Class: Twilio::REST::Memory::V1::ObservationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Memory::V1::ObservationInstance
- Defined in:
- lib/twilio-ruby/rest/memory/v1/observation.rb
Instance Method Summary collapse
-
#content ⇒ String
The main content of the observation.
-
#context ⇒ ObservationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_ids ⇒ Array<String>
Array of conversation IDs associated with this observation.
-
#created_at ⇒ Time
The timestamp when the observation was created.
-
#delete ⇒ Boolean
Delete the ObservationInstance.
-
#fetch ⇒ ObservationInstance
Fetch the ObservationInstance.
-
#id ⇒ String
A unique identifier for the observation using Twilio Type ID (TTID) format.
-
#initialize(version, payload, store_id: nil, profile_id: nil, observation_id: nil) ⇒ ObservationInstance
constructor
Initialize the ObservationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#message ⇒ String
Confirmation message for the operation.
-
#occurred_at ⇒ Time
The timestamp when the observation originally occurred.
-
#patch(observation_core: nil) ⇒ ObservationInstance
Patch the ObservationInstance.
-
#source ⇒ String
The source system that generated this observation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#updated_at ⇒ Time
The timestamp when the observation was last updated.
Constructor Details
#initialize(version, payload, store_id: nil, profile_id: nil, observation_id: nil) ⇒ ObservationInstance
Initialize the ObservationInstance
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 659 def initialize(version, payload , store_id: nil, profile_id: nil, observation_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'message' => payload['message'], 'content' => payload['content'], 'occurred_at' => Twilio.deserialize_iso8601_datetime(payload['occurred_at']), 'source' => payload['source'], 'conversation_ids' => payload['conversation_ids'], 'id' => payload['id'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), } # Context @instance_context = nil @params = { 'store_id' => store_id || @properties['store_id'] ,'profile_id' => profile_id || @properties['profile_id'] ,'observation_id' => observation_id || @properties['observation_id'] , } end |
Instance Method Details
#content ⇒ String
Returns The main content of the observation.
700 701 702 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 700 def content @properties['content'] end |
#context ⇒ ObservationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
685 686 687 688 689 690 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 685 def context unless @instance_context @instance_context = ObservationContext.new(@version , @params['store_id'], @params['profile_id'], @params['observation_id']) end @instance_context end |
#conversation_ids ⇒ Array<String>
Returns Array of conversation IDs associated with this observation.
718 719 720 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 718 def conversation_ids @properties['conversation_ids'] end |
#created_at ⇒ Time
Returns The timestamp when the observation was created.
730 731 732 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 730 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the ObservationInstance
743 744 745 746 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 743 def delete context.delete end |
#fetch ⇒ ObservationInstance
Fetch the ObservationInstance
751 752 753 754 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 751 def fetch context.fetch end |
#id ⇒ String
Returns A unique identifier for the observation using Twilio Type ID (TTID) format.
724 725 726 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 724 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
777 778 779 780 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 777 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ObservationInstance #{values}>" end |
#message ⇒ String
Returns Confirmation message for the operation.
694 695 696 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 694 def @properties['message'] end |
#occurred_at ⇒ Time
Returns The timestamp when the observation originally occurred.
706 707 708 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 706 def occurred_at @properties['occurred_at'] end |
#patch(observation_core: nil) ⇒ ObservationInstance
Patch the ObservationInstance
760 761 762 763 764 765 766 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 760 def patch(observation_core: nil ) context.patch( observation_core: observation_core, ) end |
#source ⇒ String
Returns The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters.
712 713 714 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 712 def source @properties['source'] end |
#to_s ⇒ Object
Provide a user friendly representation
770 771 772 773 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 770 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ObservationInstance #{values}>" end |
#updated_at ⇒ Time
Returns The timestamp when the observation was last updated.
736 737 738 |
# File 'lib/twilio-ruby/rest/memory/v1/observation.rb', line 736 def updated_at @properties['updated_at'] end |