Class: Vellum::PromptDeploymentReleasePromptDeployment

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, additional_properties: nil) ⇒ Vellum::PromptDeploymentReleasePromptDeployment

Parameters:

  • id (String)
  • name (String)
  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



23
24
25
26
27
28
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 23

def initialize(id:, name:, additional_properties: nil)
  @id = id
  @name = name
  @additional_properties = additional_properties
  @_field_set = { "id": id, "name": name }
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



12
13
14
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 12

def additional_properties
  @additional_properties
end

#id ⇒ String (readonly)

Returns:

  • (String)


8
9
10
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 8

def id
  @id
end

#name ⇒ String (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 10

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::PromptDeploymentReleasePromptDeployment

Parameters:

  • json_object (String)

Returns:



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 34

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  name = parsed_json["name"]
  new(
    id: id,
    name: name,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


58
59
60
61
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 58

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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


49
50
51
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_deployment.rb', line 49

def to_json
  @_field_set&.to_json
end