merge_hris_client 1.0.4 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -12
  3. data/docs/AccountDetails.md +11 -7
  4. data/docs/AccountDetailsAndActions.md +2 -0
  5. data/docs/AccountDetailsApi.md +10 -7
  6. data/docs/AccountIntegration.md +4 -4
  7. data/docs/AccountTokenApi.md +2 -2
  8. data/docs/AvailableActionsApi.md +2 -2
  9. data/docs/BankInfo.md +1 -1
  10. data/docs/BankInfoApi.md +8 -12
  11. data/docs/Benefit.md +2 -2
  12. data/docs/BenefitsApi.md +4 -4
  13. data/docs/CompaniesApi.md +4 -4
  14. data/docs/Company.md +2 -2
  15. data/docs/DataPassthroughRequest.md +3 -1
  16. data/docs/DebugModeLog.md +22 -0
  17. data/docs/DebugModelLogSummary.md +22 -0
  18. data/docs/Deduction.md +2 -2
  19. data/docs/DeductionsApi.md +4 -4
  20. data/docs/DeleteAccountApi.md +3 -2
  21. data/docs/Earning.md +3 -3
  22. data/docs/EarningTypeEnum.md +15 -0
  23. data/docs/Employee.md +17 -15
  24. data/docs/EmployeeEndpointRequest.md +18 -0
  25. data/docs/EmployeePayrollRun.md +2 -2
  26. data/docs/EmployeePayrollRunsApi.md +4 -4
  27. data/docs/EmployeeRequest.md +70 -0
  28. data/docs/EmployeeResponse.md +24 -0
  29. data/docs/EmployeesApi.md +232 -4
  30. data/docs/Employment.md +6 -4
  31. data/docs/EmploymentsApi.md +5 -4
  32. data/docs/EncodingEnum.md +15 -0
  33. data/docs/EndUserDetailsRequest.md +5 -3
  34. data/docs/ForceResyncApi.md +2 -2
  35. data/docs/GenerateKeyApi.md +2 -2
  36. data/docs/Group.md +28 -0
  37. data/docs/GroupTypeEnum.md +15 -0
  38. data/docs/GroupsApi.md +177 -0
  39. data/docs/IgnoreCommonModel.md +20 -0
  40. data/docs/IssuesApi.md +13 -4
  41. data/docs/LinkTokenApi.md +3 -3
  42. data/docs/LinkedAccountStatus.md +20 -0
  43. data/docs/LinkedAccountsApi.md +2 -2
  44. data/docs/Location.md +3 -1
  45. data/docs/LocationsApi.md +4 -4
  46. data/docs/MetaResponse.md +24 -0
  47. data/docs/MultipartFormFieldRequest.md +26 -0
  48. data/docs/PaginatedGroupList.md +22 -0
  49. data/docs/PassthroughApi.md +2 -2
  50. data/docs/PayGroupsApi.md +4 -4
  51. data/docs/PayrollRunsApi.md +4 -4
  52. data/docs/RegenerateKeyApi.md +2 -2
  53. data/docs/SyncStatusApi.md +0 -1
  54. data/docs/Tax.md +2 -2
  55. data/docs/Team.md +1 -1
  56. data/docs/TeamsApi.md +5 -4
  57. data/docs/TimeOff.md +4 -4
  58. data/docs/TimeOffApi.md +80 -6
  59. data/docs/TimeOffBalance.md +2 -2
  60. data/docs/TimeOffRequest.md +4 -4
  61. data/docs/TimeOffResponse.md +3 -1
  62. data/docs/WebhookReceiver.md +22 -0
  63. data/docs/WebhookReceiverRequest.md +22 -0
  64. data/docs/WebhookReceiversApi.md +153 -0
  65. data/lib/merge_hris_client/api/account_details_api.rb +10 -3
  66. data/lib/merge_hris_client/api/bank_info_api.rb +4 -9
  67. data/lib/merge_hris_client/api/employees_api.rb +216 -2
  68. data/lib/merge_hris_client/api/employments_api.rb +2 -2
  69. data/lib/merge_hris_client/api/groups_api.rb +182 -0
  70. data/lib/merge_hris_client/api/issues_api.rb +12 -0
  71. data/lib/merge_hris_client/api/linked_accounts_api.rb +1 -1
  72. data/lib/merge_hris_client/api/sync_status_api.rb +0 -62
  73. data/lib/merge_hris_client/api/time_off_api.rb +65 -0
  74. data/lib/merge_hris_client/api/webhook_receivers_api.rb +154 -0
  75. data/lib/merge_hris_client/configuration.rb +6 -4
  76. data/lib/merge_hris_client/models/account_details.rb +23 -5
  77. data/lib/merge_hris_client/models/account_details_and_actions.rb +16 -2
  78. data/lib/merge_hris_client/models/account_details_and_actions_integration.rb +1 -1
  79. data/lib/merge_hris_client/models/account_details_and_actions_status_enum.rb +1 -0
  80. data/lib/merge_hris_client/models/account_integration.rb +5 -27
  81. data/lib/merge_hris_client/models/account_token.rb +1 -1
  82. data/lib/merge_hris_client/models/account_type_enum.rb +1 -0
  83. data/lib/merge_hris_client/models/available_actions.rb +1 -1
  84. data/lib/merge_hris_client/models/bank_info.rb +0 -1
  85. data/lib/merge_hris_client/models/benefit.rb +1 -2
  86. data/lib/merge_hris_client/models/categories_enum.rb +1 -0
  87. data/lib/merge_hris_client/models/category_enum.rb +1 -0
  88. data/lib/merge_hris_client/models/company.rb +1 -1
  89. data/lib/merge_hris_client/models/country_enum.rb +1 -0
  90. data/lib/merge_hris_client/models/data_passthrough_request.rb +17 -3
  91. data/lib/merge_hris_client/models/debug_mode_log.rb +251 -0
  92. data/lib/merge_hris_client/models/debug_model_log_summary.rb +251 -0
  93. data/lib/merge_hris_client/models/deduction.rb +0 -1
  94. data/lib/merge_hris_client/models/earning.rb +4 -7
  95. data/lib/merge_hris_client/models/earning_type_enum.rb +38 -0
  96. data/lib/merge_hris_client/models/employee.rb +14 -9
  97. data/lib/merge_hris_client/models/employee_endpoint_request.rb +223 -0
  98. data/lib/merge_hris_client/models/employee_payroll_run.rb +1 -3
  99. data/lib/merge_hris_client/models/employee_request.rb +564 -0
  100. data/lib/merge_hris_client/models/employee_response.rb +266 -0
  101. data/lib/merge_hris_client/models/employment.rb +12 -3
  102. data/lib/merge_hris_client/models/employment_status_enum.rb +1 -1
  103. data/lib/merge_hris_client/models/employment_type_enum.rb +1 -1
  104. data/lib/merge_hris_client/models/encoding_enum.rb +36 -0
  105. data/lib/merge_hris_client/models/end_user_details_request.rb +74 -27
  106. data/lib/merge_hris_client/models/error_validation_problem.rb +1 -1
  107. data/lib/merge_hris_client/models/ethnicity_enum.rb +1 -1
  108. data/lib/merge_hris_client/models/flsa_status_enum.rb +1 -1
  109. data/lib/merge_hris_client/models/gender_enum.rb +1 -1
  110. data/lib/merge_hris_client/models/generate_remote_key_request.rb +1 -1
  111. data/lib/merge_hris_client/models/group.rb +275 -0
  112. data/lib/merge_hris_client/models/group_type_enum.rb +38 -0
  113. data/lib/merge_hris_client/models/ignore_common_model.rb +247 -0
  114. data/lib/merge_hris_client/models/ignore_common_model_request.rb +256 -0
  115. data/lib/merge_hris_client/models/issue.rb +1 -1
  116. data/lib/merge_hris_client/models/issue_status_enum.rb +1 -1
  117. data/lib/merge_hris_client/models/link_token.rb +1 -1
  118. data/lib/merge_hris_client/models/linked_account_status.rb +237 -0
  119. data/lib/merge_hris_client/models/location.rb +13 -2
  120. data/lib/merge_hris_client/models/location_type_enum.rb +36 -0
  121. data/lib/merge_hris_client/models/marital_status_enum.rb +1 -1
  122. data/lib/merge_hris_client/models/meta_response.rb +262 -0
  123. data/lib/merge_hris_client/models/method_enum.rb +1 -1
  124. data/lib/merge_hris_client/models/model_operation.rb +1 -1
  125. data/lib/merge_hris_client/models/multipart_form_field_request.rb +341 -0
  126. data/lib/merge_hris_client/models/paginated_account_details_and_actions_list.rb +1 -1
  127. data/lib/merge_hris_client/models/paginated_bank_info_list.rb +1 -1
  128. data/lib/merge_hris_client/models/paginated_benefit_list.rb +1 -1
  129. data/lib/merge_hris_client/models/paginated_company_list.rb +1 -1
  130. data/lib/merge_hris_client/models/paginated_deduction_list.rb +1 -1
  131. data/lib/merge_hris_client/models/paginated_employee_list.rb +1 -1
  132. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +1 -1
  133. data/lib/merge_hris_client/models/paginated_employment_list.rb +1 -1
  134. data/lib/merge_hris_client/models/paginated_group_list.rb +240 -0
  135. data/lib/merge_hris_client/models/paginated_issue_list.rb +1 -1
  136. data/lib/merge_hris_client/models/paginated_location_list.rb +1 -1
  137. data/lib/merge_hris_client/models/paginated_pay_group_list.rb +1 -1
  138. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +1 -1
  139. data/lib/merge_hris_client/models/paginated_sync_status_list.rb +1 -1
  140. data/lib/merge_hris_client/models/paginated_team_list.rb +1 -1
  141. data/lib/merge_hris_client/models/paginated_time_off_balance_list.rb +1 -1
  142. data/lib/merge_hris_client/models/paginated_time_off_list.rb +1 -1
  143. data/lib/merge_hris_client/models/pay_currency_enum.rb +1 -1
  144. data/lib/merge_hris_client/models/pay_frequency_enum.rb +1 -2
  145. data/lib/merge_hris_client/models/pay_period_enum.rb +1 -1
  146. data/lib/merge_hris_client/models/payroll_run.rb +1 -1
  147. data/lib/merge_hris_client/models/policy_type_enum.rb +1 -0
  148. data/lib/merge_hris_client/models/reason_enum.rb +37 -0
  149. data/lib/merge_hris_client/models/remote_data.rb +1 -1
  150. data/lib/merge_hris_client/models/remote_data_request.rb +1 -1
  151. data/lib/merge_hris_client/models/remote_key.rb +1 -1
  152. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +1 -1
  153. data/lib/merge_hris_client/models/remote_response.rb +1 -1
  154. data/lib/merge_hris_client/models/request_format_enum.rb +2 -0
  155. data/lib/merge_hris_client/models/request_type_enum.rb +1 -0
  156. data/lib/merge_hris_client/models/run_state_enum.rb +1 -1
  157. data/lib/merge_hris_client/models/run_type_enum.rb +1 -11
  158. data/lib/merge_hris_client/models/sync_status.rb +1 -1
  159. data/lib/merge_hris_client/models/sync_status_status_enum.rb +1 -2
  160. data/lib/merge_hris_client/models/tax.rb +3 -6
  161. data/lib/merge_hris_client/models/team.rb +0 -1
  162. data/lib/merge_hris_client/models/time_off.rb +0 -2
  163. data/lib/merge_hris_client/models/time_off_balance.rb +1 -2
  164. data/lib/merge_hris_client/models/time_off_endpoint_request.rb +1 -1
  165. data/lib/merge_hris_client/models/time_off_request.rb +1 -3
  166. data/lib/merge_hris_client/models/time_off_response.rb +16 -5
  167. data/lib/merge_hris_client/models/time_off_status_enum.rb +1 -1
  168. data/lib/merge_hris_client/models/units_enum.rb +1 -1
  169. data/lib/merge_hris_client/models/validation_problem_source.rb +1 -1
  170. data/lib/merge_hris_client/models/warning_validation_problem.rb +1 -1
  171. data/lib/merge_hris_client/models/webhook_receiver.rb +246 -0
  172. data/lib/merge_hris_client/models/webhook_receiver_request.rb +280 -0
  173. data/lib/merge_hris_client/version.rb +1 -1
  174. data/lib/merge_hris_client.rb +21 -2
  175. data/pull_request_template.md +3 -1
  176. data/spec/api/account_details_api_spec.rb +1 -0
  177. data/spec/api/bank_info_api_spec.rb +2 -4
  178. data/spec/api/employees_api_spec.rb +38 -0
  179. data/spec/api/groups_api_spec.rb +68 -0
  180. data/spec/api/issues_api_spec.rb +4 -0
  181. data/spec/api/time_off_api_spec.rb +12 -0
  182. data/spec/models/account_details_and_actions_spec.rb +6 -0
  183. data/spec/models/account_details_spec.rb +12 -0
  184. data/spec/models/data_passthrough_request_spec.rb +6 -0
  185. data/spec/models/debug_mode_log_spec.rb +46 -0
  186. data/spec/models/debug_model_log_summary_spec.rb +46 -0
  187. data/spec/models/earning_type_enum_spec.rb +28 -0
  188. data/spec/models/employee_endpoint_request_spec.rb +34 -0
  189. data/spec/models/employee_request_spec.rb +190 -0
  190. data/spec/models/employee_response_spec.rb +52 -0
  191. data/spec/models/employee_spec.rb +6 -0
  192. data/spec/models/employment_spec.rb +6 -0
  193. data/spec/models/encoding_enum_spec.rb +28 -0
  194. data/spec/models/end_user_details_request_spec.rb +6 -0
  195. data/spec/models/group_spec.rb +64 -0
  196. data/spec/models/group_type_enum_spec.rb +28 -0
  197. data/spec/models/ignore_common_model_spec.rb +40 -0
  198. data/spec/models/location_spec.rb +6 -0
  199. data/spec/models/multipart_form_field_request_spec.rb +58 -0
  200. data/spec/models/paginated_group_list_spec.rb +46 -0
  201. data/spec/models/time_off_response_spec.rb +6 -0
  202. metadata +153 -89
  203. data/test_ruby.rb +0 -30
@@ -0,0 +1,256 @@
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 IgnoreCommonModelRequest
18
+ attr_accessor :reason
19
+
20
+ attr_accessor :message
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'reason' => :'reason',
26
+ :'message' => :'message'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'reason' => :'ReasonEnum',
39
+ :'message' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::IgnoreCommonModelRequest` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::IgnoreCommonModelRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'reason')
65
+ self.reason = attributes[:'reason']
66
+ end
67
+
68
+ if attributes.key?(:'message')
69
+ self.message = attributes[:'message']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @reason.nil?
78
+ invalid_properties.push('invalid value for "reason", reason cannot be nil.')
79
+ end
80
+
81
+ if !@message.nil? && @message.to_s.length > 256
82
+ invalid_properties.push('invalid value for "message", the character length must be smaller than or equal to 256.')
83
+ end
84
+
85
+ if !@message.nil? && @message.to_s.length < 1
86
+ invalid_properties.push('invalid value for "message", the character length must be great than or equal to 1.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @reason.nil?
96
+ return false if !@message.nil? && @message.to_s.length > 256
97
+ return false if !@message.nil? && @message.to_s.length < 1
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] message Value to be assigned
103
+ def message=(message)
104
+ if !message.nil? && message.to_s.length > 256
105
+ fail ArgumentError, 'invalid value for "message", the character length must be smaller than or equal to 256.'
106
+ end
107
+
108
+ if !message.nil? && message.to_s.length < 1
109
+ fail ArgumentError, 'invalid value for "message", the character length must be great than or equal to 1.'
110
+ end
111
+
112
+ @message = message
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ reason == o.reason &&
121
+ message == o.message
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(o)
127
+ self == o
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [reason, message].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ new.build_from_hash(attributes)
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
+ self.send("#{key}=", nil)
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = MergeHRISClient.const_get(type)
204
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -198,7 +198,7 @@ module MergeHRISClient
198
198
  when :Date
199
199
  Date.parse(value)
200
200
  when :String
201
- value.to_s
201
+ value
202
202
  when :Integer
203
203
  value.to_i
204
204
  when :Float
@@ -29,8 +29,8 @@ module MergeHRISClient
29
29
  # @param [String] The enum value in the form of the string
30
30
  # @return [String] The enum value
31
31
  def build_from_hash(value)
32
- constantValues = IssueStatusEnum.constants.select { |c| IssueStatusEnum::const_get(c) == value }
33
32
  value
34
33
  end
35
34
  end
35
+
36
36
  end
@@ -154,7 +154,7 @@ module MergeHRISClient
154
154
  when :Date
155
155
  Date.parse(value)
156
156
  when :String
157
- value.to_s
157
+ value
158
158
  when :Integer
159
159
  value.to_i
160
160
  when :Float
@@ -0,0 +1,237 @@
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 LinkedAccountStatus
18
+ attr_accessor :linked_account_status
19
+
20
+ attr_accessor :can_make_request
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'linked_account_status' => :'linked_account_status',
26
+ :'can_make_request' => :'can_make_request'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'linked_account_status' => :'String',
39
+ :'can_make_request' => :'Boolean'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::LinkedAccountStatus` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::LinkedAccountStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'linked_account_status')
65
+ self.linked_account_status = attributes[:'linked_account_status']
66
+ end
67
+
68
+ if attributes.key?(:'can_make_request')
69
+ self.can_make_request = attributes[:'can_make_request']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ if @linked_account_status.nil?
78
+ invalid_properties.push('invalid value for "linked_account_status", linked_account_status cannot be nil.')
79
+ end
80
+
81
+ if @can_make_request.nil?
82
+ invalid_properties.push('invalid value for "can_make_request", can_make_request cannot be nil.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return false if @linked_account_status.nil?
92
+ return false if @can_make_request.nil?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ linked_account_status == o.linked_account_status &&
102
+ can_make_request == o.can_make_request
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [linked_account_status, can_make_request].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ new.build_from_hash(attributes)
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = MergeHRISClient.const_get(type)
185
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end
@@ -39,12 +39,15 @@ module MergeHRISClient
39
39
  # The location's state. Represents a region if outside of the US.
40
40
  attr_accessor :state
41
41
 
42
- # The location's zip code.
42
+ # The location's zip code or postal code.
43
43
  attr_accessor :zip_code
44
44
 
45
45
  # The location's country.
46
46
  attr_accessor :country
47
47
 
48
+ # The location's type. Can be either WORK or HOME
49
+ attr_accessor :location_type
50
+
48
51
  attr_accessor :remote_data
49
52
 
50
53
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -60,6 +63,7 @@ module MergeHRISClient
60
63
  :'state' => :'state',
61
64
  :'zip_code' => :'zip_code',
62
65
  :'country' => :'country',
66
+ :'location_type' => :'location_type',
63
67
  :'remote_data' => :'remote_data'
64
68
  }
65
69
  end
@@ -82,6 +86,7 @@ module MergeHRISClient
82
86
  :'state' => :'String',
83
87
  :'zip_code' => :'String',
84
88
  :'country' => :'CountryEnum',
89
+ :'location_type' => :'LocationTypeEnum',
85
90
  :'remote_data' => :'Array<RemoteData>'
86
91
  }
87
92
  end
@@ -98,6 +103,7 @@ module MergeHRISClient
98
103
  :'state',
99
104
  :'zip_code',
100
105
  :'country',
106
+ :'location_type',
101
107
  :'remote_data'
102
108
  ])
103
109
  end
@@ -157,6 +163,10 @@ module MergeHRISClient
157
163
  self.country = attributes[:'country']
158
164
  end
159
165
 
166
+ if attributes.key?(:'location_type')
167
+ self.location_type = attributes[:'location_type']
168
+ end
169
+
160
170
  if attributes.key?(:'remote_data')
161
171
  if (value = attributes[:'remote_data']).is_a?(Array)
162
172
  self.remote_data = value
@@ -192,6 +202,7 @@ module MergeHRISClient
192
202
  state == o.state &&
193
203
  zip_code == o.zip_code &&
194
204
  country == o.country &&
205
+ location_type == o.location_type &&
195
206
  remote_data == o.remote_data
196
207
  end
197
208
 
@@ -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, name, phone_number, street_1, street_2, city, state, zip_code, country, remote_data].hash
218
+ [id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, location_type, remote_data].hash
208
219
  end
209
220
 
210
221
  # Builds the object from hash
@@ -0,0 +1,36 @@
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 LocationTypeEnum
18
+ HOME = "HOME".freeze
19
+ WORK = "WORK".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ value
33
+ end
34
+ end
35
+
36
+ end
@@ -32,8 +32,8 @@ module MergeHRISClient
32
32
  # @param [String] The enum value in the form of the string
33
33
  # @return [String] The enum value
34
34
  def build_from_hash(value)
35
- constantValues = MaritalStatusEnum.constants.select { |c| MaritalStatusEnum::const_get(c) == value }
36
35
  value
37
36
  end
38
37
  end
38
+
39
39
  end