GitLab-API-v3

 view release on metacpan or  search on metacpan

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

    my $variable = $api->update_variable(
        $id,
        $key,
        \%params,
    );

Sends a C<PUT> request to C</projects/:id/variables/:key> and returns the decoded/deserialized response body.

=cut

sub update_variable {
    my $self = shift;
    croak 'update_variable must be called with 2 to 3 arguments' if @_ < 2 or @_ > 3;
    croak 'The #1 argument ($id) to update_variable must be a scalar' if ref($_[0]) or (!defined $_[0]);
    croak 'The #2 argument ($key) to update_variable must be a scalar' if ref($_[1]) or (!defined $_[1]);
    croak 'The last argument (\%params) to update_variable must be a hash ref' if defined($_[2]) and ref($_[2]) ne 'HASH';
    my $params = (@_ == 3) ? pop() : undef;
    my $path = sprintf('/projects/%s/variables/%s', (map { uri_escape($_) } @_));
    return $self->put( $path, ( defined($params) ? $params : () ) );
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.525 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )