Class: Vellum::VellumValueLogicalConditionGroupRequest
- Inherits:
-
Object
- Object
- Vellum::VellumValueLogicalConditionGroupRequest
- Defined in:
- lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb
Overview
higher-order conditions.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #combinator ⇒ Vellum::ConditionCombinator readonly
- #conditions ⇒ Array<Vellum::VellumValueLogicalExpressionRequest> readonly
- #negated ⇒ Boolean readonly
- #type ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Vellum::VellumValueLogicalConditionGroupRequest
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(type:, conditions:, combinator:, negated:, additional_properties: nil) ⇒ Vellum::VellumValueLogicalConditionGroupRequest constructor
- #to_json ⇒ String
Constructor Details
#initialize(type:, conditions:, combinator:, negated:, additional_properties: nil) ⇒ Vellum::VellumValueLogicalConditionGroupRequest
33 34 35 36 37 38 39 40 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 33 def initialize(type:, conditions:, combinator:, negated:, additional_properties: nil) @type = type @conditions = conditions @combinator = combinator @negated = negated @additional_properties = additional_properties @_field_set = { "type": type, "conditions": conditions, "combinator": combinator, "negated": negated } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 20 def additional_properties @additional_properties end |
#combinator ⇒ Vellum::ConditionCombinator (readonly)
16 17 18 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 16 def combinator @combinator end |
#conditions ⇒ Array<Vellum::VellumValueLogicalExpressionRequest> (readonly)
14 15 16 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 14 def conditions @conditions end |
#negated ⇒ Boolean (readonly)
18 19 20 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 18 def negated @negated end |
#type ⇒ String (readonly)
12 13 14 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 12 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::VellumValueLogicalConditionGroupRequest
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] conditions = parsed_json["conditions"]&.map do | item | item = item.to_json Vellum::VellumValueLogicalExpressionRequest.from_json(json_object: item) end combinator = parsed_json["combinator"] negated = parsed_json["negated"] new( type: type, conditions: conditions, combinator: combinator, negated: negated, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
77 78 79 80 81 82 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 77 def self.validate_raw(obj:) obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.conditions.is_a?(Array) != false || raise("Passed value for field obj.conditions is not the expected type, validation failed.") obj.combinator.is_a?(Vellum::ConditionCombinator) != false || raise("Passed value for field obj.combinator is not the expected type, validation failed.") obj.negated.is_a?(Boolean) != false || raise("Passed value for field obj.negated is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
68 69 70 |
# File 'lib/vellum_ai/types/vellum_value_logical_condition_group_request.rb', line 68 def to_json @_field_set&.to_json end |