AsposeSlidesCloud-SlidesApi

 view release on metacpan or  search on metacpan

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'slide_index'}) {
        my $_base_variable = "{" . "slideIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'slide_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'shape_index'}) {
        my $_base_variable = "{" . "shapeIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'shape_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('Shape', $response);
    return $_response_object;
}

#
# import_chart_from_workbook
#
# Imports a chart from an Excel workbook and adds it to the slide.
# 
# @param string $name Document name. (required)
# @param int $slide_index Slide index. (required)
# @param string $worksheet_name The name of the worksheet that contains the chart. (required)
# @param File $document Excel workbook data. (optional)
# @param string $chart_name The name of the chart. Required if chartIndex is not specified. (optional)
# @param int $chart_index The zero-based index of the chart in the worksheet. Takes precedence over chartName. (optional)
# @param double $x X coordinate of the chart (EMU). (optional, default to 0.0)
# @param double $y Y coordinate of the chart (EMU). (optional, default to 0.0)
# @param boolean $embed_all_workbook If true, the entire workbook is embedded; if false, only chart data. (optional, default to true)
# @param string $workbook_path Storage path to the workbook. If omitted, the workbook must be uploaded as multipart form data. (optional)
# @param string $workbook_storage Storage name for workbookPath. (optional)
# @param string $password Document password. (optional)
# @param string $folder Presentation folder. (optional)
# @param string $storage Presentation storage. (optional)
{
    my $params = {
    'name' => {
        data_type => 'string',
        description => 'Document name.',
        required => '1',
    },
    'slide_index' => {
        data_type => 'int',
        description => 'Slide index.',
        required => '1',
    },
    'worksheet_name' => {
        data_type => 'string',
        description => 'The name of the worksheet that contains the chart.',
        required => '1',
    },
    'document' => {
        data_type => 'File',
        description => 'Excel workbook data.',
        required => '0',
    },
    'chart_name' => {
        data_type => 'string',
        description => 'The name of the chart. Required if chartIndex is not specified.',
        required => '0',
    },
    'chart_index' => {
        data_type => 'int',
        description => 'The zero-based index of the chart in the worksheet. Takes precedence over chartName.',
        required => '0',
    },
    'x' => {
        data_type => 'double',
        description => 'X coordinate of the chart (EMU).',
        required => '0',
    },
    'y' => {
        data_type => 'double',
        description => 'Y coordinate of the chart (EMU).',
        required => '0',
    },
    'embed_all_workbook' => {
        data_type => 'boolean',
        description => 'If true, the entire workbook is embedded; if false, only chart data.',
        required => '0',
    },
    'workbook_path' => {
        data_type => 'string',
        description => 'Storage path to the workbook. If omitted, the workbook must be uploaded as multipart form data.',
        required => '0',
    },
    'workbook_storage' => {
        data_type => 'string',
        description => 'Storage name for workbookPath.',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'Document password.',
        required => '0',
    },
    'folder' => {
        data_type => 'string',
        description => 'Presentation folder.',
        required => '0',
    },
    'storage' => {
        data_type => 'string',
        description => 'Presentation storage.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'import_chart_from_workbook' } = { 
    	summary => 'Imports a chart from an Excel workbook and adds it to the slide.',
        params => $params,
        returns => 'ShapeBase',
        };
}
# @return ShapeBase
#
sub import_chart_from_workbook {
    my ($self, %args) = @_;

    # verify the required parameter 'name' is set
    unless (exists $args{'name'} && defined $args{'name'} && $args{'name'}) {
      croak("Missing the required parameter 'name' when calling import_chart_from_workbook");
    }

    # verify the required parameter 'slide_index' is set
    unless (exists $args{'slide_index'} && defined $args{'slide_index'}) {
      croak("Missing the required parameter 'slide_index' when calling import_chart_from_workbook");
    }

    # verify the required parameter 'worksheet_name' is set
    unless (exists $args{'worksheet_name'} && defined $args{'worksheet_name'} && $args{'worksheet_name'}) {
      croak("Missing the required parameter 'worksheet_name' when calling import_chart_from_workbook");
    }

    # parse inputs
    my $_resource_path = '/slides/{name}/slides/{slideIndex}/shapes/fromExcelChart';

    my $_method = 'POST';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

        $query_params->{'group'} = $self->{api_client}->to_boolean_query_value($args{'group'});
    }

    # query params
    if (exists $args{'folder'} && defined $args{'folder'}) {
        $query_params->{'folder'} = $self->{api_client}->to_query_value($args{'folder'});
    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'slide_index'}) {
        my $_base_variable = "{" . "slideIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'slide_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    if ( exists $args{'image'} && $args{'image'}) {
        push(@$files, $args{'image'});
    }
    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('Shapes', $response);
    return $_response_object;
}

#
# import_table_from_workbook
#
# Imports a table from an Excel workbook and adds it to the slide.
# 
# @param string $name Document name. (required)
# @param int $slide_index Slide index. (required)
# @param string $worksheet_name The name of the worksheet that contains the table. (required)
# @param string $cell_range The cell range that defines the table (e.g. \"A1:D10\"). (required)
# @param File $document Excel workbook data. (optional)
# @param double $x X coordinate of the table (EMU). (optional, default to 0.0)
# @param double $y Y coordinate of the table (EMU). (optional, default to 0.0)
# @param string $workbook_path Storage path to the workbook. If omitted, the workbook must be uploaded as multipart form data. (optional)
# @param string $workbook_storage Storage name for workbookPath. (optional)
# @param string $password Document password. (optional)
# @param string $folder Presentation folder. (optional)
# @param string $storage Presentation storage. (optional)
{
    my $params = {
    'name' => {
        data_type => 'string',
        description => 'Document name.',
        required => '1',
    },
    'slide_index' => {
        data_type => 'int',
        description => 'Slide index.',
        required => '1',
    },
    'worksheet_name' => {
        data_type => 'string',
        description => 'The name of the worksheet that contains the table.',
        required => '1',
    },
    'cell_range' => {
        data_type => 'string',
        description => 'The cell range that defines the table (e.g. \"A1:D10\").',
        required => '1',
    },
    'document' => {
        data_type => 'File',
        description => 'Excel workbook data.',
        required => '0',
    },
    'x' => {
        data_type => 'double',
        description => 'X coordinate of the table (EMU).',
        required => '0',
    },
    'y' => {
        data_type => 'double',
        description => 'Y coordinate of the table (EMU).',
        required => '0',
    },
    'workbook_path' => {
        data_type => 'string',
        description => 'Storage path to the workbook. If omitted, the workbook must be uploaded as multipart form data.',
        required => '0',
    },
    'workbook_storage' => {
        data_type => 'string',
        description => 'Storage name for workbookPath.',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'Document password.',
        required => '0',
    },
    'folder' => {
        data_type => 'string',
        description => 'Presentation folder.',
        required => '0',
    },
    'storage' => {
        data_type => 'string',
        description => 'Presentation storage.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'import_table_from_workbook' } = { 
    	summary => 'Imports a table from an Excel workbook and adds it to the slide.',
        params => $params,
        returns => 'ShapeBase',
        };
}
# @return ShapeBase
#
sub import_table_from_workbook {
    my ($self, %args) = @_;

    # verify the required parameter 'name' is set
    unless (exists $args{'name'} && defined $args{'name'} && $args{'name'}) {
      croak("Missing the required parameter 'name' when calling import_table_from_workbook");
    }

    # verify the required parameter 'slide_index' is set
    unless (exists $args{'slide_index'} && defined $args{'slide_index'}) {
      croak("Missing the required parameter 'slide_index' when calling import_table_from_workbook");
    }

    # verify the required parameter 'worksheet_name' is set
    unless (exists $args{'worksheet_name'} && defined $args{'worksheet_name'} && $args{'worksheet_name'}) {
      croak("Missing the required parameter 'worksheet_name' when calling import_table_from_workbook");
    }

    # verify the required parameter 'cell_range' is set
    unless (exists $args{'cell_range'} && defined $args{'cell_range'} && $args{'cell_range'}) {
      croak("Missing the required parameter 'cell_range' when calling import_table_from_workbook");
    }

    # parse inputs
    my $_resource_path = '/slides/{name}/slides/{slideIndex}/shapes/fromExcelTable';

    my $_method = 'POST';
    my $query_params = {};
    my $header_params = {};

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

    my $_resource_path = '/slides/{name}/merge';

    my $_method = 'PUT';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');

    # query params
    if (exists $args{'folder'} && defined $args{'folder'}) {
        $query_params->{'folder'} = $self->{api_client}->to_query_value($args{'folder'});
    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    # body params
    if ( exists $args{'request'} && $args{'request'}) {
        $_body_data = $args{'request'};
    }

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('Document', $response);
    return $_response_object;
}

#
# pipeline
#
# Performs slides pipeline.
# 
# @param Pipeline $pipeline A Pipeline object. (required)
# @param ARRAY[string] $files Files to upload with the pipeline (optional)
{
    my $params = {
    'pipeline' => {
        data_type => 'Pipeline',
        description => 'A Pipeline object.',
        required => '1',
    },
    'files' => {
        data_type => 'ARRAY[string]',
        description => 'Files to upload with the pipeline',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'pipeline' } = { 
    	summary => 'Performs slides pipeline.',
        params => $params,
        returns => 'File',
        };
}
# @return File
#
sub pipeline {
    my ($self, %args) = @_;

    # verify the required parameter 'pipeline' is set
    unless (exists $args{'pipeline'} && defined $args{'pipeline'} && $args{'pipeline'}) {
      croak("Missing the required parameter 'pipeline' when calling pipeline");
    }

    # parse inputs
    my $_resource_path = '/slides/pipeline';

    my $_method = 'POST';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('multipart/form-data');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data');

    my $_body_data;
    my $files = [];
    if ( exists $args{'files'} && $args{'files'}) {
        my $arg_files = $args{'files'};
        push(@$files, @$arg_files);
    }
    # body params
    if ( exists $args{'pipeline'} && $args{'pipeline'}) {
        $_body_data = $args{'pipeline'};
    }

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('File', $response);
    return $_response_object;
}

#
# reorder_slides
#
# Reorder presentation slides positions.

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # query params
    if (exists $args{'fonts_folder'} && defined $args{'fonts_folder'}) {
        $query_params->{'fontsFolder'} = $self->{api_client}->to_query_value($args{'fonts_folder'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'slide_index'}) {
        my $_base_variable = "{" . "slideIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'slide_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'shape_index'}) {
        my $_base_variable = "{" . "shapeIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'shape_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'format'}) {
        my $_base_variable = "{" . "format" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'format'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    if ( exists $args{'document'} && $args{'document'}) {
        push(@$files, $args{'document'});
    }
    # body params
    if ( exists $args{'options'} && $args{'options'}) {
        $_body_data = $args{'options'};
    }

    # make the API Call
    $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    return;
}

#
# save_slide
#
# Save a slide to a specified format.
# 
# @param string $name Document name. (required)
# @param int $slide_index Slide index. (required)
# @param string $format Output file format. (required)
# @param string $out_path Path to upload the output file to. (required)
# @param ExportOptions $options Export options. (optional)
# @param int $width The width of the slide representation in the output format; 0 to not adjust the size. Default is 0. (optional, default to 0)
# @param int $height The height of the slide representation in the output format; 0 to not adjust the size. Default is 0. (optional, default to 0)
# @param string $password Document password. (optional)
# @param string $folder Document folder. (optional)
# @param string $storage Document storage. (optional)
# @param string $fonts_folder Storage folder containing custom fonts to be used with the document. (optional)
{
    my $params = {
    'name' => {
        data_type => 'string',
        description => 'Document name.',
        required => '1',
    },
    'slide_index' => {
        data_type => 'int',
        description => 'Slide index.',
        required => '1',
    },
    'format' => {
        data_type => 'string',
        description => 'Output file format.',
        required => '1',
    },
    'out_path' => {
        data_type => 'string',
        description => 'Path to upload the output file to.',
        required => '1',
    },
    'options' => {
        data_type => 'ExportOptions',
        description => 'Export options.',
        required => '0',
    },
    'width' => {
        data_type => 'int',
        description => 'The width of the slide representation in the output format; 0 to not adjust the size. Default is 0.',
        required => '0',
    },
    'height' => {
        data_type => 'int',
        description => 'The height of the slide representation in the output format; 0 to not adjust the size. Default is 0.',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'Document password.',
        required => '0',
    },
    'folder' => {
        data_type => 'string',
        description => 'Document folder.',
        required => '0',
    },
    'storage' => {
        data_type => 'string',
        description => 'Document storage.',
        required => '0',
    },
    'fonts_folder' => {
        data_type => 'string',
        description => 'Storage folder containing custom fonts to be used with the document.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'save_slide' } = { 
    	summary => 'Save a slide to a specified format.',
        params => $params,
        returns => undef,
        };
}
# @return void
#
sub save_slide {
    my ($self, %args) = @_;

    # verify the required parameter 'name' is set
    unless (exists $args{'name'} && defined $args{'name'} && $args{'name'}) {
      croak("Missing the required parameter 'name' when calling save_slide");
    }

    # verify the required parameter 'slide_index' is set
    unless (exists $args{'slide_index'} && defined $args{'slide_index'}) {
      croak("Missing the required parameter 'slide_index' when calling save_slide");
    }

    # verify the required parameter 'format' is set

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN


    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');

    # query params
    if (exists $args{'folder'} && defined $args{'folder'}) {
        $query_params->{'folder'} = $self->{api_client}->to_query_value($args{'folder'});
    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    # body params
    if ( exists $args{'dto'} && $args{'dto'}) {
        $_body_data = $args{'dto'};
    }

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('ViewProperties', $response);
    return $_response_object;
}

#
# split
#
# Splitting presentations. Create one image per slide.
# 
# @param string $name Document name. (required)
# @param ExportOptions $options Export options. (optional)
# @param string $format Export format. Default value is jpeg. (optional, default to 0)
# @param int $width The width of created images. (optional)
# @param int $height The height of created images. (optional)
# @param int $from The start slide number for splitting, if is not specified splitting starts from the first slide of the presentation. (optional)
# @param int $to The last slide number for splitting, if is not specified splitting ends at the last slide of the document. (optional)
# @param string $dest_folder Folder on storage where images are going to be uploaded. If not specified then images are uploaded to same folder as presentation. (optional)
# @param string $password Document password. (optional)
# @param string $folder Document folder. (optional)
# @param string $storage Document storage. (optional)
# @param string $fonts_folder Custom fonts folder. (optional)
{
    my $params = {
    'name' => {
        data_type => 'string',
        description => 'Document name.',
        required => '1',
    },
    'options' => {
        data_type => 'ExportOptions',
        description => 'Export options.',
        required => '0',
    },
    'format' => {
        data_type => 'string',
        description => 'Export format. Default value is jpeg.',
        required => '0',
    },
    'width' => {
        data_type => 'int',
        description => 'The width of created images.',
        required => '0',
    },
    'height' => {
        data_type => 'int',
        description => 'The height of created images.',
        required => '0',
    },
    'from' => {
        data_type => 'int',
        description => 'The start slide number for splitting, if is not specified splitting starts from the first slide of the presentation.',
        required => '0',
    },
    'to' => {
        data_type => 'int',
        description => 'The last slide number for splitting, if is not specified splitting ends at the last slide of the document.',
        required => '0',
    },
    'dest_folder' => {
        data_type => 'string',
        description => 'Folder on storage where images are going to be uploaded. If not specified then images are uploaded to same folder as presentation.',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'Document password.',
        required => '0',
    },
    'folder' => {
        data_type => 'string',
        description => 'Document folder.',
        required => '0',
    },
    'storage' => {
        data_type => 'string',
        description => 'Document storage.',
        required => '0',
    },
    'fonts_folder' => {
        data_type => 'string',
        description => 'Custom fonts folder.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'split' } = { 
    	summary => 'Splitting presentations. Create one image per slide.',
        params => $params,
        returns => 'SplitDocumentResult',
        };
}
# @return SplitDocumentResult
#
sub split {
    my ($self, %args) = @_;

    # verify the required parameter 'name' is set
    unless (exists $args{'name'} && defined $args{'name'} && $args{'name'}) {
      croak("Missing the required parameter 'name' when calling split");
    }

    # verify enum value
    if (exists $args{'format'} && $args{'format'} && !grep(/^$args{'format'}$/i, ( 'Jpeg', 'Png', 'Gif', 'Bmp', 'Tiff', 'Html', 'Pdf', 'Xps', 'Pptx', 'Odp', 'Otp', 'Ppt', 'Pps', 'Ppsx', 'Pptm', 'Ppsm', 'Potx', 'Pot', 'Potm', 'Svg', 'Fodp', 'Xaml', 'H...
      croak("Invalid value for 'format': " . $args{'format'});
    }

    # parse inputs
    my $_resource_path = '/slides/{name}/split';

    my $_method = 'POST';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');

    # query params

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

        $query_params->{'to'} = $self->{api_client}->to_query_value($args{'to'});
    }

    # query params
    if (exists $args{'dest_folder'} && defined $args{'dest_folder'}) {
        $query_params->{'destFolder'} = $self->{api_client}->to_query_value($args{'dest_folder'});
    }

    # query params
    if (exists $args{'folder'} && defined $args{'folder'}) {
        $query_params->{'folder'} = $self->{api_client}->to_query_value($args{'folder'});
    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # query params
    if (exists $args{'fonts_folder'} && defined $args{'fonts_folder'}) {
        $query_params->{'fontsFolder'} = $self->{api_client}->to_query_value($args{'fonts_folder'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    # body params
    if ( exists $args{'options'} && $args{'options'}) {
        $_body_data = $args{'options'};
    }

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('SplitDocumentResult', $response);
    return $_response_object;
}

#
# split_and_save_online
#
# Splits PowerPoint presentation slides from the specified range into separate files and exports them in the specified file format. If the range is not provided all slides will be processed. 
# 
# @param File $document Document data. (required)
# @param string $format ExportFormat (required)
# @param string $dest_folder Folder on storage where images are going to be uploaded. If not specified then images are uploaded to the root folder. (optional, default to )
# @param int $width Slide width. (optional)
# @param int $height Slide height. (optional)
# @param int $from The start slide number for splitting, if is not specified splitting starts from the first slide of the presentation. (optional)
# @param int $to The last slide number for splitting, if is not specified splitting ends at the last slide of the document. (optional)
# @param string $password Document password. (optional)
# @param string $storage Document storage. (optional)
# @param string $fonts_folder Custom fonts folder. (optional)
# @param ExportOptions $options Export options. (optional)
{
    my $params = {
    'document' => {
        data_type => 'File',
        description => 'Document data.',
        required => '1',
    },
    'format' => {
        data_type => 'string',
        description => 'ExportFormat',
        required => '1',
    },
    'dest_folder' => {
        data_type => 'string',
        description => 'Folder on storage where images are going to be uploaded. If not specified then images are uploaded to the root folder.',
        required => '0',
    },
    'width' => {
        data_type => 'int',
        description => 'Slide width.',
        required => '0',
    },
    'height' => {
        data_type => 'int',
        description => 'Slide height.',
        required => '0',
    },
    'from' => {
        data_type => 'int',
        description => 'The start slide number for splitting, if is not specified splitting starts from the first slide of the presentation.',
        required => '0',
    },
    'to' => {
        data_type => 'int',
        description => 'The last slide number for splitting, if is not specified splitting ends at the last slide of the document.',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'Document password.',
        required => '0',
    },
    'storage' => {
        data_type => 'string',
        description => 'Document storage.',
        required => '0',
    },
    'fonts_folder' => {
        data_type => 'string',
        description => 'Custom fonts folder.',
        required => '0',
    },
    'options' => {
        data_type => 'ExportOptions',
        description => 'Export options.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'split_and_save_online' } = { 
    	summary => 'Splits PowerPoint presentation slides from the specified range into separate files and exports them in the specified file format. If the range is not provided all slides will be processed. ',
        params => $params,
        returns => 'SplitDocumentResult',
        };
}
# @return SplitDocumentResult
#
sub split_and_save_online {
    my ($self, %args) = @_;

    # verify the required parameter 'document' is set
    unless (exists $args{'document'} && defined $args{'document'} && $args{'document'}) {
      croak("Missing the required parameter 'document' when calling split_and_save_online");
    }

    # verify the required parameter 'format' is set

lib/AsposeSlidesCloud/SlidesApi.pm  view on Meta::CPAN

    my $_method = 'PUT';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');

    # query params
    if (exists $args{'folder'} && defined $args{'folder'}) {
        $query_params->{'folder'} = $self->{api_client}->to_query_value($args{'folder'});
    }

    # query params
    if (exists $args{'storage'} && defined $args{'storage'}) {
        $query_params->{'storage'} = $self->{api_client}->to_query_value($args{'storage'});
    }

    # header params
    if ( exists $args{'password'}) {
        $header_params->{':password'} = $self->{api_client}->to_header_value($args{'password'});
    }

    # path params
    if ( exists $args{'name'}) {
        my $_base_variable = "{" . "name" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'name'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    # path params
    if ( exists $args{'module_index'}) {
        my $_base_variable = "{" . "moduleIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'module_index'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    # body params
    if ( exists $args{'module_dto'} && $args{'module_dto'}) {
        $_body_data = $args{'module_dto'};
    }

    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('VbaModule', $response);
    return $_response_object;
}

#
# upload_file
#
# Upload file
# 
# @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            ...
# @param File $file File to upload (required)
# @param string $storage_name Storage name (optional)
{
    my $params = {
    'path' => {
        data_type => 'string',
        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          ...
        required => '1',
    },
    'file' => {
        data_type => 'File',
        description => 'File to upload',
        required => '1',
    },
    'storage_name' => {
        data_type => 'string',
        description => 'Storage name',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'upload_file' } = { 
    	summary => 'Upload file',
        params => $params,
        returns => 'FilesUploadResult',
        };
}
# @return FilesUploadResult
#
sub upload_file {
    my ($self, %args) = @_;

    # verify the required parameter 'path' is set
    unless (exists $args{'path'} && defined $args{'path'} && $args{'path'}) {
      croak("Missing the required parameter 'path' when calling upload_file");
    }

    # verify the required parameter 'file' is set
    unless (exists $args{'file'} && defined $args{'file'} && $args{'file'}) {
      croak("Missing the required parameter 'file' when calling upload_file");
    }

    # parse inputs
    my $_resource_path = '/slides/storage/file/{path}';

    my $_method = 'PUT';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/json');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data');

    # query params
    if (exists $args{'storage_name'} && defined $args{'storage_name'}) {
        $query_params->{'storageName'} = $self->{api_client}->to_query_value($args{'storage_name'});
    }

    # path params
    if ( exists $args{'path'}) {
        my $_base_variable = "{" . "path" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'path'});
        $_resource_path =~ s/$_base_variable/$_base_value/g;
    }

    my $_body_data;
    my $files = [];
    if ( exists $args{'file'} && $args{'file'}) {
        push(@$files, $args{'file'});
    }
    # make the API Call
    my $response = $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    if (!$response) {
        return;
    }
    my $_response_object = $self->{api_client}->deserialize('FilesUploadResult', $response);
    return $_response_object;
}

1;



( run in 0.963 second using v1.01-cache-2.11-cpan-b16cb0d3907 )