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
Initialize the CpsInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@return [CpsInstance] CpsInstance
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
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
@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 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
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
@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
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
@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