Class: Twilio::REST::Memory::V1::TraitGroupContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Memory::V1::TraitGroupContext
- Defined in:
- lib/twilio-ruby/rest/memory/v1/trait_group.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TraitGroupInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the TraitGroupInstanceMetadata.
-
#fetch(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstance.
-
#fetch_with_metadata(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstanceMetadata.
-
#initialize(version, store_id, trait_group_name) ⇒ TraitGroupContext
constructor
Initialize the TraitGroupContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#patch(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstance.
-
#patch_with_metadata(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstanceMetadata.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, store_id, trait_group_name) ⇒ TraitGroupContext
Initialize the TraitGroupContext
415 416 417 418 419 420 421 422 423 424 425 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 415 def initialize(version, store_id, trait_group_name) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { store_id: store_id, trait_group_name: trait_group_name, } @uri = "/ControlPlane/Stores/#{@solution[:store_id]}/TraitGroups/#{@solution[:trait_group_name]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the TraitGroupInstance
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 429 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) TraitGroupInstance.new( @version, response.body, store_id: @solution[:store_id], trait_group_name: @solution[:trait_group_name], ) end |
#delete_with_metadata ⇒ Boolean
Delete the TraitGroupInstanceMetadata
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 448 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) traitGroup_instance = TraitGroupInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) TraitGroupInstanceMetadata.new(@version, traitGroup_instance, response.headers, response.status_code) end |
#fetch(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstance
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 471 def fetch( include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset ) params = Twilio::Values.of({ 'includeTraits' => include_traits, 'pageSize' => page_size, 'pageToken' => page_token, 'orderBy' => order_by, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) TraitGroupInstance.new( @version, payload, store_id: @solution[:store_id], trait_group_name: @solution[:trait_group_name], ) end |
#fetch_with_metadata(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstanceMetadata
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 506 def ( include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset ) params = Twilio::Values.of({ 'includeTraits' => include_traits, 'pageSize' => page_size, 'pageToken' => page_token, 'orderBy' => order_by, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, params: params, headers: headers) trait_group_instance = TraitGroupInstance.new( @version, response.body, store_id: @solution[:store_id], trait_group_name: @solution[:trait_group_name], ) TraitGroupInstanceMetadata.new( @version, trait_group_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
606 607 608 609 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 606 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.TraitGroupContext #{context}>" end |
#patch(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstance
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 545 def patch( if_match: :unset, patch_trait_group_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) headers['Content-Type'] = 'application/json' payload = @version.patch('PATCH', @uri, headers: headers, data: patch_trait_group_request.to_json) TraitGroupInstance.new( @version, payload, store_id: @solution[:store_id], trait_group_name: @solution[:trait_group_name], ) end |
#patch_with_metadata(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstanceMetadata
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 570 def ( if_match: :unset, patch_trait_group_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) headers['Content-Type'] = 'application/json' response = @version.('PATCH', @uri, headers: headers, data: patch_trait_group_request.to_json) trait_group_instance = TraitGroupInstance.new( @version, response.body, store_id: @solution[:store_id], trait_group_name: @solution[:trait_group_name], ) TraitGroupInstanceMetadata.new( @version, trait_group_instance, response.headers, response.status_code ) end |
#to_s ⇒ Object
Provide a user friendly representation
599 600 601 602 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 599 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.TraitGroupContext #{context}>" end |