merge_hris_client 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -5
  3. data/docs/AccountDetails.md +5 -1
  4. data/docs/AccountDetailsAndActions.md +2 -0
  5. data/docs/AccountDetailsApi.md +8 -5
  6. data/docs/Company.md +2 -2
  7. data/docs/DataPassthroughRequest.md +1 -1
  8. data/docs/Employee.md +8 -8
  9. data/docs/EmployeeRequest.md +8 -8
  10. data/docs/EmployeesApi.md +78 -4
  11. data/docs/Employment.md +5 -3
  12. data/docs/EndUserDetailsRequest.md +3 -3
  13. data/docs/IssuesApi.md +8 -0
  14. data/docs/LinkTokenApi.md +1 -1
  15. data/docs/LinkedAccountStatus.md +20 -0
  16. data/docs/Location.md +1 -1
  17. data/docs/MetaResponse.md +24 -0
  18. data/docs/TimeOff.md +2 -2
  19. data/docs/TimeOffApi.md +72 -0
  20. data/docs/TimeOffBalance.md +1 -1
  21. data/docs/TimeOffRequest.md +2 -2
  22. data/docs/WebhookReceiver.md +22 -0
  23. data/docs/WebhookReceiverRequest.md +22 -0
  24. data/docs/WebhookReceiversApi.md +153 -0
  25. data/lib/merge_hris_client/api/account_details_api.rb +10 -3
  26. data/lib/merge_hris_client/api/employees_api.rb +72 -3
  27. data/lib/merge_hris_client/api/employments_api.rb +2 -2
  28. data/lib/merge_hris_client/api/issues_api.rb +12 -0
  29. data/lib/merge_hris_client/api/linked_accounts_api.rb +1 -1
  30. data/lib/merge_hris_client/api/time_off_api.rb +62 -0
  31. data/lib/merge_hris_client/models/account_details.rb +22 -4
  32. data/lib/merge_hris_client/models/account_details_and_actions.rb +15 -1
  33. data/lib/merge_hris_client/models/company.rb +1 -1
  34. data/lib/merge_hris_client/models/data_passthrough_request.rb +1 -0
  35. data/lib/merge_hris_client/models/earning.rb +1 -0
  36. data/lib/merge_hris_client/models/employee.rb +1 -1
  37. data/lib/merge_hris_client/models/employee_request.rb +1 -1
  38. data/lib/merge_hris_client/models/employment.rb +12 -2
  39. data/lib/merge_hris_client/models/end_user_details_request.rb +34 -0
  40. data/lib/merge_hris_client/models/group.rb +1 -1
  41. data/lib/merge_hris_client/models/linked_account_status.rb +237 -0
  42. data/lib/merge_hris_client/models/location.rb +1 -1
  43. data/lib/merge_hris_client/models/meta_response.rb +262 -0
  44. data/lib/merge_hris_client/models/payroll_run.rb +1 -1
  45. data/lib/merge_hris_client/models/tax.rb +1 -0
  46. data/lib/merge_hris_client/models/time_off_balance.rb +1 -1
  47. data/lib/merge_hris_client/models/webhook_receiver.rb +246 -0
  48. data/lib/merge_hris_client/models/webhook_receiver_request.rb +280 -0
  49. data/lib/merge_hris_client/version.rb +1 -1
  50. data/lib/merge_hris_client.rb +5 -0
  51. data/spec/api/account_details_api_spec.rb +1 -0
  52. data/spec/api/employees_api_spec.rb +12 -0
  53. data/spec/api/issues_api_spec.rb +4 -0
  54. data/spec/api/time_off_api_spec.rb +11 -0
  55. data/spec/models/account_details_and_actions_spec.rb +6 -0
  56. data/spec/models/account_details_spec.rb +12 -0
  57. data/spec/models/employment_spec.rb +6 -0
  58. metadata +108 -100
  59. data/test_ruby.rb +0 -30
@@ -0,0 +1,262 @@
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 MetaResponse
18
+ attr_accessor :request_schema
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :has_conditional_params
23
+
24
+ attr_accessor :has_required_linked_account_params
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'request_schema' => :'request_schema',
30
+ :'status' => :'status',
31
+ :'has_conditional_params' => :'has_conditional_params',
32
+ :'has_required_linked_account_params' => :'has_required_linked_account_params'
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
+ :'request_schema' => :'Hash<String, AnyType>',
45
+ :'status' => :'LinkedAccountStatus',
46
+ :'has_conditional_params' => :'Boolean',
47
+ :'has_required_linked_account_params' => :'Boolean'
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::MetaResponse` 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::MetaResponse`. 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?(:'request_schema')
73
+ if (value = attributes[:'request_schema']).is_a?(Hash)
74
+ self.request_schema = value
75
+ end
76
+ end
77
+
78
+ if attributes.key?(:'status')
79
+ self.status = attributes[:'status']
80
+ end
81
+
82
+ if attributes.key?(:'has_conditional_params')
83
+ self.has_conditional_params = attributes[:'has_conditional_params']
84
+ end
85
+
86
+ if attributes.key?(:'has_required_linked_account_params')
87
+ self.has_required_linked_account_params = attributes[:'has_required_linked_account_params']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ if @request_schema.nil?
96
+ invalid_properties.push('invalid value for "request_schema", request_schema cannot be nil.')
97
+ end
98
+
99
+ if @has_conditional_params.nil?
100
+ invalid_properties.push('invalid value for "has_conditional_params", has_conditional_params cannot be nil.')
101
+ end
102
+
103
+ if @has_required_linked_account_params.nil?
104
+ invalid_properties.push('invalid value for "has_required_linked_account_params", has_required_linked_account_params cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ return false if @request_schema.nil?
114
+ return false if @has_conditional_params.nil?
115
+ return false if @has_required_linked_account_params.nil?
116
+ true
117
+ end
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] Object to be compared
121
+ def ==(o)
122
+ return true if self.equal?(o)
123
+ self.class == o.class &&
124
+ request_schema == o.request_schema &&
125
+ status == o.status &&
126
+ has_conditional_params == o.has_conditional_params &&
127
+ has_required_linked_account_params == o.has_required_linked_account_params
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Integer] Hash code
138
+ def hash
139
+ [request_schema, status, has_conditional_params, has_required_linked_account_params].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def self.build_from_hash(attributes)
146
+ new.build_from_hash(attributes)
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ self.class.openapi_types.each_pair do |key, type|
155
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
156
+ self.send("#{key}=", nil)
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :Time
178
+ Time.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :Boolean
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ # models (e.g. Pet) or oneOf
209
+ klass = MergeHRISClient.const_get(type)
210
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module MergeHRISClient
17
- # # The PayrollRun Object ### Description The `PayrollRun` object is used to represent a payroll run. ### Usage Example Fetch from the `LIST PayrollRuns` endpoint and filter by `ID` to show all payroll runs.
17
+ # # The PayrollRun Object ### Description The `PayrollRun` object is used to represent a payroll run. This payroll run is not specific to an employee. ### Usage Example Fetch from the `LIST PayrollRuns` endpoint and filter by `ID` to show all payroll runs.
18
18
  class PayrollRun
19
19
  attr_accessor :id
20
20
 
@@ -67,6 +67,7 @@ module MergeHRISClient
67
67
  :'name',
68
68
  :'amount',
69
69
  :'employer_tax',
70
+ :'remote_data'
70
71
  ])
71
72
  end
72
73
 
@@ -23,7 +23,7 @@ module MergeHRISClient
23
23
 
24
24
  attr_accessor :employee
25
25
 
26
- # The current PTO balance in terms of hours.
26
+ # The current remaining PTO balance in terms of hours. This does not represent the starting PTO balance. If the API provider only provides PTO balance in terms of days, we estimate 8 hours per day.
27
27
  attr_accessor :balance
28
28
 
29
29
  # The amount of PTO used in terms of hours.
@@ -0,0 +1,246 @@
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 WebhookReceiver
18
+ attr_accessor :event
19
+
20
+ attr_accessor :is_active
21
+
22
+ attr_accessor :key
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'event' => :'event',
28
+ :'is_active' => :'is_active',
29
+ :'key' => :'key'
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
+ :'event' => :'String',
42
+ :'is_active' => :'Boolean',
43
+ :'key' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::WebhookReceiver` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::WebhookReceiver`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'event')
69
+ self.event = attributes[:'event']
70
+ end
71
+
72
+ if attributes.key?(:'is_active')
73
+ self.is_active = attributes[:'is_active']
74
+ end
75
+
76
+ if attributes.key?(:'key')
77
+ self.key = attributes[:'key']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @event.nil?
86
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
87
+ end
88
+
89
+ if @is_active.nil?
90
+ invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @event.nil?
100
+ return false if @is_active.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ event == o.event &&
110
+ is_active == o.is_active &&
111
+ key == o.key
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [event, is_active, key].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = MergeHRISClient.const_get(type)
194
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end