vellum_ai 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +24 -0
  4. data/lib/vellum_ai/types/audio_input.rb +75 -0
  5. data/lib/vellum_ai/types/code_executor_input.rb +64 -0
  6. data/lib/vellum_ai/types/document_input.rb +75 -0
  7. data/lib/vellum_ai/types/image_input.rb +75 -0
  8. data/lib/vellum_ai/types/named_scenario_input_audio_variable_value_request.rb +76 -0
  9. data/lib/vellum_ai/types/named_scenario_input_document_variable_value_request.rb +76 -0
  10. data/lib/vellum_ai/types/named_scenario_input_image_variable_value_request.rb +76 -0
  11. data/lib/vellum_ai/types/named_scenario_input_request.rb +64 -0
  12. data/lib/vellum_ai/types/named_scenario_input_video_variable_value_request.rb +76 -0
  13. data/lib/vellum_ai/types/named_test_case_audio_variable_value.rb +75 -0
  14. data/lib/vellum_ai/types/named_test_case_audio_variable_value_request.rb +76 -0
  15. data/lib/vellum_ai/types/named_test_case_document_variable_value.rb +74 -0
  16. data/lib/vellum_ai/types/named_test_case_document_variable_value_request.rb +76 -0
  17. data/lib/vellum_ai/types/named_test_case_image_variable_value.rb +74 -0
  18. data/lib/vellum_ai/types/named_test_case_image_variable_value_request.rb +75 -0
  19. data/lib/vellum_ai/types/named_test_case_variable_value.rb +64 -0
  20. data/lib/vellum_ai/types/named_test_case_variable_value_request.rb +64 -0
  21. data/lib/vellum_ai/types/named_test_case_video_variable_value.rb +74 -0
  22. data/lib/vellum_ai/types/named_test_case_video_variable_value_request.rb +75 -0
  23. data/lib/vellum_ai/types/node_execution_span_attributes.rb +11 -2
  24. data/lib/vellum_ai/types/scenario_input.rb +64 -0
  25. data/lib/vellum_ai/types/scenario_input_audio_variable_value.rb +74 -0
  26. data/lib/vellum_ai/types/scenario_input_document_variable_value.rb +74 -0
  27. data/lib/vellum_ai/types/scenario_input_image_variable_value.rb +74 -0
  28. data/lib/vellum_ai/types/scenario_input_video_variable_value.rb +74 -0
  29. data/lib/vellum_ai/types/span_link.rb +3 -3
  30. data/lib/vellum_ai/types/span_link_type_enum.rb +10 -1
  31. data/lib/vellum_ai/types/test_case_audio_variable_value.rb +84 -0
  32. data/lib/vellum_ai/types/test_case_document_variable_value.rb +84 -0
  33. data/lib/vellum_ai/types/test_case_image_variable_value.rb +84 -0
  34. data/lib/vellum_ai/types/test_case_variable_value.rb +64 -0
  35. data/lib/vellum_ai/types/test_case_video_variable_value.rb +84 -0
  36. data/lib/vellum_ai/types/video_input.rb +75 -0
  37. data/lib/vellum_ai/types/workflow_push_deployment_config_request.rb +9 -2
  38. data/lib/vellum_ai/workflows/client.rb +12 -4
  39. metadata +26 -2
@@ -3,6 +3,10 @@ require "json"
3
3
  require_relative "named_scenario_input_string_variable_value_request"
4
4
  require_relative "named_scenario_input_json_variable_value_request"
5
5
  require_relative "named_scenario_input_chat_history_variable_value_request"
6
+ require_relative "named_scenario_input_audio_variable_value_request"
7
+ require_relative "named_scenario_input_video_variable_value_request"
8
+ require_relative "named_scenario_input_image_variable_value_request"
9
+ require_relative "named_scenario_input_document_variable_value_request"
6
10
 
7
11
  module Vellum
8
12
  class NamedScenarioInputRequest
@@ -40,6 +44,46 @@ end
40
44
  return Vellum::NamedScenarioInputChatHistoryVariableValueRequest.from_json(json_object: struct)
41
45
  else
42
46
  return nil
47
+ end
48
+ rescue StandardError
49
+ # noop
50
+ end
51
+ begin
52
+ Vellum::NamedScenarioInputAudioVariableValueRequest.validate_raw(obj: struct)
53
+ unless struct.nil?
54
+ return Vellum::NamedScenarioInputAudioVariableValueRequest.from_json(json_object: struct)
55
+ else
56
+ return nil
57
+ end
58
+ rescue StandardError
59
+ # noop
60
+ end
61
+ begin
62
+ Vellum::NamedScenarioInputVideoVariableValueRequest.validate_raw(obj: struct)
63
+ unless struct.nil?
64
+ return Vellum::NamedScenarioInputVideoVariableValueRequest.from_json(json_object: struct)
65
+ else
66
+ return nil
67
+ end
68
+ rescue StandardError
69
+ # noop
70
+ end
71
+ begin
72
+ Vellum::NamedScenarioInputImageVariableValueRequest.validate_raw(obj: struct)
73
+ unless struct.nil?
74
+ return Vellum::NamedScenarioInputImageVariableValueRequest.from_json(json_object: struct)
75
+ else
76
+ return nil
77
+ end
78
+ rescue StandardError
79
+ # noop
80
+ end
81
+ begin
82
+ Vellum::NamedScenarioInputDocumentVariableValueRequest.validate_raw(obj: struct)
83
+ unless struct.nil?
84
+ return Vellum::NamedScenarioInputDocumentVariableValueRequest.from_json(json_object: struct)
85
+ else
86
+ return nil
43
87
  end
44
88
  rescue StandardError
45
89
  # noop
@@ -68,6 +112,26 @@ end
68
112
  rescue StandardError
69
113
  # noop
70
114
  end
115
+ begin
116
+ return Vellum::NamedScenarioInputAudioVariableValueRequest.validate_raw(obj: obj)
117
+ rescue StandardError
118
+ # noop
119
+ end
120
+ begin
121
+ return Vellum::NamedScenarioInputVideoVariableValueRequest.validate_raw(obj: obj)
122
+ rescue StandardError
123
+ # noop
124
+ end
125
+ begin
126
+ return Vellum::NamedScenarioInputImageVariableValueRequest.validate_raw(obj: obj)
127
+ rescue StandardError
128
+ # noop
129
+ end
130
+ begin
131
+ return Vellum::NamedScenarioInputDocumentVariableValueRequest.validate_raw(obj: obj)
132
+ rescue StandardError
133
+ # noop
134
+ end
71
135
  raise("Passed value matched no type within the union, validation failed.")
72
136
  end
73
137
  end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_video_request"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedScenarioInputVideoVariableValueRequest
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumVideoRequest]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumVideoRequest]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedScenarioInputVideoVariableValueRequest]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of
35
+ # NamedScenarioInputVideoVariableValueRequest
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::NamedScenarioInputVideoVariableValueRequest]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ unless parsed_json["value"].nil?
44
+ value = parsed_json["value"].to_json
45
+ value = Vellum::VellumVideoRequest.from_json(json_object: value)
46
+ else
47
+ value = nil
48
+ end
49
+ name = parsed_json["name"]
50
+ new(
51
+ type: type,
52
+ value: value,
53
+ name: name,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+ # Serialize an instance of NamedScenarioInputVideoVariableValueRequest to a JSON
58
+ # object
59
+ #
60
+ # @return [String]
61
+ def to_json
62
+ @_field_set&.to_json
63
+ end
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
72
+ Vellum::VellumVideoRequest.validate_raw(obj: obj.value)
73
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_audio"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Named Test Case value that is of type AUDIO
8
+ class NamedTestCaseAudioVariableValue
9
+ # @return [String]
10
+ attr_reader :type
11
+ # @return [Vellum::VellumAudio]
12
+ attr_reader :value
13
+ # @return [String]
14
+ attr_reader :name
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param type [String]
24
+ # @param value [Vellum::VellumAudio]
25
+ # @param name [String]
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [Vellum::NamedTestCaseAudioVariableValue]
28
+ def initialize(type:, value:, name:, additional_properties: nil)
29
+ @type = type
30
+ @value = value
31
+ @name = name
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "type": type, "value": value, "name": name }
34
+ end
35
+ # Deserialize a JSON object to an instance of NamedTestCaseAudioVariableValue
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::NamedTestCaseAudioVariableValue]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ unless parsed_json["value"].nil?
44
+ value = parsed_json["value"].to_json
45
+ value = Vellum::VellumAudio.from_json(json_object: value)
46
+ else
47
+ value = nil
48
+ end
49
+ name = parsed_json["name"]
50
+ new(
51
+ type: type,
52
+ value: value,
53
+ name: name,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+ # Serialize an instance of NamedTestCaseAudioVariableValue to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json
61
+ @_field_set&.to_json
62
+ end
63
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
64
+ # hash and check each fields type against the current object's property
65
+ # definitions.
66
+ #
67
+ # @param obj [Object]
68
+ # @return [Void]
69
+ def self.validate_raw(obj:)
70
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
71
+ Vellum::VellumAudio.validate_raw(obj: obj.value)
72
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_audio_request"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Named Test Case value that is of type AUDIO
8
+ class NamedTestCaseAudioVariableValueRequest
9
+ # @return [String]
10
+ attr_reader :type
11
+ # @return [Vellum::VellumAudioRequest]
12
+ attr_reader :value
13
+ # @return [String]
14
+ attr_reader :name
15
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
16
+ attr_reader :additional_properties
17
+ # @return [Object]
18
+ attr_reader :_field_set
19
+ protected :_field_set
20
+
21
+ OMIT = Object.new
22
+
23
+ # @param type [String]
24
+ # @param value [Vellum::VellumAudioRequest]
25
+ # @param name [String]
26
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
27
+ # @return [Vellum::NamedTestCaseAudioVariableValueRequest]
28
+ def initialize(type:, value:, name:, additional_properties: nil)
29
+ @type = type
30
+ @value = value
31
+ @name = name
32
+ @additional_properties = additional_properties
33
+ @_field_set = { "type": type, "value": value, "name": name }
34
+ end
35
+ # Deserialize a JSON object to an instance of
36
+ # NamedTestCaseAudioVariableValueRequest
37
+ #
38
+ # @param json_object [String]
39
+ # @return [Vellum::NamedTestCaseAudioVariableValueRequest]
40
+ def self.from_json(json_object:)
41
+ struct = JSON.parse(json_object, object_class: OpenStruct)
42
+ parsed_json = JSON.parse(json_object)
43
+ type = parsed_json["type"]
44
+ unless parsed_json["value"].nil?
45
+ value = parsed_json["value"].to_json
46
+ value = Vellum::VellumAudioRequest.from_json(json_object: value)
47
+ else
48
+ value = nil
49
+ end
50
+ name = parsed_json["name"]
51
+ new(
52
+ type: type,
53
+ value: value,
54
+ name: name,
55
+ additional_properties: struct
56
+ )
57
+ end
58
+ # Serialize an instance of NamedTestCaseAudioVariableValueRequest to a JSON object
59
+ #
60
+ # @return [String]
61
+ def to_json
62
+ @_field_set&.to_json
63
+ end
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
72
+ Vellum::VellumAudioRequest.validate_raw(obj: obj.value)
73
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_document"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseDocumentVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumDocument]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumDocument]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseDocumentVariableValue]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of NamedTestCaseDocumentVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::NamedTestCaseDocumentVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumDocument.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ name = parsed_json["name"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ name: name,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of NamedTestCaseDocumentVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumDocument.validate_raw(obj: obj.value)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_document_request"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseDocumentVariableValueRequest
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumDocumentRequest]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumDocumentRequest]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseDocumentVariableValueRequest]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of
35
+ # NamedTestCaseDocumentVariableValueRequest
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::NamedTestCaseDocumentVariableValueRequest]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ unless parsed_json["value"].nil?
44
+ value = parsed_json["value"].to_json
45
+ value = Vellum::VellumDocumentRequest.from_json(json_object: value)
46
+ else
47
+ value = nil
48
+ end
49
+ name = parsed_json["name"]
50
+ new(
51
+ type: type,
52
+ value: value,
53
+ name: name,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+ # Serialize an instance of NamedTestCaseDocumentVariableValueRequest to a JSON
58
+ # object
59
+ #
60
+ # @return [String]
61
+ def to_json
62
+ @_field_set&.to_json
63
+ end
64
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
65
+ # hash and check each fields type against the current object's property
66
+ # definitions.
67
+ #
68
+ # @param obj [Object]
69
+ # @return [Void]
70
+ def self.validate_raw(obj:)
71
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
72
+ Vellum::VellumDocumentRequest.validate_raw(obj: obj.value)
73
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_image"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseImageVariableValue
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumImage]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumImage]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseImageVariableValue]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of NamedTestCaseImageVariableValue
35
+ #
36
+ # @param json_object [String]
37
+ # @return [Vellum::NamedTestCaseImageVariableValue]
38
+ def self.from_json(json_object:)
39
+ struct = JSON.parse(json_object, object_class: OpenStruct)
40
+ parsed_json = JSON.parse(json_object)
41
+ type = parsed_json["type"]
42
+ unless parsed_json["value"].nil?
43
+ value = parsed_json["value"].to_json
44
+ value = Vellum::VellumImage.from_json(json_object: value)
45
+ else
46
+ value = nil
47
+ end
48
+ name = parsed_json["name"]
49
+ new(
50
+ type: type,
51
+ value: value,
52
+ name: name,
53
+ additional_properties: struct
54
+ )
55
+ end
56
+ # Serialize an instance of NamedTestCaseImageVariableValue to a JSON object
57
+ #
58
+ # @return [String]
59
+ def to_json
60
+ @_field_set&.to_json
61
+ end
62
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
63
+ # hash and check each fields type against the current object's property
64
+ # definitions.
65
+ #
66
+ # @param obj [Object]
67
+ # @return [Void]
68
+ def self.validate_raw(obj:)
69
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
70
+ Vellum::VellumImage.validate_raw(obj: obj.value)
71
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+ require_relative "vellum_image_request"
3
+ require "ostruct"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class NamedTestCaseImageVariableValueRequest
8
+ # @return [String]
9
+ attr_reader :type
10
+ # @return [Vellum::VellumImageRequest]
11
+ attr_reader :value
12
+ # @return [String]
13
+ attr_reader :name
14
+ # @return [OpenStruct] Additional properties unmapped to the current class definition
15
+ attr_reader :additional_properties
16
+ # @return [Object]
17
+ attr_reader :_field_set
18
+ protected :_field_set
19
+
20
+ OMIT = Object.new
21
+
22
+ # @param type [String]
23
+ # @param value [Vellum::VellumImageRequest]
24
+ # @param name [String]
25
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
26
+ # @return [Vellum::NamedTestCaseImageVariableValueRequest]
27
+ def initialize(type:, value:, name:, additional_properties: nil)
28
+ @type = type
29
+ @value = value
30
+ @name = name
31
+ @additional_properties = additional_properties
32
+ @_field_set = { "type": type, "value": value, "name": name }
33
+ end
34
+ # Deserialize a JSON object to an instance of
35
+ # NamedTestCaseImageVariableValueRequest
36
+ #
37
+ # @param json_object [String]
38
+ # @return [Vellum::NamedTestCaseImageVariableValueRequest]
39
+ def self.from_json(json_object:)
40
+ struct = JSON.parse(json_object, object_class: OpenStruct)
41
+ parsed_json = JSON.parse(json_object)
42
+ type = parsed_json["type"]
43
+ unless parsed_json["value"].nil?
44
+ value = parsed_json["value"].to_json
45
+ value = Vellum::VellumImageRequest.from_json(json_object: value)
46
+ else
47
+ value = nil
48
+ end
49
+ name = parsed_json["name"]
50
+ new(
51
+ type: type,
52
+ value: value,
53
+ name: name,
54
+ additional_properties: struct
55
+ )
56
+ end
57
+ # Serialize an instance of NamedTestCaseImageVariableValueRequest to a JSON object
58
+ #
59
+ # @return [String]
60
+ def to_json
61
+ @_field_set&.to_json
62
+ end
63
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given
64
+ # hash and check each fields type against the current object's property
65
+ # definitions.
66
+ #
67
+ # @param obj [Object]
68
+ # @return [Void]
69
+ def self.validate_raw(obj:)
70
+ obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
71
+ Vellum::VellumImageRequest.validate_raw(obj: obj.value)
72
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
73
+ end
74
+ end
75
+ end
@@ -8,6 +8,10 @@ require_relative "named_test_case_search_results_variable_value"
8
8
  require_relative "named_test_case_error_variable_value"
9
9
  require_relative "named_test_case_function_call_variable_value"
10
10
  require_relative "named_test_case_array_variable_value"
11
+ require_relative "named_test_case_audio_variable_value"
12
+ require_relative "named_test_case_video_variable_value"
13
+ require_relative "named_test_case_image_variable_value"
14
+ require_relative "named_test_case_document_variable_value"
11
15
 
12
16
  module Vellum
13
17
  class NamedTestCaseVariableValue
@@ -95,6 +99,46 @@ end
95
99
  return Vellum::NamedTestCaseArrayVariableValue.from_json(json_object: struct)
96
100
  else
97
101
  return nil
102
+ end
103
+ rescue StandardError
104
+ # noop
105
+ end
106
+ begin
107
+ Vellum::NamedTestCaseAudioVariableValue.validate_raw(obj: struct)
108
+ unless struct.nil?
109
+ return Vellum::NamedTestCaseAudioVariableValue.from_json(json_object: struct)
110
+ else
111
+ return nil
112
+ end
113
+ rescue StandardError
114
+ # noop
115
+ end
116
+ begin
117
+ Vellum::NamedTestCaseVideoVariableValue.validate_raw(obj: struct)
118
+ unless struct.nil?
119
+ return Vellum::NamedTestCaseVideoVariableValue.from_json(json_object: struct)
120
+ else
121
+ return nil
122
+ end
123
+ rescue StandardError
124
+ # noop
125
+ end
126
+ begin
127
+ Vellum::NamedTestCaseImageVariableValue.validate_raw(obj: struct)
128
+ unless struct.nil?
129
+ return Vellum::NamedTestCaseImageVariableValue.from_json(json_object: struct)
130
+ else
131
+ return nil
132
+ end
133
+ rescue StandardError
134
+ # noop
135
+ end
136
+ begin
137
+ Vellum::NamedTestCaseDocumentVariableValue.validate_raw(obj: struct)
138
+ unless struct.nil?
139
+ return Vellum::NamedTestCaseDocumentVariableValue.from_json(json_object: struct)
140
+ else
141
+ return nil
98
142
  end
99
143
  rescue StandardError
100
144
  # noop
@@ -148,6 +192,26 @@ end
148
192
  rescue StandardError
149
193
  # noop
150
194
  end
195
+ begin
196
+ return Vellum::NamedTestCaseAudioVariableValue.validate_raw(obj: obj)
197
+ rescue StandardError
198
+ # noop
199
+ end
200
+ begin
201
+ return Vellum::NamedTestCaseVideoVariableValue.validate_raw(obj: obj)
202
+ rescue StandardError
203
+ # noop
204
+ end
205
+ begin
206
+ return Vellum::NamedTestCaseImageVariableValue.validate_raw(obj: obj)
207
+ rescue StandardError
208
+ # noop
209
+ end
210
+ begin
211
+ return Vellum::NamedTestCaseDocumentVariableValue.validate_raw(obj: obj)
212
+ rescue StandardError
213
+ # noop
214
+ end
151
215
  raise("Passed value matched no type within the union, validation failed.")
152
216
  end
153
217
  end