Class: Vellum::DeploymentHistoryItem
- Inherits:
-
Object
- Object
- Vellum::DeploymentHistoryItem
- Defined in:
- lib/vellum_ai/types/deployment_history_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #deployment_id ⇒ String readonly
-
#description ⇒ String
readonly
A human-readable description of the deployment.
- #id ⇒ String readonly
- #input_variables ⇒ Array<Vellum::VellumVariable> readonly
-
#label ⇒ String
readonly
A human-readable label for the deployment.
-
#name ⇒ String
readonly
A name that uniquely identifies this deployment within its workspace.
- #timestamp ⇒ DateTime readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(id:, deployment_id:, timestamp:, label:, name:, input_variables:, description: OMIT, additional_properties: nil) ⇒ Vellum::DeploymentHistoryItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(id:, deployment_id:, timestamp:, label:, name:, input_variables:, description: OMIT, additional_properties: nil) ⇒ Vellum::DeploymentHistoryItem
40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 40 def initialize(id:, deployment_id:, timestamp:, label:, name:, input_variables:, description: OMIT, additional_properties: nil) @id = id @deployment_id = deployment_id = @label = label @name = name @input_variables = input_variables @description = description if description != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "deployment_id": deployment_id, "timestamp": , "label": label, "name": name, "input_variables": input_variables, "description": description }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 24 def additional_properties @additional_properties end |
#deployment_id ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 12 def deployment_id @deployment_id end |
#description ⇒ String (readonly)
Returns A human-readable description of the deployment.
22 23 24 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 22 def description @description end |
#id ⇒ String (readonly)
10 11 12 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 10 def id @id end |
#input_variables ⇒ Array<Vellum::VellumVariable> (readonly)
20 21 22 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 20 def input_variables @input_variables end |
#label ⇒ String (readonly)
Returns A human-readable label for the deployment.
16 17 18 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 16 def label @label end |
#name ⇒ String (readonly)
Returns A name that uniquely identifies this deployment within its workspace.
18 19 20 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 18 def name @name end |
#timestamp ⇒ DateTime (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 14 def end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::DeploymentHistoryItem
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] deployment_id = parsed_json["deployment_id"] = unless parsed_json["timestamp"].nil? DateTime.parse(parsed_json["timestamp"]) else nil end label = parsed_json["label"] name = parsed_json["name"] input_variables = parsed_json["input_variables"]&.map do | item | item = item.to_json Vellum::VellumVariable.from_json(json_object: item) end description = parsed_json["description"] new( id: id, deployment_id: deployment_id, timestamp: , label: label, name: name, input_variables: input_variables, description: description, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
97 98 99 100 101 102 103 104 105 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 97 def self.validate_raw(obj:) obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.deployment_id.is_a?(String) != false || raise("Passed value for field obj.deployment_id is not the expected type, validation failed.") obj..is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.") obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.") obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.input_variables.is_a?(Array) != false || raise("Passed value for field obj.input_variables is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
88 89 90 |
# File 'lib/vellum_ai/types/deployment_history_item.rb', line 88 def to_json @_field_set&.to_json end |