aspose_cad_cloud 20.11 → 24.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_cad_cloud/api/cad_api.rb +2778 -392
  3. data/lib/aspose_cad_cloud/configuration.rb +8 -1
  4. data/lib/aspose_cad_cloud/models/bitmap_compression.rb +27 -0
  5. data/lib/aspose_cad_cloud/models/bmp_options_dto.rb +2 -2
  6. data/lib/aspose_cad_cloud/models/cad_draw_type_mode.rb +21 -0
  7. data/lib/aspose_cad_cloud/models/cad_response.rb +48 -8
  8. data/lib/aspose_cad_cloud/models/{cff2_properties.rb → cf2_properties.rb} +3 -3
  9. data/lib/aspose_cad_cloud/models/cgm_options_dto.rb +281 -0
  10. data/lib/aspose_cad_cloud/models/color_modes.rb +27 -0
  11. data/lib/aspose_cad_cloud/models/compression_method.rb +23 -0
  12. data/lib/aspose_cad_cloud/models/dicom_options_dto.rb +281 -0
  13. data/lib/aspose_cad_cloud/models/draco_options_dto.rb +281 -0
  14. data/lib/aspose_cad_cloud/models/dwf_options_dto.rb +281 -0
  15. data/lib/aspose_cad_cloud/models/dxf_options_dto.rb +281 -0
  16. data/lib/aspose_cad_cloud/models/{error.rb → error_model.rb} +2 -2
  17. data/lib/aspose_cad_cloud/models/fbx_options_dto.rb +281 -0
  18. data/lib/aspose_cad_cloud/models/fbx_properties.rb +197 -0
  19. data/lib/aspose_cad_cloud/models/files_upload_result.rb +1 -1
  20. data/lib/aspose_cad_cloud/models/glb_options_dto.rb +281 -0
  21. data/lib/aspose_cad_cloud/models/gltf_options_dto.rb +281 -0
  22. data/lib/aspose_cad_cloud/models/interpolation_mode.rb +28 -0
  23. data/lib/aspose_cad_cloud/models/jpeg2000_codec.rb +22 -0
  24. data/lib/aspose_cad_cloud/models/jpeg_compression_color_mode.rb +24 -0
  25. data/lib/aspose_cad_cloud/models/jpeg_compression_mode.rb +23 -0
  26. data/lib/aspose_cad_cloud/models/line_cap.rb +30 -0
  27. data/lib/aspose_cad_cloud/models/obj_options_dto.rb +281 -0
  28. data/lib/aspose_cad_cloud/models/obj_properties.rb +197 -0
  29. data/lib/aspose_cad_cloud/models/pdf_compliance.rb +22 -0
  30. data/lib/aspose_cad_cloud/models/pdf_digital_signature_details_core_dto.rb +294 -0
  31. data/lib/aspose_cad_cloud/models/pdf_digital_signature_hash_algorithm_core.rb +24 -0
  32. data/lib/aspose_cad_cloud/models/{pdf_document_options.rb → pdf_document_options_dto.rb} +17 -7
  33. data/lib/aspose_cad_cloud/models/pdf_options_dto.rb +1 -1
  34. data/lib/aspose_cad_cloud/models/plt_properties.rb +197 -0
  35. data/lib/aspose_cad_cloud/models/png_color_type.rb +24 -0
  36. data/lib/aspose_cad_cloud/models/png_filter_type.rb +25 -0
  37. data/lib/aspose_cad_cloud/models/requests/ConvertRequest.rb +53 -0
  38. data/lib/aspose_cad_cloud/models/requests/EditMetadataRequest.rb +45 -0
  39. data/lib/aspose_cad_cloud/models/requests/ExtractMetadataRequest.rb +49 -0
  40. data/lib/aspose_cad_cloud/models/requests/ExtractTextRequest.rb +45 -0
  41. data/lib/aspose_cad_cloud/models/requests/PaperToCadRequest.rb +49 -0
  42. data/lib/aspose_cad_cloud/models/requests/PostDrawingCgmRequest.rb +61 -0
  43. data/lib/aspose_cad_cloud/models/requests/PostDrawingDicomRequest.rb +61 -0
  44. data/lib/aspose_cad_cloud/models/requests/PostDrawingDracoRequest.rb +61 -0
  45. data/lib/aspose_cad_cloud/models/requests/PostDrawingDwfRequest.rb +61 -0
  46. data/lib/aspose_cad_cloud/models/requests/PostDrawingDxfRequest.rb +61 -0
  47. data/lib/aspose_cad_cloud/models/requests/PostDrawingFbxRequest.rb +61 -0
  48. data/lib/aspose_cad_cloud/models/requests/PostDrawingGlbRequest.rb +61 -0
  49. data/lib/aspose_cad_cloud/models/requests/PostDrawingGltfRequest.rb +61 -0
  50. data/lib/aspose_cad_cloud/models/requests/PostDrawingObjRequest.rb +61 -0
  51. data/lib/aspose_cad_cloud/models/requests/PostDrawingStpRequest.rb +61 -0
  52. data/lib/aspose_cad_cloud/models/requests/PostDrawingThreeDsRequest.rb +61 -0
  53. data/lib/aspose_cad_cloud/models/requests/PostDrawingU3dRequest.rb +61 -0
  54. data/lib/aspose_cad_cloud/models/requests/PostDrawingWebpRequest.rb +61 -0
  55. data/lib/aspose_cad_cloud/models/requests/PutDrawingCgmRequest.rb +57 -0
  56. data/lib/aspose_cad_cloud/models/requests/PutDrawingDicomRequest.rb +57 -0
  57. data/lib/aspose_cad_cloud/models/requests/PutDrawingDracoRequest.rb +57 -0
  58. data/lib/aspose_cad_cloud/models/requests/PutDrawingDwfRequest.rb +57 -0
  59. data/lib/aspose_cad_cloud/models/requests/PutDrawingDxfRequest.rb +57 -0
  60. data/lib/aspose_cad_cloud/models/requests/PutDrawingFbxRequest.rb +57 -0
  61. data/lib/aspose_cad_cloud/models/requests/PutDrawingGlbRequest.rb +57 -0
  62. data/lib/aspose_cad_cloud/models/requests/PutDrawingGltfRequest.rb +57 -0
  63. data/lib/aspose_cad_cloud/models/requests/PutDrawingObjRequest.rb +57 -0
  64. data/lib/aspose_cad_cloud/models/requests/PutDrawingStpRequest.rb +57 -0
  65. data/lib/aspose_cad_cloud/models/requests/PutDrawingThreeDsRequest.rb +57 -0
  66. data/lib/aspose_cad_cloud/models/requests/PutDrawingU3dRequest.rb +57 -0
  67. data/lib/aspose_cad_cloud/models/requests/PutDrawingWebpRequest.rb +57 -0
  68. data/lib/aspose_cad_cloud/models/requests/PutEditMetadataRequest.rb +49 -0
  69. data/lib/aspose_cad_cloud/models/requests/ViewerRequest.rb +49 -0
  70. data/lib/aspose_cad_cloud/models/requests/WatermarkRequest.rb +57 -0
  71. data/lib/aspose_cad_cloud/models/rotate_flip_type.rb +35 -0
  72. data/lib/aspose_cad_cloud/models/smoothing_mode.rb +25 -0
  73. data/lib/aspose_cad_cloud/models/stp_options_dto.rb +281 -0
  74. data/lib/aspose_cad_cloud/models/stp_properties.rb +197 -0
  75. data/lib/aspose_cad_cloud/models/svg_color_mode.rb +24 -0
  76. data/lib/aspose_cad_cloud/models/text_rendering_hint.rb +25 -0
  77. data/lib/aspose_cad_cloud/models/three_ds_options_dto.rb +281 -0
  78. data/lib/aspose_cad_cloud/models/tiff_byte_order.rb +21 -0
  79. data/lib/aspose_cad_cloud/models/tiff_compressions.rb +43 -0
  80. data/lib/aspose_cad_cloud/models/tiff_expected_format.rb +35 -0
  81. data/lib/aspose_cad_cloud/models/tiff_photometrics.rb +31 -0
  82. data/lib/aspose_cad_cloud/models/u3d_options_dto.rb +281 -0
  83. data/lib/aspose_cad_cloud/models/unit_type.rb +41 -0
  84. data/lib/aspose_cad_cloud/models/webp_options_dto.rb +281 -0
  85. data/lib/aspose_cad_cloud/version.rb +1 -1
  86. data/lib/aspose_cad_cloud.rb +43 -3
  87. metadata +100 -12
@@ -173,7 +173,14 @@ module AsposeCadCloud
173
173
  # Returns Auth Settings hash for api client.
174
174
  def auth_settings
175
175
  {
176
- 'JWT' =>
176
+ 'ApiKey' =>
177
+ {
178
+ type: 'api_key',
179
+ in: 'header',
180
+ key: 'Authorization',
181
+ value: api_key_with_prefix('Authorization')
182
+ },
183
+ 'Bearer' =>
177
184
  {
178
185
  type: 'oauth2',
179
186
  in: 'header',
@@ -0,0 +1,27 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+
6
+ class BitmapCompression
7
+
8
+ RGB = "Rgb".freeze
9
+ RLE8 = "Rle8".freeze
10
+ RLE4 = "Rle4".freeze
11
+ BITFIELDS = "Bitfields".freeze
12
+ JPEG = "Jpeg".freeze
13
+ PNG = "Png".freeze
14
+ ALPHA_BITFIELDS = "AlphaBitfields".freeze
15
+ DXT1 = "Dxt1".freeze
16
+
17
+ # Builds the enum from string
18
+ # @param [String] The enum value in the form of the string
19
+ # @return [String] The enum value
20
+ def build_from_hash(value)
21
+ constantValues = BitmapCompression.constants.select{|c| BitmapCompression::const_get(c) == value}
22
+ raise "Invalid ENUM value #{value} for class #BitmapCompression" if constantValues.empty?
23
+ value
24
+ end
25
+ end
26
+
27
+ end
@@ -158,7 +158,7 @@ module AsposeCadCloud
158
158
  return false unless rotation_validator.valid?(@rotation)
159
159
  return false if @bits_per_pixel.nil?
160
160
  return false if @compression.nil?
161
- compression_validator = EnumAttributeValidator.new('String', ["Rgb", "Rle8", "Rle4", "Bitfields", "Jpeg", "Png", "AlphaBitfields"])
161
+ compression_validator = EnumAttributeValidator.new('String', ["Rgb", "Rle8", "Rle4", "Bitfields", "Jpeg", "Png", "AlphaBitfields", "Dxt1"])
162
162
  return false unless compression_validator.valid?(@compression)
163
163
  return true
164
164
  end
@@ -180,7 +180,7 @@ module AsposeCadCloud
180
180
  # Custom attribute writer method checking allowed values (enum).
181
181
  # @param [Object] compression Object to be assigned
182
182
  def compression=(compression)
183
- validator = EnumAttributeValidator.new('String', ["Rgb", "Rle8", "Rle4", "Bitfields", "Jpeg", "Png", "AlphaBitfields"])
183
+ validator = EnumAttributeValidator.new('String', ["Rgb", "Rle8", "Rle4", "Bitfields", "Jpeg", "Png", "AlphaBitfields", "Dxt1"])
184
184
  if compression.to_i == 0
185
185
  unless validator.valid?(compression)
186
186
  raise ArgumentError, "invalid value for 'compression', must be one of #{validator.allowable_values}."
@@ -0,0 +1,21 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+
6
+ class CadDrawTypeMode
7
+
8
+ USE_DRAW_COLOR = "UseDrawColor".freeze
9
+ USE_OBJECT_COLOR = "UseObjectColor".freeze
10
+
11
+ # Builds the enum from string
12
+ # @param [String] The enum value in the form of the string
13
+ # @return [String] The enum value
14
+ def build_from_hash(value)
15
+ constantValues = CadDrawTypeMode.constants.select{|c| CadDrawTypeMode::const_get(c) == value}
16
+ raise "Invalid ENUM value #{value} for class #CadDrawTypeMode" if constantValues.empty?
17
+ value
18
+ end
19
+ end
20
+
21
+ end
@@ -61,8 +61,20 @@ module AsposeCadCloud
61
61
  # Gets or sets the DWF properties.
62
62
  attr_accessor :dwf_properties
63
63
 
64
- # Gets or sets the CFF2 properties.
65
- attr_accessor :cff2_properties
64
+ # Gets or sets the Cf2 properties.
65
+ attr_accessor :cf2_properties
66
+
67
+ # Gets or sets the Cf2 properties.
68
+ attr_accessor :fbx_properties
69
+
70
+ # Gets or sets the FBX properties.
71
+ attr_accessor :obj_properties
72
+
73
+ # Gets or sets the Cf2 properties.
74
+ attr_accessor :plt_properties
75
+
76
+ # Gets or sets the STP properties.
77
+ attr_accessor :stp_properties
66
78
 
67
79
 
68
80
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -78,7 +90,11 @@ module AsposeCadCloud
78
90
  :'igs_properties' => :'IgsProperties',
79
91
  :'stl_properties' => :'StlProperties',
80
92
  :'dwf_properties' => :'DwfProperties',
81
- :'cff2_properties' => :'Cff2Properties'
93
+ :'cf2_properties' => :'Cf2Properties',
94
+ :'fbx_properties' => :'FbxProperties',
95
+ :'obj_properties' => :'ObjProperties',
96
+ :'plt_properties' => :'PltProperties',
97
+ :'stp_properties' => :'StpProperties'
82
98
  }
83
99
  end
84
100
 
@@ -95,7 +111,11 @@ module AsposeCadCloud
95
111
  :'igs_properties' => :'IgsProperties',
96
112
  :'stl_properties' => :'StlProperties',
97
113
  :'dwf_properties' => :'DwfProperties',
98
- :'cff2_properties' => :'Cff2Properties'
114
+ :'cf2_properties' => :'Cf2Properties',
115
+ :'fbx_properties' => :'FbxProperties',
116
+ :'obj_properties' => :'ObjProperties',
117
+ :'plt_properties' => :'PltProperties',
118
+ :'stp_properties' => :'StpProperties'
99
119
  }
100
120
  end
101
121
 
@@ -147,8 +167,24 @@ module AsposeCadCloud
147
167
  self.dwf_properties = attributes[:'DwfProperties']
148
168
  end
149
169
 
150
- if attributes.key?(:'Cff2Properties')
151
- self.cff2_properties = attributes[:'Cff2Properties']
170
+ if attributes.key?(:'Cf2Properties')
171
+ self.cf2_properties = attributes[:'Cf2Properties']
172
+ end
173
+
174
+ if attributes.key?(:'FbxProperties')
175
+ self.fbx_properties = attributes[:'FbxProperties']
176
+ end
177
+
178
+ if attributes.key?(:'ObjProperties')
179
+ self.obj_properties = attributes[:'ObjProperties']
180
+ end
181
+
182
+ if attributes.key?(:'PltProperties')
183
+ self.plt_properties = attributes[:'PltProperties']
184
+ end
185
+
186
+ if attributes.key?(:'StpProperties')
187
+ self.stp_properties = attributes[:'StpProperties']
152
188
  end
153
189
 
154
190
  end
@@ -191,7 +227,11 @@ module AsposeCadCloud
191
227
  igs_properties == other.igs_properties &&
192
228
  stl_properties == other.stl_properties &&
193
229
  dwf_properties == other.dwf_properties &&
194
- cff2_properties == other.cff2_properties
230
+ cf2_properties == other.cf2_properties &&
231
+ fbx_properties == other.fbx_properties &&
232
+ obj_properties == other.obj_properties &&
233
+ plt_properties == other.plt_properties &&
234
+ stp_properties == other.stp_properties
195
235
  end
196
236
 
197
237
  # @see the `==` method
@@ -203,7 +243,7 @@ module AsposeCadCloud
203
243
  # Calculates hash code according to all attributes.
204
244
  # @return [Fixnum] Hash code
205
245
  def hash
206
- [height, width, dwg_properties, dxf_properties, dwt_properties, dgn_properties, ifc_properties, igs_properties, stl_properties, dwf_properties, cff2_properties].hash
246
+ [height, width, dwg_properties, dxf_properties, dwt_properties, dgn_properties, ifc_properties, igs_properties, stl_properties, dwf_properties, cf2_properties, fbx_properties, obj_properties, plt_properties, stp_properties].hash
207
247
  end
208
248
 
209
249
  # Builds the object from hash
@@ -4,7 +4,7 @@ require 'date'
4
4
  module AsposeCadCloud
5
5
  #
6
6
  # --------------------------------------------------------------------------------------------------------------------
7
- # <copyright company="Aspose" file="Cff2Properties.rb">
7
+ # <copyright company="Aspose" file="Cf2Properties.rb">
8
8
  # Copyright (c) 2017 Aspose.CAD Cloud
9
9
  # </copyright>
10
10
  # <summary>
@@ -29,8 +29,8 @@ module AsposeCadCloud
29
29
  # --------------------------------------------------------------------------------------------------------------------
30
30
  #
31
31
 
32
- # Represents information about CFF2 drawing.
33
- class Cff2Properties
32
+ # Represents information about CF2 drawing.
33
+ class Cf2Properties
34
34
 
35
35
  # Attribute mapping from ruby-style variable name to JSON key.
36
36
  def self.attribute_map
@@ -0,0 +1,281 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+ #
6
+ # --------------------------------------------------------------------------------------------------------------------
7
+ # <copyright company="Aspose" file="CgmOptionsDTO.rb">
8
+ # Copyright (c) 2017 Aspose.CAD Cloud
9
+ # </copyright>
10
+ # <summary>
11
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ # of this software and associated documentation files (the "Software"), to deal
13
+ # in the Software without restriction, including without limitation the rights
14
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ # copies of the Software, and to permit persons to whom the Software is
16
+ # furnished to do so, subject to the following conditions:
17
+ #
18
+ # The above copyright notice and this permission notice shall be included in all
19
+ # copies or substantial portions of the Software.
20
+ #
21
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ # SOFTWARE.
28
+ # </summary>
29
+ # --------------------------------------------------------------------------------------------------------------------
30
+ #
31
+
32
+ # Export options for CGM format
33
+ class CgmOptionsDTO
34
+ # Resulting rotation operation
35
+ attr_accessor :rotation
36
+
37
+ # Layers to export
38
+ attr_accessor :layers
39
+
40
+ # DPI resolution settings
41
+ attr_accessor :resolution_settings
42
+
43
+ # Raster options
44
+ attr_accessor :vector_rasterization_options
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'rotation' => :'Rotation',
72
+ :'layers' => :'Layers',
73
+ :'resolution_settings' => :'ResolutionSettings',
74
+ :'vector_rasterization_options' => :'VectorRasterizationOptions'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ :'rotation' => :'String',
82
+ :'layers' => :'Array<String>',
83
+ :'resolution_settings' => :'ResolutionSetting',
84
+ :'vector_rasterization_options' => :'CadRasterizationOptionsDTO'
85
+ }
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
+
96
+ if attributes.key?(:'Rotation')
97
+ self.rotation = attributes[:'Rotation']
98
+ end
99
+
100
+ if attributes.key?(:'Layers')
101
+ if (value = attributes[:'Layers']).is_a?(Array)
102
+ self.layers = value
103
+ end
104
+ end
105
+
106
+ if attributes.key?(:'ResolutionSettings')
107
+ self.resolution_settings = attributes[:'ResolutionSettings']
108
+ end
109
+
110
+ if attributes.key?(:'VectorRasterizationOptions')
111
+ self.vector_rasterization_options = attributes[:'VectorRasterizationOptions']
112
+ end
113
+
114
+ end
115
+
116
+ # Show invalid properties with the reasons. Usually used together with valid?
117
+ # @return Array for valid properies with the reasons
118
+ def list_invalid_properties
119
+ invalid_properties = []
120
+ if @rotation.nil?
121
+ invalid_properties.push("invalid value for 'rotation', rotation cannot be nil.")
122
+ end
123
+
124
+ return invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ return false if @rotation.nil?
131
+ rotation_validator = EnumAttributeValidator.new('String', ["RotateNoneFlipNone", "Rotate90FlipNone", "Rotate180FlipNone", "Rotate270FlipNone", "RotateNoneFlipX", "Rotate90FlipX", "Rotate180FlipX", "Rotate270FlipX", "RotateNoneFlipY", "Rotate90FlipY", "Rotate180FlipY", "Rotate270FlipY", "RotateNoneFlipXY", "Rotate90FlipXY", "Rotate180FlipXY", "Rotate270FlipXY"])
132
+ return false unless rotation_validator.valid?(@rotation)
133
+ return true
134
+ end
135
+
136
+ # Custom attribute writer method checking allowed values (enum).
137
+ # @param [Object] rotation Object to be assigned
138
+ def rotation=(rotation)
139
+ validator = EnumAttributeValidator.new('String', ["RotateNoneFlipNone", "Rotate90FlipNone", "Rotate180FlipNone", "Rotate270FlipNone", "RotateNoneFlipX", "Rotate90FlipX", "Rotate180FlipX", "Rotate270FlipX", "RotateNoneFlipY", "Rotate90FlipY", "Rotate180FlipY", "Rotate270FlipY", "RotateNoneFlipXY", "Rotate90FlipXY", "Rotate180FlipXY", "Rotate270FlipXY"])
140
+ if rotation.to_i == 0
141
+ unless validator.valid?(rotation)
142
+ raise ArgumentError, "invalid value for 'rotation', must be one of #{validator.allowable_values}."
143
+ end
144
+ @rotation = rotation
145
+ else
146
+ @rotation = validator.allowable_values[rotation.to_i]
147
+ end
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(other)
153
+ return true if self.equal?(other)
154
+ self.class == other.class &&
155
+ rotation == other.rotation &&
156
+ layers == other.layers &&
157
+ resolution_settings == other.resolution_settings &&
158
+ vector_rasterization_options == other.vector_rasterization_options
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(other)
164
+ self == other
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Fixnum] Hash code
169
+ def hash
170
+ [rotation, layers, resolution_settings, vector_rasterization_options].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ self.class.swagger_types.each_pair do |key, type|
179
+ if type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
183
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
184
+ end
185
+ elsif !attributes[self.class.attribute_map[key]].nil?
186
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
187
+ end
188
+ # or else data not found in attributes(hash), not an issue as the data can be optional
189
+ end
190
+
191
+ self
192
+ end
193
+
194
+ # Deserializes the data based on type
195
+ # @param string type Data type
196
+ # @param string value Value to be deserialized
197
+ # @return [Object] Deserialized data
198
+ def _deserialize(type, value)
199
+ case type.to_sym
200
+ when :DateTime
201
+ Time.at(/\d/.match(value)[0].to_f).to_datetime
202
+ when :Date
203
+ Time.at(/\d/.match(value)[0].to_f).to_date
204
+ when :String
205
+ value.to_s
206
+ when :Integer
207
+ value.to_i
208
+ when :Float
209
+ value.to_f
210
+ when :BOOLEAN
211
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
212
+ true
213
+ else
214
+ false
215
+ end
216
+ when :Object
217
+ # generic object (usually a Hash), return directly
218
+ value
219
+ when /\AArray<(?<inner_type>.+)>\z/
220
+ inner_type = Regexp.last_match[:inner_type]
221
+ value.map { |v| _deserialize(inner_type, v) }
222
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
223
+ k_type = Regexp.last_match[:k_type]
224
+ v_type = Regexp.last_match[:v_type]
225
+ {}.tap do |hash|
226
+ value.each do |k, v|
227
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
228
+ end
229
+ end
230
+ else
231
+ # model
232
+ temp_model = AsposeCadCloud.const_get(type).new
233
+ temp_model.build_from_hash(value)
234
+ end
235
+ end
236
+
237
+ # Returns the string representation of the object
238
+ # @return [String] String presentation of the object
239
+ def to_s
240
+ to_hash.to_s
241
+ end
242
+
243
+ # to_body is an alias to to_hash (backward compatibility)
244
+ # @return [Hash] Returns the object in the form of hash
245
+ def to_body
246
+ to_hash
247
+ end
248
+
249
+ # Returns the object in the form of hash
250
+ # @return [Hash] Returns the object in the form of hash
251
+ def to_hash
252
+ hash = {}
253
+ self.class.attribute_map.each_pair do |attr, param|
254
+ value = self.send(attr)
255
+ next if value.nil?
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,27 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+
6
+ class ColorModes
7
+
8
+ BITMAP = "Bitmap".freeze
9
+ GRAYSCALE = "Grayscale".freeze
10
+ INDEXED = "Indexed".freeze
11
+ RGB = "Rgb".freeze
12
+ CMYK = "Cmyk".freeze
13
+ MULTICHANNEL = "Multichannel".freeze
14
+ DUOTONE = "Duotone".freeze
15
+ LAB = "Lab".freeze
16
+
17
+ # Builds the enum from string
18
+ # @param [String] The enum value in the form of the string
19
+ # @return [String] The enum value
20
+ def build_from_hash(value)
21
+ constantValues = ColorModes.constants.select{|c| ColorModes::const_get(c) == value}
22
+ raise "Invalid ENUM value #{value} for class #ColorModes" if constantValues.empty?
23
+ value
24
+ end
25
+ end
26
+
27
+ end
@@ -0,0 +1,23 @@
1
+
2
+ require 'date'
3
+
4
+ module AsposeCadCloud
5
+
6
+ class CompressionMethod
7
+
8
+ RAW = "Raw".freeze
9
+ RLE = "RLE".freeze
10
+ ZIP_WITHOUT_PREDICTION = "ZipWithoutPrediction".freeze
11
+ ZIP_WITH_PREDICTION = "ZipWithPrediction".freeze
12
+
13
+ # Builds the enum from string
14
+ # @param [String] The enum value in the form of the string
15
+ # @return [String] The enum value
16
+ def build_from_hash(value)
17
+ constantValues = CompressionMethod.constants.select{|c| CompressionMethod::const_get(c) == value}
18
+ raise "Invalid ENUM value #{value} for class #CompressionMethod" if constantValues.empty?
19
+ value
20
+ end
21
+ end
22
+
23
+ end