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.
-
#delete ⇒ Boolean
Delete 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.
Constructor Details
#initialize(version, payload, store_id: nil, profile_id: nil) ⇒ ProfileInstance
Initialize the ProfileInstance
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 545 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'], '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
567 568 569 570 571 572 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 567 def context unless @instance_context @instance_context = ProfileContext.new(@version , @params['store_id'], @params['profile_id']) end @instance_context end |
#delete ⇒ Boolean
Delete the ProfileInstance
601 602 603 604 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 601 def delete context.delete end |
#id ⇒ String
Returns The canonical profile ID.
576 577 578 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 576 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
627 628 629 630 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 627 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ProfileInstance #{values}>" end |
#message ⇒ String
582 583 584 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 582 def @properties['message'] end |
#meta ⇒ ProfilesMeta
594 595 596 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 594 def @properties['meta'] end |
#patch(profile_patch: nil) ⇒ ProfileInstance
Patch the ProfileInstance
610 611 612 613 614 615 616 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 610 def patch(profile_patch: nil ) context.patch( profile_patch: profile_patch, ) end |
#profiles ⇒ Array<String>
588 589 590 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 588 def profiles @properties['profiles'] end |
#to_s ⇒ Object
Provide a user friendly representation
620 621 622 623 |
# File 'lib/twilio-ruby/rest/memory/v1/profile.rb', line 620 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Memory.V1.ProfileInstance #{values}>" end |