class Twilio::REST::Autopilot::V1::AssistantContext::ModelBuildInstance

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 help@twilio.com.

Public Class Methods

new(version, payload, assistant_sid: nil, sid: nil) click to toggle source

Initialize the ModelBuildInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] assistant_sid The SID of the

{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
parent of the resource.

@param [String] sid The Twilio-provided string that uniquely identifies the

ModelBuild resource to fetch.

@return [ModelBuildInstance] ModelBuildInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
256 def initialize(version, payload, assistant_sid: nil, sid: nil)
257   super(version)
258 
259   # Marshaled Properties
260   @properties = {
261       'account_sid' => payload['account_sid'],
262       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
263       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
264       'assistant_sid' => payload['assistant_sid'],
265       'sid' => payload['sid'],
266       'status' => payload['status'],
267       'unique_name' => payload['unique_name'],
268       'url' => payload['url'],
269       'build_duration' => payload['build_duration'] == nil ? payload['build_duration'] : payload['build_duration'].to_i,
270       'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
271   }
272 
273   # Context
274   @instance_context = nil
275   @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], }
276 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
291 def account_sid
292   @properties['account_sid']
293 end
assistant_sid() click to toggle source

@return [String] The SID of the Assistant that is the parent of the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
309 def assistant_sid
310   @properties['assistant_sid']
311 end
build_duration() click to toggle source

@return [String] The time in seconds it took to build the model

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
339 def build_duration
340   @properties['build_duration']
341 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ModelBuildContext] ModelBuildContext for this ModelBuildInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
282 def context
283   unless @instance_context
284     @instance_context = ModelBuildContext.new(@version, @params['assistant_sid'], @params['sid'], )
285   end
286   @instance_context
287 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
297 def date_created
298   @properties['date_created']
299 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
303 def date_updated
304   @properties['date_updated']
305 end
delete() click to toggle source

Delete the ModelBuildInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
370 def delete
371   context.delete
372 end
error_code() click to toggle source

@return [String] More information about why the model build failed, if `status` is `failed`

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
345 def error_code
346   @properties['error_code']
347 end
fetch() click to toggle source

Fetch the ModelBuildInstance @return [ModelBuildInstance] Fetched ModelBuildInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
352 def fetch
353   context.fetch
354 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
383 def inspect
384   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
385   "<Twilio.Autopilot.V1.ModelBuildInstance #{values}>"
386 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
315 def sid
316   @properties['sid']
317 end
status() click to toggle source

@return [model_build.Status] The status of the model build process

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
321 def status
322   @properties['status']
323 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
376 def to_s
377   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
378   "<Twilio.Autopilot.V1.ModelBuildInstance #{values}>"
379 end
unique_name() click to toggle source

@return [String] An application-defined string that uniquely identifies the resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
327 def unique_name
328   @properties['unique_name']
329 end
update(unique_name: :unset) click to toggle source

Update the ModelBuildInstance @param [String] unique_name An application-defined string that uniquely

identifies the resource. This value must be a unique string of no more than 64
characters. It can be used as an alternative to the `sid` in the URL path to
address the resource.

@return [ModelBuildInstance] Updated ModelBuildInstance

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
363 def update(unique_name: :unset)
364   context.update(unique_name: unique_name, )
365 end
url() click to toggle source

@return [String] The absolute URL of the ModelBuild resource

    # File lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb
333 def url
334   @properties['url']
335 end