merge_hris_client 1.0.4 → 2.0.0

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