Class: Telnyx::Resources::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/webhooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Webhooks

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Webhooks.

Parameters:



25
26
27
# File 'lib/telnyx/resources/webhooks.rb', line 25

def initialize(client:)
  @client = client
end

Instance Method Details

#unsafe_unwrap(payload) ⇒ Telnyx::Models::CallAIGatherEndedWebhookEvent, ...

Parameters:

  • payload (String)

    The raw webhook payload as a string

Returns:



9
10
11
12
# File 'lib/telnyx/resources/webhooks.rb', line 9

def unsafe_unwrap(payload)
  parsed = JSON.parse(payload, symbolize_names: true)
  Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnsafeUnwrapWebhookEvent, parsed)
end

#unwrap(payload) ⇒ Telnyx::Models::CallAIGatherEndedWebhookEvent, ...

Parameters:

  • payload (String)

    The raw webhook payload as a string

Returns:



17
18
19
20
# File 'lib/telnyx/resources/webhooks.rb', line 17

def unwrap(payload)
  parsed = JSON.parse(payload, symbolize_names: true)
  Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
end