groupdocs_conversion_cloud 24.3 → 24.4

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
  SHA256:
3
- metadata.gz: 74886dfd7d48be4b54ea4ecc554d39346b4c5cfe14dcf18c2b654e94c4d2c068
4
- data.tar.gz: 52d625970d1efc95d04653f1bc48a8c6e7f38865faff1dca8536777d2d21da4c
3
+ metadata.gz: 4a70f2c7718350e9c3e3b5a4a50ac60fe02778fa267354c064f74ce267a059cf
4
+ data.tar.gz: c3e58c3d169f438df030a3de76410ae347bd5cd912c5ec3392060fd545ef8ba3
5
5
  SHA512:
6
- metadata.gz: fd78a4b7c44f32a57c977fe5b8014de6d6d547405753b733bf5a103af65e224e9a6f6360aa90200e4ccbb162fb2d2e56f4bb5ea78d3a7250e3dd4db8b280c32d
7
- data.tar.gz: f8ee111daa7d40bcd44a2b0be2c68c7b03f04985a82fd18b8d8208ec92e921de3ef8de786f06f818754741af6f09a633294c92fa87ccbceade58d2ce45bc9ee7
6
+ metadata.gz: 30ae9f2b07b3388ab9ca322934ca1b1375875e84db0910ac514f7eac490baaf6718f0cb58056797275a6e2799d22388ad1bcac461ba25a4304c18a751167f1e6
7
+ data.tar.gz: 000a80f3b0b45c0b8e510453a6878186cfe150f5f7a383934c3ac577cf7cab2b7f1205caee1ee1a67c93d45cc424958f37ac62dae3d05c1453e5dd1fc231d849
@@ -34,22 +34,43 @@ module GroupDocsConversionCloud
34
34
  # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
35
  attr_accessor :format
36
36
 
37
- # Set desired page width for converting CAD document
38
- attr_accessor :width
39
-
40
- # Set desired page height for converting CAD document
41
- attr_accessor :height
42
-
43
37
  # Render specific CAD layouts
44
38
  attr_accessor :layout_names
45
39
 
40
+ # Gets or sets a background color.
41
+ attr_accessor :background_color
42
+
43
+ # Gets or sets type of drawing.
44
+ attr_accessor :draw_type
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
46
67
  # Attribute mapping from ruby-style variable name to JSON key.
47
68
  def self.attribute_map
48
69
  {
49
70
  :'format' => :'Format',
50
- :'width' => :'Width',
51
- :'height' => :'Height',
52
- :'layout_names' => :'LayoutNames'
71
+ :'layout_names' => :'LayoutNames',
72
+ :'background_color' => :'BackgroundColor',
73
+ :'draw_type' => :'DrawType'
53
74
  }
54
75
  end
55
76
 
@@ -57,9 +78,9 @@ module GroupDocsConversionCloud
57
78
  def self.swagger_types
58
79
  {
59
80
  :'format' => :'String',
60
- :'width' => :'Integer',
61
- :'height' => :'Integer',
62
- :'layout_names' => :'Array<String>'
81
+ :'layout_names' => :'Array<String>',
82
+ :'background_color' => :'String',
83
+ :'draw_type' => :'String'
63
84
  }
64
85
  end
65
86
 
@@ -75,32 +96,28 @@ module GroupDocsConversionCloud
75
96
  self.format = attributes[:'Format']
76
97
  end
77
98
 
78
- if attributes.key?(:'Width')
79
- self.width = attributes[:'Width']
80
- end
81
-
82
- if attributes.key?(:'Height')
83
- self.height = attributes[:'Height']
84
- end
85
-
86
99
  if attributes.key?(:'LayoutNames')
87
100
  if (value = attributes[:'LayoutNames']).is_a?(Array)
88
101
  self.layout_names = value
89
102
  end
90
103
  end
91
104
 
105
+ if attributes.key?(:'BackgroundColor')
106
+ self.background_color = attributes[:'BackgroundColor']
107
+ end
108
+
109
+ if attributes.key?(:'DrawType')
110
+ self.draw_type = attributes[:'DrawType']
111
+ end
112
+
92
113
  end
93
114
 
94
115
  # Show invalid properties with the reasons. Usually used together with valid?
95
116
  # @return Array for valid properies with the reasons
96
117
  def list_invalid_properties
97
118
  invalid_properties = []
98
- if @width.nil?
99
- invalid_properties.push("invalid value for 'width', width cannot be nil.")
100
- end
101
-
102
- if @height.nil?
103
- invalid_properties.push("invalid value for 'height', height cannot be nil.")
119
+ if @draw_type.nil?
120
+ invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
104
121
  end
105
122
 
106
123
  return invalid_properties
@@ -109,20 +126,35 @@ module GroupDocsConversionCloud
109
126
  # Check to see if the all the properties in the model are valid
110
127
  # @return true if the model is valid
111
128
  def valid?
112
- return false if @width.nil?
113
- return false if @height.nil?
129
+ return false if @draw_type.nil?
130
+ draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
131
+ return false unless draw_type_validator.valid?(@draw_type)
114
132
  return true
115
133
  end
116
134
 
135
+ # Custom attribute writer method checking allowed values (enum).
136
+ # @param [Object] draw_type Object to be assigned
137
+ def draw_type=(draw_type)
138
+ validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
139
+ if draw_type.to_i == 0
140
+ unless validator.valid?(draw_type)
141
+ raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
142
+ end
143
+ @draw_type = draw_type
144
+ else
145
+ @draw_type = validator.allowable_values[draw_type.to_i]
146
+ end
147
+ end
148
+
117
149
  # Checks equality by comparing each attribute.
118
150
  # @param [Object] Object to be compared
119
151
  def ==(other)
120
152
  return true if self.equal?(other)
121
153
  self.class == other.class &&
122
154
  format == other.format &&
123
- width == other.width &&
124
- height == other.height &&
125
- layout_names == other.layout_names
155
+ layout_names == other.layout_names &&
156
+ background_color == other.background_color &&
157
+ draw_type == other.draw_type
126
158
  end
127
159
 
128
160
  # @see the `==` method
@@ -134,7 +166,7 @@ module GroupDocsConversionCloud
134
166
  # Calculates hash code according to all attributes.
135
167
  # @return [Fixnum] Hash code
136
168
  def hash
137
- [format, width, height, layout_names].hash
169
+ [format, layout_names, background_color, draw_type].hash
138
170
  end
139
171
 
140
172
  # Downcases first letter.
@@ -0,0 +1,288 @@
1
+ #
2
+ # --------------------------------------------------------------------------------------------------------------------
3
+ # <copyright company="Aspose Pty Ltd" file="cf2_load_options.rb">
4
+ # Copyright (c) 2003-2024 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
+ # Cf2 load options
32
+ class Cf2LoadOptions
33
+
34
+ # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
+ attr_accessor :format
36
+
37
+ # Render specific CAD layouts
38
+ attr_accessor :layout_names
39
+
40
+ # Gets or sets a background color.
41
+ attr_accessor :background_color
42
+
43
+ # Gets or sets type of drawing.
44
+ attr_accessor :draw_type
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'format' => :'Format',
71
+ :'layout_names' => :'LayoutNames',
72
+ :'background_color' => :'BackgroundColor',
73
+ :'draw_type' => :'DrawType'
74
+ }
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.swagger_types
79
+ {
80
+ :'format' => :'String',
81
+ :'layout_names' => :'Array<String>',
82
+ :'background_color' => :'String',
83
+ :'draw_type' => :'String'
84
+ }
85
+ end
86
+
87
+ # Initializes the object
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
+
95
+ if attributes.key?(:'Format')
96
+ self.format = attributes[:'Format']
97
+ end
98
+
99
+ if attributes.key?(:'LayoutNames')
100
+ if (value = attributes[:'LayoutNames']).is_a?(Array)
101
+ self.layout_names = value
102
+ end
103
+ end
104
+
105
+ if attributes.key?(:'BackgroundColor')
106
+ self.background_color = attributes[:'BackgroundColor']
107
+ end
108
+
109
+ if attributes.key?(:'DrawType')
110
+ self.draw_type = attributes[:'DrawType']
111
+ end
112
+
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properies with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = []
119
+ if @draw_type.nil?
120
+ invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
121
+ end
122
+
123
+ return invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ return false if @draw_type.nil?
130
+ draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
131
+ return false unless draw_type_validator.valid?(@draw_type)
132
+ return true
133
+ end
134
+
135
+ # Custom attribute writer method checking allowed values (enum).
136
+ # @param [Object] draw_type Object to be assigned
137
+ def draw_type=(draw_type)
138
+ validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
139
+ if draw_type.to_i == 0
140
+ unless validator.valid?(draw_type)
141
+ raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
142
+ end
143
+ @draw_type = draw_type
144
+ else
145
+ @draw_type = validator.allowable_values[draw_type.to_i]
146
+ end
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(other)
152
+ return true if self.equal?(other)
153
+ self.class == other.class &&
154
+ format == other.format &&
155
+ layout_names == other.layout_names &&
156
+ background_color == other.background_color &&
157
+ draw_type == other.draw_type
158
+ end
159
+
160
+ # @see the `==` method
161
+ # @param [Object] Object to be compared
162
+ def eql?(other)
163
+ self == other
164
+ end
165
+
166
+ # Calculates hash code according to all attributes.
167
+ # @return [Fixnum] Hash code
168
+ def hash
169
+ [format, layout_names, background_color, draw_type].hash
170
+ end
171
+
172
+ # Downcases first letter.
173
+ # @return downcased string
174
+ def uncap(str)
175
+ str[0, 1].downcase + str[1..-1]
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ pname = uncap(self.class.attribute_map[key]).intern
185
+ value = attributes[pname]
186
+ if type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the the attribute
188
+ # is documented as an array but the input is not
189
+ if value.is_a?(Array)
190
+ self.send("#{key}=", value.map { |v| _deserialize($1, v) })
191
+ end
192
+ elsif !value.nil?
193
+ self.send("#{key}=", _deserialize(type, value))
194
+ end
195
+ # or else data not found in attributes(hash), not an issue as the data can be optional
196
+ end
197
+
198
+ self
199
+ end
200
+
201
+ # Deserializes the data based on type
202
+ # @param string type Data type
203
+ # @param string value Value to be deserialized
204
+ # @return [Object] Deserialized data
205
+ def _deserialize(type, value)
206
+ case type.to_sym
207
+ when :DateTime
208
+ Date.parse value
209
+ when :Date
210
+ Date.parse value
211
+ when :String
212
+ value.to_s
213
+ when :Integer
214
+ value.to_i
215
+ when :Float
216
+ value.to_f
217
+ when :BOOLEAN
218
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
219
+ true
220
+ else
221
+ false
222
+ end
223
+ when :Object
224
+ # generic object (usually a Hash), return directly
225
+ value
226
+ when /\AArray<(?<inner_type>.+)>\z/
227
+ inner_type = Regexp.last_match[:inner_type]
228
+ value.map { |v| _deserialize(inner_type, v) }
229
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
230
+ k_type = Regexp.last_match[:k_type]
231
+ v_type = Regexp.last_match[:v_type]
232
+ {}.tap do |hash|
233
+ value.each do |k, v|
234
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
235
+ end
236
+ end
237
+ else
238
+ # model
239
+ temp_model = GroupDocsConversionCloud.const_get(type).new
240
+ temp_model.build_from_hash(value)
241
+ end
242
+ end
243
+
244
+ # Returns the string representation of the object
245
+ # @return [String] String presentation of the object
246
+ def to_s
247
+ to_hash.to_s
248
+ end
249
+
250
+ # to_body is an alias to to_hash (backward compatibility)
251
+ # @return [Hash] Returns the object in the form of hash
252
+ def to_body
253
+ to_hash
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ next if value.nil?
263
+ hash[param] = _to_hash(value)
264
+ end
265
+ hash
266
+ end
267
+
268
+ # Outputs non-array value in the form of hash
269
+ # For object, use to_hash. Otherwise, just return the value
270
+ # @param [Object] value Any valid value
271
+ # @return [Hash] Returns the value in the form of hash
272
+ def _to_hash(value)
273
+ if value.is_a?(Array)
274
+ value.compact.map { |v| _to_hash(v) }
275
+ elsif value.is_a?(Hash)
276
+ {}.tap do |hash|
277
+ value.each { |k, v| hash[k] = _to_hash(v) }
278
+ end
279
+ elsif value.respond_to? :to_hash
280
+ value.to_hash
281
+ else
282
+ value
283
+ end
284
+ end
285
+
286
+ end
287
+
288
+ end
@@ -34,22 +34,43 @@ module GroupDocsConversionCloud
34
34
  # The format of input file, (\"docx\", for example). This field must be filled with correct input file format when using ConvertDirect method, which accept input file as binary stream, and, because of that, API can correctly handle LoadOptions. In regular conversion, the input file format taken from the input file name and this field ignored.
35
35
  attr_accessor :format
36
36
 
37
- # Set desired page width for converting CAD document
38
- attr_accessor :width
39
-
40
- # Set desired page height for converting CAD document
41
- attr_accessor :height
42
-
43
37
  # Render specific CAD layouts
44
38
  attr_accessor :layout_names
45
39
 
40
+ # Gets or sets a background color.
41
+ attr_accessor :background_color
42
+
43
+ # Gets or sets type of drawing.
44
+ attr_accessor :draw_type
45
+ class EnumAttributeValidator
46
+ attr_reader :datatype
47
+ attr_reader :allowable_values
48
+
49
+ def initialize(datatype, allowable_values)
50
+ @allowable_values = allowable_values.map do |value|
51
+ case datatype.to_s
52
+ when /Integer/i
53
+ value.to_i
54
+ when /Float/i
55
+ value.to_f
56
+ else
57
+ value
58
+ end
59
+ end
60
+ end
61
+
62
+ def valid?(value)
63
+ !value || allowable_values.include?(value)
64
+ end
65
+ end
66
+
46
67
  # Attribute mapping from ruby-style variable name to JSON key.
47
68
  def self.attribute_map
48
69
  {
49
70
  :'format' => :'Format',
50
- :'width' => :'Width',
51
- :'height' => :'Height',
52
- :'layout_names' => :'LayoutNames'
71
+ :'layout_names' => :'LayoutNames',
72
+ :'background_color' => :'BackgroundColor',
73
+ :'draw_type' => :'DrawType'
53
74
  }
54
75
  end
55
76
 
@@ -57,9 +78,9 @@ module GroupDocsConversionCloud
57
78
  def self.swagger_types
58
79
  {
59
80
  :'format' => :'String',
60
- :'width' => :'Integer',
61
- :'height' => :'Integer',
62
- :'layout_names' => :'Array<String>'
81
+ :'layout_names' => :'Array<String>',
82
+ :'background_color' => :'String',
83
+ :'draw_type' => :'String'
63
84
  }
64
85
  end
65
86
 
@@ -75,32 +96,28 @@ module GroupDocsConversionCloud
75
96
  self.format = attributes[:'Format']
76
97
  end
77
98
 
78
- if attributes.key?(:'Width')
79
- self.width = attributes[:'Width']
80
- end
81
-
82
- if attributes.key?(:'Height')
83
- self.height = attributes[:'Height']
84
- end
85
-
86
99
  if attributes.key?(:'LayoutNames')
87
100
  if (value = attributes[:'LayoutNames']).is_a?(Array)
88
101
  self.layout_names = value
89
102
  end
90
103
  end
91
104
 
105
+ if attributes.key?(:'BackgroundColor')
106
+ self.background_color = attributes[:'BackgroundColor']
107
+ end
108
+
109
+ if attributes.key?(:'DrawType')
110
+ self.draw_type = attributes[:'DrawType']
111
+ end
112
+
92
113
  end
93
114
 
94
115
  # Show invalid properties with the reasons. Usually used together with valid?
95
116
  # @return Array for valid properies with the reasons
96
117
  def list_invalid_properties
97
118
  invalid_properties = []
98
- if @width.nil?
99
- invalid_properties.push("invalid value for 'width', width cannot be nil.")
100
- end
101
-
102
- if @height.nil?
103
- invalid_properties.push("invalid value for 'height', height cannot be nil.")
119
+ if @draw_type.nil?
120
+ invalid_properties.push("invalid value for 'draw_type', draw_type cannot be nil.")
104
121
  end
105
122
 
106
123
  return invalid_properties
@@ -109,20 +126,35 @@ module GroupDocsConversionCloud
109
126
  # Check to see if the all the properties in the model are valid
110
127
  # @return true if the model is valid
111
128
  def valid?
112
- return false if @width.nil?
113
- return false if @height.nil?
129
+ return false if @draw_type.nil?
130
+ draw_type_validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
131
+ return false unless draw_type_validator.valid?(@draw_type)
114
132
  return true
115
133
  end
116
134
 
135
+ # Custom attribute writer method checking allowed values (enum).
136
+ # @param [Object] draw_type Object to be assigned
137
+ def draw_type=(draw_type)
138
+ validator = EnumAttributeValidator.new('String', ["UseDrawColor", "UseObjectColor"])
139
+ if draw_type.to_i == 0
140
+ unless validator.valid?(draw_type)
141
+ raise ArgumentError, "invalid value for 'draw_type', must be one of #{validator.allowable_values}."
142
+ end
143
+ @draw_type = draw_type
144
+ else
145
+ @draw_type = validator.allowable_values[draw_type.to_i]
146
+ end
147
+ end
148
+
117
149
  # Checks equality by comparing each attribute.
118
150
  # @param [Object] Object to be compared
119
151
  def ==(other)
120
152
  return true if self.equal?(other)
121
153
  self.class == other.class &&
122
154
  format == other.format &&
123
- width == other.width &&
124
- height == other.height &&
125
- layout_names == other.layout_names
155
+ layout_names == other.layout_names &&
156
+ background_color == other.background_color &&
157
+ draw_type == other.draw_type
126
158
  end
127
159
 
128
160
  # @see the `==` method
@@ -134,7 +166,7 @@ module GroupDocsConversionCloud
134
166
  # Calculates hash code according to all attributes.
135
167
  # @return [Fixnum] Hash code
136
168
  def hash
137
- [format, width, height, layout_names].hash
169
+ [format, layout_names, background_color, draw_type].hash
138
170
  end
139
171
 
140
172
  # Downcases first letter.