Class: RokkaClientCodegen::SourceImage
- Inherits:
-
Object
- Object
- RokkaClientCodegen::SourceImage
- Defined in:
- lib/rokka_client_codegen/models/source_image.rb
Instance Attribute Summary collapse
-
#binary_hash ⇒ Object
Returns the value of attribute binary_hash.
-
#created ⇒ Object
Returns the value of attribute created.
-
#deleted ⇒ Object
Null as default (means false).
-
#deleted_date ⇒ Object
Returns the value of attribute deleted_date.
-
#dynamic_metadata ⇒ Object
Returns the value of attribute dynamic_metadata.
-
#format ⇒ Object
Returns the value of attribute format.
-
#height ⇒ Object
Returns the value of attribute height.
-
#link ⇒ Object
Returns the value of attribute link.
-
#long_hash ⇒ Object
Returns the value of attribute long_hash.
-
#mimetype ⇒ Object
Returns the value of attribute mimetype.
-
#name ⇒ Object
Returns the value of attribute name.
-
#organization ⇒ Object
Returns the value of attribute organization.
-
#short_hash ⇒ Object
Returns the value of attribute short_hash.
-
#size ⇒ Object
Returns the value of attribute size.
-
#static_metadata ⇒ Object
Returns the value of attribute static_metadata.
-
#user_metadata ⇒ Object
Returns the value of attribute user_metadata.
-
#width ⇒ Object
Returns the value of attribute width.
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
-
#==(o) ⇒ 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?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SourceImage
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 = {}) ⇒ SourceImage
Initializes the object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 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 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 102 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?(:'hash') self.long_hash = attributes[:'hash'] end if attributes.has_key?(:'short_hash') self.short_hash = attributes[:'short_hash'] end if attributes.has_key?(:'binary_hash') self.binary_hash = attributes[:'binary_hash'] end if attributes.has_key?(:'created') self.created = attributes[:'created'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'mimetype') self.mimetype = attributes[:'mimetype'] end if attributes.has_key?(:'format') self.format = attributes[:'format'] end if attributes.has_key?(:'size') self.size = attributes[:'size'] end if attributes.has_key?(:'width') self.width = attributes[:'width'] end if attributes.has_key?(:'height') self.height = attributes[:'height'] end if attributes.has_key?(:'organization') self.organization = attributes[:'organization'] end if attributes.has_key?(:'link') self.link = attributes[:'link'] end if attributes.has_key?(:'dynamic_metadata') self. = attributes[:'dynamic_metadata'] end if attributes.has_key?(:'static_metadata') self. = attributes[:'static_metadata'] end if attributes.has_key?(:'user_metadata') self. = attributes[:'user_metadata'] end if attributes.has_key?(:'deleted') self.deleted = attributes[:'deleted'] end if attributes.has_key?(:'deleted_date') self.deleted_date = attributes[:'deleted_date'] end end |
Instance Attribute Details
#binary_hash ⇒ Object
Returns the value of attribute binary_hash.
22 23 24 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 22 def binary_hash @binary_hash end |
#created ⇒ Object
Returns the value of attribute created.
24 25 26 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 24 def created @created end |
#deleted ⇒ Object
Null as default (means false)
49 50 51 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 49 def deleted @deleted end |
#deleted_date ⇒ Object
Returns the value of attribute deleted_date.
51 52 53 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 51 def deleted_date @deleted_date end |
#dynamic_metadata ⇒ Object
Returns the value of attribute dynamic_metadata.
42 43 44 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 42 def @dynamic_metadata end |
#format ⇒ Object
Returns the value of attribute format.
30 31 32 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 30 def format @format end |
#height ⇒ Object
Returns the value of attribute height.
36 37 38 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 36 def height @height end |
#link ⇒ Object
Returns the value of attribute link.
40 41 42 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 40 def link @link end |
#long_hash ⇒ Object
Returns the value of attribute long_hash.
18 19 20 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 18 def long_hash @long_hash end |
#mimetype ⇒ Object
Returns the value of attribute mimetype.
28 29 30 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 28 def mimetype @mimetype end |
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 26 def name @name end |
#organization ⇒ Object
Returns the value of attribute organization.
38 39 40 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 38 def organization @organization end |
#short_hash ⇒ Object
Returns the value of attribute short_hash.
20 21 22 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 20 def short_hash @short_hash end |
#size ⇒ Object
Returns the value of attribute size.
32 33 34 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 32 def size @size end |
#static_metadata ⇒ Object
Returns the value of attribute static_metadata.
44 45 46 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 44 def @static_metadata end |
#user_metadata ⇒ Object
Returns the value of attribute user_metadata.
46 47 48 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 46 def @user_metadata end |
#width ⇒ Object
Returns the value of attribute width.
34 35 36 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 34 def width @width end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 55 def self.attribute_map { :'long_hash' => :'hash', :'short_hash' => :'short_hash', :'binary_hash' => :'binary_hash', :'created' => :'created', :'name' => :'name', :'mimetype' => :'mimetype', :'format' => :'format', :'size' => :'size', :'width' => :'width', :'height' => :'height', :'organization' => :'organization', :'link' => :'link', :'dynamic_metadata' => :'dynamic_metadata', :'static_metadata' => :'static_metadata', :'user_metadata' => :'user_metadata', :'deleted' => :'deleted', :'deleted_date' => :'deleted_date' } end |
.swagger_types ⇒ Object
Attribute type mapping.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 78 def self.swagger_types { :'long_hash' => :'String', :'short_hash' => :'String', :'binary_hash' => :'String', :'created' => :'DateTime', :'name' => :'String', :'mimetype' => :'String', :'format' => :'String', :'size' => :'Integer', :'width' => :'Integer', :'height' => :'Integer', :'organization' => :'String', :'link' => :'String', :'dynamic_metadata' => :'Object', :'static_metadata' => :'Object', :'user_metadata' => :'Object', :'deleted' => :'BOOLEAN', :'deleted_date' => :'DateTime' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 193 def ==(o) return true if self.equal?(o) self.class == o.class && hash == o.hash && short_hash == o.short_hash && binary_hash == o.binary_hash && created == o.created && name == o.name && mimetype == o.mimetype && format == o.format && size == o.size && width == o.width && height == o.height && organization == o.organization && link == o.link && == o. && == o. && == o. && deleted == o.deleted && deleted_date == o.deleted_date end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 251 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 = RokkaClientCodegen.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
317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 317 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
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 230 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?(o) ⇒ Boolean
217 218 219 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 217 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
223 224 225 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 223 def hash [long_hash, short_hash, binary_hash, created, name, mimetype, format, size, width, height, organization, link, , , , deleted, deleted_date].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
180 181 182 183 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 180 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
297 298 299 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 297 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
303 304 305 306 307 308 309 310 311 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 303 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
291 292 293 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 291 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
187 188 189 |
# File 'lib/rokka_client_codegen/models/source_image.rb', line 187 def valid? return true end |