GitLab-API-v3
view release on metacpan or search on metacpan
author/header.pm view on Meta::CPAN
package GitLab::API::v3;
=head1 NAME
GitLab::API::v3 - A complete GitLab API v3 client. (deprecated)
=head1 SYNOPSIS
use GitLab::API::v3;
my $api = GitLab::API::v3->new(
url => $v3_api_url,
token => $token,
);
my $branches = $api->branches( $project_id );
=head2 DEPRECATED
This module is at the end of it's life as the latest GitLab no longer supports
the v3 API. Instead, use L<GitLab::API::v4>.
=head1 DESCRIPTION
This module provides a one-to-one interface with the GitLab
API v3. Much is not documented here as it would just be duplicating
GitLab's own L<API Documentation|http://doc.gitlab.com/ce/api/README.html>.
Note that this distribution also includes the L<gitlab-api-v3> command-line
interface (CLI).
=head1 CREDENTIALS
Authentication credentials may be defined by setting either the L</token>,
the L</login> and L</password>, or the L</email> and L</password> arguments.
When the object is constructed the L</login>, L</email>, and L</password>
arguments are used to call L</session> to generate a token. The token is
saved in the L</token> attribute, and the login/email/password arguments
are discarded.
If no credentials are supplied then the client will be anonymous and greatly
limited in what it can do with the API.
=head2 CONSTANTS
Several values in the GitLab API require looking up the numeric value
for a meaning (such as C<access_level> and C<visibility_level>).
Instead of doing that, you can use L<GitLab::API::v3::Constants>.
=head2 EXCEPTIONS
The API methods will all throw (hopefully) a useful exception if
an unsuccessful response is received from the API. That is except for
C<GET> requests that return a C<404> response - these will return C<undef>
for methods that return a value.
If you'd like to catch and handle these exceptions consider using
L<Try::Tiny>.
=head2 LOGGING
This module uses L<Log::Any> and produces some debug messages here
and there, but the most useful bits are the info messages produced
just before each API call.
=head2 PROJECT ID
Note that many API calls require a C<$project_id>. This can be
specified as either a numeric project C<ID>, or as a
C<NAMESPACE_PATH/PROJECT_PATH> in many cases. Perhaps even
all cases, but the GitLab documentation on this point is vague.
=head2 RETURN VALUES
Many of this module's methods should return a value but do not
currently. This is due to the fact that this module was built
as a strict representation of GitLab's own documentation which
is often inconsistent.
If you find a method that should provide a return value, but
doesn't currently, please verify that GitLab actually does
return a value and then submit a pull request or open an issue.
See L</CONTRIBUTING> for more info.
=cut
use GitLab::API::v3::RESTClient;
use GitLab::API::v3::Paginator;
use Types::Standard -types;
use Types::Common::String -types;
use URI::Escape;
use Carp qw( croak );
use Log::Any qw( $log );
use Moo;
use strictures 1;
use namespace::clean;
around BUILDARGS => sub{
my $orig = shift;
( run in 0.531 second using v1.01-cache-2.11-cpan-140bd7fdf52 )