groupdocs_conversion_cloud 23.7 → 23.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec8fc8a087332ee52550d2698e5edc6246ad3e69
4
- data.tar.gz: f9d848c4d6d48b433a318f900e0d18736c308e2b
3
+ metadata.gz: f5421a24e4263b3a624a8bdc6f0390fd12ab086b
4
+ data.tar.gz: 91512f3de6516f2a62813ca4e92e743b3f29bc60
5
5
  SHA512:
6
- metadata.gz: 338679812b41383380615b43f615ecafad52eef2b81a8e9b5e78861766726ea8b3d068797706ea2922fe620f2e915e872b3a271d6534fe191097e30ee175487d
7
- data.tar.gz: 98257c0cce580a473dc35ef621e7ba3c3914ba96e9c8912d656bfea49f95351a0fdfd953c927896be8c5634e3212ff0a78c112f9cd116aa506a44cd454db3042
6
+ metadata.gz: 23df5833f7173801ed0a433ae2970b035e91211ae06662eec204796038521902e382644b3f96011c95932cd936c6014fb85c34af9e374db63e51c9a55c6bb3e9
7
+ data.tar.gz: e534c59c2150764dd2d7dfc64beb1d2a72a41eadb61c1a53e15fb7a1e77fb774a8f86b93ff7a65720122c1d9dc066c5a32b39ca64f8b4e2e7ebb512959943eda
@@ -31,7 +31,7 @@ require 'faraday'
31
31
  require 'mimemagic'
32
32
  require 'addressable'
33
33
  require_relative 'version'
34
- require_relative 'api_error'
34
+ require_relative 'api_client_error'
35
35
 
36
36
  module GroupDocsConversionCloud
37
37
  #
@@ -69,7 +69,7 @@ module GroupDocsConversionCloud
69
69
  end
70
70
 
71
71
  unless response.success?
72
- raise ApiError.new(:code => response.status, :response_body => response.body)
72
+ raise ApiClientError.new(:code => response.status, :response_body => response.body)
73
73
  end
74
74
 
75
75
  data = deserialize(response, opts[:return_type]) if opts[:return_type]
@@ -25,18 +25,17 @@
25
25
 
26
26
  module GroupDocsConversionCloud
27
27
  #
28
- # ApiError class for error handling
28
+ # ApiClientError class for error handling
29
29
  #
30
- class ApiError < StandardError
30
+ class ApiClientError < StandardError
31
31
  attr_reader :code
32
32
  attr_reader :message
33
33
 
34
34
  # Usage examples:
35
- # ApiError.new
36
- # ApiError.new(:code => 500, :response_body => "")
37
- def initialize(arg = nil)
38
- if arg.is_a? Hash
39
-
35
+ # ApiClientError.new
36
+ # ApiClientError.new(:code => 500, :response_body => "")
37
+ def initialize(arg = nil)
38
+ if arg.is_a? Hash
40
39
  if arg.key?(:response_body) then
41
40
  data = JSON.parse(arg[:response_body], :symbolize_names => true)
42
41
  if !data.nil? then
@@ -69,3 +68,4 @@ module GroupDocsConversionCloud
69
68
  end
70
69
  end
71
70
  end
71
+
@@ -0,0 +1,244 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="api_error.rb">
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsConversionCloud
31
+
32
+ class ApiError
33
+ attr_accessor :code
34
+ attr_accessor :message
35
+ attr_accessor :description
36
+ attr_accessor :date_time
37
+ attr_accessor :inner_error
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'code' => :'Code',
43
+ :'message' => :'Message',
44
+ :'description' => :'Description',
45
+ :'date_time' => :'DateTime',
46
+ :'inner_error' => :'InnerError'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'code' => :'String',
54
+ :'message' => :'String',
55
+ :'description' => :'String',
56
+ :'date_time' => :'DateTime',
57
+ :'inner_error' => :'ApiError'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.key?(:'Code')
70
+ self.code = attributes[:'Code']
71
+ end
72
+
73
+ if attributes.key?(:'Message')
74
+ self.message = attributes[:'Message']
75
+ end
76
+
77
+ if attributes.key?(:'Description')
78
+ self.description = attributes[:'Description']
79
+ end
80
+
81
+ if attributes.key?(:'DateTime')
82
+ self.date_time = attributes[:'DateTime']
83
+ end
84
+
85
+ if attributes.key?(:'InnerError')
86
+ self.inner_error = attributes[:'InnerError']
87
+ end
88
+
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properies with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = []
95
+ return invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ return true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(other)
107
+ return true if self.equal?(other)
108
+ self.class == other.class &&
109
+ code == other.code &&
110
+ message == other.message &&
111
+ description == other.description &&
112
+ date_time == other.date_time &&
113
+ inner_error == other.inner_error
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(other)
119
+ self == other
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Fixnum] Hash code
124
+ def hash
125
+ [code, message, description, date_time, inner_error].hash
126
+ end
127
+
128
+ # Downcases first letter.
129
+ # @return downcased string
130
+ def uncap(str)
131
+ str[0, 1].downcase + str[1..-1]
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.swagger_types.each_pair do |key, type|
140
+ pname = uncap(self.class.attribute_map[key]).intern
141
+ value = attributes[pname]
142
+ if type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the the attribute
144
+ # is documented as an array but the input is not
145
+ if value.is_a?(Array)
146
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !value.nil?
149
+ self.send("#{key}=", _deserialize(type, value))
150
+ end
151
+ # or else data not found in attributes(hash), not an issue as the data can be optional
152
+ end
153
+
154
+ self
155
+ end
156
+
157
+ # Deserializes the data based on type
158
+ # @param string type Data type
159
+ # @param string value Value to be deserialized
160
+ # @return [Object] Deserialized data
161
+ def _deserialize(type, value)
162
+ case type.to_sym
163
+ when :DateTime
164
+ Date.parse value
165
+ when :Date
166
+ Date.parse value
167
+ when :String
168
+ value.to_s
169
+ when :Integer
170
+ value.to_i
171
+ when :Float
172
+ value.to_f
173
+ when :BOOLEAN
174
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ true
176
+ else
177
+ false
178
+ end
179
+ when :Object
180
+ # generic object (usually a Hash), return directly
181
+ value
182
+ when /\AArray<(?<inner_type>.+)>\z/
183
+ inner_type = Regexp.last_match[:inner_type]
184
+ value.map { |v| _deserialize(inner_type, v) }
185
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ k_type = Regexp.last_match[:k_type]
187
+ v_type = Regexp.last_match[:v_type]
188
+ {}.tap do |hash|
189
+ value.each do |k, v|
190
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
191
+ end
192
+ end
193
+ else
194
+ # model
195
+ temp_model = GroupDocsConversionCloud.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
+
244
+ end
@@ -0,0 +1,220 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="api_error_response.rb">
4
+ # Copyright (c) 2003-2023 Aspose Pty Ltd
5
+ # </copyright>
6
+ # <summary>
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # </summary>
25
+ # --------------------------------------------------------------------------------------------------------------------
26
+ #
27
+
28
+ require 'date'
29
+
30
+ module GroupDocsConversionCloud
31
+
32
+ class ApiErrorResponse
33
+ attr_accessor :request_id
34
+ attr_accessor :error
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'request_id' => :'RequestId',
40
+ :'error' => :'Error'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'request_id' => :'String',
48
+ :'error' => :'ApiError'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+
60
+ if attributes.key?(:'RequestId')
61
+ self.request_id = attributes[:'RequestId']
62
+ end
63
+
64
+ if attributes.key?(:'Error')
65
+ self.error = attributes[:'Error']
66
+ end
67
+
68
+ end
69
+
70
+ # Show invalid properties with the reasons. Usually used together with valid?
71
+ # @return Array for valid properies with the reasons
72
+ def list_invalid_properties
73
+ invalid_properties = []
74
+ return 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
+ return true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(other)
86
+ return true if self.equal?(other)
87
+ self.class == other.class &&
88
+ request_id == other.request_id &&
89
+ error == other.error
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(other)
95
+ self == other
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [request_id, error].hash
102
+ end
103
+
104
+ # Downcases first letter.
105
+ # @return downcased string
106
+ def uncap(str)
107
+ str[0, 1].downcase + str[1..-1]
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.swagger_types.each_pair do |key, type|
116
+ pname = uncap(self.class.attribute_map[key]).intern
117
+ value = attributes[pname]
118
+ if type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the the attribute
120
+ # is documented as an array but the input is not
121
+ if value.is_a?(Array)
122
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !value.nil?
125
+ self.send("#{key}=", _deserialize(type, value))
126
+ end
127
+ # or else data not found in attributes(hash), not an issue as the data can be optional
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :DateTime
140
+ Date.parse value
141
+ when :Date
142
+ Date.parse value
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :BOOLEAN
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else
170
+ # model
171
+ temp_model = GroupDocsConversionCloud.const_get(type).new
172
+ temp_model.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ next if value.nil?
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+
218
+ end
219
+
220
+ end
@@ -25,5 +25,5 @@
25
25
  # --------------------------------------------------------------------------------------------------------------------
26
26
  #
27
27
  module GroupDocsConversionCloud
28
- VERSION = "23.7".freeze
28
+ VERSION = "23.9".freeze
29
29
  end
@@ -25,11 +25,13 @@
25
25
 
26
26
  # Common files
27
27
  require_relative 'groupdocs_conversion_cloud/api_client'
28
- require_relative 'groupdocs_conversion_cloud/api_error'
28
+ require_relative 'groupdocs_conversion_cloud/api_client_error'
29
29
  require_relative 'groupdocs_conversion_cloud/version'
30
30
  require_relative 'groupdocs_conversion_cloud/configuration'
31
31
 
32
32
  # Models
33
+ require_relative 'groupdocs_conversion_cloud/models/api_error'
34
+ require_relative 'groupdocs_conversion_cloud/models/api_error_response'
33
35
  require_relative 'groupdocs_conversion_cloud/models/consumption_result'
34
36
  require_relative 'groupdocs_conversion_cloud/models/convert_options'
35
37
  require_relative 'groupdocs_conversion_cloud/models/convert_settings'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs_conversion_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: '23.7'
4
+ version: '23.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - GroupDocs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -78,8 +78,10 @@ files:
78
78
  - lib/groupdocs_conversion_cloud/api/license_api.rb
79
79
  - lib/groupdocs_conversion_cloud/api/storage_api.rb
80
80
  - lib/groupdocs_conversion_cloud/api_client.rb
81
- - lib/groupdocs_conversion_cloud/api_error.rb
81
+ - lib/groupdocs_conversion_cloud/api_client_error.rb
82
82
  - lib/groupdocs_conversion_cloud/configuration.rb
83
+ - lib/groupdocs_conversion_cloud/models/api_error.rb
84
+ - lib/groupdocs_conversion_cloud/models/api_error_response.rb
83
85
  - lib/groupdocs_conversion_cloud/models/bmp_convert_options.rb
84
86
  - lib/groupdocs_conversion_cloud/models/bmp_load_options.rb
85
87
  - lib/groupdocs_conversion_cloud/models/cad_load_options.rb