merge_ats_client 2.0.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +16 -0
  3. data/README.md +16 -4
  4. data/docs/ConditionSchema.md +30 -0
  5. data/docs/ConditionTypeEnum.md +15 -0
  6. data/docs/EmailAddressRequest.md +5 -1
  7. data/docs/EndUserDetailsRequest.md +2 -2
  8. data/docs/LinkedAccountCondition.md +28 -0
  9. data/docs/LinkedAccountConditionRequest.md +22 -0
  10. data/docs/LinkedAccountSelectiveSyncConfiguration.md +18 -0
  11. data/docs/LinkedAccountSelectiveSyncConfigurationListRequest.md +18 -0
  12. data/docs/LinkedAccountSelectiveSyncConfigurationRequest.md +18 -0
  13. data/docs/OperatorSchema.md +20 -0
  14. data/docs/PaginatedConditionSchemaList.md +22 -0
  15. data/docs/PhoneNumberRequest.md +5 -1
  16. data/docs/SelectiveSyncApi.md +233 -0
  17. data/docs/UrlRequest.md +5 -1
  18. data/lib/merge_ats_client/api/selective_sync_api.rb +225 -0
  19. data/lib/merge_ats_client/models/access_role_enum.rb +1 -1
  20. data/lib/merge_ats_client/models/account_details_and_actions_status_enum.rb +1 -1
  21. data/lib/merge_ats_client/models/activity_type_enum.rb +1 -1
  22. data/lib/merge_ats_client/models/attachment_type_enum.rb +1 -1
  23. data/lib/merge_ats_client/models/categories_enum.rb +1 -1
  24. data/lib/merge_ats_client/models/category_enum.rb +1 -1
  25. data/lib/merge_ats_client/models/condition_schema.rb +297 -0
  26. data/lib/merge_ats_client/models/condition_type_enum.rb +50 -0
  27. data/lib/merge_ats_client/models/disability_status_enum.rb +1 -1
  28. data/lib/merge_ats_client/models/email_address_request.rb +29 -5
  29. data/lib/merge_ats_client/models/email_address_type_enum.rb +1 -1
  30. data/lib/merge_ats_client/models/encoding_enum.rb +1 -1
  31. data/lib/merge_ats_client/models/end_user_details_request.rb +2 -2
  32. data/lib/merge_ats_client/models/gender_enum.rb +1 -1
  33. data/lib/merge_ats_client/models/job_status_enum.rb +1 -1
  34. data/lib/merge_ats_client/models/linked_account_condition.rb +282 -0
  35. data/lib/merge_ats_client/models/linked_account_condition_request.rb +269 -0
  36. data/lib/merge_ats_client/models/linked_account_selective_sync_configuration.rb +221 -0
  37. data/lib/merge_ats_client/models/linked_account_selective_sync_configuration_list_request.rb +226 -0
  38. data/lib/merge_ats_client/models/linked_account_selective_sync_configuration_request.rb +226 -0
  39. data/lib/merge_ats_client/models/method_enum.rb +1 -1
  40. data/lib/merge_ats_client/models/offer_status_enum.rb +1 -1
  41. data/lib/merge_ats_client/models/operator_schema.rb +229 -0
  42. data/lib/merge_ats_client/models/overall_recommendation_enum.rb +1 -1
  43. data/lib/merge_ats_client/models/paginated_condition_schema_list.rb +240 -0
  44. data/lib/merge_ats_client/models/phone_number_request.rb +29 -5
  45. data/lib/merge_ats_client/models/phone_number_type_enum.rb +1 -1
  46. data/lib/merge_ats_client/models/race_enum.rb +1 -1
  47. data/lib/merge_ats_client/models/reason_enum.rb +1 -1
  48. data/lib/merge_ats_client/models/request_format_enum.rb +1 -1
  49. data/lib/merge_ats_client/models/response_type_enum.rb +1 -1
  50. data/lib/merge_ats_client/models/scheduled_interview_status_enum.rb +1 -1
  51. data/lib/merge_ats_client/models/sync_status_status_enum.rb +1 -1
  52. data/lib/merge_ats_client/models/url.rb +1 -1
  53. data/lib/merge_ats_client/models/url_request.rb +30 -6
  54. data/lib/merge_ats_client/models/url_type_enum.rb +1 -1
  55. data/lib/merge_ats_client/models/veteran_status_enum.rb +1 -1
  56. data/lib/merge_ats_client/models/visibility_enum.rb +1 -1
  57. data/lib/merge_ats_client/version.rb +1 -1
  58. data/lib/merge_ats_client.rb +10 -0
  59. data/spec/api/selective_sync_api_spec.rb +72 -0
  60. data/spec/models/condition_schema_spec.rb +70 -0
  61. data/spec/models/condition_type_enum_spec.rb +28 -0
  62. data/spec/models/email_address_request_spec.rb +12 -0
  63. data/spec/models/linked_account_condition_request_spec.rb +46 -0
  64. data/spec/models/linked_account_condition_spec.rb +64 -0
  65. data/spec/models/linked_account_selective_sync_configuration_list_request_spec.rb +34 -0
  66. data/spec/models/linked_account_selective_sync_configuration_request_spec.rb +34 -0
  67. data/spec/models/linked_account_selective_sync_configuration_spec.rb +34 -0
  68. data/spec/models/operator_schema_spec.rb +40 -0
  69. data/spec/models/paginated_condition_schema_list_spec.rb +46 -0
  70. data/spec/models/phone_number_request_spec.rb +12 -0
  71. data/spec/models/url_request_spec.rb +12 -0
  72. metadata +152 -111
@@ -0,0 +1,225 @@
1
+ =begin
2
+ #Merge ATS API
3
+
4
+ #The unified API for building rich integrations with multiple Applicant Tracking 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 'cgi'
14
+
15
+ module MergeATSClient
16
+ class SelectiveSyncApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get a linked account's selective syncs.
23
+ # @param x_account_token [String] Token identifying the end user.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Array<LinkedAccountSelectiveSyncConfiguration>]
26
+ def selective_sync_configurations_list(x_account_token, opts = {})
27
+ data, _status_code, _headers = selective_sync_configurations_list_with_http_info(x_account_token, opts)
28
+ data
29
+ end
30
+
31
+ # Get a linked account&#39;s selective syncs.
32
+ # @param x_account_token [String] Token identifying the end user.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(Array<LinkedAccountSelectiveSyncConfiguration>, Integer, Hash)>] Array<LinkedAccountSelectiveSyncConfiguration> data, response status code and response headers
35
+ def selective_sync_configurations_list_with_http_info(x_account_token, opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: SelectiveSyncApi.selective_sync_configurations_list ...'
38
+ end
39
+ # verify the required parameter 'x_account_token' is set
40
+ if @api_client.config.client_side_validation && x_account_token.nil?
41
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling SelectiveSyncApi.selective_sync_configurations_list"
42
+ end
43
+ # resource path
44
+ local_var_path = '/selective-sync/configurations'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+ header_params[:'X-Account-Token'] = x_account_token
54
+
55
+ # form parameters
56
+ form_params = opts[:form_params] || {}
57
+
58
+ # http body (model)
59
+ post_body = opts[:debug_body]
60
+
61
+ # return_type
62
+ return_type = opts[:debug_return_type] || 'Array<LinkedAccountSelectiveSyncConfiguration>'
63
+
64
+ # auth_names
65
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
66
+
67
+ new_options = opts.merge(
68
+ :operation => :"SelectiveSyncApi.selective_sync_configurations_list",
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type
75
+ )
76
+
77
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
78
+ if @api_client.config.debugging
79
+ @api_client.config.logger.debug "API called: SelectiveSyncApi#selective_sync_configurations_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
80
+ end
81
+ return data, status_code, headers
82
+ end
83
+
84
+ # Replace a linked account's selective syncs.
85
+ # @param x_account_token [String] Token identifying the end user.
86
+ # @param linked_account_selective_sync_configuration_list_request [LinkedAccountSelectiveSyncConfigurationListRequest]
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [Array<LinkedAccountSelectiveSyncConfiguration>]
89
+ def selective_sync_configurations_update(x_account_token, linked_account_selective_sync_configuration_list_request, opts = {})
90
+ data, _status_code, _headers = selective_sync_configurations_update_with_http_info(x_account_token, linked_account_selective_sync_configuration_list_request, opts)
91
+ data
92
+ end
93
+
94
+ # Replace a linked account&#39;s selective syncs.
95
+ # @param x_account_token [String] Token identifying the end user.
96
+ # @param linked_account_selective_sync_configuration_list_request [LinkedAccountSelectiveSyncConfigurationListRequest]
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(Array<LinkedAccountSelectiveSyncConfiguration>, Integer, Hash)>] Array<LinkedAccountSelectiveSyncConfiguration> data, response status code and response headers
99
+ def selective_sync_configurations_update_with_http_info(x_account_token, linked_account_selective_sync_configuration_list_request, opts = {})
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug 'Calling API: SelectiveSyncApi.selective_sync_configurations_update ...'
102
+ end
103
+ # verify the required parameter 'x_account_token' is set
104
+ if @api_client.config.client_side_validation && x_account_token.nil?
105
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling SelectiveSyncApi.selective_sync_configurations_update"
106
+ end
107
+ # verify the required parameter 'linked_account_selective_sync_configuration_list_request' is set
108
+ if @api_client.config.client_side_validation && linked_account_selective_sync_configuration_list_request.nil?
109
+ fail ArgumentError, "Missing the required parameter 'linked_account_selective_sync_configuration_list_request' when calling SelectiveSyncApi.selective_sync_configurations_update"
110
+ end
111
+ # resource path
112
+ local_var_path = '/selective-sync/configurations'
113
+
114
+ # query parameters
115
+ query_params = opts[:query_params] || {}
116
+
117
+ # header parameters
118
+ header_params = opts[:header_params] || {}
119
+ # HTTP header 'Accept' (if needed)
120
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
121
+ # HTTP header 'Content-Type'
122
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
123
+ header_params[:'X-Account-Token'] = x_account_token
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(linked_account_selective_sync_configuration_list_request)
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type] || 'Array<LinkedAccountSelectiveSyncConfiguration>'
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"SelectiveSyncApi.selective_sync_configurations_update",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: SelectiveSyncApi#selective_sync_configurations_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Get metadata for the conditions available to a linked account.
155
+ # @param x_account_token [String] Token identifying the end user.
156
+ # @param [Hash] opts the optional parameters
157
+ # @option opts [String] :common_model
158
+ # @option opts [Integer] :cursor The pagination cursor value.
159
+ # @option opts [Integer] :page_size Number of results to return per page.
160
+ # @return [PaginatedConditionSchemaList]
161
+ def selective_sync_meta_list(x_account_token, opts = {})
162
+ data, _status_code, _headers = selective_sync_meta_list_with_http_info(x_account_token, opts)
163
+ data
164
+ end
165
+
166
+ # Get metadata for the conditions available to a linked account.
167
+ # @param x_account_token [String] Token identifying the end user.
168
+ # @param [Hash] opts the optional parameters
169
+ # @option opts [String] :common_model
170
+ # @option opts [Integer] :cursor The pagination cursor value.
171
+ # @option opts [Integer] :page_size Number of results to return per page.
172
+ # @return [Array<(PaginatedConditionSchemaList, Integer, Hash)>] PaginatedConditionSchemaList data, response status code and response headers
173
+ def selective_sync_meta_list_with_http_info(x_account_token, opts = {})
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug 'Calling API: SelectiveSyncApi.selective_sync_meta_list ...'
176
+ end
177
+ # verify the required parameter 'x_account_token' is set
178
+ if @api_client.config.client_side_validation && x_account_token.nil?
179
+ fail ArgumentError, "Missing the required parameter 'x_account_token' when calling SelectiveSyncApi.selective_sync_meta_list"
180
+ end
181
+ # resource path
182
+ local_var_path = '/selective-sync/meta'
183
+
184
+ # query parameters
185
+ query_params = opts[:query_params] || {}
186
+ query_params[:'common_model'] = opts[:'common_model'] if !opts[:'common_model'].nil?
187
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
188
+ query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
189
+
190
+ # header parameters
191
+ header_params = opts[:header_params] || {}
192
+ # HTTP header 'Accept' (if needed)
193
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
194
+ header_params[:'X-Account-Token'] = x_account_token
195
+
196
+ # form parameters
197
+ form_params = opts[:form_params] || {}
198
+
199
+ # http body (model)
200
+ post_body = opts[:debug_body]
201
+
202
+ # return_type
203
+ return_type = opts[:debug_return_type] || 'PaginatedConditionSchemaList'
204
+
205
+ # auth_names
206
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
207
+
208
+ new_options = opts.merge(
209
+ :operation => :"SelectiveSyncApi.selective_sync_meta_list",
210
+ :header_params => header_params,
211
+ :query_params => query_params,
212
+ :form_params => form_params,
213
+ :body => post_body,
214
+ :auth_names => auth_names,
215
+ :return_type => return_type
216
+ )
217
+
218
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug "API called: SelectiveSyncApi#selective_sync_meta_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+ end
225
+ end
@@ -41,7 +41,7 @@ module MergeATSClient
41
41
  end
42
42
 
43
43
  def self.build_from_hash(value)
44
- IssueStatusEnum.new.build_from_hash(value)
44
+ AccessRoleEnum.new.build_from_hash(value)
45
45
  end
46
46
  end
47
47
 
@@ -39,7 +39,7 @@ module MergeATSClient
39
39
  end
40
40
 
41
41
  def self.build_from_hash(value)
42
- IssueStatusEnum.new.build_from_hash(value)
42
+ AccountDetailsAndActionsStatusEnum.new.build_from_hash(value)
43
43
  end
44
44
  end
45
45
 
@@ -39,7 +39,7 @@ module MergeATSClient
39
39
  end
40
40
 
41
41
  def self.build_from_hash(value)
42
- IssueStatusEnum.new.build_from_hash(value)
42
+ ActivityTypeEnum.new.build_from_hash(value)
43
43
  end
44
44
  end
45
45
 
@@ -40,7 +40,7 @@ module MergeATSClient
40
40
  end
41
41
 
42
42
  def self.build_from_hash(value)
43
- IssueStatusEnum.new.build_from_hash(value)
43
+ AttachmentTypeEnum.new.build_from_hash(value)
44
44
  end
45
45
  end
46
46
 
@@ -41,7 +41,7 @@ module MergeATSClient
41
41
  end
42
42
 
43
43
  def self.build_from_hash(value)
44
- IssueStatusEnum.new.build_from_hash(value)
44
+ CategoriesEnum.new.build_from_hash(value)
45
45
  end
46
46
  end
47
47
 
@@ -41,7 +41,7 @@ module MergeATSClient
41
41
  end
42
42
 
43
43
  def self.build_from_hash(value)
44
- IssueStatusEnum.new.build_from_hash(value)
44
+ CategoryEnum.new.build_from_hash(value)
45
45
  end
46
46
  end
47
47
 
@@ -0,0 +1,297 @@
1
+ =begin
2
+ #Merge ATS API
3
+
4
+ #The unified API for building rich integrations with multiple Applicant Tracking 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 MergeATSClient
17
+ class ConditionSchema
18
+ # The ID of the condition schema. This ID is used when updating selective syncs for a linked account.
19
+ attr_accessor :id
20
+
21
+ # The common model for which a condition schema is defined.
22
+ attr_accessor :common_model
23
+
24
+ # User-facing *native condition* name. e.g. \"Skip Manager\".
25
+ attr_accessor :native_name
26
+
27
+ # The name of the field on the common model that this condition corresponds to, if they conceptually match. e.g. \"location_type\".
28
+ attr_accessor :field_name
29
+
30
+ # Whether this condition can only be applied once. If false, the condition can be AND'd together multiple times.
31
+ attr_accessor :is_unique
32
+
33
+ attr_accessor :condition_type
34
+
35
+ # The schemas for the operators that can be used on a condition.
36
+ attr_accessor :operators
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'id' => :'id',
42
+ :'common_model' => :'common_model',
43
+ :'native_name' => :'native_name',
44
+ :'field_name' => :'field_name',
45
+ :'is_unique' => :'is_unique',
46
+ :'condition_type' => :'condition_type',
47
+ :'operators' => :'operators'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'id' => :'String',
60
+ :'common_model' => :'String',
61
+ :'native_name' => :'String',
62
+ :'field_name' => :'String',
63
+ :'is_unique' => :'Boolean',
64
+ :'condition_type' => :'ConditionTypeEnum',
65
+ :'operators' => :'Array<OperatorSchema>'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'native_name',
73
+ :'field_name',
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::ConditionSchema` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!self.class.attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::ConditionSchema`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'id')
93
+ self.id = attributes[:'id']
94
+ end
95
+
96
+ if attributes.key?(:'common_model')
97
+ self.common_model = attributes[:'common_model']
98
+ end
99
+
100
+ if attributes.key?(:'native_name')
101
+ self.native_name = attributes[:'native_name']
102
+ end
103
+
104
+ if attributes.key?(:'field_name')
105
+ self.field_name = attributes[:'field_name']
106
+ end
107
+
108
+ if attributes.key?(:'is_unique')
109
+ self.is_unique = attributes[:'is_unique']
110
+ end
111
+
112
+ if attributes.key?(:'condition_type')
113
+ self.condition_type = attributes[:'condition_type']
114
+ end
115
+
116
+ if attributes.key?(:'operators')
117
+ if (value = attributes[:'operators']).is_a?(Array)
118
+ self.operators = value
119
+ end
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ if @id.nil?
128
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
129
+ end
130
+
131
+ if @condition_type.nil?
132
+ invalid_properties.push('invalid value for "condition_type", condition_type cannot be nil.')
133
+ end
134
+
135
+ if @operators.nil?
136
+ invalid_properties.push('invalid value for "operators", operators cannot be nil.')
137
+ end
138
+
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ return false if @id.nil?
146
+ return false if @condition_type.nil?
147
+ return false if @operators.nil?
148
+ true
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ id == o.id &&
157
+ common_model == o.common_model &&
158
+ native_name == o.native_name &&
159
+ field_name == o.field_name &&
160
+ is_unique == o.is_unique &&
161
+ condition_type == o.condition_type &&
162
+ operators == o.operators
163
+ end
164
+
165
+ # @see the `==` method
166
+ # @param [Object] Object to be compared
167
+ def eql?(o)
168
+ self == o
169
+ end
170
+
171
+ # Calculates hash code according to all attributes.
172
+ # @return [Integer] Hash code
173
+ def hash
174
+ [id, common_model, native_name, field_name, is_unique, condition_type, operators].hash
175
+ end
176
+
177
+ # Builds the object from hash
178
+ # @param [Hash] attributes Model attributes in the form of hash
179
+ # @return [Object] Returns the model itself
180
+ def self.build_from_hash(attributes)
181
+ new.build_from_hash(attributes)
182
+ end
183
+
184
+ # Builds the object from hash
185
+ # @param [Hash] attributes Model attributes in the form of hash
186
+ # @return [Object] Returns the model itself
187
+ def build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
+ self.send("#{key}=", nil)
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
197
+ end
198
+ elsif !attributes[self.class.attribute_map[key]].nil?
199
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :Time
213
+ Time.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ # models (e.g. Pet) or oneOf
244
+ klass = MergeATSClient.const_get(type)
245
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -0,0 +1,50 @@
1
+ =begin
2
+ #Merge ATS API
3
+
4
+ #The unified API for building rich integrations with multiple Applicant Tracking 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 MergeATSClient
17
+ class ConditionTypeEnum
18
+ BOOLEAN = "BOOLEAN".freeze
19
+ DATE = "DATE".freeze
20
+ DATE_TIME = "DATE_TIME".freeze
21
+ INTEGER = "INTEGER".freeze
22
+ FLOAT = "FLOAT".freeze
23
+ STRING = "STRING".freeze
24
+ LIST_OF_STRINGS = "LIST_OF_STRINGS".freeze
25
+
26
+ MERGE_NONSTANDARD_VALUE = "MERGE_NONSTANDARD_VALUE".freeze
27
+
28
+ attr_accessor :value
29
+ attr_accessor :raw_value
30
+
31
+ # Builds the enum from string
32
+ # @param [String] The enum value in the form of the string
33
+ # @return [String] The enum value
34
+ def build_from_hash(value)
35
+ @raw_value = value
36
+ if ["BOOLEAN", "DATE", "DATE_TIME", "INTEGER", "FLOAT", "STRING", "LIST_OF_STRINGS", ].include? value
37
+ @value = value
38
+ else
39
+ @value = MERGE_NONSTANDARD_VALUE
40
+ end
41
+
42
+ self
43
+ end
44
+
45
+ def self.build_from_hash(value)
46
+ ConditionTypeEnum.new.build_from_hash(value)
47
+ end
48
+ end
49
+
50
+ end
@@ -39,7 +39,7 @@ module MergeATSClient
39
39
  end
40
40
 
41
41
  def self.build_from_hash(value)
42
- IssueStatusEnum.new.build_from_hash(value)
42
+ DisabilityStatusEnum.new.build_from_hash(value)
43
43
  end
44
44
  end
45
45