=begin comment

Web API Swagger specification

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

OpenAPI spec version: 1.0

Generated by: https://github.com/swagger-api/swagger-codegen.git

=end comment

=cut

#
# NOTE: This class is auto generated by Swagger Codegen
# Please update the test cases below to test the API endpoints.
# Ref: https://github.com/swagger-api/swagger-codegen
#
use Test::More tests => 1; #TODO update number of test cases
use Test::Exception;

use lib 'lib';
use strict;
use warnings;
use_ok('AsposeCellsCloud::OAuthApi');
use_ok('AsposeCellsCloud::Configuration');
use_ok('AsposeCellsCloud::ApiClient');
use_ok('AsposeCellsCloud::CellsApi');
use_ok('AsposeCellsCloud::Object::WorkbookEncryptionRequest');
use_ok('AsposeCellsCloud::Object::WorkbookProtectionRequest');
use_ok('AsposeCellsCloud::Object::CalculationOptions');
use_ok('AsposeCellsCloud::Object::WorkbookSettings');
use_ok('AsposeCellsCloud::Object::Style');
use_ok('AsposeCellsCloud::Object::SaaSposeResponse');
use_ok('AsposeCellsCloud::Object::ImportOption');
use_ok('AsposeCellsCloud::Object::ImportIntArrayOption');
use_ok('AsposeCellsCloud::Object::PasswordRequest');

require 't\CellsTestBase.pl';
my $new_client = get_client();
my $result =undef;
copy_to_temp_1();
my $BOOK1 = 'Book1.xlsx';
my $MYDOC = 'myDocument.xlsx';
my $PVTESTFILE = 'TestCase.xlsx';
my $TEMPFOLDER = 'Temp';
my $SHEET1 = 'Sheet1';
my $SHEET2 = 'Sheet2';
my $SHEET3 = 'Sheet3';
my $SHEET4 = 'Sheet4';
my $SHEET5 = 'Sheet5';
my $SHEET6 = 'Sheet6';
my $SHEET7 = 'Sheet7';
my $SHEET8 = 'Sheet8';
my $CELLNAME = 'A1';
my $RANGE = 'A1:C10';
my $CELLAREA = 'A1:C10';

use_ok('AsposeCellsCloud::CellsWorkbookApi');

my $api = AsposeCellsCloud::CellsWorkbookApi->new($new_client);
isa_ok($api, 'AsposeCellsCloud::CellsWorkbookApi');

#
# cells_workbook_post_encrypt_document test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $encryption = AsposeCellsCloud::Object::WorkbookEncryptionRequest->new(
        Password=>'123456',
        KeyLength =>128, 
        EncryptionType=>'XOR'); # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_encrypt_document(name => $name, encryption => $encryption, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_encrypt_document OK');
}

#
# cells_workbook_delete_decrypt_document test 
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $encryption = AsposeCellsCloud::Object::WorkbookEncryptionRequest->new(
        Password=>'123456' ,
        KeyLength =>128 ,
        EncryptionType =>'XOR' );  # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_delete_decrypt_document(name => $name, encryption => $encryption, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_delete_decrypt_document OK');
}

#
# cells_workbook_delete_document_unprotect_from_changes test 
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_delete_document_unprotect_from_changes(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_delete_document_unprotect_from_changes OK');
}

#
# cells_workbook_delete_unprotect_document test 
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $protection = AsposeCellsCloud::Object::WorkbookProtectionRequest->new( Password=>'123456', ProtectionType=>'All '); # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_delete_unprotect_document(name => $name, protection => $protection, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_delete_unprotect_document OK');
}



#
# cells_workbook_get_workbook test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $password = undef; # replace NULL with a proper value
    my $is_auto_fit = 'true'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook(name => $name, password => $password, is_auto_fit => $is_auto_fit, folder => $folder);    
}

#
# cells_workbook_get_workbook_default_style test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_default_style(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_default_style OK');
}

#
# cells_workbook_get_workbook_name test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $name_name = 'Name_3'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_name(name => $name, name_name => $name_name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_name OK');
}

#
# cells_workbook_get_workbook_name_value test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $name_name = 'Name_3'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_name_value(name => $name, name_name => $name_name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_name_value OK');
}

#
# cells_workbook_get_workbook_names test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_names(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_names OK');
}

#
# cells_workbook_get_workbook_settings test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_settings(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_settings OK');
}

#
# cells_workbook_get_workbook_text_items test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_get_workbook_text_items(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_get_workbook_text_items OK');
}

#
# cells_workbook_post_autofit_workbook_rows test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $auto_fitter_options = undef; # replace NULL with a proper value
    my $start_row = 1; # replace NULL with a proper value
    my $end_row = 100; # replace NULL with a proper value
    my $only_auto = 'true'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_autofit_workbook_rows(name => $name, auto_fitter_options => $auto_fitter_options, start_row => $start_row, end_row => $end_row, only_auto => $only_auto, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_autofit_workbook_rows OK');
}


#
# cells_workbook_post_import_data test 
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my @intarray = qw(1 2 3 4) ;
    my $importdata =  ' {"FirstRow":1,"FirstColumn":2,"IsVertical":true,"Data":[1,2,3],"DestinationWorksheet":"Sheet1","IsInsert":true,"ImportDataType":"IntArray","Source":null}';
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_import_data(name => $name, importdata => $importdata, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_import_data OK');
}

#
# cells_workbook_post_protect_document test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $protection = AsposeCellsCloud::Object::WorkbookProtectionRequest->new( Password=>undef, ProtectionType=>'All'); # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_protect_document(name => $name, protection => $protection, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_protect_document OK');
}

#
# cells_workbook_post_workbook_calculate_formula test
#
{
    copy_to_temp_1();
    my $name = $BOOK1; # replace NULL with a proper value
    my $options = AsposeCellsCloud::Object::CalculationOptions->new(IgnoreError=>'true'); # replace NULL with a proper value
    my $ignore_error = 'true'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbook_calculate_formula(name => $name, options => $options, ignore_error => $ignore_error, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbook_calculate_formula OK');
}

#
# cells_workbook_post_workbook_get_smart_marker_result test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $xml_file = 'ReportData.xml'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    my $out_path = undef; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbook_get_smart_marker_result(name => $name, xml_file => $xml_file, folder => $folder, out_path => $out_path);   
}

#
# cells_workbook_post_workbook_settings test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $settings = AsposeCellsCloud::Object::WorkbookSettings->new (AutoCompressPictures=>'true'); # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbook_settings(name => $name, settings => $settings, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbook_settings OK');
}

#
# cells_workbook_post_workbook_split test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $format = 'png'; # replace NULL with a proper value
    my $from = 1; # replace NULL with a proper value
    my $to = 3; # replace NULL with a proper value
    my $horizontal_resolution = 100; # replace NULL with a proper value
    my $vertical_resolution = 90; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbook_split(name => $name, format => $format, from => $from, to => $to, horizontal_resolution => $horizontal_resolution, vertical_resolution => $vertical_resolution, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbook_split OK');
}

#
# cells_workbook_post_workbooks_merge test
#
{
    copy_to_temp_1();
    copy_to_temp_2();
    my $name = $BOOK1; # replace NULL with a proper value
    my $merge_with = 'myDocument.xlsx'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbooks_merge(name => $name, merge_with => $merge_with, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbooks_merge OK');
}

#
# cells_workbook_post_workbooks_text_replace test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $old_value = 'undef111'; # replace NULL with a proper value
    my $new_value = 'undef'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbooks_text_replace(name => $name, old_value => $old_value, new_value => $new_value, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbooks_text_replace OK');
}

#
# cells_workbook_post_workbooks_text_search test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $text = 'test'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_post_workbooks_text_search(name => $name, text => $text, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_post_workbooks_text_search OK');
}

#
# cells_workbook_put_convert_workbook test
#
{
    my $format = 'pdf'; # replace NULL with a proper value
    my $password = undef; # replace NULL with a proper value
    my $out_path = undef; # replace NULL with a proper value
    my $Book1_data =undef;
    my @fileinfos = stat("D:\\Projects\\Aspose\\Aspose.Cloud\\Aspose.Cells.Cloud.SDK\\src\\TestData\\Book1.xlsx");
    my $filelength = @fileinfos[7];
    print $filelength;
    open(DATA, "<D:\\Projects\\Aspose\\Aspose.Cloud\\Aspose.Cells.Cloud.SDK\\src\\TestData\\Book1.xlsx") or die "file.txt 文件无法打开, $!";
    binmode(DATA);
    # while( read (DATA, $Book1_data, 8)) {};
    read (DATA, $Book1_data, $filelength);
    close (DATA);
    print "read file.";
    $result = $api->cells_workbook_put_convert_workbook( workbook => $Book1_data, format => $format, password => $password, out_path => $out_path);
}

#
# cells_workbook_put_document_protect_from_changes test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $password = AsposeCellsCloud::Object::PasswordRequest->new(Password=>'123456'); # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_put_document_protect_from_changes(name => $name, password => $password, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_put_document_protect_from_changes OK');
}

#
# cells_workbook_put_workbook_create test
#
{
    copy_to_temp_1();
    my $name = 'NewBook'.$BOOK1; # replace NULL with a proper value
    my $template_file = $BOOK1; # replace NULL with a proper value
    my $data_file = 'ReportData.xml'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_put_workbook_create(name => $name, template_file => $template_file, data_file => $data_file, folder => $folder);
}

#
# cells_workbook_delete_workbook_name test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $name_name = 'Name_2'; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_delete_workbook_name(name => $name, name_name => $name_name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_delete_workbook_name OK');
}

#
# cells_workbook_delete_workbook_names test
#
{
    my $name = $BOOK1; # replace NULL with a proper value
    my $folder = $TEMPFOLDER; # replace NULL with a proper value
    $result = $api->cells_workbook_delete_workbook_names(name => $name, folder => $folder);
    ok($result->status eq 'OK' ,'cells_workbook_delete_workbook_names OK');
}
1;
