require
5.6.0;
use
base (
"Class::Accessor"
,
"Class::Data::Inheritable"
);
__PACKAGE__->mk_classdata(
'attribute_map'
=> {});
__PACKAGE__->mk_classdata(
'method_documentation'
=> {});
__PACKAGE__->mk_classdata(
'class_documentation'
=> {});
sub
new {
my
(
$class
,
%args
) =
@_
;
my
$self
=
bless
{},
$class
;
foreach
my
$attribute
(
keys
%{
$class
->attribute_map}) {
my
$args_key
=
$class
->attribute_map->{
$attribute
};
$self
->
$attribute
(
$args
{
$args_key
} );
}
return
$self
;
}
{
my
$params
= {
'client'
=>{
data_type
=>
'ApiClient'
,
description
=>
'API Client.'
,
required
=>
'0'
,
}
};
__PACKAGE__->method_documentation->{
'post_convert_workbook_to_markdown'
} = {
summary
=>
'Convert Excel file to Markdown files.'
,
params
=>
$params
,
returns
=>
'FileInfo'
,
};
}
sub
run_http_request {
my
(
$self
,
%args
) =
@_
;
my
$client
=
$args
{
'client'
};
my
$_resource_path
=
'/cells/convert/markdown'
;
my
$_method
=
'POST'
;
my
$query_params
= {};
my
$header_params
= {};
my
$form_params
= {};
my
$_header_accept
=
$client
->select_header_accept(
'application/json'
);
if
(
$_header_accept
) {
$header_params
->{
'Accept'
} =
$_header_accept
;
}
$header_params
->{
'Content-Type'
} =
$client
->select_header_content_type(
'multipart/form-data'
);
if
(
defined
$self
->password){
$query_params
->{
'password'
} =
$client
->to_query_value(
$self
->password);
}
if
(
defined
$self
->check_excel_restriction){
$query_params
->{
'checkExcelRestriction'
} =
$client
->to_query_value(
$self
->check_excel_restriction);
}
if
(
defined
$self
->region){
$query_params
->{
'region'
} =
$client
->to_query_value(
$self
->region);
}
my
$_body_data
;
if
(
defined
$self
->file) {
my
$map_file
=
$self
->file;
while
(
my
(
$filename
,
$value
) =
each
(
%$map_file
) ) {
$form_params
->{
$filename
} = [
$value
,
$filename
,
'application/octet-stream'
];
}
}
my
$auth_settings
= [
qw()
];
my
$response
=
$client
->call_api(
$_resource_path
,
$_method
,
$query_params
,
$form_params
,
$header_params
,
$_body_data
,
$auth_settings
);
return
$response
;
}
__PACKAGE__->method_documentation({
'file'
=> {
datatype
=>
'string'
,
base_name
=>
'File'
,
description
=>
'File to upload'
,
format
=>
''
,
read_only
=>
''
,
},
'password'
=> {
datatype
=>
'string'
,
base_name
=>
'password'
,
description
=>
'The password needed to open an Excel file.'
,
format
=>
''
,
read_only
=>
''
,
},
'check_excel_restriction'
=> {
datatype
=>
'string'
,
base_name
=>
'checkExcelRestriction'
,
description
=>
'Whether check restriction of excel file when user modify cells related objects.'
,
format
=>
''
,
read_only
=>
''
,
},
'region'
=> {
datatype
=>
'string'
,
base_name
=>
'region'
,
description
=>
'The regional settings for workbook.'
,
format
=>
''
,
read_only
=>
''
,
},
});
__PACKAGE__->attribute_map( {
'file'
=>
'File'
,
'password'
=>
'password'
,
'check_excel_restriction'
=>
'checkExcelRestriction'
,
'region'
=>
'region'
} );
__PACKAGE__->mk_accessors(
keys
%{__PACKAGE__->attribute_map});
1;