Class: Gusto::Companies::CompanyPrimarySignatoryHomeAddress
- Inherits:
-
Object
- Object
- Gusto::Companies::CompanyPrimarySignatoryHomeAddress
- Defined in:
- lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #city ⇒ String readonly
- #country ⇒ String readonly
- #state ⇒ String readonly
- #street1 ⇒ String readonly
- #street2 ⇒ String readonly
- #zip ⇒ String readonly
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress constructor
- #to_json ⇒ String
Constructor Details
#initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 36 def initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) @street1 = street1 if street1 != OMIT @street2 = street2 if street2 != OMIT @city = city if city != OMIT @state = state if state != OMIT @zip = zip if zip != OMIT @country = country if country != OMIT @additional_properties = additional_properties @_field_set = { "street_1": street1, "street_2": street2, "city": city, "state": state, "zip": zip, "country": country }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 21 def additional_properties @additional_properties end |
#city ⇒ String (readonly)
13 14 15 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 13 def city @city end |
#country ⇒ String (readonly)
19 20 21 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 19 def country @country end |
#state ⇒ String (readonly)
15 16 17 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 15 def state @state end |
#street1 ⇒ String (readonly)
9 10 11 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 9 def street1 @street1 end |
#street2 ⇒ String (readonly)
11 12 13 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 11 def street2 @street2 end |
#zip ⇒ String (readonly)
17 18 19 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 17 def zip @zip end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 52 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) street1 = parsed_json["street_1"] street2 = parsed_json["street_2"] city = parsed_json["city"] state = parsed_json["state"] zip = parsed_json["zip"] country = parsed_json["country"] new( street1: street1, street2: street2, city: city, state: state, zip: zip, country: country, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
83 84 85 86 87 88 89 90 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 83 def self.validate_raw(obj:) obj.street1&.is_a?(String) != false || raise("Passed value for field obj.street1 is not the expected type, validation failed.") obj.street2&.is_a?(String) != false || raise("Passed value for field obj.street2 is not the expected type, validation failed.") obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.") obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.") obj.zip&.is_a?(String) != false || raise("Passed value for field obj.zip is not the expected type, validation failed.") obj.country&.is_a?(String) != false || raise("Passed value for field obj.country is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
74 75 76 |
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 74 def to_json @_field_set&.to_json end |