Class: AsposeImagingCloud::ImagingResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose-imaging-cloud/models/imaging_response.rb

Overview

Represents information about image.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ImagingResponse

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 146

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.has_key?(:'Height')
    self.height = attributes[:'Height']
  end

  if attributes.has_key?(:'Width')
    self.width = attributes[:'Width']
  end

  if attributes.has_key?(:'BitsPerPixel')
    self.bits_per_pixel = attributes[:'BitsPerPixel']
  end

  if attributes.has_key?(:'BmpProperties')
    self.bmp_properties = attributes[:'BmpProperties']
  end

  if attributes.has_key?(:'GifProperties')
    self.gif_properties = attributes[:'GifProperties']
  end

  if attributes.has_key?(:'JpegProperties')
    self.jpeg_properties = attributes[:'JpegProperties']
  end

  if attributes.has_key?(:'PngProperties')
    self.png_properties = attributes[:'PngProperties']
  end

  if attributes.has_key?(:'TiffProperties')
    self.tiff_properties = attributes[:'TiffProperties']
  end

  if attributes.has_key?(:'PsdProperties')
    self.psd_properties = attributes[:'PsdProperties']
  end

  if attributes.has_key?(:'DjvuProperties')
    self.djvu_properties = attributes[:'DjvuProperties']
  end

  if attributes.has_key?(:'WebPProperties')
    self.web_p_properties = attributes[:'WebPProperties']
  end

  if attributes.has_key?(:'Jpeg2000Properties')
    self.jpeg2000_properties = attributes[:'Jpeg2000Properties']
  end

  if attributes.has_key?(:'DicomProperties')
    self.dicom_properties = attributes[:'DicomProperties']
  end

  if attributes.has_key?(:'DngProperties')
    self.dng_properties = attributes[:'DngProperties']
  end

  if attributes.has_key?(:'OdgProperties')
    self.odg_properties = attributes[:'OdgProperties']
  end

  if attributes.has_key?(:'SvgProperties')
    self.svg_properties = attributes[:'SvgProperties']
  end

  if attributes.has_key?(:'EpsProperties')
    self.eps_properties = attributes[:'EpsProperties']
  end

  if attributes.has_key?(:'HorizontalResolution')
    self.horizontal_resolution = attributes[:'HorizontalResolution']
  end

  if attributes.has_key?(:'VerticalResolution')
    self.vertical_resolution = attributes[:'VerticalResolution']
  end

  if attributes.has_key?(:'IsCached')
    self.is_cached = attributes[:'IsCached']
  end
end

Instance Attribute Details

#bits_per_pixelObject

Gets or sets the bits per pixel for image.



39
40
41
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 39

def bits_per_pixel
  @bits_per_pixel
end

#bmp_propertiesObject

Gets or sets the BMP properties.



42
43
44
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 42

def bmp_properties
  @bmp_properties
end

#dicom_propertiesObject

Gets or sets the DICOM properties.



69
70
71
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 69

def dicom_properties
  @dicom_properties
end

#djvu_propertiesObject

Gets or sets the DJVU properties.



60
61
62
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 60

def djvu_properties
  @djvu_properties
end

#dng_propertiesObject

Gets or sets the DNG properties.



72
73
74
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 72

def dng_properties
  @dng_properties
end

#eps_propertiesObject

Gets or sets the EPS properties.



81
82
83
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 81

def eps_properties
  @eps_properties
end

#gif_propertiesObject

Gets or sets the GIF properties.



45
46
47
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 45

def gif_properties
  @gif_properties
end

#heightObject

Gets or sets the height of image.



33
34
35
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 33

def height
  @height
end

#horizontal_resolutionObject

Gets or sets the horizontal resolution of an image.



84
85
86
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 84

def horizontal_resolution
  @horizontal_resolution
end

#is_cachedObject

Gets or sets a value indicating whether image is cached.



90
91
92
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 90

def is_cached
  @is_cached
end

#jpeg2000_propertiesObject

Gets or sets the JPEG2000 properties.



66
67
68
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 66

def jpeg2000_properties
  @jpeg2000_properties
end

#jpeg_propertiesObject

Gets or sets the JPEG properties.



48
49
50
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 48

def jpeg_properties
  @jpeg_properties
end

#odg_propertiesObject

Gets or sets the the ODG properties.



75
76
77
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 75

def odg_properties
  @odg_properties
end

#png_propertiesObject

Gets or sets the PNG properties.



51
52
53
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 51

def png_properties
  @png_properties
end

#psd_propertiesObject

Gets or sets the PSD properties.



57
58
59
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 57

def psd_properties
  @psd_properties
end

#svg_propertiesObject

Gets or sets the SVG properties.



78
79
80
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 78

def svg_properties
  @svg_properties
end

#tiff_propertiesObject

Gets or sets the TIFF properties.



54
55
56
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 54

def tiff_properties
  @tiff_properties
end

#vertical_resolutionObject

Gets or sets the vertical resolution of an image.



87
88
89
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 87

def vertical_resolution
  @vertical_resolution
end

#web_p_propertiesObject

Gets or sets the WEBP properties.



63
64
65
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 63

def web_p_properties
  @web_p_properties
end

#widthObject

Gets or sets the width of image.



36
37
38
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 36

def width
  @width
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 93

def self.attribute_map
  {
    :'height' => :'Height',
    :'width' => :'Width',
    :'bits_per_pixel' => :'BitsPerPixel',
    :'bmp_properties' => :'BmpProperties',
    :'gif_properties' => :'GifProperties',
    :'jpeg_properties' => :'JpegProperties',
    :'png_properties' => :'PngProperties',
    :'tiff_properties' => :'TiffProperties',
    :'psd_properties' => :'PsdProperties',
    :'djvu_properties' => :'DjvuProperties',
    :'web_p_properties' => :'WebPProperties',
    :'jpeg2000_properties' => :'Jpeg2000Properties',
    :'dicom_properties' => :'DicomProperties',
    :'dng_properties' => :'DngProperties',
    :'odg_properties' => :'OdgProperties',
    :'svg_properties' => :'SvgProperties',
    :'eps_properties' => :'EpsProperties',
    :'horizontal_resolution' => :'HorizontalResolution',
    :'vertical_resolution' => :'VerticalResolution',
    :'is_cached' => :'IsCached'
  }
end

.swagger_typesObject

Attribute type mapping.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 119

def self.swagger_types
  {
    :'height' => :'Integer',
    :'width' => :'Integer',
    :'bits_per_pixel' => :'Integer',
    :'bmp_properties' => :'BmpProperties',
    :'gif_properties' => :'GifProperties',
    :'jpeg_properties' => :'JpegProperties',
    :'png_properties' => :'PngProperties',
    :'tiff_properties' => :'TiffProperties',
    :'psd_properties' => :'PsdProperties',
    :'djvu_properties' => :'DjvuProperties',
    :'web_p_properties' => :'WebPProperties',
    :'jpeg2000_properties' => :'Jpeg2000Properties',
    :'dicom_properties' => :'DicomProperties',
    :'dng_properties' => :'DngProperties',
    :'odg_properties' => :'OdgProperties',
    :'svg_properties' => :'SvgProperties',
    :'eps_properties' => :'EpsProperties',
    :'horizontal_resolution' => :'Float',
    :'vertical_resolution' => :'Float',
    :'is_cached' => :'BOOLEAN'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 278

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      height == o.height &&
      width == o.width &&
      bits_per_pixel == o.bits_per_pixel &&
      bmp_properties == o.bmp_properties &&
      gif_properties == o.gif_properties &&
      jpeg_properties == o.jpeg_properties &&
      png_properties == o.png_properties &&
      tiff_properties == o.tiff_properties &&
      psd_properties == o.psd_properties &&
      djvu_properties == o.djvu_properties &&
      web_p_properties == o.web_p_properties &&
      jpeg2000_properties == o.jpeg2000_properties &&
      dicom_properties == o.dicom_properties &&
      dng_properties == o.dng_properties &&
      odg_properties == o.odg_properties &&
      svg_properties == o.svg_properties &&
      eps_properties == o.eps_properties &&
      horizontal_resolution == o.horizontal_resolution &&
      vertical_resolution == o.vertical_resolution &&
      is_cached == o.is_cached
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 341

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  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 = AsposeImagingCloud.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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 407

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 318

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    attribute_key = self.class.attribute_map[key]
    attribute_key = (attribute_key[0, 1].downcase + attribute_key[1..-1]).to_sym
    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[attribute_key].is_a?(Array)
        self.send("#{key}=", attributes[attribute_key].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[attribute_key].nil?
      self.send("#{key}=", _deserialize(type, attributes[attribute_key]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


305
306
307
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 305

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



311
312
313
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 311

def hash
  [height, width, bits_per_pixel, bmp_properties, gif_properties, jpeg_properties, png_properties, tiff_properties, psd_properties, djvu_properties, web_p_properties, jpeg2000_properties, dicom_properties, dng_properties, odg_properties, svg_properties, eps_properties, horizontal_resolution, vertical_resolution, is_cached].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 235

def list_invalid_properties
  invalid_properties = Array.new
  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

  if @bits_per_pixel.nil?
    invalid_properties.push('invalid value for "bits_per_pixel", bits_per_pixel cannot be nil.')
  end

  if @horizontal_resolution.nil?
    invalid_properties.push('invalid value for "horizontal_resolution", horizontal_resolution cannot be nil.')
  end

  if @vertical_resolution.nil?
    invalid_properties.push('invalid value for "vertical_resolution", vertical_resolution cannot be nil.')
  end

  if @is_cached.nil?
    invalid_properties.push('invalid value for "is_cached", is_cached cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



387
388
389
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 387

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



393
394
395
396
397
398
399
400
401
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 393

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



381
382
383
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 381

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



266
267
268
269
270
271
272
273
274
# File 'lib/aspose-imaging-cloud/models/imaging_response.rb', line 266

def valid?
  return false if @height.nil?
  return false if @width.nil?
  return false if @bits_per_pixel.nil?
  return false if @horizontal_resolution.nil?
  return false if @vertical_resolution.nil?
  return false if @is_cached.nil?
  true
end