class Twilio::REST::Proxy::V1::ServiceContext::ShortCodeContext
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the ShortCodeContext
@param [Version] version Version
that contains the resource @param [String] service_sid The SID of the parent
{Service}[https://www.twilio.com/docs/proxy/api/service] to fetch the resource from.
@param [String] sid The Twilio-provided string that uniquely identifies the
ShortCode resource to fetch.
@return [ShortCodeContext] ShortCodeContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 175 def initialize(version, service_sid, sid) 176 super(version) 177 178 # Path Solution 179 @solution = {service_sid: service_sid, sid: sid, } 180 @uri = "/Services/#{@solution[:service_sid]}/ShortCodes/#{@solution[:sid]}" 181 end
Public Instance Methods
Delete the ShortCodeInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 186 def delete 187 @version.delete('DELETE', @uri) 188 end
Fetch the ShortCodeInstance
@return [ShortCodeInstance] Fetched ShortCodeInstance
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 193 def fetch 194 payload = @version.fetch('GET', @uri) 195 196 ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) 197 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 223 def inspect 224 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 225 "#<Twilio.Proxy.V1.ShortCodeContext #{context}>" 226 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 216 def to_s 217 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 218 "#<Twilio.Proxy.V1.ShortCodeContext #{context}>" 219 end
Update the ShortCodeInstance
@param [Boolean] is_reserved Whether the short code should be reserved and not
be assigned to a participant using proxy pool logic. See {Reserved Phone Numbers}[https://www.twilio.com/docs/proxy/reserved-phone-numbers] for more information.
@return [ShortCodeInstance] Updated ShortCodeInstance
# File lib/twilio-ruby/rest/proxy/v1/service/short_code.rb 206 def update(is_reserved: :unset) 207 data = Twilio::Values.of({'IsReserved' => is_reserved, }) 208 209 payload = @version.update('POST', @uri, data: data) 210 211 ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) 212 end