merge_hris_client 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeHRISClient
|
17
|
-
# # The Company Object ### Description The `Company` object is used to represent a Company. ### Usage Example Fetch from the `LIST Companies` endpoint and filter by `ID` to show all companies.
|
17
|
+
# # The Company Object ### Description The `Company` object is used to represent a Company within the HRIS / Payroll system. ### Usage Example Fetch from the `LIST Companies` endpoint and filter by `ID` to show all companies.
|
18
18
|
class Company
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -27,6 +27,7 @@ module MergeHRISClient
|
|
27
27
|
# Pass an array of `MultipartFormField` objects in here instead of using the `data` param if `request_format` is set to `MULTIPART`.
|
28
28
|
attr_accessor :multipart_form_data
|
29
29
|
|
30
|
+
# The headers to use for the request (Merge will handle the account's authorization headers). `Content-Type` header is required for passthrough. Choose content type corresponding to expected format of receiving server.
|
30
31
|
attr_accessor :headers
|
31
32
|
|
32
33
|
attr_accessor :request_format
|
@@ -21,7 +21,7 @@ module MergeHRISClient
|
|
21
21
|
# The third-party API ID of the matching object.
|
22
22
|
attr_accessor :remote_id
|
23
23
|
|
24
|
-
# The employee's number that appears in the remote UI. Note: This is distinct from the remote_id field, which is a unique identifier for the employee set by the remote API, and is not exposed to the user.
|
24
|
+
# The employee's number that appears in the remote UI. Note: This is distinct from the remote_id field, which is a unique identifier for the employee set by the remote API, and is not exposed to the user. This value can also change in many API providers.
|
25
25
|
attr_accessor :employee_number
|
26
26
|
|
27
27
|
attr_accessor :company
|
@@ -19,7 +19,7 @@ module MergeHRISClient
|
|
19
19
|
# The third-party API ID of the matching object.
|
20
20
|
attr_accessor :remote_id
|
21
21
|
|
22
|
-
# The employee's number that appears in the remote UI. Note: This is distinct from the remote_id field, which is a unique identifier for the employee set by the remote API, and is not exposed to the user.
|
22
|
+
# The employee's number that appears in the remote UI. Note: This is distinct from the remote_id field, which is a unique identifier for the employee set by the remote API, and is not exposed to the user. This value can also change in many API providers.
|
23
23
|
attr_accessor :employee_number
|
24
24
|
|
25
25
|
attr_accessor :company
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeHRISClient
|
17
|
-
# # The Employment Object ### Description The `Employment` object is used to represent an employment position at a company. These are associated with the employee filling the role. ### Usage Example Fetch from the `LIST Employments` endpoint and filter by `ID` to show all employees.
|
17
|
+
# # The Employment Object ### Description The `Employment` object is used to represent an employment position at a company. These are associated with the employee filling the role. Please note: Employment objects are constructed if the object does not exist in the remote system. ### Usage Example Fetch from the `LIST Employments` endpoint and filter by `ID` to show all employees.
|
18
18
|
class Employment
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -38,6 +38,8 @@ module MergeHRISClient
|
|
38
38
|
# The position's currency code.
|
39
39
|
attr_accessor :pay_currency
|
40
40
|
|
41
|
+
attr_accessor :pay_group
|
42
|
+
|
41
43
|
# The position's FLSA status.
|
42
44
|
attr_accessor :flsa_status
|
43
45
|
|
@@ -60,6 +62,7 @@ module MergeHRISClient
|
|
60
62
|
:'pay_period' => :'pay_period',
|
61
63
|
:'pay_frequency' => :'pay_frequency',
|
62
64
|
:'pay_currency' => :'pay_currency',
|
65
|
+
:'pay_group' => :'pay_group',
|
63
66
|
:'flsa_status' => :'flsa_status',
|
64
67
|
:'effective_date' => :'effective_date',
|
65
68
|
:'employment_type' => :'employment_type',
|
@@ -83,6 +86,7 @@ module MergeHRISClient
|
|
83
86
|
:'pay_period' => :'PayPeriodEnum',
|
84
87
|
:'pay_frequency' => :'PayFrequencyEnum',
|
85
88
|
:'pay_currency' => :'PayCurrencyEnum',
|
89
|
+
:'pay_group' => :'String',
|
86
90
|
:'flsa_status' => :'FlsaStatusEnum',
|
87
91
|
:'effective_date' => :'Time',
|
88
92
|
:'employment_type' => :'EmploymentTypeEnum',
|
@@ -100,6 +104,7 @@ module MergeHRISClient
|
|
100
104
|
:'pay_period',
|
101
105
|
:'pay_frequency',
|
102
106
|
:'pay_currency',
|
107
|
+
:'pay_group',
|
103
108
|
:'flsa_status',
|
104
109
|
:'effective_date',
|
105
110
|
:'employment_type',
|
@@ -154,6 +159,10 @@ module MergeHRISClient
|
|
154
159
|
self.pay_currency = attributes[:'pay_currency']
|
155
160
|
end
|
156
161
|
|
162
|
+
if attributes.key?(:'pay_group')
|
163
|
+
self.pay_group = attributes[:'pay_group']
|
164
|
+
end
|
165
|
+
|
157
166
|
if attributes.key?(:'flsa_status')
|
158
167
|
self.flsa_status = attributes[:'flsa_status']
|
159
168
|
end
|
@@ -199,6 +208,7 @@ module MergeHRISClient
|
|
199
208
|
pay_period == o.pay_period &&
|
200
209
|
pay_frequency == o.pay_frequency &&
|
201
210
|
pay_currency == o.pay_currency &&
|
211
|
+
pay_group == o.pay_group &&
|
202
212
|
flsa_status == o.flsa_status &&
|
203
213
|
effective_date == o.effective_date &&
|
204
214
|
employment_type == o.employment_type &&
|
@@ -214,7 +224,7 @@ module MergeHRISClient
|
|
214
224
|
# Calculates hash code according to all attributes.
|
215
225
|
# @return [Integer] Hash code
|
216
226
|
def hash
|
217
|
-
[id, remote_id, employee, job_title, pay_rate, pay_period, pay_frequency, pay_currency, flsa_status, effective_date, employment_type, remote_data].hash
|
227
|
+
[id, remote_id, employee, job_title, pay_rate, pay_period, pay_frequency, pay_currency, pay_group, flsa_status, effective_date, employment_type, remote_data].hash
|
218
228
|
end
|
219
229
|
|
220
230
|
# Builds the object from hash
|
@@ -23,8 +23,10 @@ module MergeHRISClient
|
|
23
23
|
|
24
24
|
attr_accessor :categories
|
25
25
|
|
26
|
+
# The slug of a specific pre-selected integration for this linking flow token, for examples of slugs see https://www.merge.dev/docs/basics/integration-metadata
|
26
27
|
attr_accessor :integration
|
27
28
|
|
29
|
+
# An integer number of minutes between [30, 720] for how long this token is valid. Defaults to 30
|
28
30
|
attr_accessor :link_expiry_mins
|
29
31
|
|
30
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -115,6 +117,10 @@ module MergeHRISClient
|
|
115
117
|
invalid_properties.push('invalid value for "end_user_email_address", end_user_email_address cannot be nil.')
|
116
118
|
end
|
117
119
|
|
120
|
+
if @end_user_email_address.to_s.length > 100
|
121
|
+
invalid_properties.push('invalid value for "end_user_email_address", the character length must be smaller than or equal to 100.')
|
122
|
+
end
|
123
|
+
|
118
124
|
if @end_user_email_address.to_s.length < 1
|
119
125
|
invalid_properties.push('invalid value for "end_user_email_address", the character length must be great than or equal to 1.')
|
120
126
|
end
|
@@ -123,6 +129,10 @@ module MergeHRISClient
|
|
123
129
|
invalid_properties.push('invalid value for "end_user_organization_name", end_user_organization_name cannot be nil.')
|
124
130
|
end
|
125
131
|
|
132
|
+
if @end_user_organization_name.to_s.length > 100
|
133
|
+
invalid_properties.push('invalid value for "end_user_organization_name", the character length must be smaller than or equal to 100.')
|
134
|
+
end
|
135
|
+
|
126
136
|
if @end_user_organization_name.to_s.length < 1
|
127
137
|
invalid_properties.push('invalid value for "end_user_organization_name", the character length must be great than or equal to 1.')
|
128
138
|
end
|
@@ -131,10 +141,18 @@ module MergeHRISClient
|
|
131
141
|
invalid_properties.push('invalid value for "end_user_origin_id", end_user_origin_id cannot be nil.')
|
132
142
|
end
|
133
143
|
|
144
|
+
if @end_user_origin_id.to_s.length > 100
|
145
|
+
invalid_properties.push('invalid value for "end_user_origin_id", the character length must be smaller than or equal to 100.')
|
146
|
+
end
|
147
|
+
|
134
148
|
if @end_user_origin_id.to_s.length < 1
|
135
149
|
invalid_properties.push('invalid value for "end_user_origin_id", the character length must be great than or equal to 1.')
|
136
150
|
end
|
137
151
|
|
152
|
+
if @categories.nil?
|
153
|
+
invalid_properties.push('invalid value for "categories", categories cannot be nil.')
|
154
|
+
end
|
155
|
+
|
138
156
|
if !@integration.nil? && @integration.to_s.length < 1
|
139
157
|
invalid_properties.push('invalid value for "integration", the character length must be great than or equal to 1.')
|
140
158
|
end
|
@@ -154,11 +172,15 @@ module MergeHRISClient
|
|
154
172
|
# @return true if the model is valid
|
155
173
|
def valid?
|
156
174
|
return false if @end_user_email_address.nil?
|
175
|
+
return false if @end_user_email_address.to_s.length > 100
|
157
176
|
return false if @end_user_email_address.to_s.length < 1
|
158
177
|
return false if @end_user_organization_name.nil?
|
178
|
+
return false if @end_user_organization_name.to_s.length > 100
|
159
179
|
return false if @end_user_organization_name.to_s.length < 1
|
160
180
|
return false if @end_user_origin_id.nil?
|
181
|
+
return false if @end_user_origin_id.to_s.length > 100
|
161
182
|
return false if @end_user_origin_id.to_s.length < 1
|
183
|
+
return false if @categories.nil?
|
162
184
|
return false if !@integration.nil? && @integration.to_s.length < 1
|
163
185
|
return false if !@link_expiry_mins.nil? && @link_expiry_mins > 720
|
164
186
|
return false if !@link_expiry_mins.nil? && @link_expiry_mins < 30
|
@@ -172,6 +194,10 @@ module MergeHRISClient
|
|
172
194
|
fail ArgumentError, 'end_user_email_address cannot be nil'
|
173
195
|
end
|
174
196
|
|
197
|
+
if end_user_email_address.to_s.length > 100
|
198
|
+
fail ArgumentError, 'invalid value for "end_user_email_address", the character length must be smaller than or equal to 100.'
|
199
|
+
end
|
200
|
+
|
175
201
|
if end_user_email_address.to_s.length < 1
|
176
202
|
fail ArgumentError, 'invalid value for "end_user_email_address", the character length must be great than or equal to 1.'
|
177
203
|
end
|
@@ -186,6 +212,10 @@ module MergeHRISClient
|
|
186
212
|
fail ArgumentError, 'end_user_organization_name cannot be nil'
|
187
213
|
end
|
188
214
|
|
215
|
+
if end_user_organization_name.to_s.length > 100
|
216
|
+
fail ArgumentError, 'invalid value for "end_user_organization_name", the character length must be smaller than or equal to 100.'
|
217
|
+
end
|
218
|
+
|
189
219
|
if end_user_organization_name.to_s.length < 1
|
190
220
|
fail ArgumentError, 'invalid value for "end_user_organization_name", the character length must be great than or equal to 1.'
|
191
221
|
end
|
@@ -200,6 +230,10 @@ module MergeHRISClient
|
|
200
230
|
fail ArgumentError, 'end_user_origin_id cannot be nil'
|
201
231
|
end
|
202
232
|
|
233
|
+
if end_user_origin_id.to_s.length > 100
|
234
|
+
fail ArgumentError, 'invalid value for "end_user_origin_id", the character length must be smaller than or equal to 100.'
|
235
|
+
end
|
236
|
+
|
203
237
|
if end_user_origin_id.to_s.length < 1
|
204
238
|
fail ArgumentError, 'invalid value for "end_user_origin_id", the character length must be great than or equal to 1.'
|
205
239
|
end
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MergeHRISClient
|
17
|
-
# # The
|
17
|
+
# # The Group Object ### Description The `Group` object is used to represent Group information that employees belong to. This is often referenced with an Employee object. Please note: The teams object will fulfill most use cases. The Groups object is for power-users that want all types of groups at a company and the optionality of pulling multiple groups for an employee. ### Usage Example Fetch from the `LIST Employee` endpoint and expand groups to view an employee's groups.
|
18
18
|
class Group
|
19
19
|
attr_accessor :id
|
20
20
|
|
@@ -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
|