Class: Vellum::DeploymentRead

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/deployment_read.rb

Overview

A Prompt Deployment’s full details.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created:, label:, name:, status: OMIT, environment: OMIT, last_deployed_on:, input_variables:, description: OMIT, active_model_version_ids: OMIT, last_deployed_history_item_id:, additional_properties: nil) ⇒ Vellum::DeploymentRead

Parameters:

  • environment (Vellum::EnvironmentEnum) (defaults to: OMIT)

    Deprecated. The value returned will always be ‘PRODUCTION’.

  • last_deployed_on (DateTime)
  • input_variables (Array<Vellum::VellumVariable>)
  • description (String) (defaults to: OMIT)

    A human-readable description of the deployment

  • active_model_version_ids (Array<String>) (defaults to: OMIT)

    Deprecated. This now always returns an empty array.

  • last_deployed_history_item_id (String)

    The ID of the history item associated with this Deployment’s LATEST Release Tag

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/vellum_ai/types/deployment_read.rb', line 60

def initialize(id:, created:, label:, name:, status: OMIT, environment: OMIT, last_deployed_on:, input_variables:, description: OMIT, active_model_version_ids: OMIT, last_deployed_history_item_id:, additional_properties: nil)
  @id = id
  @created = created
  @label = label
  @name = name
  @status = status if status != OMIT
  @environment = environment if environment != OMIT
  @last_deployed_on = last_deployed_on
  @input_variables = input_variables
  @description = description if description != OMIT
  @active_model_version_ids = active_model_version_ids if active_model_version_ids != OMIT
  @last_deployed_history_item_id = last_deployed_history_item_id
  @additional_properties = additional_properties
  @_field_set = { "id": id, "created": created, "label": label, "name": name, "status": status, "environment": environment, "last_deployed_on": last_deployed_on, "input_variables": input_variables, "description": description, "active_model_version_ids": active_model_version_ids, "last_deployed_history_item_id": last_deployed_history_item_id }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#active_model_version_idsArray<String> (readonly)

Returns Deprecated. This now always returns an empty array.

Returns:

  • (Array<String>)

    Deprecated. This now always returns an empty array.



34
35
36
# File 'lib/vellum_ai/types/deployment_read.rb', line 34

def active_model_version_ids
  @active_model_version_ids
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



38
39
40
# File 'lib/vellum_ai/types/deployment_read.rb', line 38

def additional_properties
  @additional_properties
end

#createdDateTime (readonly)

Returns:

  • (DateTime)


16
17
18
# File 'lib/vellum_ai/types/deployment_read.rb', line 16

def created
  @created
end

#descriptionString (readonly)

Returns A human-readable description of the deployment.

Returns:

  • (String)

    A human-readable description of the deployment



32
33
34
# File 'lib/vellum_ai/types/deployment_read.rb', line 32

def description
  @description
end

#environmentVellum::EnvironmentEnum (readonly)

Returns Deprecated. The value returned will always be ‘PRODUCTION’.

Returns:



26
27
28
# File 'lib/vellum_ai/types/deployment_read.rb', line 26

def environment
  @environment
end

#idString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/vellum_ai/types/deployment_read.rb', line 14

def id
  @id
end

#input_variablesArray<Vellum::VellumVariable> (readonly)

Returns:



30
31
32
# File 'lib/vellum_ai/types/deployment_read.rb', line 30

def input_variables
  @input_variables
end

#labelString (readonly)

Returns A human-readable label for the deployment.

Returns:

  • (String)

    A human-readable label for the deployment



18
19
20
# File 'lib/vellum_ai/types/deployment_read.rb', line 18

def label
  @label
end

#last_deployed_history_item_idString (readonly)

Returns The ID of the history item associated with this Deployment’s LATEST Release Tag.

Returns:

  • (String)

    The ID of the history item associated with this Deployment’s LATEST Release Tag



36
37
38
# File 'lib/vellum_ai/types/deployment_read.rb', line 36

def last_deployed_history_item_id
  @last_deployed_history_item_id
end

#last_deployed_onDateTime (readonly)

Returns:

  • (DateTime)


28
29
30
# File 'lib/vellum_ai/types/deployment_read.rb', line 28

def last_deployed_on
  @last_deployed_on
end

#nameString (readonly)

Returns A name that uniquely identifies this deployment within its workspace.

Returns:

  • (String)

    A name that uniquely identifies this deployment within its workspace



20
21
22
# File 'lib/vellum_ai/types/deployment_read.rb', line 20

def name
  @name
end

#statusObject (readonly)

  • ‘ARCHIVED` - Archived



24
25
26
# File 'lib/vellum_ai/types/deployment_read.rb', line 24

def status
  @status
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::DeploymentRead

Parameters:

  • json_object (String)

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/vellum_ai/types/deployment_read.rb', line 81

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  created = unless parsed_json["created"].nil?
  DateTime.parse(parsed_json["created"])
else
  nil
end
  label = parsed_json["label"]
  name = parsed_json["name"]
  status = parsed_json["status"]
  environment = parsed_json["environment"]
  last_deployed_on = unless parsed_json["last_deployed_on"].nil?
  DateTime.parse(parsed_json["last_deployed_on"])
else
  nil
end
  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"]
  active_model_version_ids = parsed_json["active_model_version_ids"]
  last_deployed_history_item_id = parsed_json["last_deployed_history_item_id"]
  new(
    id: id,
    created: created,
    label: label,
    name: name,
    status: status,
    environment: environment,
    last_deployed_on: last_deployed_on,
    input_variables: input_variables,
    description: description,
    active_model_version_ids: active_model_version_ids,
    last_deployed_history_item_id: last_deployed_history_item_id,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/vellum_ai/types/deployment_read.rb', line 133

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.created.is_a?(DateTime) != false || raise("Passed value for field obj.created 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.status&.is_a?(Vellum::EntityStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.environment&.is_a?(Vellum::EnvironmentEnum) != false || raise("Passed value for field obj.environment is not the expected type, validation failed.")
  obj.last_deployed_on.is_a?(DateTime) != false || raise("Passed value for field obj.last_deployed_on 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.")
  obj.active_model_version_ids&.is_a?(Array) != false || raise("Passed value for field obj.active_model_version_ids is not the expected type, validation failed.")
  obj.last_deployed_history_item_id.is_a?(String) != false || raise("Passed value for field obj.last_deployed_history_item_id is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


124
125
126
# File 'lib/vellum_ai/types/deployment_read.rb', line 124

def to_json
  @_field_set&.to_json
end