@@ -7321,7 +7321,6 @@ sub create_project_for_user {
7321
7321
$api->edit_project(
7322
7322
$project_id,
7323
7323
\%params,
7324
- \%params_multipart,
7325
7324
);
7326
7325
7327
7326
Sends a C<PUT > request to C<projects/:project_id > .
@@ -7330,21 +7329,40 @@ Sends a C<PUT> request to C<projects/:project_id>.
7330
7329
7331
7330
sub edit_project {
7332
7331
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 ;
7334
7333
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' ;
7338
7335
my $params = (@_ == 2) ? pop () : undef ;
7339
7336
my $options = {};
7340
7337
$options -> {decode } = 0;
7341
7338
$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
+ }
7343
7342
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 );
7348
7366
return ;
7349
7367
}
7350
7368
0 commit comments