NAME
GitLab::API::v3 - GitLab API v3 client.
SYNOPSIS
use GitLab::API::v3;
my $api = GitLab::API::v3->new(
url => $v3_api_url,
token => $token,
);
my $branches = $api->branches( $project_id );
DESCRIPTION
This module provides a one-to-one interface with the GitLab API v3. Little is documented here as it would just be duplicating GitLab's own API Documentation.
Currently only the branches set of API handlers is supported. More are coming shortly (release early, release often).
REQUIRED ARGUMENTS
url
The URL to your v3 API endpoint. Typically this will be something like http://git.example.com/api/v3
.
token
A GitLab API token.
OPTIONAL ARGUMENTS
rest_client
An instance of GitLab::API::v3::RESTClient
. Typically you will not be setting this as it defaults to a new instance and customization should not be necessary.
BRANCH METHODS
branches
my $branches = $api->branches( $project_id );
Returns an array ref of branch hash refs.
branch
my $branch = $api->branch( $project_id, $branch_name );
Returns a branch hash ref.
protect_branch
$api->protect_branch( $project_id, $branch_name );
Marks a branch as protected.
unprotect_branch
$api->unprotect_branch( $project_id, $branch_name );
Marks a branch as not protected.
create_branch
my $branch = $api->create_branch(
$project_id,
branch_name => $branch_name,
ref => $ref,
);
Creates a branch and returns the hash ref for it.
delete_branch
$api->delete_branch(
$project_id,
$branch_name,
);
Deletes the specified branch.
AUTHOR
Aran Clary Deltac <bluefeet@gmail.com>
ACKNOWLEDGEMENTS
Thanks to ZipRecruiter for encouraging their employees to contribute back to the open source ecosystem. Without their dedication to quality software development this distribution would not exist.
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.