Class: Twilio::REST::Preview::BulkExports::ExportConfigurationInstance

Inherits:
InstanceResource
  • 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, payload, resource_type: nil) ⇒ ExportConfigurationInstance

Initialize the ExportConfigurationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • resource_type (String) (defaults to: nil)

    The resource_type



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 133

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

#contextExportConfigurationContext

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

Returns:



154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 154

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

#enabledBoolean

Returns The enabled.

Returns:

  • (Boolean)

    The enabled



163
164
165
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 163

def enabled
  @properties['enabled']
end

#fetchExportConfigurationInstance

Fetch a ExportConfigurationInstance

Returns:



194
195
196
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 194

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



217
218
219
220
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 217

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

#resource_typeString

Returns The resource_type.

Returns:

  • (String)

    The resource_type



181
182
183
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 181

def resource_type
  @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



210
211
212
213
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 210

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.BulkExports.ExportConfigurationInstance #{values}>"
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:



204
205
206
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 204

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



187
188
189
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 187

def url
  @properties['url']
end

#webhook_methodString

Returns The webhook_method.

Returns:

  • (String)

    The webhook_method



175
176
177
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 175

def webhook_method
  @properties['webhook_method']
end

#webhook_urlString

Returns The webhook_url.

Returns:

  • (String)

    The webhook_url



169
170
171
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb', line 169

def webhook_url
  @properties['webhook_url']
end