Class: Twilio::REST::Numbers::V1::WebhookInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/numbers/v1/webhook.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ WebhookInstance

Initialize the WebhookInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this Webhook resource.

  • sid (String) —

    The SID of the Call resource to fetch.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 125

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'url' => payload['url'],
        'port_in_target_url' => payload['port_in_target_url'],
        'port_out_target_url' => payload['port_out_target_url'],
        'notifications_of' => payload['notifications_of'],
        'port_in_target_date_created' => Twilio.deserialize_iso8601_datetime(payload['port_in_target_date_created']),
        'port_out_target_date_created' => Twilio.deserialize_iso8601_datetime(payload['port_out_target_date_created']),
    }
end

Instance Method Details

#inspect ⇒ Object

Provide a detailed, user friendly representation



185
186
187
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 185

def inspect
    "<Twilio.Numbers.V1.WebhookInstance>"
end

#notifications_of ⇒ Array<String>

Returns A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.

Returns:

  • (Array<String>) —

    A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent.



161
162
163
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 161

def notifications_of
    @properties['notifications_of']
end

#port_in_target_date_created ⇒ Time

Returns Creation date for the port in webhook configuration.

Returns:

  • (Time) —

    Creation date for the port in webhook configuration



167
168
169
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 167

def port_in_target_date_created
    @properties['port_in_target_date_created']
end

#port_in_target_url ⇒ String

Returns The complete webhook url that will be called when a notification event for port in request or port in phone number happens.

Returns:

  • (String) —

    The complete webhook url that will be called when a notification event for port in request or port in phone number happens



149
150
151
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 149

def port_in_target_url
    @properties['port_in_target_url']
end

#port_out_target_date_created ⇒ Time

Returns Creation date for the port out webhook configuration.

Returns:

  • (Time) —

    Creation date for the port out webhook configuration



173
174
175
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 173

def port_out_target_date_created
    @properties['port_out_target_date_created']
end

#port_out_target_url ⇒ String

Returns The complete webhook url that will be called when a notification event for a port out phone number happens.

Returns:

  • (String) —

    The complete webhook url that will be called when a notification event for a port out phone number happens.



155
156
157
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 155

def port_out_target_url
    @properties['port_out_target_url']
end

#to_s ⇒ Object

Provide a user friendly representation



179
180
181
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 179

def to_s
    "<Twilio.Numbers.V1.WebhookInstance>"
end

#url ⇒ String

Returns The URL of the webhook configuration request.

Returns:

  • (String) —

    The URL of the webhook configuration request



143
144
145
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 143

def url
    @properties['url']
end