WebService-BitbucketServer

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

lib/WebService/BitbucketServer/WADL.pm
maint/regenerate_apis.pl
shares/spec/submap_access_tokens.pl
shares/spec/submap_audit.pl
shares/spec/submap_branch.pl
shares/spec/submap_build.pl
shares/spec/submap_comment_likes.pl
shares/spec/submap_core.pl
shares/spec/submap_default_reviewers.pl
shares/spec/submap_git.pl
shares/spec/submap_gpg.pl
shares/spec/submap_jira.pl
shares/spec/submap_mirroring_upstream.pl
shares/spec/submap_ref_restriction.pl
shares/spec/submap_repository_ref_sync.pl
shares/spec/submap_ssh.pl
t/00-compile.t
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/01-accessors.t
t/10-request.t

README  view on Meta::CPAN

    Get the WebService::BitbucketServer::CommentLikes::V1 api.

 default_reviewers

    Get the WebService::BitbucketServer::DefaultReviewers::V1 api.

 git

    Get the WebService::BitbucketServer::Git::V1 api.

 gpg

    Get the WebService::BitbucketServer::GPG::V1 api.

 jira

    Get the WebService::BitbucketServer::JIRA::V1 api.

 ssh

    Get the WebService::BitbucketServer::SSH::V1 api.

lib/WebService/BitbucketServer.pm  view on Meta::CPAN

Get the L<WebService::BitbucketServer::CommentLikes::V1> api.

=head2 default_reviewers

Get the L<WebService::BitbucketServer::DefaultReviewers::V1> api.

=head2 git

Get the L<WebService::BitbucketServer::Git::V1> api.

=head2 gpg

Get the L<WebService::BitbucketServer::GPG::V1> api.

=head2 jira

Get the L<WebService::BitbucketServer::JIRA::V1> api.

=head2 ssh

Get the L<WebService::BitbucketServer::SSH::V1> api.

lib/WebService/BitbucketServer/GPG/V1.pm  view on Meta::CPAN

    return delete $args->{$name} if defined $args->{$name};
    $name =~ s/([A-Z])/'_'.lc($1)/eg;
    return delete $args->{$name} if defined $args->{$name};
    _croak("Missing required parameter $name");
}


sub delete_keys {
    my $self = shift;
    my $args = {@_ == 1 ? %{$_[0]} : @_};
    my $url  = _get_url('gpg/1.0/keys', $args);
    my $data = (exists $args->{data} && $args->{data}) || (%$args && $args);
    $self->context->call(method => 'DELETE', url => $url, $data ? (data => $data) : ());
}


sub get_keys {
    my $self = shift;
    my $args = {@_ == 1 ? %{$_[0]} : @_};
    my $url  = _get_url('gpg/1.0/keys', $args);
    my $data = (exists $args->{data} && $args->{data}) || (%$args && $args);
    $self->context->call(method => 'GET', url => $url, $data ? (data => $data) : ());
}


sub add_key {
    my $self = shift;
    my $args = {@_ == 1 ? %{$_[0]} : @_};
    my $url  = _get_url('gpg/1.0/keys', $args);
    my $data = (exists $args->{data} && $args->{data}) || (%$args && $args);
    $self->context->call(method => 'POST', url => $url, $data ? (data => $data) : ());
}


sub delete_key {
    my $self = shift;
    my $args = {@_ == 1 ? %{$_[0]} : @_};
    my $url  = _get_url('gpg/1.0/keys/{fingerprintOrId}', $args);
    my $data = (exists $args->{data} && $args->{data}) || (%$args && $args);
    $self->context->call(method => 'DELETE', url => $url, $data ? (data => $data) : ());
}


1;

__END__

=pod

lib/WebService/BitbucketServer/GPG/V1.pm  view on Meta::CPAN


version 0.605

=head1 SYNOPSIS

    my $stash = WebService::BitbucketServer->new(
        base_url    => 'https://stash.example.com/',
        username    => 'bob',
        password    => 'secret',
    );
    my $api = $stash->gpg;

=head1 DESCRIPTION

This is a Bitbucket Server REST API for L<GPG::V1|https://developer.atlassian.com/static/rest/bitbucket-server/5.8.3/bitbucket-gpg-rest.html>.

Original API documentation created by and copyright Atlassian.

=head1 ATTRIBUTES

=head2 context

Get the instance of L<WebService::BitbucketServer> passed to L</new>.

=head1 METHODS

=head2 new

    $api = WebService::BitbucketServer::GPG::V1->new(context => $webservice_bitbucketserver_obj);

Create a new API.

Normally you would use C<<< $webservice_bitbucketserver_obj->gpg >>> instead.

=head2 delete_keys

Delete all GPG keys for a supplied user.

    DELETE gpg/1.0/keys

Parameters:

=over 4

=item * C<<< user >>> - string, default: none

the username of the user to delete the keys for. If no username is specified, the GPG keys will
be deleted for the currently authenticated user.

lib/WebService/BitbucketServer/GPG/V1.pm  view on Meta::CPAN


=back

=head2 get_keys

Find all the keys for the currently authenticated user. Optionally, users with ADMIN and higher permissions
may choose to specify the C<<< user >>> parameter to retrieve GPG keys for another user.

Only authenticated users may call this endpoint.

    GET gpg/1.0/keys

Parameters:

=over 4

=item * C<<< user >>> - string, default: none

the name of the user to get keys for (optional; requires ADMIN permission or higher)

=back

lib/WebService/BitbucketServer/GPG/V1.pm  view on Meta::CPAN


=back

=head2 add_key

Add a GPG key to the authenticated user's account. Optionally, users with ADMIN and higher permissions may choose
to specify the C<<< user >>> parameter to add a GPG key for another user.

Only authenticated users may call this endpoint.

    POST gpg/1.0/keys

Parameters:

=over 4

=item * C<<< user >>> - string, default: none

the name of the user to add a key for (optional; requires ADMIN permission or higher)

=back

Responses:

=over 4

=item * C<<< 200 >>> - gpgKey, type: application/json

Response contains the GPG key that was just created.

=item * C<<< 400 >>> - validation, type: application/json

The request has failed validation.

=item * C<<< 401 >>> - errors, type: application/json

The currently authenticated user has insufficient permissions to perform this operation.

=back

=head2 delete_key

Delete the GPG key with the specified ID or Key Fingerprint.

Only authenticated users may call this endpoint.

    DELETE gpg/1.0/keys/{fingerprintOrId}

Parameters:

=over 4

=item * C<<< fingerprintOrId >>> - string, default: none

=back

Responses:

lib/WebService/BitbucketServer/Spec.pm  view on Meta::CPAN

    'default-reviewers/1.0'     => {
        id                      => 'default_reviewers',
        documentation_filename  => 'bitbucket-default-reviewers-rest',
        package                 => 'DefaultReviewers::V1',
    },
    'git/1.0'                   => {
        id                      => 'git',
        documentation_filename  => 'bitbucket-git-rest',
        package                 => 'Git::V1',
    },
    'gpg/1.0'                   => {
        id                      => 'gpg',
        documentation_filename  => 'bitbucket-gpg-rest',
        package                 => 'GPG::V1',
    },
    'jira/1.0'                  => {
        id                      => 'jira',
        documentation_filename  => 'bitbucket-jira-rest',
        package                 => 'JIRA::V1',
    },
    'ssh/1.0'                  => {
        id                      => 'ssh',
        documentation_filename  => 'bitbucket-ssh-rest',

shares/spec/submap_gpg.pl  view on Meta::CPAN

# Map endpoints to subroutine names in GPG::V1.
use strict;
{
    'gpg/1.0/keys DELETE' => 'delete_keys',
    'gpg/1.0/keys GET' => 'get_keys',
    'gpg/1.0/keys POST' => 'add_key',
    'gpg/1.0/keys/{fingerprintOrId} DELETE' => 'delete_key',
};

t/01-accessors.t  view on Meta::CPAN


    access_tokens
    core
    audit
    ref_restriction
    branch
    build
    comment_likes
    default_reviewers
    git
    gpg
    jira
    ssh
    mirroring_upstream
    repository_ref_sync
);
can_ok($api, @api_accessors);



( run in 2.249 seconds using v1.01-cache-2.11-cpan-df04353d9ac )