Class: Vapi::AnalysisPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/analysis_plan.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(summary_plan: OMIT, structured_data_plan: OMIT, success_evaluation_plan: OMIT, additional_properties: nil) ⇒ Vapi::AnalysisPlan

Parameters:

  • summary_plan (Vapi::SummaryPlan) (defaults to: OMIT)

    This is the plan for generating the summary of the call. This outputs to ‘call.analysis.summary`.

  • structured_data_plan (Vapi::StructuredDataPlan) (defaults to: OMIT)

    This is the plan for generating the structured data from the call. This outputs to ‘call.analysis.structuredData`.

  • success_evaluation_plan (Vapi::SuccessEvaluationPlan) (defaults to: OMIT)

    This is the plan for generating the success evaluation of the call. This outputs to ‘call.analysis.successEvaluation`.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 36

def initialize(summary_plan: OMIT, structured_data_plan: OMIT, success_evaluation_plan: OMIT,
               additional_properties: nil)
  @summary_plan = summary_plan if summary_plan != OMIT
  @structured_data_plan = structured_data_plan if structured_data_plan != OMIT
  @success_evaluation_plan = success_evaluation_plan if success_evaluation_plan != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "summaryPlan": summary_plan,
    "structuredDataPlan": structured_data_plan,
    "successEvaluationPlan": success_evaluation_plan
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



21
22
23
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 21

def additional_properties
  @additional_properties
end

#structured_data_planVapi::StructuredDataPlan (readonly)

Returns This is the plan for generating the structured data from the call. This outputs to ‘call.analysis.structuredData`.

Returns:

  • (Vapi::StructuredDataPlan)

    This is the plan for generating the structured data from the call. This outputs to ‘call.analysis.structuredData`.



16
17
18
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 16

def structured_data_plan
  @structured_data_plan
end

#success_evaluation_planVapi::SuccessEvaluationPlan (readonly)

Returns This is the plan for generating the success evaluation of the call. This outputs to ‘call.analysis.successEvaluation`.

Returns:

  • (Vapi::SuccessEvaluationPlan)

    This is the plan for generating the success evaluation of the call. This outputs to ‘call.analysis.successEvaluation`.



19
20
21
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 19

def success_evaluation_plan
  @success_evaluation_plan
end

#summary_planVapi::SummaryPlan (readonly)

Returns This is the plan for generating the summary of the call. This outputs to ‘call.analysis.summary`.

Returns:

  • (Vapi::SummaryPlan)

    This is the plan for generating the summary of the call. This outputs to ‘call.analysis.summary`.



13
14
15
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 13

def summary_plan
  @summary_plan
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::AnalysisPlan

Deserialize a JSON object to an instance of AnalysisPlan

Parameters:

  • json_object (String)

Returns:



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 55

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  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
  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(
    summary_plan: summary_plan,
    structured_data_plan: structured_data_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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


97
98
99
100
101
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 97

def self.validate_raw(obj:)
  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.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

Returns:

  • (String)


87
88
89
# File 'lib/vapi_server_sdk/types/analysis_plan.rb', line 87

def to_json(*_args)
  @_field_set&.to_json
end