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`.


198
199
200
201
202
203
204
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 198

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


209
210
211
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 209

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

#fetchUsAppToPersonInstance

Fetch the UsAppToPersonInstance

Returns:


216
217
218
219
220
221
222
223
224
225
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 216

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


236
237
238
239
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 236

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

#to_sObject

Provide a user friendly representation


229
230
231
232
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 229

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