Class: Vapi::InvoicePlan
- Inherits:
-
Object
- Object
- Vapi::InvoicePlan
- Defined in:
- lib/vapi_server_sdk/types/invoice_plan.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#company_address ⇒ String
readonly
This is the address of the company.
-
#company_email ⇒ String
readonly
This is the preferred invoicing email of the company.
-
#company_name ⇒ String
readonly
This is the name of the company.
-
#company_tax_id ⇒ String
readonly
This is the tax ID of the company.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::InvoicePlan
Deserialize a JSON object to an instance of InvoicePlan.
-
.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(company_name: OMIT, company_address: OMIT, company_tax_id: OMIT, company_email: OMIT, additional_properties: nil) ⇒ Vapi::InvoicePlan constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of InvoicePlan to a JSON object.
Constructor Details
#initialize(company_name: OMIT, company_address: OMIT, company_tax_id: OMIT, company_email: OMIT, additional_properties: nil) ⇒ Vapi::InvoicePlan
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 32 def initialize(company_name: OMIT, company_address: OMIT, company_tax_id: OMIT, company_email: OMIT, additional_properties: nil) @company_name = company_name if company_name != OMIT @company_address = company_address if company_address != OMIT @company_tax_id = company_tax_id if company_tax_id != OMIT @company_email = company_email if company_email != OMIT @additional_properties = additional_properties @_field_set = { "companyName": company_name, "companyAddress": company_address, "companyTaxId": company_tax_id, "companyEmail": company_email }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
18 19 20 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 18 def additional_properties @additional_properties end |
#company_address ⇒ String (readonly)
Returns This is the address of the company.
11 12 13 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 11 def company_address @company_address end |
#company_email ⇒ String (readonly)
Returns This is the preferred invoicing email of the company. If not specified, defaults to the subscription’s email.
16 17 18 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 16 def company_email @company_email end |
#company_name ⇒ String (readonly)
Returns This is the name of the company.
9 10 11 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 9 def company_name @company_name end |
#company_tax_id ⇒ String (readonly)
Returns This is the tax ID of the company.
13 14 15 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 13 def company_tax_id @company_tax_id end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::InvoicePlan
Deserialize a JSON object to an instance of InvoicePlan
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 53 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) company_name = parsed_json["companyName"] company_address = parsed_json["companyAddress"] company_tax_id = parsed_json["companyTaxId"] company_email = parsed_json["companyEmail"] new( company_name: company_name, company_address: company_address, company_tax_id: company_tax_id, company_email: company_email, 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.
82 83 84 85 86 87 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 82 def self.validate_raw(obj:) obj.company_name&.is_a?(String) != false || raise("Passed value for field obj.company_name is not the expected type, validation failed.") obj.company_address&.is_a?(String) != false || raise("Passed value for field obj.company_address is not the expected type, validation failed.") obj.company_tax_id&.is_a?(String) != false || raise("Passed value for field obj.company_tax_id is not the expected type, validation failed.") obj.company_email&.is_a?(String) != false || raise("Passed value for field obj.company_email is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of InvoicePlan to a JSON object
72 73 74 |
# File 'lib/vapi_server_sdk/types/invoice_plan.rb', line 72 def to_json(*_args) @_field_set&.to_json end |