Class: Gusto::EmployeeWorkAddress

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, effective_date: OMIT, active: OMIT, location_uuid: OMIT, employee_uuid: OMIT, version: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeWorkAddress

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



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fern_gusto/types/employee_work_address.rb', line 57

def initialize(uuid:, effective_date: OMIT, active: OMIT, location_uuid: OMIT, employee_uuid: OMIT, version: OMIT, street1: OMIT, street2: OMIT, city: OMIT, state: OMIT, zip: OMIT, country: OMIT, additional_properties: nil)
  @uuid = uuid
  @effective_date = effective_date if effective_date != OMIT
  @active = active if active != OMIT
  @location_uuid = location_uuid if location_uuid != OMIT
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @version = version if version != OMIT
  @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 = { "uuid": uuid, "effective_date": effective_date, "active": active, "location_uuid": location_uuid, "employee_uuid": employee_uuid, "version": version, "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

#activeBoolean (readonly)

Returns Signifies if this address is the active work address for the current date.

Returns:

  • (Boolean)

    Signifies if this address is the active work address for the current date



12
13
14
# File 'lib/fern_gusto/types/employee_work_address.rb', line 12

def active
  @active
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



34
35
36
# File 'lib/fern_gusto/types/employee_work_address.rb', line 34

def additional_properties
  @additional_properties
end

#cityString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/fern_gusto/types/employee_work_address.rb', line 26

def city
  @city
end

#countryString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/fern_gusto/types/employee_work_address.rb', line 32

def country
  @country
end

#effective_dateString (readonly)

Returns The date the employee began working at this location.

Returns:

  • (String)

    The date the employee began working at this location.



10
11
12
# File 'lib/fern_gusto/types/employee_work_address.rb', line 10

def effective_date
  @effective_date
end

#employee_uuidString (readonly)

Returns UUID reference to the employee for this work address.

Returns:

  • (String)

    UUID reference to the employee for this work address.



16
17
18
# File 'lib/fern_gusto/types/employee_work_address.rb', line 16

def employee_uuid
  @employee_uuid
end

#location_uuidString (readonly)

Returns UUID reference to the company location for this work address.

Returns:

  • (String)

    UUID reference to the company location for this work address.



14
15
16
# File 'lib/fern_gusto/types/employee_work_address.rb', line 14

def location_uuid
  @location_uuid
end

#stateString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/fern_gusto/types/employee_work_address.rb', line 28

def state
  @state
end

#street1String (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/fern_gusto/types/employee_work_address.rb', line 22

def street1
  @street1
end

#street2String (readonly)

Returns:

  • (String)


24
25
26
# File 'lib/fern_gusto/types/employee_work_address.rb', line 24

def street2
  @street2
end

#uuidString (readonly)

Returns The unique identifier of this work address.

Returns:

  • (String)

    The unique identifier of this work address.



8
9
10
# File 'lib/fern_gusto/types/employee_work_address.rb', line 8

def uuid
  @uuid
end

#versionObject (readonly)

on how to use this field.



20
21
22
# File 'lib/fern_gusto/types/employee_work_address.rb', line 20

def version
  @version
end

#zipString (readonly)

Returns:

  • (String)


30
31
32
# File 'lib/fern_gusto/types/employee_work_address.rb', line 30

def zip
  @zip
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::EmployeeWorkAddress

Parameters:

  • json_object (String)

Returns:



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/fern_gusto/types/employee_work_address.rb', line 79

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  effective_date = parsed_json["effective_date"]
  active = parsed_json["active"]
  location_uuid = parsed_json["location_uuid"]
  employee_uuid = parsed_json["employee_uuid"]
  version = parsed_json["version"]
  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(
    uuid: uuid,
    effective_date: effective_date,
    active: active,
    location_uuid: location_uuid,
    employee_uuid: employee_uuid,
    version: version,
    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)


122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/fern_gusto/types/employee_work_address.rb', line 122

def self.validate_raw(obj:)
  obj.uuid.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.effective_date&.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.")
  obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.")
  obj.location_uuid&.is_a?(String) != false || raise("Passed value for field obj.location_uuid is not the expected type, validation failed.")
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  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)


113
114
115
# File 'lib/fern_gusto/types/employee_work_address.rb', line 113

def to_json
  @_field_set&.to_json
end