Class: Vapi::AnalysisPlan
- Inherits:
-
Object
- Object
- Vapi::AnalysisPlan
- Defined in:
- lib/vapi_server_sdk/types/analysis_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#min_messages_threshold ⇒ Float
readonly
The minimum number of messages required to run the analysis plan.
-
#structured_data_multi_plan ⇒ Array<Vapi::StructuredDataMultiPlan>
readonly
This is an array of structured data plan catalogs.
-
#structured_data_plan ⇒ Vapi::StructuredDataPlan
readonly
This is the plan for generating the structured data from the call.
-
#success_evaluation_plan ⇒ Vapi::SuccessEvaluationPlan
readonly
This is the plan for generating the success evaluation of the call.
-
#summary_plan ⇒ Vapi::SummaryPlan
readonly
This is the plan for generating the summary of the call.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::AnalysisPlan
Deserialize a JSON object to an instance of AnalysisPlan.
-
.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(min_messages_threshold: OMIT, summary_plan: OMIT, structured_data_plan: OMIT, structured_data_multi_plan: OMIT, success_evaluation_plan: OMIT, additional_properties: nil) ⇒ Vapi::AnalysisPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AnalysisPlan to a JSON object.
Constructor Details
#initialize(min_messages_threshold: OMIT, summary_plan: OMIT, structured_data_plan: OMIT, structured_data_multi_plan: OMIT, success_evaluation_plan: OMIT, additional_properties: nil) ⇒ Vapi::AnalysisPlan
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 51 def initialize(min_messages_threshold: OMIT, summary_plan: OMIT, structured_data_plan: OMIT, structured_data_multi_plan: OMIT, success_evaluation_plan: OMIT, additional_properties: nil) @min_messages_threshold = if != OMIT @summary_plan = summary_plan if summary_plan != OMIT @structured_data_plan = structured_data_plan if structured_data_plan != OMIT @structured_data_multi_plan = structured_data_multi_plan if structured_data_multi_plan != OMIT @success_evaluation_plan = success_evaluation_plan if success_evaluation_plan != OMIT @additional_properties = additional_properties @_field_set = { "minMessagesThreshold": , "summaryPlan": summary_plan, "structuredDataPlan": structured_data_plan, "structuredDataMultiPlan": structured_data_multi_plan, "successEvaluationPlan": success_evaluation_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 30 def additional_properties @additional_properties end |
#min_messages_threshold ⇒ Float (readonly)
Returns The minimum number of messages required to run the analysis plan. If the number of messages is less than this, analysis will be skipped. @default 2.
15 16 17 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 15 def @min_messages_threshold end |
#structured_data_multi_plan ⇒ Array<Vapi::StructuredDataMultiPlan> (readonly)
Returns This is an array of structured data plan catalogs. Each entry includes a ‘key` and a `plan` for generating the structured data from the call. This outputs to `call.analysis.structuredDataMulti`.
25 26 27 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 25 def structured_data_multi_plan @structured_data_multi_plan end |
#structured_data_plan ⇒ Vapi::StructuredDataPlan (readonly)
Returns This is the plan for generating the structured data from the call. This outputs to ‘call.analysis.structuredData`.
21 22 23 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 21 def structured_data_plan @structured_data_plan end |
#success_evaluation_plan ⇒ Vapi::SuccessEvaluationPlan (readonly)
Returns This is the plan for generating the success evaluation of the call. This outputs to ‘call.analysis.successEvaluation`.
28 29 30 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 28 def success_evaluation_plan @success_evaluation_plan end |
#summary_plan ⇒ Vapi::SummaryPlan (readonly)
Returns This is the plan for generating the summary of the call. This outputs to ‘call.analysis.summary`.
18 19 20 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 18 def summary_plan @summary_plan end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::AnalysisPlan
Deserialize a JSON object to an instance of AnalysisPlan
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 74 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) = parsed_json["minMessagesThreshold"] if parsed_json["summaryPlan"].nil? summary_plan = nil else summary_plan = parsed_json["summaryPlan"].to_json summary_plan = Vapi::SummaryPlan.from_json(json_object: summary_plan) end if parsed_json["structuredDataPlan"].nil? structured_data_plan = nil else structured_data_plan = parsed_json["structuredDataPlan"].to_json structured_data_plan = Vapi::StructuredDataPlan.from_json(json_object: structured_data_plan) end structured_data_multi_plan = parsed_json["structuredDataMultiPlan"]&.map do |item| item = item.to_json Vapi::StructuredDataMultiPlan.from_json(json_object: item) end if parsed_json["successEvaluationPlan"].nil? success_evaluation_plan = nil else success_evaluation_plan = parsed_json["successEvaluationPlan"].to_json success_evaluation_plan = Vapi::SuccessEvaluationPlan.from_json(json_object: success_evaluation_plan) end new( min_messages_threshold: , summary_plan: summary_plan, structured_data_plan: structured_data_plan, structured_data_multi_plan: structured_data_multi_plan, success_evaluation_plan: success_evaluation_plan, 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.
123 124 125 126 127 128 129 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 123 def self.validate_raw(obj:) obj.&.is_a?(Float) != false || raise("Passed value for field obj.min_messages_threshold is not the expected type, validation failed.") obj.summary_plan.nil? || Vapi::SummaryPlan.validate_raw(obj: obj.summary_plan) obj.structured_data_plan.nil? || Vapi::StructuredDataPlan.validate_raw(obj: obj.structured_data_plan) obj.structured_data_multi_plan&.is_a?(Array) != false || raise("Passed value for field obj.structured_data_multi_plan is not the expected type, validation failed.") obj.success_evaluation_plan.nil? || Vapi::SuccessEvaluationPlan.validate_raw(obj: obj.success_evaluation_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AnalysisPlan to a JSON object
113 114 115 |
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 113 def to_json(*_args) @_field_set&.to_json end |