t that does the heavy lifting.
=head1 DESCRIPTION
Currently this class uses L<HTTP::Tiny> and L<JSON::MaybeXS> to do its job.
This may change, and the interface may change, so documentation is lacki
rror when making the request
=cut
use Carp qw();
use HTTP::Tiny::Multipart;
use HTTP::Tiny;
use JSON::MaybeXS;
use Log::Any qw( $log );
use Path::Tiny;
use Try::Tiny;
use Types::Common::Numeric -typ
n HTTP::Tiny->new( verify_SSL => 1 );
}
has json => (
is => 'lazy',
isa => HasMethods[ 'encode', 'decode' ],
);
sub _build_json {
return JSON::MaybeXS->new(utf8 => 1, allow_nonref => 1);
.
This module is used by L<GitLab::API::v4::Mock>.
=cut
use GitLab::API::v4::Mock::Engine;
use JSON::MaybeXS;
use URI;
use Moo;
use strictures 2;
use namespace::clean;
extends 'GitLab::API::v4::R
[$http_method, $url, $options],
@captures,
);
$content = encode_json( $content ) if ref $content;
return {
status => $status,
success
.
=cut
has_endpoint POST => qr{^users$}, sub{
my ($self, $req) = @_;
my $user = decode_json( $req->[2]->{content} );
$self->engine->create_user( $user );
return 204;
};
=head2 PUT
to explicitly use it as shown in the
L</SYNOPSIS>.
=cut
use Getopt::Long;
use IO::Prompter;
use JSON::MaybeXS;
use Log::Any qw( $log );
use Path::Tiny;
use Types::Common::String -types;
use Types::S
=head1 ARGUMENTS
=head2 file
The file to load configuration from. The file should hold valid JSON.
By default this will be set to C<.gitlab-api-v4-config> in the current
user's home directory.
I_V4_RETRIES},
});
}
=head2 file_args
Returns a hashref of arguments gotten by decoding the JSON in the L</file>.
=cut
has file_args => (
is => 'lazy',
isa => HashRef,
);
sub _build_f