Class: Twilio::REST::Insights::V3::CustomFieldMappingInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Insights::V3::CustomFieldMappingInstance
- Defined in:
- lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb
Instance Method Summary collapse
- #category ⇒ MappingCategory
-
#context ⇒ CustomFieldMappingContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_at ⇒ Time
When the mapping was registered.
-
#description ⇒ String
Optional, free-text description supplied at registration time.
- #entity_metadata ⇒ EntityMetadata
-
#fetch ⇒ CustomFieldMappingInstance
Fetch the CustomFieldMappingInstance.
-
#id ⇒ String
The unique identifier of the custom field mapping.
-
#initialize(version, payload, mapping_id: nil) ⇒ CustomFieldMappingInstance
constructor
Initialize the CustomFieldMappingInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#name ⇒ String
Name of the custom field, unique within the account.
-
#patch(if_match: :unset, custom_field_mapping_update_request: nil) ⇒ CustomFieldMappingInstance
Patch the CustomFieldMappingInstance.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#updated_at ⇒ Time
When the mapping was last modified via
PATCH.
Constructor Details
#initialize(version, payload, mapping_id: nil) ⇒ CustomFieldMappingInstance
Initialize the CustomFieldMappingInstance
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 658 def initialize(version, payload , mapping_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'id' => payload['id'], 'category' => payload['category'], 'name' => payload['name'], 'description' => payload['description'], 'entity_metadata' => payload['entity_metadata'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), } # Context @instance_context = nil @params = { 'mapping_id' => mapping_id || @properties['mapping_id'] , } end |
Instance Method Details
#category ⇒ MappingCategory
698 699 700 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 698 def category @properties['category'] end |
#context ⇒ CustomFieldMappingContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
683 684 685 686 687 688 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 683 def context unless @instance_context @instance_context = CustomFieldMappingContext.new(@version , @params['mapping_id']) end @instance_context end |
#created_at ⇒ Time
Returns When the mapping was registered.
722 723 724 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 722 def created_at @properties['created_at'] end |
#description ⇒ String
Returns Optional, free-text description supplied at registration time. Display-only — not part of any uniqueness check.
710 711 712 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 710 def description @properties['description'] end |
#entity_metadata ⇒ EntityMetadata
716 717 718 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 716 def @properties['entity_metadata'] end |
#fetch ⇒ CustomFieldMappingInstance
Fetch the CustomFieldMappingInstance
735 736 737 738 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 735 def fetch context.fetch end |
#id ⇒ String
Returns The unique identifier of the custom field mapping.
692 693 694 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 692 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
765 766 767 768 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 765 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V3.CustomFieldMappingInstance #{values}>" end |
#name ⇒ String
Returns Name of the custom field, unique within the account.
704 705 706 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 704 def name @properties['name'] end |
#patch(if_match: :unset, custom_field_mapping_update_request: nil) ⇒ CustomFieldMappingInstance
Patch the CustomFieldMappingInstance
745 746 747 748 749 750 751 752 753 754 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 745 def patch( if_match: :unset, custom_field_mapping_update_request: nil ) context.patch( if_match: if_match, custom_field_mapping_update_request: custom_field_mapping_update_request, ) end |
#to_s ⇒ Object
Provide a user friendly representation
758 759 760 761 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 758 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Insights.V3.CustomFieldMappingInstance #{values}>" end |
#updated_at ⇒ Time
Returns When the mapping was last modified via PATCH. Null until the first update.
728 729 730 |
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 728 def updated_at @properties['updated_at'] end |