Class: Twilio::REST::Intelligence::V2::OperatorTypeInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the OperatorTypeInstance

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 OperatorType resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 218

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'name' => payload['name'],
        'sid' => payload['sid'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'docs_link' => payload['docs_link'],
        'output_type' => payload['output_type'],
        'supported_languages' => payload['supported_languages'],
        'provider' => payload['provider'],
        'availability' => payload['availability'],
        'configurable' => payload['configurable'],
        'config_schema' => payload['config_schema'],
        '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

#availabilityAvailability

Returns:

  • (Availability)


305
306
307
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 305

def availability
    @properties['availability']
end

#config_schemaHash

Returns JSON Schema for configuring an Operator with this Operator Type. Following json-schema.org/.

Returns:

  • (Hash)

    JSON Schema for configuring an Operator with this Operator Type. Following json-schema.org/



317
318
319
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 317

def config_schema
    @properties['config_schema']
end

#configurableBoolean

Returns Operators can be created from configurable Operator Types.

Returns:

  • (Boolean)

    Operators can be created from configurable Operator Types.



311
312
313
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 311

def configurable
    @properties['configurable']
end

#contextOperatorTypeContext

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

Returns:



248
249
250
251
252
253
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 248

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

#date_createdTime

Returns The date that this Operator Type was created, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Operator Type was created, given in ISO 8601 format.



323
324
325
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 323

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Operator Type was updated, given in ISO 8601 format.

Returns:

  • (Time)

    The date that this Operator Type was updated, given in ISO 8601 format.



329
330
331
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 329

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.



275
276
277
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 275

def description
    @properties['description']
end

Returns Additional documentation for the Operator Type.

Returns:

  • (String)

    Additional documentation for the Operator Type.



281
282
283
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 281

def docs_link
    @properties['docs_link']
end

#fetchOperatorTypeInstance

Fetch the OperatorTypeInstance

Returns:



342
343
344
345
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 342

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.



269
270
271
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 269

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



356
357
358
359
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 356

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

#nameString

Returns A unique name that references an Operator’s Operator Type.

Returns:

  • (String)

    A unique name that references an Operator’s Operator Type.



257
258
259
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 257

def name
    @properties['name']
end

#output_typeOutputType

Returns:

  • (OutputType)


287
288
289
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 287

def output_type
    @properties['output_type']
end

#providerProvider

Returns:

  • (Provider)


299
300
301
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 299

def provider
    @properties['provider']
end

#sidString

Returns A 34 character string that uniquely identifies this Operator Type.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Operator Type.



263
264
265
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 263

def sid
    @properties['sid']
end

#supported_languagesArray<String>

Returns List of languages this Operator Type supports.

Returns:

  • (Array<String>)

    List of languages this Operator Type supports.



293
294
295
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 293

def supported_languages
    @properties['supported_languages']
end

#to_sObject

Provide a user friendly representation



349
350
351
352
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 349

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



335
336
337
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_type.rb', line 335

def url
    @properties['url']
end