Class: Twilio::REST::Conversations::V1::ConfigurationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::ConfigurationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/configuration.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this configuration.
-
#context ⇒ ConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#default_chat_service_sid ⇒ String
The SID of the default [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) used when creating a conversation.
-
#default_closed_timer ⇒ String
Default ISO8601 duration when conversation will be switched to ‘closed` state.
-
#default_inactive_timer ⇒ String
Default ISO8601 duration when conversation will be switched to ‘inactive` state.
-
#default_messaging_service_sid ⇒ String
The SID of the default [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) used when creating a conversation.
-
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance.
-
#initialize(version, payload) ⇒ ConfigurationInstance
constructor
Initialize the ConfigurationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
Contains absolute API resource URLs to access the webhook and default service configurations.
-
#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.
-
#url ⇒ String
An absolute API resource URL for this global configuration.
-
#webhooks ⇒ webhooks
Access the webhooks.
Constructor Details
#initialize(version, payload) ⇒ ConfigurationInstance
Initialize the ConfigurationInstance
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 173 def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'default_chat_service_sid' => payload['default_chat_service_sid'], 'default_messaging_service_sid' => payload['default_messaging_service_sid'], 'default_inactive_timer' => payload['default_inactive_timer'], 'default_closed_timer' => payload['default_closed_timer'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) responsible for this configuration.
205 206 207 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 205 def account_sid @properties['account_sid'] end |
#context ⇒ ConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
196 197 198 199 200 201 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 196 def context unless @instance_context @instance_context = ConfigurationContext.new(@version ) end @instance_context end |
#default_chat_service_sid ⇒ String
Returns The SID of the default [Conversation Service](www.twilio.com/docs/conversations/api/service-resource) used when creating a conversation.
211 212 213 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 211 def default_chat_service_sid @properties['default_chat_service_sid'] end |
#default_closed_timer ⇒ String
Returns Default ISO8601 duration when conversation will be switched to ‘closed` state. Minimum value for this timer is 10 minutes.
229 230 231 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 229 def default_closed_timer @properties['default_closed_timer'] end |
#default_inactive_timer ⇒ String
Returns Default ISO8601 duration when conversation will be switched to ‘inactive` state. Minimum value for this timer is 1 minute.
223 224 225 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 223 def default_inactive_timer @properties['default_inactive_timer'] end |
#default_messaging_service_sid ⇒ String
Returns The SID of the default [Messaging Service](www.twilio.com/docs/messaging/api/service-resource) used when creating a conversation.
217 218 219 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 217 def default_messaging_service_sid @properties['default_messaging_service_sid'] end |
#fetch ⇒ ConfigurationInstance
Fetch the ConfigurationInstance
248 249 250 251 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 248 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
291 292 293 294 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 291 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" end |
#links ⇒ Hash
Returns Contains absolute API resource URLs to access the webhook and default service configurations.
241 242 243 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 241 def links @properties['links'] end |
#to_s ⇒ Object
Provide a user friendly representation
284 285 286 287 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 284 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" end |
#update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) ⇒ ConfigurationInstance
Update the ConfigurationInstance
260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 260 def update( default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset ) context.update( default_chat_service_sid: default_chat_service_sid, default_messaging_service_sid: default_messaging_service_sid, default_inactive_timer: default_inactive_timer, default_closed_timer: default_closed_timer, ) end |
#url ⇒ String
Returns An absolute API resource URL for this global configuration.
235 236 237 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 235 def url @properties['url'] end |
#webhooks ⇒ webhooks
Access the webhooks
278 279 280 |
# File 'lib/twilio-ruby/rest/conversations/v1/configuration.rb', line 278 def webhooks context.webhooks end |