Class: Twilio::REST::Memory::V1::DataMappingInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Memory::V1::DataMappingInstance
- Defined in:
- lib/twilio-ruby/rest/memory/v1/data_mapping.rb
Instance Method Summary collapse
-
#context ⇒ DataMappingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_at ⇒ Time
The ISO 8601 timestamp when the data mapping was created.
-
#delete ⇒ Boolean
Delete the DataMappingInstance.
-
#description ⇒ String
A human readable description of this resource, up to 512 characters.
-
#display_name ⇒ String
Name of the data mapping.
-
#fetch ⇒ DataMappingInstance
Fetch the DataMappingInstance.
-
#id ⇒ String
The unique identifier for the data mapping.
-
#initialize(version, payload, store_id: nil, data_mapping_id: nil) ⇒ DataMappingInstance
constructor
Initialize the DataMappingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#is_enabled ⇒ Boolean
Flag indicating whether the data mapping is active.
- #mapping_from ⇒ DataMappingFromDataSet
- #mapping_to ⇒ DataMappingToTraits
- #message ⇒ String
-
#patch(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstance.
-
#status_url ⇒ String
URI to check operation status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#updated_at ⇒ Time
The ISO 8601 timestamp when the data mapping was last updated.
-
#version ⇒ String
The current version number of the DataMapping.
Constructor Details
#initialize(version, payload, store_id: nil, data_mapping_id: nil) ⇒ DataMappingInstance
Initialize the DataMappingInstance
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 691 def initialize(version, payload , store_id: nil, data_mapping_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'message' => payload['message'], 'status_url' => payload['status_url'], 'display_name' => payload['display_name'], 'description' => payload['description'], 'is_enabled' => payload['is_enabled'], 'mapping_to' => payload['mapping_to'], 'mapping_from' => payload['mapping_from'], 'id' => payload['id'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, } # Context @instance_context = nil @params = { 'store_id' => store_id || @properties['store_id'] ,'data_mapping_id' => data_mapping_id || @properties['data_mapping_id'] , } end |
Instance Method Details
#context ⇒ DataMappingContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
720 721 722 723 724 725 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 720 def context unless @instance_context @instance_context = DataMappingContext.new(@version , @params['store_id'], @params['data_mapping_id']) end @instance_context end |
#created_at ⇒ Time
Returns The ISO 8601 timestamp when the data mapping was created.
777 778 779 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 777 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the DataMappingInstance
796 797 798 799 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 796 def delete context.delete end |
#description ⇒ String
Returns A human readable description of this resource, up to 512 characters.
747 748 749 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 747 def description @properties['description'] end |
#display_name ⇒ String
Returns Name of the data mapping.
741 742 743 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 741 def display_name @properties['display_name'] end |
#fetch ⇒ DataMappingInstance
Fetch the DataMappingInstance
804 805 806 807 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 804 def fetch context.fetch end |
#id ⇒ String
Returns The unique identifier for the data mapping.
771 772 773 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 771 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
834 835 836 837 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 834 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.DataMappingInstance #{values}>" end |
#is_enabled ⇒ Boolean
Returns Flag indicating whether the data mapping is active. When true, data will be ingested and mapped according to the configuration. When false, the data mapping will be inactive and no data will be ingested into the Memory Store.
753 754 755 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 753 def is_enabled @properties['is_enabled'] end |
#mapping_from ⇒ DataMappingFromDataSet
765 766 767 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 765 def mapping_from @properties['mapping_from'] end |
#mapping_to ⇒ DataMappingToTraits
759 760 761 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 759 def mapping_to @properties['mapping_to'] end |
#message ⇒ String
729 730 731 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 729 def @properties['message'] end |
#patch(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstance
814 815 816 817 818 819 820 821 822 823 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 814 def patch( if_match: :unset, data_mapping_core: :unset ) context.patch( if_match: if_match, data_mapping_core: data_mapping_core, ) end |
#status_url ⇒ String
Returns URI to check operation status.
735 736 737 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 735 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
827 828 829 830 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 827 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.DataMappingInstance #{values}>" end |
#updated_at ⇒ Time
Returns The ISO 8601 timestamp when the data mapping was last updated.
783 784 785 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 783 def updated_at @properties['updated_at'] end |
#version ⇒ String
Returns The current version number of the DataMapping. Incremented on each successful update.
789 790 791 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 789 def version @properties['version'] end |