cloudmersive-convert-api-client 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -4
  3. data/docs/ConvertDataApi.md +481 -2
  4. data/docs/XmlAddAttributeWithXPathResult.md +10 -0
  5. data/docs/XmlAddChildWithXPathResult.md +10 -0
  6. data/docs/XmlFIlterWithXPathResult.md +10 -0
  7. data/docs/XmlRemoveAllChildrenWithXPathResult.md +10 -0
  8. data/docs/XmlRemoveWithXPathResult.md +11 -0
  9. data/docs/XmlReplaceWithXPathResult.md +10 -0
  10. data/docs/XmlSetValueWithXPathResult.md +10 -0
  11. data/lib/cloudmersive-convert-api-client.rb +7 -0
  12. data/lib/cloudmersive-convert-api-client/api/convert_data_api.rb +530 -3
  13. data/lib/cloudmersive-convert-api-client/models/xml_add_attribute_with_x_path_result.rb +209 -0
  14. data/lib/cloudmersive-convert-api-client/models/xml_add_child_with_x_path_result.rb +209 -0
  15. data/lib/cloudmersive-convert-api-client/models/xml_f_ilter_with_x_path_result.rb +211 -0
  16. data/lib/cloudmersive-convert-api-client/models/xml_remove_all_children_with_x_path_result.rb +209 -0
  17. data/lib/cloudmersive-convert-api-client/models/xml_remove_with_x_path_result.rb +221 -0
  18. data/lib/cloudmersive-convert-api-client/models/xml_replace_with_x_path_result.rb +209 -0
  19. data/lib/cloudmersive-convert-api-client/models/xml_set_value_with_x_path_result.rb +209 -0
  20. data/lib/cloudmersive-convert-api-client/version.rb +1 -1
  21. data/spec/api/convert_data_api_spec.rb +110 -1
  22. data/spec/models/xml_add_attribute_with_x_path_result_spec.rb +54 -0
  23. data/spec/models/xml_add_child_with_x_path_result_spec.rb +54 -0
  24. data/spec/models/xml_f_ilter_with_x_path_result_spec.rb +54 -0
  25. data/spec/models/xml_remove_all_children_with_x_path_result_spec.rb +54 -0
  26. data/spec/models/xml_remove_with_x_path_result_spec.rb +60 -0
  27. data/spec/models/xml_replace_with_x_path_result_spec.rb +54 -0
  28. data/spec/models/xml_set_value_with_x_path_result_spec.rb +54 -0
  29. metadata +23 -2
@@ -0,0 +1,209 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudmersiveConvertApiClient
16
+ # Result of performing a set value operation on XML input using XPath
17
+ class XmlSetValueWithXPathResult
18
+ # True if the operation was successful, false otherwise
19
+ attr_accessor :successful
20
+
21
+ # Resulting, modified XML document
22
+ attr_accessor :resulting_xml_document
23
+
24
+ # Count of the matching results
25
+ attr_accessor :nodes_edited_count
26
+
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'successful' => :'Successful',
32
+ :'resulting_xml_document' => :'ResultingXmlDocument',
33
+ :'nodes_edited_count' => :'NodesEditedCount'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.swagger_types
39
+ {
40
+ :'successful' => :'BOOLEAN',
41
+ :'resulting_xml_document' => :'String',
42
+ :'nodes_edited_count' => :'Integer'
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?(:'Successful')
55
+ self.successful = attributes[:'Successful']
56
+ end
57
+
58
+ if attributes.has_key?(:'ResultingXmlDocument')
59
+ self.resulting_xml_document = attributes[:'ResultingXmlDocument']
60
+ end
61
+
62
+ if attributes.has_key?(:'NodesEditedCount')
63
+ self.nodes_edited_count = attributes[:'NodesEditedCount']
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
+ return 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
+ return 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
+ successful == o.successful &&
87
+ resulting_xml_document == o.resulting_xml_document &&
88
+ nodes_edited_count == o.nodes_edited_count
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
+ [successful, resulting_xml_document, nodes_edited_count].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 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
+
209
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.3.1
11
11
  =end
12
12
 
13
13
  module CloudmersiveConvertApiClient
14
- VERSION = "1.5.6"
14
+ VERSION = "1.5.7"
15
15
  end
@@ -49,7 +49,7 @@ describe 'ConvertDataApi' do
49
49
  # Convert a JSON object into XML
50
50
  # @param json_object
51
51
  # @param [Hash] opts the optional parameters
52
- # @return [Object]
52
+ # @return [String]
53
53
  describe 'convert_data_json_to_xml test' do
54
54
  it "should work" do
55
55
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
@@ -80,6 +80,102 @@ describe 'ConvertDataApi' do
80
80
  end
81
81
  end
82
82
 
83
+ # unit tests for convert_data_xml_edit_add_attribute_with_x_path
84
+ # Adds an attribute to all XML nodes matching XPath expression
85
+ # Return the reuslts of editing an XML document by adding an attribute to all of the nodes that match an input XPath expression.
86
+ # @param input_file Input XML file to perform the operation on.
87
+ # @param x_path_expression Valid XML XPath query expression
88
+ # @param xml_attribute_name Name of the XML attribute to add
89
+ # @param xml_attribute_value Value of the XML attribute to add
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [XmlAddAttributeWithXPathResult]
92
+ describe 'convert_data_xml_edit_add_attribute_with_x_path test' do
93
+ it "should work" do
94
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
95
+ end
96
+ end
97
+
98
+ # unit tests for convert_data_xml_edit_add_child_with_x_path
99
+ # Adds an XML node as a child to XML nodes matching XPath expression
100
+ # Return the reuslts of editing an XML document by adding an XML node as a child to all of the nodes that match an input XPath expression.
101
+ # @param input_file Input XML file to perform the operation on.
102
+ # @param x_path_expression Valid XML XPath query expression
103
+ # @param xml_node_to_add XML Node to add as a child
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [XmlAddChildWithXPathResult]
106
+ describe 'convert_data_xml_edit_add_child_with_x_path test' do
107
+ it "should work" do
108
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
109
+ end
110
+ end
111
+
112
+ # unit tests for convert_data_xml_edit_remove_all_child_nodes_with_x_path
113
+ # Removes, deletes all children of nodes matching XPath expression, but does not remove the nodes
114
+ # Return the reuslts of editing an XML document by removing all child nodes of the nodes that match an input XPath expression.
115
+ # @param input_file Input XML file to perform the operation on.
116
+ # @param x_path_expression Valid XML XPath query expression
117
+ # @param [Hash] opts the optional parameters
118
+ # @return [XmlRemoveAllChildrenWithXPathResult]
119
+ describe 'convert_data_xml_edit_remove_all_child_nodes_with_x_path test' do
120
+ it "should work" do
121
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
122
+ end
123
+ end
124
+
125
+ # unit tests for convert_data_xml_edit_replace_with_x_path
126
+ # Replaces XML nodes matching XPath expression with new node
127
+ # Return the reuslts of editing an XML document by replacing all of the nodes that match an input XPath expression with a new XML node expression.
128
+ # @param input_file Input XML file to perform the operation on.
129
+ # @param x_path_expression Valid XML XPath query expression
130
+ # @param xml_node_replacement XML Node replacement content
131
+ # @param [Hash] opts the optional parameters
132
+ # @return [XmlReplaceWithXPathResult]
133
+ describe 'convert_data_xml_edit_replace_with_x_path test' do
134
+ it "should work" do
135
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
136
+ end
137
+ end
138
+
139
+ # unit tests for convert_data_xml_edit_set_value_with_x_path
140
+ # Sets the value contents of XML nodes matching XPath expression
141
+ # Return the reuslts of editing an XML document by setting the contents of all of the nodes that match an input XPath expression. Supports elements and attributes.
142
+ # @param input_file Input XML file to perform the operation on.
143
+ # @param x_path_expression Valid XML XPath query expression
144
+ # @param xml_value XML Value to set into the matching XML nodes
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [XmlSetValueWithXPathResult]
147
+ describe 'convert_data_xml_edit_set_value_with_x_path test' do
148
+ it "should work" do
149
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
150
+ end
151
+ end
152
+
153
+ # unit tests for convert_data_xml_filter_with_x_path
154
+ # Filter, select XML nodes using XPath expression, get results
155
+ # Return the reuslts of filtering, selecting an XML document with an XPath expression
156
+ # @param x_path_expression Valid XML XPath query expression
157
+ # @param input_file Input file to perform the operation on.
158
+ # @param [Hash] opts the optional parameters
159
+ # @return [XmlFIlterWithXPathResult]
160
+ describe 'convert_data_xml_filter_with_x_path test' do
161
+ it "should work" do
162
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
163
+ end
164
+ end
165
+
166
+ # unit tests for convert_data_xml_remove_with_x_path
167
+ # Remove, delete XML nodes and items matching XPath expression
168
+ # Return the reuslts of editing an XML document by removing all of the nodes that match an input XPath expression
169
+ # @param x_path_expression Valid XML XPath query expression
170
+ # @param input_file Input file to perform the operation on.
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [XmlRemoveWithXPathResult]
173
+ describe 'convert_data_xml_remove_with_x_path test' do
174
+ it "should work" do
175
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
176
+ end
177
+ end
178
+
83
179
  # unit tests for convert_data_xml_to_json
84
180
  # Convert XML to JSON conversion
85
181
  # Convert an XML string or file into JSON
@@ -92,4 +188,17 @@ describe 'ConvertDataApi' do
92
188
  end
93
189
  end
94
190
 
191
+ # unit tests for convert_data_xml_transform_with_xslt_to_xml
192
+ # Transform XML document file with XSLT into a new XML document
193
+ # Convert an XML string or file into JSON
194
+ # @param input_file Input XML file to perform the operation on.
195
+ # @param transform_file Input XSLT file to use to transform the input XML file.
196
+ # @param [Hash] opts the optional parameters
197
+ # @return [String]
198
+ describe 'convert_data_xml_transform_with_xslt_to_xml test' do
199
+ it "should work" do
200
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
201
+ end
202
+ end
203
+
95
204
  end
@@ -0,0 +1,54 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::XmlAddAttributeWithXPathResult
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'XmlAddAttributeWithXPathResult' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::XmlAddAttributeWithXPathResult.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of XmlAddAttributeWithXPathResult' do
31
+ it 'should create an instance of XmlAddAttributeWithXPathResult' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::XmlAddAttributeWithXPathResult)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "resulting_xml_document"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "nodes_edited_count"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end
54
+
@@ -0,0 +1,54 @@
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.3.1
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for CloudmersiveConvertApiClient::XmlAddChildWithXPathResult
18
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
19
+ # Please update as you see appropriate
20
+ describe 'XmlAddChildWithXPathResult' do
21
+ before do
22
+ # run before each test
23
+ @instance = CloudmersiveConvertApiClient::XmlAddChildWithXPathResult.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of XmlAddChildWithXPathResult' do
31
+ it 'should create an instance of XmlAddChildWithXPathResult' do
32
+ expect(@instance).to be_instance_of(CloudmersiveConvertApiClient::XmlAddChildWithXPathResult)
33
+ end
34
+ end
35
+ describe 'test attribute "successful"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "resulting_xml_document"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "nodes_edited_count"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ end
54
+