vellum_ai 0.3.12 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/requests.rb +2 -2
  3. data/lib/types_export.rb +30 -0
  4. data/lib/vellum_ai/test_suite_runs/client.rb +149 -0
  5. data/lib/vellum_ai/types/paginated_test_suite_run_execution_list.rb +64 -0
  6. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config.rb +57 -0
  7. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data.rb +50 -0
  8. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_data_request.rb +50 -0
  9. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_request.rb +57 -0
  10. data/lib/vellum_ai/types/test_suite_run_deployment_release_tag_exec_config_type_enum.rb +5 -0
  11. data/lib/vellum_ai/types/test_suite_run_exec_config.rb +90 -0
  12. data/lib/vellum_ai/types/test_suite_run_exec_config_request.rb +90 -0
  13. data/lib/vellum_ai/types/test_suite_run_execution.rb +69 -0
  14. data/lib/vellum_ai/types/test_suite_run_execution_chat_history_output.rb +54 -0
  15. data/lib/vellum_ai/types/test_suite_run_execution_error_output.rb +56 -0
  16. data/lib/vellum_ai/types/test_suite_run_execution_json_output.rb +50 -0
  17. data/lib/vellum_ai/types/test_suite_run_execution_metric_result.rb +54 -0
  18. data/lib/vellum_ai/types/test_suite_run_execution_number_output.rb +50 -0
  19. data/lib/vellum_ai/types/test_suite_run_execution_output.rb +142 -0
  20. data/lib/vellum_ai/types/test_suite_run_execution_search_results_output.rb +54 -0
  21. data/lib/vellum_ai/types/test_suite_run_execution_string_output.rb +50 -0
  22. data/lib/vellum_ai/types/test_suite_run_metric_error_output.rb +57 -0
  23. data/lib/vellum_ai/types/test_suite_run_metric_error_output_type_enum.rb +5 -0
  24. data/lib/vellum_ai/types/test_suite_run_metric_number_output.rb +51 -0
  25. data/lib/vellum_ai/types/test_suite_run_metric_number_output_type_enum.rb +5 -0
  26. data/lib/vellum_ai/types/test_suite_run_metric_output.rb +90 -0
  27. data/lib/vellum_ai/types/test_suite_run_read.rb +96 -0
  28. data/lib/vellum_ai/types/test_suite_run_state.rb +12 -0
  29. data/lib/vellum_ai/types/test_suite_run_test_suite.rb +55 -0
  30. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config.rb +57 -0
  31. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data.rb +50 -0
  32. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_data_request.rb +50 -0
  33. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_request.rb +57 -0
  34. data/lib/vellum_ai/types/test_suite_run_workflow_release_tag_exec_config_type_enum.rb +5 -0
  35. data/lib/vellum_ai/types/workflow_output_array.rb +2 -2
  36. data/lib/vellum_ai/types/workflow_output_chat_history.rb +2 -2
  37. data/lib/vellum_ai/types/workflow_output_error.rb +2 -2
  38. data/lib/vellum_ai/types/workflow_output_function_call.rb +2 -2
  39. data/lib/vellum_ai/types/workflow_output_image.rb +2 -2
  40. data/lib/vellum_ai/types/workflow_output_json.rb +2 -2
  41. data/lib/vellum_ai/types/workflow_output_number.rb +2 -2
  42. data/lib/vellum_ai/types/workflow_output_search_results.rb +2 -2
  43. data/lib/vellum_ai/types/workflow_output_string.rb +2 -2
  44. data/lib/vellum_ai.rb +5 -2
  45. metadata +33 -2
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "vellum_error"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Output for a test suite run metric that is of type ERROR
8
+ class TestSuiteRunMetricErrorOutput
9
+ attr_reader :value, :name, :additional_properties
10
+
11
+ # @param value [VellumError]
12
+ # @param name [String]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [TestSuiteRunMetricErrorOutput]
15
+ def initialize(value:, name:, additional_properties: nil)
16
+ # @type [VellumError]
17
+ @value = value
18
+ # @type [String]
19
+ @name = name
20
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
21
+ @additional_properties = additional_properties
22
+ end
23
+
24
+ # Deserialize a JSON object to an instance of TestSuiteRunMetricErrorOutput
25
+ #
26
+ # @param json_object [JSON]
27
+ # @return [TestSuiteRunMetricErrorOutput]
28
+ def self.from_json(json_object:)
29
+ struct = JSON.parse(json_object, object_class: OpenStruct)
30
+ parsed_json = JSON.parse(json_object)
31
+ if parsed_json["value"].nil?
32
+ value = nil
33
+ else
34
+ value = parsed_json["value"].to_json
35
+ value = VellumError.from_json(json_object: value)
36
+ end
37
+ name = struct.name
38
+ new(value: value, name: name, additional_properties: struct)
39
+ end
40
+
41
+ # Serialize an instance of TestSuiteRunMetricErrorOutput to a JSON object
42
+ #
43
+ # @return [JSON]
44
+ def to_json(*_args)
45
+ { "value": @value, "name": @name }.to_json
46
+ end
47
+
48
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
49
+ #
50
+ # @param obj [Object]
51
+ # @return [Void]
52
+ def self.validate_raw(obj:)
53
+ VellumError.validate_raw(obj: obj.value)
54
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ TEST_SUITE_RUN_METRIC_ERROR_OUTPUT_TYPE_ENUM = String
5
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ # Output for a test suite run metric that is of type NUMBER
7
+ class TestSuiteRunMetricNumberOutput
8
+ attr_reader :value, :name, :additional_properties
9
+
10
+ # @param value [Float]
11
+ # @param name [String]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [TestSuiteRunMetricNumberOutput]
14
+ def initialize(value:, name:, additional_properties: nil)
15
+ # @type [Float]
16
+ @value = value
17
+ # @type [String]
18
+ @name = name
19
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
20
+ @additional_properties = additional_properties
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of TestSuiteRunMetricNumberOutput
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [TestSuiteRunMetricNumberOutput]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ JSON.parse(json_object)
30
+ value = struct.value
31
+ name = struct.name
32
+ new(value: value, name: name, additional_properties: struct)
33
+ end
34
+
35
+ # Serialize an instance of TestSuiteRunMetricNumberOutput to a JSON object
36
+ #
37
+ # @return [JSON]
38
+ def to_json(*_args)
39
+ { "value": @value, "name": @name }.to_json
40
+ end
41
+
42
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
43
+ #
44
+ # @param obj [Object]
45
+ # @return [Void]
46
+ def self.validate_raw(obj:)
47
+ obj.value.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
48
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ TEST_SUITE_RUN_METRIC_NUMBER_OUTPUT_TYPE_ENUM = String
5
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "test_suite_run_metric_number_output"
5
+ require_relative "test_suite_run_metric_error_output"
6
+
7
+ module Vellum
8
+ class TestSuiteRunMetricOutput
9
+ attr_reader :member, :discriminant
10
+
11
+ private_class_method :new
12
+ alias kind_of? is_a?
13
+ # @param member [Object]
14
+ # @param discriminant [String]
15
+ # @return [TestSuiteRunMetricOutput]
16
+ def initialize(member:, discriminant:)
17
+ # @type [Object]
18
+ @member = member
19
+ # @type [String]
20
+ @discriminant = discriminant
21
+ end
22
+
23
+ # Deserialize a JSON object to an instance of TestSuiteRunMetricOutput
24
+ #
25
+ # @param json_object [JSON]
26
+ # @return [TestSuiteRunMetricOutput]
27
+ def self.from_json(json_object:)
28
+ struct = JSON.parse(json_object, object_class: OpenStruct)
29
+ member = case struct.type
30
+ when "NUMBER"
31
+ TestSuiteRunMetricNumberOutput.from_json(json_object: json_object)
32
+ when "ERROR"
33
+ TestSuiteRunMetricErrorOutput.from_json(json_object: json_object)
34
+ else
35
+ TestSuiteRunMetricNumberOutput.from_json(json_object: json_object)
36
+ end
37
+ new(member: member, discriminant: struct.type)
38
+ end
39
+
40
+ # For Union Types, to_json functionality is delegated to the wrapped member.
41
+ #
42
+ # @return [JSON]
43
+ def to_json(*_args)
44
+ case @discriminant
45
+ when "NUMBER"
46
+ { **@member.to_json, type: @discriminant }.to_json
47
+ when "ERROR"
48
+ { **@member.to_json, type: @discriminant }.to_json
49
+ else
50
+ { "type": @discriminant, value: @member }.to_json
51
+ end
52
+ @member.to_json
53
+ end
54
+
55
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
56
+ #
57
+ # @param obj [Object]
58
+ # @return [Void]
59
+ def self.validate_raw(obj:)
60
+ case obj.type
61
+ when "NUMBER"
62
+ TestSuiteRunMetricNumberOutput.validate_raw(obj: obj)
63
+ when "ERROR"
64
+ TestSuiteRunMetricErrorOutput.validate_raw(obj: obj)
65
+ else
66
+ raise("Passed value matched no type within the union, validation failed.")
67
+ end
68
+ end
69
+
70
+ # For Union Types, is_a? functionality is delegated to the wrapped member.
71
+ #
72
+ # @param obj [Object]
73
+ # @return [Boolean]
74
+ def is_a?(obj)
75
+ @member.is_a?(obj)
76
+ end
77
+
78
+ # @param member [TestSuiteRunMetricNumberOutput]
79
+ # @return [TestSuiteRunMetricOutput]
80
+ def self.number(member:)
81
+ new(member: member, discriminant: "NUMBER")
82
+ end
83
+
84
+ # @param member [TestSuiteRunMetricErrorOutput]
85
+ # @return [TestSuiteRunMetricOutput]
86
+ def self.error(member:)
87
+ new(member: member, discriminant: "ERROR")
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,96 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "date"
4
+ require_relative "test_suite_run_test_suite"
5
+ require_relative "test_suite_run_state"
6
+ require_relative "test_suite_run_exec_config"
7
+ require "json"
8
+
9
+ module Vellum
10
+ class TestSuiteRunRead
11
+ attr_reader :id, :created, :test_suite, :state, :exec_config, :additional_properties
12
+
13
+ # @param id [String]
14
+ # @param created [DateTime]
15
+ # @param test_suite [TestSuiteRunTestSuite]
16
+ # @param state [TEST_SUITE_RUN_STATE] The current state of this run
17
+ # - `QUEUED` - Queued
18
+ # - `RUNNING` - Running
19
+ # - `COMPLETE` - Complete
20
+ # - `FAILED` - Failed
21
+ # - `CANCELLED` - Cancelled
22
+ # @param exec_config [TestSuiteRunExecConfig] Configuration that defines how the Test Suite should be run
23
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
24
+ # @return [TestSuiteRunRead]
25
+ def initialize(id:, created:, test_suite:, state: nil, exec_config: nil, additional_properties: nil)
26
+ # @type [String]
27
+ @id = id
28
+ # @type [DateTime]
29
+ @created = created
30
+ # @type [TestSuiteRunTestSuite]
31
+ @test_suite = test_suite
32
+ # @type [TEST_SUITE_RUN_STATE] The current state of this run
33
+ # - `QUEUED` - Queued
34
+ # - `RUNNING` - Running
35
+ # - `COMPLETE` - Complete
36
+ # - `FAILED` - Failed
37
+ # - `CANCELLED` - Cancelled
38
+ @state = state
39
+ # @type [TestSuiteRunExecConfig] Configuration that defines how the Test Suite should be run
40
+ @exec_config = exec_config
41
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
42
+ @additional_properties = additional_properties
43
+ end
44
+
45
+ # Deserialize a JSON object to an instance of TestSuiteRunRead
46
+ #
47
+ # @param json_object [JSON]
48
+ # @return [TestSuiteRunRead]
49
+ def self.from_json(json_object:)
50
+ struct = JSON.parse(json_object, object_class: OpenStruct)
51
+ parsed_json = JSON.parse(json_object)
52
+ id = struct.id
53
+ created = DateTime.parse(parsed_json["created"])
54
+ if parsed_json["test_suite"].nil?
55
+ test_suite = nil
56
+ else
57
+ test_suite = parsed_json["test_suite"].to_json
58
+ test_suite = TestSuiteRunTestSuite.from_json(json_object: test_suite)
59
+ end
60
+ state = TEST_SUITE_RUN_STATE.key(parsed_json["state"]) || parsed_json["state"]
61
+ if parsed_json["exec_config"].nil?
62
+ exec_config = nil
63
+ else
64
+ exec_config = parsed_json["exec_config"].to_json
65
+ exec_config = TestSuiteRunExecConfig.from_json(json_object: exec_config)
66
+ end
67
+ new(id: id, created: created, test_suite: test_suite, state: state, exec_config: exec_config,
68
+ additional_properties: struct)
69
+ end
70
+
71
+ # Serialize an instance of TestSuiteRunRead to a JSON object
72
+ #
73
+ # @return [JSON]
74
+ def to_json(*_args)
75
+ {
76
+ "id": @id,
77
+ "created": @created,
78
+ "test_suite": @test_suite,
79
+ "state": TEST_SUITE_RUN_STATE[@state] || @state,
80
+ "exec_config": @exec_config
81
+ }.to_json
82
+ end
83
+
84
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
85
+ #
86
+ # @param obj [Object]
87
+ # @return [Void]
88
+ def self.validate_raw(obj:)
89
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
90
+ obj.created.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
91
+ TestSuiteRunTestSuite.validate_raw(obj: obj.test_suite)
92
+ obj.state&.is_a?(TEST_SUITE_RUN_STATE) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
93
+ obj.exec_config.nil? || TestSuiteRunExecConfig.validate_raw(obj: obj.exec_config)
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ # @type [TEST_SUITE_RUN_STATE]
5
+ TEST_SUITE_RUN_STATE = {
6
+ queued: "QUEUED",
7
+ running: "RUNNING",
8
+ complete: "COMPLETE",
9
+ failed: "FAILED",
10
+ cancelled: "CANCELLED"
11
+ }.freeze
12
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class TestSuiteRunTestSuite
7
+ attr_reader :id, :history_item_id, :label, :additional_properties
8
+
9
+ # @param id [String]
10
+ # @param history_item_id [String]
11
+ # @param label [String]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [TestSuiteRunTestSuite]
14
+ def initialize(id:, history_item_id:, label:, additional_properties: nil)
15
+ # @type [String]
16
+ @id = id
17
+ # @type [String]
18
+ @history_item_id = history_item_id
19
+ # @type [String]
20
+ @label = label
21
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
22
+ @additional_properties = additional_properties
23
+ end
24
+
25
+ # Deserialize a JSON object to an instance of TestSuiteRunTestSuite
26
+ #
27
+ # @param json_object [JSON]
28
+ # @return [TestSuiteRunTestSuite]
29
+ def self.from_json(json_object:)
30
+ struct = JSON.parse(json_object, object_class: OpenStruct)
31
+ JSON.parse(json_object)
32
+ id = struct.id
33
+ history_item_id = struct.history_item_id
34
+ label = struct.label
35
+ new(id: id, history_item_id: history_item_id, label: label, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of TestSuiteRunTestSuite to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "history_item_id": @history_item_id, "label": @label }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.history_item_id.is_a?(String) != false || raise("Passed value for field obj.history_item_id is not the expected type, validation failed.")
52
+ obj.label.is_a?(String) != false || raise("Passed value for field obj.label is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_workflow_release_tag_exec_config_data"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Execution configuration for running a Test Suite against a Workflow Deployment
8
+ class TestSuiteRunWorkflowReleaseTagExecConfig
9
+ attr_reader :data, :test_case_ids, :additional_properties
10
+
11
+ # @param data [TestSuiteRunWorkflowReleaseTagExecConfigData]
12
+ # @param test_case_ids [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfig]
15
+ def initialize(data:, test_case_ids: nil, additional_properties: nil)
16
+ # @type [TestSuiteRunWorkflowReleaseTagExecConfigData]
17
+ @data = data
18
+ # @type [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
19
+ @test_case_ids = test_case_ids
20
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
21
+ @additional_properties = additional_properties
22
+ end
23
+
24
+ # Deserialize a JSON object to an instance of TestSuiteRunWorkflowReleaseTagExecConfig
25
+ #
26
+ # @param json_object [JSON]
27
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfig]
28
+ def self.from_json(json_object:)
29
+ struct = JSON.parse(json_object, object_class: OpenStruct)
30
+ parsed_json = JSON.parse(json_object)
31
+ if parsed_json["data"].nil?
32
+ data = nil
33
+ else
34
+ data = parsed_json["data"].to_json
35
+ data = TestSuiteRunWorkflowReleaseTagExecConfigData.from_json(json_object: data)
36
+ end
37
+ test_case_ids = struct.test_case_ids
38
+ new(data: data, test_case_ids: test_case_ids, additional_properties: struct)
39
+ end
40
+
41
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfig to a JSON object
42
+ #
43
+ # @return [JSON]
44
+ def to_json(*_args)
45
+ { "data": @data, "test_case_ids": @test_case_ids }.to_json
46
+ end
47
+
48
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
49
+ #
50
+ # @param obj [Object]
51
+ # @return [Void]
52
+ def self.validate_raw(obj:)
53
+ TestSuiteRunWorkflowReleaseTagExecConfigData.validate_raw(obj: obj.data)
54
+ obj.test_case_ids&.is_a?(Array) != false || raise("Passed value for field obj.test_case_ids is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class TestSuiteRunWorkflowReleaseTagExecConfigData
7
+ attr_reader :workflow_deployment_id, :tag, :additional_properties
8
+
9
+ # @param workflow_deployment_id [String] The ID of the Workflow Deployment to run the Test Suite against.
10
+ # @param tag [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
11
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigData]
13
+ def initialize(workflow_deployment_id:, tag: nil, additional_properties: nil)
14
+ # @type [String] The ID of the Workflow Deployment to run the Test Suite against.
15
+ @workflow_deployment_id = workflow_deployment_id
16
+ # @type [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
17
+ @tag = tag
18
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
19
+ @additional_properties = additional_properties
20
+ end
21
+
22
+ # Deserialize a JSON object to an instance of TestSuiteRunWorkflowReleaseTagExecConfigData
23
+ #
24
+ # @param json_object [JSON]
25
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigData]
26
+ def self.from_json(json_object:)
27
+ struct = JSON.parse(json_object, object_class: OpenStruct)
28
+ JSON.parse(json_object)
29
+ workflow_deployment_id = struct.workflow_deployment_id
30
+ tag = struct.tag
31
+ new(workflow_deployment_id: workflow_deployment_id, tag: tag, additional_properties: struct)
32
+ end
33
+
34
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfigData to a JSON object
35
+ #
36
+ # @return [JSON]
37
+ def to_json(*_args)
38
+ { "workflow_deployment_id": @workflow_deployment_id, "tag": @tag }.to_json
39
+ end
40
+
41
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
42
+ #
43
+ # @param obj [Object]
44
+ # @return [Void]
45
+ def self.validate_raw(obj:)
46
+ obj.workflow_deployment_id.is_a?(String) != false || raise("Passed value for field obj.workflow_deployment_id is not the expected type, validation failed.")
47
+ obj.tag&.is_a?(String) != false || raise("Passed value for field obj.tag is not the expected type, validation failed.")
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class TestSuiteRunWorkflowReleaseTagExecConfigDataRequest
7
+ attr_reader :workflow_deployment_id, :tag, :additional_properties
8
+
9
+ # @param workflow_deployment_id [String] The ID of the Workflow Deployment to run the Test Suite against.
10
+ # @param tag [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
11
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
12
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
13
+ def initialize(workflow_deployment_id:, tag: nil, additional_properties: nil)
14
+ # @type [String] The ID of the Workflow Deployment to run the Test Suite against.
15
+ @workflow_deployment_id = workflow_deployment_id
16
+ # @type [String] A tag identifying which release of the Workflow Deployment to run the Test Suite against. Useful for testing past versions of the Workflow Deployment
17
+ @tag = tag
18
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
19
+ @additional_properties = additional_properties
20
+ end
21
+
22
+ # Deserialize a JSON object to an instance of TestSuiteRunWorkflowReleaseTagExecConfigDataRequest
23
+ #
24
+ # @param json_object [JSON]
25
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
26
+ def self.from_json(json_object:)
27
+ struct = JSON.parse(json_object, object_class: OpenStruct)
28
+ JSON.parse(json_object)
29
+ workflow_deployment_id = struct.workflow_deployment_id
30
+ tag = struct.tag
31
+ new(workflow_deployment_id: workflow_deployment_id, tag: tag, additional_properties: struct)
32
+ end
33
+
34
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfigDataRequest to a JSON object
35
+ #
36
+ # @return [JSON]
37
+ def to_json(*_args)
38
+ { "workflow_deployment_id": @workflow_deployment_id, "tag": @tag }.to_json
39
+ end
40
+
41
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
42
+ #
43
+ # @param obj [Object]
44
+ # @return [Void]
45
+ def self.validate_raw(obj:)
46
+ obj.workflow_deployment_id.is_a?(String) != false || raise("Passed value for field obj.workflow_deployment_id is not the expected type, validation failed.")
47
+ obj.tag&.is_a?(String) != false || raise("Passed value for field obj.tag is not the expected type, validation failed.")
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_suite_run_workflow_release_tag_exec_config_data_request"
4
+ require "json"
5
+
6
+ module Vellum
7
+ # Execution configuration for running a Test Suite against a Workflow Deployment
8
+ class TestSuiteRunWorkflowReleaseTagExecConfigRequest
9
+ attr_reader :data, :test_case_ids, :additional_properties
10
+
11
+ # @param data [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
12
+ # @param test_case_ids [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigRequest]
15
+ def initialize(data:, test_case_ids: nil, additional_properties: nil)
16
+ # @type [TestSuiteRunWorkflowReleaseTagExecConfigDataRequest]
17
+ @data = data
18
+ # @type [Array<String>] Optionally specify a subset of test case ids to run. If not provided, all test cases within the test suite will be run by default.
19
+ @test_case_ids = test_case_ids
20
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
21
+ @additional_properties = additional_properties
22
+ end
23
+
24
+ # Deserialize a JSON object to an instance of TestSuiteRunWorkflowReleaseTagExecConfigRequest
25
+ #
26
+ # @param json_object [JSON]
27
+ # @return [TestSuiteRunWorkflowReleaseTagExecConfigRequest]
28
+ def self.from_json(json_object:)
29
+ struct = JSON.parse(json_object, object_class: OpenStruct)
30
+ parsed_json = JSON.parse(json_object)
31
+ if parsed_json["data"].nil?
32
+ data = nil
33
+ else
34
+ data = parsed_json["data"].to_json
35
+ data = TestSuiteRunWorkflowReleaseTagExecConfigDataRequest.from_json(json_object: data)
36
+ end
37
+ test_case_ids = struct.test_case_ids
38
+ new(data: data, test_case_ids: test_case_ids, additional_properties: struct)
39
+ end
40
+
41
+ # Serialize an instance of TestSuiteRunWorkflowReleaseTagExecConfigRequest to a JSON object
42
+ #
43
+ # @return [JSON]
44
+ def to_json(*_args)
45
+ { "data": @data, "test_case_ids": @test_case_ids }.to_json
46
+ end
47
+
48
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
49
+ #
50
+ # @param obj [Object]
51
+ # @return [Void]
52
+ def self.validate_raw(obj:)
53
+ TestSuiteRunWorkflowReleaseTagExecConfigDataRequest.validate_raw(obj: obj.data)
54
+ obj.test_case_ids&.is_a?(Array) != false || raise("Passed value for field obj.test_case_ids is not the expected type, validation failed.")
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vellum
4
+ TEST_SUITE_RUN_WORKFLOW_RELEASE_TAG_EXEC_CONFIG_TYPE_ENUM = String
5
+ end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [Array<ArrayVariableValueItem>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputArray]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -54,7 +54,7 @@ module Vellum
54
54
  def self.validate_raw(obj:)
55
55
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
56
56
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
57
- obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
58
58
  end
59
59
  end
60
60
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [Array<ChatMessage>]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputChatHistory]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -54,7 +54,7 @@ module Vellum
54
54
  def self.validate_raw(obj:)
55
55
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
56
56
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
57
- obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
58
58
  end
59
59
  end
60
60
  end
@@ -13,7 +13,7 @@ module Vellum
13
13
  # @param value [VellumError]
14
14
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
15
  # @return [WorkflowOutputError]
16
- def initialize(id:, name:, value:, additional_properties: nil)
16
+ def initialize(id:, name:, value: nil, additional_properties: nil)
17
17
  # @type [String]
18
18
  @id = id
19
19
  # @type [String] The output's name, as defined in the workflow
@@ -56,7 +56,7 @@ module Vellum
56
56
  def self.validate_raw(obj:)
57
57
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
58
58
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
59
- VellumError.validate_raw(obj: obj.value)
59
+ obj.value.nil? || VellumError.validate_raw(obj: obj.value)
60
60
  end
61
61
  end
62
62
  end