merge_hris_client 3.2.1 → 3.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -16
  3. data/docs/AccountDetails.md +3 -1
  4. data/docs/AccountDetailsAndActions.md +7 -3
  5. data/docs/AccountIntegration.md +8 -4
  6. data/docs/AdvancedMetadata.md +28 -0
  7. data/docs/AuditLogEvent.md +32 -0
  8. data/docs/AuditTrailApi.md +91 -0
  9. data/docs/BankInfo.md +6 -4
  10. data/docs/BankInfoApi.md +4 -4
  11. data/docs/Benefit.md +6 -4
  12. data/docs/CommonModelScopeAPI.md +18 -0
  13. data/docs/Company.md +6 -4
  14. data/docs/CreateFieldMappingRequest.md +28 -0
  15. data/docs/DataPassthroughRequest.md +4 -4
  16. data/docs/DebugModelLogSummary.md +1 -1
  17. data/docs/Deduction.md +6 -4
  18. data/docs/Dependent.md +6 -4
  19. data/docs/Earning.md +6 -4
  20. data/docs/Employee.md +7 -3
  21. data/docs/EmployeePayrollRun.md +6 -4
  22. data/docs/EmployeeRequest.md +2 -0
  23. data/docs/EmployeesApi.md +10 -4
  24. data/docs/EmployerBenefit.md +6 -4
  25. data/docs/Employment.md +6 -4
  26. data/docs/EmploymentsApi.md +4 -4
  27. data/docs/EndUserDetailsRequest.md +13 -7
  28. data/docs/EventTypeEnum.md +15 -0
  29. data/docs/ExternalTargetFieldAPI.md +22 -0
  30. data/docs/ExternalTargetFieldAPIResponse.md +48 -0
  31. data/docs/FieldMappingApi.md +455 -0
  32. data/docs/FieldMappingApiInstance.md +24 -0
  33. data/docs/FieldMappingApiInstanceRemoteField.md +22 -0
  34. data/docs/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.md +22 -0
  35. data/docs/FieldMappingApiInstanceResponse.md +48 -0
  36. data/docs/FieldMappingApiInstanceTargetField.md +22 -0
  37. data/docs/FieldMappingInstanceResponse.md +24 -0
  38. data/docs/FieldPermissionDeserializer.md +20 -0
  39. data/docs/FieldPermissionDeserializerRequest.md +20 -0
  40. data/docs/ForceResyncApi.md +1 -1
  41. data/docs/GenerateRemoteKeyRequest.md +1 -1
  42. data/docs/Group.md +9 -5
  43. data/docs/GroupsApi.md +8 -4
  44. data/docs/IndividualCommonModelScopeDeserializer.md +22 -0
  45. data/docs/IndividualCommonModelScopeDeserializerRequest.md +22 -0
  46. data/docs/Issue.md +1 -1
  47. data/docs/IssuesApi.md +5 -3
  48. data/docs/LinkTokenApi.md +1 -1
  49. data/docs/LinkedAccountCommonModelScopeDeserializerRequest.md +18 -0
  50. data/docs/LinkedAccountsApi.md +2 -2
  51. data/docs/Location.md +6 -4
  52. data/docs/LocationsApi.md +6 -4
  53. data/docs/MetaResponse.md +1 -1
  54. data/docs/ModelPermissionDeserializer.md +18 -0
  55. data/docs/ModelPermissionDeserializerRequest.md +18 -0
  56. data/docs/PaginatedAuditLogEventList.md +22 -0
  57. data/docs/PaginatedTimesheetEntryList.md +22 -0
  58. data/docs/PatchedEditFieldMappingRequest.md +22 -0
  59. data/docs/PayGroup.md +6 -4
  60. data/docs/PayrollRun.md +6 -4
  61. data/docs/PayrollRunsApi.md +4 -4
  62. data/docs/RemoteEndpointInfo.md +22 -0
  63. data/docs/RemoteFieldAPI.md +28 -0
  64. data/docs/RemoteFieldAPIResponse.md +48 -0
  65. data/docs/RemoteKeyForRegenerationRequest.md +1 -1
  66. data/docs/RoleEnum.md +15 -0
  67. data/docs/ScopesApi.md +222 -0
  68. data/docs/SyncStatusApi.md +1 -1
  69. data/docs/Tax.md +6 -4
  70. data/docs/Team.md +6 -4
  71. data/docs/TimeOff.md +5 -3
  72. data/docs/TimeOffApi.md +12 -4
  73. data/docs/TimeOffBalance.md +6 -4
  74. data/docs/TimeOffBalancesApi.md +4 -4
  75. data/docs/TimesheetEntriesApi.md +341 -0
  76. data/docs/TimesheetEntry.md +38 -0
  77. data/docs/TimesheetEntryEndpointRequest.md +18 -0
  78. data/docs/TimesheetEntryRequest.md +28 -0
  79. data/docs/TimesheetEntryResponse.md +24 -0
  80. data/lib/merge_hris_client/api/audit_trail_api.rb +95 -0
  81. data/lib/merge_hris_client/api/bank_info_api.rb +4 -4
  82. data/lib/merge_hris_client/api/employees_api.rb +13 -4
  83. data/lib/merge_hris_client/api/employments_api.rb +4 -4
  84. data/lib/merge_hris_client/api/field_mapping_api.rb +424 -0
  85. data/lib/merge_hris_client/api/force_resync_api.rb +2 -2
  86. data/lib/merge_hris_client/api/groups_api.rb +10 -4
  87. data/lib/merge_hris_client/api/issues_api.rb +7 -4
  88. data/lib/merge_hris_client/api/linked_accounts_api.rb +3 -3
  89. data/lib/merge_hris_client/api/locations_api.rb +11 -4
  90. data/lib/merge_hris_client/api/payroll_runs_api.rb +4 -4
  91. data/lib/merge_hris_client/api/scopes_api.rb +209 -0
  92. data/lib/merge_hris_client/api/sync_status_api.rb +2 -2
  93. data/lib/merge_hris_client/api/time_off_api.rb +16 -4
  94. data/lib/merge_hris_client/api/time_off_balances_api.rb +4 -4
  95. data/lib/merge_hris_client/api/timesheet_entries_api.rb +342 -0
  96. data/lib/merge_hris_client/configuration.rb +4 -0
  97. data/lib/merge_hris_client/models/account_details.rb +14 -5
  98. data/lib/merge_hris_client/models/account_details_and_actions.rb +28 -4
  99. data/lib/merge_hris_client/models/account_integration.rb +36 -14
  100. data/lib/merge_hris_client/models/advanced_metadata.rb +270 -0
  101. data/lib/merge_hris_client/models/audit_log_event.rb +356 -0
  102. data/lib/merge_hris_client/models/bank_info.rb +24 -16
  103. data/lib/merge_hris_client/models/benefit.rb +24 -16
  104. data/lib/merge_hris_client/models/common_model_scope_api.rb +226 -0
  105. data/lib/merge_hris_client/models/company.rb +24 -16
  106. data/lib/merge_hris_client/models/create_field_mapping_request.rb +396 -0
  107. data/lib/merge_hris_client/models/data_passthrough_request.rb +3 -0
  108. data/lib/merge_hris_client/models/deduction.rb +24 -16
  109. data/lib/merge_hris_client/models/dependent.rb +24 -16
  110. data/lib/merge_hris_client/models/earning.rb +24 -16
  111. data/lib/merge_hris_client/models/employee.rb +34 -15
  112. data/lib/merge_hris_client/models/employee_payroll_run.rb +24 -16
  113. data/lib/merge_hris_client/models/employee_request.rb +12 -1
  114. data/lib/merge_hris_client/models/employer_benefit.rb +24 -16
  115. data/lib/merge_hris_client/models/employment.rb +24 -16
  116. data/lib/merge_hris_client/models/end_user_details_request.rb +67 -6
  117. data/lib/merge_hris_client/models/event_type_enum.rb +81 -0
  118. data/lib/merge_hris_client/models/external_target_field_api.rb +239 -0
  119. data/lib/merge_hris_client/models/external_target_field_api_response.rb +385 -0
  120. data/lib/merge_hris_client/models/field_mapping_api_instance.rb +247 -0
  121. data/lib/merge_hris_client/models/field_mapping_api_instance_remote_field.rb +253 -0
  122. data/lib/merge_hris_client/models/field_mapping_api_instance_remote_field_remote_endpoint_info.rb +241 -0
  123. data/lib/merge_hris_client/models/field_mapping_api_instance_response.rb +385 -0
  124. data/lib/merge_hris_client/models/field_mapping_api_instance_target_field.rb +251 -0
  125. data/lib/merge_hris_client/models/field_mapping_instance_response.rb +266 -0
  126. data/lib/merge_hris_client/models/field_permission_deserializer.rb +231 -0
  127. data/lib/merge_hris_client/models/field_permission_deserializer_request.rb +231 -0
  128. data/lib/merge_hris_client/models/generate_remote_key_request.rb +1 -0
  129. data/lib/merge_hris_client/models/group.rb +34 -15
  130. data/lib/merge_hris_client/models/individual_common_model_scope_deserializer.rb +243 -0
  131. data/lib/merge_hris_client/models/individual_common_model_scope_deserializer_request.rb +262 -0
  132. data/lib/merge_hris_client/models/linked_account_common_model_scope_deserializer_request.rb +226 -0
  133. data/lib/merge_hris_client/models/location.rb +24 -16
  134. data/lib/merge_hris_client/models/model_permission_deserializer.rb +218 -0
  135. data/lib/merge_hris_client/models/model_permission_deserializer_request.rb +218 -0
  136. data/lib/merge_hris_client/models/paginated_audit_log_event_list.rb +240 -0
  137. data/lib/merge_hris_client/models/paginated_timesheet_entry_list.rb +240 -0
  138. data/lib/merge_hris_client/models/patched_edit_field_mapping_request.rb +271 -0
  139. data/lib/merge_hris_client/models/pay_group.rb +24 -16
  140. data/lib/merge_hris_client/models/payroll_run.rb +24 -16
  141. data/lib/merge_hris_client/models/remote_endpoint_info.rb +253 -0
  142. data/lib/merge_hris_client/models/remote_field_api.rb +285 -0
  143. data/lib/merge_hris_client/models/remote_field_api_response.rb +385 -0
  144. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +1 -0
  145. data/lib/merge_hris_client/models/role_enum.rb +49 -0
  146. data/lib/merge_hris_client/models/tax.rb +24 -16
  147. data/lib/merge_hris_client/models/team.rb +24 -16
  148. data/lib/merge_hris_client/models/time_off.rb +23 -15
  149. data/lib/merge_hris_client/models/time_off_balance.rb +24 -16
  150. data/lib/merge_hris_client/models/timesheet_entry.rb +326 -0
  151. data/lib/merge_hris_client/models/timesheet_entry_endpoint_request.rb +223 -0
  152. data/lib/merge_hris_client/models/timesheet_entry_request.rb +278 -0
  153. data/lib/merge_hris_client/models/timesheet_entry_response.rb +266 -0
  154. data/lib/merge_hris_client/version.rb +1 -1
  155. data/lib/merge_hris_client.rb +35 -21
  156. data/spec/api/audit_trail_api_spec.rb +51 -0
  157. data/spec/api/bank_info_api_spec.rb +2 -2
  158. data/spec/api/employees_api_spec.rb +5 -2
  159. data/spec/api/employments_api_spec.rb +2 -2
  160. data/spec/api/field_mapping_api_spec.rb +107 -0
  161. data/spec/api/force_resync_api_spec.rb +1 -1
  162. data/spec/api/groups_api_spec.rb +4 -2
  163. data/spec/api/issues_api_spec.rb +3 -2
  164. data/spec/api/linked_accounts_api_spec.rb +1 -1
  165. data/spec/api/locations_api_spec.rb +3 -2
  166. data/spec/api/payroll_runs_api_spec.rb +2 -2
  167. data/spec/api/scopes_api_spec.rb +68 -0
  168. data/spec/api/sync_status_api_spec.rb +1 -1
  169. data/spec/api/time_off_api_spec.rb +6 -2
  170. data/spec/api/time_off_balances_api_spec.rb +2 -2
  171. data/spec/api/timesheet_entries_api_spec.rb +99 -0
  172. data/spec/models/account_details_and_actions_spec.rb +12 -0
  173. data/spec/models/account_details_spec.rb +6 -0
  174. data/spec/models/account_integration_spec.rb +14 -2
  175. data/spec/models/advanced_metadata_spec.rb +64 -0
  176. data/spec/models/audit_log_event_spec.rb +76 -0
  177. data/spec/models/bank_info_spec.rb +12 -6
  178. data/spec/models/benefit_spec.rb +12 -6
  179. data/spec/models/common_model_scope_api_spec.rb +34 -0
  180. data/spec/models/company_spec.rb +11 -5
  181. data/spec/models/create_field_mapping_request_spec.rb +64 -0
  182. data/spec/models/deduction_spec.rb +12 -6
  183. data/spec/models/dependent_spec.rb +12 -6
  184. data/spec/models/earning_spec.rb +11 -5
  185. data/spec/models/employee_payroll_run_spec.rb +12 -6
  186. data/spec/models/employee_request_spec.rb +6 -0
  187. data/spec/models/employee_spec.rb +18 -6
  188. data/spec/models/employer_benefit_spec.rb +12 -6
  189. data/spec/models/employment_spec.rb +12 -6
  190. data/spec/models/end_user_details_request_spec.rb +18 -0
  191. data/spec/models/event_type_enum_spec.rb +28 -0
  192. data/spec/models/external_target_field_api_response_spec.rb +124 -0
  193. data/spec/models/external_target_field_api_spec.rb +46 -0
  194. data/spec/models/field_mapping_api_instance_remote_field_remote_endpoint_info_spec.rb +46 -0
  195. data/spec/models/field_mapping_api_instance_remote_field_spec.rb +46 -0
  196. data/spec/models/field_mapping_api_instance_response_spec.rb +124 -0
  197. data/spec/models/field_mapping_api_instance_spec.rb +52 -0
  198. data/spec/models/field_mapping_api_instance_target_field_spec.rb +46 -0
  199. data/spec/models/field_mapping_instance_response_spec.rb +52 -0
  200. data/spec/models/field_permission_deserializer_request_spec.rb +40 -0
  201. data/spec/models/field_permission_deserializer_spec.rb +40 -0
  202. data/spec/models/group_spec.rb +13 -1
  203. data/spec/models/individual_common_model_scope_deserializer_request_spec.rb +46 -0
  204. data/spec/models/individual_common_model_scope_deserializer_spec.rb +46 -0
  205. data/spec/models/linked_account_common_model_scope_deserializer_request_spec.rb +34 -0
  206. data/spec/models/location_spec.rb +12 -6
  207. data/spec/models/model_permission_deserializer_request_spec.rb +34 -0
  208. data/spec/models/model_permission_deserializer_spec.rb +34 -0
  209. data/spec/models/paginated_audit_log_event_list_spec.rb +46 -0
  210. data/spec/models/paginated_timesheet_entry_list_spec.rb +46 -0
  211. data/spec/models/patched_edit_field_mapping_request_spec.rb +46 -0
  212. data/spec/models/pay_group_spec.rb +9 -3
  213. data/spec/models/payroll_run_spec.rb +12 -6
  214. data/spec/models/remote_endpoint_info_spec.rb +46 -0
  215. data/spec/models/remote_field_api_response_spec.rb +124 -0
  216. data/spec/models/remote_field_api_spec.rb +64 -0
  217. data/spec/models/role_enum_spec.rb +28 -0
  218. data/spec/models/tax_spec.rb +12 -6
  219. data/spec/models/team_spec.rb +10 -4
  220. data/spec/models/time_off_balance_spec.rb +12 -6
  221. data/spec/models/time_off_spec.rb +12 -6
  222. data/spec/models/timesheet_entry_endpoint_request_spec.rb +34 -0
  223. data/spec/models/timesheet_entry_request_spec.rb +64 -0
  224. data/spec/models/timesheet_entry_response_spec.rb +52 -0
  225. data/spec/models/timesheet_entry_spec.rb +94 -0
  226. metadata +266 -126
@@ -0,0 +1,270 @@
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 AdvancedMetadata
18
+ attr_accessor :id
19
+
20
+ attr_accessor :display_name
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :is_required
25
+
26
+ attr_accessor :is_custom
27
+
28
+ attr_accessor :field_choices
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'id' => :'id',
34
+ :'display_name' => :'display_name',
35
+ :'description' => :'description',
36
+ :'is_required' => :'is_required',
37
+ :'is_custom' => :'is_custom',
38
+ :'field_choices' => :'field_choices'
39
+ }
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'String',
51
+ :'display_name' => :'String',
52
+ :'description' => :'String',
53
+ :'is_required' => :'Boolean',
54
+ :'is_custom' => :'Boolean',
55
+ :'field_choices' => :'Array<Object>'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::AdvancedMetadata` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!self.class.attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::AdvancedMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'id')
81
+ self.id = attributes[:'id']
82
+ end
83
+
84
+ if attributes.key?(:'display_name')
85
+ self.display_name = attributes[:'display_name']
86
+ end
87
+
88
+ if attributes.key?(:'description')
89
+ self.description = attributes[:'description']
90
+ end
91
+
92
+ if attributes.key?(:'is_required')
93
+ self.is_required = attributes[:'is_required']
94
+ end
95
+
96
+ if attributes.key?(:'is_custom')
97
+ self.is_custom = attributes[:'is_custom']
98
+ end
99
+
100
+ if attributes.key?(:'field_choices')
101
+ if (value = attributes[:'field_choices']).is_a?(Array)
102
+ self.field_choices = value
103
+ end
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ if @id.nil?
112
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
113
+ end
114
+
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ return false if @id.nil?
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ id == o.id &&
131
+ display_name == o.display_name &&
132
+ description == o.description &&
133
+ is_required == o.is_required &&
134
+ is_custom == o.is_custom &&
135
+ field_choices == o.field_choices
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [id, display_name, description, is_required, is_custom, field_choices].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ new.build_from_hash(attributes)
155
+ end
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+ self.class.openapi_types.each_pair do |key, type|
163
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
+ self.send("#{key}=", nil)
165
+ elsif type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :Time
186
+ Time.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :Boolean
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ # models (e.g. Pet) or oneOf
217
+ klass = MergeHRISClient.const_get(type)
218
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+ end
@@ -0,0 +1,356 @@
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 AuditLogEvent
18
+ attr_accessor :id
19
+
20
+ # The User's full name at the time of this Event occurring.
21
+ attr_accessor :user_name
22
+
23
+ # The User's email at the time of this Event occurring.
24
+ attr_accessor :user_email
25
+
26
+ # Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. * `ADMIN` - ADMIN * `DEVELOPER` - DEVELOPER * `MEMBER` - MEMBER * `API` - API * `SYSTEM` - SYSTEM * `MERGE_TEAM` - MERGE_TEAM
27
+ attr_accessor :role
28
+
29
+ attr_accessor :ip_address
30
+
31
+ # Designates the type of event that occurred. * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY * `INVITED_USER` - INVITED_USER * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT * `CREATED_DESTINATION` - CREATED_DESTINATION * `DELETED_DESTINATION` - DELETED_DESTINATION * `CHANGED_DESTINATION` - CHANGED_DESTINATION * `CHANGED_SCOPES` - CHANGED_SCOPES * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION * `ENABLED_CATEGORY` - ENABLED_CATEGORY * `DISABLED_CATEGORY` - DISABLED_CATEGORY * `CHANGED_PASSWORD` - CHANGED_PASSWORD * `RESET_PASSWORD` - RESET_PASSWORD * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - CREATED_INTEGRATION_WIDE_FIELD_MAPPING * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - DELETED_INTEGRATION_WIDE_FIELD_MAPPING * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC * `MUTED_ISSUE` - MUTED_ISSUE * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED
32
+ attr_accessor :event_type
33
+
34
+ attr_accessor :event_description
35
+
36
+ attr_accessor :created_at
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'user_name' => :'user_name',
43
+ :'user_email' => :'user_email',
44
+ :'role' => :'role',
45
+ :'ip_address' => :'ip_address',
46
+ :'event_type' => :'event_type',
47
+ :'event_description' => :'event_description',
48
+ :'created_at' => :'created_at'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'id' => :'String',
61
+ :'user_name' => :'String',
62
+ :'user_email' => :'String',
63
+ :'role' => :'RoleEnum',
64
+ :'ip_address' => :'String',
65
+ :'event_type' => :'EventTypeEnum',
66
+ :'event_description' => :'String',
67
+ :'created_at' => :'Time'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'user_name',
75
+ :'user_email',
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::AuditLogEvent` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::AuditLogEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'id')
95
+ self.id = attributes[:'id']
96
+ end
97
+
98
+ if attributes.key?(:'user_name')
99
+ self.user_name = attributes[:'user_name']
100
+ end
101
+
102
+ if attributes.key?(:'user_email')
103
+ self.user_email = attributes[:'user_email']
104
+ end
105
+
106
+ if attributes.key?(:'role')
107
+ self.role = attributes[:'role']
108
+ end
109
+
110
+ if attributes.key?(:'ip_address')
111
+ self.ip_address = attributes[:'ip_address']
112
+ end
113
+
114
+ if attributes.key?(:'event_type')
115
+ self.event_type = attributes[:'event_type']
116
+ end
117
+
118
+ if attributes.key?(:'event_description')
119
+ self.event_description = attributes[:'event_description']
120
+ end
121
+
122
+ if attributes.key?(:'created_at')
123
+ self.created_at = attributes[:'created_at']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ if !@user_name.nil? && @user_name.to_s.length > 200
132
+ invalid_properties.push('invalid value for "user_name", the character length must be smaller than or equal to 200.')
133
+ end
134
+
135
+ if !@user_email.nil? && @user_email.to_s.length > 254
136
+ invalid_properties.push('invalid value for "user_email", the character length must be smaller than or equal to 254.')
137
+ end
138
+
139
+ if @role.nil?
140
+ invalid_properties.push('invalid value for "role", role cannot be nil.')
141
+ end
142
+
143
+ if @ip_address.nil?
144
+ invalid_properties.push('invalid value for "ip_address", ip_address cannot be nil.')
145
+ end
146
+
147
+ if @ip_address.to_s.length > 45
148
+ invalid_properties.push('invalid value for "ip_address", the character length must be smaller than or equal to 45.')
149
+ end
150
+
151
+ if @event_type.nil?
152
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
153
+ end
154
+
155
+ if @event_description.nil?
156
+ invalid_properties.push('invalid value for "event_description", event_description cannot be nil.')
157
+ end
158
+
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ return false if !@user_name.nil? && @user_name.to_s.length > 200
166
+ return false if !@user_email.nil? && @user_email.to_s.length > 254
167
+ return false if @role.nil?
168
+ return false if @ip_address.nil?
169
+ return false if @ip_address.to_s.length > 45
170
+ return false if @event_type.nil?
171
+ return false if @event_description.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] user_name Value to be assigned
177
+ def user_name=(user_name)
178
+ if !user_name.nil? && user_name.to_s.length > 200
179
+ fail ArgumentError, 'invalid value for "user_name", the character length must be smaller than or equal to 200.'
180
+ end
181
+
182
+ @user_name = user_name
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] user_email Value to be assigned
187
+ def user_email=(user_email)
188
+ if !user_email.nil? && user_email.to_s.length > 254
189
+ fail ArgumentError, 'invalid value for "user_email", the character length must be smaller than or equal to 254.'
190
+ end
191
+
192
+ @user_email = user_email
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] ip_address Value to be assigned
197
+ def ip_address=(ip_address)
198
+ if ip_address.nil?
199
+ fail ArgumentError, 'ip_address cannot be nil'
200
+ end
201
+
202
+ if ip_address.to_s.length > 45
203
+ fail ArgumentError, 'invalid value for "ip_address", the character length must be smaller than or equal to 45.'
204
+ end
205
+
206
+ @ip_address = ip_address
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ id == o.id &&
215
+ user_name == o.user_name &&
216
+ user_email == o.user_email &&
217
+ role == o.role &&
218
+ ip_address == o.ip_address &&
219
+ event_type == o.event_type &&
220
+ event_description == o.event_description &&
221
+ created_at == o.created_at
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] Object to be compared
226
+ def eql?(o)
227
+ self == o
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Integer] Hash code
232
+ def hash
233
+ [id, user_name, user_email, role, ip_address, event_type, event_description, created_at].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def self.build_from_hash(attributes)
240
+ new.build_from_hash(attributes)
241
+ end
242
+
243
+ # Builds the object from hash
244
+ # @param [Hash] attributes Model attributes in the form of hash
245
+ # @return [Object] Returns the model itself
246
+ def build_from_hash(attributes)
247
+ return nil unless attributes.is_a?(Hash)
248
+ self.class.openapi_types.each_pair do |key, type|
249
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
250
+ self.send("#{key}=", nil)
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
255
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ end
257
+ elsif !attributes[self.class.attribute_map[key]].nil?
258
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
+ end
260
+ end
261
+
262
+ self
263
+ end
264
+
265
+ # Deserializes the data based on type
266
+ # @param string type Data type
267
+ # @param string value Value to be deserialized
268
+ # @return [Object] Deserialized data
269
+ def _deserialize(type, value)
270
+ case type.to_sym
271
+ when :Time
272
+ Time.parse(value)
273
+ when :Date
274
+ Date.parse(value)
275
+ when :String
276
+ value
277
+ when :Integer
278
+ value.to_i
279
+ when :Float
280
+ value.to_f
281
+ when :Boolean
282
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
283
+ true
284
+ else
285
+ false
286
+ end
287
+ when :Object
288
+ # generic object (usually a Hash), return directly
289
+ value
290
+ when /\AArray<(?<inner_type>.+)>\z/
291
+ inner_type = Regexp.last_match[:inner_type]
292
+ value.map { |v| _deserialize(inner_type, v) }
293
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
294
+ k_type = Regexp.last_match[:k_type]
295
+ v_type = Regexp.last_match[:v_type]
296
+ {}.tap do |hash|
297
+ value.each do |k, v|
298
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
299
+ end
300
+ end
301
+ else # model
302
+ # models (e.g. Pet) or oneOf
303
+ klass = MergeHRISClient.const_get(type)
304
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
305
+ end
306
+ end
307
+
308
+ # Returns the string representation of the object
309
+ # @return [String] String presentation of the object
310
+ def to_s
311
+ to_hash.to_s
312
+ end
313
+
314
+ # to_body is an alias to to_hash (backward compatibility)
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_body
317
+ to_hash
318
+ end
319
+
320
+ # Returns the object in the form of hash
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_hash
323
+ hash = {}
324
+ self.class.attribute_map.each_pair do |attr, param|
325
+ value = self.send(attr)
326
+ if value.nil?
327
+ is_nullable = self.class.openapi_nullable.include?(attr)
328
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
329
+ end
330
+
331
+ hash[param] = _to_hash(value)
332
+ end
333
+ hash
334
+ end
335
+
336
+ # Outputs non-array value in the form of hash
337
+ # For object, use to_hash. Otherwise, just return the value
338
+ # @param [Object] value Any valid value
339
+ # @return [Hash] Returns the value in the form of hash
340
+ def _to_hash(value)
341
+ if value.is_a?(Array)
342
+ value.compact.map { |v| _to_hash(v) }
343
+ elsif value.is_a?(Hash)
344
+ {}.tap do |hash|
345
+ value.each { |k, v| hash[k] = _to_hash(v) }
346
+ end
347
+ elsif value.respond_to? :to_hash
348
+ value.to_hash
349
+ else
350
+ value
351
+ end
352
+ end
353
+
354
+ end
355
+
356
+ end