Class: Zernio::EnableVoiceOnNumber200Response

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/enable_voice_on_number200_response.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ EnableVoiceOnNumber200Response

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 138

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::EnableVoiceOnNumber200Response` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::EnableVoiceOnNumber200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'enabled')
    self.enabled = attributes[:'enabled']
  end

  if attributes.key?(:'phone_number')
    self.phone_number = attributes[:'phone_number']
  end

  if attributes.key?(:'pstn_forward_to')
    self.pstn_forward_to = attributes[:'pstn_forward_to']
  end

  if attributes.key?(:'recording_enabled')
    self.recording_enabled = attributes[:'recording_enabled']
  end

  if attributes.key?(:'transcription_enabled')
    self.transcription_enabled = attributes[:'transcription_enabled']
  end

  if attributes.key?(:'transcription_language')
    self.transcription_language = attributes[:'transcription_language']
  end

  if attributes.key?(:'voicemail_enabled')
    self.voicemail_enabled = attributes[:'voicemail_enabled']
  end

  if attributes.key?(:'voicemail_greeting')
    self.voicemail_greeting = attributes[:'voicemail_greeting']
  end

  if attributes.key?(:'business_hours_enabled')
    self.business_hours_enabled = attributes[:'business_hours_enabled']
  end

  if attributes.key?(:'business_hours_timezone')
    self.business_hours_timezone = attributes[:'business_hours_timezone']
  end

  if attributes.key?(:'business_hours')
    if (value = attributes[:'business_hours']).is_a?(Array)
      self.business_hours = value
    end
  end

  if attributes.key?(:'blocked_callers')
    if (value = attributes[:'blocked_callers']).is_a?(Array)
      self.blocked_callers = value
    end
  end

  if attributes.key?(:'forward_caller_id')
    self.forward_caller_id = attributes[:'forward_caller_id']
  end

  if attributes.key?(:'ivr_enabled')
    self.ivr_enabled = attributes[:'ivr_enabled']
  end

  if attributes.key?(:'ivr_prompt')
    self.ivr_prompt = attributes[:'ivr_prompt']
  end

  if attributes.key?(:'ivr_options')
    if (value = attributes[:'ivr_options']).is_a?(Array)
      self.ivr_options = value
    end
  end
end

Instance Attribute Details

#blocked_callersObject

Returns the value of attribute blocked_callers.



40
41
42
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 40

def blocked_callers
  @blocked_callers
end

#business_hoursObject

Returns the value of attribute business_hours.



38
39
40
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 38

def business_hours
  @business_hours
end

#business_hours_enabledObject

Returns the value of attribute business_hours_enabled.



34
35
36
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 34

def business_hours_enabled
  @business_hours_enabled
end

#business_hours_timezoneObject

Returns the value of attribute business_hours_timezone.



36
37
38
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 36

def business_hours_timezone
  @business_hours_timezone
end

#enabledObject

Returns the value of attribute enabled.



18
19
20
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 18

def enabled
  @enabled
end

#forward_caller_idObject

Returns the value of attribute forward_caller_id.



42
43
44
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 42

def forward_caller_id
  @forward_caller_id
end

#ivr_enabledObject

Returns the value of attribute ivr_enabled.



44
45
46
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 44

def ivr_enabled
  @ivr_enabled
end

#ivr_optionsObject

Returns the value of attribute ivr_options.



48
49
50
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 48

def ivr_options
  @ivr_options
end

#ivr_promptObject

Returns the value of attribute ivr_prompt.



46
47
48
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 46

def ivr_prompt
  @ivr_prompt
end

#phone_numberObject

Returns the value of attribute phone_number.



20
21
22
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 20

def phone_number
  @phone_number
end

#pstn_forward_toObject

Returns the value of attribute pstn_forward_to.



22
23
24
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 22

def pstn_forward_to
  @pstn_forward_to
end

#recording_enabledObject

Returns the value of attribute recording_enabled.



24
25
26
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 24

def recording_enabled
  @recording_enabled
end

#transcription_enabledObject

Returns the value of attribute transcription_enabled.



26
27
28
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 26

def transcription_enabled
  @transcription_enabled
end

#transcription_languageObject

Returns the value of attribute transcription_language.



28
29
30
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 28

def transcription_language
  @transcription_language
end

#voicemail_enabledObject

Returns the value of attribute voicemail_enabled.



30
31
32
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 30

def voicemail_enabled
  @voicemail_enabled
end

#voicemail_greetingObject

Returns the value of attribute voicemail_greeting.



32
33
34
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 32

def voicemail_greeting
  @voicemail_greeting
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



95
96
97
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 95

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



100
101
102
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 100

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 73

def self.attribute_map
  {
    :'enabled' => :'enabled',
    :'phone_number' => :'phoneNumber',
    :'pstn_forward_to' => :'pstnForwardTo',
    :'recording_enabled' => :'recordingEnabled',
    :'transcription_enabled' => :'transcriptionEnabled',
    :'transcription_language' => :'transcriptionLanguage',
    :'voicemail_enabled' => :'voicemailEnabled',
    :'voicemail_greeting' => :'voicemailGreeting',
    :'business_hours_enabled' => :'businessHoursEnabled',
    :'business_hours_timezone' => :'businessHoursTimezone',
    :'business_hours' => :'businessHours',
    :'blocked_callers' => :'blockedCallers',
    :'forward_caller_id' => :'forwardCallerId',
    :'ivr_enabled' => :'ivrEnabled',
    :'ivr_prompt' => :'ivrPrompt',
    :'ivr_options' => :'ivrOptions'
  }
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



300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 300

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{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[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



127
128
129
130
131
132
133
134
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 127

def self.openapi_nullable
  Set.new([
    :'pstn_forward_to',
    :'voicemail_greeting',
    :'business_hours_timezone',
    :'ivr_prompt',
  ])
end

.openapi_typesObject

Attribute type mapping.



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 105

def self.openapi_types
  {
    :'enabled' => :'Boolean',
    :'phone_number' => :'String',
    :'pstn_forward_to' => :'String',
    :'recording_enabled' => :'Boolean',
    :'transcription_enabled' => :'Boolean',
    :'transcription_language' => :'String',
    :'voicemail_enabled' => :'Boolean',
    :'voicemail_greeting' => :'String',
    :'business_hours_enabled' => :'Boolean',
    :'business_hours_timezone' => :'String',
    :'business_hours' => :'Array<EnableVoiceOnNumber200ResponseBusinessHoursInner>',
    :'blocked_callers' => :'Array<String>',
    :'forward_caller_id' => :'String',
    :'ivr_enabled' => :'Boolean',
    :'ivr_prompt' => :'String',
    :'ivr_options' => :'Array<EnableVoiceOnNumber200ResponseIvrOptionsInner>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 264

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      enabled == o.enabled &&
      phone_number == o.phone_number &&
      pstn_forward_to == o.pstn_forward_to &&
      recording_enabled == o.recording_enabled &&
      transcription_enabled == o.transcription_enabled &&
      transcription_language == o.transcription_language &&
      voicemail_enabled == o.voicemail_enabled &&
      voicemail_greeting == o.voicemail_greeting &&
      business_hours_enabled == o.business_hours_enabled &&
      business_hours_timezone == o.business_hours_timezone &&
      business_hours == o.business_hours &&
      blocked_callers == o.blocked_callers &&
      forward_caller_id == o.forward_caller_id &&
      ivr_enabled == o.ivr_enabled &&
      ivr_prompt == o.ivr_prompt &&
      ivr_options == o.ivr_options
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


287
288
289
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 287

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



293
294
295
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 293

def hash
  [enabled, phone_number, pstn_forward_to, recording_enabled, transcription_enabled, transcription_language, voicemail_enabled, voicemail_greeting, business_hours_enabled, business_hours_timezone, business_hours, blocked_callers, forward_caller_id, ivr_enabled, ivr_prompt, ivr_options].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



225
226
227
228
229
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 225

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 322

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

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



233
234
235
236
237
238
239
240
# File 'lib/zernio-sdk/models/enable_voice_on_number200_response.rb', line 233

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  transcription_language_validator = EnumAttributeValidator.new('String', ["auto", "en", "es"])
  return false unless transcription_language_validator.valid?(@transcription_language)
  forward_caller_id_validator = EnumAttributeValidator.new('String', ["business", "caller"])
  return false unless forward_caller_id_validator.valid?(@forward_caller_id)
  true
end