Class: Quandoo::MerchantDetailsDto
- Inherits:
-
Object
- Object
- Quandoo::MerchantDetailsDto
- Defined in:
- lib/quandoo/models/merchant_details_dto.rb
Instance Attribute Summary collapse
-
#bookable ⇒ Object
The flag indicates whether the merchant is bookable or not.
-
#ccv_enabled ⇒ Object
If true, credit card information is required when creating a reservation.
-
#chain ⇒ Object
The chain of the merchant.
-
#currency ⇒ Object
The currency of the merchant.
-
#documents ⇒ Object
The documents this merchant has.
-
#id ⇒ Object
The id of the merchant.
-
#images ⇒ Object
The images this merchant has.
-
#ivr_redirect_number ⇒ Object
The IVR forwarding phone number.
-
#links ⇒ Object
The links related to this entity.
-
#locale ⇒ Object
The locale of the merchant.
-
#location ⇒ Object
The location of the merchant.
-
#name ⇒ Object
The name of the merchant.
-
#opening_times ⇒ Object
All opening times of the merchant.
-
#phone_number ⇒ Object
The phone number of the merchant.
-
#review_score ⇒ Object
The review score of the merchant.
-
#tag_groups ⇒ Object
The tag groups this merchant belongs to.
-
#timezone ⇒ Object
The timezone of the merchant.
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 = {}) ⇒ MerchantDetailsDto
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 = {}) ⇒ MerchantDetailsDto
Initializes the object
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 116 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?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'phoneNumber') self.phone_number = attributes[:'phoneNumber'] end if attributes.has_key?(:'currency') self.currency = attributes[:'currency'] end if attributes.has_key?(:'locale') self.locale = attributes[:'locale'] end if attributes.has_key?(:'timezone') self.timezone = attributes[:'timezone'] end if attributes.has_key?(:'location') self.location = attributes[:'location'] end if attributes.has_key?(:'reviewScore') self.review_score = attributes[:'reviewScore'] end if attributes.has_key?(:'tagGroups') if (value = attributes[:'tagGroups']).is_a?(Array) self.tag_groups = value end end if attributes.has_key?(:'images') if (value = attributes[:'images']).is_a?(Array) self.images = value end end if attributes.has_key?(:'documents') if (value = attributes[:'documents']).is_a?(Array) self.documents = value end end if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end end if attributes.has_key?(:'bookable') self.bookable = attributes[:'bookable'] end if attributes.has_key?(:'openingTimes') self.opening_times = attributes[:'openingTimes'] end if attributes.has_key?(:'ccvEnabled') self.ccv_enabled = attributes[:'ccvEnabled'] end if attributes.has_key?(:'chain') self.chain = attributes[:'chain'] end if attributes.has_key?(:'ivrRedirectNumber') self.ivr_redirect_number = attributes[:'ivrRedirectNumber'] end end |
Instance Attribute Details
#bookable ⇒ Object
The flag indicates whether the merchant is bookable or not.
54 55 56 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 54 def bookable @bookable end |
#ccv_enabled ⇒ Object
If true, credit card information is required when creating a reservation.
60 61 62 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 60 def ccv_enabled @ccv_enabled end |
#chain ⇒ Object
The chain of the merchant.
63 64 65 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 63 def chain @chain end |
#currency ⇒ Object
The currency of the merchant.
27 28 29 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 27 def currency @currency end |
#documents ⇒ Object
The documents this merchant has.
48 49 50 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 48 def documents @documents end |
#id ⇒ Object
The id of the merchant.
18 19 20 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 18 def id @id end |
#images ⇒ Object
The images this merchant has.
45 46 47 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 45 def images @images end |
#ivr_redirect_number ⇒ Object
The IVR forwarding phone number.
66 67 68 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 66 def ivr_redirect_number @ivr_redirect_number end |
#links ⇒ Object
The links related to this entity.
51 52 53 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 51 def links @links end |
#locale ⇒ Object
The locale of the merchant.
30 31 32 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 30 def locale @locale end |
#location ⇒ Object
The location of the merchant.
36 37 38 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 36 def location @location end |
#name ⇒ Object
The name of the merchant.
21 22 23 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 21 def name @name end |
#opening_times ⇒ Object
All opening times of the merchant.
57 58 59 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 57 def opening_times @opening_times end |
#phone_number ⇒ Object
The phone number of the merchant.
24 25 26 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 24 def phone_number @phone_number end |
#review_score ⇒ Object
The review score of the merchant.
39 40 41 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 39 def review_score @review_score end |
#tag_groups ⇒ Object
The tag groups this merchant belongs to.
42 43 44 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 42 def tag_groups @tag_groups end |
#timezone ⇒ Object
The timezone of the merchant.
33 34 35 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 33 def timezone @timezone end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 69 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'phone_number' => :'phoneNumber', :'currency' => :'currency', :'locale' => :'locale', :'timezone' => :'timezone', :'location' => :'location', :'review_score' => :'reviewScore', :'tag_groups' => :'tagGroups', :'images' => :'images', :'documents' => :'documents', :'links' => :'links', :'bookable' => :'bookable', :'opening_times' => :'openingTimes', :'ccv_enabled' => :'ccvEnabled', :'chain' => :'chain', :'ivr_redirect_number' => :'ivrRedirectNumber' } end |
.swagger_types ⇒ Object
Attribute type mapping.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 92 def self.swagger_types { :'id' => :'Integer', :'name' => :'String', :'phone_number' => :'String', :'currency' => :'String', :'locale' => :'String', :'timezone' => :'String', :'location' => :'LocationDto', :'review_score' => :'String', :'tag_groups' => :'Array<TagGroupDto>', :'images' => :'Array<ImageDto>', :'documents' => :'Array<DocumentDto>', :'links' => :'Array<LinkRelationDto>', :'bookable' => :'BOOLEAN', :'opening_times' => :'OpeningTimesDto', :'ccv_enabled' => :'BOOLEAN', :'chain' => :'ChainDto', :'ivr_redirect_number' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 264 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && phone_number == o.phone_number && currency == o.currency && locale == o.locale && timezone == o.timezone && location == o.location && review_score == o.review_score && tag_groups == o.tag_groups && images == o.images && documents == o.documents && links == o.links && bookable == o.bookable && opening_times == o.opening_times && ccv_enabled == o.ccv_enabled && chain == o.chain && ivr_redirect_number == o.ivr_redirect_number end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 322 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 = Quandoo.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
388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 388 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
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 301 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
288 289 290 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 288 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
294 295 296 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 294 def hash [id, name, phone_number, currency, locale, timezone, location, review_score, tag_groups, images, documents, links, bookable, opening_times, ccv_enabled, chain, ivr_redirect_number].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 201 def list_invalid_properties invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @phone_number.nil? invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.') end if @timezone.nil? invalid_properties.push('invalid value for "timezone", timezone cannot be nil.') end if @location.nil? invalid_properties.push('invalid value for "location", location cannot be nil.') end if @review_score.nil? invalid_properties.push('invalid value for "review_score", review_score cannot be nil.') end if @links.nil? invalid_properties.push('invalid value for "links", links cannot be nil.') end if @bookable.nil? invalid_properties.push('invalid value for "bookable", bookable cannot be nil.') end if @opening_times.nil? invalid_properties.push('invalid value for "opening_times", opening_times cannot be nil.') end if @ccv_enabled.nil? invalid_properties.push('invalid value for "ccv_enabled", ccv_enabled cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
368 369 370 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 368 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
374 375 376 377 378 379 380 381 382 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 374 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
362 363 364 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 362 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/quandoo/models/merchant_details_dto.rb', line 248 def valid? return false if @id.nil? return false if @name.nil? return false if @phone_number.nil? return false if @timezone.nil? return false if @location.nil? return false if @review_score.nil? return false if @links.nil? return false if @bookable.nil? return false if @opening_times.nil? return false if @ccv_enabled.nil? true end |