Class: Twilio::REST::Numbers::V2::RegulatoryComplianceList::EndUserContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Numbers::V2::RegulatoryComplianceList::EndUserContext
- Defined in:
- lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the EndUserInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the EndUserInstanceMetadata.
-
#fetch ⇒ EndUserInstance
Fetch the EndUserInstance.
-
#fetch_with_metadata ⇒ EndUserInstance
Fetch the EndUserInstanceMetadata.
-
#initialize(version, sid) ⇒ EndUserContext
constructor
Initialize the EndUserContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, attributes: :unset) ⇒ EndUserInstance
Update the EndUserInstance.
-
#update_with_metadata(friendly_name: :unset, attributes: :unset) ⇒ EndUserInstance
Update the EndUserInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ EndUserContext
Initialize the EndUserContext
229 230 231 232 233 234 235 236 237 238 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 229 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/RegulatoryCompliance/EndUsers/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the EndUserInstance
242 243 244 245 246 247 248 249 250 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 242 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the EndUserInstanceMetadata
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 255 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) endUser_instance = EndUserInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) EndUserInstanceMetadata.new(@version, endUser_instance, response.headers, response.status_code) end |
#fetch ⇒ EndUserInstance
Fetch the EndUserInstance
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 274 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) EndUserInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ EndUserInstance
Fetch the EndUserInstanceMetadata
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 293 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) end_user_instance = EndUserInstance.new( @version, response.body, sid: @solution[:sid], ) EndUserInstanceMetadata.new( @version, end_user_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
389 390 391 392 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 389 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.EndUserContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
382 383 384 385 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 382 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Numbers.V2.EndUserContext #{context}>" end |
#update(friendly_name: :unset, attributes: :unset) ⇒ EndUserInstance
Update the EndUserInstance
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 320 def update( friendly_name: :unset, attributes: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Attributes' => Twilio.serialize_object(attributes), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) EndUserInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(friendly_name: :unset, attributes: :unset) ⇒ EndUserInstance
Update the EndUserInstanceMetadata
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user.rb', line 349 def ( friendly_name: :unset, attributes: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Attributes' => Twilio.serialize_object(attributes), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) end_user_instance = EndUserInstance.new( @version, response.body, sid: @solution[:sid], ) EndUserInstanceMetadata.new( @version, end_user_instance, response.headers, response.status_code ) end |