merge_hris_client 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (232) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +179 -0
  4. data/Rakefile +10 -0
  5. data/config.json +1 -0
  6. data/docs/AccountIntegration.md +28 -0
  7. data/docs/AccountToken.md +18 -0
  8. data/docs/AccountTokenApi.md +79 -0
  9. data/docs/AvailableActions.md +22 -0
  10. data/docs/AvailableActionsApi.md +79 -0
  11. data/docs/Benefit.md +32 -0
  12. data/docs/BenefitPlanTypeEnum.md +15 -0
  13. data/docs/BenefitsApi.md +181 -0
  14. data/docs/CompaniesApi.md +175 -0
  15. data/docs/Company.md +28 -0
  16. data/docs/CountryEnum.md +15 -0
  17. data/docs/DataPassthrough.md +24 -0
  18. data/docs/DataPassthroughRequest.md +26 -0
  19. data/docs/Deduction.md +28 -0
  20. data/docs/Earning.md +26 -0
  21. data/docs/Employee.md +66 -0
  22. data/docs/EmployeePayrollRun.md +42 -0
  23. data/docs/EmployeePayrollRunsApi.md +183 -0
  24. data/docs/EmployeesApi.md +187 -0
  25. data/docs/Employment.md +38 -0
  26. data/docs/EmploymentStatusEnum.md +15 -0
  27. data/docs/EmploymentTypeEnum.md +15 -0
  28. data/docs/EmploymentsApi.md +177 -0
  29. data/docs/EndUserDetails.md +24 -0
  30. data/docs/EndUserDetailsRequest.md +26 -0
  31. data/docs/EthnicityEnum.md +15 -0
  32. data/docs/FlsaStatusEnum.md +15 -0
  33. data/docs/GenderEnum.md +15 -0
  34. data/docs/GenerateKeyApi.md +79 -0
  35. data/docs/GenerateRemoteKeyRequest.md +18 -0
  36. data/docs/LinkToken.md +20 -0
  37. data/docs/LinkTokenApi.md +79 -0
  38. data/docs/Location.md +36 -0
  39. data/docs/LocationsApi.md +175 -0
  40. data/docs/MaritalStatusEnum.md +15 -0
  41. data/docs/MethodEnum.md +15 -0
  42. data/docs/ModelOperation.md +22 -0
  43. data/docs/NullEnum.md +15 -0
  44. data/docs/PaginatedBenefitList.md +22 -0
  45. data/docs/PaginatedCompanyList.md +22 -0
  46. data/docs/PaginatedEmployeeList.md +22 -0
  47. data/docs/PaginatedEmployeePayrollRunList.md +22 -0
  48. data/docs/PaginatedEmploymentList.md +22 -0
  49. data/docs/PaginatedLocationList.md +22 -0
  50. data/docs/PaginatedPayrollRunList.md +22 -0
  51. data/docs/PaginatedTeamList.md +22 -0
  52. data/docs/PaginatedTimeOffList.md +22 -0
  53. data/docs/PassthroughApi.md +81 -0
  54. data/docs/PayCurrencyEnum.md +15 -0
  55. data/docs/PayFrequencyEnum.md +15 -0
  56. data/docs/PayPeriodEnum.md +15 -0
  57. data/docs/PayrollRun.md +32 -0
  58. data/docs/PayrollRunsApi.md +175 -0
  59. data/docs/RegenerateKeyApi.md +79 -0
  60. data/docs/RemoteData.md +20 -0
  61. data/docs/RemoteKey.md +20 -0
  62. data/docs/RemoteKeyForRegeneration.md +18 -0
  63. data/docs/RemoteKeyForRegenerationRequest.md +18 -0
  64. data/docs/RemoteResponse.md +26 -0
  65. data/docs/RequestTypeEnum.md +15 -0
  66. data/docs/RunStateEnum.md +15 -0
  67. data/docs/RunTypeEnum.md +15 -0
  68. data/docs/StateEnum.md +15 -0
  69. data/docs/SyncStatus.md +28 -0
  70. data/docs/SyncStatusApi.md +79 -0
  71. data/docs/Tax.md +28 -0
  72. data/docs/Team.md +24 -0
  73. data/docs/TeamsApi.md +175 -0
  74. data/docs/TimeOff.md +36 -0
  75. data/docs/TimeOffApi.md +183 -0
  76. data/docs/TimeOffStatusEnum.md +15 -0
  77. data/docs/TypeEnum.md +15 -0
  78. data/docs/UnitsEnum.md +15 -0
  79. data/git_push.sh +58 -0
  80. data/lib/merge_hris_client.rb +110 -0
  81. data/lib/merge_hris_client/api/account_token_api.rb +83 -0
  82. data/lib/merge_hris_client/api/available_actions_api.rb +84 -0
  83. data/lib/merge_hris_client/api/benefits_api.rb +196 -0
  84. data/lib/merge_hris_client/api/companies_api.rb +179 -0
  85. data/lib/merge_hris_client/api/employee_payroll_runs_api.rb +199 -0
  86. data/lib/merge_hris_client/api/employees_api.rb +205 -0
  87. data/lib/merge_hris_client/api/employments_api.rb +182 -0
  88. data/lib/merge_hris_client/api/generate_key_api.rb +85 -0
  89. data/lib/merge_hris_client/api/link_token_api.rb +85 -0
  90. data/lib/merge_hris_client/api/locations_api.rb +179 -0
  91. data/lib/merge_hris_client/api/passthrough_api.rb +92 -0
  92. data/lib/merge_hris_client/api/payroll_runs_api.rb +179 -0
  93. data/lib/merge_hris_client/api/regenerate_key_api.rb +85 -0
  94. data/lib/merge_hris_client/api/sync_status_api.rb +84 -0
  95. data/lib/merge_hris_client/api/teams_api.rb +179 -0
  96. data/lib/merge_hris_client/api/time_off_api.rb +199 -0
  97. data/lib/merge_hris_client/api_client.rb +390 -0
  98. data/lib/merge_hris_client/api_error.rb +57 -0
  99. data/lib/merge_hris_client/configuration.rb +279 -0
  100. data/lib/merge_hris_client/models/account_integration.rb +325 -0
  101. data/lib/merge_hris_client/models/account_token.rb +223 -0
  102. data/lib/merge_hris_client/models/available_actions.rb +249 -0
  103. data/lib/merge_hris_client/models/benefit.rb +297 -0
  104. data/lib/merge_hris_client/models/benefit_plan_type_enum.rb +56 -0
  105. data/lib/merge_hris_client/models/company.rb +277 -0
  106. data/lib/merge_hris_client/models/country_enum.rb +282 -0
  107. data/lib/merge_hris_client/models/data_passthrough.rb +262 -0
  108. data/lib/merge_hris_client/models/data_passthrough_request.rb +271 -0
  109. data/lib/merge_hris_client/models/deduction.rb +275 -0
  110. data/lib/merge_hris_client/models/earning.rb +264 -0
  111. data/lib/merge_hris_client/models/employee.rb +544 -0
  112. data/lib/merge_hris_client/models/employee_payroll_run.rb +352 -0
  113. data/lib/merge_hris_client/models/employment.rb +330 -0
  114. data/lib/merge_hris_client/models/employment_status_enum.rb +37 -0
  115. data/lib/merge_hris_client/models/employment_type_enum.rb +39 -0
  116. data/lib/merge_hris_client/models/end_user_details.rb +289 -0
  117. data/lib/merge_hris_client/models/end_user_details_request.rb +298 -0
  118. data/lib/merge_hris_client/models/ethnicity_enum.rb +42 -0
  119. data/lib/merge_hris_client/models/flsa_status_enum.rb +38 -0
  120. data/lib/merge_hris_client/models/gender_enum.rb +39 -0
  121. data/lib/merge_hris_client/models/generate_remote_key_request.rb +224 -0
  122. data/lib/merge_hris_client/models/link_token.rb +237 -0
  123. data/lib/merge_hris_client/models/location.rb +319 -0
  124. data/lib/merge_hris_client/models/marital_status_enum.rb +39 -0
  125. data/lib/merge_hris_client/models/method_enum.rb +41 -0
  126. data/lib/merge_hris_client/models/model_operation.rb +256 -0
  127. data/lib/merge_hris_client/models/paginated_benefit_list.rb +240 -0
  128. data/lib/merge_hris_client/models/paginated_company_list.rb +240 -0
  129. data/lib/merge_hris_client/models/paginated_employee_list.rb +240 -0
  130. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +240 -0
  131. data/lib/merge_hris_client/models/paginated_employment_list.rb +240 -0
  132. data/lib/merge_hris_client/models/paginated_location_list.rb +240 -0
  133. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +240 -0
  134. data/lib/merge_hris_client/models/paginated_team_list.rb +240 -0
  135. data/lib/merge_hris_client/models/paginated_time_off_list.rb +240 -0
  136. data/lib/merge_hris_client/models/pay_currency_enum.rb +340 -0
  137. data/lib/merge_hris_client/models/pay_frequency_enum.rb +43 -0
  138. data/lib/merge_hris_client/models/pay_period_enum.rb +42 -0
  139. data/lib/merge_hris_client/models/payroll_run.rb +297 -0
  140. data/lib/merge_hris_client/models/remote_data.rb +234 -0
  141. data/lib/merge_hris_client/models/remote_key.rb +238 -0
  142. data/lib/merge_hris_client/models/remote_key_for_regeneration.rb +224 -0
  143. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +224 -0
  144. data/lib/merge_hris_client/models/remote_response.rb +279 -0
  145. data/lib/merge_hris_client/models/request_type_enum.rb +38 -0
  146. data/lib/merge_hris_client/models/run_state_enum.rb +39 -0
  147. data/lib/merge_hris_client/models/run_type_enum.rb +49 -0
  148. data/lib/merge_hris_client/models/state_enum.rb +93 -0
  149. data/lib/merge_hris_client/models/sync_status.rb +294 -0
  150. data/lib/merge_hris_client/models/tax.rb +275 -0
  151. data/lib/merge_hris_client/models/team.rb +253 -0
  152. data/lib/merge_hris_client/models/time_off.rb +319 -0
  153. data/lib/merge_hris_client/models/time_off_status_enum.rb +39 -0
  154. data/lib/merge_hris_client/models/type_enum.rb +38 -0
  155. data/lib/merge_hris_client/models/units_enum.rb +36 -0
  156. data/lib/merge_hris_client/version.rb +15 -0
  157. data/merge_hris_client-1.0.0.gem +0 -0
  158. data/merge_hris_client.gemspec +38 -0
  159. data/pull_request_template.md +20 -0
  160. data/spec/api/account_token_api_spec.rb +46 -0
  161. data/spec/api/available_actions_api_spec.rb +46 -0
  162. data/spec/api/benefits_api_spec.rb +68 -0
  163. data/spec/api/companies_api_spec.rb +65 -0
  164. data/spec/api/employee_payroll_runs_api_spec.rb +69 -0
  165. data/spec/api/employees_api_spec.rb +71 -0
  166. data/spec/api/employments_api_spec.rb +66 -0
  167. data/spec/api/link_token_api_spec.rb +46 -0
  168. data/spec/api/locations_api_spec.rb +65 -0
  169. data/spec/api/passthrough_api_spec.rb +48 -0
  170. data/spec/api/payroll_runs_api_spec.rb +65 -0
  171. data/spec/api/regenerate_key_api_spec.rb +46 -0
  172. data/spec/api/teams_api_spec.rb +65 -0
  173. data/spec/api/time_off_api_spec.rb +69 -0
  174. data/spec/api_client_spec.rb +226 -0
  175. data/spec/configuration_spec.rb +42 -0
  176. data/spec/models/account_integration_spec.rb +58 -0
  177. data/spec/models/account_token_spec.rb +34 -0
  178. data/spec/models/available_actions_spec.rb +34 -0
  179. data/spec/models/benefit_plan_type_enum_spec.rb +28 -0
  180. data/spec/models/benefit_spec.rb +70 -0
  181. data/spec/models/company_spec.rb +58 -0
  182. data/spec/models/country_enum_spec.rb +28 -0
  183. data/spec/models/data_passthrough_request_spec.rb +58 -0
  184. data/spec/models/data_passthrough_spec.rb +52 -0
  185. data/spec/models/deduction_spec.rb +58 -0
  186. data/spec/models/earning_spec.rb +52 -0
  187. data/spec/models/employee_payroll_run_spec.rb +100 -0
  188. data/spec/models/employee_spec.rb +166 -0
  189. data/spec/models/employment_spec.rb +88 -0
  190. data/spec/models/employment_status_enum_spec.rb +28 -0
  191. data/spec/models/employment_type_enum_spec.rb +28 -0
  192. data/spec/models/end_user_details_request_spec.rb +56 -0
  193. data/spec/models/end_user_details_spec.rb +56 -0
  194. data/spec/models/ethnicity_enum_spec.rb +28 -0
  195. data/spec/models/flsa_status_enum_spec.rb +28 -0
  196. data/spec/models/gender_enum_spec.rb +28 -0
  197. data/spec/models/link_token_spec.rb +40 -0
  198. data/spec/models/location_spec.rb +82 -0
  199. data/spec/models/marital_status_enum_spec.rb +28 -0
  200. data/spec/models/method_enum_spec.rb +28 -0
  201. data/spec/models/model_operation_spec.rb +40 -0
  202. data/spec/models/paginated_benefit_list_spec.rb +46 -0
  203. data/spec/models/paginated_company_list_spec.rb +46 -0
  204. data/spec/models/paginated_employee_list_spec.rb +46 -0
  205. data/spec/models/paginated_employee_payroll_run_list_spec.rb +46 -0
  206. data/spec/models/paginated_employment_list_spec.rb +46 -0
  207. data/spec/models/paginated_location_list_spec.rb +46 -0
  208. data/spec/models/paginated_payroll_run_list_spec.rb +46 -0
  209. data/spec/models/paginated_team_list_spec.rb +46 -0
  210. data/spec/models/paginated_time_off_list_spec.rb +46 -0
  211. data/spec/models/pay_currency_enum_spec.rb +28 -0
  212. data/spec/models/pay_frequency_enum_spec.rb +28 -0
  213. data/spec/models/pay_period_enum_spec.rb +28 -0
  214. data/spec/models/payroll_run_spec.rb +70 -0
  215. data/spec/models/remote_data_spec.rb +40 -0
  216. data/spec/models/remote_key_for_regeneration_request_spec.rb +34 -0
  217. data/spec/models/remote_key_for_regeneration_spec.rb +34 -0
  218. data/spec/models/remote_key_spec.rb +40 -0
  219. data/spec/models/remote_response_spec.rb +58 -0
  220. data/spec/models/request_type_enum_spec.rb +28 -0
  221. data/spec/models/run_state_enum_spec.rb +28 -0
  222. data/spec/models/run_type_enum_spec.rb +28 -0
  223. data/spec/models/state_enum_spec.rb +28 -0
  224. data/spec/models/tax_spec.rb +58 -0
  225. data/spec/models/team_spec.rb +46 -0
  226. data/spec/models/time_off_spec.rb +82 -0
  227. data/spec/models/time_off_status_enum_spec.rb +28 -0
  228. data/spec/models/type_enum_spec.rb +28 -0
  229. data/spec/models/units_enum_spec.rb +28 -0
  230. data/spec/spec_helper.rb +111 -0
  231. data/test_ruby.rb +30 -0
  232. metadata +385 -0
@@ -0,0 +1,325 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MergeHRISClient
17
+ class AccountIntegration
18
+ # Company name.
19
+ attr_accessor :name
20
+
21
+ # Category or categories this integration belongs to.
22
+ attr_accessor :categories
23
+
24
+ # Company logo in rectangular shape.
25
+ attr_accessor :image
26
+
27
+ # Company logo in square shape.
28
+ attr_accessor :square_image
29
+
30
+ # The color of this integration used for buttons and text throughout the app and landing pages.
31
+ attr_accessor :color
32
+
33
+ attr_accessor :slug
34
+
35
+ class EnumAttributeValidator
36
+ attr_reader :datatype
37
+ attr_reader :allowable_values
38
+
39
+ def initialize(datatype, allowable_values)
40
+ @allowable_values = allowable_values.map do |value|
41
+ case datatype.to_s
42
+ when /Integer/i
43
+ value.to_i
44
+ when /Float/i
45
+ value.to_f
46
+ else
47
+ value
48
+ end
49
+ end
50
+ end
51
+
52
+ def valid?(value)
53
+ !value || allowable_values.include?(value)
54
+ end
55
+ end
56
+
57
+ # Attribute mapping from ruby-style variable name to JSON key.
58
+ def self.attribute_map
59
+ {
60
+ :'name' => :'name',
61
+ :'categories' => :'categories',
62
+ :'image' => :'image',
63
+ :'square_image' => :'square_image',
64
+ :'color' => :'color',
65
+ :'slug' => :'slug'
66
+ }
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'name' => :'String',
78
+ :'categories' => :'Array<String>',
79
+ :'image' => :'String',
80
+ :'square_image' => :'String',
81
+ :'color' => :'String',
82
+ :'slug' => :'String'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ :'image',
90
+ :'square_image',
91
+ ])
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ if (!attributes.is_a?(Hash))
98
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::AccountIntegration` initialize method"
99
+ end
100
+
101
+ # check to see if the attribute exists and convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h|
103
+ if (!self.class.attribute_map.key?(k.to_sym))
104
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::AccountIntegration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
105
+ end
106
+ h[k.to_sym] = v
107
+ }
108
+
109
+ if attributes.key?(:'name')
110
+ self.name = attributes[:'name']
111
+ end
112
+
113
+ if attributes.key?(:'categories')
114
+ if (value = attributes[:'categories']).is_a?(Array)
115
+ self.categories = value
116
+ end
117
+ end
118
+
119
+ if attributes.key?(:'image')
120
+ self.image = attributes[:'image']
121
+ end
122
+
123
+ if attributes.key?(:'square_image')
124
+ self.square_image = attributes[:'square_image']
125
+ end
126
+
127
+ if attributes.key?(:'color')
128
+ self.color = attributes[:'color']
129
+ end
130
+
131
+ if attributes.key?(:'slug')
132
+ self.slug = attributes[:'slug']
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+ if @name.nil?
141
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
142
+ end
143
+
144
+ if !@color.nil? && @color.to_s.length > 18
145
+ invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 18.')
146
+ end
147
+
148
+ pattern = Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
149
+ if !@color.nil? && @color !~ pattern
150
+ invalid_properties.push("invalid value for \"color\", must conform to the pattern #{pattern}.")
151
+ end
152
+
153
+ invalid_properties
154
+ end
155
+
156
+ # Check to see if the all the properties in the model are valid
157
+ # @return true if the model is valid
158
+ def valid?
159
+ return false if @name.nil?
160
+ return false if !@color.nil? && @color.to_s.length > 18
161
+ return false if !@color.nil? && @color !~ Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
162
+ true
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] color Value to be assigned
167
+ def color=(color)
168
+ if !color.nil? && color.to_s.length > 18
169
+ fail ArgumentError, 'invalid value for "color", the character length must be smaller than or equal to 18.'
170
+ end
171
+
172
+ pattern = Regexp.new(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)
173
+ if !color.nil? && color !~ pattern
174
+ fail ArgumentError, "invalid value for \"color\", must conform to the pattern #{pattern}."
175
+ end
176
+
177
+ @color = color
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ name == o.name &&
186
+ categories == o.categories &&
187
+ image == o.image &&
188
+ square_image == o.square_image &&
189
+ color == o.color &&
190
+ slug == o.slug
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [name, categories, image, square_image, color, slug].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ new.build_from_hash(attributes)
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ self.class.openapi_types.each_pair do |key, type|
218
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
219
+ self.send("#{key}=", nil)
220
+ elsif type =~ /\AArray<(.*)>/i
221
+ # check to ensure the input is an array given that the attribute
222
+ # is documented as an array but the input is not
223
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
224
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
225
+ end
226
+ elsif !attributes[self.class.attribute_map[key]].nil?
227
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
228
+ end
229
+ end
230
+
231
+ self
232
+ end
233
+
234
+ # Deserializes the data based on type
235
+ # @param string type Data type
236
+ # @param string value Value to be deserialized
237
+ # @return [Object] Deserialized data
238
+ def _deserialize(type, value)
239
+ case type.to_sym
240
+ when :Time
241
+ Time.parse(value)
242
+ when :Date
243
+ Date.parse(value)
244
+ when :String
245
+ value.to_s
246
+ when :Integer
247
+ value.to_i
248
+ when :Float
249
+ value.to_f
250
+ when :Boolean
251
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
252
+ true
253
+ else
254
+ false
255
+ end
256
+ when :Object
257
+ # generic object (usually a Hash), return directly
258
+ value
259
+ when /\AArray<(?<inner_type>.+)>\z/
260
+ inner_type = Regexp.last_match[:inner_type]
261
+ value.map { |v| _deserialize(inner_type, v) }
262
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
263
+ k_type = Regexp.last_match[:k_type]
264
+ v_type = Regexp.last_match[:v_type]
265
+ {}.tap do |hash|
266
+ value.each do |k, v|
267
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
268
+ end
269
+ end
270
+ else # model
271
+ # models (e.g. Pet) or oneOf
272
+ klass = MergeHRISClient.const_get(type)
273
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
274
+ end
275
+ end
276
+
277
+ # Returns the string representation of the object
278
+ # @return [String] String presentation of the object
279
+ def to_s
280
+ to_hash.to_s
281
+ end
282
+
283
+ # to_body is an alias to to_hash (backward compatibility)
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_body
286
+ to_hash
287
+ end
288
+
289
+ # Returns the object in the form of hash
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_hash
292
+ hash = {}
293
+ self.class.attribute_map.each_pair do |attr, param|
294
+ value = self.send(attr)
295
+ if value.nil?
296
+ is_nullable = self.class.openapi_nullable.include?(attr)
297
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
298
+ end
299
+
300
+ hash[param] = _to_hash(value)
301
+ end
302
+ hash
303
+ end
304
+
305
+ # Outputs non-array value in the form of hash
306
+ # For object, use to_hash. Otherwise, just return the value
307
+ # @param [Object] value Any valid value
308
+ # @return [Hash] Returns the value in the form of hash
309
+ def _to_hash(value)
310
+ if value.is_a?(Array)
311
+ value.compact.map { |v| _to_hash(v) }
312
+ elsif value.is_a?(Hash)
313
+ {}.tap do |hash|
314
+ value.each { |k, v| hash[k] = _to_hash(v) }
315
+ end
316
+ elsif value.respond_to? :to_hash
317
+ value.to_hash
318
+ else
319
+ value
320
+ end
321
+ end
322
+
323
+ end
324
+
325
+ end
@@ -0,0 +1,223 @@
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.0.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MergeHRISClient
17
+ class AccountToken
18
+ attr_accessor :account_token
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'account_token' => :'account_token'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'account_token' => :'String'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::AccountToken` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::AccountToken`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'account_token')
61
+ self.account_token = attributes[:'account_token']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ if @account_token.nil?
70
+ invalid_properties.push('invalid value for "account_token", account_token cannot be nil.')
71
+ end
72
+
73
+ invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return false if @account_token.nil?
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(o)
86
+ return true if self.equal?(o)
87
+ self.class == o.class &&
88
+ account_token == o.account_token
89
+ end
90
+
91
+ # @see the `==` method
92
+ # @param [Object] Object to be compared
93
+ def eql?(o)
94
+ self == o
95
+ end
96
+
97
+ # Calculates hash code according to all attributes.
98
+ # @return [Integer] Hash code
99
+ def hash
100
+ [account_token].hash
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def self.build_from_hash(attributes)
107
+ new.build_from_hash(attributes)
108
+ end
109
+
110
+ # Builds the object from hash
111
+ # @param [Hash] attributes Model attributes in the form of hash
112
+ # @return [Object] Returns the model itself
113
+ def build_from_hash(attributes)
114
+ return nil unless attributes.is_a?(Hash)
115
+ self.class.openapi_types.each_pair do |key, type|
116
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
122
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
123
+ end
124
+ elsif !attributes[self.class.attribute_map[key]].nil?
125
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
+ end
127
+ end
128
+
129
+ self
130
+ end
131
+
132
+ # Deserializes the data based on type
133
+ # @param string type Data type
134
+ # @param string value Value to be deserialized
135
+ # @return [Object] Deserialized data
136
+ def _deserialize(type, value)
137
+ case type.to_sym
138
+ when :Time
139
+ Time.parse(value)
140
+ when :Date
141
+ Date.parse(value)
142
+ when :String
143
+ value.to_s
144
+ when :Integer
145
+ value.to_i
146
+ when :Float
147
+ value.to_f
148
+ when :Boolean
149
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
150
+ true
151
+ else
152
+ false
153
+ end
154
+ when :Object
155
+ # generic object (usually a Hash), return directly
156
+ value
157
+ when /\AArray<(?<inner_type>.+)>\z/
158
+ inner_type = Regexp.last_match[:inner_type]
159
+ value.map { |v| _deserialize(inner_type, v) }
160
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
161
+ k_type = Regexp.last_match[:k_type]
162
+ v_type = Regexp.last_match[:v_type]
163
+ {}.tap do |hash|
164
+ value.each do |k, v|
165
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
166
+ end
167
+ end
168
+ else # model
169
+ # models (e.g. Pet) or oneOf
170
+ klass = MergeHRISClient.const_get(type)
171
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
+ end
173
+ end
174
+
175
+ # Returns the string representation of the object
176
+ # @return [String] String presentation of the object
177
+ def to_s
178
+ to_hash.to_s
179
+ end
180
+
181
+ # to_body is an alias to to_hash (backward compatibility)
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_body
184
+ to_hash
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = self.send(attr)
193
+ if value.nil?
194
+ is_nullable = self.class.openapi_nullable.include?(attr)
195
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
196
+ end
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ # Outputs non-array value in the form of hash
204
+ # For object, use to_hash. Otherwise, just return the value
205
+ # @param [Object] value Any valid value
206
+ # @return [Hash] Returns the value in the form of hash
207
+ def _to_hash(value)
208
+ if value.is_a?(Array)
209
+ value.compact.map { |v| _to_hash(v) }
210
+ elsif value.is_a?(Hash)
211
+ {}.tap do |hash|
212
+ value.each { |k, v| hash[k] = _to_hash(v) }
213
+ end
214
+ elsif value.respond_to? :to_hash
215
+ value.to_hash
216
+ else
217
+ value
218
+ end
219
+ end
220
+
221
+ end
222
+
223
+ end