Class: Twilio::REST::Intelligence::V2::ServiceContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::ServiceContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/service.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#initialize(version, sid) ⇒ ServiceContext
constructor
Initialize the ServiceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
Constructor Details
#initialize(version, sid) ⇒ ServiceContext
Initialize the ServiceContext
177 178 179 180 181 182 183 184 185 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 177 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Services/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ServiceInstance
189 190 191 192 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 189 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
197 198 199 200 201 202 203 204 205 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 197 def fetch payload = @version.fetch('GET', @uri) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
264 265 266 267 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 264 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.ServiceContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
257 258 259 260 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 257 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.ServiceContext #{context}>" end |
#update(auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset) ⇒ ServiceInstance
Update the ServiceInstance
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 220 def update( auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset ) data = Twilio::Values.of({ 'AutoTranscribe' => auto_transcribe, 'DataLogging' => data_logging, 'FriendlyName' => friendly_name, 'LanguageCode' => language_code, 'UniqueName' => unique_name, 'AutoRedaction' => auto_redaction, 'MediaRedaction' => media_redaction, 'WebhookUrl' => webhook_url, 'WebhookHttpMethod' => webhook_http_method, }) headers = Twilio::Values.of({ 'If-Match' => if_match, }) payload = @version.update('POST', @uri, data: data, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |