BZ-Client
    
    
  
  
  
view release on metacpan or search on metacpan
eg/nagios2bugzilla/talktobugzilla.pl view on Meta::CPAN
    try { if ($delete) { $log->debug('Removing file: ' .$f->basename); $f->remove() }}
    catch { $log->warn(sprintf 'Failed to delete %s because: %s', $f->basename, $_) };
    # telling nagios
    nagios_comment( @{$params}{qw( HOSTNAME SERVICEDESC )}, $newbug );
    return 1
}
sub update_bug {
    my $f = shift;
    my $bug = shift;
    my $params = shift;
    # ignore closed bugs
    unless ( $bug->is_open() ) {
        $log->info('Bug is closed, not updating');
    
  
  
  lib/BZ/Client/Bug.pm view on Meta::CPAN
    }
    $client->log('debug', $class . '::search: Found ' . join(',',@result));
    return wantarray ? @result : \@result
}
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'Bug.create', $params);
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Bug.update', $params, 'bugs');
}
sub update_see_also {
    my($class, $client, $params) = @_;
    $client->log('debug', $class . '::update_see_also: Updating See-Also');
    my $result = $class->api_call($client, 'Bug.update_see_also', $params);
    my $changes = $result->{'changes'};
    if (!$changes || 'HASH' ne ref($changes)) {
        $class->error($client, 'Invalid reply by server, expected hash of changed bug details.');
    }
    $client->log('debug', $class . '::update_see_also: Updated stuff');
    return wantarray ? %$changes : $changes
}
sub update_tags {
    my($class, $client, $params) = @_;
    $client->log('debug', $class . '::update_tags: Updating Tags');
    my $result = $class->api_call($client, 'Bug.update_tags', $params);
    my $changes = $result->{'changes'};
    if (!$changes || 'HASH' ne ref($changes)) {
        $class->error($client, 'Invalid reply by server, expected hash of changed bug details.');
    }
    $client->log('debug', $class . '::update_tags: Updated stuff');
    return wantarray ? %$changes : $changes
}
    
  
  
  lib/BZ/Client/Bug/Attachment.pm view on Meta::CPAN
        $params->{data} = BZ::Client::XMLRPC::base64->new($params->{data})
            if (exists $params->{data} and ref $params->{data} eq '');
    }
    my $result = $class->api_call($client, 'Bug.add_attachment', $params);
    my $ids = $result->{'ids'};
    $class->error($client, 'Invalid reply by server, expected attachment ID.')
        unless $ids;
    return wantarray ? @$ids : $ids
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Bug.update_attachment', $params, 'attachments');
}
## rw methods
sub id {
    my $self = shift;
    if (@_) {
    
  
  
  lib/BZ/Client/BugUserLastVisit.pm view on Meta::CPAN
package BZ::Client::BugUserLastVisit;
$BZ::Client::BugUserLastVisit::VERSION = '4.4004';
use parent qw( BZ::Client::API );
# See https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/BugUserLastVisit.html
## functions
sub update {
    my($class, $client, $params) = @_;
    my $result = $class->api_call($client, 'BugUserLastVisit.update', $params);
    return wantarray ? @$result : $result
}
sub get {
    my($class, $client, $params) = @_;
    my $result = $class->api_call($client, 'BugUserLastVisit.get', $params);
    return wantarray ? @$result : $result
}
    
  
  
  lib/BZ/Client/Component.pm view on Meta::CPAN
# See https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Component.html
# These are in order as per the above
## functions
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'Component.create', $params);
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Component.update', $params, 'components');
}
sub delete {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Component.delete', $params, 'components');
}
1;
    
  
  
  lib/BZ/Client/FlagType.pm view on Meta::CPAN
    my($class, $client, $params) = @_;
    my $result = $class->api_call($client, 'FlagType.get', $params);
    return wantarray ? %$result : $result
}
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'FlagType.create', $params, 'flag_id');
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'FlagType.update', $params, 'flagtypes');
}
1;
__END__
=pod
    
  
  
  lib/BZ/Client/Group.pm view on Meta::CPAN
# See https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Group.html
## functions
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'Group.create', $params);
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Group.update', $params, 'groups');
}
sub get {
    my($class, $client, $params) = @_;
    my $result = $class->api_call($client, 'Group.get', $params);
    return wantarray ? %$result : $result
}
    
  
  
  lib/BZ/Client/Product.pm view on Meta::CPAN
# See https://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Product.html
## functions
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'Product.create', $params);
}
sub update {
    my($class, $client, $params) = @_;
    return $class->_returns_array($client, 'Product.update', $params, 'components');
}
# convenience function
sub _get_list {
    my($class, $methodName, $client) = @_;
    my $result = $class->api_call($client, $methodName);
    my $ids = $result->{'ids'};
    if (!$ids || 'ARRAY' ne ref($ids)) {
    
  
  
  lib/BZ/Client/User.pm view on Meta::CPAN
    return wantarray ? @result : \@result
}
## methods
sub create {
    my($class, $client, $params) = @_;
    return $class->_create($client, 'User.create', $params);
}
sub update {
    my($class, $client, $params) = @_;
    $client->log('debug', $class . '::update: Updating.');
    if (defined $params->{'email_enabled'}) {
        if ($params->{'email_enabled'}) {
            $params->{'email_enabled'} = BZ::Client::XMLRPC::boolean::TRUE()
        }
        else {
            $params->{'email_enabled'} = BZ::Client::XMLRPC::boolean::FALSE()
        }
    }
    
  
  
  
( run in 0.413 second using v1.01-cache-2.11-cpan-0a6323c29d9 )