class Twilio::REST::Conversations::V1::ConfigurationInstance
Public Class Methods
Initialize the ConfigurationInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@return [ConfigurationInstance] ConfigurationInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 141 def initialize(version, payload) 142 super(version) 143 144 # Marshaled Properties 145 @properties = { 146 'account_sid' => payload['account_sid'], 147 'default_chat_service_sid' => payload['default_chat_service_sid'], 148 'default_messaging_service_sid' => payload['default_messaging_service_sid'], 149 'default_inactive_timer' => payload['default_inactive_timer'], 150 'default_closed_timer' => payload['default_closed_timer'], 151 'url' => payload['url'], 152 'links' => payload['links'], 153 } 154 155 # Context 156 @instance_context = nil 157 @params = {} 158 end
Public Instance Methods
@return [String] The SID of the Account responsible for this configuration.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 173 def account_sid 174 @properties['account_sid'] 175 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ConfigurationContext] ConfigurationContext
for this ConfigurationInstance
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 164 def context 165 unless @instance_context 166 @instance_context = ConfigurationContext.new(@version, ) 167 end 168 @instance_context 169 end
@return [String] The SID of the default Conversation Service that every new conversation is associated with.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 179 def default_chat_service_sid 180 @properties['default_chat_service_sid'] 181 end
@return [String] Default ISO8601 duration when conversation will be switched to `closed` state.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 197 def default_closed_timer 198 @properties['default_closed_timer'] 199 end
@return [String] Default ISO8601 duration when conversation will be switched to `inactive` state.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 191 def default_inactive_timer 192 @properties['default_inactive_timer'] 193 end
@return [String] The SID of the default Messaging
Service that every new conversation is associated with.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 185 def default_messaging_service_sid 186 @properties['default_messaging_service_sid'] 187 end
Fetch the ConfigurationInstance
@return [ConfigurationInstance] Fetched ConfigurationInstance
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 216 def fetch 217 context.fetch 218 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 252 def inspect 253 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 254 "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" 255 end
@return [String] Absolute URLs to access the webhook and default service configurations.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 209 def links 210 @properties['links'] 211 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 245 def to_s 246 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 247 "<Twilio.Conversations.V1.ConfigurationInstance #{values}>" 248 end
Update the ConfigurationInstance
@param [String] default_chat_service_sid
The SID of the default {Conversation
Service}[https://www.twilio.com/docs/conversations/api/service-resource] to use when creating a conversation.
@param [String] default_messaging_service_sid
The SID of the default {Messaging
Service}[https://www.twilio.com/docs/sms/services/api] to use when creating a conversation.
@param [String] default_inactive_timer
Default ISO8601 duration when
conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
@param [String] default_closed_timer
Default ISO8601 duration when conversation
will be switched to `closed` state. Minimum value for this timer is 10 minutes.
@return [ConfigurationInstance] Updated ConfigurationInstance
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 234 def update(default_chat_service_sid: :unset, default_messaging_service_sid: :unset, default_inactive_timer: :unset, default_closed_timer: :unset) 235 context.update( 236 default_chat_service_sid: default_chat_service_sid, 237 default_messaging_service_sid: default_messaging_service_sid, 238 default_inactive_timer: default_inactive_timer, 239 default_closed_timer: default_closed_timer, 240 ) 241 end
@return [String] An absolute URL for this global configuration.
# File lib/twilio-ruby/rest/conversations/v1/configuration.rb 203 def url 204 @properties['url'] 205 end