Class: Twilio::REST::Intelligence::V2::OperatorAttachmentsInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil) ⇒ OperatorAttachmentsInstance

Initialize the OperatorAttachmentsInstance



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 266

def initialize(version, payload , service_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'service_sid' => payload['service_sid'],
        'operator_sids' => payload['operator_sids'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'service_sid' => service_sid  || @properties['service_sid']  , }
end

Instance Method Details

#contextOperatorAttachmentsContext

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



286
287
288
289
290
291
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 286

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

#fetchOperatorAttachmentsInstance

Fetch the OperatorAttachmentsInstance



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

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

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

#operator_sidsArray<String>



301
302
303
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 301

def operator_sids
    @properties['operator_sids']
end

#service_sidString



295
296
297
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 295

def service_sid
    @properties['service_sid']
end

#to_sObject

Provide a user friendly representation



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

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

#urlString



307
308
309
# File 'lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb', line 307

def url
    @properties['url']
end