Class: Twilio::REST::Preview::TrustedComms::CpsInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::TrustedComms::CpsInstance
- Defined in:
- lib/twilio-ruby/rest/preview/trusted_comms/cps.rb
Overview
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 [email protected]
Instance Method Summary collapse
-
#context ⇒ CpsContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#cps_url ⇒ String
CPS URL of the phone number.
-
#fetch(x_xcnam_sensitive_phone_number: :unset) ⇒ CpsInstance
Fetch the CpsInstance.
-
#initialize(version, payload) ⇒ CpsInstance
constructor
Initialize the CpsInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#phone_number ⇒ String
Phone number passed.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload) ⇒ CpsInstance
Initialize the CpsInstance
116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 116 def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'cps_url' => payload['cps_url'], 'phone_number' => payload['phone_number'], 'url' => payload['url'], } # Context @instance_context = nil @params = {} end |
Instance Method Details
#context ⇒ CpsContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
135 136 137 138 139 140 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 135 def context unless @instance_context @instance_context = CpsContext.new(@version, ) end @instance_context end |
#cps_url ⇒ String
Returns CPS URL of the phone number.
144 145 146 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 144 def cps_url @properties['cps_url'] end |
#fetch(x_xcnam_sensitive_phone_number: :unset) ⇒ CpsInstance
Fetch the CpsInstance
165 166 167 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 165 def fetch(x_xcnam_sensitive_phone_number: :unset) context.fetch(x_xcnam_sensitive_phone_number: x_xcnam_sensitive_phone_number, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
178 179 180 181 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 178 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.TrustedComms.CpsInstance #{values}>" end |
#phone_number ⇒ String
Returns Phone number passed.
150 151 152 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 150 def phone_number @properties['phone_number'] end |
#to_s ⇒ Object
Provide a user friendly representation
171 172 173 174 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 171 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.TrustedComms.CpsInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
156 157 158 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 156 def url @properties['url'] end |