NAME

WebService::BitbucketServer::RefRestriction::V2 - Bindings for a Bitbucket Server REST API

VERSION

version 0.600

SYNOPSIS

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

DESCRIPTION

This is a Bitbucket Server REST API for RefRestriction::V2.

Original API documentation created by and copyright Atlassian.

ATTRIBUTES

context

Get the instance of WebService::BitbucketServer passed to "new".

METHODS

new

    $api = WebService::BitbucketServer::RefRestriction::V2->new(context => $webservice_bitbucketserver_obj);

Create a new API.

Normally you would use $webservice_bitbucketserver_obj->ref_restriction instead.

create_restrictions_for_repository

Allows creating multiple restrictions at once.

    POST branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions

Responses:

  • 200 - restriction, type: application/json

    Response contains the ref restrictions that were just created.

  • 400 - errors, type: application/json

    The request has failed validation.

  • 401 - validation, type: application/json

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

get_restrictions_for_repository

Search for restrictions using the supplied parameters.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    GET branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions

Parameters:

  • type - string, default: none

    (optional) types of restrictions to filter on: one of 'read-only', 'no-deletes', 'fast-forward-only' or 'pull-request-only'.

  • matcherType - string, default: none

    (optional) matcher type to filter on: one of 'BRANCH', 'PATTERN', 'MODEL_CATEGORY' or 'MODEL_BRANCH'.

  • matcherId - string, default: none

    (optional) matcher id to filter on. Requires the matcherType parameter to be specified also.

Responses:

  • 200 - page, type: application/json

  • 404 - not-found, type: application/json

    The restriction could not be found.

get_restriction_for_repository

Returns a restriction as specified by a restriction id.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    GET branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}

Parameters:

  • id - int, default: none

Responses:

  • 200 - restriction, type: application/json

    The restriction that was created

  • 404 - not-found, type: unknown

    The restriction could not be found.

delete_restriction_for_repository

Deletes a restriction as specified by a restriction id.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    DELETE branch-permissions/2.0/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}

Parameters:

  • id - int, default: none

Responses:

  • 204 - data, type: unknown

    an empty response indicating that the restriction no longer exists on the repository

create_restriction

Allows creating multiple restrictions at once.

    POST branch-permissions/2.0/projects/{projectKey}/restrictions

Responses:

  • 200 - restriction, type: application/json

    Response contains the ref restrictions that were just created.

  • 400 - errors, type: application/json

    The request has failed validation.

  • 401 - validation, type: application/json

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

get_restrictions

Search for restrictions using the supplied parameters.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    GET branch-permissions/2.0/projects/{projectKey}/restrictions

Parameters:

  • type - string, default: none

    (optional) types of restrictions to filter on: one of 'read-only', 'no-deletes', 'fast-forward-only' or 'pull-request-only'.

  • matcherType - string, default: none

    (optional) matcher type to filter on: one of 'BRANCH', 'PATTERN', 'MODEL_CATEGORY' or 'MODEL_BRANCH'.

  • matcherId - string, default: none

    (optional) matcher id to filter on. Requires the matcherType parameter to be specified also.

Responses:

  • 200 - page, type: application/json

  • 404 - not-found, type: application/json

    The restriction could not be found.

get_restriction

Returns a restriction as specified by a restriction id.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    GET branch-permissions/2.0/projects/{projectKey}/restrictions/{id}

Parameters:

  • id - int, default: none

Responses:

  • 200 - restriction, type: application/json

    The restriction that was created

  • 404 - not-found, type: unknown

    The restriction could not be found.

delete_restriction

Deletes a restriction as specified by a restriction id.

The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

    DELETE branch-permissions/2.0/projects/{projectKey}/restrictions/{id}

Parameters:

  • id - int, default: none

Responses:

  • 204 - data, type: unknown

    an empty response indicating that the restriction no longer exists on the project

SEE ALSO

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/chazmcgarvey/WebService-BitbucketServer/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Charles McGarvey <ccm@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Charles McGarvey.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.