class Twilio::REST::Messaging::V1::ServiceContext::ShortCodeContext

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 ShortCodeContext @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 ShortCode resource to fetch. @return [ShortCodeContext] ShortCodeContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/messaging/v1/service/short_code.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]}/ShortCodes/#{@solution[:sid]}"
180 end

Public Instance Methods

delete() click to toggle source

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

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

Fetch the ShortCodeInstance @return [ShortCodeInstance] Fetched ShortCodeInstance

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

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/messaging/v1/service/short_code.rb
207 def inspect
208   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
209   "#<Twilio.Messaging.V1.ShortCodeContext #{context}>"
210 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/messaging/v1/service/short_code.rb
200 def to_s
201   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
202   "#<Twilio.Messaging.V1.ShortCodeContext #{context}>"
203 end