Class: Twilio::REST::Preview::BulkExports::ExportConfigurationContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, resource_type) ⇒ ExportConfigurationContext

Initialize the ExportConfigurationContext

Parameters:

  • version (Version)

    Version that contains the resource

  • resource_type (String)

    The resource_type



73
74
75
76
77
78
79
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 73

def initialize(version, resource_type)
  super(version)

  # Path Solution
  @solution = {resource_type: resource_type, }
  @uri = "/Exports/#{@solution[:resource_type]}/Configuration"
end

Instance Method Details

#fetchExportConfigurationInstance

Fetch a ExportConfigurationInstance

Returns:



84
85
86
87
88
89
90
91
92
93
94
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 84

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  ExportConfigurationInstance.new(@version, payload, resource_type: @solution[:resource_type], )
end

#inspectObject

Provide a detailed, user friendly representation



127
128
129
130
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 127

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.BulkExports.ExportConfigurationContext #{context}>"
end

#to_sObject

Provide a user friendly representation



120
121
122
123
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 120

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.BulkExports.ExportConfigurationContext #{context}>"
end

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

Update the ExportConfigurationInstance

Parameters:

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

    The enabled

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

    The webhook_url

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

    The webhook_method

Returns:



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 102

def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset)
  data = Twilio::Values.of({
      'Enabled' => enabled,
      'WebhookUrl' => webhook_url,
      'WebhookMethod' => webhook_method,
  })

  payload = @version.update(
      'POST',
      @uri,
      data: data,
  )

  ExportConfigurationInstance.new(@version, payload, resource_type: @solution[:resource_type], )
end