class Twilio::REST::Messaging::V1::ServiceContext::PhoneNumberContext

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

Public Class Methods

new(version, service_sid, sid) click to toggle source

Initialize the PhoneNumberContext @param [Version] version Version that contains the resource @param [String] service_sid The SID of the

{Service}[https://www.twilio.com/docs/chat/rest/service-resource] to fetch the
resource from.

@param [String] sid The SID of the PhoneNumber resource to fetch. @return [PhoneNumberContext] PhoneNumberContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
174 def initialize(version, service_sid, sid)
175   super(version)
176 
177   # Path Solution
178   @solution = {service_sid: service_sid, sid: sid, }
179   @uri = "/Services/#{@solution[:service_sid]}/PhoneNumbers/#{@solution[:sid]}"
180 end

Public Instance Methods

delete() click to toggle source

Delete the PhoneNumberInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
185 def delete
186    @version.delete('DELETE', @uri)
187 end
fetch() click to toggle source

Fetch the PhoneNumberInstance @return [PhoneNumberInstance] Fetched PhoneNumberInstance

    # File lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
192 def fetch
193   payload = @version.fetch('GET', @uri)
194 
195   PhoneNumberInstance.new(
196       @version,
197       payload,
198       service_sid: @solution[:service_sid],
199       sid: @solution[:sid],
200   )
201 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
212 def inspect
213   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
214   "#<Twilio.Messaging.V1.PhoneNumberContext #{context}>"
215 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb
205 def to_s
206   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
207   "#<Twilio.Messaging.V1.PhoneNumberContext #{context}>"
208 end