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
465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 465 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
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 479 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
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 498 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
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 521 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
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 556 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
656 657 658 659 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 656 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
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 595 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
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 620 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
649 650 651 652 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 649 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.TraitGroupContext #{context}>" end |