Class: Twilio::REST::Webhooks::V1::SharedKeyInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Webhooks::V1::SharedKeyInstance
- Defined in:
- lib/twilio-ruby/rest/webhooks/v1/shared_key.rb
Instance Method Summary collapse
- #code ⇒ String
-
#context ⇒ SharedKeyContext
Generate an instance context for the instance, the context is capable of performing various actions.
- #created_at ⇒ Time
-
#delete ⇒ Boolean
Delete the SharedKeyInstance.
- #detail ⇒ String
-
#fetch ⇒ SharedKeyInstance
Fetch the SharedKeyInstance.
-
#friendly_name ⇒ String
Human-readable name for identification.
-
#id ⇒ String
Unique SharedKey identifier (TypeID/TTID format).
-
#initialize(version, payload, shared_key_id: nil) ⇒ SharedKeyInstance
constructor
Initialize the SharedKeyInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#patch(patch_shared_key: nil) ⇒ SharedKeyInstance
Patch the SharedKeyInstance.
-
#secret ⇒ String
Signing secret (only returned on POST, cannot be retrieved later).
- #status ⇒ String
- #title ⇒ String
-
#to_s ⇒ Object
Provide a user friendly representation.
- #type ⇒ String
- #updated_at ⇒ Time
Constructor Details
#initialize(version, payload, shared_key_id: nil) ⇒ SharedKeyInstance
Initialize the SharedKeyInstance
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 581 def initialize(version, payload , shared_key_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'id' => payload['id'], 'friendly_name' => payload['friendly_name'], 'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']), 'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']), 'secret' => payload['secret'], 'type' => payload['type'], 'title' => payload['title'], 'status' => payload['status'] == nil ? payload['status'] : payload['status'].to_i, 'detail' => payload['detail'], 'code' => payload['code'] == nil ? payload['code'] : payload['code'].to_i, } # Context @instance_context = nil @params = { 'shared_key_id' => shared_key_id || @properties['shared_key_id'] , } end |
Instance Method Details
#code ⇒ String
672 673 674 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 672 def code @properties['code'] end |
#context ⇒ SharedKeyContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
609 610 611 612 613 614 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 609 def context unless @instance_context @instance_context = SharedKeyContext.new(@version , @params['shared_key_id']) end @instance_context end |
#created_at ⇒ Time
630 631 632 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 630 def created_at @properties['created_at'] end |
#delete ⇒ Boolean
Delete the SharedKeyInstance
679 680 681 682 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 679 def delete context.delete end |
#detail ⇒ String
666 667 668 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 666 def detail @properties['detail'] end |
#fetch ⇒ SharedKeyInstance
Fetch the SharedKeyInstance
687 688 689 690 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 687 def fetch context.fetch end |
#friendly_name ⇒ String
Returns Human-readable name for identification.
624 625 626 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 624 def friendly_name @properties['friendly_name'] end |
#id ⇒ String
Returns Unique SharedKey identifier (TypeID/TTID format).
618 619 620 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 618 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
713 714 715 716 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 713 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Webhooks.V1.SharedKeyInstance #{values}>" end |
#patch(patch_shared_key: nil) ⇒ SharedKeyInstance
Patch the SharedKeyInstance
696 697 698 699 700 701 702 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 696 def patch(patch_shared_key: nil ) context.patch( patch_shared_key: patch_shared_key, ) end |
#secret ⇒ String
Returns Signing secret (only returned on POST, cannot be retrieved later).
642 643 644 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 642 def secret @properties['secret'] end |
#status ⇒ String
660 661 662 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 660 def status @properties['status'] end |
#title ⇒ String
654 655 656 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 654 def title @properties['title'] end |
#to_s ⇒ Object
Provide a user friendly representation
706 707 708 709 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 706 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Webhooks.V1.SharedKeyInstance #{values}>" end |
#type ⇒ String
648 649 650 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 648 def type @properties['type'] end |
#updated_at ⇒ Time
636 637 638 |
# File 'lib/twilio-ruby/rest/webhooks/v1/shared_key.rb', line 636 def updated_at @properties['updated_at'] end |