Class: Gusto::Companies::CompanyPrimarySignatoryHomeAddress

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyPrimarySignatoryHomeAddress

Parameters:

  • street1 (String) (defaults to: OMIT)
  • street2 (String) (defaults to: OMIT)
  • city (String) (defaults to: OMIT)
  • state (String) (defaults to: OMIT)
  • zip (String) (defaults to: OMIT)
  • country (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#cityString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 13

def city
  @city
end

#countryString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 19

def country
  @country
end

#stateString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 15

def state
  @state
end

#street1String (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 9

def street1
  @street1
end

#street2String (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/fern_gusto/companies/types/company_primary_signatory_home_address.rb', line 11

def street2
  @street2
end

#zipString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (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