GitLab-API-v3

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


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 ["CONTRIBUTING"](#contributing) for more info.

# REQUIRED ARGUMENTS

## url

The URL to your v3 API endpoint.  Typically this will be something
like `http://git.example.com/api/v3`.

# OPTIONAL ARGUMENTS

## token

A GitLab API token.
If set then neither ["login"](#login) or ["email"](#email) may be set.
Read more in ["CREDENTIALS"](#credentials).

author/README.pod  view on Meta::CPAN

generating the documentation.  If no return variable is declared
then the subroutine will return an empty list no matter what
the API response returns.

=head2 HTTP_METHOD

One of GET, POST, PUT, or DELETE.

=head2 PATH

The path to the API endpoint (after the /api/v3 bit).
The path is a list of static and dynamic strings separate by
forward slashes.  So, if you have:

    /foo/:bar/baz

Then the API subroutine would require one argument which would
be injected in place of C<:bar>.

=head2 ?

If the PATH ends with a C<?> then this signifies that the API
endpoint accepts query parameters.

=head1 GENERATING

To generate C<lib/GitLab/API/v3.pm> do this:

    cd author
    perl generate.pl > ../lib/GitLab/API/v3.pm

=cut

author/generate.pl  view on Meta::CPAN

my $footer = path('footer.pm')->slurp();
my $config = YAML::XS::Load( path('config.yml')->slurp() );

print $header;

foreach my $section_pack (@{ $config->{sections} }) {
foreach my $section_name (keys %$section_pack) {
    my $section = $section_pack->{$section_name};

    my $file = $dir->child("$section_name.yml");
    my $endpoints = YAML::XS::Load( $file->slurp() );

    print "=head1 $section->{head}\n\n";
    print "See L<$section->{doc_url}>.\n\n";

    foreach my $endpoint_pack (@$endpoints) {
    foreach my $sub (keys %$endpoint_pack) {
        my $spec = $endpoint_pack->{$sub};

        my ($return, $method, $path, $params_ok);
        if ($spec =~ m{^(?:(\S+) = |)(GET|POST|PUT|DELETE) (\S+?)(\??)$}) {
            ($return, $method, $path, $params_ok) = ($1, $2, $3, $4);
        }
        else {
            die "Invalid spec ($sub): $spec";
        }

        print "=head2 $sub\n\n";

author/header.pm  view on Meta::CPAN

        'PRIVATE-TOKEN' => $self->token(),
    ) if $self->has_token();

    return;
}

=head1 REQUIRED ARGUMENTS

=head2 url

The URL to your v3 API endpoint.  Typically this will be something
like C<http://git.example.com/api/v3>.

=cut

has url => (
    is       => 'ro',
    isa      => NonEmptySimpleStr,
    required => 1,
);

lib/GitLab/API/v3.pm  view on Meta::CPAN

        'PRIVATE-TOKEN' => $self->token(),
    ) if $self->has_token();

    return;
}

=head1 REQUIRED ARGUMENTS

=head2 url

The URL to your v3 API endpoint.  Typically this will be something
like C<http://git.example.com/api/v3>.

=cut

has url => (
    is       => 'ro',
    isa      => NonEmptySimpleStr,
    required => 1,
);



( run in 1.628 second using v1.01-cache-2.11-cpan-2b1a40005be )