NAME

WebService::BitbucketServer::Branch::V1 - 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->branch;

DESCRIPTION

This is a Bitbucket Server REST API for Branch::V1.

Original API documentation created by and copyright Atlassian.

ATTRIBUTES

context

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

METHODS

new

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

Create a new API.

Normally you would use $webservice_bitbucketserver_obj->branch instead.

delete_branch

Deletes a branch in the specified repository.

If the branch does not exist, this operation will not raise an error. In other words after calling this resource and receiving a 204 response the branch provided in the request is guaranteed to not exist in the specified repository any more, regardless of its existence beforehand.

The optional 'endPoint' parameter of the request may contain a commit ID that the provided ref name is expected to point to. Should the ref point to a different commit ID, a 400 response will be returned with appropriate error details.

The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be deleted.

    DELETE branch-utils/1.0/projects/{projectKey}/repos/{repositorySlug}/branches

Responses:

  • 400 - errors, type: application/json

    the branch was not deleted because the request was invalid, e.g. no ref name to delete was provided, or the provided ref name points to the default branch in the repository that cannot be deleted

  • 401 - errors, type: application/json

    The currently authenticated user has insufficient permissions to delete a branch. This could be due to insufficient repository permissions, or lack of branch permission for the provided ref name.

  • 204 - data, type: unknown

    an empty response indicating that the branch no longer exists in the repository

create_branch

Creates a branch in the specified repository.

The authenticated user must have an effective REPO_WRITE permission to call this resource. If branch permissions are set up in the repository, the authenticated user must also have access to the branch name that is to be created.

    POST branch-utils/1.0/projects/{projectKey}/repos/{repositorySlug}/branches

Responses:

  • 201 - data, type: application/json

    a JSON representation of the newly created branch

  • 400 - errors, type: application/json

    the branch was not created because the request was invalid, e.g. the provided ref name already existed in the repository, or was not a valid ref name in the repository

  • 401 - errors, type: application/json

    The currently authenticated user has insufficient permissions to create a branch. This could be due to insufficient repository permissions, or lack of branch permission for the provided ref name

find_branch_info_by_commit

Gets the branch information associated with a single commit from a given repository.

    GET branch-utils/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/info/{commitId}

Parameters:

  • commitId - string, default: none

    full SHA1 of the commit (ex: e00cf62997a027bbf785614a93e2e55bb331d268)

Responses:

  • 200 - data, type: application/json

    a page of branch refs associated with the commit

  • 500 - errors, type: application/json

    The request has timed out processing the branch request

get_branch_model

Get the {@link BranchModel} associated with the repository.

The authenticated user must have the REPO_READ (or higher) permission for the specified repository to call this resource.

    GET branch-utils/1.0/projects/{projectKey}/repos/{repositorySlug}/branchmodel

Responses:

  • 200 - data, type: application/json

    The branch model associated with the specified repository.

  • 401 - errors, type: application/json

    The currently authenticated user does not have sufficient permission (REPO_READ) to query the branch model of the repository.

  • 409 - errors, type: application/json

    The specified repository is empty - the branch model cannot be constructed

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.