5.7.145. Bugzilla::Extension::AgileTools::WebService::Util

5.7.145.1. NAME

Bugzilla::Extension::AgileTools::WebService::Util - AgileTools WS utility functions

5.7.145.2. SYNOPSIS

use Bugzilla::Extension::AgileTools::WebService::Util;

my $object = Bugzilla::SomeObject->new($id);

my $ws_typed_hash = object_to_hash($webservice, $object,
    {
        id => "int",
        name => "string",
        date => "dateTime",
    });

my $changes = $object->update();

my $ws_typed_hash = changes_to_hash($webservice, $changes,
    {
        id => "int",
        name => "string",
        date => "dateTime",
    });

5.7.145.3. DESCRIPTION

Utility functions for webservices

5.7.145.4. FUNCTIONS

  • object_to_hash($webservice, $object, $field_types)
Description: Converts object field values in corresponding Webservice typed
             value
Params:      $webservice - WebService object
             $object - Object, which has accessor methods for corresponding
                       fields defined in $field_types
             $field_types - Hash ref which maps field name => field type
Returns:     Hash ref, where
                $field_name => WebService->type(
                        $field_type, $object->$field_name)
  • changes_to_hash($webservice, $changes, $field_types)
Description: Similar as object_to_hash, except takes changes hash returned
             by Bugzilla::Object->update() and returns hash with same
             structure and values converted to webservice type

This documentation undoubtedly has bugs; if you find some, please file them here.