merge_hris_client 1.0.4 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +37 -12
  3. data/docs/AccountDetails.md +11 -7
  4. data/docs/AccountDetailsAndActions.md +2 -0
  5. data/docs/AccountDetailsApi.md +10 -7
  6. data/docs/AccountIntegration.md +4 -4
  7. data/docs/AccountTokenApi.md +2 -2
  8. data/docs/AvailableActionsApi.md +2 -2
  9. data/docs/BankInfo.md +1 -1
  10. data/docs/BankInfoApi.md +8 -12
  11. data/docs/Benefit.md +2 -2
  12. data/docs/BenefitsApi.md +4 -4
  13. data/docs/CompaniesApi.md +4 -4
  14. data/docs/Company.md +2 -2
  15. data/docs/DataPassthroughRequest.md +3 -1
  16. data/docs/DebugModeLog.md +22 -0
  17. data/docs/DebugModelLogSummary.md +22 -0
  18. data/docs/Deduction.md +2 -2
  19. data/docs/DeductionsApi.md +4 -4
  20. data/docs/DeleteAccountApi.md +3 -2
  21. data/docs/Earning.md +3 -3
  22. data/docs/EarningTypeEnum.md +15 -0
  23. data/docs/Employee.md +17 -15
  24. data/docs/EmployeeEndpointRequest.md +18 -0
  25. data/docs/EmployeePayrollRun.md +2 -2
  26. data/docs/EmployeePayrollRunsApi.md +4 -4
  27. data/docs/EmployeeRequest.md +70 -0
  28. data/docs/EmployeeResponse.md +24 -0
  29. data/docs/EmployeesApi.md +232 -4
  30. data/docs/Employment.md +6 -4
  31. data/docs/EmploymentsApi.md +5 -4
  32. data/docs/EncodingEnum.md +15 -0
  33. data/docs/EndUserDetailsRequest.md +5 -3
  34. data/docs/ForceResyncApi.md +2 -2
  35. data/docs/GenerateKeyApi.md +2 -2
  36. data/docs/Group.md +28 -0
  37. data/docs/GroupTypeEnum.md +15 -0
  38. data/docs/GroupsApi.md +177 -0
  39. data/docs/IgnoreCommonModel.md +20 -0
  40. data/docs/IssuesApi.md +13 -4
  41. data/docs/LinkTokenApi.md +3 -3
  42. data/docs/LinkedAccountStatus.md +20 -0
  43. data/docs/LinkedAccountsApi.md +2 -2
  44. data/docs/Location.md +3 -1
  45. data/docs/LocationsApi.md +4 -4
  46. data/docs/MetaResponse.md +24 -0
  47. data/docs/MultipartFormFieldRequest.md +26 -0
  48. data/docs/PaginatedGroupList.md +22 -0
  49. data/docs/PassthroughApi.md +2 -2
  50. data/docs/PayGroupsApi.md +4 -4
  51. data/docs/PayrollRunsApi.md +4 -4
  52. data/docs/RegenerateKeyApi.md +2 -2
  53. data/docs/SyncStatusApi.md +0 -1
  54. data/docs/Tax.md +2 -2
  55. data/docs/Team.md +1 -1
  56. data/docs/TeamsApi.md +5 -4
  57. data/docs/TimeOff.md +4 -4
  58. data/docs/TimeOffApi.md +80 -6
  59. data/docs/TimeOffBalance.md +2 -2
  60. data/docs/TimeOffRequest.md +4 -4
  61. data/docs/TimeOffResponse.md +3 -1
  62. data/docs/WebhookReceiver.md +22 -0
  63. data/docs/WebhookReceiverRequest.md +22 -0
  64. data/docs/WebhookReceiversApi.md +153 -0
  65. data/lib/merge_hris_client/api/account_details_api.rb +10 -3
  66. data/lib/merge_hris_client/api/bank_info_api.rb +4 -9
  67. data/lib/merge_hris_client/api/employees_api.rb +216 -2
  68. data/lib/merge_hris_client/api/employments_api.rb +2 -2
  69. data/lib/merge_hris_client/api/groups_api.rb +182 -0
  70. data/lib/merge_hris_client/api/issues_api.rb +12 -0
  71. data/lib/merge_hris_client/api/linked_accounts_api.rb +1 -1
  72. data/lib/merge_hris_client/api/sync_status_api.rb +0 -62
  73. data/lib/merge_hris_client/api/time_off_api.rb +65 -0
  74. data/lib/merge_hris_client/api/webhook_receivers_api.rb +154 -0
  75. data/lib/merge_hris_client/configuration.rb +6 -4
  76. data/lib/merge_hris_client/models/account_details.rb +23 -5
  77. data/lib/merge_hris_client/models/account_details_and_actions.rb +16 -2
  78. data/lib/merge_hris_client/models/account_details_and_actions_integration.rb +1 -1
  79. data/lib/merge_hris_client/models/account_details_and_actions_status_enum.rb +1 -0
  80. data/lib/merge_hris_client/models/account_integration.rb +5 -27
  81. data/lib/merge_hris_client/models/account_token.rb +1 -1
  82. data/lib/merge_hris_client/models/account_type_enum.rb +1 -0
  83. data/lib/merge_hris_client/models/available_actions.rb +1 -1
  84. data/lib/merge_hris_client/models/bank_info.rb +0 -1
  85. data/lib/merge_hris_client/models/benefit.rb +1 -2
  86. data/lib/merge_hris_client/models/categories_enum.rb +1 -0
  87. data/lib/merge_hris_client/models/category_enum.rb +1 -0
  88. data/lib/merge_hris_client/models/company.rb +1 -1
  89. data/lib/merge_hris_client/models/country_enum.rb +1 -0
  90. data/lib/merge_hris_client/models/data_passthrough_request.rb +17 -3
  91. data/lib/merge_hris_client/models/debug_mode_log.rb +251 -0
  92. data/lib/merge_hris_client/models/debug_model_log_summary.rb +251 -0
  93. data/lib/merge_hris_client/models/deduction.rb +0 -1
  94. data/lib/merge_hris_client/models/earning.rb +4 -7
  95. data/lib/merge_hris_client/models/earning_type_enum.rb +38 -0
  96. data/lib/merge_hris_client/models/employee.rb +14 -9
  97. data/lib/merge_hris_client/models/employee_endpoint_request.rb +223 -0
  98. data/lib/merge_hris_client/models/employee_payroll_run.rb +1 -3
  99. data/lib/merge_hris_client/models/employee_request.rb +564 -0
  100. data/lib/merge_hris_client/models/employee_response.rb +266 -0
  101. data/lib/merge_hris_client/models/employment.rb +12 -3
  102. data/lib/merge_hris_client/models/employment_status_enum.rb +1 -1
  103. data/lib/merge_hris_client/models/employment_type_enum.rb +1 -1
  104. data/lib/merge_hris_client/models/encoding_enum.rb +36 -0
  105. data/lib/merge_hris_client/models/end_user_details_request.rb +74 -27
  106. data/lib/merge_hris_client/models/error_validation_problem.rb +1 -1
  107. data/lib/merge_hris_client/models/ethnicity_enum.rb +1 -1
  108. data/lib/merge_hris_client/models/flsa_status_enum.rb +1 -1
  109. data/lib/merge_hris_client/models/gender_enum.rb +1 -1
  110. data/lib/merge_hris_client/models/generate_remote_key_request.rb +1 -1
  111. data/lib/merge_hris_client/models/group.rb +275 -0
  112. data/lib/merge_hris_client/models/group_type_enum.rb +38 -0
  113. data/lib/merge_hris_client/models/ignore_common_model.rb +247 -0
  114. data/lib/merge_hris_client/models/ignore_common_model_request.rb +256 -0
  115. data/lib/merge_hris_client/models/issue.rb +1 -1
  116. data/lib/merge_hris_client/models/issue_status_enum.rb +1 -1
  117. data/lib/merge_hris_client/models/link_token.rb +1 -1
  118. data/lib/merge_hris_client/models/linked_account_status.rb +237 -0
  119. data/lib/merge_hris_client/models/location.rb +13 -2
  120. data/lib/merge_hris_client/models/location_type_enum.rb +36 -0
  121. data/lib/merge_hris_client/models/marital_status_enum.rb +1 -1
  122. data/lib/merge_hris_client/models/meta_response.rb +262 -0
  123. data/lib/merge_hris_client/models/method_enum.rb +1 -1
  124. data/lib/merge_hris_client/models/model_operation.rb +1 -1
  125. data/lib/merge_hris_client/models/multipart_form_field_request.rb +341 -0
  126. data/lib/merge_hris_client/models/paginated_account_details_and_actions_list.rb +1 -1
  127. data/lib/merge_hris_client/models/paginated_bank_info_list.rb +1 -1
  128. data/lib/merge_hris_client/models/paginated_benefit_list.rb +1 -1
  129. data/lib/merge_hris_client/models/paginated_company_list.rb +1 -1
  130. data/lib/merge_hris_client/models/paginated_deduction_list.rb +1 -1
  131. data/lib/merge_hris_client/models/paginated_employee_list.rb +1 -1
  132. data/lib/merge_hris_client/models/paginated_employee_payroll_run_list.rb +1 -1
  133. data/lib/merge_hris_client/models/paginated_employment_list.rb +1 -1
  134. data/lib/merge_hris_client/models/paginated_group_list.rb +240 -0
  135. data/lib/merge_hris_client/models/paginated_issue_list.rb +1 -1
  136. data/lib/merge_hris_client/models/paginated_location_list.rb +1 -1
  137. data/lib/merge_hris_client/models/paginated_pay_group_list.rb +1 -1
  138. data/lib/merge_hris_client/models/paginated_payroll_run_list.rb +1 -1
  139. data/lib/merge_hris_client/models/paginated_sync_status_list.rb +1 -1
  140. data/lib/merge_hris_client/models/paginated_team_list.rb +1 -1
  141. data/lib/merge_hris_client/models/paginated_time_off_balance_list.rb +1 -1
  142. data/lib/merge_hris_client/models/paginated_time_off_list.rb +1 -1
  143. data/lib/merge_hris_client/models/pay_currency_enum.rb +1 -1
  144. data/lib/merge_hris_client/models/pay_frequency_enum.rb +1 -2
  145. data/lib/merge_hris_client/models/pay_period_enum.rb +1 -1
  146. data/lib/merge_hris_client/models/payroll_run.rb +1 -1
  147. data/lib/merge_hris_client/models/policy_type_enum.rb +1 -0
  148. data/lib/merge_hris_client/models/reason_enum.rb +37 -0
  149. data/lib/merge_hris_client/models/remote_data.rb +1 -1
  150. data/lib/merge_hris_client/models/remote_data_request.rb +1 -1
  151. data/lib/merge_hris_client/models/remote_key.rb +1 -1
  152. data/lib/merge_hris_client/models/remote_key_for_regeneration_request.rb +1 -1
  153. data/lib/merge_hris_client/models/remote_response.rb +1 -1
  154. data/lib/merge_hris_client/models/request_format_enum.rb +2 -0
  155. data/lib/merge_hris_client/models/request_type_enum.rb +1 -0
  156. data/lib/merge_hris_client/models/run_state_enum.rb +1 -1
  157. data/lib/merge_hris_client/models/run_type_enum.rb +1 -11
  158. data/lib/merge_hris_client/models/sync_status.rb +1 -1
  159. data/lib/merge_hris_client/models/sync_status_status_enum.rb +1 -2
  160. data/lib/merge_hris_client/models/tax.rb +3 -6
  161. data/lib/merge_hris_client/models/team.rb +0 -1
  162. data/lib/merge_hris_client/models/time_off.rb +0 -2
  163. data/lib/merge_hris_client/models/time_off_balance.rb +1 -2
  164. data/lib/merge_hris_client/models/time_off_endpoint_request.rb +1 -1
  165. data/lib/merge_hris_client/models/time_off_request.rb +1 -3
  166. data/lib/merge_hris_client/models/time_off_response.rb +16 -5
  167. data/lib/merge_hris_client/models/time_off_status_enum.rb +1 -1
  168. data/lib/merge_hris_client/models/units_enum.rb +1 -1
  169. data/lib/merge_hris_client/models/validation_problem_source.rb +1 -1
  170. data/lib/merge_hris_client/models/warning_validation_problem.rb +1 -1
  171. data/lib/merge_hris_client/models/webhook_receiver.rb +246 -0
  172. data/lib/merge_hris_client/models/webhook_receiver_request.rb +280 -0
  173. data/lib/merge_hris_client/version.rb +1 -1
  174. data/lib/merge_hris_client.rb +21 -2
  175. data/pull_request_template.md +3 -1
  176. data/spec/api/account_details_api_spec.rb +1 -0
  177. data/spec/api/bank_info_api_spec.rb +2 -4
  178. data/spec/api/employees_api_spec.rb +38 -0
  179. data/spec/api/groups_api_spec.rb +68 -0
  180. data/spec/api/issues_api_spec.rb +4 -0
  181. data/spec/api/time_off_api_spec.rb +12 -0
  182. data/spec/models/account_details_and_actions_spec.rb +6 -0
  183. data/spec/models/account_details_spec.rb +12 -0
  184. data/spec/models/data_passthrough_request_spec.rb +6 -0
  185. data/spec/models/debug_mode_log_spec.rb +46 -0
  186. data/spec/models/debug_model_log_summary_spec.rb +46 -0
  187. data/spec/models/earning_type_enum_spec.rb +28 -0
  188. data/spec/models/employee_endpoint_request_spec.rb +34 -0
  189. data/spec/models/employee_request_spec.rb +190 -0
  190. data/spec/models/employee_response_spec.rb +52 -0
  191. data/spec/models/employee_spec.rb +6 -0
  192. data/spec/models/employment_spec.rb +6 -0
  193. data/spec/models/encoding_enum_spec.rb +28 -0
  194. data/spec/models/end_user_details_request_spec.rb +6 -0
  195. data/spec/models/group_spec.rb +64 -0
  196. data/spec/models/group_type_enum_spec.rb +28 -0
  197. data/spec/models/ignore_common_model_spec.rb +40 -0
  198. data/spec/models/location_spec.rb +6 -0
  199. data/spec/models/multipart_form_field_request_spec.rb +58 -0
  200. data/spec/models/paginated_group_list_spec.rb +46 -0
  201. data/spec/models/time_off_response_spec.rb +6 -0
  202. metadata +153 -89
  203. data/test_ruby.rb +0 -30
@@ -21,12 +21,15 @@ module MergeHRISClient
21
21
 
22
22
  attr_accessor :errors
23
23
 
24
+ attr_accessor :logs
25
+
24
26
  # Attribute mapping from ruby-style variable name to JSON key.
25
27
  def self.attribute_map
26
28
  {
27
29
  :'model' => :'model',
28
30
  :'warnings' => :'warnings',
29
- :'errors' => :'errors'
31
+ :'errors' => :'errors',
32
+ :'logs' => :'logs'
30
33
  }
31
34
  end
32
35
 
@@ -40,7 +43,8 @@ module MergeHRISClient
40
43
  {
41
44
  :'model' => :'TimeOff',
42
45
  :'warnings' => :'Array<WarningValidationProblem>',
43
- :'errors' => :'Array<ErrorValidationProblem>'
46
+ :'errors' => :'Array<ErrorValidationProblem>',
47
+ :'logs' => :'Array<DebugModeLog>'
44
48
  }
45
49
  end
46
50
 
@@ -80,6 +84,12 @@ module MergeHRISClient
80
84
  self.errors = value
81
85
  end
82
86
  end
87
+
88
+ if attributes.key?(:'logs')
89
+ if (value = attributes[:'logs']).is_a?(Array)
90
+ self.logs = value
91
+ end
92
+ end
83
93
  end
84
94
 
85
95
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -117,7 +127,8 @@ module MergeHRISClient
117
127
  self.class == o.class &&
118
128
  model == o.model &&
119
129
  warnings == o.warnings &&
120
- errors == o.errors
130
+ errors == o.errors &&
131
+ logs == o.logs
121
132
  end
122
133
 
123
134
  # @see the `==` method
@@ -129,7 +140,7 @@ module MergeHRISClient
129
140
  # Calculates hash code according to all attributes.
130
141
  # @return [Integer] Hash code
131
142
  def hash
132
- [model, warnings, errors].hash
143
+ [model, warnings, errors, logs].hash
133
144
  end
134
145
 
135
146
  # Builds the object from hash
@@ -172,7 +183,7 @@ module MergeHRISClient
172
183
  when :Date
173
184
  Date.parse(value)
174
185
  when :String
175
- value.to_s
186
+ value
176
187
  when :Integer
177
188
  value.to_i
178
189
  when :Float
@@ -32,8 +32,8 @@ module MergeHRISClient
32
32
  # @param [String] The enum value in the form of the string
33
33
  # @return [String] The enum value
34
34
  def build_from_hash(value)
35
- constantValues = TimeOffStatusEnum.constants.select { |c| TimeOffStatusEnum::const_get(c) == value }
36
35
  value
37
36
  end
38
37
  end
38
+
39
39
  end
@@ -29,8 +29,8 @@ module MergeHRISClient
29
29
  # @param [String] The enum value in the form of the string
30
30
  # @return [String] The enum value
31
31
  def build_from_hash(value)
32
- constantValues = UnitsEnum.constants.select { |c| UnitsEnum::const_get(c) == value }
33
32
  value
34
33
  end
35
34
  end
35
+
36
36
  end
@@ -140,7 +140,7 @@ module MergeHRISClient
140
140
  when :Date
141
141
  Date.parse(value)
142
142
  when :String
143
- value.to_s
143
+ value
144
144
  when :Integer
145
145
  value.to_i
146
146
  when :Float
@@ -177,7 +177,7 @@ module MergeHRISClient
177
177
  when :Date
178
178
  Date.parse(value)
179
179
  when :String
180
- value.to_s
180
+ value
181
181
  when :Integer
182
182
  value.to_i
183
183
  when :Float
@@ -0,0 +1,246 @@
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 WebhookReceiver
18
+ attr_accessor :event
19
+
20
+ attr_accessor :is_active
21
+
22
+ attr_accessor :key
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'event' => :'event',
28
+ :'is_active' => :'is_active',
29
+ :'key' => :'key'
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
+ :'event' => :'String',
42
+ :'is_active' => :'Boolean',
43
+ :'key' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::WebhookReceiver` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::WebhookReceiver`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'event')
69
+ self.event = attributes[:'event']
70
+ end
71
+
72
+ if attributes.key?(:'is_active')
73
+ self.is_active = attributes[:'is_active']
74
+ end
75
+
76
+ if attributes.key?(:'key')
77
+ self.key = attributes[:'key']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @event.nil?
86
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
87
+ end
88
+
89
+ if @is_active.nil?
90
+ invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
91
+ end
92
+
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ return false if @event.nil?
100
+ return false if @is_active.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ event == o.event &&
110
+ is_active == o.is_active &&
111
+ key == o.key
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [event, is_active, key].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ new.build_from_hash(attributes)
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
140
+ self.send("#{key}=", nil)
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :Time
162
+ Time.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ # models (e.g. Pet) or oneOf
193
+ klass = MergeHRISClient.const_get(type)
194
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
195
+ end
196
+ end
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # to_body is an alias to to_hash (backward compatibility)
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_body
207
+ to_hash
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ # Outputs non-array value in the form of hash
227
+ # For object, use to_hash. Otherwise, just return the value
228
+ # @param [Object] value Any valid value
229
+ # @return [Hash] Returns the value in the form of hash
230
+ def _to_hash(value)
231
+ if value.is_a?(Array)
232
+ value.compact.map { |v| _to_hash(v) }
233
+ elsif value.is_a?(Hash)
234
+ {}.tap do |hash|
235
+ value.each { |k, v| hash[k] = _to_hash(v) }
236
+ end
237
+ elsif value.respond_to? :to_hash
238
+ value.to_hash
239
+ else
240
+ value
241
+ end
242
+ end
243
+
244
+ end
245
+
246
+ end
@@ -0,0 +1,280 @@
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 WebhookReceiverRequest
18
+ attr_accessor :event
19
+
20
+ attr_accessor :is_active
21
+
22
+ attr_accessor :key
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'event' => :'event',
28
+ :'is_active' => :'is_active',
29
+ :'key' => :'key'
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
+ :'event' => :'String',
42
+ :'is_active' => :'Boolean',
43
+ :'key' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeHRISClient::WebhookReceiverRequest` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeHRISClient::WebhookReceiverRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'event')
69
+ self.event = attributes[:'event']
70
+ end
71
+
72
+ if attributes.key?(:'is_active')
73
+ self.is_active = attributes[:'is_active']
74
+ end
75
+
76
+ if attributes.key?(:'key')
77
+ self.key = attributes[:'key']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @event.nil?
86
+ invalid_properties.push('invalid value for "event", event cannot be nil.')
87
+ end
88
+
89
+ if @event.to_s.length < 1
90
+ invalid_properties.push('invalid value for "event", the character length must be great than or equal to 1.')
91
+ end
92
+
93
+ if @is_active.nil?
94
+ invalid_properties.push('invalid value for "is_active", is_active cannot be nil.')
95
+ end
96
+
97
+ if !@key.nil? && @key.to_s.length < 1
98
+ invalid_properties.push('invalid value for "key", the character length must be great than or equal to 1.')
99
+ end
100
+
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ return false if @event.nil?
108
+ return false if @event.to_s.length < 1
109
+ return false if @is_active.nil?
110
+ return false if !@key.nil? && @key.to_s.length < 1
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] event Value to be assigned
116
+ def event=(event)
117
+ if event.nil?
118
+ fail ArgumentError, 'event cannot be nil'
119
+ end
120
+
121
+ if event.to_s.length < 1
122
+ fail ArgumentError, 'invalid value for "event", the character length must be great than or equal to 1.'
123
+ end
124
+
125
+ @event = event
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] key Value to be assigned
130
+ def key=(key)
131
+ if !key.nil? && key.to_s.length < 1
132
+ fail ArgumentError, 'invalid value for "key", the character length must be great than or equal to 1.'
133
+ end
134
+
135
+ @key = key
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ event == o.event &&
144
+ is_active == o.is_active &&
145
+ key == o.key
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [event, is_active, key].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = MergeHRISClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.1.1
11
11
  =end
12
12
 
13
13
  module MergeHRISClient
14
- VERSION = '1.0.4'
14
+ VERSION = '2.0.2'
15
15
  end