Class: Twilio::REST::Conversations::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/service.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this service.
-
#bindings ⇒ bindings
Access the bindings.
-
#configuration ⇒ configuration
Access the configuration.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_with_participants ⇒ conversation_with_participants
Access the conversation_with_participants.
-
#conversations ⇒ conversations
Access the conversations.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#friendly_name ⇒ String
The human-readable name of this service, limited to 256 characters.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
Contains absolute API resource URLs to access conversations, users, roles, bindings and configuration of this service.
-
#participant_conversations ⇒ participant_conversations
Access the participant_conversations.
-
#roles ⇒ roles
Access the roles.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
An absolute API resource URL for this service.
-
#users ⇒ users
Access the users.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 578 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this service.
611 612 613 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 611 def account_sid @properties['account_sid'] end |
#bindings ⇒ bindings
Access the bindings
705 706 707 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 705 def bindings context.bindings end |
#configuration ⇒ configuration
Access the configuration
684 685 686 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 684 def configuration context.configuration end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
602 603 604 605 606 607 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 602 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#conversation_with_participants ⇒ conversation_with_participants
Access the conversation_with_participants
677 678 679 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 677 def conversation_with_participants context.conversation_with_participants end |
#conversations ⇒ conversations
Access the conversations
712 713 714 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 712 def conversations context.conversations end |
#date_created ⇒ Time
Returns The date that this resource was created.
629 630 631 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 629 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
635 636 637 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 635 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
654 655 656 657 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 654 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
662 663 664 665 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 662 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this service, limited to 256 characters. Optional.
623 624 625 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 623 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
725 726 727 728 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 725 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ServiceInstance #{values}>" end |
#links ⇒ Hash
Returns Contains absolute API resource URLs to access conversations, users, roles, bindings and configuration of this service.
647 648 649 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 647 def links @properties['links'] end |
#participant_conversations ⇒ participant_conversations
Access the participant_conversations
670 671 672 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 670 def participant_conversations context.participant_conversations end |
#roles ⇒ roles
Access the roles
698 699 700 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 698 def roles context.roles end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
617 618 619 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 617 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
718 719 720 721 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 718 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ServiceInstance #{values}>" end |
#url ⇒ String
Returns An absolute API resource URL for this service.
641 642 643 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 641 def url @properties['url'] end |
#users ⇒ users
Access the users
691 692 693 |
# File 'lib/twilio-ruby/rest/conversations/v1/service.rb', line 691 def users context.users end |