StorageApi.pm untested

filter: Statementstmt 0.0% 0 / 505 Branchbran 0.0% 0 / 174 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 25 Podpod 0.0% 0 / 16 totaltotal 0.0% 0 / 729 CC 88 SCAR 39.5
CC
88
Cov
0%
diagram_storage_file_copy_src_path_put
90.0
diagram_storage_file_move_src_path_put
90.0
diagram_storage_file_path_put
72.0
CRAP 52.0
1 =begin comment
2
3 Aspose.Diagram Cloud API Reference
4
5 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
7 OpenAPI spec version: 3.0
8
9 Generated by: https://github.com/swagger-api/swagger-codegen.git
10
11 =end comment
12
13 =cut
14
15 #
16 # NOTE: This class is auto generated by the swagger code generator program.
17 # Do not edit the class manually.
18 # Ref: https://github.com/swagger-api/swagger-codegen
19 #
20 package AsposeDiagramCloud::StorageApi;
21
22 require 5.6.0;
23 use strict;
24 use warnings;
25 use utf8;
26 use Exporter;
27 use Carp qw( croak );
28 use Log::Any qw($log);
29
30 use AsposeDiagramCloud::ApiClient;
31
32 use base "Class::Data::Inheritable";
33
34 __PACKAGE__->mk_classdata('method_documentation' => {});
35
36 sub new {
37 my $class = shift;
38 my $api_client;
39
40 if ($_[0] && ref $_[0] && ref $_[0] eq 'AsposeDiagramCloud::ApiClient' ) {
41 $api_client = $_[0];
42 } else {
43 $api_client = AsposeDiagramCloud::ApiClient->new(@_);
44 }
45
46 my $access_token = $api_client->o_auth_post('grant_type' => "client_credentials", 'client_id' => $api_client->{config}->{app_sid}, 'client_secret' =>$api_client->{config}->{app_key})->access_token;
47 $api_client->{config}->{access_token} = $access_token;
48 my $base_url = $api_client->{config}->{base_url};
49
50 if( substr( $base_url,length($base_url)-1,1) eq '/'){
51 $base_url = $base_url . $api_client->{config}->{api_version};
52 }else{
53 $base_url = $base_url . '/'.$api_client->{config}->{api_version};
54 }
55
56 $api_client->{config}->{base_url} = $base_url;
57
58 bless { api_client => $api_client }, $class;
59
60 }
61
62
63 #
64 # diagram_storage_disc_get
65 #
66 # Get disc usage
67 #
68 # @param string $storage_name Storage name (optional)
69 {
70 my $params = {
71 'storage_name' => {
72 data_type => 'string',
73 description => 'Storage name',
74 required => '0',
75 },
76 };
77 __PACKAGE__->method_documentation->{ 'diagram_storage_disc_get' } = {
78 summary => 'Get disc usage',
79 params => $params,
80 returns => 'DiscUsage',
81 };
82 }
83 # @return DiscUsage
84 #
85 sub diagram_storage_disc_get {
86 my ($self, %args) = @_;
87
88 # parse inputs
89 my $_resource_path = '/diagram/storage/disc';
90
91 my $_method = 'GET';
92 my $query_params = {};
93 my $header_params = {};
94 my $form_params = {};
95
96 # 'Accept' and 'Content-Type' header
97 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
98 if ($_header_accept) {
99 $header_params->{'Accept'} = $_header_accept;
100 }
101 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
102
103 # query params
104 if ( exists $args{'storage_name'}) {
105 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
106 }
107
108 my $_body_data;
109 # authentication setting, if any
110 my $auth_settings = [qw(JWT )];
111
112 # make the API Call
113 my $response = $self->{api_client}->call_api($_resource_path, $_method,
114 $query_params, $form_params,
115 $header_params, $_body_data, $auth_settings);
116 if (!$response) {
117 return;
118 }
119 my $_response_object = $self->{api_client}->deserialize('DiscUsage', $response);
120 return $_response_object;
121 }
122
123 #
124 # diagram_storage_exist_path_get
125 #
126 # Check if file or folder exists
127 #
128 # @param string $path File or folder path e.g. '/file.ext' or '/folder' (required)
129 # @param string $storage_name Storage name (optional)
130 # @param string $version_id File version ID (optional)
131 {
132 my $params = {
133 'path' => {
134 data_type => 'string',
135 description => 'File or folder path e.g. '/file.ext' or '/folder'',
136 required => '1',
137 },
138 'storage_name' => {
139 data_type => 'string',
140 description => 'Storage name',
141 required => '0',
142 },
143 'version_id' => {
144 data_type => 'string',
145 description => 'File version ID',
146 required => '0',
147 },
148 };
149 __PACKAGE__->method_documentation->{ 'diagram_storage_exist_path_get' } = {
150 summary => 'Check if file or folder exists',
151 params => $params,
152 returns => 'ObjectExist',
153 };
154 }
155 # @return ObjectExist
156 #
157 sub diagram_storage_exist_path_get {
158 my ($self, %args) = @_;
159
160 # verify the required parameter 'path' is set
161 unless (exists $args{'path'}) {
162 croak("Missing the required parameter 'path' when calling diagram_storage_exist_path_get");
163 }
164
165 # parse inputs
166 my $_resource_path = '/diagram/storage/exist/{path}';
167
168 my $_method = 'GET';
169 my $query_params = {};
170 my $header_params = {};
171 my $form_params = {};
172
173 # 'Accept' and 'Content-Type' header
174 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
175 if ($_header_accept) {
176 $header_params->{'Accept'} = $_header_accept;
177 }
178 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
179
180 # query params
181 if ( exists $args{'storage_name'}) {
182 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
183 }
184
185 # query params
186 if ( exists $args{'version_id'}) {
187 $query_params->{'versionId'} = $self->{api_client}->to_query_value($args{'version_id'});
188 }
189
190 # path params
191 if ( exists $args{'path'}) {
192 my $_base_variable = "{" . "path" . "}";
193 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
194 $_resource_path =~ s/$_base_variable/$_base_value/g;
195 }
196
197 my $_body_data;
198 # authentication setting, if any
199 my $auth_settings = [qw(JWT )];
200
201 # make the API Call
202 my $response = $self->{api_client}->call_api($_resource_path, $_method,
203 $query_params, $form_params,
204 $header_params, $_body_data, $auth_settings);
205 if (!$response) {
206 return;
207 }
208 my $_response_object = $self->{api_client}->deserialize('ObjectExist', $response);
209 return $_response_object;
210 }
211
212 #
213 # diagram_storage_file_copy_src_path_put
214 #
215 # Copy file
216 #
217 # @param string $src_path Source file path e.g. '/folder/file.ext' (required)
218 # @param string $dest_path Destination file path (required)
219 # @param string $src_storage_name Source storage name (optional)
220 # @param string $dest_storage_name Destination storage name (optional)
221 # @param string $version_id File version ID to copy (optional)
222 {
223 my $params = {
224 'src_path' => {
225 data_type => 'string',
226 description => 'Source file path e.g. '/folder/file.ext'',
227 required => '1',
228 },
229 'dest_path' => {
230 data_type => 'string',
231 description => 'Destination file path',
232 required => '1',
233 },
234 'src_storage_name' => {
235 data_type => 'string',
236 description => 'Source storage name',
237 required => '0',
238 },
239 'dest_storage_name' => {
240 data_type => 'string',
241 description => 'Destination storage name',
242 required => '0',
243 },
244 'version_id' => {
245 data_type => 'string',
246 description => 'File version ID to copy',
247 required => '0',
248 },
249 };
250 __PACKAGE__->method_documentation->{ 'diagram_storage_file_copy_src_path_put' } = {
251 summary => 'Copy file',
252 params => $params,
253 returns => undef,
254 };
255 }
256 # @return void
257 #
258 sub diagram_storage_file_copy_src_path_put {
259 my ($self, %args) = @_;
260
261 # verify the required parameter 'src_path' is set
262 unless (exists $args{'src_path'}) {
263 croak("Missing the required parameter 'src_path' when calling diagram_storage_file_copy_src_path_put");
264 }
265
266 # verify the required parameter 'dest_path' is set
267 unless (exists $args{'dest_path'}) {
268 croak("Missing the required parameter 'dest_path' when calling diagram_storage_file_copy_src_path_put");
269 }
270
271 # parse inputs
272 my $_resource_path = '/diagram/storage/file/copy/{srcPath}';
273
274 my $_method = 'PUT';
275 my $query_params = {};
276 my $header_params = {};
277 my $form_params = {};
278
279 # 'Accept' and 'Content-Type' header
280 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
281 if ($_header_accept) {
282 $header_params->{'Accept'} = $_header_accept;
283 }
284 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
285
286 # query params
287 if ( exists $args{'dest_path'}) {
288 $query_params->{'destPath'} = $self->{api_client}->to_query_value($args{'dest_path'});
289 }
290
291 # query params
292 if ( exists $args{'src_storage_name'}) {
293 $query_params->{'srcStorageName'} = $self->{api_client}->to_query_value($args{'src_storage_name'});
294 }
295
296 # query params
297 if ( exists $args{'dest_storage_name'}) {
298 $query_params->{'destStorageName'} = $self->{api_client}->to_query_value($args{'dest_storage_name'});
299 }
300
301 # query params
302 if ( exists $args{'version_id'}) {
303 $query_params->{'versionId'} = $self->{api_client}->to_query_value($args{'version_id'});
304 }
305
306 # path params
307 if ( exists $args{'src_path'}) {
308 my $_base_variable = "{" . "srcPath" . "}";
309 my $_base_value = $self->{api_client}->to_path_value($args{'src_path'});
310 $_resource_path =~ s/$_base_variable/$_base_value/g;
311 }
312
313 my $_body_data;
314 # authentication setting, if any
315 my $auth_settings = [qw(JWT )];
316
317 # make the API Call
318 $self->{api_client}->call_api($_resource_path, $_method,
319 $query_params, $form_params,
320 $header_params, $_body_data, $auth_settings);
321 return;
322 }
323
324 #
325 # diagram_storage_file_move_src_path_put
326 #
327 # Move file
328 #
329 # @param string $src_path Source file path e.g. '/src.ext' (required)
330 # @param string $dest_path Destination file path e.g. '/dest.ext' (required)
331 # @param string $src_storage_name Source storage name (optional)
332 # @param string $dest_storage_name Destination storage name (optional)
333 # @param string $version_id File version ID to move (optional)
334 {
335 my $params = {
336 'src_path' => {
337 data_type => 'string',
338 description => 'Source file path e.g. '/src.ext'',
339 required => '1',
340 },
341 'dest_path' => {
342 data_type => 'string',
343 description => 'Destination file path e.g. '/dest.ext'',
344 required => '1',
345 },
346 'src_storage_name' => {
347 data_type => 'string',
348 description => 'Source storage name',
349 required => '0',
350 },
351 'dest_storage_name' => {
352 data_type => 'string',
353 description => 'Destination storage name',
354 required => '0',
355 },
356 'version_id' => {
357 data_type => 'string',
358 description => 'File version ID to move',
359 required => '0',
360 },
361 };
362 __PACKAGE__->method_documentation->{ 'diagram_storage_file_move_src_path_put' } = {
363 summary => 'Move file',
364 params => $params,
365 returns => undef,
366 };
367 }
368 # @return void
369 #
370 sub diagram_storage_file_move_src_path_put {
371 my ($self, %args) = @_;
372
373 # verify the required parameter 'src_path' is set
374 unless (exists $args{'src_path'}) {
375 croak("Missing the required parameter 'src_path' when calling diagram_storage_file_move_src_path_put");
376 }
377
378 # verify the required parameter 'dest_path' is set
379 unless (exists $args{'dest_path'}) {
380 croak("Missing the required parameter 'dest_path' when calling diagram_storage_file_move_src_path_put");
381 }
382
383 # parse inputs
384 my $_resource_path = '/diagram/storage/file/move/{srcPath}';
385
386 my $_method = 'PUT';
387 my $query_params = {};
388 my $header_params = {};
389 my $form_params = {};
390
391 # 'Accept' and 'Content-Type' header
392 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
393 if ($_header_accept) {
394 $header_params->{'Accept'} = $_header_accept;
395 }
396 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
397
398 # query params
399 if ( exists $args{'dest_path'}) {
400 $query_params->{'destPath'} = $self->{api_client}->to_query_value($args{'dest_path'});
401 }
402
403 # query params
404 if ( exists $args{'src_storage_name'}) {
405 $query_params->{'srcStorageName'} = $self->{api_client}->to_query_value($args{'src_storage_name'});
406 }
407
408 # query params
409 if ( exists $args{'dest_storage_name'}) {
410 $query_params->{'destStorageName'} = $self->{api_client}->to_query_value($args{'dest_storage_name'});
411 }
412
413 # query params
414 if ( exists $args{'version_id'}) {
415 $query_params->{'versionId'} = $self->{api_client}->to_query_value($args{'version_id'});
416 }
417
418 # path params
419 if ( exists $args{'src_path'}) {
420 my $_base_variable = "{" . "srcPath" . "}";
421 my $_base_value = $self->{api_client}->to_path_value($args{'src_path'});
422 $_resource_path =~ s/$_base_variable/$_base_value/g;
423 }
424
425 my $_body_data;
426 # authentication setting, if any
427 my $auth_settings = [qw(JWT )];
428
429 # make the API Call
430 $self->{api_client}->call_api($_resource_path, $_method,
431 $query_params, $form_params,
432 $header_params, $_body_data, $auth_settings);
433 return;
434 }
435
436 #
437 # diagram_storage_file_path_delete
438 #
439 # Delete file
440 #
441 # @param string $path File path e.g. '/folder/file.ext' (required)
442 # @param string $storage_name Storage name (optional)
443 # @param string $version_id File version ID to delete (optional)
444 {
445 my $params = {
446 'path' => {
447 data_type => 'string',
448 description => 'File path e.g. '/folder/file.ext'',
449 required => '1',
450 },
451 'storage_name' => {
452 data_type => 'string',
453 description => 'Storage name',
454 required => '0',
455 },
456 'version_id' => {
457 data_type => 'string',
458 description => 'File version ID to delete',
459 required => '0',
460 },
461 };
462 __PACKAGE__->method_documentation->{ 'diagram_storage_file_path_delete' } = {
463 summary => 'Delete file',
464 params => $params,
465 returns => undef,
466 };
467 }
468 # @return void
469 #
470 sub diagram_storage_file_path_delete {
471 my ($self, %args) = @_;
472
473 # verify the required parameter 'path' is set
474 unless (exists $args{'path'}) {
475 croak("Missing the required parameter 'path' when calling diagram_storage_file_path_delete");
476 }
477
478 # parse inputs
479 my $_resource_path = '/diagram/storage/file/{path}';
480
481 my $_method = 'DELETE';
482 my $query_params = {};
483 my $header_params = {};
484 my $form_params = {};
485
486 # 'Accept' and 'Content-Type' header
487 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
488 if ($_header_accept) {
489 $header_params->{'Accept'} = $_header_accept;
490 }
491 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
492
493 # query params
494 if ( exists $args{'storage_name'}) {
495 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
496 }
497
498 # query params
499 if ( exists $args{'version_id'}) {
500 $query_params->{'versionId'} = $self->{api_client}->to_query_value($args{'version_id'});
501 }
502
503 # path params
504 if ( exists $args{'path'}) {
505 my $_base_variable = "{" . "path" . "}";
506 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
507 $_resource_path =~ s/$_base_variable/$_base_value/g;
508 }
509
510 my $_body_data;
511 # authentication setting, if any
512 my $auth_settings = [qw(JWT )];
513
514 # make the API Call
515 $self->{api_client}->call_api($_resource_path, $_method,
516 $query_params, $form_params,
517 $header_params, $_body_data, $auth_settings);
518 return;
519 }
520
521 #
522 # diagram_storage_file_path_get
523 #
524 # Download file
525 #
526 # @param string $path File path e.g. '/folder/file.ext' (required)
527 # @param string $storage_name Storage name (optional)
528 # @param string $version_id File version ID to download (optional)
529 {
530 my $params = {
531 'path' => {
532 data_type => 'string',
533 description => 'File path e.g. '/folder/file.ext'',
534 required => '1',
535 },
536 'storage_name' => {
537 data_type => 'string',
538 description => 'Storage name',
539 required => '0',
540 },
541 'version_id' => {
542 data_type => 'string',
543 description => 'File version ID to download',
544 required => '0',
545 },
546 };
547 __PACKAGE__->method_documentation->{ 'diagram_storage_file_path_get' } = {
548 summary => 'Download file',
549 params => $params,
550 returns => 'string',
551 };
552 }
553 # @return string
554 #
555 sub diagram_storage_file_path_get {
556 my ($self, %args) = @_;
557
558 # verify the required parameter 'path' is set
559 unless (exists $args{'path'}) {
560 croak("Missing the required parameter 'path' when calling diagram_storage_file_path_get");
561 }
562
563 # parse inputs
564 my $_resource_path = '/diagram/storage/file/{path}';
565
566 my $_method = 'GET';
567 my $query_params = {};
568 my $header_params = {};
569 my $form_params = {};
570
571 # 'Accept' and 'Content-Type' header
572 my $_header_accept = $self->{api_client}->select_header_accept('multipart/form-data');
573 if ($_header_accept) {
574 $header_params->{'Accept'} = $_header_accept;
575 }
576 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
577
578 # query params
579 if ( exists $args{'storage_name'}) {
580 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
581 }
582
583 # query params
584 if ( exists $args{'version_id'}) {
585 $query_params->{'versionId'} = $self->{api_client}->to_query_value($args{'version_id'});
586 }
587
588 # path params
589 if ( exists $args{'path'}) {
590 my $_base_variable = "{" . "path" . "}";
591 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
592 $_resource_path =~ s/$_base_variable/$_base_value/g;
593 }
594
595 my $_body_data;
596 # authentication setting, if any
597 my $auth_settings = [qw(JWT )];
598
599 # make the API Call
600 my $response = $self->{api_client}->call_api($_resource_path, $_method,
601 $query_params, $form_params,
602 $header_params, $_body_data, $auth_settings);
603 if (!$response) {
604 return;
605 }
606 my $_response_object = $self->{api_client}->deserialize('string', $response);
607 return $_response_object;
608 }
609
610 #
611 # diagram_storage_file_path_put
612 #
613 # Upload file
614 #
615 # @param string $path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. (required)
616 # @param string $file File to upload (required)
617 # @param string $storage_name Storage name (optional)
618 {
619 my $params = {
620 'path' => {
621 data_type => 'string',
622 description => 'Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. ',
623 required => '1',
624 },
625 'file' => {
626 data_type => 'string',
627 description => 'File to upload',
628 required => '1',
629 },
630 'storage_name' => {
631 data_type => 'string',
632 description => 'Storage name',
633 required => '0',
634 },
635 };
636 __PACKAGE__->method_documentation->{ 'diagram_storage_file_path_put' } = {
637 summary => 'Upload file',
638 params => $params,
639 returns => 'FilesUploadResult',
640 };
641 }
642 # @return FilesUploadResult
643 #
644 sub diagram_storage_file_path_put {
645 my ($self, %args) = @_;
646
647 # verify the required parameter 'path' is set
648 unless (exists $args{'path'}) {
649 croak("Missing the required parameter 'path' when calling diagram_storage_file_path_put");
650 }
651
652 # verify the required parameter 'file' is set
653 unless (exists $args{'file'}) {
654 croak("Missing the required parameter 'file' when calling diagram_storage_file_path_put");
655 }
656
657 # parse inputs
658 my $_resource_path = '/diagram/storage/file/{path}';
659
660 my $_method = 'PUT';
661 my $query_params = {};
662 my $header_params = {};
663 my $form_params = {};
664
665 # 'Accept' and 'Content-Type' header
666 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
667 if ($_header_accept) {
668 $header_params->{'Accept'} = $_header_accept;
669 }
670 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data');
671
672 # query params
673 if ( exists $args{'storage_name'}) {
674 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
675 }
676
677 # path params
678 if ( exists $args{'path'}) {
679 my $_base_variable = "{" . "path" . "}";
680 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
681 $_resource_path =~ s/$_base_variable/$_base_value/g;
682 }
683
684 my $_body_data;
685 # body params
686 if ( exists $args{'file'}) {
687 $_body_data = $args{'file'};
688 }
689
690 # authentication setting, if any
691 my $auth_settings = [qw(JWT )];
692
693 # make the API Call
694 my $response = $self->{api_client}->call_api($_resource_path, $_method,
695 $query_params, $form_params,
696 $header_params, $_body_data, $auth_settings);
697 if (!$response) {
698 return;
699 }
700 my $_response_object = $self->{api_client}->deserialize('FilesUploadResult', $response);
701 return $_response_object;
702 }
703
704 #
705 # diagram_storage_folder_copy_src_path_put
706 #
707 # Copy folder
708 #
709 # @param string $src_path Source folder path e.g. '/src' (required)
710 # @param string $dest_path Destination folder path e.g. '/dst' (required)
711 # @param string $src_storage_name Source storage name (optional)
712 # @param string $dest_storage_name Destination storage name (optional)
713 {
714 my $params = {
715 'src_path' => {
716 data_type => 'string',
717 description => 'Source folder path e.g. '/src'',
718 required => '1',
719 },
720 'dest_path' => {
721 data_type => 'string',
722 description => 'Destination folder path e.g. '/dst'',
723 required => '1',
724 },
725 'src_storage_name' => {
726 data_type => 'string',
727 description => 'Source storage name',
728 required => '0',
729 },
730 'dest_storage_name' => {
731 data_type => 'string',
732 description => 'Destination storage name',
733 required => '0',
734 },
735 };
736 __PACKAGE__->method_documentation->{ 'diagram_storage_folder_copy_src_path_put' } = {
737 summary => 'Copy folder',
738 params => $params,
739 returns => undef,
740 };
741 }
742 # @return void
743 #
744 sub diagram_storage_folder_copy_src_path_put {
745 my ($self, %args) = @_;
746
747 # verify the required parameter 'src_path' is set
748 unless (exists $args{'src_path'}) {
749 croak("Missing the required parameter 'src_path' when calling diagram_storage_folder_copy_src_path_put");
750 }
751
752 # verify the required parameter 'dest_path' is set
753 unless (exists $args{'dest_path'}) {
754 croak("Missing the required parameter 'dest_path' when calling diagram_storage_folder_copy_src_path_put");
755 }
756
757 # parse inputs
758 my $_resource_path = '/diagram/storage/folder/copy/{srcPath}';
759
760 my $_method = 'PUT';
761 my $query_params = {};
762 my $header_params = {};
763 my $form_params = {};
764
765 # 'Accept' and 'Content-Type' header
766 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
767 if ($_header_accept) {
768 $header_params->{'Accept'} = $_header_accept;
769 }
770 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
771
772 # query params
773 if ( exists $args{'dest_path'}) {
774 $query_params->{'destPath'} = $self->{api_client}->to_query_value($args{'dest_path'});
775 }
776
777 # query params
778 if ( exists $args{'src_storage_name'}) {
779 $query_params->{'srcStorageName'} = $self->{api_client}->to_query_value($args{'src_storage_name'});
780 }
781
782 # query params
783 if ( exists $args{'dest_storage_name'}) {
784 $query_params->{'destStorageName'} = $self->{api_client}->to_query_value($args{'dest_storage_name'});
785 }
786
787 # path params
788 if ( exists $args{'src_path'}) {
789 my $_base_variable = "{" . "srcPath" . "}";
790 my $_base_value = $self->{api_client}->to_path_value($args{'src_path'});
791 $_resource_path =~ s/$_base_variable/$_base_value/g;
792 }
793
794 my $_body_data;
795 # authentication setting, if any
796 my $auth_settings = [qw(JWT )];
797
798 # make the API Call
799 $self->{api_client}->call_api($_resource_path, $_method,
800 $query_params, $form_params,
801 $header_params, $_body_data, $auth_settings);
802 return;
803 }
804
805 #
806 # diagram_storage_folder_move_src_path_put
807 #
808 # Move folder
809 #
810 # @param string $src_path Folder path to move e.g. '/folder' (required)
811 # @param string $dest_path Destination folder path to move to e.g '/dst' (required)
812 # @param string $src_storage_name Source storage name (optional)
813 # @param string $dest_storage_name Destination storage name (optional)
814 {
815 my $params = {
816 'src_path' => {
817 data_type => 'string',
818 description => 'Folder path to move e.g. '/folder'',
819 required => '1',
820 },
821 'dest_path' => {
822 data_type => 'string',
823 description => 'Destination folder path to move to e.g '/dst'',
824 required => '1',
825 },
826 'src_storage_name' => {
827 data_type => 'string',
828 description => 'Source storage name',
829 required => '0',
830 },
831 'dest_storage_name' => {
832 data_type => 'string',
833 description => 'Destination storage name',
834 required => '0',
835 },
836 };
837 __PACKAGE__->method_documentation->{ 'diagram_storage_folder_move_src_path_put' } = {
838 summary => 'Move folder',
839 params => $params,
840 returns => undef,
841 };
842 }
843 # @return void
844 #
845 sub diagram_storage_folder_move_src_path_put {
846 my ($self, %args) = @_;
847
848 # verify the required parameter 'src_path' is set
849 unless (exists $args{'src_path'}) {
850 croak("Missing the required parameter 'src_path' when calling diagram_storage_folder_move_src_path_put");
851 }
852
853 # verify the required parameter 'dest_path' is set
854 unless (exists $args{'dest_path'}) {
855 croak("Missing the required parameter 'dest_path' when calling diagram_storage_folder_move_src_path_put");
856 }
857
858 # parse inputs
859 my $_resource_path = '/diagram/storage/folder/move/{srcPath}';
860
861 my $_method = 'PUT';
862 my $query_params = {};
863 my $header_params = {};
864 my $form_params = {};
865
866 # 'Accept' and 'Content-Type' header
867 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
868 if ($_header_accept) {
869 $header_params->{'Accept'} = $_header_accept;
870 }
871 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
872
873 # query params
874 if ( exists $args{'dest_path'}) {
875 $query_params->{'destPath'} = $self->{api_client}->to_query_value($args{'dest_path'});
876 }
877
878 # query params
879 if ( exists $args{'src_storage_name'}) {
880 $query_params->{'srcStorageName'} = $self->{api_client}->to_query_value($args{'src_storage_name'});
881 }
882
883 # query params
884 if ( exists $args{'dest_storage_name'}) {
885 $query_params->{'destStorageName'} = $self->{api_client}->to_query_value($args{'dest_storage_name'});
886 }
887
888 # path params
889 if ( exists $args{'src_path'}) {
890 my $_base_variable = "{" . "srcPath" . "}";
891 my $_base_value = $self->{api_client}->to_path_value($args{'src_path'});
892 $_resource_path =~ s/$_base_variable/$_base_value/g;
893 }
894
895 my $_body_data;
896 # authentication setting, if any
897 my $auth_settings = [qw(JWT )];
898
899 # make the API Call
900 $self->{api_client}->call_api($_resource_path, $_method,
901 $query_params, $form_params,
902 $header_params, $_body_data, $auth_settings);
903 return;
904 }
905
906 #
907 # diagram_storage_folder_path_delete
908 #
909 # Delete folder
910 #
911 # @param string $path Folder path e.g. '/folder' (required)
912 # @param string $storage_name Storage name (optional)
913 # @param boolean $recursive Enable to delete folders, subfolders and files (optional, default to false)
914 {
915 my $params = {
916 'path' => {
917 data_type => 'string',
918 description => 'Folder path e.g. '/folder'',
919 required => '1',
920 },
921 'storage_name' => {
922 data_type => 'string',
923 description => 'Storage name',
924 required => '0',
925 },
926 'recursive' => {
927 data_type => 'boolean',
928 description => 'Enable to delete folders, subfolders and files',
929 required => '0',
930 },
931 };
932 __PACKAGE__->method_documentation->{ 'diagram_storage_folder_path_delete' } = {
933 summary => 'Delete folder',
934 params => $params,
935 returns => undef,
936 };
937 }
938 # @return void
939 #
940 sub diagram_storage_folder_path_delete {
941 my ($self, %args) = @_;
942
943 # verify the required parameter 'path' is set
944 unless (exists $args{'path'}) {
945 croak("Missing the required parameter 'path' when calling diagram_storage_folder_path_delete");
946 }
947
948 # parse inputs
949 my $_resource_path = '/diagram/storage/folder/{path}';
950
951 my $_method = 'DELETE';
952 my $query_params = {};
953 my $header_params = {};
954 my $form_params = {};
955
956 # 'Accept' and 'Content-Type' header
957 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
958 if ($_header_accept) {
959 $header_params->{'Accept'} = $_header_accept;
960 }
961 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
962
963 # query params
964 if ( exists $args{'storage_name'}) {
965 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
966 }
967
968 # query params
969 if ( exists $args{'recursive'}) {
970 $query_params->{'recursive'} = $self->{api_client}->to_query_value($args{'recursive'});
971 }
972
973 # path params
974 if ( exists $args{'path'}) {
975 my $_base_variable = "{" . "path" . "}";
976 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
977 $_resource_path =~ s/$_base_variable/$_base_value/g;
978 }
979
980 my $_body_data;
981 # authentication setting, if any
982 my $auth_settings = [qw(JWT )];
983
984 # make the API Call
985 $self->{api_client}->call_api($_resource_path, $_method,
986 $query_params, $form_params,
987 $header_params, $_body_data, $auth_settings);
988 return;
989 }
990
991 #
992 # diagram_storage_folder_path_get
993 #
994 # Get all files and folders within a folder
995 #
996 # @param string $path Folder path e.g. '/folder' (required)
997 # @param string $storage_name Storage name (optional)
998 {
999 my $params = {
1000 'path' => {
1001 data_type => 'string',
1002 description => 'Folder path e.g. '/folder'',
1003 required => '1',
1004 },
1005 'storage_name' => {
1006 data_type => 'string',
1007 description => 'Storage name',
1008 required => '0',
1009 },
1010 };
1011 __PACKAGE__->method_documentation->{ 'diagram_storage_folder_path_get' } = {
1012 summary => 'Get all files and folders within a folder',
1013 params => $params,
1014 returns => 'FilesList',
1015 };
1016 }
1017 # @return FilesList
1018 #
1019 sub diagram_storage_folder_path_get {
1020 my ($self, %args) = @_;
1021
1022 # verify the required parameter 'path' is set
1023 unless (exists $args{'path'}) {
1024 croak("Missing the required parameter 'path' when calling diagram_storage_folder_path_get");
1025 }
1026
1027 # parse inputs
1028 my $_resource_path = '/diagram/storage/folder/{path}';
1029
1030 my $_method = 'GET';
1031 my $query_params = {};
1032 my $header_params = {};
1033 my $form_params = {};
1034
1035 # 'Accept' and 'Content-Type' header
1036 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1037 if ($_header_accept) {
1038 $header_params->{'Accept'} = $_header_accept;
1039 }
1040 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
1041
1042 # query params
1043 if ( exists $args{'storage_name'}) {
1044 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
1045 }
1046
1047 # path params
1048 if ( exists $args{'path'}) {
1049 my $_base_variable = "{" . "path" . "}";
1050 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
1051 $_resource_path =~ s/$_base_variable/$_base_value/g;
1052 }
1053
1054 my $_body_data;
1055 # authentication setting, if any
1056 my $auth_settings = [qw(JWT )];
1057
1058 # make the API Call
1059 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1060 $query_params, $form_params,
1061 $header_params, $_body_data, $auth_settings);
1062 if (!$response) {
1063 return;
1064 }
1065 my $_response_object = $self->{api_client}->deserialize('FilesList', $response);
1066 return $_response_object;
1067 }
1068
1069 #
1070 # diagram_storage_folder_path_put
1071 #
1072 # Create the folder
1073 #
1074 # @param string $path Folder path to create e.g. 'folder_1/folder_2/' (required)
1075 # @param string $storage_name Storage name (optional)
1076 {
1077 my $params = {
1078 'path' => {
1079 data_type => 'string',
1080 description => 'Folder path to create e.g. 'folder_1/folder_2/'',
1081 required => '1',
1082 },
1083 'storage_name' => {
1084 data_type => 'string',
1085 description => 'Storage name',
1086 required => '0',
1087 },
1088 };
1089 __PACKAGE__->method_documentation->{ 'diagram_storage_folder_path_put' } = {
1090 summary => 'Create the folder',
1091 params => $params,
1092 returns => undef,
1093 };
1094 }
1095 # @return void
1096 #
1097 sub diagram_storage_folder_path_put {
1098 my ($self, %args) = @_;
1099
1100 # verify the required parameter 'path' is set
1101 unless (exists $args{'path'}) {
1102 croak("Missing the required parameter 'path' when calling diagram_storage_folder_path_put");
1103 }
1104
1105 # parse inputs
1106 my $_resource_path = '/diagram/storage/folder/{path}';
1107
1108 my $_method = 'PUT';
1109 my $query_params = {};
1110 my $header_params = {};
1111 my $form_params = {};
1112
1113 # 'Accept' and 'Content-Type' header
1114 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1115 if ($_header_accept) {
1116 $header_params->{'Accept'} = $_header_accept;
1117 }
1118 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
1119
1120 # query params
1121 if ( exists $args{'storage_name'}) {
1122 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
1123 }
1124
1125 # path params
1126 if ( exists $args{'path'}) {
1127 my $_base_variable = "{" . "path" . "}";
1128 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
1129 $_resource_path =~ s/$_base_variable/$_base_value/g;
1130 }
1131
1132 my $_body_data;
1133 # authentication setting, if any
1134 my $auth_settings = [qw(JWT )];
1135
1136 # make the API Call
1137 $self->{api_client}->call_api($_resource_path, $_method,
1138 $query_params, $form_params,
1139 $header_params, $_body_data, $auth_settings);
1140 return;
1141 }
1142
1143 #
1144 # diagram_storage_storage_name_exist_get
1145 #
1146 # Check if storage exists
1147 #
1148 # @param string $storage_name Storage name (required)
1149 {
1150 my $params = {
1151 'storage_name' => {
1152 data_type => 'string',
1153 description => 'Storage name',
1154 required => '1',
1155 },
1156 };
1157 __PACKAGE__->method_documentation->{ 'diagram_storage_storage_name_exist_get' } = {
1158 summary => 'Check if storage exists',
1159 params => $params,
1160 returns => 'StorageExist',
1161 };
1162 }
1163 # @return StorageExist
1164 #
1165 sub diagram_storage_storage_name_exist_get {
1166 my ($self, %args) = @_;
1167
1168 # verify the required parameter 'storage_name' is set
1169 unless (exists $args{'storage_name'}) {
1170 croak("Missing the required parameter 'storage_name' when calling diagram_storage_storage_name_exist_get");
1171 }
1172
1173 # parse inputs
1174 my $_resource_path = '/diagram/storage/{storageName}/exist';
1175
1176 my $_method = 'GET';
1177 my $query_params = {};
1178 my $header_params = {};
1179 my $form_params = {};
1180
1181 # 'Accept' and 'Content-Type' header
1182 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1183 if ($_header_accept) {
1184 $header_params->{'Accept'} = $_header_accept;
1185 }
1186 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
1187
1188 # path params
1189 if ( exists $args{'storage_name'}) {
1190 my $_base_variable = "{" . "storageName" . "}";
1191 my $_base_value = $self->{api_client}->to_path_value($args{'storage_name'});
1192 $_resource_path =~ s/$_base_variable/$_base_value/g;
1193 }
1194
1195 my $_body_data;
1196 # authentication setting, if any
1197 my $auth_settings = [qw(JWT )];
1198
1199 # make the API Call
1200 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1201 $query_params, $form_params,
1202 $header_params, $_body_data, $auth_settings);
1203 if (!$response) {
1204 return;
1205 }
1206 my $_response_object = $self->{api_client}->deserialize('StorageExist', $response);
1207 return $_response_object;
1208 }
1209
1210 #
1211 # diagram_storage_version_path_get
1212 #
1213 # Get file versions
1214 #
1215 # @param string $path File path e.g. '/file.ext' (required)
1216 # @param string $storage_name Storage name (optional)
1217 {
1218 my $params = {
1219 'path' => {
1220 data_type => 'string',
1221 description => 'File path e.g. '/file.ext'',
1222 required => '1',
1223 },
1224 'storage_name' => {
1225 data_type => 'string',
1226 description => 'Storage name',
1227 required => '0',
1228 },
1229 };
1230 __PACKAGE__->method_documentation->{ 'diagram_storage_version_path_get' } = {
1231 summary => 'Get file versions',
1232 params => $params,
1233 returns => 'FileVersions',
1234 };
1235 }
1236 # @return FileVersions
1237 #
1238 sub diagram_storage_version_path_get {
1239 my ($self, %args) = @_;
1240
1241 # verify the required parameter 'path' is set
1242 unless (exists $args{'path'}) {
1243 croak("Missing the required parameter 'path' when calling diagram_storage_version_path_get");
1244 }
1245
1246 # parse inputs
1247 my $_resource_path = '/diagram/storage/version/{path}';
1248
1249 my $_method = 'GET';
1250 my $query_params = {};
1251 my $header_params = {};
1252 my $form_params = {};
1253
1254 # 'Accept' and 'Content-Type' header
1255 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1256 if ($_header_accept) {
1257 $header_params->{'Accept'} = $_header_accept;
1258 }
1259 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
1260
1261 # query params
1262 if ( exists $args{'storage_name'}) {
1263 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
1264 }
1265
1266 # path params
1267 if ( exists $args{'path'}) {
1268 my $_base_variable = "{" . "path" . "}";
1269 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
1270 $_resource_path =~ s/$_base_variable/$_base_value/g;
1271 }
1272
1273 my $_body_data;
1274 # authentication setting, if any
1275 my $auth_settings = [qw(JWT )];
1276
1277 # make the API Call
1278 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1279 $query_params, $form_params,
1280 $header_params, $_body_data, $auth_settings);
1281 if (!$response) {
1282 return;
1283 }
1284 my $_response_object = $self->{api_client}->deserialize('FileVersions', $response);
1285 return $_response_object;
1286 }
1287 #
1288 # Upload file
1289 #
1290 # Upload file
1291 #
1292 # @param string $path Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. (required)
1293 # @param File $file File to upload (required)
1294 # @param string $storage_name Storage name (optional)
1295 {
1296 my $params = {
1297 'path' => {
1298 data_type => 'string',
1299 description => 'Path where to upload including filename and extension e.g. /file.ext or /Folder 1/file.ext If the content is multipart and path does not contains the file name it tries to get them from filename parameter from Content-Disposition header. ',
1300 required => '1',
1301 },
1302 'localfileName' => {
1303 data_type => 'string',
1304 description => 'localfileName name.',
1305 required => '0',
1306 },
1307 'body' => {
1308 data_type => 'string',
1309 description => 'file.',
1310 required => '0',
1311 },
1312 'storage_name' => {
1313 data_type => 'string',
1314 description => 'Storage name',
1315 required => '0',
1316 },
1317 };
1318 __PACKAGE__->method_documentation->{ 'diagram_storage_file_path_put' } = {
1319 summary => 'Upload file',
1320 params => $params,
1321 returns => 'FilesUploadResult',
1322 };
1323 }
1324 # @return FilesUploadResult
1325 #
1326 sub upload_file {
1327 my ($self, %args) = @_;
1328
1329 # verify the required parameter 'path' is set
1330 unless (exists $args{'path'}) {
1331 croak("Missing the required parameter 'path' when calling diagram_storage_file_path_put");
1332 }
1333
1334 # parse inputs
1335 my $_resource_path = '/diagram/storage/file/{path}';
1336
1337 my $_method = 'PUT';
1338 my $query_params = {};
1339 my $header_params = {};
1340 my $form_params = {};
1341
1342 # 'Accept' and 'Content-Type' header
1343 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1344 if ($_header_accept) {
1345 $header_params->{'Accept'} = $_header_accept;
1346 }
1347 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data');
1348
1349 #####################################################
1350 my $filename=$args{'localfileName'};
1351 my $filedisposition='form-data; filename="'.$filename.'"';
1352 $header_params->{'Content-Disposition'} =$filedisposition;
1353 my $_body_data=$args{'body'};
1354 #printf $filedisposition;####################################
1355
1356 # query params
1357 if ( exists $args{'storage_name'}) {
1358 $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
1359 }
1360
1361 # path params
1362 if ( exists $args{'path'}) {
1363 my $_base_variable = "{" . "path" . "}";
1364 my $_base_value = $self->{api_client}->to_path_value($args{'path'});
1365 $_resource_path =~ s/$_base_variable/$_base_value/g;
1366 }
1367
1368 # authentication setting, if any
1369 my $auth_settings = [qw(JWT )];
1370
1371 # make the API Call
1372 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1373 $query_params, $form_params,
1374 $header_params, $_body_data, $auth_settings);
1375 if (!$response) {
1376 return;
1377 }
1378 my $_response_object = $self->{api_client}->deserialize('FilesUploadResult', $response);
1379 return $_response_object;
1380 }
1381
1382 1;