Class: Vapi::OrgPlan
- Inherits:
-
Object
- Object
- Vapi::OrgPlan
- Defined in:
- lib/vapi_server_sdk/types/org_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #cost_per_overage_minute ⇒ Float readonly
- #included_minutes ⇒ Float readonly
- #included_providers ⇒ Array<Hash{String => Object}> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::OrgPlan
Deserialize a JSON object to an instance of OrgPlan.
-
.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(included_providers: OMIT, included_minutes: OMIT, cost_per_overage_minute: OMIT, additional_properties: nil) ⇒ Vapi::OrgPlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of OrgPlan to a JSON object.
Constructor Details
#initialize(included_providers: OMIT, included_minutes: OMIT, cost_per_overage_minute: OMIT, additional_properties: nil) ⇒ Vapi::OrgPlan
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 27 def initialize(included_providers: OMIT, included_minutes: OMIT, cost_per_overage_minute: OMIT, additional_properties: nil) @included_providers = included_providers if included_providers != OMIT @included_minutes = included_minutes if included_minutes != OMIT @cost_per_overage_minute = cost_per_overage_minute if cost_per_overage_minute != OMIT @additional_properties = additional_properties @_field_set = { "includedProviders": included_providers, "includedMinutes": included_minutes, "costPerOverageMinute": cost_per_overage_minute }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
15 16 17 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 15 def additional_properties @additional_properties end |
#cost_per_overage_minute ⇒ Float (readonly)
13 14 15 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 13 def cost_per_overage_minute @cost_per_overage_minute end |
#included_minutes ⇒ Float (readonly)
11 12 13 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 11 def included_minutes @included_minutes end |
#included_providers ⇒ Array<Hash{String => Object}> (readonly)
9 10 11 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 9 def included_providers @included_providers end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::OrgPlan
Deserialize a JSON object to an instance of OrgPlan
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) included_providers = parsed_json["includedProviders"] included_minutes = parsed_json["includedMinutes"] cost_per_overage_minute = parsed_json["costPerOverageMinute"] new( included_providers: included_providers, included_minutes: included_minutes, cost_per_overage_minute: cost_per_overage_minute, 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.
73 74 75 76 77 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 73 def self.validate_raw(obj:) obj.included_providers&.is_a?(Array) != false || raise("Passed value for field obj.included_providers is not the expected type, validation failed.") obj.included_minutes&.is_a?(Float) != false || raise("Passed value for field obj.included_minutes is not the expected type, validation failed.") obj.cost_per_overage_minute&.is_a?(Float) != false || raise("Passed value for field obj.cost_per_overage_minute is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of OrgPlan to a JSON object
63 64 65 |
# File 'lib/vapi_server_sdk/types/org_plan.rb', line 63 def to_json(*_args) @_field_set&.to_json end |