Class: Zernio::WebhookPayloadCallReceivedCall

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/webhook_payload_call_received_call.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 = {}) ⇒ WebhookPayloadCallReceivedCall

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 121

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadCallReceivedCall` 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::WebhookPayloadCallReceivedCall`. 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?(:'id')
    self.id = attributes[:'id']
  end

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



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

def 
  @account_id
end

#contact_idObject

Returns the value of attribute contact_id.



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

def contact_id
  @contact_id
end

#conversation_idObject

Returns the value of attribute conversation_id.



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

def conversation_id
  @conversation_id
end

#directionObject

Returns the value of attribute direction.



29
30
31
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 29

def direction
  @direction
end

#forward_toObject

Destination snapshot at routing time



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

def forward_to
  @forward_to
end

#fromObject

Consumer wa_id / E.164



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

def from
  @from
end

#idObject

Internal Zernio Call doc id



19
20
21
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 19

def id
  @id
end

#meta_call_idObject

Meta wacid.* call id when known



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

def meta_call_id
  @meta_call_id
end

#phone_number_idObject

Meta phone_number_id



27
28
29
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 27

def phone_number_id
  @phone_number_id
end

#started_atObject

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

#toObject

Business number (E.164)



35
36
37
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 35

def to
  @to
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



86
87
88
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 86

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



91
92
93
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 91

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 69

def self.attribute_map
  {
    :'id' => :'id',
    :'meta_call_id' => :'metaCallId',
    :'account_id' => :'accountId',
    :'phone_number_id' => :'phoneNumberId',
    :'direction' => :'direction',
    :'from' => :'from',
    :'to' => :'to',
    :'forward_to' => :'forwardTo',
    :'contact_id' => :'contactId',
    :'conversation_id' => :'conversationId',
    :'started_at' => :'startedAt'
  }
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



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 240

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



113
114
115
116
117
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 113

def self.openapi_nullable
  Set.new([
    :'meta_call_id',
  ])
end

.openapi_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 96

def self.openapi_types
  {
    :'id' => :'String',
    :'meta_call_id' => :'String',
    :'account_id' => :'String',
    :'phone_number_id' => :'String',
    :'direction' => :'String',
    :'from' => :'String',
    :'to' => :'String',
    :'forward_to' => :'String',
    :'contact_id' => :'String',
    :'conversation_id' => :'String',
    :'started_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 209

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      meta_call_id == o.meta_call_id &&
       == o. &&
      phone_number_id == o.phone_number_id &&
      direction == o.direction &&
      from == o.from &&
      to == o.to &&
      forward_to == o.forward_to &&
      contact_id == o.contact_id &&
      conversation_id == o.conversation_id &&
      started_at == o.started_at
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


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

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



233
234
235
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 233

def hash
  [id, meta_call_id, , phone_number_id, direction, from, to, forward_to, contact_id, conversation_id, started_at].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



182
183
184
185
186
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 182

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



262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 262

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



190
191
192
193
194
195
# File 'lib/zernio-sdk/models/webhook_payload_call_received_call.rb', line 190

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  direction_validator = EnumAttributeValidator.new('String', ["inbound", "outbound"])
  return false unless direction_validator.valid?(@direction)
  true
end