@@ -7321,7 +7321,6 @@ sub create_project_for_user {
73217321 $api->edit_project(
73227322 $project_id,
73237323 \%params,
7324- \%params_multipart,
73257324 );
73267325
73277326Sends a C<PUT > request to C<projects/:project_id > .
@@ -7330,21 +7329,40 @@ Sends a C<PUT> request to C<projects/:project_id>.
73307329
73317330sub edit_project {
73327331 my $self = shift ;
7333- croak ' edit_project must be called with 1 to 3 arguments' if @_ < 1 or @_ > 3 ;
7332+ croak ' edit_project must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2 ;
73347333 croak ' The #1 argument ($project_id) to edit_project must be a scalar' if ref ($_ [0]) or (!defined $_ [0]);
7335- croak ' The #2 argument (\%params) to edit_project must be a hash ref' if defined ($_ [1]) and ref ($_ [1]) ne ' HASH' ;
7336- croak ' The last argument (\%params_multipart) to edit_project must be a hash ref' if defined ($_ [2]) and ref ($_ [2]) ne ' HASH' ;
7337- my $params_multipart = (@_ == 3) ? pop () : undef ;
7334+ croak ' The last argument (\%params) to edit_project must be a hash ref' if defined ($_ [1]) and ref ($_ [1]) ne ' HASH' ;
73387335 my $params = (@_ == 2) ? pop () : undef ;
73397336 my $options = {};
73407337 $options -> {decode } = 0;
73417338 $options -> {content } = $params if defined $params ;
7342- $self -> _call_rest_client( ' PUT' , ' projects/:project_id' , [$_ [0]], $options );
7339+ $self -> _call_rest_client( ' PUT' , ' projects/:project_id' , [@_ ], $options );
7340+ return ;
7341+ }
73437342
7344- if (keys %$params_multipart ) {
7345- $options -> {content }-> {file } = $params_multipart ;
7346- $self -> _call_rest_client( ' PUT' , ' projects/:project_id' , [$_ [0]], $options );
7347- }
7343+ =item edit_project_multipart
7344+
7345+ $api->edit_project_multipart(
7346+ $project_id,
7347+ \%params,
7348+ );
7349+
7350+ Sends a C<PUT > request to C<projects/:project_id > .
7351+
7352+ The request will have "multipart/form-data" header set for uploading files.
7353+ =cut
7354+
7355+ sub edit_project_multipart {
7356+ my $self = shift ;
7357+ croak ' edit_project_multipart must be called with 1 to 2 arguments' if @_ < 1 or @_ > 2;
7358+ croak ' The #1 argument ($project_id) to edit_project_multipart must be a scalar' if ref ($_ [0]) or (!defined $_ [0]);
7359+ croak ' The last argument (\%params) to edit_project_multipart must be a hash ref' if defined ($_ [1]) and ref ($_ [1]) ne ' HASH' ;
7360+ my $params = (@_ == 2) ? pop () : undef ;
7361+ my $options = {};
7362+ $options -> {decode } = 0;
7363+ $options -> {content } = $params if defined $params ;
7364+ $options -> {content }-> {file } = $params ;
7365+ $self -> _call_rest_client( ' PUT' , ' projects/:project_id' , [@_ ], $options );
73487366 return ;
73497367}
73507368
0 commit comments