Class: AsposeCadCloud::CadResponse
- Inherits:
-
Object
- Object
- AsposeCadCloud::CadResponse
- Defined in:
- lib/aspose_cad_cloud/models/cad_response.rb
Overview
Represents information about a drawing.
Instance Attribute Summary collapse
-
#cf2_properties ⇒ Object
Gets or sets the Cf2 properties.
-
#dgn_properties ⇒ Object
Gets or sets the DGN properties.
-
#dwf_properties ⇒ Object
Gets or sets the DWF properties.
-
#dwg_properties ⇒ Object
Gets or sets the DWG properties.
-
#dwt_properties ⇒ Object
Gets or sets the DWT properties.
-
#dxf_properties ⇒ Object
Gets or sets the DXF properties.
-
#fbx_properties ⇒ Object
Gets or sets the Cf2 properties.
-
#height ⇒ Object
Gets or sets the height of a drawing.
-
#ifc_properties ⇒ Object
Gets or sets the IFC properties.
-
#igs_properties ⇒ Object
Gets or sets the IGS properties.
-
#obj_properties ⇒ Object
Gets or sets the FBX properties.
-
#plt_properties ⇒ Object
Gets or sets the Cf2 properties.
-
#stl_properties ⇒ Object
Gets or sets the STL properties.
-
#stp_properties ⇒ Object
Gets or sets the STP properties.
-
#width ⇒ Object
Gets or sets the width of a drawing.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CadResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ CadResponse
Initializes the object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 124 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.key?(:'Height') self.height = attributes[:'Height'] end if attributes.key?(:'Width') self.width = attributes[:'Width'] end if attributes.key?(:'DwgProperties') self.dwg_properties = attributes[:'DwgProperties'] end if attributes.key?(:'DxfProperties') self.dxf_properties = attributes[:'DxfProperties'] end if attributes.key?(:'DwtProperties') self.dwt_properties = attributes[:'DwtProperties'] end if attributes.key?(:'DgnProperties') self.dgn_properties = attributes[:'DgnProperties'] end if attributes.key?(:'IfcProperties') self.ifc_properties = attributes[:'IfcProperties'] end if attributes.key?(:'IgsProperties') self.igs_properties = attributes[:'IgsProperties'] end if attributes.key?(:'StlProperties') self.stl_properties = attributes[:'StlProperties'] end if attributes.key?(:'DwfProperties') self.dwf_properties = attributes[:'DwfProperties'] end if attributes.key?(:'Cf2Properties') self.cf2_properties = attributes[:'Cf2Properties'] end if attributes.key?(:'FbxProperties') self.fbx_properties = attributes[:'FbxProperties'] end if attributes.key?(:'ObjProperties') self.obj_properties = attributes[:'ObjProperties'] end if attributes.key?(:'PltProperties') self.plt_properties = attributes[:'PltProperties'] end if attributes.key?(:'StpProperties') self.stp_properties = attributes[:'StpProperties'] end end |
Instance Attribute Details
#cf2_properties ⇒ Object
Gets or sets the Cf2 properties.
65 66 67 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 65 def cf2_properties @cf2_properties end |
#dgn_properties ⇒ Object
Gets or sets the DGN properties.
50 51 52 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 50 def dgn_properties @dgn_properties end |
#dwf_properties ⇒ Object
Gets or sets the DWF properties.
62 63 64 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 62 def dwf_properties @dwf_properties end |
#dwg_properties ⇒ Object
Gets or sets the DWG properties.
41 42 43 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 41 def dwg_properties @dwg_properties end |
#dwt_properties ⇒ Object
Gets or sets the DWT properties.
47 48 49 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 47 def dwt_properties @dwt_properties end |
#dxf_properties ⇒ Object
Gets or sets the DXF properties.
44 45 46 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 44 def dxf_properties @dxf_properties end |
#fbx_properties ⇒ Object
Gets or sets the Cf2 properties.
68 69 70 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 68 def fbx_properties @fbx_properties end |
#height ⇒ Object
Gets or sets the height of a drawing.
35 36 37 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 35 def height @height end |
#ifc_properties ⇒ Object
Gets or sets the IFC properties.
53 54 55 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 53 def ifc_properties @ifc_properties end |
#igs_properties ⇒ Object
Gets or sets the IGS properties.
56 57 58 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 56 def igs_properties @igs_properties end |
#obj_properties ⇒ Object
Gets or sets the FBX properties.
71 72 73 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 71 def obj_properties @obj_properties end |
#plt_properties ⇒ Object
Gets or sets the Cf2 properties.
74 75 76 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 74 def plt_properties @plt_properties end |
#stl_properties ⇒ Object
Gets or sets the STL properties.
59 60 61 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 59 def stl_properties @stl_properties end |
#stp_properties ⇒ Object
Gets or sets the STP properties.
77 78 79 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 77 def stp_properties @stp_properties end |
#width ⇒ Object
Gets or sets the width of a drawing.
38 39 40 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 38 def width @width end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 81 def self.attribute_map { :'height' => :'Height', :'width' => :'Width', :'dwg_properties' => :'DwgProperties', :'dxf_properties' => :'DxfProperties', :'dwt_properties' => :'DwtProperties', :'dgn_properties' => :'DgnProperties', :'ifc_properties' => :'IfcProperties', :'igs_properties' => :'IgsProperties', :'stl_properties' => :'StlProperties', :'dwf_properties' => :'DwfProperties', :'cf2_properties' => :'Cf2Properties', :'fbx_properties' => :'FbxProperties', :'obj_properties' => :'ObjProperties', :'plt_properties' => :'PltProperties', :'stp_properties' => :'StpProperties' } end |
.swagger_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 102 def self.swagger_types { :'height' => :'Integer', :'width' => :'Integer', :'dwg_properties' => :'DwgProperties', :'dxf_properties' => :'DxfProperties', :'dwt_properties' => :'DwgProperties', :'dgn_properties' => :'DgnProperties', :'ifc_properties' => :'IfcProperties', :'igs_properties' => :'IgsProperties', :'stl_properties' => :'StlProperties', :'dwf_properties' => :'DwfProperties', :'cf2_properties' => :'Cf2Properties', :'fbx_properties' => :'FbxProperties', :'obj_properties' => :'ObjProperties', :'plt_properties' => :'PltProperties', :'stp_properties' => :'StpProperties' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 217 def ==(other) return true if self.equal?(other) self.class == other.class && height == other.height && width == other.width && dwg_properties == other.dwg_properties && dxf_properties == other.dxf_properties && dwt_properties == other.dwt_properties && dgn_properties == other.dgn_properties && ifc_properties == other.ifc_properties && igs_properties == other.igs_properties && stl_properties == other.stl_properties && dwf_properties == other.dwf_properties && cf2_properties == other.cf2_properties && fbx_properties == other.fbx_properties && obj_properties == other.obj_properties && plt_properties == other.plt_properties && stp_properties == other.stp_properties end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 274 def _deserialize(type, value) case type.to_sym when :DateTime Time.at(/\d/.match(value)[0].to_f).to_datetime when :Date Time.at(/\d/.match(value)[0].to_f).to_date when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = AsposeCadCloud.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 341 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 252 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
239 240 241 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 239 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
245 246 247 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 245 def hash [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 end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 194 def list_invalid_properties invalid_properties = [] if @height.nil? invalid_properties.push("invalid value for 'height', height cannot be nil.") end if @width.nil? invalid_properties.push("invalid value for 'width', width cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
321 322 323 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 321 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
327 328 329 330 331 332 333 334 335 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 327 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
315 316 317 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 315 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
209 210 211 212 213 |
# File 'lib/aspose_cad_cloud/models/cad_response.rb', line 209 def valid? return false if @height.nil? return false if @width.nil? return true end |