merge_ats_client 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,221 @@
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 LinkedAccountSelectiveSyncConfiguration
18
+ # The conditions belonging to a selective sync.
19
+ attr_accessor :linked_account_conditions
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'linked_account_conditions' => :'linked_account_conditions'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'linked_account_conditions' => :'Array<LinkedAccountCondition>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::LinkedAccountSelectiveSyncConfiguration` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::LinkedAccountSelectiveSyncConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'linked_account_conditions')
62
+ if (value = attributes[:'linked_account_conditions']).is_a?(Array)
63
+ self.linked_account_conditions = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ linked_account_conditions == o.linked_account_conditions
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Integer] Hash code
97
+ def hash
98
+ [linked_account_conditions].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def self.build_from_hash(attributes)
105
+ new.build_from_hash(attributes)
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = MergeATSClient.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,226 @@
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 LinkedAccountSelectiveSyncConfigurationListRequest
18
+ # The selective syncs associated with a linked account.
19
+ attr_accessor :sync_configurations
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'sync_configurations' => :'sync_configurations'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'sync_configurations' => :'Array<LinkedAccountSelectiveSyncConfigurationRequest>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::LinkedAccountSelectiveSyncConfigurationListRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::LinkedAccountSelectiveSyncConfigurationListRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'sync_configurations')
62
+ if (value = attributes[:'sync_configurations']).is_a?(Array)
63
+ self.sync_configurations = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if @sync_configurations.nil?
73
+ invalid_properties.push('invalid value for "sync_configurations", sync_configurations cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if @sync_configurations.nil?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ sync_configurations == o.sync_configurations
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [sync_configurations].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
120
+ self.send("#{key}=", nil)
121
+ elsif type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = MergeATSClient.const_get(type)
174
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -0,0 +1,226 @@
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 LinkedAccountSelectiveSyncConfigurationRequest
18
+ # The conditions belonging to a selective sync.
19
+ attr_accessor :linked_account_conditions
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'linked_account_conditions' => :'linked_account_conditions'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'linked_account_conditions' => :'Array<LinkedAccountConditionRequest>'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MergeATSClient::LinkedAccountSelectiveSyncConfigurationRequest` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MergeATSClient::LinkedAccountSelectiveSyncConfigurationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'linked_account_conditions')
62
+ if (value = attributes[:'linked_account_conditions']).is_a?(Array)
63
+ self.linked_account_conditions = value
64
+ end
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ if @linked_account_conditions.nil?
73
+ invalid_properties.push('invalid value for "linked_account_conditions", linked_account_conditions cannot be nil.')
74
+ end
75
+
76
+ invalid_properties
77
+ end
78
+
79
+ # Check to see if the all the properties in the model are valid
80
+ # @return true if the model is valid
81
+ def valid?
82
+ return false if @linked_account_conditions.nil?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ linked_account_conditions == o.linked_account_conditions
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [linked_account_conditions].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ new.build_from_hash(attributes)
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def build_from_hash(attributes)
117
+ return nil unless attributes.is_a?(Hash)
118
+ self.class.openapi_types.each_pair do |key, type|
119
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
120
+ self.send("#{key}=", nil)
121
+ elsif type =~ /\AArray<(.*)>/i
122
+ # check to ensure the input is an array given that the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
126
+ end
127
+ elsif !attributes[self.class.attribute_map[key]].nil?
128
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
129
+ end
130
+ end
131
+
132
+ self
133
+ end
134
+
135
+ # Deserializes the data based on type
136
+ # @param string type Data type
137
+ # @param string value Value to be deserialized
138
+ # @return [Object] Deserialized data
139
+ def _deserialize(type, value)
140
+ case type.to_sym
141
+ when :Time
142
+ Time.parse(value)
143
+ when :Date
144
+ Date.parse(value)
145
+ when :String
146
+ value
147
+ when :Integer
148
+ value.to_i
149
+ when :Float
150
+ value.to_f
151
+ when :Boolean
152
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
153
+ true
154
+ else
155
+ false
156
+ end
157
+ when :Object
158
+ # generic object (usually a Hash), return directly
159
+ value
160
+ when /\AArray<(?<inner_type>.+)>\z/
161
+ inner_type = Regexp.last_match[:inner_type]
162
+ value.map { |v| _deserialize(inner_type, v) }
163
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
164
+ k_type = Regexp.last_match[:k_type]
165
+ v_type = Regexp.last_match[:v_type]
166
+ {}.tap do |hash|
167
+ value.each do |k, v|
168
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
169
+ end
170
+ end
171
+ else # model
172
+ # models (e.g. Pet) or oneOf
173
+ klass = MergeATSClient.const_get(type)
174
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+
224
+ end
225
+
226
+ end
@@ -43,7 +43,7 @@ module MergeATSClient
43
43
  end
44
44
 
45
45
  def self.build_from_hash(value)
46
- IssueStatusEnum.new.build_from_hash(value)
46
+ MethodEnum.new.build_from_hash(value)
47
47
  end
48
48
  end
49
49
 
@@ -45,7 +45,7 @@ module MergeATSClient
45
45
  end
46
46
 
47
47
  def self.build_from_hash(value)
48
- IssueStatusEnum.new.build_from_hash(value)
48
+ OfferStatusEnum.new.build_from_hash(value)
49
49
  end
50
50
  end
51
51