Class: Twilio::REST::Intelligence::V2::CustomOperatorContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Intelligence::V2::CustomOperatorContext
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CustomOperatorInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the CustomOperatorInstanceMetadata.
-
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance.
-
#fetch_with_metadata ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstanceMetadata.
-
#initialize(version, sid) ⇒ CustomOperatorContext
constructor
Initialize the CustomOperatorContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance.
-
#update_with_metadata(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ CustomOperatorContext
Initialize the CustomOperatorContext
243 244 245 246 247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 243 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Operators/Custom/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CustomOperatorInstance
256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 256 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the CustomOperatorInstanceMetadata
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 269 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) customOperator_instance = CustomOperatorInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) CustomOperatorInstanceMetadata.new(@version, customOperator_instance, response.headers, response.status_code) end |
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 288 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) CustomOperatorInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstanceMetadata
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 307 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) custom_operator_instance = CustomOperatorInstance.new( @version, response.body, sid: @solution[:sid], ) CustomOperatorInstanceMetadata.new( @version, custom_operator_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 407 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
400 401 402 403 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 400 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Intelligence.V2.CustomOperatorContext #{context}>" end |
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 335 def update( friendly_name: nil, config: nil, if_match: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Config' => Twilio.serialize_object(config), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) payload = @version.update('POST', @uri, data: data, headers: headers) CustomOperatorInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstanceMetadata
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 366 def ( friendly_name: nil, config: nil, if_match: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Config' => Twilio.serialize_object(config), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) response = @version.('POST', @uri, data: data, headers: headers) custom_operator_instance = CustomOperatorInstance.new( @version, response.body, sid: @solution[:sid], ) CustomOperatorInstanceMetadata.new( @version, custom_operator_instance, response.headers, response.status_code ) end |