Class: Vellum::TestSuiteRunExecConfig
- Inherits:
-
Object
- Object
- Vellum::TestSuiteRunExecConfig
- Defined in:
- lib/vellum_ai/types/test_suite_run_exec_config.rb
Instance Attribute Summary collapse
-
#discriminant ⇒ Object
readonly
Returns the value of attribute discriminant.
-
#member ⇒ Object
readonly
Returns the value of attribute member.
Class Method Summary collapse
- .deployment_release_tag(member:) ⇒ TestSuiteRunExecConfig
-
.from_json(json_object:) ⇒ TestSuiteRunExecConfig
Deserialize a JSON object to an instance of TestSuiteRunExecConfig.
-
.validate_raw(obj:) ⇒ Void
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.
- .workflow_release_tag(member:) ⇒ TestSuiteRunExecConfig
Instance Method Summary collapse
- #initialize(member:, discriminant:) ⇒ TestSuiteRunExecConfig constructor
-
#is_a?(obj) ⇒ Boolean
For Union Types, is_a? functionality is delegated to the wrapped member.
- #kind_of? ⇒ Object
-
#to_json(*_args) ⇒ JSON
For Union Types, to_json functionality is delegated to the wrapped member.
Constructor Details
#initialize(member:, discriminant:) ⇒ TestSuiteRunExecConfig
16 17 18 19 20 21 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 16 def initialize(member:, discriminant:) # @type [Object] @member = member # @type [String] @discriminant = discriminant end |
Instance Attribute Details
#discriminant ⇒ Object (readonly)
Returns the value of attribute discriminant.
9 10 11 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 9 def discriminant @discriminant end |
#member ⇒ Object (readonly)
Returns the value of attribute member.
9 10 11 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 9 def member @member end |
Class Method Details
.deployment_release_tag(member:) ⇒ TestSuiteRunExecConfig
80 81 82 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 80 def self.deployment_release_tag(member:) new(member: member, discriminant: "DEPLOYMENT_RELEASE_TAG") end |
.from_json(json_object:) ⇒ TestSuiteRunExecConfig
Deserialize a JSON object to an instance of TestSuiteRunExecConfig
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 27 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) member = case struct.type when "DEPLOYMENT_RELEASE_TAG" TestSuiteRunDeploymentReleaseTagExecConfig.from_json(json_object: json_object) when "WORKFLOW_RELEASE_TAG" TestSuiteRunWorkflowReleaseTagExecConfig.from_json(json_object: json_object) else TestSuiteRunDeploymentReleaseTagExecConfig.from_json(json_object: json_object) end new(member: member, discriminant: struct.type) end |
.validate_raw(obj:) ⇒ Void
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.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 59 def self.validate_raw(obj:) case obj.type when "DEPLOYMENT_RELEASE_TAG" TestSuiteRunDeploymentReleaseTagExecConfig.validate_raw(obj: obj) when "WORKFLOW_RELEASE_TAG" TestSuiteRunWorkflowReleaseTagExecConfig.validate_raw(obj: obj) else raise("Passed value matched no type within the union, validation failed.") end end |
.workflow_release_tag(member:) ⇒ TestSuiteRunExecConfig
86 87 88 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 86 def self.workflow_release_tag(member:) new(member: member, discriminant: "WORKFLOW_RELEASE_TAG") end |
Instance Method Details
#is_a?(obj) ⇒ Boolean
For Union Types, is_a? functionality is delegated to the wrapped member.
74 75 76 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 74 def is_a?(obj) @member.is_a?(obj) end |
#kind_of? ⇒ Object
12 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 12 alias kind_of? is_a? |
#to_json(*_args) ⇒ JSON
For Union Types, to_json functionality is delegated to the wrapped member.
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/vellum_ai/types/test_suite_run_exec_config.rb', line 43 def to_json(*_args) case @discriminant when "DEPLOYMENT_RELEASE_TAG" { **@member.to_json, type: @discriminant }.to_json when "WORKFLOW_RELEASE_TAG" { **@member.to_json, type: @discriminant }.to_json else { "type": @discriminant, value: @member }.to_json end @member.to_json end |