cloudmersive-convert-api-client 1.2.3 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +201 -0
  3. data/build.ps1 +12 -0
  4. data/client/Gemfile +7 -0
  5. data/client/README.md +184 -0
  6. data/client/Rakefile +8 -0
  7. data/client/cloudmersive-convert-api-client.gemspec +45 -0
  8. data/client/docs/CompareDocumentApi.md +66 -0
  9. data/client/docs/ConvertDataApi.md +118 -0
  10. data/client/docs/ConvertDocumentApi.md +723 -0
  11. data/client/docs/ConvertImageApi.md +69 -0
  12. data/client/docs/ConvertTemplateApi.md +63 -0
  13. data/client/docs/ConvertWebApi.md +283 -0
  14. data/client/docs/ConvertedPngPage.md +9 -0
  15. data/client/docs/DocumentValidationError.md +11 -0
  16. data/client/docs/DocumentValidationResult.md +11 -0
  17. data/client/docs/DocxFooter.md +9 -0
  18. data/client/docs/DocxHeader.md +9 -0
  19. data/client/docs/DocxInsertImageRequest.md +13 -0
  20. data/client/docs/DocxInsertImageResponse.md +9 -0
  21. data/client/docs/DocxParagraph.md +10 -0
  22. data/client/docs/DocxRun.md +14 -0
  23. data/client/docs/DocxSection.md +8 -0
  24. data/client/docs/DocxSetFooterRequest.md +10 -0
  25. data/client/docs/DocxSetFooterResponse.md +9 -0
  26. data/client/docs/DocxSetHeaderRequest.md +10 -0
  27. data/client/docs/DocxSetHeaderResponse.md +9 -0
  28. data/client/docs/DocxStyle.md +13 -0
  29. data/client/docs/DocxTable.md +45 -0
  30. data/client/docs/DocxTableCell.md +14 -0
  31. data/client/docs/DocxTableRow.md +9 -0
  32. data/client/docs/DocxText.md +9 -0
  33. data/client/docs/EditDocumentApi.md +668 -0
  34. data/client/docs/FinishEditingRequest.md +8 -0
  35. data/client/docs/GetDocxHeadersAndFootersRequest.md +9 -0
  36. data/client/docs/GetDocxHeadersAndFootersResponse.md +10 -0
  37. data/client/docs/GetDocxStylesRequest.md +9 -0
  38. data/client/docs/GetDocxStylesResponse.md +9 -0
  39. data/client/docs/GetDocxTablesRequest.md +9 -0
  40. data/client/docs/GetDocxTablesResponse.md +9 -0
  41. data/client/docs/HtmlMdResult.md +9 -0
  42. data/client/docs/HtmlTemplateApplicationRequest.md +10 -0
  43. data/client/docs/HtmlTemplateApplicationResponse.md +9 -0
  44. data/client/docs/HtmlTemplateOperation.md +10 -0
  45. data/client/docs/HtmlToOfficeRequest.md +8 -0
  46. data/client/docs/HtmlToPdfRequest.md +9 -0
  47. data/client/docs/InsertDocxTablesRequest.md +10 -0
  48. data/client/docs/InsertDocxTablesResponse.md +9 -0
  49. data/client/docs/MergeDocumentApi.md +182 -0
  50. data/client/docs/PdfToPngResult.md +9 -0
  51. data/client/docs/RemoveDocxHeadersAndFootersRequest.md +11 -0
  52. data/client/docs/RemoveDocxHeadersAndFootersResponse.md +9 -0
  53. data/client/docs/ReplaceStringRequest.md +12 -0
  54. data/client/docs/ScreenshotRequest.md +9 -0
  55. data/client/docs/ValidateDocumentApi.md +173 -0
  56. data/client/docs/ViewerResponse.md +9 -0
  57. data/client/docs/ViewerToolsApi.md +63 -0
  58. data/client/git_push.sh +55 -0
  59. data/client/lib/cloudmersive-convert-api-client.rb +89 -0
  60. data/client/lib/cloudmersive-convert-api-client/api/compare_document_api.rb +86 -0
  61. data/client/lib/cloudmersive-convert-api-client/api/convert_data_api.rb +135 -0
  62. data/client/lib/cloudmersive-convert-api-client/api/convert_document_api.rb +751 -0
  63. data/client/lib/cloudmersive-convert-api-client/api/convert_image_api.rb +91 -0
  64. data/client/lib/cloudmersive-convert-api-client/api/convert_template_api.rb +78 -0
  65. data/client/lib/cloudmersive-convert-api-client/api/convert_web_api.rb +299 -0
  66. data/client/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +684 -0
  67. data/client/lib/cloudmersive-convert-api-client/api/merge_document_api.rb +212 -0
  68. data/client/lib/cloudmersive-convert-api-client/api/validate_document_api.rb +191 -0
  69. data/client/lib/cloudmersive-convert-api-client/api/viewer_tools_api.rb +79 -0
  70. data/client/lib/cloudmersive-convert-api-client/api_client.rb +389 -0
  71. data/client/lib/cloudmersive-convert-api-client/api_error.rb +38 -0
  72. data/client/lib/cloudmersive-convert-api-client/configuration.rb +209 -0
  73. data/client/lib/cloudmersive-convert-api-client/models/converted_png_page.rb +199 -0
  74. data/client/lib/cloudmersive-convert-api-client/models/document_validation_error.rb +219 -0
  75. data/client/lib/cloudmersive-convert-api-client/models/document_validation_result.rb +221 -0
  76. data/client/lib/cloudmersive-convert-api-client/models/docx_footer.rb +203 -0
  77. data/client/lib/cloudmersive-convert-api-client/models/docx_header.rb +203 -0
  78. data/client/lib/cloudmersive-convert-api-client/models/docx_insert_image_request.rb +271 -0
  79. data/client/lib/cloudmersive-convert-api-client/models/docx_insert_image_response.rb +199 -0
  80. data/client/lib/cloudmersive-convert-api-client/models/docx_paragraph.rb +211 -0
  81. data/client/lib/cloudmersive-convert-api-client/models/docx_run.rb +251 -0
  82. data/client/lib/cloudmersive-convert-api-client/models/docx_section.rb +191 -0
  83. data/client/lib/cloudmersive-convert-api-client/models/docx_set_footer_request.rb +225 -0
  84. data/client/lib/cloudmersive-convert-api-client/models/docx_set_footer_response.rb +199 -0
  85. data/client/lib/cloudmersive-convert-api-client/models/docx_set_header_request.rb +225 -0
  86. data/client/lib/cloudmersive-convert-api-client/models/docx_set_header_response.rb +199 -0
  87. data/client/lib/cloudmersive-convert-api-client/models/docx_style.rb +239 -0
  88. data/client/lib/cloudmersive-convert-api-client/models/docx_table.rb +561 -0
  89. data/client/lib/cloudmersive-convert-api-client/models/docx_table_cell.rb +251 -0
  90. data/client/lib/cloudmersive-convert-api-client/models/docx_table_row.rb +201 -0
  91. data/client/lib/cloudmersive-convert-api-client/models/docx_text.rb +199 -0
  92. data/client/lib/cloudmersive-convert-api-client/models/finish_editing_request.rb +189 -0
  93. data/client/lib/cloudmersive-convert-api-client/models/get_docx_headers_and_footers_request.rb +215 -0
  94. data/client/lib/cloudmersive-convert-api-client/models/get_docx_headers_and_footers_response.rb +211 -0
  95. data/client/lib/cloudmersive-convert-api-client/models/get_docx_styles_request.rb +215 -0
  96. data/client/lib/cloudmersive-convert-api-client/models/get_docx_styles_response.rb +201 -0
  97. data/client/lib/cloudmersive-convert-api-client/models/get_docx_tables_request.rb +215 -0
  98. data/client/lib/cloudmersive-convert-api-client/models/get_docx_tables_response.rb +201 -0
  99. data/client/lib/cloudmersive-convert-api-client/models/html_md_result.rb +199 -0
  100. data/client/lib/cloudmersive-convert-api-client/models/html_template_application_request.rb +208 -0
  101. data/client/lib/cloudmersive-convert-api-client/models/html_template_application_response.rb +197 -0
  102. data/client/lib/cloudmersive-convert-api-client/models/html_template_operation.rb +239 -0
  103. data/client/lib/cloudmersive-convert-api-client/models/html_to_office_request.rb +188 -0
  104. data/client/lib/cloudmersive-convert-api-client/models/html_to_pdf_request.rb +197 -0
  105. data/client/lib/cloudmersive-convert-api-client/models/insert_docx_tables_request.rb +225 -0
  106. data/client/lib/cloudmersive-convert-api-client/models/insert_docx_tables_response.rb +199 -0
  107. data/client/lib/cloudmersive-convert-api-client/models/pdf_to_png_result.rb +201 -0
  108. data/client/lib/cloudmersive-convert-api-client/models/remove_docx_headers_and_footers_request.rb +235 -0
  109. data/client/lib/cloudmersive-convert-api-client/models/remove_docx_headers_and_footers_response.rb +199 -0
  110. data/client/lib/cloudmersive-convert-api-client/models/replace_string_request.rb +245 -0
  111. data/client/lib/cloudmersive-convert-api-client/models/screenshot_request.rb +197 -0
  112. data/client/lib/cloudmersive-convert-api-client/models/viewer_response.rb +197 -0
  113. data/client/lib/cloudmersive-convert-api-client/version.rb +15 -0
  114. data/client/spec/api/compare_document_api_spec.rb +48 -0
  115. data/client/spec/api/convert_data_api_spec.rb +59 -0
  116. data/client/spec/api/convert_document_api_spec.rb +191 -0
  117. data/client/spec/api/convert_image_api_spec.rb +49 -0
  118. data/client/spec/api/convert_template_api_spec.rb +47 -0
  119. data/client/spec/api/convert_web_api_spec.rb +95 -0
  120. data/client/spec/api/edit_document_api_spec.rb +179 -0
  121. data/client/spec/api/merge_document_api_spec.rb +74 -0
  122. data/client/spec/api/validate_document_api_spec.rb +71 -0
  123. data/client/spec/api/viewer_tools_api_spec.rb +47 -0
  124. data/client/spec/api_client_spec.rb +226 -0
  125. data/client/spec/configuration_spec.rb +42 -0
  126. data/client/spec/models/converted_png_page_spec.rb +48 -0
  127. data/client/spec/models/document_validation_error_spec.rb +60 -0
  128. data/client/spec/models/document_validation_result_spec.rb +60 -0
  129. data/client/spec/models/docx_footer_spec.rb +48 -0
  130. data/client/spec/models/docx_header_spec.rb +48 -0
  131. data/client/spec/models/docx_insert_image_request_spec.rb +72 -0
  132. data/client/spec/models/docx_insert_image_response_spec.rb +48 -0
  133. data/client/spec/models/docx_paragraph_spec.rb +54 -0
  134. data/client/spec/models/docx_run_spec.rb +78 -0
  135. data/client/spec/models/docx_section_spec.rb +42 -0
  136. data/client/spec/models/docx_set_footer_request_spec.rb +54 -0
  137. data/client/spec/models/docx_set_footer_response_spec.rb +48 -0
  138. data/client/spec/models/docx_set_header_request_spec.rb +54 -0
  139. data/client/spec/models/docx_set_header_response_spec.rb +48 -0
  140. data/client/spec/models/docx_style_spec.rb +72 -0
  141. data/client/spec/models/docx_table_cell_spec.rb +78 -0
  142. data/client/spec/models/docx_table_row_spec.rb +48 -0
  143. data/client/spec/models/docx_table_spec.rb +264 -0
  144. data/client/spec/models/docx_text_spec.rb +48 -0
  145. data/client/spec/models/finish_editing_request_spec.rb +42 -0
  146. data/client/spec/models/get_docx_headers_and_footers_request_spec.rb +48 -0
  147. data/client/spec/models/get_docx_headers_and_footers_response_spec.rb +54 -0
  148. data/client/spec/models/get_docx_styles_request_spec.rb +48 -0
  149. data/client/spec/models/get_docx_styles_response_spec.rb +48 -0
  150. data/client/spec/models/get_docx_tables_request_spec.rb +48 -0
  151. data/client/spec/models/get_docx_tables_response_spec.rb +48 -0
  152. data/client/spec/models/html_md_result_spec.rb +48 -0
  153. data/client/spec/models/html_template_application_request_spec.rb +54 -0
  154. data/client/spec/models/html_template_application_response_spec.rb +48 -0
  155. data/client/spec/models/html_template_operation_spec.rb +58 -0
  156. data/client/spec/models/html_to_office_request_spec.rb +42 -0
  157. data/client/spec/models/html_to_pdf_request_spec.rb +48 -0
  158. data/client/spec/models/insert_docx_tables_request_spec.rb +54 -0
  159. data/client/spec/models/insert_docx_tables_response_spec.rb +48 -0
  160. data/client/spec/models/pdf_to_png_result_spec.rb +48 -0
  161. data/client/spec/models/remove_docx_headers_and_footers_request_spec.rb +60 -0
  162. data/client/spec/models/remove_docx_headers_and_footers_response_spec.rb +48 -0
  163. data/client/spec/models/replace_string_request_spec.rb +66 -0
  164. data/client/spec/models/screenshot_request_spec.rb +48 -0
  165. data/client/spec/models/viewer_response_spec.rb +48 -0
  166. data/client/spec/spec_helper.rb +111 -0
  167. data/cloudmersiveConvertApiClient-1.2.6.gem +0 -0
  168. data/cloudmersiveConvertApiClient-1.2.7.gem +0 -0
  169. data/packageconfig.json +11 -0
  170. data/swagger-codegen-cli.jar +0 -0
  171. metadata +173 -3
@@ -0,0 +1,188 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Details of the HTML to Office request
17
+ class HtmlToOfficeRequest
18
+ attr_accessor :html
19
+
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'html' => :'Html'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'html' => :'String'
32
+ }
33
+ end
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ def initialize(attributes = {})
38
+ return unless attributes.is_a?(Hash)
39
+
40
+ # convert string to symbol for hash key
41
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
42
+
43
+ if attributes.has_key?(:'Html')
44
+ self.html = attributes[:'Html']
45
+ end
46
+
47
+ end
48
+
49
+ # Show invalid properties with the reasons. Usually used together with valid?
50
+ # @return Array for valid properties with the reasons
51
+ def list_invalid_properties
52
+ invalid_properties = Array.new
53
+ return invalid_properties
54
+ end
55
+
56
+ # Check to see if the all the properties in the model are valid
57
+ # @return true if the model is valid
58
+ def valid?
59
+ return true
60
+ end
61
+
62
+ # Checks equality by comparing each attribute.
63
+ # @param [Object] Object to be compared
64
+ def ==(o)
65
+ return true if self.equal?(o)
66
+ self.class == o.class &&
67
+ html == o.html
68
+ end
69
+
70
+ # @see the `==` method
71
+ # @param [Object] Object to be compared
72
+ def eql?(o)
73
+ self == o
74
+ end
75
+
76
+ # Calculates hash code according to all attributes.
77
+ # @return [Fixnum] Hash code
78
+ def hash
79
+ [html].hash
80
+ end
81
+
82
+ # Builds the object from hash
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ # @return [Object] Returns the model itself
85
+ def build_from_hash(attributes)
86
+ return nil unless attributes.is_a?(Hash)
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /\AArray<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
93
+ end
94
+ elsif !attributes[self.class.attribute_map[key]].nil?
95
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
96
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
97
+ end
98
+
99
+ self
100
+ end
101
+
102
+ # Deserializes the data based on type
103
+ # @param string type Data type
104
+ # @param string value Value to be deserialized
105
+ # @return [Object] Deserialized data
106
+ def _deserialize(type, value)
107
+ case type.to_sym
108
+ when :DateTime
109
+ DateTime.parse(value)
110
+ when :Date
111
+ Date.parse(value)
112
+ when :String
113
+ value.to_s
114
+ when :Integer
115
+ value.to_i
116
+ when :Float
117
+ value.to_f
118
+ when :BOOLEAN
119
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
120
+ true
121
+ else
122
+ false
123
+ end
124
+ when :Object
125
+ # generic object (usually a Hash), return directly
126
+ value
127
+ when /\AArray<(?<inner_type>.+)>\z/
128
+ inner_type = Regexp.last_match[:inner_type]
129
+ value.map { |v| _deserialize(inner_type, v) }
130
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
131
+ k_type = Regexp.last_match[:k_type]
132
+ v_type = Regexp.last_match[:v_type]
133
+ {}.tap do |hash|
134
+ value.each do |k, v|
135
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
136
+ end
137
+ end
138
+ else # model
139
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
140
+ temp_model.build_from_hash(value)
141
+ end
142
+ end
143
+
144
+ # Returns the string representation of the object
145
+ # @return [String] String presentation of the object
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_hash (backward compatibility)
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_body
153
+ to_hash
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ next if value.nil?
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map{ |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+
186
+ end
187
+
188
+ end
@@ -0,0 +1,197 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Details of the HTML to PDF request
17
+ class HtmlToPdfRequest
18
+ attr_accessor :html
19
+
20
+ attr_accessor :extra_loading_wait
21
+
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'html' => :'Html',
27
+ :'extra_loading_wait' => :'ExtraLoadingWait'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'html' => :'String',
35
+ :'extra_loading_wait' => :'Integer'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
46
+
47
+ if attributes.has_key?(:'Html')
48
+ self.html = attributes[:'Html']
49
+ end
50
+
51
+ if attributes.has_key?(:'ExtraLoadingWait')
52
+ self.extra_loading_wait = attributes[:'ExtraLoadingWait']
53
+ end
54
+
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ return invalid_properties
62
+ end
63
+
64
+ # Check to see if the all the properties in the model are valid
65
+ # @return true if the model is valid
66
+ def valid?
67
+ return true
68
+ end
69
+
70
+ # Checks equality by comparing each attribute.
71
+ # @param [Object] Object to be compared
72
+ def ==(o)
73
+ return true if self.equal?(o)
74
+ self.class == o.class &&
75
+ html == o.html &&
76
+ extra_loading_wait == o.extra_loading_wait
77
+ end
78
+
79
+ # @see the `==` method
80
+ # @param [Object] Object to be compared
81
+ def eql?(o)
82
+ self == o
83
+ end
84
+
85
+ # Calculates hash code according to all attributes.
86
+ # @return [Fixnum] Hash code
87
+ def hash
88
+ [html, extra_loading_wait].hash
89
+ end
90
+
91
+ # Builds the object from hash
92
+ # @param [Hash] attributes Model attributes in the form of hash
93
+ # @return [Object] Returns the model itself
94
+ def build_from_hash(attributes)
95
+ return nil unless attributes.is_a?(Hash)
96
+ self.class.swagger_types.each_pair do |key, type|
97
+ if type =~ /\AArray<(.*)>/i
98
+ # check to ensure the input is an array given that the the attribute
99
+ # is documented as an array but the input is not
100
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
101
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
102
+ end
103
+ elsif !attributes[self.class.attribute_map[key]].nil?
104
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
105
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
106
+ end
107
+
108
+ self
109
+ end
110
+
111
+ # Deserializes the data based on type
112
+ # @param string type Data type
113
+ # @param string value Value to be deserialized
114
+ # @return [Object] Deserialized data
115
+ def _deserialize(type, value)
116
+ case type.to_sym
117
+ when :DateTime
118
+ DateTime.parse(value)
119
+ when :Date
120
+ Date.parse(value)
121
+ when :String
122
+ value.to_s
123
+ when :Integer
124
+ value.to_i
125
+ when :Float
126
+ value.to_f
127
+ when :BOOLEAN
128
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
129
+ true
130
+ else
131
+ false
132
+ end
133
+ when :Object
134
+ # generic object (usually a Hash), return directly
135
+ value
136
+ when /\AArray<(?<inner_type>.+)>\z/
137
+ inner_type = Regexp.last_match[:inner_type]
138
+ value.map { |v| _deserialize(inner_type, v) }
139
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
140
+ k_type = Regexp.last_match[:k_type]
141
+ v_type = Regexp.last_match[:v_type]
142
+ {}.tap do |hash|
143
+ value.each do |k, v|
144
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
145
+ end
146
+ end
147
+ else # model
148
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
149
+ temp_model.build_from_hash(value)
150
+ end
151
+ end
152
+
153
+ # Returns the string representation of the object
154
+ # @return [String] String presentation of the object
155
+ def to_s
156
+ to_hash.to_s
157
+ end
158
+
159
+ # to_body is an alias to to_hash (backward compatibility)
160
+ # @return [Hash] Returns the object in the form of hash
161
+ def to_body
162
+ to_hash
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = self.send(attr)
171
+ next if value.nil?
172
+ hash[param] = _to_hash(value)
173
+ end
174
+ hash
175
+ end
176
+
177
+ # Outputs non-array value in the form of hash
178
+ # For object, use to_hash. Otherwise, just return the value
179
+ # @param [Object] value Any valid value
180
+ # @return [Hash] Returns the value in the form of hash
181
+ def _to_hash(value)
182
+ if value.is_a?(Array)
183
+ value.compact.map{ |v| _to_hash(v) }
184
+ elsif value.is_a?(Hash)
185
+ {}.tap do |hash|
186
+ value.each { |k, v| hash[k] = _to_hash(v) }
187
+ end
188
+ elsif value.respond_to? :to_hash
189
+ value.to_hash
190
+ else
191
+ value
192
+ end
193
+ end
194
+
195
+ end
196
+
197
+ end
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #convertapi
3
+
4
+ #Convert API lets you effortlessly convert file formats and types.
5
+
6
+ OpenAPI spec version: v1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: unset
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Input to a Insert Tables request
17
+ class InsertDocxTablesRequest
18
+ # Optional: Bytes of the input file to operate on
19
+ attr_accessor :input_file_bytes
20
+
21
+ # Optional: URL of a file to operate on as input. This can be a public URL, or you can also use the begin-editing API to upload a document and pass in the secure URL result from that operation as the URL here (this URL is not public).
22
+ attr_accessor :input_file_url
23
+
24
+ # Table you would like to insert
25
+ attr_accessor :table_to_insert
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'input_file_bytes' => :'InputFileBytes',
32
+ :'input_file_url' => :'InputFileUrl',
33
+ :'table_to_insert' => :'TableToInsert'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'input_file_bytes' => :'String',
41
+ :'input_file_url' => :'String',
42
+ :'table_to_insert' => :'DocxTable'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ return unless attributes.is_a?(Hash)
50
+
51
+ # convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
+
54
+ if attributes.has_key?(:'InputFileBytes')
55
+ self.input_file_bytes = attributes[:'InputFileBytes']
56
+ end
57
+
58
+ if attributes.has_key?(:'InputFileUrl')
59
+ self.input_file_url = attributes[:'InputFileUrl']
60
+ end
61
+
62
+ if attributes.has_key?(:'TableToInsert')
63
+ self.table_to_insert = attributes[:'TableToInsert']
64
+ end
65
+
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
73
+ invalid_properties.push("invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.")
74
+ end
75
+
76
+ return invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if !@input_file_bytes.nil? && @input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
83
+ return true
84
+ end
85
+
86
+ # Custom attribute writer method with validation
87
+ # @param [Object] input_file_bytes Value to be assigned
88
+ def input_file_bytes=(input_file_bytes)
89
+
90
+ if !input_file_bytes.nil? && input_file_bytes !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
91
+ fail ArgumentError, "invalid value for 'input_file_bytes', must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."
92
+ end
93
+
94
+ @input_file_bytes = input_file_bytes
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ input_file_bytes == o.input_file_bytes &&
103
+ input_file_url == o.input_file_url &&
104
+ table_to_insert == o.table_to_insert
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Fixnum] Hash code
115
+ def hash
116
+ [input_file_bytes, input_file_url, table_to_insert].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+ self.class.swagger_types.each_pair do |key, type|
125
+ if type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :DateTime
146
+ DateTime.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :BOOLEAN
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
177
+ temp_model.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ hash[param] = _to_hash(value)
201
+ end
202
+ hash
203
+ end
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map{ |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+
223
+ end
224
+
225
+ end