Class: Twilio::REST::Content::V1::ContentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Content::V1::ContentInstance
- Defined in:
- lib/twilio-ruby/rest/content/v1/content.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/usage/api/account) that created Content resource.
-
#approval_create ⇒ approval_create
Access the approval_create.
-
#approval_fetch ⇒ approval_fetch
Access the approval_fetch.
-
#context ⇒ ContentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the ContentInstance.
-
#fetch ⇒ ContentInstance
Fetch the ContentInstance.
-
#friendly_name ⇒ String
A string name used to describe the Content resource.
-
#initialize(version, payload, sid: nil) ⇒ ContentInstance
constructor
Initialize the ContentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#language ⇒ String
Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
-
#links ⇒ Hash
A list of links related to the Content resource, such as approval_fetch and approval_create.
-
#sid ⇒ String
The unique string that that we created to identify the Content resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#types ⇒ Hash
The [Content types](www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
-
#url ⇒ String
The URL of the resource, relative to ‘content.twilio.com`.
-
#variables ⇒ Hash
Defines the default placeholder values for variables included in the Content resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ContentInstance
Initialize the ContentInstance
810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 810 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'language' => payload['language'], 'variables' => payload['variables'], 'types' => payload['types'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/usage/api/account) that created Content resource.
863 864 865 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 863 def account_sid @properties['account_sid'] end |
#approval_create ⇒ approval_create
Access the approval_create
922 923 924 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 922 def approval_create context.approval_create end |
#approval_fetch ⇒ approval_fetch
Access the approval_fetch
929 930 931 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 929 def approval_fetch context.approval_fetch end |
#context ⇒ ContentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
836 837 838 839 840 841 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 836 def context unless @instance_context @instance_context = ContentContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
845 846 847 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 845 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
851 852 853 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 851 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ContentInstance
906 907 908 909 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 906 def delete context.delete end |
#fetch ⇒ ContentInstance
Fetch the ContentInstance
914 915 916 917 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 914 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A string name used to describe the Content resource. Not visible to the end recipient.
869 870 871 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 869 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
942 943 944 945 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 942 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Content.V1.ContentInstance #{values}>" end |
#language ⇒ String
Returns Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in.
875 876 877 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 875 def language @properties['language'] end |
#links ⇒ Hash
Returns A list of links related to the Content resource, such as approval_fetch and approval_create.
899 900 901 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 899 def links @properties['links'] end |
#sid ⇒ String
Returns The unique string that that we created to identify the Content resource.
857 858 859 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 857 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
935 936 937 938 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 935 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Content.V1.ContentInstance #{values}>" end |
#types ⇒ Hash
Returns The [Content types](www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource.
887 888 889 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 887 def types @properties['types'] end |
#url ⇒ String
Returns The URL of the resource, relative to ‘content.twilio.com`.
893 894 895 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 893 def url @properties['url'] end |
#variables ⇒ Hash
Returns Defines the default placeholder values for variables included in the Content resource. e.g. "Customer_Name".
881 882 883 |
# File 'lib/twilio-ruby/rest/content/v1/content.rb', line 881 def variables @properties['variables'] end |