merge_hris_client 3.1.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -13
- data/docs/AsyncPassthroughApi.md +155 -0
- data/docs/AsyncPassthroughReciept.md +18 -0
- data/docs/BankInfo.md +2 -2
- data/docs/BankInfoApi.md +2 -2
- data/docs/Benefit.md +9 -3
- data/docs/BenefitPlanTypeEnum.md +15 -0
- data/docs/Company.md +2 -2
- data/docs/Deduction.md +2 -2
- data/docs/DeleteAccountApi.md +9 -9
- data/docs/Dependent.md +50 -0
- data/docs/DependentsApi.md +181 -0
- data/docs/Earning.md +2 -2
- data/docs/Employee.md +2 -2
- data/docs/EmployeePayrollRun.md +2 -2
- data/docs/EmployerBenefit.md +36 -0
- data/docs/EmployerBenefitsApi.md +177 -0
- data/docs/Employment.md +2 -2
- data/docs/EmploymentsApi.md +2 -2
- data/docs/EndUserDetailsRequest.md +1 -1
- data/docs/Group.md +2 -2
- data/docs/LinkedAccountsApi.md +2 -2
- data/docs/Location.md +3 -3
- data/docs/PaginatedDependentList.md +22 -0
- data/docs/PaginatedEmployerBenefitList.md +22 -0
- data/docs/PayGroup.md +2 -2
- data/docs/PayrollRun.md +2 -2
- data/docs/RelationshipEnum.md +15 -0
- data/docs/RemoteData.md +1 -1
- data/docs/SyncStatusApi.md +1 -1
- data/docs/Tax.md +2 -2
- data/docs/Team.md +2 -2
- data/docs/TimeOff.md +2 -2
- data/docs/TimeOffBalance.md +2 -2
- data/lib/merge_hris_client/api/async_passthrough_api.rb +160 -0
- data/lib/merge_hris_client/api/bank_info_api.rb +2 -2
- data/lib/merge_hris_client/api/delete_account_api.rb +7 -7
- data/lib/merge_hris_client/api/dependents_api.rb +188 -0
- data/lib/merge_hris_client/api/employer_benefits_api.rb +182 -0
- data/lib/merge_hris_client/api/employments_api.rb +2 -2
- data/lib/merge_hris_client/api/linked_accounts_api.rb +2 -2
- data/lib/merge_hris_client/api/sync_status_api.rb +2 -2
- data/lib/merge_hris_client/models/async_passthrough_reciept.rb +223 -0
- data/lib/merge_hris_client/models/bank_info.rb +10 -10
- data/lib/merge_hris_client/models/benefit.rb +42 -9
- data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +48 -0
- data/lib/merge_hris_client/models/company.rb +10 -10
- data/lib/merge_hris_client/models/deduction.rb +10 -10
- data/lib/merge_hris_client/models/dependent.rb +470 -0
- data/lib/merge_hris_client/models/earning.rb +10 -10
- data/lib/merge_hris_client/models/employee.rb +10 -10
- data/lib/merge_hris_client/models/employee_payroll_run.rb +10 -10
- data/lib/merge_hris_client/models/employer_benefit.rb +363 -0
- data/lib/merge_hris_client/models/employment.rb +10 -10
- data/lib/merge_hris_client/models/end_user_details_request.rb +1 -1
- data/lib/merge_hris_client/models/group.rb +10 -10
- data/lib/merge_hris_client/models/location.rb +10 -10
- data/lib/merge_hris_client/models/paginated_dependent_list.rb +240 -0
- data/lib/merge_hris_client/models/paginated_employer_benefit_list.rb +240 -0
- data/lib/merge_hris_client/models/pay_group.rb +10 -10
- data/lib/merge_hris_client/models/payroll_run.rb +10 -10
- data/lib/merge_hris_client/models/relationship_enum.rb +46 -0
- data/lib/merge_hris_client/models/remote_data.rb +3 -4
- data/lib/merge_hris_client/models/sync_status_status_enum.rb +2 -1
- data/lib/merge_hris_client/models/tax.rb +10 -10
- data/lib/merge_hris_client/models/team.rb +10 -10
- data/lib/merge_hris_client/models/time_off.rb +10 -10
- data/lib/merge_hris_client/models/time_off_balance.rb +10 -10
- data/lib/merge_hris_client/version.rb +1 -1
- data/lib/merge_hris_client.rb +16 -2
- data/spec/api/async_passthrough_api_spec.rb +59 -0
- data/spec/api/bank_info_api_spec.rb +1 -1
- data/spec/api/delete_account_api_spec.rb +2 -2
- data/spec/api/dependents_api_spec.rb +70 -0
- data/spec/api/employer_benefits_api_spec.rb +68 -0
- data/spec/api/employments_api_spec.rb +1 -1
- data/spec/api/linked_accounts_api_spec.rb +1 -1
- data/spec/api/sync_status_api_spec.rb +1 -1
- data/spec/models/async_passthrough_reciept_spec.rb +34 -0
- data/spec/models/bank_info_spec.rb +2 -2
- data/spec/models/benefit_plan_type_enum_spec.rb +28 -0
- data/spec/models/benefit_spec.rb +19 -1
- data/spec/models/company_spec.rb +2 -2
- data/spec/models/deduction_spec.rb +2 -2
- data/spec/models/dependent_spec.rb +130 -0
- data/spec/models/earning_spec.rb +2 -2
- data/spec/models/employee_payroll_run_spec.rb +2 -2
- data/spec/models/employee_spec.rb +2 -2
- data/spec/models/employer_benefit_spec.rb +88 -0
- data/spec/models/employment_spec.rb +2 -2
- data/spec/models/group_spec.rb +2 -2
- data/spec/models/location_spec.rb +2 -2
- data/spec/models/paginated_dependent_list_spec.rb +46 -0
- data/spec/models/paginated_employer_benefit_list_spec.rb +46 -0
- data/spec/models/pay_group_spec.rb +2 -2
- data/spec/models/payroll_run_spec.rb +2 -2
- data/spec/models/relationship_enum_spec.rb +28 -0
- data/spec/models/tax_spec.rb +2 -2
- data/spec/models/team_spec.rb +2 -2
- data/spec/models/time_off_balance_spec.rb +2 -2
- data/spec/models/time_off_spec.rb +2 -2
- metadata +161 -121
@@ -0,0 +1,48 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
class BenefitPlanTypeEnum
|
18
|
+
MEDICAL = "MEDICAL".freeze
|
19
|
+
HEALTH_SAVINGS = "HEALTH_SAVINGS".freeze
|
20
|
+
INSURANCE = "INSURANCE".freeze
|
21
|
+
RETIREMENT = "RETIREMENT".freeze
|
22
|
+
OTHER = "OTHER".freeze
|
23
|
+
|
24
|
+
MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
|
25
|
+
|
26
|
+
attr_accessor :value
|
27
|
+
attr_accessor :raw_value
|
28
|
+
|
29
|
+
# Builds the enum from string
|
30
|
+
# @param [String] The enum value in the form of the string
|
31
|
+
# @return [String] The enum value
|
32
|
+
def build_from_hash(value)
|
33
|
+
@raw_value = value
|
34
|
+
if ["MEDICAL", "HEALTH_SAVINGS", "INSURANCE", "RETIREMENT", "OTHER", ].include? value
|
35
|
+
@value = value
|
36
|
+
else
|
37
|
+
@value = MERGE_NONSTANDARD_VALUE
|
38
|
+
end
|
39
|
+
|
40
|
+
self
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.build_from_hash(value)
|
44
|
+
BenefitPlanTypeEnum.new.build_from_hash(value)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
@@ -33,11 +33,11 @@ module MergeHRISClient
|
|
33
33
|
# Indicates whether or not this object has been deleted by third party webhooks.
|
34
34
|
attr_accessor :remote_was_deleted
|
35
35
|
|
36
|
-
attr_accessor :field_mappings
|
37
|
-
|
38
36
|
# This is the datetime that this object was last updated by Merge
|
39
37
|
attr_accessor :modified_at
|
40
38
|
|
39
|
+
attr_accessor :field_mappings
|
40
|
+
|
41
41
|
attr_accessor :remote_data
|
42
42
|
|
43
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -49,8 +49,8 @@ module MergeHRISClient
|
|
49
49
|
:'display_name' => :'display_name',
|
50
50
|
:'eins' => :'eins',
|
51
51
|
:'remote_was_deleted' => :'remote_was_deleted',
|
52
|
-
:'field_mappings' => :'field_mappings',
|
53
52
|
:'modified_at' => :'modified_at',
|
53
|
+
:'field_mappings' => :'field_mappings',
|
54
54
|
:'remote_data' => :'remote_data'
|
55
55
|
}
|
56
56
|
end
|
@@ -69,8 +69,8 @@ module MergeHRISClient
|
|
69
69
|
:'display_name' => :'String',
|
70
70
|
:'eins' => :'Array<String>',
|
71
71
|
:'remote_was_deleted' => :'Boolean',
|
72
|
-
:'field_mappings' => :'Hash<String, Object>',
|
73
72
|
:'modified_at' => :'Time',
|
73
|
+
:'field_mappings' => :'Hash<String, Object>',
|
74
74
|
:'remote_data' => :'Array<RemoteData>'
|
75
75
|
}
|
76
76
|
end
|
@@ -128,16 +128,16 @@ module MergeHRISClient
|
|
128
128
|
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
129
129
|
end
|
130
130
|
|
131
|
+
if attributes.key?(:'modified_at')
|
132
|
+
self.modified_at = attributes[:'modified_at']
|
133
|
+
end
|
134
|
+
|
131
135
|
if attributes.key?(:'field_mappings')
|
132
136
|
if (value = attributes[:'field_mappings']).is_a?(Hash)
|
133
137
|
self.field_mappings = value
|
134
138
|
end
|
135
139
|
end
|
136
140
|
|
137
|
-
if attributes.key?(:'modified_at')
|
138
|
-
self.modified_at = attributes[:'modified_at']
|
139
|
-
end
|
140
|
-
|
141
141
|
if attributes.key?(:'remote_data')
|
142
142
|
if (value = attributes[:'remote_data']).is_a?(Array)
|
143
143
|
self.remote_data = value
|
@@ -169,8 +169,8 @@ module MergeHRISClient
|
|
169
169
|
display_name == o.display_name &&
|
170
170
|
eins == o.eins &&
|
171
171
|
remote_was_deleted == o.remote_was_deleted &&
|
172
|
-
field_mappings == o.field_mappings &&
|
173
172
|
modified_at == o.modified_at &&
|
173
|
+
field_mappings == o.field_mappings &&
|
174
174
|
remote_data == o.remote_data
|
175
175
|
end
|
176
176
|
|
@@ -183,7 +183,7 @@ module MergeHRISClient
|
|
183
183
|
# Calculates hash code according to all attributes.
|
184
184
|
# @return [Integer] Hash code
|
185
185
|
def hash
|
186
|
-
[id, remote_id, legal_name, display_name, eins, remote_was_deleted,
|
186
|
+
[id, remote_id, legal_name, display_name, eins, remote_was_deleted, modified_at, field_mappings, remote_data].hash
|
187
187
|
end
|
188
188
|
|
189
189
|
# Builds the object from hash
|
@@ -35,11 +35,11 @@ module MergeHRISClient
|
|
35
35
|
# Indicates whether or not this object has been deleted by third party webhooks.
|
36
36
|
attr_accessor :remote_was_deleted
|
37
37
|
|
38
|
-
attr_accessor :field_mappings
|
39
|
-
|
40
38
|
# This is the datetime that this object was last updated by Merge
|
41
39
|
attr_accessor :modified_at
|
42
40
|
|
41
|
+
attr_accessor :field_mappings
|
42
|
+
|
43
43
|
attr_accessor :remote_data
|
44
44
|
|
45
45
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -52,8 +52,8 @@ module MergeHRISClient
|
|
52
52
|
:'employee_deduction' => :'employee_deduction',
|
53
53
|
:'company_deduction' => :'company_deduction',
|
54
54
|
:'remote_was_deleted' => :'remote_was_deleted',
|
55
|
-
:'field_mappings' => :'field_mappings',
|
56
55
|
:'modified_at' => :'modified_at',
|
56
|
+
:'field_mappings' => :'field_mappings',
|
57
57
|
:'remote_data' => :'remote_data'
|
58
58
|
}
|
59
59
|
end
|
@@ -73,8 +73,8 @@ module MergeHRISClient
|
|
73
73
|
:'employee_deduction' => :'Float',
|
74
74
|
:'company_deduction' => :'Float',
|
75
75
|
:'remote_was_deleted' => :'Boolean',
|
76
|
-
:'field_mappings' => :'Hash<String, Object>',
|
77
76
|
:'modified_at' => :'Time',
|
77
|
+
:'field_mappings' => :'Hash<String, Object>',
|
78
78
|
:'remote_data' => :'Array<RemoteData>'
|
79
79
|
}
|
80
80
|
end
|
@@ -135,16 +135,16 @@ module MergeHRISClient
|
|
135
135
|
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
136
136
|
end
|
137
137
|
|
138
|
+
if attributes.key?(:'modified_at')
|
139
|
+
self.modified_at = attributes[:'modified_at']
|
140
|
+
end
|
141
|
+
|
138
142
|
if attributes.key?(:'field_mappings')
|
139
143
|
if (value = attributes[:'field_mappings']).is_a?(Hash)
|
140
144
|
self.field_mappings = value
|
141
145
|
end
|
142
146
|
end
|
143
147
|
|
144
|
-
if attributes.key?(:'modified_at')
|
145
|
-
self.modified_at = attributes[:'modified_at']
|
146
|
-
end
|
147
|
-
|
148
148
|
if attributes.key?(:'remote_data')
|
149
149
|
if (value = attributes[:'remote_data']).is_a?(Array)
|
150
150
|
self.remote_data = value
|
@@ -177,8 +177,8 @@ module MergeHRISClient
|
|
177
177
|
employee_deduction == o.employee_deduction &&
|
178
178
|
company_deduction == o.company_deduction &&
|
179
179
|
remote_was_deleted == o.remote_was_deleted &&
|
180
|
-
field_mappings == o.field_mappings &&
|
181
180
|
modified_at == o.modified_at &&
|
181
|
+
field_mappings == o.field_mappings &&
|
182
182
|
remote_data == o.remote_data
|
183
183
|
end
|
184
184
|
|
@@ -191,7 +191,7 @@ module MergeHRISClient
|
|
191
191
|
# Calculates hash code according to all attributes.
|
192
192
|
# @return [Integer] Hash code
|
193
193
|
def hash
|
194
|
-
[id, remote_id, employee_payroll_run, name, employee_deduction, company_deduction, remote_was_deleted,
|
194
|
+
[id, remote_id, employee_payroll_run, name, employee_deduction, company_deduction, remote_was_deleted, modified_at, field_mappings, remote_data].hash
|
195
195
|
end
|
196
196
|
|
197
197
|
# Builds the object from hash
|
@@ -0,0 +1,470 @@
|
|
1
|
+
=begin
|
2
|
+
#Merge HRIS API
|
3
|
+
|
4
|
+
#The unified API for building rich integrations with multiple HR Information System platforms.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0
|
7
|
+
Contact: hello@merge.dev
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.1.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MergeHRISClient
|
17
|
+
# # The Dependent Object ### Description The `Dependent` object is used to represent a dependent (e.g. child, spouse, domestic partner, etc) of an `Employee` ### Usage Example Fetch from the `LIST Dependents` endpoint and filter by `ID` to show all dependents.
|
18
|
+
class Dependent
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The third-party API ID of the matching object.
|
22
|
+
attr_accessor :remote_id
|
23
|
+
|
24
|
+
# The dependents's first name.
|
25
|
+
attr_accessor :first_name
|
26
|
+
|
27
|
+
# The dependents's middle name.
|
28
|
+
attr_accessor :middle_name
|
29
|
+
|
30
|
+
# The dependents's last name.
|
31
|
+
attr_accessor :last_name
|
32
|
+
|
33
|
+
# The dependent's relationship to the employee. * `CHILD` - CHILD * `SPOUSE` - SPOUSE * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER
|
34
|
+
attr_accessor :relationship
|
35
|
+
|
36
|
+
# The employee this person is a dependent of.
|
37
|
+
attr_accessor :employee
|
38
|
+
|
39
|
+
# The dependent's date of birth.
|
40
|
+
attr_accessor :date_of_birth
|
41
|
+
|
42
|
+
# The dependent's gender. * `MALE` - MALE * `FEMALE` - FEMALE * `NON-BINARY` - NON-BINARY * `OTHER` - OTHER * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE
|
43
|
+
attr_accessor :gender
|
44
|
+
|
45
|
+
# The dependent's phone number.
|
46
|
+
attr_accessor :phone_number
|
47
|
+
|
48
|
+
# The dependents's home address.
|
49
|
+
attr_accessor :home_location
|
50
|
+
|
51
|
+
# Whether or not the dependent is a student
|
52
|
+
attr_accessor :is_student
|
53
|
+
|
54
|
+
# The dependents's social security number.
|
55
|
+
attr_accessor :ssn
|
56
|
+
|
57
|
+
# Indicates whether or not this object has been deleted by third party webhooks.
|
58
|
+
attr_accessor :remote_was_deleted
|
59
|
+
|
60
|
+
# This is the datetime that this object was last updated by Merge
|
61
|
+
attr_accessor :modified_at
|
62
|
+
|
63
|
+
attr_accessor :field_mappings
|
64
|
+
|
65
|
+
attr_accessor :remote_data
|
66
|
+
|
67
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
+
def self.attribute_map
|
69
|
+
{
|
70
|
+
:'id' => :'id',
|
71
|
+
:'remote_id' => :'remote_id',
|
72
|
+
:'first_name' => :'first_name',
|
73
|
+
:'middle_name' => :'middle_name',
|
74
|
+
:'last_name' => :'last_name',
|
75
|
+
:'relationship' => :'relationship',
|
76
|
+
:'employee' => :'employee',
|
77
|
+
:'date_of_birth' => :'date_of_birth',
|
78
|
+
:'gender' => :'gender',
|
79
|
+
:'phone_number' => :'phone_number',
|
80
|
+
:'home_location' => :'home_location',
|
81
|
+
:'is_student' => :'is_student',
|
82
|
+
:'ssn' => :'ssn',
|
83
|
+
:'remote_was_deleted' => :'remote_was_deleted',
|
84
|
+
:'modified_at' => :'modified_at',
|
85
|
+
:'field_mappings' => :'field_mappings',
|
86
|
+
:'remote_data' => :'remote_data'
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# Returns all the JSON keys this model knows about
|
91
|
+
def self.acceptable_attributes
|
92
|
+
attribute_map.values
|
93
|
+
end
|
94
|
+
|
95
|
+
# Attribute type mapping.
|
96
|
+
def self.openapi_types
|
97
|
+
{
|
98
|
+
:'id' => :'String',
|
99
|
+
:'remote_id' => :'String',
|
100
|
+
:'first_name' => :'String',
|
101
|
+
:'middle_name' => :'String',
|
102
|
+
:'last_name' => :'String',
|
103
|
+
:'relationship' => :'RelationshipEnum',
|
104
|
+
:'employee' => :'String',
|
105
|
+
:'date_of_birth' => :'Time',
|
106
|
+
:'gender' => :'GenderEnum',
|
107
|
+
:'phone_number' => :'String',
|
108
|
+
:'home_location' => :'String',
|
109
|
+
:'is_student' => :'Boolean',
|
110
|
+
:'ssn' => :'String',
|
111
|
+
:'remote_was_deleted' => :'Boolean',
|
112
|
+
:'modified_at' => :'Time',
|
113
|
+
:'field_mappings' => :'Hash<String, Object>',
|
114
|
+
:'remote_data' => :'Array<RemoteData>'
|
115
|
+
}
|
116
|
+
end
|
117
|
+
|
118
|
+
# List of attributes with nullable: true
|
119
|
+
def self.openapi_nullable
|
120
|
+
Set.new([
|
121
|
+
:'remote_id',
|
122
|
+
:'first_name',
|
123
|
+
:'middle_name',
|
124
|
+
:'last_name',
|
125
|
+
:'relationship',
|
126
|
+
:'employee',
|
127
|
+
:'date_of_birth',
|
128
|
+
:'gender',
|
129
|
+
:'phone_number',
|
130
|
+
:'home_location',
|
131
|
+
:'is_student',
|
132
|
+
:'ssn',
|
133
|
+
:'field_mappings',
|
134
|
+
:'remote_data'
|
135
|
+
])
|
136
|
+
end
|
137
|
+
|
138
|
+
# Initializes the object
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
def initialize(attributes = {})
|
141
|
+
if (!attributes.is_a?(Hash))
|
142
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::Dependent` initialize method"
|
143
|
+
end
|
144
|
+
|
145
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
146
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
147
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
148
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::Dependent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
149
|
+
end
|
150
|
+
h[k.to_sym] = v
|
151
|
+
}
|
152
|
+
|
153
|
+
if attributes.key?(:'id')
|
154
|
+
self.id = attributes[:'id']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.key?(:'remote_id')
|
158
|
+
self.remote_id = attributes[:'remote_id']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'first_name')
|
162
|
+
self.first_name = attributes[:'first_name']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.key?(:'middle_name')
|
166
|
+
self.middle_name = attributes[:'middle_name']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'last_name')
|
170
|
+
self.last_name = attributes[:'last_name']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'relationship')
|
174
|
+
self.relationship = attributes[:'relationship']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'employee')
|
178
|
+
self.employee = attributes[:'employee']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'date_of_birth')
|
182
|
+
self.date_of_birth = attributes[:'date_of_birth']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.key?(:'gender')
|
186
|
+
self.gender = attributes[:'gender']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'phone_number')
|
190
|
+
self.phone_number = attributes[:'phone_number']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'home_location')
|
194
|
+
self.home_location = attributes[:'home_location']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'is_student')
|
198
|
+
self.is_student = attributes[:'is_student']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'ssn')
|
202
|
+
self.ssn = attributes[:'ssn']
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'remote_was_deleted')
|
206
|
+
self.remote_was_deleted = attributes[:'remote_was_deleted']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'modified_at')
|
210
|
+
self.modified_at = attributes[:'modified_at']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'field_mappings')
|
214
|
+
if (value = attributes[:'field_mappings']).is_a?(Hash)
|
215
|
+
self.field_mappings = value
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
if attributes.key?(:'remote_data')
|
220
|
+
if (value = attributes[:'remote_data']).is_a?(Array)
|
221
|
+
self.remote_data = value
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
227
|
+
# @return Array for valid properties with the reasons
|
228
|
+
def list_invalid_properties
|
229
|
+
invalid_properties = Array.new
|
230
|
+
if !@first_name.nil? && @first_name.to_s.length > 60
|
231
|
+
invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 60.')
|
232
|
+
end
|
233
|
+
|
234
|
+
if !@middle_name.nil? && @middle_name.to_s.length > 60
|
235
|
+
invalid_properties.push('invalid value for "middle_name", the character length must be smaller than or equal to 60.')
|
236
|
+
end
|
237
|
+
|
238
|
+
if !@last_name.nil? && @last_name.to_s.length > 60
|
239
|
+
invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 60.')
|
240
|
+
end
|
241
|
+
|
242
|
+
if !@phone_number.nil? && @phone_number.to_s.length > 50
|
243
|
+
invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 50.')
|
244
|
+
end
|
245
|
+
|
246
|
+
if !@ssn.nil? && @ssn.to_s.length > 50
|
247
|
+
invalid_properties.push('invalid value for "ssn", the character length must be smaller than or equal to 50.')
|
248
|
+
end
|
249
|
+
|
250
|
+
invalid_properties
|
251
|
+
end
|
252
|
+
|
253
|
+
# Check to see if the all the properties in the model are valid
|
254
|
+
# @return true if the model is valid
|
255
|
+
def valid?
|
256
|
+
return false if !@first_name.nil? && @first_name.to_s.length > 60
|
257
|
+
return false if !@middle_name.nil? && @middle_name.to_s.length > 60
|
258
|
+
return false if !@last_name.nil? && @last_name.to_s.length > 60
|
259
|
+
return false if !@phone_number.nil? && @phone_number.to_s.length > 50
|
260
|
+
return false if !@ssn.nil? && @ssn.to_s.length > 50
|
261
|
+
true
|
262
|
+
end
|
263
|
+
|
264
|
+
# Custom attribute writer method with validation
|
265
|
+
# @param [Object] first_name Value to be assigned
|
266
|
+
def first_name=(first_name)
|
267
|
+
if !first_name.nil? && first_name.to_s.length > 60
|
268
|
+
fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 60.'
|
269
|
+
end
|
270
|
+
|
271
|
+
@first_name = first_name
|
272
|
+
end
|
273
|
+
|
274
|
+
# Custom attribute writer method with validation
|
275
|
+
# @param [Object] middle_name Value to be assigned
|
276
|
+
def middle_name=(middle_name)
|
277
|
+
if !middle_name.nil? && middle_name.to_s.length > 60
|
278
|
+
fail ArgumentError, 'invalid value for "middle_name", the character length must be smaller than or equal to 60.'
|
279
|
+
end
|
280
|
+
|
281
|
+
@middle_name = middle_name
|
282
|
+
end
|
283
|
+
|
284
|
+
# Custom attribute writer method with validation
|
285
|
+
# @param [Object] last_name Value to be assigned
|
286
|
+
def last_name=(last_name)
|
287
|
+
if !last_name.nil? && last_name.to_s.length > 60
|
288
|
+
fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 60.'
|
289
|
+
end
|
290
|
+
|
291
|
+
@last_name = last_name
|
292
|
+
end
|
293
|
+
|
294
|
+
# Custom attribute writer method with validation
|
295
|
+
# @param [Object] phone_number Value to be assigned
|
296
|
+
def phone_number=(phone_number)
|
297
|
+
if !phone_number.nil? && phone_number.to_s.length > 50
|
298
|
+
fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 50.'
|
299
|
+
end
|
300
|
+
|
301
|
+
@phone_number = phone_number
|
302
|
+
end
|
303
|
+
|
304
|
+
# Custom attribute writer method with validation
|
305
|
+
# @param [Object] ssn Value to be assigned
|
306
|
+
def ssn=(ssn)
|
307
|
+
if !ssn.nil? && ssn.to_s.length > 50
|
308
|
+
fail ArgumentError, 'invalid value for "ssn", the character length must be smaller than or equal to 50.'
|
309
|
+
end
|
310
|
+
|
311
|
+
@ssn = ssn
|
312
|
+
end
|
313
|
+
|
314
|
+
# Checks equality by comparing each attribute.
|
315
|
+
# @param [Object] Object to be compared
|
316
|
+
def ==(o)
|
317
|
+
return true if self.equal?(o)
|
318
|
+
self.class == o.class &&
|
319
|
+
id == o.id &&
|
320
|
+
remote_id == o.remote_id &&
|
321
|
+
first_name == o.first_name &&
|
322
|
+
middle_name == o.middle_name &&
|
323
|
+
last_name == o.last_name &&
|
324
|
+
relationship == o.relationship &&
|
325
|
+
employee == o.employee &&
|
326
|
+
date_of_birth == o.date_of_birth &&
|
327
|
+
gender == o.gender &&
|
328
|
+
phone_number == o.phone_number &&
|
329
|
+
home_location == o.home_location &&
|
330
|
+
is_student == o.is_student &&
|
331
|
+
ssn == o.ssn &&
|
332
|
+
remote_was_deleted == o.remote_was_deleted &&
|
333
|
+
modified_at == o.modified_at &&
|
334
|
+
field_mappings == o.field_mappings &&
|
335
|
+
remote_data == o.remote_data
|
336
|
+
end
|
337
|
+
|
338
|
+
# @see the `==` method
|
339
|
+
# @param [Object] Object to be compared
|
340
|
+
def eql?(o)
|
341
|
+
self == o
|
342
|
+
end
|
343
|
+
|
344
|
+
# Calculates hash code according to all attributes.
|
345
|
+
# @return [Integer] Hash code
|
346
|
+
def hash
|
347
|
+
[id, remote_id, first_name, middle_name, last_name, relationship, employee, date_of_birth, gender, phone_number, home_location, is_student, ssn, remote_was_deleted, modified_at, field_mappings, remote_data].hash
|
348
|
+
end
|
349
|
+
|
350
|
+
# Builds the object from hash
|
351
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
352
|
+
# @return [Object] Returns the model itself
|
353
|
+
def self.build_from_hash(attributes)
|
354
|
+
new.build_from_hash(attributes)
|
355
|
+
end
|
356
|
+
|
357
|
+
# Builds the object from hash
|
358
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
359
|
+
# @return [Object] Returns the model itself
|
360
|
+
def build_from_hash(attributes)
|
361
|
+
return nil unless attributes.is_a?(Hash)
|
362
|
+
self.class.openapi_types.each_pair do |key, type|
|
363
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
364
|
+
self.send("#{key}=", nil)
|
365
|
+
elsif type =~ /\AArray<(.*)>/i
|
366
|
+
# check to ensure the input is an array given that the attribute
|
367
|
+
# is documented as an array but the input is not
|
368
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
369
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
370
|
+
end
|
371
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
372
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
self
|
377
|
+
end
|
378
|
+
|
379
|
+
# Deserializes the data based on type
|
380
|
+
# @param string type Data type
|
381
|
+
# @param string value Value to be deserialized
|
382
|
+
# @return [Object] Deserialized data
|
383
|
+
def _deserialize(type, value)
|
384
|
+
case type.to_sym
|
385
|
+
when :Time
|
386
|
+
Time.parse(value)
|
387
|
+
when :Date
|
388
|
+
Date.parse(value)
|
389
|
+
when :String
|
390
|
+
value
|
391
|
+
when :Integer
|
392
|
+
value.to_i
|
393
|
+
when :Float
|
394
|
+
value.to_f
|
395
|
+
when :Boolean
|
396
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
397
|
+
true
|
398
|
+
else
|
399
|
+
false
|
400
|
+
end
|
401
|
+
when :Object
|
402
|
+
# generic object (usually a Hash), return directly
|
403
|
+
value
|
404
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
405
|
+
inner_type = Regexp.last_match[:inner_type]
|
406
|
+
value.map { |v| _deserialize(inner_type, v) }
|
407
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
408
|
+
k_type = Regexp.last_match[:k_type]
|
409
|
+
v_type = Regexp.last_match[:v_type]
|
410
|
+
{}.tap do |hash|
|
411
|
+
value.each do |k, v|
|
412
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
413
|
+
end
|
414
|
+
end
|
415
|
+
else # model
|
416
|
+
# models (e.g. Pet) or oneOf
|
417
|
+
klass = MergeHRISClient.const_get(type)
|
418
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
419
|
+
end
|
420
|
+
end
|
421
|
+
|
422
|
+
# Returns the string representation of the object
|
423
|
+
# @return [String] String presentation of the object
|
424
|
+
def to_s
|
425
|
+
to_hash.to_s
|
426
|
+
end
|
427
|
+
|
428
|
+
# to_body is an alias to to_hash (backward compatibility)
|
429
|
+
# @return [Hash] Returns the object in the form of hash
|
430
|
+
def to_body
|
431
|
+
to_hash
|
432
|
+
end
|
433
|
+
|
434
|
+
# Returns the object in the form of hash
|
435
|
+
# @return [Hash] Returns the object in the form of hash
|
436
|
+
def to_hash
|
437
|
+
hash = {}
|
438
|
+
self.class.attribute_map.each_pair do |attr, param|
|
439
|
+
value = self.send(attr)
|
440
|
+
if value.nil?
|
441
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
442
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
443
|
+
end
|
444
|
+
|
445
|
+
hash[param] = _to_hash(value)
|
446
|
+
end
|
447
|
+
hash
|
448
|
+
end
|
449
|
+
|
450
|
+
# Outputs non-array value in the form of hash
|
451
|
+
# For object, use to_hash. Otherwise, just return the value
|
452
|
+
# @param [Object] value Any valid value
|
453
|
+
# @return [Hash] Returns the value in the form of hash
|
454
|
+
def _to_hash(value)
|
455
|
+
if value.is_a?(Array)
|
456
|
+
value.compact.map { |v| _to_hash(v) }
|
457
|
+
elsif value.is_a?(Hash)
|
458
|
+
{}.tap do |hash|
|
459
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
460
|
+
end
|
461
|
+
elsif value.respond_to? :to_hash
|
462
|
+
value.to_hash
|
463
|
+
else
|
464
|
+
value
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
end
|
469
|
+
|
470
|
+
end
|