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



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 150

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



171
172
173
174
175
176
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 171

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

#enabledBoolean



180
181
182
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 180

def enabled
    @properties['enabled']
end

#fetchExportConfigurationInstance

Fetch the ExportConfigurationInstance



211
212
213
214
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 211

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



244
245
246
247
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 244

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

#resource_typeString



198
199
200
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 198

def resource_type
    @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



237
238
239
240
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 237

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



222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 222

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

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

#urlString



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

def url
    @properties['url']
end

#webhook_methodString



192
193
194
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 192

def webhook_method
    @properties['webhook_method']
end

#webhook_urlString



186
187
188
# File 'lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb', line 186

def webhook_url
    @properties['webhook_url']
end