Class: UltracartClient::ConversationPbxAudio
- Inherits:
-
Object
- Object
- UltracartClient::ConversationPbxAudio
- Defined in:
- lib/ultracart_api/models/conversation_pbx_audio.rb
Instance Attribute Summary collapse
-
#audio_s3_listing_key ⇒ Object
Audio S3 Listing Key.
-
#conversation_pbx_audio_uuid ⇒ Object
Conversation Pbx Audio UUID.
-
#default_hold_music ⇒ Object
If true, this will be the default hold music.
-
#description ⇒ Object
Description of this audio.
-
#filename ⇒ Object
Filename.
-
#merchant_id ⇒ Object
Merchant Id.
-
#mime_type ⇒ Object
Mime Type.
-
#url ⇒ Object
URL.
-
#user_id ⇒ Object
User Id.
-
#version ⇒ Object
Version.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_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 ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ConversationPbxAudio
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 = {}) ⇒ ConversationPbxAudio
Initializes the object
93 94 95 96 97 98 99 100 101 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 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 93 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxAudio` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxAudio`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'audio_s3_listing_key') self.audio_s3_listing_key = attributes[:'audio_s3_listing_key'] end if attributes.key?(:'conversation_pbx_audio_uuid') self.conversation_pbx_audio_uuid = attributes[:'conversation_pbx_audio_uuid'] end if attributes.key?(:'default_hold_music') self.default_hold_music = attributes[:'default_hold_music'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'filename') self.filename = attributes[:'filename'] end if attributes.key?(:'merchant_id') self.merchant_id = attributes[:'merchant_id'] end if attributes.key?(:'mime_type') self.mime_type = attributes[:'mime_type'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'version') self.version = attributes[:'version'] end end |
Instance Attribute Details
#audio_s3_listing_key ⇒ Object
Audio S3 Listing Key
19 20 21 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 19 def audio_s3_listing_key @audio_s3_listing_key end |
#conversation_pbx_audio_uuid ⇒ Object
Conversation Pbx Audio UUID
22 23 24 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 22 def conversation_pbx_audio_uuid @conversation_pbx_audio_uuid end |
#default_hold_music ⇒ Object
If true, this will be the default hold music
25 26 27 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 25 def default_hold_music @default_hold_music end |
#description ⇒ Object
Description of this audio
28 29 30 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 28 def description @description end |
#filename ⇒ Object
Filename
31 32 33 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 31 def filename @filename end |
#merchant_id ⇒ Object
Merchant Id
34 35 36 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 34 def merchant_id @merchant_id end |
#mime_type ⇒ Object
Mime Type
37 38 39 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 37 def mime_type @mime_type end |
#url ⇒ Object
URL
40 41 42 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 40 def url @url end |
#user_id ⇒ Object
User Id
43 44 45 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 43 def user_id @user_id end |
#version ⇒ Object
Version
46 47 48 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 46 def version @version end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
65 66 67 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 65 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 49 def self.attribute_map { :'audio_s3_listing_key' => :'audio_s3_listing_key', :'conversation_pbx_audio_uuid' => :'conversation_pbx_audio_uuid', :'default_hold_music' => :'default_hold_music', :'description' => :'description', :'filename' => :'filename', :'merchant_id' => :'merchant_id', :'mime_type' => :'mime_type', :'url' => :'url', :'user_id' => :'user_id', :'version' => :'version' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
282 283 284 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 282 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
86 87 88 89 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 86 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 70 def self.openapi_types { :'audio_s3_listing_key' => :'String', :'conversation_pbx_audio_uuid' => :'String', :'default_hold_music' => :'Boolean', :'description' => :'String', :'filename' => :'String', :'merchant_id' => :'String', :'mime_type' => :'String', :'url' => :'String', :'user_id' => :'Integer', :'version' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 252 def ==(o) return true if self.equal?(o) self.class == o.class && audio_s3_listing_key == o.audio_s3_listing_key && conversation_pbx_audio_uuid == o.conversation_pbx_audio_uuid && default_hold_music == o.default_hold_music && description == o.description && filename == o.filename && merchant_id == o.merchant_id && mime_type == o.mime_type && url == o.url && user_id == o.user_id && version == o.version end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
313 314 315 316 317 318 319 320 321 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 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 313 def _deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = UltracartClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
384 385 386 387 388 389 390 391 392 393 394 395 396 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 384 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
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 289 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that 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 end self end |
#eql?(o) ⇒ Boolean
269 270 271 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 269 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
275 276 277 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 275 def hash [audio_s3_listing_key, conversation_pbx_audio_uuid, default_hold_music, description, filename, merchant_id, mime_type, url, user_id, version].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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/ultracart_api/models/conversation_pbx_audio.rb', line 149 def list_invalid_properties invalid_properties = Array.new if !@audio_s3_listing_key.nil? && @audio_s3_listing_key.to_s.length > 250 invalid_properties.push('invalid value for "audio_s3_listing_key", the character length must be smaller than or equal to 250.') end if !@conversation_pbx_audio_uuid.nil? && @conversation_pbx_audio_uuid.to_s.length > 50 invalid_properties.push('invalid value for "conversation_pbx_audio_uuid", the character length must be smaller than or equal to 50.') end if !@description.nil? && @description.to_s.length > 100 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 100.') end if !@filename.nil? && @filename.to_s.length > 100 invalid_properties.push('invalid value for "filename", the character length must be smaller than or equal to 100.') end if !@merchant_id.nil? && @merchant_id.to_s.length > 5 invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.') end if !@mime_type.nil? && @mime_type.to_s.length > 100 invalid_properties.push('invalid value for "mime_type", the character length must be smaller than or equal to 100.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
360 361 362 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 360 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 366 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
354 355 356 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 354 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
180 181 182 183 184 185 186 187 188 |
# File 'lib/ultracart_api/models/conversation_pbx_audio.rb', line 180 def valid? return false if !@audio_s3_listing_key.nil? && @audio_s3_listing_key.to_s.length > 250 return false if !@conversation_pbx_audio_uuid.nil? && @conversation_pbx_audio_uuid.to_s.length > 50 return false if !@description.nil? && @description.to_s.length > 100 return false if !@filename.nil? && @filename.to_s.length > 100 return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5 return false if !@mime_type.nil? && @mime_type.to_s.length > 100 true end |