Class: Twilio::REST::Trusthub::V1::EndUserTypeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Trusthub::V1::EndUserTypeContext
- Defined in:
- lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb
Instance Method Summary collapse
-
#fetch ⇒ EndUserTypeInstance
Fetch the EndUserTypeInstance.
-
#fetch_with_metadata ⇒ EndUserTypeInstance
Fetch the EndUserTypeInstanceMetadata.
-
#initialize(version, sid) ⇒ EndUserTypeContext
constructor
Initialize the EndUserTypeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ EndUserTypeContext
Initialize the EndUserTypeContext
159 160 161 162 163 164 165 166 167 168 |
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 159 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/EndUserTypes/#{@solution[:sid]}" end |
Instance Method Details
#fetch ⇒ EndUserTypeInstance
Fetch the EndUserTypeInstance
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 172 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EndUserTypeInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ EndUserTypeInstance
Fetch the EndUserTypeInstanceMetadata
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 191 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) end_user_type_instance = EndUserTypeInstance.new( @version, response.body, sid: @solution[:sid], ) EndUserTypeInstanceMetadata.new( @version, end_user_type_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
223 224 225 226 |
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 223 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trusthub.V1.EndUserTypeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
216 217 218 219 |
# File 'lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb', line 216 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Trusthub.V1.EndUserTypeContext #{context}>" end |