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](www.twilio.com/docs/messaging/api/service-resource) to fetch the resource from.

  • sid (String)

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



193
194
195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 193

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



205
206
207
208
# File 'lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb', line 205

def delete

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

#fetchUsAppToPersonInstance

Fetch the UsAppToPersonInstance

Returns:



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

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



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

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

#to_sObject

Provide a user friendly representation



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

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