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 ⇒ CpsInstance
Fetch a 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
118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 118 def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'phone_number' => payload['phone_number'], 'cps_url' => payload['cps_url'], '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
137 138 139 140 141 142 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 137 def context unless @instance_context @instance_context = CpsContext.new(@version, ) end @instance_context end |
#cps_url ⇒ String
Returns CPS URL of the phone number.
152 153 154 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 152 def cps_url @properties['cps_url'] end |
#fetch ⇒ CpsInstance
Fetch a CpsInstance
165 166 167 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 165 def fetch context.fetch 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.
146 147 148 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 146 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.
158 159 160 |
# File 'lib/twilio-ruby/rest/preview/trusted_comms/cps.rb', line 158 def url @properties['url'] end |