Class: Gusto::Companies::CompaniesCreateRequestCompany
- Inherits:
-
Object
- Object
- Gusto::Companies::CompaniesCreateRequestCompany
- Defined in:
- lib/fern_gusto/companies/types/companies_create_request_company.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#contractor_only ⇒ Object
readonly
company will support both contractors and employees).
-
#ein ⇒ String
readonly
The employer identification number (EIN) of the company.
-
#name ⇒ String
readonly
The legal name of the company.
-
#trade_name ⇒ String
readonly
The name of the company.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Companies::CompaniesCreateRequestCompany
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(name:, trade_name: OMIT, ein: OMIT, contractor_only: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompaniesCreateRequestCompany constructor
- #to_json ⇒ String
Constructor Details
#initialize(name:, trade_name: OMIT, ein: OMIT, contractor_only: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompaniesCreateRequestCompany
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 34 def initialize(name:, trade_name: OMIT, ein: OMIT, contractor_only: OMIT, additional_properties: nil) @name = name @trade_name = trade_name if trade_name != OMIT @ein = ein if ein != OMIT @contractor_only = contractor_only if contractor_only != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "trade_name": trade_name, "ein": ein, "contractor_only": contractor_only }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
19 20 21 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 19 def additional_properties @additional_properties end |
#contractor_only ⇒ Object (readonly)
company will support both contractors and employees).
17 18 19 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 17 def contractor_only @contractor_only end |
#ein ⇒ String (readonly)
Returns The employer identification number (EIN) of the company.
13 14 15 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 13 def ein @ein end |
#name ⇒ String (readonly)
Returns The legal name of the company.
9 10 11 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 9 def name @name end |
#trade_name ⇒ String (readonly)
Returns The name of the company.
11 12 13 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 11 def trade_name @trade_name end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompaniesCreateRequestCompany
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 48 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] trade_name = parsed_json["trade_name"] ein = parsed_json["ein"] contractor_only = parsed_json["contractor_only"] new( name: name, trade_name: trade_name, ein: ein, contractor_only: contractor_only, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
75 76 77 78 79 80 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 75 def self.validate_raw(obj:) obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.trade_name&.is_a?(String) != false || raise("Passed value for field obj.trade_name is not the expected type, validation failed.") obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.") obj.contractor_only&.is_a?(Boolean) != false || raise("Passed value for field obj.contractor_only is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
66 67 68 |
# File 'lib/fern_gusto/companies/types/companies_create_request_company.rb', line 66 def to_json @_field_set&.to_json end |