merge_hris_client 3.1.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -13
  3. data/docs/AsyncPassthroughApi.md +155 -0
  4. data/docs/AsyncPassthroughReciept.md +18 -0
  5. data/docs/BankInfo.md +2 -2
  6. data/docs/BankInfoApi.md +2 -2
  7. data/docs/Benefit.md +9 -3
  8. data/docs/BenefitPlanTypeEnum.md +15 -0
  9. data/docs/Company.md +2 -2
  10. data/docs/Deduction.md +2 -2
  11. data/docs/DeleteAccountApi.md +9 -9
  12. data/docs/Dependent.md +50 -0
  13. data/docs/DependentsApi.md +181 -0
  14. data/docs/Earning.md +2 -2
  15. data/docs/Employee.md +2 -2
  16. data/docs/EmployeePayrollRun.md +2 -2
  17. data/docs/EmployerBenefit.md +36 -0
  18. data/docs/EmployerBenefitsApi.md +177 -0
  19. data/docs/Employment.md +2 -2
  20. data/docs/EmploymentsApi.md +2 -2
  21. data/docs/EndUserDetailsRequest.md +1 -1
  22. data/docs/Group.md +2 -2
  23. data/docs/LinkedAccountsApi.md +2 -2
  24. data/docs/Location.md +3 -3
  25. data/docs/PaginatedDependentList.md +22 -0
  26. data/docs/PaginatedEmployerBenefitList.md +22 -0
  27. data/docs/PayGroup.md +2 -2
  28. data/docs/PayrollRun.md +2 -2
  29. data/docs/RelationshipEnum.md +15 -0
  30. data/docs/RemoteData.md +1 -1
  31. data/docs/SyncStatusApi.md +1 -1
  32. data/docs/Tax.md +2 -2
  33. data/docs/Team.md +2 -2
  34. data/docs/TimeOff.md +2 -2
  35. data/docs/TimeOffBalance.md +2 -2
  36. data/lib/merge_hris_client/api/async_passthrough_api.rb +160 -0
  37. data/lib/merge_hris_client/api/bank_info_api.rb +2 -2
  38. data/lib/merge_hris_client/api/delete_account_api.rb +7 -7
  39. data/lib/merge_hris_client/api/dependents_api.rb +188 -0
  40. data/lib/merge_hris_client/api/employer_benefits_api.rb +182 -0
  41. data/lib/merge_hris_client/api/employments_api.rb +2 -2
  42. data/lib/merge_hris_client/api/linked_accounts_api.rb +2 -2
  43. data/lib/merge_hris_client/api/sync_status_api.rb +2 -2
  44. data/lib/merge_hris_client/models/async_passthrough_reciept.rb +223 -0
  45. data/lib/merge_hris_client/models/bank_info.rb +10 -10
  46. data/lib/merge_hris_client/models/benefit.rb +42 -9
  47. data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +48 -0
  48. data/lib/merge_hris_client/models/company.rb +10 -10
  49. data/lib/merge_hris_client/models/deduction.rb +10 -10
  50. data/lib/merge_hris_client/models/dependent.rb +470 -0
  51. data/lib/merge_hris_client/models/earning.rb +10 -10
  52. data/lib/merge_hris_client/models/employee.rb +10 -10
  53. data/lib/merge_hris_client/models/employee_payroll_run.rb +10 -10
  54. data/lib/merge_hris_client/models/employer_benefit.rb +363 -0
  55. data/lib/merge_hris_client/models/employment.rb +10 -10
  56. data/lib/merge_hris_client/models/end_user_details_request.rb +1 -1
  57. data/lib/merge_hris_client/models/group.rb +10 -10
  58. data/lib/merge_hris_client/models/location.rb +10 -10
  59. data/lib/merge_hris_client/models/paginated_dependent_list.rb +240 -0
  60. data/lib/merge_hris_client/models/paginated_employer_benefit_list.rb +240 -0
  61. data/lib/merge_hris_client/models/pay_group.rb +10 -10
  62. data/lib/merge_hris_client/models/payroll_run.rb +10 -10
  63. data/lib/merge_hris_client/models/relationship_enum.rb +46 -0
  64. data/lib/merge_hris_client/models/remote_data.rb +3 -4
  65. data/lib/merge_hris_client/models/sync_status_status_enum.rb +2 -1
  66. data/lib/merge_hris_client/models/tax.rb +10 -10
  67. data/lib/merge_hris_client/models/team.rb +10 -10
  68. data/lib/merge_hris_client/models/time_off.rb +10 -10
  69. data/lib/merge_hris_client/models/time_off_balance.rb +10 -10
  70. data/lib/merge_hris_client/version.rb +1 -1
  71. data/lib/merge_hris_client.rb +16 -2
  72. data/spec/api/async_passthrough_api_spec.rb +59 -0
  73. data/spec/api/bank_info_api_spec.rb +1 -1
  74. data/spec/api/delete_account_api_spec.rb +2 -2
  75. data/spec/api/dependents_api_spec.rb +70 -0
  76. data/spec/api/employer_benefits_api_spec.rb +68 -0
  77. data/spec/api/employments_api_spec.rb +1 -1
  78. data/spec/api/linked_accounts_api_spec.rb +1 -1
  79. data/spec/api/sync_status_api_spec.rb +1 -1
  80. data/spec/models/async_passthrough_reciept_spec.rb +34 -0
  81. data/spec/models/bank_info_spec.rb +2 -2
  82. data/spec/models/benefit_plan_type_enum_spec.rb +28 -0
  83. data/spec/models/benefit_spec.rb +19 -1
  84. data/spec/models/company_spec.rb +2 -2
  85. data/spec/models/deduction_spec.rb +2 -2
  86. data/spec/models/dependent_spec.rb +130 -0
  87. data/spec/models/earning_spec.rb +2 -2
  88. data/spec/models/employee_payroll_run_spec.rb +2 -2
  89. data/spec/models/employee_spec.rb +2 -2
  90. data/spec/models/employer_benefit_spec.rb +88 -0
  91. data/spec/models/employment_spec.rb +2 -2
  92. data/spec/models/group_spec.rb +2 -2
  93. data/spec/models/location_spec.rb +2 -2
  94. data/spec/models/paginated_dependent_list_spec.rb +46 -0
  95. data/spec/models/paginated_employer_benefit_list_spec.rb +46 -0
  96. data/spec/models/pay_group_spec.rb +2 -2
  97. data/spec/models/payroll_run_spec.rb +2 -2
  98. data/spec/models/relationship_enum_spec.rb +28 -0
  99. data/spec/models/tax_spec.rb +2 -2
  100. data/spec/models/team_spec.rb +2 -2
  101. data/spec/models/time_off_balance_spec.rb +2 -2
  102. data/spec/models/time_off_spec.rb +2 -2
  103. metadata +161 -121
@@ -33,11 +33,11 @@ module MergeHRISClient
33
33
  # Indicates whether or not this object has been deleted by third party webhooks.
34
34
  attr_accessor :remote_was_deleted
35
35
 
36
- attr_accessor :field_mappings
37
-
38
36
  # This is the datetime that this object was last updated by Merge
39
37
  attr_accessor :modified_at
40
38
 
39
+ attr_accessor :field_mappings
40
+
41
41
  attr_accessor :remote_data
42
42
 
43
43
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -49,8 +49,8 @@ module MergeHRISClient
49
49
  :'name' => :'name',
50
50
  :'type' => :'type',
51
51
  :'remote_was_deleted' => :'remote_was_deleted',
52
- :'field_mappings' => :'field_mappings',
53
52
  :'modified_at' => :'modified_at',
53
+ :'field_mappings' => :'field_mappings',
54
54
  :'remote_data' => :'remote_data'
55
55
  }
56
56
  end
@@ -69,8 +69,8 @@ module MergeHRISClient
69
69
  :'name' => :'String',
70
70
  :'type' => :'GroupTypeEnum',
71
71
  :'remote_was_deleted' => :'Boolean',
72
- :'field_mappings' => :'Hash<String, Object>',
73
72
  :'modified_at' => :'Time',
73
+ :'field_mappings' => :'Hash<String, Object>',
74
74
  :'remote_data' => :'Array<RemoteData>'
75
75
  }
76
76
  end
@@ -126,16 +126,16 @@ module MergeHRISClient
126
126
  self.remote_was_deleted = attributes[:'remote_was_deleted']
127
127
  end
128
128
 
129
+ if attributes.key?(:'modified_at')
130
+ self.modified_at = attributes[:'modified_at']
131
+ end
132
+
129
133
  if attributes.key?(:'field_mappings')
130
134
  if (value = attributes[:'field_mappings']).is_a?(Hash)
131
135
  self.field_mappings = value
132
136
  end
133
137
  end
134
138
 
135
- if attributes.key?(:'modified_at')
136
- self.modified_at = attributes[:'modified_at']
137
- end
138
-
139
139
  if attributes.key?(:'remote_data')
140
140
  if (value = attributes[:'remote_data']).is_a?(Array)
141
141
  self.remote_data = value
@@ -167,8 +167,8 @@ module MergeHRISClient
167
167
  name == o.name &&
168
168
  type == o.type &&
169
169
  remote_was_deleted == o.remote_was_deleted &&
170
- field_mappings == o.field_mappings &&
171
170
  modified_at == o.modified_at &&
171
+ field_mappings == o.field_mappings &&
172
172
  remote_data == o.remote_data
173
173
  end
174
174
 
@@ -181,7 +181,7 @@ module MergeHRISClient
181
181
  # Calculates hash code according to all attributes.
182
182
  # @return [Integer] Hash code
183
183
  def hash
184
- [id, remote_id, parent_group, name, type, remote_was_deleted, field_mappings, modified_at, remote_data].hash
184
+ [id, remote_id, parent_group, name, type, remote_was_deleted, modified_at, field_mappings, remote_data].hash
185
185
  end
186
186
 
187
187
  # Builds the object from hash
@@ -51,11 +51,11 @@ module MergeHRISClient
51
51
  # Indicates whether or not this object has been deleted by third party webhooks.
52
52
  attr_accessor :remote_was_deleted
53
53
 
54
- attr_accessor :field_mappings
55
-
56
54
  # This is the datetime that this object was last updated by Merge
57
55
  attr_accessor :modified_at
58
56
 
57
+ attr_accessor :field_mappings
58
+
59
59
  attr_accessor :remote_data
60
60
 
61
61
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -73,8 +73,8 @@ module MergeHRISClient
73
73
  :'country' => :'country',
74
74
  :'location_type' => :'location_type',
75
75
  :'remote_was_deleted' => :'remote_was_deleted',
76
- :'field_mappings' => :'field_mappings',
77
76
  :'modified_at' => :'modified_at',
77
+ :'field_mappings' => :'field_mappings',
78
78
  :'remote_data' => :'remote_data'
79
79
  }
80
80
  end
@@ -99,8 +99,8 @@ module MergeHRISClient
99
99
  :'country' => :'CountryEnum',
100
100
  :'location_type' => :'LocationTypeEnum',
101
101
  :'remote_was_deleted' => :'Boolean',
102
- :'field_mappings' => :'Hash<String, Object>',
103
102
  :'modified_at' => :'Time',
103
+ :'field_mappings' => :'Hash<String, Object>',
104
104
  :'remote_data' => :'Array<RemoteData>'
105
105
  }
106
106
  end
@@ -186,16 +186,16 @@ module MergeHRISClient
186
186
  self.remote_was_deleted = attributes[:'remote_was_deleted']
187
187
  end
188
188
 
189
+ if attributes.key?(:'modified_at')
190
+ self.modified_at = attributes[:'modified_at']
191
+ end
192
+
189
193
  if attributes.key?(:'field_mappings')
190
194
  if (value = attributes[:'field_mappings']).is_a?(Hash)
191
195
  self.field_mappings = value
192
196
  end
193
197
  end
194
198
 
195
- if attributes.key?(:'modified_at')
196
- self.modified_at = attributes[:'modified_at']
197
- end
198
-
199
199
  if attributes.key?(:'remote_data')
200
200
  if (value = attributes[:'remote_data']).is_a?(Array)
201
201
  self.remote_data = value
@@ -233,8 +233,8 @@ module MergeHRISClient
233
233
  country == o.country &&
234
234
  location_type == o.location_type &&
235
235
  remote_was_deleted == o.remote_was_deleted &&
236
- field_mappings == o.field_mappings &&
237
236
  modified_at == o.modified_at &&
237
+ field_mappings == o.field_mappings &&
238
238
  remote_data == o.remote_data
239
239
  end
240
240
 
@@ -247,7 +247,7 @@ module MergeHRISClient
247
247
  # Calculates hash code according to all attributes.
248
248
  # @return [Integer] Hash code
249
249
  def hash
250
- [id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, location_type, remote_was_deleted, field_mappings, modified_at, remote_data].hash
250
+ [id, remote_id, name, phone_number, street_1, street_2, city, state, zip_code, country, location_type, remote_was_deleted, modified_at, field_mappings, remote_data].hash
251
251
  end
252
252
 
253
253
  # Builds the object from hash
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #Merge HRIS API
3
+
4
+ #The unified API for building rich integrations with multiple HR Information System platforms.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: hello@merge.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MergeHRISClient
17
+ class PaginatedDependentList
18
+ attr_accessor :_next
19
+
20
+ attr_accessor :previous
21
+
22
+ attr_accessor :results
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'_next' => :'next',
28
+ :'previous' => :'previous',
29
+ :'results' => :'results'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<Dependent>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'_next',
51
+ :'previous',
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::PaginatedDependentList` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::PaginatedDependentList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'_next')
71
+ self._next = attributes[:'_next']
72
+ end
73
+
74
+ if attributes.key?(:'previous')
75
+ self.previous = attributes[:'previous']
76
+ end
77
+
78
+ if attributes.key?(:'results')
79
+ if (value = attributes[:'results']).is_a?(Array)
80
+ self.results = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ _next == o._next &&
104
+ previous == o.previous &&
105
+ results == o.results
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [_next, previous, results].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = MergeHRISClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -0,0 +1,240 @@
1
+ =begin
2
+ #Merge HRIS API
3
+
4
+ #The unified API for building rich integrations with multiple HR Information System platforms.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: hello@merge.dev
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MergeHRISClient
17
+ class PaginatedEmployerBenefitList
18
+ attr_accessor :_next
19
+
20
+ attr_accessor :previous
21
+
22
+ attr_accessor :results
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'_next' => :'next',
28
+ :'previous' => :'previous',
29
+ :'results' => :'results'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'_next' => :'String',
42
+ :'previous' => :'String',
43
+ :'results' => :'Array<EmployerBenefit>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ :'_next',
51
+ :'previous',
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::PaginatedEmployerBenefitList` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::PaginatedEmployerBenefitList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'_next')
71
+ self._next = attributes[:'_next']
72
+ end
73
+
74
+ if attributes.key?(:'previous')
75
+ self.previous = attributes[:'previous']
76
+ end
77
+
78
+ if attributes.key?(:'results')
79
+ if (value = attributes[:'results']).is_a?(Array)
80
+ self.results = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ _next == o._next &&
104
+ previous == o.previous &&
105
+ results == o.results
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [_next, previous, results].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.openapi_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = MergeHRISClient.const_get(type)
188
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -27,11 +27,11 @@ module MergeHRISClient
27
27
  # Indicates whether or not this object has been deleted by third party webhooks.
28
28
  attr_accessor :remote_was_deleted
29
29
 
30
- attr_accessor :field_mappings
31
-
32
30
  # This is the datetime that this object was last updated by Merge
33
31
  attr_accessor :modified_at
34
32
 
33
+ attr_accessor :field_mappings
34
+
35
35
  attr_accessor :remote_data
36
36
 
37
37
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -41,8 +41,8 @@ module MergeHRISClient
41
41
  :'remote_id' => :'remote_id',
42
42
  :'pay_group_name' => :'pay_group_name',
43
43
  :'remote_was_deleted' => :'remote_was_deleted',
44
- :'field_mappings' => :'field_mappings',
45
44
  :'modified_at' => :'modified_at',
45
+ :'field_mappings' => :'field_mappings',
46
46
  :'remote_data' => :'remote_data'
47
47
  }
48
48
  end
@@ -59,8 +59,8 @@ module MergeHRISClient
59
59
  :'remote_id' => :'String',
60
60
  :'pay_group_name' => :'String',
61
61
  :'remote_was_deleted' => :'Boolean',
62
- :'field_mappings' => :'Hash<String, Object>',
63
62
  :'modified_at' => :'Time',
63
+ :'field_mappings' => :'Hash<String, Object>',
64
64
  :'remote_data' => :'Array<RemoteData>'
65
65
  }
66
66
  end
@@ -106,16 +106,16 @@ module MergeHRISClient
106
106
  self.remote_was_deleted = attributes[:'remote_was_deleted']
107
107
  end
108
108
 
109
+ if attributes.key?(:'modified_at')
110
+ self.modified_at = attributes[:'modified_at']
111
+ end
112
+
109
113
  if attributes.key?(:'field_mappings')
110
114
  if (value = attributes[:'field_mappings']).is_a?(Hash)
111
115
  self.field_mappings = value
112
116
  end
113
117
  end
114
118
 
115
- if attributes.key?(:'modified_at')
116
- self.modified_at = attributes[:'modified_at']
117
- end
118
-
119
119
  if attributes.key?(:'remote_data')
120
120
  if (value = attributes[:'remote_data']).is_a?(Array)
121
121
  self.remote_data = value
@@ -145,8 +145,8 @@ module MergeHRISClient
145
145
  remote_id == o.remote_id &&
146
146
  pay_group_name == o.pay_group_name &&
147
147
  remote_was_deleted == o.remote_was_deleted &&
148
- field_mappings == o.field_mappings &&
149
148
  modified_at == o.modified_at &&
149
+ field_mappings == o.field_mappings &&
150
150
  remote_data == o.remote_data
151
151
  end
152
152
 
@@ -159,7 +159,7 @@ module MergeHRISClient
159
159
  # Calculates hash code according to all attributes.
160
160
  # @return [Integer] Hash code
161
161
  def hash
162
- [id, remote_id, pay_group_name, remote_was_deleted, field_mappings, modified_at, remote_data].hash
162
+ [id, remote_id, pay_group_name, remote_was_deleted, modified_at, field_mappings, remote_data].hash
163
163
  end
164
164
 
165
165
  # Builds the object from hash