Class: Twilio::REST::Intelligence::V2::CustomOperatorInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::CustomOperatorInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account the Custom Operator belongs to.
-
#author ⇒ String
The creator of the Custom Operator.
- #availability ⇒ Availability
-
#config ⇒ Hash
Operator configuration, following the schema defined by the Operator Type.
-
#context ⇒ CustomOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Custom Operator was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Custom Operator was updated, given in ISO 8601 format.
-
#delete ⇒ Boolean
Delete the CustomOperatorInstance.
-
#description ⇒ String
A human-readable description of this resource, longer than the friendly name.
-
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance.
-
#friendly_name ⇒ String
A human-readable name of this resource, up to 64 characters.
-
#initialize(version, payload, sid: nil) ⇒ CustomOperatorInstance
constructor
Initialize the CustomOperatorInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#operator_type ⇒ String
Operator Type for this Operator.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Custom Operator.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
Numeric Custom Operator version.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CustomOperatorInstance
Initialize the CustomOperatorInstance
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 287 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'description' => payload['description'], 'author' => payload['author'], 'operator_type' => payload['operator_type'], 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, 'availability' => payload['availability'], 'config' => payload['config'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
324 325 326 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 324 def account_sid @properties['account_sid'] end |
#author ⇒ String
348 349 350 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 348 def @properties['author'] end |
#availability ⇒ Availability
366 367 368 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 366 def availability @properties['availability'] end |
#config ⇒ Hash
372 373 374 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 372 def config @properties['config'] end |
#context ⇒ CustomOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
315 316 317 318 319 320 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 315 def context unless @instance_context @instance_context = CustomOperatorContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
378 379 380 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 378 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
384 385 386 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 384 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CustomOperatorInstance
397 398 399 400 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 397 def delete context.delete end |
#description ⇒ String
342 343 344 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 342 def description @properties['description'] end |
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance
405 406 407 408 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 405 def fetch context.fetch end |
#friendly_name ⇒ String
336 337 338 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 336 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
438 439 440 441 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 438 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>" end |
#operator_type ⇒ String
354 355 356 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 354 def operator_type @properties['operator_type'] end |
#sid ⇒ String
330 331 332 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 330 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
431 432 433 434 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 431 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>" end |
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance
416 417 418 419 420 421 422 423 424 425 426 427 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 416 def update( friendly_name: nil, config: nil, if_match: :unset ) context.update( friendly_name: friendly_name, config: config, if_match: if_match, ) end |
#url ⇒ String
390 391 392 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 390 def url @properties['url'] end |
#version ⇒ String
360 361 362 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 360 def version @properties['version'] end |