Class: Twilio::REST::Accounts::V1::CredentialList::AwsContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ AwsContext

Initialize the AwsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The Twilio-provided string that uniquely identifies the AWS resource to fetch.


173
174
175
176
177
178
179
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 173

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Credentials/AWS/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the AwsInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


206
207
208
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 206

def delete
   @version.delete('DELETE', @uri)
end

#fetchAwsInstance

Fetch the AwsInstance

Returns:


184
185
186
187
188
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 184

def fetch
  payload = @version.fetch('GET', @uri)

  AwsInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation


219
220
221
222
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 219

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

#to_sObject

Provide a user friendly representation


212
213
214
215
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 212

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

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

Returns:


195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 195

def update(friendly_name: :unset)
  data = Twilio::Values.of({'FriendlyName' => friendly_name, })

  payload = @version.update('POST', @uri, data: data)

  AwsInstance.new(@version, payload, sid: @solution[:sid], )
end