Class: Twilio::REST::Messaging::V1::DeactivationsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ DeactivationsInstance

Initialize the DeactivationsInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio


109
110
111
112
113
114
115
116
117
118
# File 'lib/twilio-ruby/rest/messaging/v1/deactivation.rb', line 109

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {'redirect_to' => payload['redirect_to'], }

  # Context
  @instance_context = nil
  @params = {}
end

Instance Method Details

#contextDeactivationsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


124
125
126
127
128
129
# File 'lib/twilio-ruby/rest/messaging/v1/deactivation.rb', line 124

def context
  unless @instance_context
    @instance_context = DeactivationsContext.new(@version, )
  end
  @instance_context
end

#fetch(date: :unset) ⇒ DeactivationsInstance

Fetch the DeactivationsInstance

Parameters:

  • date (Date) (defaults to: :unset)

    The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format.

Returns:


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

def fetch(date: :unset)
  context.fetch(date: date, )
end

#inspectObject

Provide a detailed, user friendly representation


156
157
158
159
# File 'lib/twilio-ruby/rest/messaging/v1/deactivation.rb', line 156

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Messaging.V1.DeactivationsInstance #{values}>"
end

#redirect_toString

Returns Redirect url to the list of deactivated numbers.

Returns:

  • (String)

    Redirect url to the list of deactivated numbers.


133
134
135
# File 'lib/twilio-ruby/rest/messaging/v1/deactivation.rb', line 133

def redirect_to
  @properties['redirect_to']
end

#to_sObject

Provide a user friendly representation


149
150
151
152
# File 'lib/twilio-ruby/rest/messaging/v1/deactivation.rb', line 149

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Messaging.V1.DeactivationsInstance #{values}>"
end