cloudmersive-convert-api-client 2.2.1 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +25 -8
  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/EditDocumentApi.md +223 -3
  10. data/docs/FillHandlebarFormField.md +9 -0
  11. data/docs/GetDocxContentControlsResponse.md +9 -0
  12. data/docs/GetDocxGetFormFieldsResponse.md +10 -0
  13. data/docs/HandlebarFormField.md +8 -0
  14. data/docs/TransformDocumentApi.md +185 -9
  15. data/lib/cloudmersive-convert-api-client/api/edit_document_api.rb +220 -2
  16. data/lib/cloudmersive-convert-api-client/api/transform_document_api.rb +183 -6
  17. data/lib/cloudmersive-convert-api-client/models/document_editing_edit_session.rb +196 -0
  18. data/lib/cloudmersive-convert-api-client/models/document_transform_edit_session.rb +196 -0
  19. data/lib/cloudmersive-convert-api-client/models/docx_content_control.rb +186 -0
  20. data/lib/cloudmersive-convert-api-client/models/docx_set_form_fields_request.rb +223 -0
  21. data/lib/cloudmersive-convert-api-client/models/docx_table_single_table_fill.rb +208 -0
  22. data/lib/cloudmersive-convert-api-client/models/docx_table_table_fill_multi_request.rb +223 -0
  23. data/lib/cloudmersive-convert-api-client/models/fill_handlebar_form_field.rb +196 -0
  24. data/lib/cloudmersive-convert-api-client/models/get_docx_content_controls_response.rb +198 -0
  25. data/lib/cloudmersive-convert-api-client/models/get_docx_get_form_fields_response.rb +210 -0
  26. data/lib/cloudmersive-convert-api-client/models/handlebar_form_field.rb +186 -0
  27. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  28. data/lib/cloudmersive-convert-api-client.rb +10 -0
  29. data/spec/api/edit_document_api_spec.rb +49 -1
  30. data/spec/api/transform_document_api_spec.rb +43 -3
  31. data/spec/models/document_editing_edit_session_spec.rb +47 -0
  32. data/spec/models/document_transform_edit_session_spec.rb +47 -0
  33. data/spec/models/docx_content_control_spec.rb +41 -0
  34. data/spec/models/docx_set_form_fields_request_spec.rb +53 -0
  35. data/spec/models/docx_table_single_table_fill_spec.rb +53 -0
  36. data/spec/models/docx_table_table_fill_multi_request_spec.rb +53 -0
  37. data/spec/models/fill_handlebar_form_field_spec.rb +47 -0
  38. data/spec/models/get_docx_content_controls_response_spec.rb +47 -0
  39. data/spec/models/get_docx_get_form_fields_response_spec.rb +53 -0
  40. data/spec/models/handlebar_form_field_spec.rb +41 -0
  41. metadata +32 -2
@@ -0,0 +1,210 @@
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
+ # Result of running a DocxGetFormFields command
17
+ class GetDocxGetFormFieldsResponse
18
+ # True if successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Content controls in the DOCX
22
+ attr_accessor :content_controls
23
+
24
+ # Form fields that comply with the Handlebar style, that is they are surrounded by two curly braces on either side such as \"{{FieldName}}\", in the DOCX
25
+ attr_accessor :handlebar_form_fields
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'successful' => :'Successful',
31
+ :'content_controls' => :'ContentControls',
32
+ :'handlebar_form_fields' => :'HandlebarFormFields'
33
+ }
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.swagger_types
38
+ {
39
+ :'successful' => :'BOOLEAN',
40
+ :'content_controls' => :'Array<DocxContentControl>',
41
+ :'handlebar_form_fields' => :'Array<HandlebarFormField>'
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?(:'Successful')
54
+ self.successful = attributes[:'Successful']
55
+ end
56
+
57
+ if attributes.has_key?(:'ContentControls')
58
+ if (value = attributes[:'ContentControls']).is_a?(Array)
59
+ self.content_controls = value
60
+ end
61
+ end
62
+
63
+ if attributes.has_key?(:'HandlebarFormFields')
64
+ if (value = attributes[:'HandlebarFormFields']).is_a?(Array)
65
+ self.handlebar_form_fields = value
66
+ end
67
+ end
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properties with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = Array.new
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ successful == o.successful &&
89
+ content_controls == o.content_controls &&
90
+ handlebar_form_fields == o.handlebar_form_fields
91
+ end
92
+
93
+ # @see the `==` method
94
+ # @param [Object] Object to be compared
95
+ def eql?(o)
96
+ self == o
97
+ end
98
+
99
+ # Calculates hash code according to all attributes.
100
+ # @return [Fixnum] Hash code
101
+ def hash
102
+ [successful, content_controls, handlebar_form_fields].hash
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.swagger_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :DateTime
132
+ DateTime.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :BOOLEAN
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
163
+ temp_model.build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ # Outputs non-array value in the form of hash
192
+ # For object, use to_hash. Otherwise, just return the value
193
+ # @param [Object] value Any valid value
194
+ # @return [Hash] Returns the value in the form of hash
195
+ def _to_hash(value)
196
+ if value.is_a?(Array)
197
+ value.compact.map { |v| _to_hash(v) }
198
+ elsif value.is_a?(Hash)
199
+ {}.tap do |hash|
200
+ value.each { |k, v| hash[k] = _to_hash(v) }
201
+ end
202
+ elsif value.respond_to? :to_hash
203
+ value.to_hash
204
+ else
205
+ value
206
+ end
207
+ end
208
+
209
+ end
210
+ end
@@ -0,0 +1,186 @@
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
+ # Instance of a form field that is handlebar style, such as \"{{FieldName}}\"
17
+ class HandlebarFormField
18
+ # Title of the handlebar style form field, such as \"FieldName\" in the case of \"{{FieldName}}\"
19
+ attr_accessor :form_field_title
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'form_field_title' => :'FormFieldTitle'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ :'form_field_title' => :'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?(:'FormFieldTitle')
44
+ self.form_field_title = attributes[:'FormFieldTitle']
45
+ end
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properties with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ form_field_title == o.form_field_title
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [form_field_title].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = CloudmersiveConvertApiClient.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.14
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = '2.2.1'
14
+ VERSION = '2.2.5'
15
15
  end
@@ -55,11 +55,14 @@ require 'cloudmersive-convert-api-client/models/delete_docx_table_row_response'
55
55
  require 'cloudmersive-convert-api-client/models/detect_line_endings_response'
56
56
  require 'cloudmersive-convert-api-client/models/disable_shared_workbook_request'
57
57
  require 'cloudmersive-convert-api-client/models/disable_shared_workbook_response'
58
+ require 'cloudmersive-convert-api-client/models/document_editing_edit_session'
59
+ require 'cloudmersive-convert-api-client/models/document_transform_edit_session'
58
60
  require 'cloudmersive-convert-api-client/models/document_validation_error'
59
61
  require 'cloudmersive-convert-api-client/models/document_validation_result'
60
62
  require 'cloudmersive-convert-api-client/models/docx_body'
61
63
  require 'cloudmersive-convert-api-client/models/docx_cell_style'
62
64
  require 'cloudmersive-convert-api-client/models/docx_comment'
65
+ require 'cloudmersive-convert-api-client/models/docx_content_control'
63
66
  require 'cloudmersive-convert-api-client/models/docx_footer'
64
67
  require 'cloudmersive-convert-api-client/models/docx_header'
65
68
  require 'cloudmersive-convert-api-client/models/docx_image'
@@ -77,12 +80,15 @@ require 'cloudmersive-convert-api-client/models/docx_set_custom_metadata_propert
77
80
  require 'cloudmersive-convert-api-client/models/docx_set_footer_add_page_number_request'
78
81
  require 'cloudmersive-convert-api-client/models/docx_set_footer_request'
79
82
  require 'cloudmersive-convert-api-client/models/docx_set_footer_response'
83
+ require 'cloudmersive-convert-api-client/models/docx_set_form_fields_request'
80
84
  require 'cloudmersive-convert-api-client/models/docx_set_header_request'
81
85
  require 'cloudmersive-convert-api-client/models/docx_set_header_response'
82
86
  require 'cloudmersive-convert-api-client/models/docx_style'
83
87
  require 'cloudmersive-convert-api-client/models/docx_table'
84
88
  require 'cloudmersive-convert-api-client/models/docx_table_cell'
85
89
  require 'cloudmersive-convert-api-client/models/docx_table_row'
90
+ require 'cloudmersive-convert-api-client/models/docx_table_single_table_fill'
91
+ require 'cloudmersive-convert-api-client/models/docx_table_table_fill_multi_request'
86
92
  require 'cloudmersive-convert-api-client/models/docx_table_table_fill_request'
87
93
  require 'cloudmersive-convert-api-client/models/docx_table_table_fill_table_cell'
88
94
  require 'cloudmersive-convert-api-client/models/docx_table_table_fill_table_row'
@@ -99,6 +105,7 @@ require 'cloudmersive-convert-api-client/models/eml_to_png_result'
99
105
  require 'cloudmersive-convert-api-client/models/enable_shared_workbook_request'
100
106
  require 'cloudmersive-convert-api-client/models/enable_shared_workbook_response'
101
107
  require 'cloudmersive-convert-api-client/models/exif_value'
108
+ require 'cloudmersive-convert-api-client/models/fill_handlebar_form_field'
102
109
  require 'cloudmersive-convert-api-client/models/find_docx_paragraph_request'
103
110
  require 'cloudmersive-convert-api-client/models/find_docx_paragraph_response'
104
111
  require 'cloudmersive-convert-api-client/models/find_regex_match'
@@ -112,8 +119,10 @@ require 'cloudmersive-convert-api-client/models/get_docx_body_request'
112
119
  require 'cloudmersive-convert-api-client/models/get_docx_body_response'
113
120
  require 'cloudmersive-convert-api-client/models/get_docx_comments_hierarchical_response'
114
121
  require 'cloudmersive-convert-api-client/models/get_docx_comments_response'
122
+ require 'cloudmersive-convert-api-client/models/get_docx_content_controls_response'
115
123
  require 'cloudmersive-convert-api-client/models/get_docx_get_comments_hierarchical_request'
116
124
  require 'cloudmersive-convert-api-client/models/get_docx_get_comments_request'
125
+ require 'cloudmersive-convert-api-client/models/get_docx_get_form_fields_response'
117
126
  require 'cloudmersive-convert-api-client/models/get_docx_headers_and_footers_request'
118
127
  require 'cloudmersive-convert-api-client/models/get_docx_headers_and_footers_response'
119
128
  require 'cloudmersive-convert-api-client/models/get_docx_images_request'
@@ -151,6 +160,7 @@ require 'cloudmersive-convert-api-client/models/get_xlsx_styles_request'
151
160
  require 'cloudmersive-convert-api-client/models/get_xlsx_styles_response'
152
161
  require 'cloudmersive-convert-api-client/models/get_xlsx_worksheets_request'
153
162
  require 'cloudmersive-convert-api-client/models/get_xlsx_worksheets_response'
163
+ require 'cloudmersive-convert-api-client/models/handlebar_form_field'
154
164
  require 'cloudmersive-convert-api-client/models/html_get_language_result'
155
165
  require 'cloudmersive-convert-api-client/models/html_get_links_response'
156
166
  require 'cloudmersive-convert-api-client/models/html_get_rel_canonical_url_result'