AsposeSlidesCloud-SlidesApi

 view release on metacpan or  search on metacpan

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


    # parse inputs
    my $_resource_path = '/slides/{name}/images/{imageIndex}/replace';

    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{'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{'image_index'}) {
        my $_base_variable = "{" . "imageIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'image_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
    $self->{api_client}->call_api($_resource_path, $_method,
                                           $query_params, $form_params,
                                           $header_params, $_body_data, $files);
    return;
}

#
# replace_image_online
#
# Replaces image by the specified index and returns updated document. 
# 
# @param File $document Document data. (required)
# @param int $image_index Image index. (required)
# @param File $image Image data. (required)
# @param string $password Password. (optional)
{
    my $params = {
    'document' => {
        data_type => 'File',
        description => 'Document data.',
        required => '1',
    },
    'image_index' => {
        data_type => 'int',
        description => 'Image index.',
        required => '1',
    },
    'image' => {
        data_type => 'File',
        description => 'Image data.',
        required => '1',
    },
    'password' => {
        data_type => 'string',
        description => 'Password.',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'replace_image_online' } = { 
    	summary => 'Replaces image by the specified index and returns updated document. ',
        params => $params,
        returns => 'File',
        };
}
# @return File
#
sub replace_image_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 replace_image_online");
    }

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

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

    # parse inputs
    my $_resource_path = '/slides/images/{imageIndex}/replace';

    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');

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

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

    my $_body_data;
    my $files = [];
    if ( exists $args{'document'} && $args{'document'}) {
        push(@$files, $args{'document'});
    }
    if ( exists $args{'image'} && $args{'image'}) {
        push(@$files, $args{'image'});
    }
    # make the API Call

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


    # 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;
    }

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

    # path params
    if ( exists $args{'portion_index'}) {
        my $_base_variable = "{" . "portionIndex" . "}";
        my $_base_value = $self->{api_client}->to_path_value($args{'portion_index'});
        $_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('Portion', $response);
    return $_response_object;
}

#
# update_section
#
# Update section name.
# 
# @param string $name Document name. (required)
# @param int $section_index The position of the section to be updated. (required)
# @param string $section_name Section name. (required)
# @param string $password Document password. (optional)
# @param string $folder Document folder. (optional)
# @param string $storage Document storage. (optional)
{
    my $params = {
    'name' => {
        data_type => 'string',
        description => 'Document name.',
        required => '1',
    },
    'section_index' => {
        data_type => 'int',
        description => 'The position of the section to be updated.',
        required => '1',
    },
    'section_name' => {
        data_type => 'string',
        description => 'Section name.',
        required => '1',
    },
    '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',
    },
    };
    __PACKAGE__->method_documentation->{ 'update_section' } = { 
    	summary => 'Update section name.',
        params => $params,
        returns => 'Sections',
        };
}
# @return Sections
#
sub update_section {
    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 update_section");
    }

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

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

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

    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) {



( run in 0.780 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )