Class: Twilio::REST::Autopilot::V1::AssistantContext::ExportAssistantInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.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, assistant_sid: nil) ⇒ ExportAssistantInstance

Initialize the ExportAssistantInstance

Parameters:



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 125

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

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'assistant_sid' => payload['assistant_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'status' => payload['status'],
      'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
      'url' => payload['url'],
      'schema' => payload['schema'],
  }

  # Context
  @instance_context = nil
  @params = {'assistant_sid' => assistant_sid, }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



157
158
159
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 157

def 
  @properties['account_sid']
end

#assistant_sidString

Returns The SID of the Assistant to export.

Returns:

  • (String)

    The SID of the Assistant to export.



163
164
165
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 163

def assistant_sid
  @properties['assistant_sid']
end

#contextExportAssistantContext

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

Returns:



148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 148

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

#date_createdTime

Returns The RFC 2822 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT when the resource was created



169
170
171
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 169

def date_created
  @properties['date_created']
end

#error_codeString

Returns More information about why the export failed, if ‘status` is `failed`.

Returns:

  • (String)

    More information about why the export failed, if ‘status` is `failed`



181
182
183
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 181

def error_code
  @properties['error_code']
end

#fetchExportAssistantInstance

Fetch a ExportAssistantInstance

Returns:



200
201
202
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 200

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



213
214
215
216
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 213

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

#schemaHash

Returns The JSON string that describes the requested Assistant.

Returns:

  • (Hash)

    The JSON string that describes the requested Assistant.



193
194
195
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 193

def schema
  @properties['schema']
end

#statusexport_assistant.Status

Returns The status of the export.

Returns:



175
176
177
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 175

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation



206
207
208
209
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 206

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

#urlString

Returns The absolute URL of the Export resource.

Returns:

  • (String)

    The absolute URL of the Export resource.



187
188
189
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/export_assistant.rb', line 187

def url
  @properties['url']
end