Class: Twilio::REST::Conversations::V1::ConfigurationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::ConfigurationContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/configuration.rb,
lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb
Defined Under Namespace
Classes: WebhookContext, WebhookInstance, WebhookInstanceMetadata, WebhookList, WebhookListResponse, WebhookPage, WebhookPageMetadata
Instance Method Summary collapse
-
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance.
-
#fetch_with_metadata ⇒ ConfigurationInstance
Fetch the ConfigurationInstanceMetadata.
-
#initialize(version) ⇒ ConfigurationContext
constructor
Initialize the ConfigurationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance.
-
#update_with_metadata(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstanceMetadata.
-
#webhooks ⇒ WebhookList, WebhookContext
Access the webhooks.
Constructor Details
#initialize(version) ⇒ ConfigurationContext
Initialize the ConfigurationContext
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 49 def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Configuration" # Dependents @webhooks = nil end |
Instance Method Details
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 63 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ConfigurationInstance.new( @version, payload, ) end |
#fetch_with_metadata ⇒ ConfigurationInstance
Fetch the ConfigurationInstanceMetadata
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 81 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) configuration_instance = ConfigurationInstance.new( @version, response.body, ) ConfigurationInstanceMetadata.new( @version, configuration_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
195 196 197 198 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 195 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ConfigurationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
188 189 190 191 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 188 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.ConfigurationContext #{context}>" end |
#update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 109 def update( default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset ) data = Twilio::Values.of({ 'DefaultChatServiceSid' => default_chat_service_sid, 'DefaultMessagingServiceSid' => default_messaging_service_sid, 'DefaultInactiveTimer' => default_inactive_timer, 'DefaultClosedTimer' => default_closed_timer, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ConfigurationInstance.new( @version, payload, ) end |
#update_with_metadata(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstanceMetadata
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 143 def ( default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset ) data = Twilio::Values.of({ 'DefaultChatServiceSid' => default_chat_service_sid, 'DefaultMessagingServiceSid' => default_messaging_service_sid, 'DefaultInactiveTimer' => default_inactive_timer, 'DefaultClosedTimer' => default_closed_timer, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('POST', @uri, data: data, headers: headers) configuration_instance = ConfigurationInstance.new( @version, response.body, ) ConfigurationInstanceMetadata.new( @version, configuration_instance, response.headers, response.status_code ) end |
#webhooks ⇒ WebhookList, WebhookContext
Access the webhooks
180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 180 def webhooks WebhookContext.new( @version ) end |