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
@@ -22,11 +22,17 @@ module MergeATSClient
22
22
  # The type of email address.
23
23
  attr_accessor :email_address_type
24
24
 
25
+ attr_accessor :integration_params
26
+
27
+ attr_accessor :linked_account_params
28
+
25
29
  # Attribute mapping from ruby-style variable name to JSON key.
26
30
  def self.attribute_map
27
31
  {
28
32
  :'value' => :'value',
29
- :'email_address_type' => :'email_address_type'
33
+ :'email_address_type' => :'email_address_type',
34
+ :'integration_params' => :'integration_params',
35
+ :'linked_account_params' => :'linked_account_params'
30
36
  }
31
37
  end
32
38
 
@@ -39,7 +45,9 @@ module MergeATSClient
39
45
  def self.openapi_types
40
46
  {
41
47
  :'value' => :'String',
42
- :'email_address_type' => :'EmailAddressTypeEnum'
48
+ :'email_address_type' => :'EmailAddressTypeEnum',
49
+ :'integration_params' => :'Hash<String, Object>',
50
+ :'linked_account_params' => :'Hash<String, Object>'
43
51
  }
44
52
  end
45
53
 
@@ -47,7 +55,9 @@ module MergeATSClient
47
55
  def self.openapi_nullable
48
56
  Set.new([
49
57
  :'value',
50
- :'email_address_type'
58
+ :'email_address_type',
59
+ :'integration_params',
60
+ :'linked_account_params'
51
61
  ])
52
62
  end
53
63
 
@@ -73,6 +83,18 @@ module MergeATSClient
73
83
  if attributes.key?(:'email_address_type')
74
84
  self.email_address_type = attributes[:'email_address_type']
75
85
  end
86
+
87
+ if attributes.key?(:'integration_params')
88
+ if (value = attributes[:'integration_params']).is_a?(Hash)
89
+ self.integration_params = value
90
+ end
91
+ end
92
+
93
+ if attributes.key?(:'linked_account_params')
94
+ if (value = attributes[:'linked_account_params']).is_a?(Hash)
95
+ self.linked_account_params = value
96
+ end
97
+ end
76
98
  end
77
99
 
78
100
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -109,7 +131,9 @@ module MergeATSClient
109
131
  return true if self.equal?(o)
110
132
  self.class == o.class &&
111
133
  value == o.value &&
112
- email_address_type == o.email_address_type
134
+ email_address_type == o.email_address_type &&
135
+ integration_params == o.integration_params &&
136
+ linked_account_params == o.linked_account_params
113
137
  end
114
138
 
115
139
  # @see the `==` method
@@ -121,7 +145,7 @@ module MergeATSClient
121
145
  # Calculates hash code according to all attributes.
122
146
  # @return [Integer] Hash code
123
147
  def hash
124
- [value, email_address_type].hash
148
+ [value, email_address_type, integration_params, linked_account_params].hash
125
149
  end
126
150
 
127
151
  # Builds the object from hash
@@ -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
+ EmailAddressTypeEnum.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
+ EncodingEnum.new.build_from_hash(value)
43
43
  end
44
44
  end
45
45
 
@@ -15,13 +15,13 @@ require 'time'
15
15
 
16
16
  module MergeATSClient
17
17
  class EndUserDetailsRequest
18
- # Your end user's email address.
18
+ # Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.
19
19
  attr_accessor :end_user_email_address
20
20
 
21
21
  # Your end user's organization.
22
22
  attr_accessor :end_user_organization_name
23
23
 
24
- # Unique ID for your end user.
24
+ # This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.
25
25
  attr_accessor :end_user_origin_id
26
26
 
27
27
  # The integration categories to show in Merge Link.
@@ -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
+ GenderEnum.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
+ JobStatusEnum.new.build_from_hash(value)
45
45
  end
46
46
  end
47
47
 
@@ -0,0 +1,282 @@
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 LinkedAccountCondition
18
+ # The ID indicating which condition schema to use for a specific condition.
19
+ attr_accessor :condition_schema_id
20
+
21
+ # The common model for a specific condition.
22
+ attr_accessor :common_model
23
+
24
+ # User-facing *native condition* name. e.g. \"Skip Manager\".
25
+ attr_accessor :native_name
26
+
27
+ # The operator for a specific condition.
28
+ attr_accessor :operator
29
+
30
+ # The value for a condition.
31
+ attr_accessor :value
32
+
33
+ # The name of the field on the common model that this condition corresponds to, if they conceptually match. e.g. \"location_type\".
34
+ attr_accessor :field_name
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'condition_schema_id' => :'condition_schema_id',
40
+ :'common_model' => :'common_model',
41
+ :'native_name' => :'native_name',
42
+ :'operator' => :'operator',
43
+ :'value' => :'value',
44
+ :'field_name' => :'field_name'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'condition_schema_id' => :'String',
57
+ :'common_model' => :'String',
58
+ :'native_name' => :'String',
59
+ :'operator' => :'String',
60
+ :'value' => :'Object',
61
+ :'field_name' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'native_name',
69
+ :'value',
70
+ :'field_name'
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::LinkedAccountCondition` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::LinkedAccountCondition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'condition_schema_id')
90
+ self.condition_schema_id = attributes[:'condition_schema_id']
91
+ end
92
+
93
+ if attributes.key?(:'common_model')
94
+ self.common_model = attributes[:'common_model']
95
+ end
96
+
97
+ if attributes.key?(:'native_name')
98
+ self.native_name = attributes[:'native_name']
99
+ end
100
+
101
+ if attributes.key?(:'operator')
102
+ self.operator = attributes[:'operator']
103
+ end
104
+
105
+ if attributes.key?(:'value')
106
+ self.value = attributes[:'value']
107
+ end
108
+
109
+ if attributes.key?(:'field_name')
110
+ self.field_name = attributes[:'field_name']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ if @condition_schema_id.nil?
119
+ invalid_properties.push('invalid value for "condition_schema_id", condition_schema_id cannot be nil.')
120
+ end
121
+
122
+ if @operator.nil?
123
+ invalid_properties.push('invalid value for "operator", operator cannot be nil.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @condition_schema_id.nil?
133
+ return false if @operator.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ condition_schema_id == o.condition_schema_id &&
143
+ common_model == o.common_model &&
144
+ native_name == o.native_name &&
145
+ operator == o.operator &&
146
+ value == o.value &&
147
+ field_name == o.field_name
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [condition_schema_id, common_model, native_name, operator, value, field_name].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
+ self.send("#{key}=", nil)
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = MergeATSClient.const_get(type)
230
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end
@@ -0,0 +1,269 @@
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 LinkedAccountConditionRequest
18
+ # The ID indicating which condition schema to use for a specific condition.
19
+ attr_accessor :condition_schema_id
20
+
21
+ # The operator for a specific condition.
22
+ attr_accessor :operator
23
+
24
+ # The value for a specific condition.
25
+ attr_accessor :value
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'condition_schema_id' => :'condition_schema_id',
31
+ :'operator' => :'operator',
32
+ :'value' => :'value'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'condition_schema_id' => :'String',
45
+ :'operator' => :'String',
46
+ :'value' => :'Object'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ :'value'
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::LinkedAccountConditionRequest` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::LinkedAccountConditionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'condition_schema_id')
73
+ self.condition_schema_id = attributes[:'condition_schema_id']
74
+ end
75
+
76
+ if attributes.key?(:'operator')
77
+ self.operator = attributes[:'operator']
78
+ end
79
+
80
+ if attributes.key?(:'value')
81
+ self.value = attributes[:'value']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @condition_schema_id.nil?
90
+ invalid_properties.push('invalid value for "condition_schema_id", condition_schema_id cannot be nil.')
91
+ end
92
+
93
+ if @operator.nil?
94
+ invalid_properties.push('invalid value for "operator", operator cannot be nil.')
95
+ end
96
+
97
+ if @operator.to_s.length < 1
98
+ invalid_properties.push('invalid value for "operator", 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 @condition_schema_id.nil?
108
+ return false if @operator.nil?
109
+ return false if @operator.to_s.length < 1
110
+ true
111
+ end
112
+
113
+ # Custom attribute writer method with validation
114
+ # @param [Object] operator Value to be assigned
115
+ def operator=(operator)
116
+ if operator.nil?
117
+ fail ArgumentError, 'operator cannot be nil'
118
+ end
119
+
120
+ if operator.to_s.length < 1
121
+ fail ArgumentError, 'invalid value for "operator", the character length must be great than or equal to 1.'
122
+ end
123
+
124
+ @operator = operator
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ condition_schema_id == o.condition_schema_id &&
133
+ operator == o.operator &&
134
+ value == o.value
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [condition_schema_id, operator, value].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.openapi_types.each_pair do |key, type|
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :Time
185
+ Time.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ # models (e.g. Pet) or oneOf
216
+ klass = MergeATSClient.const_get(type)
217
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
218
+ end
219
+ end
220
+
221
+ # Returns the string representation of the object
222
+ # @return [String] String presentation of the object
223
+ def to_s
224
+ to_hash.to_s
225
+ end
226
+
227
+ # to_body is an alias to to_hash (backward compatibility)
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_body
230
+ to_hash
231
+ end
232
+
233
+ # Returns the object in the form of hash
234
+ # @return [Hash] Returns the object in the form of hash
235
+ def to_hash
236
+ hash = {}
237
+ self.class.attribute_map.each_pair do |attr, param|
238
+ value = self.send(attr)
239
+ if value.nil?
240
+ is_nullable = self.class.openapi_nullable.include?(attr)
241
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
242
+ end
243
+
244
+ hash[param] = _to_hash(value)
245
+ end
246
+ hash
247
+ end
248
+
249
+ # Outputs non-array value in the form of hash
250
+ # For object, use to_hash. Otherwise, just return the value
251
+ # @param [Object] value Any valid value
252
+ # @return [Hash] Returns the value in the form of hash
253
+ def _to_hash(value)
254
+ if value.is_a?(Array)
255
+ value.compact.map { |v| _to_hash(v) }
256
+ elsif value.is_a?(Hash)
257
+ {}.tap do |hash|
258
+ value.each { |k, v| hash[k] = _to_hash(v) }
259
+ end
260
+ elsif value.respond_to? :to_hash
261
+ value.to_hash
262
+ else
263
+ value
264
+ end
265
+ end
266
+
267
+ end
268
+
269
+ end