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 sid



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

def initialize(version, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Deletes the AwsInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



216
217
218
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 216

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

#fetchAwsInstance

Fetch a AwsInstance

Returns:



185
186
187
188
189
190
191
192
193
194
195
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 185

def fetch
  params = Twilio::Values.of({})

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

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

#to_sObject

Provide a user friendly representation



222
223
224
225
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 222

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)

    The friendly_name

Returns:



201
202
203
204
205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/accounts/v1/credential/aws.rb', line 201

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