Class: Twilio::REST::Messaging::V1::ServiceContext::UsAppToPersonContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, messaging_service_sid, sid) ⇒ UsAppToPersonContext

Initialize the UsAppToPersonContext

Parameters:

  • version (Version)

    Version that contains the resource

  • messaging_service_sid (String)

    The SID of the Messaging Service to fetch the resource from.

  • sid (String)

    The SID of the US A2P Compliance resource to fetch ‘QE2c6890da8086d771620e9b13fadeba0b`.



244
245
246
247
248
249
250
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 244

def initialize(version, messaging_service_sid, sid)
  super(version)

  # Path Solution
  @solution = {messaging_service_sid: messaging_service_sid, sid: sid, }
  @uri = "/Services/#{@solution[:messaging_service_sid]}/Compliance/Usa2p/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the UsAppToPersonInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



255
256
257
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 255

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

#fetchUsAppToPersonInstance

Fetch the UsAppToPersonInstance

Returns:



262
263
264
265
266
267
268
269
270
271
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 262

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

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

#inspectObject

Provide a detailed, user friendly representation



282
283
284
285
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 282

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

#to_sObject

Provide a user friendly representation



275
276
277
278
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 275

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