cloudmersive-convert-api-client 2.2.0 → 2.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -7
  3. data/docs/DocumentEditingEditSession.md +9 -0
  4. data/docs/DocumentTransformEditSession.md +9 -0
  5. data/docs/DocxContentControl.md +8 -0
  6. data/docs/DocxSetFormFieldsRequest.md +10 -0
  7. data/docs/DocxTableSingleTableFill.md +10 -0
  8. data/docs/DocxTableTableFillMultiRequest.md +10 -0
  9. data/docs/DocxTableTableFillRequest.md +12 -0
  10. data/docs/DocxTableTableFillTableCell.md +9 -0
  11. data/docs/DocxTableTableFillTableRow.md +8 -0
  12. data/docs/EditDocumentApi.md +223 -3
  13. data/docs/FillHandlebarFormField.md +9 -0
  14. data/docs/GetDocxContentControlsResponse.md +9 -0
  15. data/docs/GetDocxGetFormFieldsResponse.md +10 -0
  16. data/docs/HandlebarFormField.md +8 -0
  17. data/docs/TransformDocumentApi.md +237 -6
  18. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +220 -2
  19. data/lib/cloudmersive-convert-api-client/api/transform_document_api.rb +235 -4
  20. data/lib/cloudmersive-convert-api-client/models/document_editing_edit_session.rb +196 -0
  21. data/lib/cloudmersive-convert-api-client/models/document_transform_edit_session.rb +196 -0
  22. data/lib/cloudmersive-convert-api-client/models/docx_content_control.rb +186 -0
  23. data/lib/cloudmersive-convert-api-client/models/docx_set_form_fields_request.rb +223 -0
  24. data/lib/cloudmersive-convert-api-client/models/docx_table_single_table_fill.rb +208 -0
  25. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_multi_request.rb +223 -0
  26. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_request.rb +243 -0
  27. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_cell.rb +196 -0
  28. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_table_row.rb +188 -0
  29. data/lib/cloudmersive-convert-api-client/models/fill_handlebar_form_field.rb +196 -0
  30. data/lib/cloudmersive-convert-api-client/models/get_docx_content_controls_response.rb +198 -0
  31. data/lib/cloudmersive-convert-api-client/models/get_docx_get_form_fields_response.rb +210 -0
  32. data/lib/cloudmersive-convert-api-client/models/handlebar_form_field.rb +186 -0
  33. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  34. data/lib/cloudmersive-convert-api-client.rb +13 -0
  35. data/spec/api/edit_document_api_spec.rb +49 -1
  36. data/spec/api/transform_document_api_spec.rb +54 -2
  37. data/spec/models/document_editing_edit_session_spec.rb +47 -0
  38. data/spec/models/document_transform_edit_session_spec.rb +47 -0
  39. data/spec/models/docx_content_control_spec.rb +41 -0
  40. data/spec/models/docx_set_form_fields_request_spec.rb +53 -0
  41. data/spec/models/docx_table_single_table_fill_spec.rb +53 -0
  42. data/spec/models/docx_table_table_fill_multi_request_spec.rb +53 -0
  43. data/spec/models/docx_table_table_fill_request_spec.rb +65 -0
  44. data/spec/models/docx_table_table_fill_table_cell_spec.rb +47 -0
  45. data/spec/models/docx_table_table_fill_table_row_spec.rb +41 -0
  46. data/spec/models/fill_handlebar_form_field_spec.rb +47 -0
  47. data/spec/models/get_docx_content_controls_response_spec.rb +47 -0
  48. data/spec/models/get_docx_get_form_fields_response_spec.rb +53 -0
  49. data/spec/models/handlebar_form_field_spec.rb +41 -0
  50. metadata +41 -2
@@ -0,0 +1,208 @@
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: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Single table fill request in a multi-table fill operation
17
+ class DocxTableSingleTableFill
18
+ # Start tag that delineates the beginning of the table
19
+ attr_accessor :table_start_tag
20
+
21
+ # End tag that delineates the end of the table
22
+ attr_accessor :table_end_tag
23
+
24
+ # Data set to populate the table with
25
+ attr_accessor :data_to_fill_in
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'table_start_tag' => :'TableStartTag',
31
+ :'table_end_tag' => :'TableEndTag',
32
+ :'data_to_fill_in' => :'DataToFillIn'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'table_start_tag' => :'String',
40
+ :'table_end_tag' => :'String',
41
+ :'data_to_fill_in' => :'Array<DocxTableTableFillTableRow>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'TableStartTag')
54
+ self.table_start_tag = attributes[:'TableStartTag']
55
+ end
56
+
57
+ if attributes.has_key?(:'TableEndTag')
58
+ self.table_end_tag = attributes[:'TableEndTag']
59
+ end
60
+
61
+ if attributes.has_key?(:'DataToFillIn')
62
+ if (value = attributes[:'DataToFillIn']).is_a?(Array)
63
+ self.data_to_fill_in = value
64
+ end
65
+ end
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
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ table_start_tag == o.table_start_tag &&
87
+ table_end_tag == o.table_end_tag &&
88
+ data_to_fill_in == o.data_to_fill_in
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Fixnum] Hash code
99
+ def hash
100
+ [table_start_tag, table_end_tag, data_to_fill_in].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.swagger_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :BOOLEAN
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
161
+ temp_model.build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ next if value.nil?
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+
207
+ end
208
+ end
@@ -0,0 +1,223 @@
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: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Request to update data in a table in a Word DOCX Document
17
+ class DocxTableTableFillMultiRequest
18
+ # Optional; Input URL of the document; use BeginEditing to create this
19
+ attr_accessor :input_file_url
20
+
21
+ # Optional; Input Word Document file content for the operation
22
+ attr_accessor :input_file_data
23
+
24
+ # Tables and datasets to fill into the document
25
+ attr_accessor :tables_to_fill
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'input_file_url' => :'InputFileUrl',
31
+ :'input_file_data' => :'InputFileData',
32
+ :'tables_to_fill' => :'TablesToFill'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'input_file_url' => :'String',
40
+ :'input_file_data' => :'String',
41
+ :'tables_to_fill' => :'Array<DocxTableSingleTableFill>'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'InputFileUrl')
54
+ self.input_file_url = attributes[:'InputFileUrl']
55
+ end
56
+
57
+ if attributes.has_key?(:'InputFileData')
58
+ self.input_file_data = attributes[:'InputFileData']
59
+ end
60
+
61
+ if attributes.has_key?(:'TablesToFill')
62
+ if (value = attributes[:'TablesToFill']).is_a?(Array)
63
+ self.tables_to_fill = value
64
+ end
65
+ end
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_data.nil? && @input_file_data !~ 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_data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
74
+ end
75
+
76
+ 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_data.nil? && @input_file_data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
83
+ true
84
+ end
85
+
86
+ # Custom attribute writer method with validation
87
+ # @param [Object] input_file_data Value to be assigned
88
+ def input_file_data=(input_file_data)
89
+ if !input_file_data.nil? && input_file_data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
90
+ fail ArgumentError, 'invalid value for "input_file_data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
91
+ end
92
+
93
+ @input_file_data = input_file_data
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ input_file_url == o.input_file_url &&
102
+ input_file_data == o.input_file_data &&
103
+ tables_to_fill == o.tables_to_fill
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [input_file_url, input_file_data, tables_to_fill].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -0,0 +1,243 @@
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: 2.4.14
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Request to update data in a table in a Word DOCX Document
17
+ class DocxTableTableFillRequest
18
+ # Optional; Input URL of the document; use BeginEditing to create this
19
+ attr_accessor :input_file_url
20
+
21
+ # Optional; Input Word Document file content for the operation
22
+ attr_accessor :input_file_data
23
+
24
+ # Start tag that delineates the beginning of the table
25
+ attr_accessor :table_start_tag
26
+
27
+ # End tag that delineates the end of the table
28
+ attr_accessor :table_end_tag
29
+
30
+ # Data set to populate the table with
31
+ attr_accessor :data_to_fill_in
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'input_file_url' => :'InputFileUrl',
37
+ :'input_file_data' => :'InputFileData',
38
+ :'table_start_tag' => :'TableStartTag',
39
+ :'table_end_tag' => :'TableEndTag',
40
+ :'data_to_fill_in' => :'DataToFillIn'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'input_file_url' => :'String',
48
+ :'input_file_data' => :'String',
49
+ :'table_start_tag' => :'String',
50
+ :'table_end_tag' => :'String',
51
+ :'data_to_fill_in' => :'Array<DocxTableTableFillTableRow>'
52
+ }
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ return unless attributes.is_a?(Hash)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
+
63
+ if attributes.has_key?(:'InputFileUrl')
64
+ self.input_file_url = attributes[:'InputFileUrl']
65
+ end
66
+
67
+ if attributes.has_key?(:'InputFileData')
68
+ self.input_file_data = attributes[:'InputFileData']
69
+ end
70
+
71
+ if attributes.has_key?(:'TableStartTag')
72
+ self.table_start_tag = attributes[:'TableStartTag']
73
+ end
74
+
75
+ if attributes.has_key?(:'TableEndTag')
76
+ self.table_end_tag = attributes[:'TableEndTag']
77
+ end
78
+
79
+ if attributes.has_key?(:'DataToFillIn')
80
+ if (value = attributes[:'DataToFillIn']).is_a?(Array)
81
+ self.data_to_fill_in = value
82
+ end
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if !@input_file_data.nil? && @input_file_data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
91
+ invalid_properties.push('invalid value for "input_file_data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.')
92
+ end
93
+
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ return false if !@input_file_data.nil? && @input_file_data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
101
+ true
102
+ end
103
+
104
+ # Custom attribute writer method with validation
105
+ # @param [Object] input_file_data Value to be assigned
106
+ def input_file_data=(input_file_data)
107
+ if !input_file_data.nil? && input_file_data !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/)
108
+ fail ArgumentError, 'invalid value for "input_file_data", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.'
109
+ end
110
+
111
+ @input_file_data = input_file_data
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ input_file_url == o.input_file_url &&
120
+ input_file_data == o.input_file_data &&
121
+ table_start_tag == o.table_start_tag &&
122
+ table_end_tag == o.table_end_tag &&
123
+ data_to_fill_in == o.data_to_fill_in
124
+ end
125
+
126
+ # @see the `==` method
127
+ # @param [Object] Object to be compared
128
+ def eql?(o)
129
+ self == o
130
+ end
131
+
132
+ # Calculates hash code according to all attributes.
133
+ # @return [Fixnum] Hash code
134
+ def hash
135
+ [input_file_url, input_file_data, table_start_tag, table_end_tag, data_to_fill_in].hash
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.swagger_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :DateTime
165
+ DateTime.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :BOOLEAN
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
196
+ temp_model.build_from_hash(value)
197
+ end
198
+ end
199
+
200
+ # Returns the string representation of the object
201
+ # @return [String] String presentation of the object
202
+ def to_s
203
+ to_hash.to_s
204
+ end
205
+
206
+ # to_body is an alias to to_hash (backward compatibility)
207
+ # @return [Hash] Returns the object in the form of hash
208
+ def to_body
209
+ to_hash
210
+ end
211
+
212
+ # Returns the object in the form of hash
213
+ # @return [Hash] Returns the object in the form of hash
214
+ def to_hash
215
+ hash = {}
216
+ self.class.attribute_map.each_pair do |attr, param|
217
+ value = self.send(attr)
218
+ next if value.nil?
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+ end