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, TraitGroupCoreTraits>
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
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 809 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
835 836 837 838 839 840 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 835 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
893 894 895 896 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 893 def delete context.delete end |
#description ⇒ String
Returns description of the Trait Group.
874 875 876 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 874 def description @properties['description'] end |
#display_name ⇒ String
Returns Provides a unique and addressable name to be assigned to this Trait Group.
868 869 870 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 868 def display_name @properties['display_name'] end |
#fetch(include_traits: :unset, page_size: :unset, page_token: :unset, order_by: :unset) ⇒ TraitGroupInstance
Fetch the TraitGroupInstance
905 906 907 908 909 910 911 912 913 914 915 916 917 918 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 905 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
945 946 947 948 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 945 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.TraitGroupInstance #{values}>" end |
#message ⇒ String
844 845 846 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 844 def @properties['message'] end |
#meta ⇒ Meta
862 863 864 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 862 def @properties['meta'] end |
#patch(if_match: :unset, patch_trait_group_request: :unset) ⇒ TraitGroupInstance
Patch the TraitGroupInstance
925 926 927 928 929 930 931 932 933 934 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 925 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.
850 851 852 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 850 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
938 939 940 941 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 938 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.TraitGroupInstance #{values}>" end |
#trait_group ⇒ TraitGroup
856 857 858 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 856 def trait_group @properties['trait_group'] end |
#traits ⇒ Hash<String, TraitGroupCoreTraits>
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.
880 881 882 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 880 def traits @properties['traits'] end |
#version ⇒ String
Returns The current version number of the Trait Group. Incremented on each successful update.
886 887 888 |
# File 'lib/twilio-ruby/rest/memory/v1/trait_group.rb', line 886 def version @properties['version'] end |