merge_hris_client 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -9
  3. data/docs/AccountDetails.md +30 -0
  4. data/docs/AccountDetailsAndActions.md +32 -0
  5. data/docs/AccountDetailsAndActionsIntegration.md +32 -0
  6. data/docs/AccountDetailsAndActionsStatusEnum.md +15 -0
  7. data/docs/AccountDetailsApi.md +76 -0
  8. data/docs/AccountTypeEnum.md +15 -0
  9. data/docs/BankInfo.md +34 -0
  10. data/docs/BankInfoApi.md +193 -0
  11. data/docs/BenefitsApi.md +2 -78
  12. data/docs/{StateEnum.md → CategoriesEnum.md} +2 -2
  13. data/docs/{NullEnum.md → CategoryEnum.md} +2 -2
  14. data/docs/CompaniesApi.md +3 -1
  15. data/docs/DataPassthroughRequest.md +5 -3
  16. data/docs/DeductionsApi.md +179 -0
  17. data/docs/Employee.md +12 -8
  18. data/docs/EmployeePayrollRun.md +3 -3
  19. data/docs/EmployeePayrollRunsApi.md +13 -3
  20. data/docs/EmployeesApi.md +12 -82
  21. data/docs/Employment.md +3 -1
  22. data/docs/EmploymentsApi.md +7 -78
  23. data/docs/EndUserDetailsRequest.md +1 -1
  24. data/docs/ErrorValidationProblem.md +24 -0
  25. data/docs/ForceResyncApi.md +79 -0
  26. data/docs/IssuesApi.md +11 -10
  27. data/docs/LinkedAccountsApi.md +103 -0
  28. data/docs/Location.md +2 -0
  29. data/docs/LocationsApi.md +2 -0
  30. data/docs/PaginatedAccountDetailsAndActionsList.md +22 -0
  31. data/docs/PaginatedBankInfoList.md +22 -0
  32. data/docs/PaginatedDeductionList.md +22 -0
  33. data/docs/PaginatedIssueList.md +2 -2
  34. data/docs/PaginatedPayGroupList.md +22 -0
  35. data/docs/PaginatedSyncStatusList.md +2 -2
  36. data/docs/PayGroup.md +24 -0
  37. data/docs/PayGroupsApi.md +177 -0
  38. data/docs/PayrollRun.md +3 -3
  39. data/docs/PayrollRunsApi.md +13 -1
  40. data/docs/PolicyTypeEnum.md +15 -0
  41. data/docs/RequestFormatEnum.md +15 -0
  42. data/docs/SyncStatusApi.md +3 -74
  43. data/docs/TeamsApi.md +7 -2
  44. data/docs/TimeOff.md +3 -3
  45. data/docs/TimeOffApi.md +88 -4
  46. data/docs/TimeOffBalance.md +4 -2
  47. data/docs/{TimeOffBalanceApi.md → TimeOffBalancesApi.md} +26 -22
  48. data/docs/TimeOffEndpointRequest.md +18 -0
  49. data/docs/TimeOffRequest.md +36 -0
  50. data/docs/TimeOffResponse.md +22 -0
  51. data/docs/ValidationProblemSource.md +18 -0
  52. data/docs/WarningValidationProblem.md +24 -0
  53. data/lib/merge_hris_client/api/account_details_api.rb +77 -0
  54. data/lib/merge_hris_client/api/bank_info_api.rb +222 -0
  55. data/lib/merge_hris_client/api/benefits_api.rb +3 -69
  56. data/lib/merge_hris_client/api/companies_api.rb +3 -0
  57. data/lib/merge_hris_client/api/deductions_api.rb +185 -0
  58. data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +17 -2
  59. data/lib/merge_hris_client/api/employees_api.rb +18 -75
  60. data/lib/merge_hris_client/api/employments_api.rb +24 -69
  61. data/lib/merge_hris_client/api/force_resync_api.rb +84 -0
  62. data/lib/merge_hris_client/api/issues_api.rb +10 -10
  63. data/lib/merge_hris_client/api/linked_accounts_api.rb +117 -0
  64. data/lib/merge_hris_client/api/locations_api.rb +3 -0
  65. data/lib/merge_hris_client/api/pay_groups_api.rb +182 -0
  66. data/lib/merge_hris_client/api/payroll_runs_api.rb +22 -0
  67. data/lib/merge_hris_client/api/sync_status_api.rb +4 -4
  68. data/lib/merge_hris_client/api/teams_api.rb +17 -0
  69. data/lib/merge_hris_client/api/time_off_api.rb +92 -2
  70. data/lib/merge_hris_client/api/time_off_balances_api.rb +206 -0
  71. data/lib/merge_hris_client/models/account_details.rb +273 -0
  72. data/lib/merge_hris_client/models/account_details_and_actions.rb +302 -0
  73. data/lib/merge_hris_client/models/account_details_and_actions_integration.rb +310 -0
  74. data/lib/merge_hris_client/models/account_details_and_actions_status_enum.rb +36 -0
  75. data/lib/merge_hris_client/models/account_integration.rb +1 -1
  76. data/lib/merge_hris_client/models/account_type_enum.rb +35 -0
  77. data/lib/merge_hris_client/models/bank_info.rb +323 -0
  78. data/lib/merge_hris_client/models/categories_enum.rb +36 -0
  79. data/lib/merge_hris_client/models/category_enum.rb +36 -0
  80. data/lib/merge_hris_client/models/data_passthrough_request.rb +66 -9
  81. data/lib/merge_hris_client/models/employee.rb +32 -8
  82. data/lib/merge_hris_client/models/employment.rb +12 -1
  83. data/lib/merge_hris_client/models/end_user_details_request.rb +73 -1
  84. data/lib/merge_hris_client/models/error_validation_problem.rb +260 -0
  85. data/lib/merge_hris_client/models/generate_remote_key_request.rb +19 -0
  86. data/lib/merge_hris_client/models/location.rb +12 -1
  87. data/lib/merge_hris_client/models/marital_status_enum.rb +1 -1
  88. data/lib/merge_hris_client/models/paginated_account_details_and_actions_list.rb +240 -0
  89. data/lib/merge_hris_client/models/paginated_bank_info_list.rb +240 -0
  90. data/lib/merge_hris_client/models/paginated_deduction_list.rb +240 -0
  91. data/lib/merge_hris_client/models/paginated_pay_group_list.rb +240 -0
  92. data/lib/merge_hris_client/models/{benefit_request.rb → pay_group.rb} +31 -54
  93. data/lib/merge_hris_client/models/policy_type_enum.rb +39 -0
  94. data/lib/merge_hris_client/models/remote_data_request.rb +19 -0
  95. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +19 -0
  96. data/lib/merge_hris_client/models/request_format_enum.rb +35 -0
  97. data/lib/merge_hris_client/models/request_type_enum.rb +2 -1
  98. data/lib/merge_hris_client/models/sync_status_status_enum.rb +2 -0
  99. data/lib/merge_hris_client/models/time_off_balance.rb +14 -3
  100. data/lib/merge_hris_client/models/time_off_endpoint_request.rb +223 -0
  101. data/lib/merge_hris_client/models/{employment_request.rb → time_off_request.rb} +80 -69
  102. data/lib/merge_hris_client/models/time_off_response.rb +255 -0
  103. data/lib/merge_hris_client/models/validation_problem_source.rb +223 -0
  104. data/lib/merge_hris_client/models/warning_validation_problem.rb +260 -0
  105. data/lib/merge_hris_client/version.rb +1 -1
  106. data/lib/merge_hris_client.rb +28 -4
  107. data/spec/api/account_details_api_spec.rb +45 -0
  108. data/spec/api/account_token_api_spec.rb +1 -1
  109. data/spec/api/available_actions_api_spec.rb +1 -1
  110. data/spec/api/bank_info_api_spec.rb +76 -0
  111. data/spec/api/benefits_api_spec.rb +4 -1
  112. data/spec/api/companies_api_spec.rb +4 -1
  113. data/spec/api/deductions_api_spec.rb +69 -0
  114. data/spec/api/employee_payroll_runs_api_spec.rb +9 -2
  115. data/spec/api/employees_api_spec.rb +9 -1
  116. data/spec/api/employments_api_spec.rb +7 -1
  117. data/spec/api/force_resync_api_spec.rb +46 -0
  118. data/spec/api/issues_api_spec.rb +5 -5
  119. data/spec/api/link_token_api_spec.rb +2 -2
  120. data/spec/api/linked_accounts_api_spec.rb +57 -0
  121. data/spec/api/locations_api_spec.rb +4 -1
  122. data/spec/api/passthrough_api_spec.rb +2 -3
  123. data/spec/api/pay_groups_api_spec.rb +68 -0
  124. data/spec/api/payroll_runs_api_spec.rb +9 -1
  125. data/spec/api/regenerate_key_api_spec.rb +2 -2
  126. data/spec/api/sync_status_api_spec.rb +2 -13
  127. data/spec/api/teams_api_spec.rb +7 -1
  128. data/spec/api/time_off_api_spec.rb +20 -2
  129. data/spec/api/{time_off_balance_api_spec.rb → time_off_balances_api_spec.rb} +13 -11
  130. data/spec/models/account_details_and_actions_integration_spec.rb +76 -0
  131. data/spec/models/account_details_and_actions_spec.rb +76 -0
  132. data/spec/models/account_details_and_actions_status_enum_spec.rb +28 -0
  133. data/spec/models/{benefit_request_spec.rb → account_details_spec.rb} +18 -12
  134. data/spec/models/account_integration_spec.rb +7 -1
  135. data/spec/models/account_token_spec.rb +7 -1
  136. data/spec/models/account_type_enum_spec.rb +28 -0
  137. data/spec/models/available_actions_spec.rb +13 -1
  138. data/spec/models/{employment_request_spec.rb → bank_info_spec.rb} +15 -15
  139. data/spec/models/benefit_plan_type_enum_spec.rb +1 -1
  140. data/spec/models/benefit_spec.rb +7 -1
  141. data/spec/models/categories_enum_spec.rb +28 -0
  142. data/spec/models/{state_enum_spec.rb → category_enum_spec.rb} +7 -7
  143. data/spec/models/company_spec.rb +7 -1
  144. data/spec/models/country_enum_spec.rb +1 -1
  145. data/spec/models/data_passthrough_request_spec.rb +7 -1
  146. data/spec/models/deduction_spec.rb +7 -1
  147. data/spec/models/earning_spec.rb +7 -1
  148. data/spec/models/employee_payroll_run_spec.rb +7 -1
  149. data/spec/models/employee_spec.rb +31 -1
  150. data/spec/models/employment_spec.rb +13 -1
  151. data/spec/models/employment_status_enum_spec.rb +1 -1
  152. data/spec/models/employment_type_enum_spec.rb +1 -1
  153. data/spec/models/end_user_details_request_spec.rb +7 -5
  154. data/spec/models/{end_user_details_spec.rb → error_validation_problem_spec.rb} +11 -15
  155. data/spec/models/ethnicity_enum_spec.rb +1 -1
  156. data/spec/models/flsa_status_enum_spec.rb +1 -1
  157. data/spec/models/gender_enum_spec.rb +1 -1
  158. data/spec/models/link_token_spec.rb +1 -1
  159. data/spec/models/location_spec.rb +13 -1
  160. data/spec/models/marital_status_enum_spec.rb +1 -1
  161. data/spec/models/method_enum_spec.rb +1 -1
  162. data/spec/models/model_operation_spec.rb +13 -1
  163. data/spec/models/paginated_account_details_and_actions_list_spec.rb +46 -0
  164. data/spec/models/paginated_bank_info_list_spec.rb +46 -0
  165. data/spec/models/paginated_benefit_list_spec.rb +1 -1
  166. data/spec/models/paginated_company_list_spec.rb +1 -1
  167. data/spec/models/paginated_deduction_list_spec.rb +46 -0
  168. data/spec/models/paginated_employee_list_spec.rb +1 -1
  169. data/spec/models/paginated_employee_payroll_run_list_spec.rb +1 -1
  170. data/spec/models/paginated_employment_list_spec.rb +1 -1
  171. data/spec/models/paginated_location_list_spec.rb +1 -1
  172. data/spec/models/paginated_pay_group_list_spec.rb +46 -0
  173. data/spec/models/paginated_payroll_run_list_spec.rb +1 -1
  174. data/spec/models/paginated_team_list_spec.rb +1 -1
  175. data/spec/models/paginated_time_off_list_spec.rb +1 -1
  176. data/spec/models/pay_currency_enum_spec.rb +1 -1
  177. data/spec/models/pay_frequency_enum_spec.rb +1 -1
  178. data/spec/models/{data_passthrough_spec.rb → pay_group_spec.rb} +11 -11
  179. data/spec/models/pay_period_enum_spec.rb +1 -1
  180. data/spec/models/payroll_run_spec.rb +7 -1
  181. data/spec/models/policy_type_enum_spec.rb +28 -0
  182. data/spec/models/remote_data_spec.rb +1 -1
  183. data/spec/models/remote_key_for_regeneration_request_spec.rb +1 -1
  184. data/spec/models/remote_key_spec.rb +1 -1
  185. data/spec/models/remote_response_spec.rb +1 -1
  186. data/spec/models/request_format_enum_spec.rb +28 -0
  187. data/spec/models/request_type_enum_spec.rb +1 -1
  188. data/spec/models/run_state_enum_spec.rb +1 -1
  189. data/spec/models/run_type_enum_spec.rb +1 -1
  190. data/spec/models/tax_spec.rb +7 -1
  191. data/spec/models/team_spec.rb +13 -1
  192. data/spec/models/time_off_balance_spec.rb +6 -0
  193. data/spec/models/{remote_key_for_regeneration_spec.rb → time_off_endpoint_request_spec.rb} +8 -8
  194. data/spec/models/time_off_request_spec.rb +88 -0
  195. data/spec/models/time_off_response_spec.rb +46 -0
  196. data/spec/models/time_off_spec.rb +19 -1
  197. data/spec/models/time_off_status_enum_spec.rb +1 -1
  198. data/spec/models/type_enum_spec.rb +1 -1
  199. data/spec/models/units_enum_spec.rb +1 -1
  200. data/spec/models/validation_problem_source_spec.rb +34 -0
  201. data/spec/models/warning_validation_problem_spec.rb +52 -0
  202. data/test_ruby.rb +11 -14
  203. metadata +115 -33
  204. data/docs/BenefitRequest.md +0 -28
  205. data/docs/DataPassthrough.md +0 -24
  206. data/docs/EmployeeRequest.md +0 -62
  207. data/docs/EmploymentRequest.md +0 -34
  208. data/docs/EndUserDetails.md +0 -24
  209. data/docs/RemoteKeyForRegeneration.md +0 -18
  210. data/lib/merge_hris_client/models/employee_request.rb +0 -523
  211. data/merge_hris_client-1.0.0.gem +0 -0
  212. data/merge_hris_client-1.0.1.gem +0 -0
  213. data/spec/models/employee_request_spec.rb +0 -160
@@ -21,6 +21,9 @@ module MergeHRISClient
21
21
  # The third-party API ID of the matching object.
22
22
  attr_accessor :remote_id
23
23
 
24
+ # The employee holding this position.
25
+ attr_accessor :employee
26
+
24
27
  # The position's title.
25
28
  attr_accessor :job_title
26
29
 
@@ -52,6 +55,7 @@ module MergeHRISClient
52
55
  {
53
56
  :'id' => :'id',
54
57
  :'remote_id' => :'remote_id',
58
+ :'employee' => :'employee',
55
59
  :'job_title' => :'job_title',
56
60
  :'pay_rate' => :'pay_rate',
57
61
  :'pay_period' => :'pay_period',
@@ -74,6 +78,7 @@ module MergeHRISClient
74
78
  {
75
79
  :'id' => :'String',
76
80
  :'remote_id' => :'String',
81
+ :'employee' => :'String',
77
82
  :'job_title' => :'String',
78
83
  :'pay_rate' => :'Float',
79
84
  :'pay_period' => :'PayPeriodEnum',
@@ -90,6 +95,7 @@ module MergeHRISClient
90
95
  def self.openapi_nullable
91
96
  Set.new([
92
97
  :'remote_id',
98
+ :'employee',
93
99
  :'job_title',
94
100
  :'pay_rate',
95
101
  :'pay_period',
@@ -125,6 +131,10 @@ module MergeHRISClient
125
131
  self.remote_id = attributes[:'remote_id']
126
132
  end
127
133
 
134
+ if attributes.key?(:'employee')
135
+ self.employee = attributes[:'employee']
136
+ end
137
+
128
138
  if attributes.key?(:'job_title')
129
139
  self.job_title = attributes[:'job_title']
130
140
  end
@@ -184,6 +194,7 @@ module MergeHRISClient
184
194
  self.class == o.class &&
185
195
  id == o.id &&
186
196
  remote_id == o.remote_id &&
197
+ employee == o.employee &&
187
198
  job_title == o.job_title &&
188
199
  pay_rate == o.pay_rate &&
189
200
  pay_period == o.pay_period &&
@@ -204,7 +215,7 @@ module MergeHRISClient
204
215
  # Calculates hash code according to all attributes.
205
216
  # @return [Integer] Hash code
206
217
  def hash
207
- [id, remote_id, job_title, pay_rate, pay_period, pay_frequency, pay_currency, flsa_status, effective_date, employment_type, remote_data].hash
218
+ [id, remote_id, employee, job_title, pay_rate, pay_period, pay_frequency, pay_currency, flsa_status, effective_date, employment_type, remote_data].hash
208
219
  end
209
220
 
210
221
  # Builds the object from hash
@@ -69,7 +69,7 @@ module MergeHRISClient
69
69
  :'end_user_email_address' => :'String',
70
70
  :'end_user_organization_name' => :'String',
71
71
  :'end_user_origin_id' => :'String',
72
- :'categories' => :'Array<String>',
72
+ :'categories' => :'Array<CategoriesEnum>',
73
73
  :'integration' => :'String'
74
74
  }
75
75
  end
@@ -127,14 +127,30 @@ module MergeHRISClient
127
127
  invalid_properties.push('invalid value for "end_user_email_address", end_user_email_address cannot be nil.')
128
128
  end
129
129
 
130
+ if @end_user_email_address.to_s.length < 1
131
+ invalid_properties.push('invalid value for "end_user_email_address", the character length must be great than or equal to 1.')
132
+ end
133
+
130
134
  if @end_user_organization_name.nil?
131
135
  invalid_properties.push('invalid value for "end_user_organization_name", end_user_organization_name cannot be nil.')
132
136
  end
133
137
 
138
+ if @end_user_organization_name.to_s.length < 1
139
+ invalid_properties.push('invalid value for "end_user_organization_name", the character length must be great than or equal to 1.')
140
+ end
141
+
134
142
  if @end_user_origin_id.nil?
135
143
  invalid_properties.push('invalid value for "end_user_origin_id", end_user_origin_id cannot be nil.')
136
144
  end
137
145
 
146
+ if @end_user_origin_id.to_s.length < 1
147
+ invalid_properties.push('invalid value for "end_user_origin_id", the character length must be great than or equal to 1.')
148
+ end
149
+
150
+ if !@integration.nil? && @integration.to_s.length < 1
151
+ invalid_properties.push('invalid value for "integration", the character length must be great than or equal to 1.')
152
+ end
153
+
138
154
  invalid_properties
139
155
  end
140
156
 
@@ -142,11 +158,67 @@ module MergeHRISClient
142
158
  # @return true if the model is valid
143
159
  def valid?
144
160
  return false if @end_user_email_address.nil?
161
+ return false if @end_user_email_address.to_s.length < 1
145
162
  return false if @end_user_organization_name.nil?
163
+ return false if @end_user_organization_name.to_s.length < 1
146
164
  return false if @end_user_origin_id.nil?
165
+ return false if @end_user_origin_id.to_s.length < 1
166
+ return false if !@integration.nil? && @integration.to_s.length < 1
147
167
  true
148
168
  end
149
169
 
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] end_user_email_address Value to be assigned
172
+ def end_user_email_address=(end_user_email_address)
173
+ if end_user_email_address.nil?
174
+ fail ArgumentError, 'end_user_email_address cannot be nil'
175
+ end
176
+
177
+ if end_user_email_address.to_s.length < 1
178
+ fail ArgumentError, 'invalid value for "end_user_email_address", the character length must be great than or equal to 1.'
179
+ end
180
+
181
+ @end_user_email_address = end_user_email_address
182
+ end
183
+
184
+ # Custom attribute writer method with validation
185
+ # @param [Object] end_user_organization_name Value to be assigned
186
+ def end_user_organization_name=(end_user_organization_name)
187
+ if end_user_organization_name.nil?
188
+ fail ArgumentError, 'end_user_organization_name cannot be nil'
189
+ end
190
+
191
+ if end_user_organization_name.to_s.length < 1
192
+ fail ArgumentError, 'invalid value for "end_user_organization_name", the character length must be great than or equal to 1.'
193
+ end
194
+
195
+ @end_user_organization_name = end_user_organization_name
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] end_user_origin_id Value to be assigned
200
+ def end_user_origin_id=(end_user_origin_id)
201
+ if end_user_origin_id.nil?
202
+ fail ArgumentError, 'end_user_origin_id cannot be nil'
203
+ end
204
+
205
+ if end_user_origin_id.to_s.length < 1
206
+ fail ArgumentError, 'invalid value for "end_user_origin_id", the character length must be great than or equal to 1.'
207
+ end
208
+
209
+ @end_user_origin_id = end_user_origin_id
210
+ end
211
+
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] integration Value to be assigned
214
+ def integration=(integration)
215
+ if !integration.nil? && integration.to_s.length < 1
216
+ fail ArgumentError, 'invalid value for "integration", the character length must be great than or equal to 1.'
217
+ end
218
+
219
+ @integration = integration
220
+ end
221
+
150
222
  # Checks equality by comparing each attribute.
151
223
  # @param [Object] Object to be compared
152
224
  def ==(o)
@@ -0,0 +1,260 @@
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 ErrorValidationProblem
18
+ attr_accessor :source
19
+
20
+ attr_accessor :title
21
+
22
+ attr_accessor :detail
23
+
24
+ attr_accessor :problem_type
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'source' => :'source',
30
+ :'title' => :'title',
31
+ :'detail' => :'detail',
32
+ :'problem_type' => :'problem_type'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'source' => :'ValidationProblemSource',
45
+ :'title' => :'String',
46
+ :'detail' => :'String',
47
+ :'problem_type' => :'String'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::ErrorValidationProblem` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::ErrorValidationProblem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'source')
73
+ self.source = attributes[:'source']
74
+ end
75
+
76
+ if attributes.key?(:'title')
77
+ self.title = attributes[:'title']
78
+ end
79
+
80
+ if attributes.key?(:'detail')
81
+ self.detail = attributes[:'detail']
82
+ end
83
+
84
+ if attributes.key?(:'problem_type')
85
+ self.problem_type = attributes[:'problem_type']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @title.nil?
94
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
95
+ end
96
+
97
+ if @detail.nil?
98
+ invalid_properties.push('invalid value for "detail", detail cannot be nil.')
99
+ end
100
+
101
+ if @problem_type.nil?
102
+ invalid_properties.push('invalid value for "problem_type", problem_type cannot be nil.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if @title.nil?
112
+ return false if @detail.nil?
113
+ return false if @problem_type.nil?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ source == o.source &&
123
+ title == o.title &&
124
+ detail == o.detail &&
125
+ problem_type == o.problem_type
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [source, title, detail, problem_type].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ new.build_from_hash(attributes)
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ self.class.openapi_types.each_pair do |key, type|
153
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
154
+ self.send("#{key}=", nil)
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = MergeHRISClient.const_get(type)
208
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -71,6 +71,10 @@ module MergeHRISClient
71
71
  invalid_properties.push('invalid value for "name", name cannot be nil.')
72
72
  end
73
73
 
74
+ if @name.to_s.length < 1
75
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
76
+ end
77
+
74
78
  invalid_properties
75
79
  end
76
80
 
@@ -78,9 +82,24 @@ module MergeHRISClient
78
82
  # @return true if the model is valid
79
83
  def valid?
80
84
  return false if @name.nil?
85
+ return false if @name.to_s.length < 1
81
86
  true
82
87
  end
83
88
 
89
+ # Custom attribute writer method with validation
90
+ # @param [Object] name Value to be assigned
91
+ def name=(name)
92
+ if name.nil?
93
+ fail ArgumentError, 'name cannot be nil'
94
+ end
95
+
96
+ if name.to_s.length < 1
97
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
98
+ end
99
+
100
+ @name = name
101
+ end
102
+
84
103
  # Checks equality by comparing each attribute.
85
104
  # @param [Object] Object to be compared
86
105
  def ==(o)
@@ -21,6 +21,9 @@ module MergeHRISClient
21
21
  # The third-party API ID of the matching object.
22
22
  attr_accessor :remote_id
23
23
 
24
+ # The location's name.
25
+ attr_accessor :name
26
+
24
27
  # The location's phone number.
25
28
  attr_accessor :phone_number
26
29
 
@@ -49,6 +52,7 @@ module MergeHRISClient
49
52
  {
50
53
  :'id' => :'id',
51
54
  :'remote_id' => :'remote_id',
55
+ :'name' => :'name',
52
56
  :'phone_number' => :'phone_number',
53
57
  :'street_1' => :'street_1',
54
58
  :'street_2' => :'street_2',
@@ -70,6 +74,7 @@ module MergeHRISClient
70
74
  {
71
75
  :'id' => :'String',
72
76
  :'remote_id' => :'String',
77
+ :'name' => :'String',
73
78
  :'phone_number' => :'String',
74
79
  :'street_1' => :'String',
75
80
  :'street_2' => :'String',
@@ -85,6 +90,7 @@ module MergeHRISClient
85
90
  def self.openapi_nullable
86
91
  Set.new([
87
92
  :'remote_id',
93
+ :'name',
88
94
  :'phone_number',
89
95
  :'street_1',
90
96
  :'street_2',
@@ -119,6 +125,10 @@ module MergeHRISClient
119
125
  self.remote_id = attributes[:'remote_id']
120
126
  end
121
127
 
128
+ if attributes.key?(:'name')
129
+ self.name = attributes[:'name']
130
+ end
131
+
122
132
  if attributes.key?(:'phone_number')
123
133
  self.phone_number = attributes[:'phone_number']
124
134
  end
@@ -174,6 +184,7 @@ module MergeHRISClient
174
184
  self.class == o.class &&
175
185
  id == o.id &&
176
186
  remote_id == o.remote_id &&
187
+ name == o.name &&
177
188
  phone_number == o.phone_number &&
178
189
  street_1 == o.street_1 &&
179
190
  street_2 == o.street_2 &&
@@ -193,7 +204,7 @@ module MergeHRISClient
193
204
  # Calculates hash code according to all attributes.
194
205
  # @return [Integer] Hash code
195
206
  def hash
196
- [id, remote_id, phone_number, street_1, street_2, city, state, zip_code, country, remote_data].hash
207
+ [id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, remote_data].hash
197
208
  end
198
209
 
199
210
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12