Class: Twilio::REST::Accounts::V1::SecondaryAuthTokenContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ SecondaryAuthTokenContext

Initialize the SecondaryAuthTokenContext

Parameters:

  • version (Version)

    Version that contains the resource



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

def initialize(version)
    super(version)

    # Path Solution
    @solution = {  }
    @uri = "/AuthTokens/Secondary"

    
end

Instance Method Details

#createSecondaryAuthTokenInstance

Create the SecondaryAuthTokenInstance

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 60

def create

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, headers: headers)
    SecondaryAuthTokenInstance.new(
        @version,
        payload,
    )
end

#deleteBoolean

Delete the SecondaryAuthTokenInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



78
79
80
81
82
83
84
85
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 78

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#inspectObject

Provide a detailed, user friendly representation



97
98
99
100
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 97

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

#to_sObject

Provide a user friendly representation



90
91
92
93
# File 'lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb', line 90

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