Class: Twilio::REST::Intelligence::V2::PrebuiltOperatorInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::PrebuiltOperatorInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account the Pre-built Operator belongs to.
-
#author ⇒ String
The creator of the Operator.
- #availability ⇒ Availability
-
#config ⇒ Hash
Operator configuration, following the schema defined by the Operator Type.
-
#context ⇒ PrebuiltOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Pre-built Operator was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Pre-built Operator was updated, given in ISO 8601 format.
-
#description ⇒ String
A human-readable description of this resource, longer than the friendly name.
-
#fetch ⇒ PrebuiltOperatorInstance
Fetch the PrebuiltOperatorInstance.
-
#friendly_name ⇒ String
A human-readable name of this resource, up to 64 characters.
-
#initialize(version, payload, sid: nil) ⇒ PrebuiltOperatorInstance
constructor
Initialize the PrebuiltOperatorInstance.
-
#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 Pre-built Operator.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
Numeric Operator version.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ PrebuiltOperatorInstance
Initialize the PrebuiltOperatorInstance
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 223 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
Returns The unique SID identifier of the Account the Pre-built Operator belongs to.
260 261 262 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 260 def account_sid @properties['account_sid'] end |
#author ⇒ String
Returns The creator of the Operator. Pre-built Operators can only be created by Twilio.
284 285 286 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 284 def @properties['author'] end |
#availability ⇒ Availability
302 303 304 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 302 def availability @properties['availability'] end |
#config ⇒ Hash
Returns Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account, will be empty for Pre-Built Operators.
308 309 310 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 308 def config @properties['config'] end |
#context ⇒ PrebuiltOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 251 def context unless @instance_context @instance_context = PrebuiltOperatorContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Pre-built Operator was created, given in ISO 8601 format.
314 315 316 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 314 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Pre-built Operator was updated, given in ISO 8601 format.
320 321 322 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 320 def date_updated @properties['date_updated'] end |
#description ⇒ String
Returns A human-readable description of this resource, longer than the friendly name.
278 279 280 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 278 def description @properties['description'] end |
#fetch ⇒ PrebuiltOperatorInstance
Fetch the PrebuiltOperatorInstance
333 334 335 336 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 333 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human-readable name of this resource, up to 64 characters.
272 273 274 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 272 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
347 348 349 350 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 347 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.PrebuiltOperatorInstance #{values}>" end |
#operator_type ⇒ String
Returns Operator Type for this Operator. References an existing Operator Type resource.
290 291 292 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 290 def operator_type @properties['operator_type'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Pre-built Operator.
266 267 268 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 266 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
340 341 342 343 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 340 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.PrebuiltOperatorInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
326 327 328 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 326 def url @properties['url'] end |
#version ⇒ String
Returns Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator.
296 297 298 |
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 296 def version @properties['version'] end |