Class: Twilio::REST::Memory::V1::ProfileInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Memory::V1::ProfileInstance
- Defined in:
- lib/twilio-ruby/rest/memory/v1/profile.rb
Instance Method Summary collapse
-
#context ⇒ ProfileContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#created_at ⇒ Time
The time the profile was created.
-
#delete ⇒ Boolean
Delete the ProfileInstance.
-
#fetch(trait_groups: :unset) ⇒ ProfileInstance
Fetch the ProfileInstance.
-
#id ⇒ String
The canonical profile ID.
-
#initialize(version, payload, store_id: nil, profile_id: nil) ⇒ ProfileInstance
constructor
Initialize the ProfileInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #message ⇒ String
- #meta ⇒ ProfilesMeta
-
#patch(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstance.
- #profiles ⇒ Array<String>
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#traits ⇒ Hash<String, Hash<String, Object>>
Multiple trait groups.
Constructor Details
#initialize(version, payload, store_id: nil, profile_id: nil) ⇒ ProfileInstance
Initialize the ProfileInstance
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 603 def initialize(version, payload , store_id: nil, profile_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'id' => payload['id'], 'message' => payload['message'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'traits' => payload['traits'], 'profiles' => payload['profiles'], 'meta' => payload['meta'], } # Context @instance_context = nil @params = { 'store_id' => store_id || @properties['store_id'] ,'profile_id' => profile_id || @properties['profile_id'] , } end |
Instance Method Details
#context ⇒ ProfileContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
627 628 629 630 631 632 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 627 def context unless @instance_context @instance_context = ProfileContext.new(@version , @params['store_id'], @params['profile_id']) end @instance_context end |
#created_at ⇒ Time
Returns The time the profile was created.
648 649 650 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 648 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the ProfileInstance
673 674 675 676 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 673 def delete context.delete end |
#fetch(trait_groups: :unset) ⇒ ProfileInstance
Fetch the ProfileInstance
682 683 684 685 686 687 688 689 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 682 def fetch( trait_groups: :unset ) context.fetch( trait_groups: trait_groups, ) end |
#id ⇒ String
Returns The canonical profile ID.
636 637 638 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 636 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
712 713 714 715 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 712 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ProfileInstance #{values}>" end |
#message ⇒ String
642 643 644 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 642 def @properties['message'] end |
#meta ⇒ ProfilesMeta
666 667 668 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 666 def @properties['meta'] end |
#patch(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstance
695 696 697 698 699 700 701 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 695 def patch(profile_patch: nil ) context.patch( profile_patch: profile_patch, ) end |
#profiles ⇒ Array<String>
660 661 662 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 660 def profiles @properties['profiles'] end |
#to_s ⇒ Object
Provide a user friendly representation
705 706 707 708 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 705 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ProfileInstance #{values}>" end |
#traits ⇒ Hash<String, Hash<String, Object>>
Returns Multiple trait groups.
654 655 656 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 654 def traits @properties['traits'] end |