GitLab-API-v4
view release on metacpan or search on metacpan
lib/GitLab/API/v4.pm view on Meta::CPAN
Sends a C<POST> request to C<users/:user_id/keys>.
=cut
sub create_user_ssh_key {
my $self = shift;
croak 'create_user_ssh_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
croak 'The #1 argument ($user_id) to create_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The last argument (\%params) to create_user_ssh_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH';
my $params = (@_ == 2) ? pop() : undef;
my $options = {};
$options->{decode} = 0;
$options->{content} = $params if defined $params;
$self->_call_rest_client( 'POST', 'users/:user_id/keys', [@_], $options );
return;
}
=item delete_current_user_ssh_key
$api->delete_current_user_ssh_key(
$key_id,
);
Sends a C<DELETE> request to C<user/keys/:key_id>.
=cut
sub delete_current_user_ssh_key {
my $self = shift;
croak 'delete_current_user_ssh_key must be called with 1 arguments' if @_ != 1;
croak 'The #1 argument ($key_id) to delete_current_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
my $options = {};
$options->{decode} = 0;
$self->_call_rest_client( 'DELETE', 'user/keys/:key_id', [@_], $options );
return;
}
=item delete_user_ssh_key
$api->delete_user_ssh_key(
$user_id,
$key_id,
);
Sends a C<DELETE> request to C<users/:user_id/keys/:key_id>.
=cut
sub delete_user_ssh_key {
my $self = shift;
croak 'delete_user_ssh_key must be called with 2 arguments' if @_ != 2;
croak 'The #1 argument ($user_id) to delete_user_ssh_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The #2 argument ($key_id) to delete_user_ssh_key must be a scalar' if ref($_[1]) or (!defined $_[1]);
my $options = {};
$options->{decode} = 0;
$self->_call_rest_client( 'DELETE', 'users/:user_id/keys/:key_id', [@_], $options );
return;
}
=item current_user_gpg_keys
my $keys = $api->current_user_gpg_keys(
\%params,
);
Sends a C<GET> request to C<user/gpg_keys> and returns the decoded response content.
=cut
sub current_user_gpg_keys {
my $self = shift;
croak 'current_user_gpg_keys must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1;
croak 'The last argument (\%params) to current_user_gpg_keys must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH';
my $params = (@_ == 1) ? pop() : undef;
my $options = {};
$options->{query} = $params if defined $params;
return $self->_call_rest_client( 'GET', 'user/gpg_keys', [@_], $options );
}
=item current_user_gpg_key
my $key = $api->current_user_gpg_key(
$key_id,
);
Sends a C<GET> request to C<user/gpg_keys/:key_id> and returns the decoded response content.
=cut
sub current_user_gpg_key {
my $self = shift;
croak 'current_user_gpg_key must be called with 1 arguments' if @_ != 1;
croak 'The #1 argument ($key_id) to current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
my $options = {};
return $self->_call_rest_client( 'GET', 'user/gpg_keys/:key_id', [@_], $options );
}
=item create_current_user_gpg_key
$api->create_current_user_gpg_key(
\%params,
);
Sends a C<POST> request to C<user/gpg_keys>.
=cut
sub create_current_user_gpg_key {
my $self = shift;
croak 'create_current_user_gpg_key must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1;
croak 'The last argument (\%params) to create_current_user_gpg_key must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH';
my $params = (@_ == 1) ? pop() : undef;
my $options = {};
$options->{decode} = 0;
$options->{content} = $params if defined $params;
$self->_call_rest_client( 'POST', 'user/gpg_keys', [@_], $options );
return;
}
=item delete_current_user_gpg_key
$api->delete_current_user_gpg_key(
$key_id,
);
Sends a C<DELETE> request to C<user/gpg_keys/:key_id>.
=cut
sub delete_current_user_gpg_key {
my $self = shift;
croak 'delete_current_user_gpg_key must be called with 1 arguments' if @_ != 1;
croak 'The #1 argument ($key_id) to delete_current_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
my $options = {};
$options->{decode} = 0;
$self->_call_rest_client( 'DELETE', 'user/gpg_keys/:key_id', [@_], $options );
return;
}
=item user_gpg_keys
my $keys = $api->user_gpg_keys(
$user_id,
\%params,
);
Sends a C<GET> request to C<users/:user_id/gpg_keys> and returns the decoded response content.
=cut
sub user_gpg_keys {
my $self = shift;
croak 'user_gpg_keys must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
croak 'The #1 argument ($user_id) to user_gpg_keys must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The last argument (\%params) to user_gpg_keys must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH';
my $params = (@_ == 2) ? pop() : undef;
my $options = {};
$options->{query} = $params if defined $params;
return $self->_call_rest_client( 'GET', 'users/:user_id/gpg_keys', [@_], $options );
}
=item user_gpg_key
my $key = $api->user_gpg_key(
$user_id,
$key_id,
);
Sends a C<GET> request to C<users/:user_id/gpg_keys/:key_id> and returns the decoded response content.
=cut
sub user_gpg_key {
my $self = shift;
croak 'user_gpg_key must be called with 2 arguments' if @_ != 2;
croak 'The #1 argument ($user_id) to user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The #2 argument ($key_id) to user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]);
my $options = {};
return $self->_call_rest_client( 'GET', 'users/:user_id/gpg_keys/:key_id', [@_], $options );
}
=item create_user_gpg_key
my $keys = $api->create_user_gpg_key(
$user_id,
\%params,
);
Sends a C<POST> request to C<users/:user_id/gpg_keys> and returns the decoded response content.
=cut
sub create_user_gpg_key {
my $self = shift;
croak 'create_user_gpg_key must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
croak 'The #1 argument ($user_id) to create_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The last argument (\%params) to create_user_gpg_key must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH';
my $params = (@_ == 2) ? pop() : undef;
my $options = {};
$options->{content} = $params if defined $params;
return $self->_call_rest_client( 'POST', 'users/:user_id/gpg_keys', [@_], $options );
}
=item delete_user_gpg_key
$api->delete_user_gpg_key(
$user_id,
$key_id,
);
Sends a C<DELETE> request to C<users/:user_id/gpg_keys/:key_id>.
=cut
sub delete_user_gpg_key {
my $self = shift;
croak 'delete_user_gpg_key must be called with 2 arguments' if @_ != 2;
croak 'The #1 argument ($user_id) to delete_user_gpg_key must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The #2 argument ($key_id) to delete_user_gpg_key must be a scalar' if ref($_[1]) or (!defined $_[1]);
my $options = {};
$options->{decode} = 0;
$self->_call_rest_client( 'DELETE', 'users/:user_id/gpg_keys/:key_id', [@_], $options );
return;
}
=item current_user_emails
my $emails = $api->current_user_emails(
\%params,
);
Sends a C<GET> request to C<user/emails> and returns the decoded response content.
=cut
sub current_user_emails {
my $self = shift;
croak 'current_user_emails must be called with 0 to 1 arguments' if @_ < 0 or @_ > 1;
croak 'The last argument (\%params) to current_user_emails must be a hash ref' if defined($_[0]) and ref($_[0]) ne 'HASH';
my $params = (@_ == 1) ? pop() : undef;
my $options = {};
$options->{query} = $params if defined $params;
return $self->_call_rest_client( 'GET', 'user/emails', [@_], $options );
}
=item user_emails
my $emails = $api->user_emails(
$user_id,
\%params,
);
Sends a C<GET> request to C<users/:user_id/emails> and returns the decoded response content.
=cut
sub user_emails {
my $self = shift;
croak 'user_emails must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
croak 'The #1 argument ($user_id) to user_emails must be a scalar' if ref($_[0]) or (!defined $_[0]);
croak 'The last argument (\%params) to user_emails must be a hash ref' if defined($_[1]) and ref($_[1]) ne 'HASH';
my $params = (@_ == 2) ? pop() : undef;
my $options = {};
$options->{query} = $params if defined $params;
return $self->_call_rest_client( 'GET', 'users/:user_id/emails', [@_], $options );
}
=item current_user_email
my $email = $api->current_user_email(
$email_id,
);
Sends a C<GET> request to C<user/emails/:email_id> and returns the decoded response content.
=cut
sub current_user_email {
my $self = shift;
croak 'current_user_email must be called with 1 arguments' if @_ != 1;
croak 'The #1 argument ($email_id) to current_user_email must be a scalar' if ref($_[0]) or (!defined $_[0]);
my $options = {};
( run in 1.324 second using v1.01-cache-2.11-cpan-df04353d9ac )