Class: Twilio::REST::Memory::V1::BulkInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/memory/v1/bulk.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, store_id: nil) ⇒ BulkInstance

Initialize the BulkInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 300

def initialize(version, payload , store_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'message' => payload['message'],
    }

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

Instance Method Details

#contextBulkContext

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

Returns:



319
320
321
322
323
324
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 319

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

#inspectObject

Provide a detailed, user friendly representation



353
354
355
356
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 353

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

#messageString

Returns:

  • (String)


328
329
330
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 328

def message
    @properties['message']
end

#to_sObject

Provide a user friendly representation



346
347
348
349
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 346

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

#update(update_profiles_bulk_request: nil) ⇒ BulkInstance

Update the BulkInstance

Parameters:

  • update_profiles_bulk_request (UpdateProfilesBulkRequest) (defaults to: nil)

Returns:



336
337
338
339
340
341
342
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 336

def update(update_profiles_bulk_request: nil
)

    context.update(
        update_profiles_bulk_request: update_profiles_bulk_request, 
    )
end