merge_hris_client 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/docs/AccountToken.md +3 -1
  4. data/docs/AvailableActions.md +1 -1
  5. data/docs/BenefitRequest.md +28 -0
  6. data/docs/BenefitsApi.md +78 -0
  7. data/docs/DeleteAccountApi.md +77 -0
  8. data/docs/Employee.md +8 -6
  9. data/docs/EmployeeRequest.md +62 -0
  10. data/docs/EmployeesApi.md +83 -1
  11. data/docs/EmploymentRequest.md +34 -0
  12. data/docs/EmploymentsApi.md +78 -0
  13. data/docs/EndUserDetailsRequest.md +1 -1
  14. data/docs/Issue.md +30 -0
  15. data/docs/IssueStatusEnum.md +15 -0
  16. data/docs/IssuesApi.md +167 -0
  17. data/docs/Location.md +1 -1
  18. data/docs/ModelOperation.md +3 -1
  19. data/docs/PaginatedIssueList.md +22 -0
  20. data/docs/PaginatedSyncStatusList.md +22 -0
  21. data/docs/PaginatedTimeOffBalanceList.md +22 -0
  22. data/docs/RemoteDataRequest.md +20 -0
  23. data/docs/SyncStatus.md +1 -1
  24. data/docs/SyncStatusApi.md +89 -11
  25. data/docs/SyncStatusStatusEnum.md +15 -0
  26. data/docs/Team.md +2 -0
  27. data/docs/TeamsApi.md +2 -0
  28. data/docs/TimeOff.md +4 -0
  29. data/docs/TimeOffBalance.md +28 -0
  30. data/docs/TimeOffBalanceApi.md +181 -0
  31. data/lib/merge_hris_client.rb +15 -4
  32. data/lib/merge_hris_client/api/account_token_api.rb +1 -1
  33. data/lib/merge_hris_client/api/available_actions_api.rb +1 -1
  34. data/lib/merge_hris_client/api/benefits_api.rb +70 -1
  35. data/lib/merge_hris_client/api/companies_api.rb +1 -1
  36. data/lib/merge_hris_client/api/delete_account_api.rb +82 -0
  37. data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +1 -1
  38. data/lib/merge_hris_client/api/employees_api.rb +76 -1
  39. data/lib/merge_hris_client/api/employments_api.rb +70 -1
  40. data/lib/merge_hris_client/api/generate_key_api.rb +1 -1
  41. data/lib/merge_hris_client/api/issues_api.rb +169 -0
  42. data/lib/merge_hris_client/api/link_token_api.rb +1 -1
  43. data/lib/merge_hris_client/api/locations_api.rb +1 -1
  44. data/lib/merge_hris_client/api/passthrough_api.rb +1 -1
  45. data/lib/merge_hris_client/api/payroll_runs_api.rb +1 -1
  46. data/lib/merge_hris_client/api/regenerate_key_api.rb +1 -1
  47. data/lib/merge_hris_client/api/sync_status_api.rb +79 -11
  48. data/lib/merge_hris_client/api/teams_api.rb +4 -1
  49. data/lib/merge_hris_client/api/time_off_api.rb +1 -1
  50. data/lib/merge_hris_client/api/time_off_balance_api.rb +196 -0
  51. data/lib/merge_hris_client/api_client.rb +2 -2
  52. data/lib/merge_hris_client/api_error.rb +1 -1
  53. data/lib/merge_hris_client/configuration.rb +1 -1
  54. data/lib/merge_hris_client/models/account_integration.rb +1 -1
  55. data/lib/merge_hris_client/models/account_token.rb +19 -5
  56. data/lib/merge_hris_client/models/available_actions.rb +1 -1
  57. data/lib/merge_hris_client/models/benefit.rb +1 -1
  58. data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +1 -1
  59. data/lib/merge_hris_client/models/benefit_request.rb +276 -0
  60. data/lib/merge_hris_client/models/company.rb +1 -1
  61. data/lib/merge_hris_client/models/country_enum.rb +1 -1
  62. data/lib/merge_hris_client/models/data_passthrough_request.rb +2 -1
  63. data/lib/merge_hris_client/models/deduction.rb +1 -1
  64. data/lib/merge_hris_client/models/earning.rb +1 -1
  65. data/lib/merge_hris_client/models/employee.rb +32 -20
  66. data/lib/merge_hris_client/models/employee_payroll_run.rb +1 -1
  67. data/lib/merge_hris_client/models/employee_request.rb +523 -0
  68. data/lib/merge_hris_client/models/employment.rb +1 -1
  69. data/lib/merge_hris_client/models/employment_request.rb +309 -0
  70. data/lib/merge_hris_client/models/employment_status_enum.rb +1 -1
  71. data/lib/merge_hris_client/models/employment_type_enum.rb +1 -1
  72. data/lib/merge_hris_client/models/end_user_details_request.rb +2 -6
  73. data/lib/merge_hris_client/models/ethnicity_enum.rb +1 -1
  74. data/lib/merge_hris_client/models/flsa_status_enum.rb +1 -1
  75. data/lib/merge_hris_client/models/gender_enum.rb +1 -1
  76. data/lib/merge_hris_client/models/generate_remote_key_request.rb +1 -1
  77. data/lib/merge_hris_client/models/issue.rb +281 -0
  78. data/lib/merge_hris_client/models/issue_status_enum.rb +36 -0
  79. data/lib/merge_hris_client/models/link_token.rb +1 -1
  80. data/lib/merge_hris_client/models/location.rb +4 -4
  81. data/lib/merge_hris_client/models/method_enum.rb +1 -1
  82. data/lib/merge_hris_client/models/model_operation.rb +21 -5
  83. data/lib/merge_hris_client/models/paginated_benefit_list.rb +1 -1
  84. data/lib/merge_hris_client/models/paginated_company_list.rb +1 -1
  85. data/lib/merge_hris_client/models/paginated_employee_list.rb +1 -1
  86. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +1 -1
  87. data/lib/merge_hris_client/models/paginated_employment_list.rb +1 -1
  88. data/lib/merge_hris_client/models/paginated_issue_list.rb +240 -0
  89. data/lib/merge_hris_client/models/paginated_location_list.rb +1 -1
  90. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +1 -1
  91. data/lib/merge_hris_client/models/paginated_sync_status_list.rb +240 -0
  92. data/lib/merge_hris_client/models/paginated_team_list.rb +1 -1
  93. data/lib/merge_hris_client/models/paginated_time_off_balance_list.rb +240 -0
  94. data/lib/merge_hris_client/models/paginated_time_off_list.rb +1 -1
  95. data/lib/merge_hris_client/models/pay_currency_enum.rb +1 -1
  96. data/lib/merge_hris_client/models/pay_frequency_enum.rb +1 -1
  97. data/lib/merge_hris_client/models/pay_period_enum.rb +1 -1
  98. data/lib/merge_hris_client/models/payroll_run.rb +1 -1
  99. data/lib/merge_hris_client/models/remote_data.rb +1 -1
  100. data/lib/merge_hris_client/models/remote_data_request.rb +234 -0
  101. data/lib/merge_hris_client/models/remote_key.rb +1 -1
  102. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +1 -1
  103. data/lib/merge_hris_client/models/remote_response.rb +1 -1
  104. data/lib/merge_hris_client/models/request_type_enum.rb +1 -1
  105. data/lib/merge_hris_client/models/run_state_enum.rb +1 -1
  106. data/lib/merge_hris_client/models/run_type_enum.rb +1 -1
  107. data/lib/merge_hris_client/models/sync_status.rb +2 -2
  108. data/lib/merge_hris_client/models/sync_status_status_enum.rb +37 -0
  109. data/lib/merge_hris_client/models/tax.rb +1 -1
  110. data/lib/merge_hris_client/models/team.rb +13 -2
  111. data/lib/merge_hris_client/models/time_off.rb +24 -2
  112. data/lib/merge_hris_client/models/time_off_balance.rb +275 -0
  113. data/lib/merge_hris_client/models/time_off_status_enum.rb +1 -1
  114. data/lib/merge_hris_client/models/type_enum.rb +1 -1
  115. data/lib/merge_hris_client/models/units_enum.rb +1 -1
  116. data/lib/merge_hris_client/version.rb +2 -2
  117. data/merge_hris_client-1.0.1.gem +0 -0
  118. data/merge_hris_client.gemspec +1 -1
  119. data/spec/api/delete_account_api_spec.rb +46 -0
  120. data/spec/api/generate_key_api_spec.rb +46 -0
  121. data/spec/api/issues_api_spec.rb +65 -0
  122. data/spec/api/sync_status_api_spec.rb +59 -0
  123. data/spec/api/time_off_balance_api_spec.rb +70 -0
  124. data/spec/api_client_spec.rb +1 -1
  125. data/spec/configuration_spec.rb +1 -1
  126. data/spec/models/benefit_request_spec.rb +64 -0
  127. data/spec/models/employee_request_spec.rb +160 -0
  128. data/spec/models/employment_request_spec.rb +82 -0
  129. data/spec/models/generate_remote_key_request_spec.rb +34 -0
  130. data/spec/models/issue_spec.rb +70 -0
  131. data/spec/models/issue_status_enum_spec.rb +28 -0
  132. data/spec/models/paginated_issue_list_spec.rb +46 -0
  133. data/spec/models/paginated_sync_status_list_spec.rb +46 -0
  134. data/spec/models/paginated_time_off_balance_list_spec.rb +46 -0
  135. data/spec/models/remote_data_request_spec.rb +40 -0
  136. data/spec/models/sync_status_spec.rb +64 -0
  137. data/spec/models/sync_status_status_enum_spec.rb +28 -0
  138. data/spec/models/time_off_balance_spec.rb +64 -0
  139. data/spec/spec_helper.rb +1 -1
  140. data/test_ruby.rb +14 -11
  141. metadata +67 -2
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,309 @@
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 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.
18
+ class EmploymentRequest
19
+ # The third-party API ID of the matching object.
20
+ attr_accessor :remote_id
21
+
22
+ # The position's title.
23
+ attr_accessor :job_title
24
+
25
+ # The position's pay rate in dollars.
26
+ attr_accessor :pay_rate
27
+
28
+ # The time period this pay rate encompasses.
29
+ attr_accessor :pay_period
30
+
31
+ # The position's pay frequency.
32
+ attr_accessor :pay_frequency
33
+
34
+ # The position's currency code.
35
+ attr_accessor :pay_currency
36
+
37
+ # The position's FLSA status.
38
+ attr_accessor :flsa_status
39
+
40
+ # The position's effective date.
41
+ attr_accessor :effective_date
42
+
43
+ # The position's type of employment.
44
+ attr_accessor :employment_type
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'remote_id' => :'remote_id',
50
+ :'job_title' => :'job_title',
51
+ :'pay_rate' => :'pay_rate',
52
+ :'pay_period' => :'pay_period',
53
+ :'pay_frequency' => :'pay_frequency',
54
+ :'pay_currency' => :'pay_currency',
55
+ :'flsa_status' => :'flsa_status',
56
+ :'effective_date' => :'effective_date',
57
+ :'employment_type' => :'employment_type'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'remote_id' => :'String',
70
+ :'job_title' => :'String',
71
+ :'pay_rate' => :'Float',
72
+ :'pay_period' => :'PayPeriodEnum',
73
+ :'pay_frequency' => :'PayFrequencyEnum',
74
+ :'pay_currency' => :'PayCurrencyEnum',
75
+ :'flsa_status' => :'FlsaStatusEnum',
76
+ :'effective_date' => :'Time',
77
+ :'employment_type' => :'EmploymentTypeEnum'
78
+ }
79
+ end
80
+
81
+ # List of attributes with nullable: true
82
+ def self.openapi_nullable
83
+ Set.new([
84
+ :'remote_id',
85
+ :'job_title',
86
+ :'pay_rate',
87
+ :'pay_period',
88
+ :'pay_frequency',
89
+ :'pay_currency',
90
+ :'flsa_status',
91
+ :'effective_date',
92
+ :'employment_type'
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::EmploymentRequest` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::EmploymentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'remote_id')
112
+ self.remote_id = attributes[:'remote_id']
113
+ end
114
+
115
+ if attributes.key?(:'job_title')
116
+ self.job_title = attributes[:'job_title']
117
+ end
118
+
119
+ if attributes.key?(:'pay_rate')
120
+ self.pay_rate = attributes[:'pay_rate']
121
+ end
122
+
123
+ if attributes.key?(:'pay_period')
124
+ self.pay_period = attributes[:'pay_period']
125
+ end
126
+
127
+ if attributes.key?(:'pay_frequency')
128
+ self.pay_frequency = attributes[:'pay_frequency']
129
+ end
130
+
131
+ if attributes.key?(:'pay_currency')
132
+ self.pay_currency = attributes[:'pay_currency']
133
+ end
134
+
135
+ if attributes.key?(:'flsa_status')
136
+ self.flsa_status = attributes[:'flsa_status']
137
+ end
138
+
139
+ if attributes.key?(:'effective_date')
140
+ self.effective_date = attributes[:'effective_date']
141
+ end
142
+
143
+ if attributes.key?(:'employment_type')
144
+ self.employment_type = attributes[:'employment_type']
145
+ end
146
+ end
147
+
148
+ # Show invalid properties with the reasons. Usually used together with valid?
149
+ # @return Array for valid properties with the reasons
150
+ def list_invalid_properties
151
+ invalid_properties = Array.new
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ true
159
+ end
160
+
161
+ # Checks equality by comparing each attribute.
162
+ # @param [Object] Object to be compared
163
+ def ==(o)
164
+ return true if self.equal?(o)
165
+ self.class == o.class &&
166
+ remote_id == o.remote_id &&
167
+ job_title == o.job_title &&
168
+ pay_rate == o.pay_rate &&
169
+ pay_period == o.pay_period &&
170
+ pay_frequency == o.pay_frequency &&
171
+ pay_currency == o.pay_currency &&
172
+ flsa_status == o.flsa_status &&
173
+ effective_date == o.effective_date &&
174
+ employment_type == o.employment_type
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Integer] Hash code
185
+ def hash
186
+ [remote_id, job_title, pay_rate, pay_period, pay_frequency, pay_currency, flsa_status, effective_date, employment_type].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def self.build_from_hash(attributes)
193
+ new.build_from_hash(attributes)
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ self.class.openapi_types.each_pair do |key, type|
202
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
203
+ self.send("#{key}=", nil)
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
208
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
209
+ end
210
+ elsif !attributes[self.class.attribute_map[key]].nil?
211
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
+ end
213
+ end
214
+
215
+ self
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def _deserialize(type, value)
223
+ case type.to_sym
224
+ when :Time
225
+ Time.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :Boolean
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ # models (e.g. Pet) or oneOf
256
+ klass = MergeHRISClient.const_get(type)
257
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+
307
+ end
308
+
309
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -77,6 +77,7 @@ module MergeHRISClient
77
77
  # List of attributes with nullable: true
78
78
  def self.openapi_nullable
79
79
  Set.new([
80
+ :'integration'
80
81
  ])
81
82
  end
82
83
 
@@ -134,10 +135,6 @@ module MergeHRISClient
134
135
  invalid_properties.push('invalid value for "end_user_origin_id", end_user_origin_id cannot be nil.')
135
136
  end
136
137
 
137
- if @categories.nil?
138
- invalid_properties.push('invalid value for "categories", categories cannot be nil.')
139
- end
140
-
141
138
  invalid_properties
142
139
  end
143
140
 
@@ -147,7 +144,6 @@ module MergeHRISClient
147
144
  return false if @end_user_email_address.nil?
148
145
  return false if @end_user_organization_name.nil?
149
146
  return false if @end_user_origin_id.nil?
150
- return false if @categories.nil?
151
147
  true
152
148
  end
153
149
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0
7
7
  Contact: hello@merge.dev
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.0.0
9
+ OpenAPI Generator version: 5.1.1
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,281 @@
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 Issue
18
+ attr_accessor :id
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :error_description
23
+
24
+ attr_accessor :end_user
25
+
26
+ attr_accessor :first_incident_time
27
+
28
+ attr_accessor :last_incident_time
29
+
30
+ attr_accessor :is_muted
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'id' => :'id',
36
+ :'status' => :'status',
37
+ :'error_description' => :'error_description',
38
+ :'end_user' => :'end_user',
39
+ :'first_incident_time' => :'first_incident_time',
40
+ :'last_incident_time' => :'last_incident_time',
41
+ :'is_muted' => :'is_muted'
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
+ :'id' => :'String',
54
+ :'status' => :'IssueStatusEnum',
55
+ :'error_description' => :'String',
56
+ :'end_user' => :'Hash<String, AnyType>',
57
+ :'first_incident_time' => :'Time',
58
+ :'last_incident_time' => :'Time',
59
+ :'is_muted' => :'Boolean'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.openapi_nullable
65
+ Set.new([
66
+ :'first_incident_time',
67
+ :'last_incident_time',
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::Issue` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::Issue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'id')
87
+ self.id = attributes[:'id']
88
+ end
89
+
90
+ if attributes.key?(:'status')
91
+ self.status = attributes[:'status']
92
+ end
93
+
94
+ if attributes.key?(:'error_description')
95
+ self.error_description = attributes[:'error_description']
96
+ end
97
+
98
+ if attributes.key?(:'end_user')
99
+ if (value = attributes[:'end_user']).is_a?(Hash)
100
+ self.end_user = value
101
+ end
102
+ end
103
+
104
+ if attributes.key?(:'first_incident_time')
105
+ self.first_incident_time = attributes[:'first_incident_time']
106
+ end
107
+
108
+ if attributes.key?(:'last_incident_time')
109
+ self.last_incident_time = attributes[:'last_incident_time']
110
+ end
111
+
112
+ if attributes.key?(:'is_muted')
113
+ self.is_muted = attributes[:'is_muted']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ if @error_description.nil?
122
+ invalid_properties.push('invalid value for "error_description", error_description cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ return false if @error_description.nil?
132
+ true
133
+ end
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] Object to be compared
137
+ def ==(o)
138
+ return true if self.equal?(o)
139
+ self.class == o.class &&
140
+ id == o.id &&
141
+ status == o.status &&
142
+ error_description == o.error_description &&
143
+ end_user == o.end_user &&
144
+ first_incident_time == o.first_incident_time &&
145
+ last_incident_time == o.last_incident_time &&
146
+ is_muted == o.is_muted
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [id, status, error_description, end_user, first_incident_time, last_incident_time, is_muted].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ new.build_from_hash(attributes)
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ self.class.openapi_types.each_pair do |key, type|
174
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
+ self.send("#{key}=", nil)
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
180
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
+ end
182
+ elsif !attributes[self.class.attribute_map[key]].nil?
183
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
184
+ end
185
+ end
186
+
187
+ self
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def _deserialize(type, value)
195
+ case type.to_sym
196
+ when :Time
197
+ Time.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :Boolean
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ # models (e.g. Pet) or oneOf
228
+ klass = MergeHRISClient.const_get(type)
229
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end