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 ⇒ DataMappingFromTypes
- #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
685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 685 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
714 715 716 717 718 719 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 714 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.
771 772 773 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 771 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the DataMappingInstance
790 791 792 793 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 790 def delete context.delete end |
#description ⇒ String
Returns A human readable description of this resource, up to 512 characters.
741 742 743 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 741 def description @properties['description'] end |
#display_name ⇒ String
Returns Name of the data mapping.
735 736 737 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 735 def display_name @properties['display_name'] end |
#fetch ⇒ DataMappingInstance
Fetch the DataMappingInstance
798 799 800 801 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 798 def fetch context.fetch end |
#id ⇒ String
Returns The unique identifier for the data mapping.
765 766 767 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 765 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
828 829 830 831 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 828 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.
747 748 749 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 747 def is_enabled @properties['is_enabled'] end |
#mapping_from ⇒ DataMappingFromTypes
759 760 761 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 759 def mapping_from @properties['mapping_from'] end |
#mapping_to ⇒ DataMappingToTraits
753 754 755 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 753 def mapping_to @properties['mapping_to'] end |
#message ⇒ String
723 724 725 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 723 def @properties['message'] end |
#patch(if_match: :unset, data_mapping_core: :unset) ⇒ DataMappingInstance
Patch the DataMappingInstance
808 809 810 811 812 813 814 815 816 817 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 808 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.
729 730 731 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 729 def status_url @properties['status_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
821 822 823 824 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 821 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.
777 778 779 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 777 def updated_at @properties['updated_at'] end |
#version ⇒ String
Returns The current version number of the DataMapping. Incremented on each successful update.
783 784 785 |
# File 'lib/twilio-ruby/rest/memory/v1/data_mapping.rb', line 783 def version @properties['version'] end |