Class: Twilio::REST::Bulkexports::V1::ExportConfigurationInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, resource_type: nil) ⇒ ExportConfigurationInstance

Initialize the ExportConfigurationInstance

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

  • sid (String) —

    The SID of the Call resource to fetch.



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 277

def initialize(version, payload , resource_type: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'enabled' => payload['enabled'],
        'webhook_url' => payload['webhook_url'],
        'webhook_method' => payload['webhook_method'],
        'resource_type' => payload['resource_type'],
        'url' => payload['url'],
    }

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

Instance Method Details

#context ⇒ ExportConfigurationContext

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

Returns:



299
300
301
302
303
304
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 299

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

#enabled ⇒ Boolean

Returns If true, Twilio will automatically generate every day's file when the day is over.

Returns:

  • (Boolean) —

    If true, Twilio will automatically generate every day's file when the day is over.



308
309
310
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 308

def enabled
    @properties['enabled']
end

#fetch ⇒ ExportConfigurationInstance

Fetch the ExportConfigurationInstance

Returns:



339
340
341
342
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 339

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



372
373
374
375
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 372

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

#resource_type ⇒ String

Returns The type of communication – Messages, Calls, Conferences, and Participants.

Returns:

  • (String) —

    The type of communication – Messages, Calls, Conferences, and Participants



326
327
328
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 326

def resource_type
    @properties['resource_type']
end

#to_s ⇒ Object

Provide a user friendly representation



365
366
367
368
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 365

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

#update(enabled: :unset, webhook_url: :unset, webhook_method: :unset) ⇒ ExportConfigurationInstance

Update the ExportConfigurationInstance

Parameters:

  • enabled (Boolean) (defaults to: :unset) —

    If true, Twilio will automatically generate every day's file when the day is over.

  • webhook_url (String) (defaults to: :unset) —

    Stores the URL destination for the method specified in webhook_method.

  • webhook_method (String) (defaults to: :unset) —

    Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url

Returns:



350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 350

def update(
  enabled: :unset, 
  webhook_url: :unset, 
  webhook_method: :unset
)

    context.update(
        enabled: enabled, 
        webhook_url: webhook_url, 
        webhook_method: webhook_method, 
    )
end

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



332
333
334
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 332

def url
    @properties['url']
end

#webhook_method ⇒ String

Returns Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url.

Returns:

  • (String) —

    Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url



320
321
322
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 320

def webhook_method
    @properties['webhook_method']
end

#webhook_url ⇒ String

Returns Stores the URL destination for the method specified in webhook_method.

Returns:

  • (String) —

    Stores the URL destination for the method specified in webhook_method.



314
315
316
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 314

def webhook_url
    @properties['webhook_url']
end