Class: Vapi::SuccessEvaluationPlan
- Inherits:
-
Object
- Object
- Vapi::SuccessEvaluationPlan
- Defined in:
- lib/vapi_server_sdk/types/success_evaluation_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#enabled ⇒ Boolean
readonly
This determines whether a success evaluation is generated and stored in ‘call.analysis.successEvaluation`.
-
#messages ⇒ Array<Hash{String => Object}>
readonly
These are the messages used to generate the success evaluation.
-
#rubric ⇒ Vapi::SuccessEvaluationPlanRubric
readonly
This enforces the rubric of the evaluation.
-
#timeout_seconds ⇒ Float
readonly
This is how long the request is tried before giving up.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::SuccessEvaluationPlan
Deserialize a JSON object to an instance of SuccessEvaluationPlan.
-
.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.
Instance Method Summary collapse
- #initialize(rubric: OMIT, messages: OMIT, enabled: OMIT, timeout_seconds: OMIT, additional_properties: nil) ⇒ Vapi::SuccessEvaluationPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of SuccessEvaluationPlan to a JSON object.
Constructor Details
#initialize(rubric: OMIT, messages: OMIT, enabled: OMIT, timeout_seconds: OMIT, additional_properties: nil) ⇒ Vapi::SuccessEvaluationPlan
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 131 def initialize(rubric: OMIT, messages: OMIT, enabled: OMIT, timeout_seconds: OMIT, additional_properties: nil) @rubric = rubric if rubric != OMIT = if != OMIT @enabled = enabled if enabled != OMIT @timeout_seconds = timeout_seconds if timeout_seconds != OMIT @additional_properties = additional_properties @_field_set = { "rubric": rubric, "messages": , "enabled": enabled, "timeoutSeconds": timeout_seconds }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
68 69 70 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 68 def additional_properties @additional_properties end |
#enabled ⇒ Boolean (readonly)
59 60 61 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 59 def enabled @enabled end |
#messages ⇒ Array<Hash{String => Object}> (readonly)
53 54 55 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 53 def end |
#rubric ⇒ Vapi::SuccessEvaluationPlanRubric (readonly)
24 25 26 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 24 def rubric @rubric end |
#timeout_seconds ⇒ Float (readonly)
66 67 68 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 66 def timeout_seconds @timeout_seconds end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::SuccessEvaluationPlan
Deserialize a JSON object to an instance of SuccessEvaluationPlan
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 151 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) rubric = parsed_json["rubric"] = parsed_json["messages"] enabled = parsed_json["enabled"] timeout_seconds = parsed_json["timeoutSeconds"] new( rubric: rubric, messages: , enabled: enabled, timeout_seconds: timeout_seconds, additional_properties: struct ) 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.
180 181 182 183 184 185 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 180 def self.validate_raw(obj:) obj.rubric&.is_a?(Vapi::SuccessEvaluationPlanRubric) != false || raise("Passed value for field obj.rubric is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.messages is not the expected type, validation failed.") obj.enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.enabled is not the expected type, validation failed.") obj.timeout_seconds&.is_a?(Float) != false || raise("Passed value for field obj.timeout_seconds is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of SuccessEvaluationPlan to a JSON object
170 171 172 |
# File 'lib/vapi_server_sdk/types/success_evaluation_plan.rb', line 170 def to_json(*_args) @_field_set&.to_json end |