@@ -117,6 +117,73 @@ def convert_document_with_http_info(request)
117117 end
118118
119119
120+ # Converts input document file to format specified
121+ #
122+ # @param request convert_document_direct_request
123+ # @return [File]
124+ def convert_document_direct ( request )
125+ data , _status_code , _headers = convert_document_direct_with_http_info ( request )
126+ data
127+ end
128+
129+ # Converts input document file to format specified
130+ #
131+ # @param request convert_document_direct_request
132+ # @return [Array<(File, Fixnum, Hash)>]
133+ # File data, response status code and response headers
134+ def convert_document_direct_with_http_info ( request )
135+ raise ArgumentError , 'Incorrect request type' unless request . is_a? ConvertDocumentDirectRequest
136+
137+ @api_client . config . logger . debug 'Calling API: ConvertApi.convert_document_direct ...' if @api_client . config . debugging
138+ # verify the required parameter 'format' is set
139+ raise ArgumentError , 'Missing the required parameter format when calling ConvertApi.convert_document_direct' if @api_client . config . client_side_validation && request . format . nil?
140+ # verify the required parameter 'file' is set
141+ raise ArgumentError , 'Missing the required parameter file when calling ConvertApi.convert_document_direct' if @api_client . config . client_side_validation && request . file . nil?
142+ # resource path
143+ local_var_path = '/conversion'
144+
145+ # query parameters
146+ query_params = { }
147+ query_params [ downcase_first_letter ( 'format' ) ] = request . format
148+
149+ if local_var_path . include? ( '{' + downcase_first_letter ( 'fromPage' ) + '}' )
150+ local_var_path = local_var_path . sub ( '{' + downcase_first_letter ( 'fromPage' ) + '}' , request . from_page . to_s )
151+ else
152+ query_params [ downcase_first_letter ( 'fromPage' ) ] = request . from_page unless request . from_page . nil?
153+ end
154+ if local_var_path . include? ( '{' + downcase_first_letter ( 'pagesCount' ) + '}' )
155+ local_var_path = local_var_path . sub ( '{' + downcase_first_letter ( 'pagesCount' ) + '}' , request . pages_count . to_s )
156+ else
157+ query_params [ downcase_first_letter ( 'pagesCount' ) ] = request . pages_count unless request . pages_count . nil?
158+ end
159+
160+ # header parameters
161+ header_params = { }
162+ # HTTP header 'Accept' (if needed)
163+ header_params [ 'Accept' ] = @api_client . select_header_accept ( [ 'application/json' ] )
164+ # HTTP header 'Content-Type'
165+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( [ 'multipart/form-data' ] )
166+
167+ # form parameters
168+ form_params = { }
169+ form_params [ downcase_first_letter ( 'File' ) ] = request . file
170+
171+ # http body (model)
172+ post_body = nil
173+ data , status_code , headers = @api_client . call_api ( :PUT , local_var_path ,
174+ header_params : header_params ,
175+ query_params : query_params ,
176+ form_params : form_params ,
177+ body : post_body ,
178+ access_token : get_access_token ,
179+ return_type : 'File' )
180+ if @api_client . config . debugging
181+ @api_client . config . logger . debug "API called:
182+ ConvertApi#convert_document_direct\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
183+ end
184+ [ data , status_code , headers ]
185+ end
186+
120187 #
121188 # Helper method to convert first letter to downcase
122189 #
@@ -216,3 +283,60 @@ def initialize(convert_settings)
216283 end
217284 end
218285end
286+ #
287+ # --------------------------------------------------------------------------------------------------------------------
288+ # <copyright company="Aspose Pty Ltd" file="convert_document_direct_request.rb">
289+ # Copyright (c) 2003-2020 Aspose Pty Ltd
290+ # </copyright>
291+ # <summary>
292+ # Permission is hereby granted, free of charge, to any person obtaining a copy
293+ # of this software and associated documentation files (the "Software"), to deal
294+ # in the Software without restriction, including without limitation the rights
295+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
296+ # copies of the Software, and to permit persons to whom the Software is
297+ # furnished to do so, subject to the following conditions:
298+ #
299+ # The above copyright notice and this permission notice shall be included in all
300+ # copies or substantial portions of the Software.
301+ #
302+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
303+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
304+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
305+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
306+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
307+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
308+ # SOFTWARE.
309+ # </summary>
310+ # --------------------------------------------------------------------------------------------------------------------
311+ #
312+
313+ module GroupDocsConversionCloud
314+
315+ #
316+ # Request model for convert_document_direct operation.
317+ #
318+ class ConvertDocumentDirectRequest
319+
320+ # Requested conversion format
321+ attr_accessor :format
322+ # Input file to convert
323+ attr_accessor :file
324+ # Page start conversion from
325+ attr_accessor :from_page
326+ # Number of pages to convert
327+ attr_accessor :pages_count
328+
329+ #
330+ # Initializes a new instance.
331+ # @param format Requested conversion format
332+ # @param file Input file to convert
333+ # @param from_page Page start conversion from
334+ # @param pages_count Number of pages to convert
335+ def initialize ( format , file , from_page = nil , pages_count = nil )
336+ self . format = format
337+ self . file = file
338+ self . from_page = from_page
339+ self . pages_count = pages_count
340+ end
341+ end
342+ end
0 commit comments