Class: Twilio::REST::Memory::V1::TraitGroupInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Memory::V1::TraitGroupInstance
- Defined in:
- lib/twilio-ruby/rest/memory/v1/trait_group.rb
Instance Method Summary collapse
-
#context ⇒ TraitGroupContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Delete the TraitGroupInstance.
-
#description ⇒ String
Description of the Trait Group.
-
#display_name ⇒ String
Provides a unique and addressable name to be assigned to this Trait Group.
-
#fetch(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstance.
-
#initialize(version, payload, store_id: nil, trait_group_name: nil) ⇒ TraitGroupInstance
constructor
Initialize the TraitGroupInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #message ⇒ String
- #meta ⇒ Meta
-
#patch(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstance.
-
#status_url ⇒ String
URI to check operation status.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #trait_group ⇒ TraitGroup
-
#traits ⇒ Hash<String, TraitGroupCoreTraitsValue>
Map of traits that are part of this Trait Group, where the key is the trait name and the value is the trait’s definition.
-
#version ⇒ String
The current version number of the Trait Group.
Constructor Details
#initialize(version, payload, store_id: nil, trait_group_name: nil) ⇒ TraitGroupInstance
Initialize the TraitGroupInstance
759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 759 def initialize(version, payload , store_id: nil, trait_group_name: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'message' => payload['message'], 'status_url' => payload['status_url'], 'trait_group' => payload['trait_group'], 'meta' => payload['meta'], 'display_name' => payload['display_name'], 'description' => payload['description'], 'traits' => payload['traits'], 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, } # Context @instance_context = nil @params = { 'store_id' => store_id || @properties['store_id'] ,'trait_group_name' => trait_group_name || @properties['trait_group_name'] , } end |
Instance Method Details
#context ⇒ TraitGroupContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
785 786 787 788 789 790 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 785 def context unless @instance_context @instance_context = TraitGroupContext.new(@version , @params['store_id'], @params['trait_group_name']) end @instance_context end |
#delete ⇒ Boolean
Delete the TraitGroupInstance
843 844 845 846 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 843 def delete context.delete end |
#description ⇒ String
Returns description of the Trait Group.
824 825 826 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 824 def description @properties['description'] end |
#display_name ⇒ String
Returns Provides a unique and addressable name to be assigned to this Trait Group.
818 819 820 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 818 def display_name @properties['display_name'] end |
#fetch(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstance
855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 855 def fetch( include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset ) context.fetch( include_traits: include_traits, page_size: page_size, page_token: page_token, order_by: order_by, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
895 896 897 898 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 895 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.TraitGroupInstance #{values}>" end |
#message ⇒ String
794 795 796 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 794 def @properties['message'] end |
#meta ⇒ Meta
812 813 814 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 812 def @properties['meta'] end |
#patch(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstance
875 876 877 878 879 880 881 882 883 884 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 875 def patch( if_match: :unset, patch_trait_group_request: :unset ) context.patch( if_match: if_match, patch_trait_group_request: patch_trait_group_request, ) end |
#status_url ⇒ String
Returns URI to check operation status.
800 801 802 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 800 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
888 889 890 891 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 888 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.TraitGroupInstance #{values}>" end |
#trait_group ⇒ TraitGroup
806 807 808 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 806 def trait_group @properties['trait_group'] end |
#traits ⇒ Hash<String, TraitGroupCoreTraitsValue>
Returns Map of traits that are part of this Trait Group, where the key is the trait name and the value is the trait’s definition.
830 831 832 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 830 def traits @properties['traits'] end |
#version ⇒ String
Returns The current version number of the Trait Group. Incremented on each successful update.
836 837 838 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 836 def version @properties['version'] end |