class Twilio::REST::Preview::TrustedComms::CpsInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, payload) click to toggle source

Initialize the CpsInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @return [CpsInstance] CpsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
116 def initialize(version, payload)
117   super(version)
118 
119   # Marshaled Properties
120   @properties = {
121       'cps_url' => payload['cps_url'],
122       'phone_number' => payload['phone_number'],
123       'url' => payload['url'],
124   }
125 
126   # Context
127   @instance_context = nil
128   @params = {}
129 end

Public Instance Methods

context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CpsContext] CpsContext for this CpsInstance

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
135 def context
136   unless @instance_context
137     @instance_context = CpsContext.new(@version, )
138   end
139   @instance_context
140 end
cps_url() click to toggle source

@return [String] CPS URL of the phone number.

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
144 def cps_url
145   @properties['cps_url']
146 end
fetch(x_xcnam_sensitive_phone_number: :unset) click to toggle source

Fetch the CpsInstance @param [String] x_xcnam_sensitive_phone_number Phone number used to retrieve its

corresponding CPS.

@return [CpsInstance] Fetched CpsInstance

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
165 def fetch(x_xcnam_sensitive_phone_number: :unset)
166   context.fetch(x_xcnam_sensitive_phone_number: x_xcnam_sensitive_phone_number, )
167 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
178 def inspect
179   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
180   "<Twilio.Preview.TrustedComms.CpsInstance #{values}>"
181 end
phone_number() click to toggle source

@return [String] Phone number passed.

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
150 def phone_number
151   @properties['phone_number']
152 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
171 def to_s
172   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
173   "<Twilio.Preview.TrustedComms.CpsInstance #{values}>"
174 end
url() click to toggle source

@return [String] The URL of this resource.

    # File lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
156 def url
157   @properties['url']
158 end