class Twilio::REST::Preview::Understand::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
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 unique ID of the parent Assistant. @param [String] sid The sid @return [ModelBuildInstance] ModelBuildInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 245 def initialize(version, payload, assistant_sid: nil, sid: nil) 246 super(version) 247 248 # Marshaled Properties 249 @properties = { 250 'account_sid' => payload['account_sid'], 251 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 252 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 253 'assistant_sid' => payload['assistant_sid'], 254 'sid' => payload['sid'], 255 'status' => payload['status'], 256 'unique_name' => payload['unique_name'], 257 'url' => payload['url'], 258 'build_duration' => payload['build_duration'] == nil ? payload['build_duration'] : payload['build_duration'].to_i, 259 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i, 260 } 261 262 # Context 263 @instance_context = nil 264 @params = {'assistant_sid' => assistant_sid, 'sid' => sid || @properties['sid'], } 265 end
Public Instance Methods
@return [String] The unique ID of the Account that created this Model Build.
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 280 def account_sid 281 @properties['account_sid'] 282 end
@return [String] The unique ID of the parent Assistant.
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 298 def assistant_sid 299 @properties['assistant_sid'] 300 end
@return [String] The time in seconds it took to build the model.
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 328 def build_duration 329 @properties['build_duration'] 330 end
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/preview/understand/assistant/model_build.rb 271 def context 272 unless @instance_context 273 @instance_context = ModelBuildContext.new(@version, @params['assistant_sid'], @params['sid'], ) 274 end 275 @instance_context 276 end
@return [Time] The date that this resource was created
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 286 def date_created 287 @properties['date_created'] 288 end
@return [Time] The date that this resource was last updated
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 292 def date_updated 293 @properties['date_updated'] 294 end
Delete the ModelBuildInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 358 def delete 359 context.delete 360 end
@return [String] The error_code
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 334 def error_code 335 @properties['error_code'] 336 end
Fetch the ModelBuildInstance
@return [ModelBuildInstance] Fetched ModelBuildInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 341 def fetch 342 context.fetch 343 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 371 def inspect 372 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 373 "<Twilio.Preview.Understand.ModelBuildInstance #{values}>" 374 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 304 def sid 305 @properties['sid'] 306 end
@return [model_build.Status] A string that described the model build status. The values can be: enqueued, building, completed, failed
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 310 def status 311 @properties['status'] 312 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 364 def to_s 365 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 366 "<Twilio.Preview.Understand.ModelBuildInstance #{values}>" 367 end
@return [String] A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 316 def unique_name 317 @properties['unique_name'] 318 end
Update the ModelBuildInstance
@param [String] unique_name
A user-provided string that uniquely identifies this
resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1
@return [ModelBuildInstance] Updated ModelBuildInstance
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 351 def update(unique_name: :unset) 352 context.update(unique_name: unique_name, ) 353 end
@return [String] The url
# File lib/twilio-ruby/rest/preview/understand/assistant/model_build.rb 322 def url 323 @properties['url'] 324 end