Class: Twilio::REST::Preview::BulkExports::ExportInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/bulk_exports/export.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) ⇒ ExportInstance

Initialize the ExportInstance

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



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 128

def initialize(version, payload, resource_type: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'resource_type' => payload['resource_type'],
      'url' => payload['url'],
      'links' => payload['links'],
  }

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

Instance Method Details

#contextExportContext

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

Returns:



147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 147

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

#daysdays

Access the days

Returns:



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

def days
  context.days
end

#fetchExportInstance

Fetch a ExportInstance

Returns:



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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



195
196
197
198
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 195

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

Returns The links.

Returns:

  • (String)

    The links



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

def links
  @properties['links']
end

#resource_typeString

Returns The resource_type.

Returns:

  • (String)

    The resource_type



156
157
158
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 156

def resource_type
  @properties['resource_type']
end

#to_sObject

Provide a user friendly representation



188
189
190
191
# File 'lib/twilio-ruby/rest/preview/bulk_exports/export.rb', line 188

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

#urlString

Returns The url.

Returns:

  • (String)

    The url



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

def url
  @properties['url']
end