Class: Twilio::REST::Accounts::V1::CredentialList::AwsContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Accounts::V1::CredentialList::AwsContext
- Defined in:
- lib/twilio-ruby/rest/accounts/v1/credential/aws.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the AwsInstance.
-
#fetch ⇒ AwsInstance
Fetch the AwsInstance.
-
#initialize(version, sid) ⇒ AwsContext
constructor
Initialize the AwsContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset) ⇒ AwsInstance
Update the AwsInstance.
Constructor Details
#initialize(version, sid) ⇒ AwsContext
Initialize the AwsContext
169 170 171 172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 169 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Credentials/AWS/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the AwsInstance
181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 181 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ AwsInstance
Fetch the AwsInstance
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 193 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AwsInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 245 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Accounts.V1.AwsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
238 239 240 241 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 238 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Accounts.V1.AwsContext #{context}>" end |
#update(friendly_name: :unset) ⇒ AwsInstance
Update the AwsInstance
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 213 def update( friendly_name: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) AwsInstance.new( @version, payload, sid: @solution[:sid], ) end |