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.
-
#delete_with_metadata ⇒ Boolean
Delete the AwsInstanceMetadata.
-
#fetch ⇒ AwsInstance
Fetch the AwsInstance.
-
#fetch_with_metadata ⇒ AwsInstance
Fetch the AwsInstanceMetadata.
-
#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.
-
#update_with_metadata(friendly_name: :unset) ⇒ AwsInstance
Update the AwsInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ AwsContext
Initialize the AwsContext
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 237 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
250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 250 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the AwsInstanceMetadata
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 263 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) aws_instance = AwsInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) AwsInstanceMetadata.new(@version, aws_instance, response.headers, response.status_code) end |
#fetch ⇒ AwsInstance
Fetch the AwsInstance
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 282 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 |
#fetch_with_metadata ⇒ AwsInstance
Fetch the AwsInstanceMetadata
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 301 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) aws_instance = AwsInstance.new( @version, response.body, sid: @solution[:sid], ) AwsInstanceMetadata.new( @version, aws_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
391 392 393 394 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 391 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Accounts.V1.AwsContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
384 385 386 387 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 384 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
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 327 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 |
#update_with_metadata(friendly_name: :unset) ⇒ AwsInstance
Update the AwsInstanceMetadata
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 353 def ( friendly_name: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) aws_instance = AwsInstance.new( @version, response.body, sid: @solution[:sid], ) AwsInstanceMetadata.new( @version, aws_instance, response.headers, response.status_code ) end |