AsposeImagingCloud-ImagingApi

 view release on metacpan or  search on metacpan

lib/AsposeImagingCloud/ImagingApi.pm  view on Meta::CPAN

    my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream');
    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{'quality'}) {        		
		$_resource_path =~ s/\Q{quality}\E/$args{'quality'}/g;
    }else{
		$_resource_path    =~ s/[?&]quality.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'compressionType'}) {        		
		$_resource_path =~ s/\Q{compressionType}\E/$args{'compressionType'}/g;
    }else{
		$_resource_path    =~ s/[?&]compressionType.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'fromScratch'}) {        		
		$_resource_path =~ s/\Q{fromScratch}\E/$args{'fromScratch'}/g;
    }else{
		$_resource_path    =~ s/[?&]fromScratch.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'outPath'}) {        		
		$_resource_path =~ s/\Q{outPath}\E/$args{'outPath'}/g;
    }else{
		$_resource_path    =~ s/[?&]outPath.*?(?=&|\?|$)//g;
	}
    
    
    my $_body_data;
	# form params
    if ( exists $args{'file'} ) {
        
		$_body_data = read_file( $args{'file'} , binmode => ':raw' );
        
        
    }
    
    

    # authentication setting, if any
    my $auth_settings = [];

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

	if($AsposeImagingCloud::Configuration::debug){
		print "\nResponse Content: ".$response->content;
	}    
	
	my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type'));
    return $_response_object;
    
}
#
# PostImagePng
#
# Update parameters of png image.
# 
# @param Boolean $fromScratch Specifies where additional parameters we do not support should be taken from. If this is true – they will be taken from default values for standard image, if it is false – they will be saved from current im...
# @param String $outPath Path to updated file, if this is empty, response contains streamed image. (optional)
# @param File $file  (required)
# @return ResponseMessage
#
sub PostImagePng {
    my ($self, %args) = @_;

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

    # parse inputs
    my $_resource_path = '/imaging/png/?appSid={appSid}&fromScratch={fromScratch}&outPath={outPath}';
    
	$_resource_path =~ s/\Q&\E/&/g;
    $_resource_path =~ s/\Q\/?\E/?/g;
    $_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g;
	$_resource_path =~ s/\Q{path}\E/{Path}/g;
    
    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/xml', 'application/octet-stream');
    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{'fromScratch'}) {        		
		$_resource_path =~ s/\Q{fromScratch}\E/$args{'fromScratch'}/g;
    }else{
		$_resource_path    =~ s/[?&]fromScratch.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'outPath'}) {        		
		$_resource_path =~ s/\Q{outPath}\E/$args{'outPath'}/g;
    }else{
		$_resource_path    =~ s/[?&]outPath.*?(?=&|\?|$)//g;
	}
    
    
    my $_body_data;
	# form params
    if ( exists $args{'file'} ) {
        
		$_body_data = read_file( $args{'file'} , binmode => ':raw' );
        
        
    }
    
    

    # authentication setting, if any
    my $auth_settings = [];

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

	if($AsposeImagingCloud::Configuration::debug){
		print "\nResponse Content: ".$response->content;

lib/AsposeImagingCloud/ImagingApi.pm  view on Meta::CPAN

    }else{
		$_resource_path    =~ s/[?&]name.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'quality'}) {        		
		$_resource_path =~ s/\Q{quality}\E/$args{'quality'}/g;
    }else{
		$_resource_path    =~ s/[?&]quality.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'compressionType'}) {        		
		$_resource_path =~ s/\Q{compressionType}\E/$args{'compressionType'}/g;
    }else{
		$_resource_path    =~ s/[?&]compressionType.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'fromScratch'}) {        		
		$_resource_path =~ s/\Q{fromScratch}\E/$args{'fromScratch'}/g;
    }else{
		$_resource_path    =~ s/[?&]fromScratch.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'outPath'}) {        		
		$_resource_path =~ s/\Q{outPath}\E/$args{'outPath'}/g;
    }else{
		$_resource_path    =~ s/[?&]outPath.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'folder'}) {        		
		$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g;
    }else{
		$_resource_path    =~ s/[?&]folder.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'storage'}) {        		
		$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g;
    }else{
		$_resource_path    =~ s/[?&]storage.*?(?=&|\?|$)//g;
	}
    
    
    my $_body_data;
	
    
    

    # authentication setting, if any
    my $auth_settings = [];

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

	if($AsposeImagingCloud::Configuration::debug){
		print "\nResponse Content: ".$response->content;
	}    
	
	my $_response_object = $self->{api_client}->pre_deserialize($response->content, 'ResponseMessage', $response->header('content-type'));
    return $_response_object;
    
}
#
# GetImagePng
#
# Update parameters of png image.
# 
# @param String $name Filename of image. (required)
# @param Boolean $fromScratch Specifies where additional parameters we do not support should be taken from. If this is true – they will be taken from default values for standard image, if it is false – they will be saved from current im...
# @param String $outPath Path to updated file, if this is empty, response contains streamed image. (optional)
# @param String $folder Folder with image to process. (optional)
# @param String $storage  (optional)
# @return ResponseMessage
#
sub GetImagePng {
    my ($self, %args) = @_;

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

    # parse inputs
    my $_resource_path = '/imaging/{name}/png/?appSid={appSid}&fromScratch={fromScratch}&outPath={outPath}&folder={folder}&storage={storage}';
    
	$_resource_path =~ s/\Q&\E/&/g;
    $_resource_path =~ s/\Q\/?\E/?/g;
    $_resource_path =~ s/\QtoFormat={toFormat}\E/format={format}/g;
	$_resource_path =~ s/\Q{path}\E/{Path}/g;
    
    my $_method = 'GET';
    my $query_params = {};
    my $header_params = {};
    my $form_params = {};

    # 'Accept' and 'Content-Type' header
    my $_header_accept = $self->{api_client}->select_header_accept('application/xml', 'application/octet-stream');
    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{'name'}) {        		
		$_resource_path =~ s/\Q{name}\E/$args{'name'}/g;
    }else{
		$_resource_path    =~ s/[?&]name.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'fromScratch'}) {        		
		$_resource_path =~ s/\Q{fromScratch}\E/$args{'fromScratch'}/g;
    }else{
		$_resource_path    =~ s/[?&]fromScratch.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'outPath'}) {        		
		$_resource_path =~ s/\Q{outPath}\E/$args{'outPath'}/g;
    }else{
		$_resource_path    =~ s/[?&]outPath.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'folder'}) {        		
		$_resource_path =~ s/\Q{folder}\E/$args{'folder'}/g;
    }else{
		$_resource_path    =~ s/[?&]folder.*?(?=&|\?|$)//g;
	}# query params
    if ( exists $args{'storage'}) {        		
		$_resource_path =~ s/\Q{storage}\E/$args{'storage'}/g;
    }else{
		$_resource_path    =~ s/[?&]storage.*?(?=&|\?|$)//g;
	}
    
    
    my $_body_data;
	
    
    

    # authentication setting, if any
    my $auth_settings = [];

    # make the API Call



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