Class: Vapi::TranscriberCost
- Inherits:
-
Object
- Object
- Vapi::TranscriberCost
- Defined in:
- lib/vapi_server_sdk/types/transcriber_cost.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#cost ⇒ Float
readonly
This is the cost of the component in USD.
-
#minutes ⇒ Float
readonly
This is the minutes of ‘transcriber` usage.
-
#transcriber ⇒ Hash{String => Object}
readonly
This is the transcriber that was used during the call.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::TranscriberCost
Deserialize a JSON object to an instance of TranscriberCost.
-
.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(transcriber:, minutes:, cost:, additional_properties: nil) ⇒ Vapi::TranscriberCost constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of TranscriberCost to a JSON object.
Constructor Details
#initialize(transcriber:, minutes:, cost:, additional_properties: nil) ⇒ Vapi::TranscriberCost
45 46 47 48 49 50 51 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 45 def initialize(transcriber:, minutes:, cost:, additional_properties: nil) @transcriber = transcriber @minutes = minutes @cost = cost @additional_properties = additional_properties @_field_set = { "transcriber": transcriber, "minutes": minutes, "cost": cost } end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 24 def additional_properties @additional_properties end |
#cost ⇒ Float (readonly)
Returns This is the cost of the component in USD.
22 23 24 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 22 def cost @cost end |
#minutes ⇒ Float (readonly)
Returns This is the minutes of ‘transcriber` usage. This should match `call.endedAt` - `call.startedAt` for single assistant calls, while squad calls will have multiple transcriber costs one for each assistant that was used.
20 21 22 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 20 def minutes @minutes end |
#transcriber ⇒ Hash{String => Object} (readonly)
Returns This is the transcriber that was used during the call. This matches one of the below:
-
‘call.assistant.transcriber`,
-
‘call.assistantId->transcriber`,
-
‘call.squad.assistant.transcriber`,
-
‘call.squad.assistantId->transcriber`,
-
‘call.squadId->.assistant.transcriber`,
-
‘call.squadId->.assistantId->transcriber`.
16 17 18 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 16 def transcriber @transcriber end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::TranscriberCost
Deserialize a JSON object to an instance of TranscriberCost
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 57 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) transcriber = parsed_json["transcriber"] minutes = parsed_json["minutes"] cost = parsed_json["cost"] new( transcriber: transcriber, minutes: minutes, cost: cost, 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.
84 85 86 87 88 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 84 def self.validate_raw(obj:) obj.transcriber.is_a?(Hash) != false || raise("Passed value for field obj.transcriber is not the expected type, validation failed.") obj.minutes.is_a?(Float) != false || raise("Passed value for field obj.minutes is not the expected type, validation failed.") obj.cost.is_a?(Float) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of TranscriberCost to a JSON object
74 75 76 |
# File 'lib/vapi_server_sdk/types/transcriber_cost.rb', line 74 def to_json(*_args) @_field_set&.to_json end |