Class: Twilio::REST::PreviewIam::V1::TokenList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::PreviewIam::V1::TokenList
- Defined in:
- lib/twilio-ruby/rest/preview_iam/v1/token.rb
Instance Method Summary collapse
-
#create(grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset) ⇒ TokenInstance
Create the TokenInstance.
-
#create_with_metadata(grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset) ⇒ TokenInstance
Create the TokenInstanceMetadata.
-
#initialize(version) ⇒ TokenList
constructor
Initialize the TokenList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version) ⇒ TokenList
Initialize the TokenList
26 27 28 29 30 31 32 33 |
# File 'lib/twilio-ruby/rest/preview_iam/v1/token.rb', line 26 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/token" end |
Instance Method Details
#create(grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset) ⇒ TokenInstance
Create the TokenInstance
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/twilio-ruby/rest/preview_iam/v1/token.rb', line 45 def create( grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset ) data = Twilio::Values.of({ 'grant_type' => grant_type, 'client_id' => client_id, 'client_secret' => client_secret, 'code' => code, 'redirect_uri' => redirect_uri, 'audience' => audience, 'refresh_token' => refresh_token, 'scope' => scope, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.create('POST', @uri, data: data, headers: headers) TokenInstance.new( @version, payload, ) end |
#create_with_metadata(grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset) ⇒ TokenInstance
Create the TokenInstanceMetadata
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/twilio-ruby/rest/preview_iam/v1/token.rb', line 91 def ( grant_type: nil, client_id: nil, client_secret: :unset, code: :unset, redirect_uri: :unset, audience: :unset, refresh_token: :unset, scope: :unset ) data = Twilio::Values.of({ 'grant_type' => grant_type, 'client_id' => client_id, 'client_secret' => client_secret, 'code' => code, 'redirect_uri' => redirect_uri, 'audience' => audience, 'refresh_token' => refresh_token, 'scope' => scope, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) token_instance = TokenInstance.new( @version, response.body, ) TokenInstanceMetadata.new( @version, token_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
136 137 138 |
# File 'lib/twilio-ruby/rest/preview_iam/v1/token.rb', line 136 def to_s '#<Twilio.PreviewIam.V1.TokenList>' end |