Module: Bandwidth::Callback

Defined in:
lib/bandwidth-sdk/models/callback.rb

Overview

Callbacks are divided into two types based on direction of the related message: - ‘statusCallback` indicates status of an outbound MT SMS, MMS, or RBM message. - `inboundCallback` indicates an inbound MO message or a multichannel message client’s response to a suggestion or location request.

Class Method Summary collapse

Class Method Details

.build(data) ⇒ Object

Builds the object

Parameters:

  • Data (Mixed)

    to be matched against the list of oneOf items

Returns:

  • (Object)

    Returns the model or the data itself



49
50
51
52
53
54
55
56
57
# File 'lib/bandwidth-sdk/models/callback.rb', line 49

def build(data)
  discriminator_value = data[openapi_discriminator_name]
  return nil if discriminator_value.nil?

  klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
  return nil unless klass

  Bandwidth.const_get(klass).build_from_hash(data)
end

.openapi_discriminator_mappingObject

Discriminator’s mapping (OpenAPI v3)



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bandwidth-sdk/models/callback.rb', line 34

def openapi_discriminator_mapping
  {
    :'message-delivered' => :'StatusCallback',
    :'message-failed' => :'StatusCallback',
    :'message-read' => :'StatusCallback',
    :'message-received' => :'InboundCallback',
    :'message-sent' => :'StatusCallback',
    :'request-location-response' => :'InboundCallback',
    :'suggestion-response' => :'InboundCallback'
  }
end

.openapi_discriminator_nameObject

Discriminator’s property name (OpenAPI v3)



29
30
31
# File 'lib/bandwidth-sdk/models/callback.rb', line 29

def openapi_discriminator_name
  :'type'
end

.openapi_one_ofObject

List of class defined in oneOf (OpenAPI v3)



21
22
23
24
25
26
# File 'lib/bandwidth-sdk/models/callback.rb', line 21

def openapi_one_of
  [
    :'InboundCallback',
    :'StatusCallback'
  ]
end