Class: Twilio::REST::Messaging::V1::DeactivationsContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ DeactivationsContext

Initialize the DeactivationsContext

Parameters:

  • version (Version)

    Version that contains the resource



48
49
50
51
52
53
54
55
56
# File 'lib/twilio-ruby/rest/messaging/v1/deactivations.rb', line 48

def initialize(version)
    super(version)

    # Path Solution
    @solution = {  }
    @uri = "/Deactivations"

    
end

Instance Method Details

#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:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/twilio-ruby/rest/messaging/v1/deactivations.rb', line 61

def fetch(
    date: :unset
)

    params = Twilio::Values.of({
        'Date' => Twilio.serialize_iso8601_date(date),
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, params: params, headers: headers)
    DeactivationsInstance.new(
        @version,
        payload,
    )
end

#inspectObject

Provide a detailed, user friendly representation



91
92
93
94
# File 'lib/twilio-ruby/rest/messaging/v1/deactivations.rb', line 91

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Messaging.V1.DeactivationsContext #{context}>"
end

#to_sObject

Provide a user friendly representation



84
85
86
87
# File 'lib/twilio-ruby/rest/messaging/v1/deactivations.rb', line 84

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Messaging.V1.DeactivationsContext #{context}>"
end