Class: Twilio::REST::Intelligence::V2::PrebuiltOperatorInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ PrebuiltOperatorInstance

Initialize the PrebuiltOperatorInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this PrebuiltOperator resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



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/prebuilt_operator.rb', line 230

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_sidString

Returns The unique SID identifier of the Account the Pre-built Operator belongs to.

Returns:

  • (String)

    The unique SID identifier of the Account the Pre-built Operator belongs to.



267
268
269
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 267

def 
    @properties['account_sid']
end

#authorString

Returns The creator of the Operator. Pre-built Operators can only be created by Twilio.

Returns:

  • (String)

    The creator of the Operator. Pre-built Operators can only be created by Twilio.



291
292
293
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 291

def author
    @properties['author']
end

#availabilityAvailability

Returns:

  • (Availability)


309
310
311
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 309

def availability
    @properties['availability']
end

#configHash

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.

Returns:

  • (Hash)

    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.



315
316
317
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 315

def config
    @properties['config']
end

#contextPrebuiltOperatorContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



258
259
260
261
262
263
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 258

def context
    unless @instance_context
        @instance_context = PrebuiltOperatorContext.new(@version , @params['sid'])
    end
    @instance_context
end

#date_createdTime

Returns The date that this Pre-built Operator was created, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Pre-built Operator was created, given in ISO 8601 format.



321
322
323
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 321

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Pre-built Operator was updated, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Pre-built Operator was updated, given in ISO 8601 format.



327
328
329
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 327

def date_updated
    @properties['date_updated']
end

#descriptionString

Returns A human-readable description of this resource, longer than the friendly name.

Returns:

  • (String)

    A human-readable description of this resource, longer than the friendly name.



285
286
287
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 285

def description
    @properties['description']
end

#fetchPrebuiltOperatorInstance

Fetch the PrebuiltOperatorInstance

Returns:



340
341
342
343
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 340

def fetch

    context.fetch
end

#friendly_nameString

Returns A human-readable name of this resource, up to 64 characters.

Returns:

  • (String)

    A human-readable name of this resource, up to 64 characters.



279
280
281
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 279

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



354
355
356
357
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 354

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.PrebuiltOperatorInstance #{values}>"
end

#operator_typeString

Returns Operator Type for this Operator. References an existing Operator Type resource.

Returns:

  • (String)

    Operator Type for this Operator. References an existing Operator Type resource.



297
298
299
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 297

def operator_type
    @properties['operator_type']
end

#sidString

Returns A 34 character string that uniquely identifies this Pre-built Operator.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Pre-built Operator.



273
274
275
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 273

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



347
348
349
350
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 347

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V2.PrebuiltOperatorInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



333
334
335
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 333

def url
    @properties['url']
end

#versionString

Returns Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator.

Returns:

  • (String)

    Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator.



303
304
305
# File 'lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb', line 303

def version
    @properties['version']
end