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.
- checksums.yaml +4 -4
- data/README.md +14 -5
- data/docs/AccountDetails.md +5 -1
- data/docs/AccountDetailsAndActions.md +2 -0
- data/docs/AccountDetailsApi.md +8 -5
- data/docs/Company.md +2 -2
- data/docs/DataPassthroughRequest.md +1 -1
- data/docs/Employee.md +8 -8
- data/docs/EmployeeRequest.md +8 -8
- data/docs/EmployeesApi.md +78 -4
- data/docs/Employment.md +5 -3
- data/docs/EndUserDetailsRequest.md +3 -3
- data/docs/IssuesApi.md +8 -0
- data/docs/LinkTokenApi.md +1 -1
- data/docs/LinkedAccountStatus.md +20 -0
- data/docs/Location.md +1 -1
- data/docs/MetaResponse.md +24 -0
- data/docs/TimeOff.md +2 -2
- data/docs/TimeOffApi.md +72 -0
- data/docs/TimeOffBalance.md +1 -1
- data/docs/TimeOffRequest.md +2 -2
- data/docs/WebhookReceiver.md +22 -0
- data/docs/WebhookReceiverRequest.md +22 -0
- data/docs/WebhookReceiversApi.md +153 -0
- data/lib/merge_hris_client/api/account_details_api.rb +10 -3
- data/lib/merge_hris_client/api/employees_api.rb +72 -3
- data/lib/merge_hris_client/api/employments_api.rb +2 -2
- data/lib/merge_hris_client/api/issues_api.rb +12 -0
- data/lib/merge_hris_client/api/linked_accounts_api.rb +1 -1
- data/lib/merge_hris_client/api/time_off_api.rb +62 -0
- data/lib/merge_hris_client/models/account_details.rb +22 -4
- data/lib/merge_hris_client/models/account_details_and_actions.rb +15 -1
- data/lib/merge_hris_client/models/company.rb +1 -1
- data/lib/merge_hris_client/models/data_passthrough_request.rb +1 -0
- data/lib/merge_hris_client/models/earning.rb +1 -0
- data/lib/merge_hris_client/models/employee.rb +1 -1
- data/lib/merge_hris_client/models/employee_request.rb +1 -1
- data/lib/merge_hris_client/models/employment.rb +12 -2
- data/lib/merge_hris_client/models/end_user_details_request.rb +34 -0
- data/lib/merge_hris_client/models/group.rb +1 -1
- data/lib/merge_hris_client/models/linked_account_status.rb +237 -0
- data/lib/merge_hris_client/models/location.rb +1 -1
- data/lib/merge_hris_client/models/meta_response.rb +262 -0
- data/lib/merge_hris_client/models/payroll_run.rb +1 -1
- data/lib/merge_hris_client/models/tax.rb +1 -0
- data/lib/merge_hris_client/models/time_off_balance.rb +1 -1
- data/lib/merge_hris_client/models/webhook_receiver.rb +246 -0
- data/lib/merge_hris_client/models/webhook_receiver_request.rb +280 -0
- data/lib/merge_hris_client/version.rb +1 -1
- data/lib/merge_hris_client.rb +5 -0
- data/spec/api/account_details_api_spec.rb +1 -0
- data/spec/api/employees_api_spec.rb +12 -0
- data/spec/api/issues_api_spec.rb +4 -0
- data/spec/api/time_off_api_spec.rb +11 -0
- data/spec/models/account_details_and_actions_spec.rb +6 -0
- data/spec/models/account_details_spec.rb +12 -0
- data/spec/models/employment_spec.rb +6 -0
- metadata +108 -100
- data/test_ruby.rb +0 -30
@@ -0,0 +1,280 @@
|
|
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 WebhookReceiverRequest
|
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::WebhookReceiverRequest` 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::WebhookReceiverRequest`. 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 @event.to_s.length < 1
|
90
|
+
invalid_properties.push('invalid value for "event", the character length must be great than or equal to 1.')
|
91
|
+
end
|
92
|
+
|
93
|
+
if @is_active.nil?
|
94
|
+
invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
|
95
|
+
end
|
96
|
+
|
97
|
+
if !@key.nil? && @key.to_s.length < 1
|
98
|
+
invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
|
99
|
+
end
|
100
|
+
|
101
|
+
invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return false if @event.nil?
|
108
|
+
return false if @event.to_s.length < 1
|
109
|
+
return false if @is_active.nil?
|
110
|
+
return false if !@key.nil? && @key.to_s.length < 1
|
111
|
+
true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Custom attribute writer method with validation
|
115
|
+
# @param [Object] event Value to be assigned
|
116
|
+
def event=(event)
|
117
|
+
if event.nil?
|
118
|
+
fail ArgumentError, 'event cannot be nil'
|
119
|
+
end
|
120
|
+
|
121
|
+
if event.to_s.length < 1
|
122
|
+
fail ArgumentError, 'invalid value for "event", the character length must be great than or equal to 1.'
|
123
|
+
end
|
124
|
+
|
125
|
+
@event = event
|
126
|
+
end
|
127
|
+
|
128
|
+
# Custom attribute writer method with validation
|
129
|
+
# @param [Object] key Value to be assigned
|
130
|
+
def key=(key)
|
131
|
+
if !key.nil? && key.to_s.length < 1
|
132
|
+
fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
|
133
|
+
end
|
134
|
+
|
135
|
+
@key = key
|
136
|
+
end
|
137
|
+
|
138
|
+
# Checks equality by comparing each attribute.
|
139
|
+
# @param [Object] Object to be compared
|
140
|
+
def ==(o)
|
141
|
+
return true if self.equal?(o)
|
142
|
+
self.class == o.class &&
|
143
|
+
event == o.event &&
|
144
|
+
is_active == o.is_active &&
|
145
|
+
key == o.key
|
146
|
+
end
|
147
|
+
|
148
|
+
# @see the `==` method
|
149
|
+
# @param [Object] Object to be compared
|
150
|
+
def eql?(o)
|
151
|
+
self == o
|
152
|
+
end
|
153
|
+
|
154
|
+
# Calculates hash code according to all attributes.
|
155
|
+
# @return [Integer] Hash code
|
156
|
+
def hash
|
157
|
+
[event, is_active, key].hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Builds the object from hash
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
162
|
+
# @return [Object] Returns the model itself
|
163
|
+
def self.build_from_hash(attributes)
|
164
|
+
new.build_from_hash(attributes)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Builds the object from hash
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
169
|
+
# @return [Object] Returns the model itself
|
170
|
+
def build_from_hash(attributes)
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
172
|
+
self.class.openapi_types.each_pair do |key, type|
|
173
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
|
+
self.send("#{key}=", nil)
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
176
|
+
# check to ensure the input is an array given that the attribute
|
177
|
+
# is documented as an array but the input is not
|
178
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
179
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
180
|
+
end
|
181
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
182
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
self
|
187
|
+
end
|
188
|
+
|
189
|
+
# Deserializes the data based on type
|
190
|
+
# @param string type Data type
|
191
|
+
# @param string value Value to be deserialized
|
192
|
+
# @return [Object] Deserialized data
|
193
|
+
def _deserialize(type, value)
|
194
|
+
case type.to_sym
|
195
|
+
when :Time
|
196
|
+
Time.parse(value)
|
197
|
+
when :Date
|
198
|
+
Date.parse(value)
|
199
|
+
when :String
|
200
|
+
value
|
201
|
+
when :Integer
|
202
|
+
value.to_i
|
203
|
+
when :Float
|
204
|
+
value.to_f
|
205
|
+
when :Boolean
|
206
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
207
|
+
true
|
208
|
+
else
|
209
|
+
false
|
210
|
+
end
|
211
|
+
when :Object
|
212
|
+
# generic object (usually a Hash), return directly
|
213
|
+
value
|
214
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
215
|
+
inner_type = Regexp.last_match[:inner_type]
|
216
|
+
value.map { |v| _deserialize(inner_type, v) }
|
217
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
218
|
+
k_type = Regexp.last_match[:k_type]
|
219
|
+
v_type = Regexp.last_match[:v_type]
|
220
|
+
{}.tap do |hash|
|
221
|
+
value.each do |k, v|
|
222
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
else # model
|
226
|
+
# models (e.g. Pet) or oneOf
|
227
|
+
klass = MergeHRISClient.const_get(type)
|
228
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the string representation of the object
|
233
|
+
# @return [String] String presentation of the object
|
234
|
+
def to_s
|
235
|
+
to_hash.to_s
|
236
|
+
end
|
237
|
+
|
238
|
+
# to_body is an alias to to_hash (backward compatibility)
|
239
|
+
# @return [Hash] Returns the object in the form of hash
|
240
|
+
def to_body
|
241
|
+
to_hash
|
242
|
+
end
|
243
|
+
|
244
|
+
# Returns the object in the form of hash
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_hash
|
247
|
+
hash = {}
|
248
|
+
self.class.attribute_map.each_pair do |attr, param|
|
249
|
+
value = self.send(attr)
|
250
|
+
if value.nil?
|
251
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
252
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
253
|
+
end
|
254
|
+
|
255
|
+
hash[param] = _to_hash(value)
|
256
|
+
end
|
257
|
+
hash
|
258
|
+
end
|
259
|
+
|
260
|
+
# Outputs non-array value in the form of hash
|
261
|
+
# For object, use to_hash. Otherwise, just return the value
|
262
|
+
# @param [Object] value Any valid value
|
263
|
+
# @return [Hash] Returns the value in the form of hash
|
264
|
+
def _to_hash(value)
|
265
|
+
if value.is_a?(Array)
|
266
|
+
value.compact.map { |v| _to_hash(v) }
|
267
|
+
elsif value.is_a?(Hash)
|
268
|
+
{}.tap do |hash|
|
269
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
270
|
+
end
|
271
|
+
elsif value.respond_to? :to_hash
|
272
|
+
value.to_hash
|
273
|
+
else
|
274
|
+
value
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
|
280
|
+
end
|
data/lib/merge_hris_client.rb
CHANGED
@@ -59,9 +59,11 @@ require 'merge_hris_client/models/ignore_common_model_request'
|
|
59
59
|
require 'merge_hris_client/models/issue'
|
60
60
|
require 'merge_hris_client/models/issue_status_enum'
|
61
61
|
require 'merge_hris_client/models/link_token'
|
62
|
+
require 'merge_hris_client/models/linked_account_status'
|
62
63
|
require 'merge_hris_client/models/location'
|
63
64
|
require 'merge_hris_client/models/location_type_enum'
|
64
65
|
require 'merge_hris_client/models/marital_status_enum'
|
66
|
+
require 'merge_hris_client/models/meta_response'
|
65
67
|
require 'merge_hris_client/models/method_enum'
|
66
68
|
require 'merge_hris_client/models/model_operation'
|
67
69
|
require 'merge_hris_client/models/multipart_form_field_request'
|
@@ -111,6 +113,8 @@ require 'merge_hris_client/models/time_off_status_enum'
|
|
111
113
|
require 'merge_hris_client/models/units_enum'
|
112
114
|
require 'merge_hris_client/models/validation_problem_source'
|
113
115
|
require 'merge_hris_client/models/warning_validation_problem'
|
116
|
+
require 'merge_hris_client/models/webhook_receiver'
|
117
|
+
require 'merge_hris_client/models/webhook_receiver_request'
|
114
118
|
|
115
119
|
# APIs
|
116
120
|
require 'merge_hris_client/api/account_details_api'
|
@@ -139,6 +143,7 @@ require 'merge_hris_client/api/sync_status_api'
|
|
139
143
|
require 'merge_hris_client/api/teams_api'
|
140
144
|
require 'merge_hris_client/api/time_off_api'
|
141
145
|
require 'merge_hris_client/api/time_off_balances_api'
|
146
|
+
require 'merge_hris_client/api/webhook_receivers_api'
|
142
147
|
|
143
148
|
module MergeHRISClient
|
144
149
|
class << self
|
@@ -34,6 +34,7 @@ describe 'AccountDetailsApi' do
|
|
34
34
|
|
35
35
|
# unit tests for account_details_retrieve
|
36
36
|
# Get details for a linked account.
|
37
|
+
# @param x_account_token Token identifying the end user.
|
37
38
|
# @param [Hash] opts the optional parameters
|
38
39
|
# @return [AccountDetails]
|
39
40
|
describe 'account_details_retrieve test' do
|
@@ -48,6 +48,7 @@ describe 'EmployeesApi' do
|
|
48
48
|
|
49
49
|
# unit tests for employees_ignore_create
|
50
50
|
# Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The \"reason\" and \"message\" fields in the request body will be stored for audit purposes.
|
51
|
+
# @param x_account_token Token identifying the end user.
|
51
52
|
# @param model_id
|
52
53
|
# @param ignore_common_model_request
|
53
54
|
# @param [Hash] opts the optional parameters
|
@@ -87,6 +88,17 @@ describe 'EmployeesApi' do
|
|
87
88
|
end
|
88
89
|
end
|
89
90
|
|
91
|
+
# unit tests for employees_meta_post_retrieve
|
92
|
+
# Returns metadata for `Employee` POSTs.
|
93
|
+
# @param x_account_token Token identifying the end user.
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [MetaResponse]
|
96
|
+
describe 'employees_meta_post_retrieve test' do
|
97
|
+
it 'should work' do
|
98
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
90
102
|
# unit tests for employees_retrieve
|
91
103
|
# Returns an `Employee` object with the given `id`.
|
92
104
|
# @param x_account_token Token identifying the end user.
|
data/spec/api/issues_api_spec.rb
CHANGED
@@ -39,8 +39,12 @@ describe 'IssuesApi' do
|
|
39
39
|
# @option opts [String] :cursor The pagination cursor value.
|
40
40
|
# @option opts [String] :end_date If included, will only include issues whose most recent action occurred before this time
|
41
41
|
# @option opts [String] :end_user_organization_name
|
42
|
+
# @option opts [Time] :first_incident_time_after If provided, will only return issues whose first incident time was after this datetime.
|
43
|
+
# @option opts [Time] :first_incident_time_before If provided, will only return issues whose first incident time was before this datetime.
|
42
44
|
# @option opts [String] :include_muted If True, will include muted issues
|
43
45
|
# @option opts [String] :integration_name
|
46
|
+
# @option opts [Time] :last_incident_time_after If provided, will only return issues whose first incident time was after this datetime.
|
47
|
+
# @option opts [Time] :last_incident_time_before If provided, will only return issues whose first incident time was before this datetime.
|
44
48
|
# @option opts [Integer] :page_size Number of results to return per page.
|
45
49
|
# @option opts [String] :start_date If included, will only include issues whose most recent action occurred after this time
|
46
50
|
# @option opts [String] :status
|
@@ -71,6 +71,17 @@ describe 'TimeOffApi' do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
# unit tests for time_off_meta_post_retrieve
|
75
|
+
# Returns metadata for `TimeOff` POSTs.
|
76
|
+
# @param x_account_token Token identifying the end user.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [MetaResponse]
|
79
|
+
describe 'time_off_meta_post_retrieve test' do
|
80
|
+
it 'should work' do
|
81
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
74
85
|
# unit tests for time_off_retrieve
|
75
86
|
# Returns a `TimeOff` object with the given `id`.
|
76
87
|
# @param x_account_token Token identifying the end user.
|
@@ -67,6 +67,12 @@ describe MergeHRISClient::AccountDetailsAndActions do
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
describe 'test attribute "webhook_listener_url"' do
|
71
|
+
it 'should work' do
|
72
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
70
76
|
describe 'test attribute "integration"' do
|
71
77
|
it 'should work' do
|
72
78
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -37,6 +37,12 @@ describe MergeHRISClient::AccountDetails do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe 'test attribute "integration_slug"' do
|
41
|
+
it 'should work' do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
40
46
|
describe 'test attribute "category"' do
|
41
47
|
it 'should work' do
|
42
48
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -67,4 +73,10 @@ describe MergeHRISClient::AccountDetails do
|
|
67
73
|
end
|
68
74
|
end
|
69
75
|
|
76
|
+
describe 'test attribute "webhook_listener_url"' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
70
82
|
end
|
@@ -73,6 +73,12 @@ describe MergeHRISClient::Employment do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
+
describe 'test attribute "pay_group"' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
76
82
|
describe 'test attribute "flsa_status"' do
|
77
83
|
it 'should work' do
|
78
84
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|