fountain_partner_api_client 0.0.3 → 0.0.4

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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -9
  3. data/docs/DefaultApi.md +228 -0
  4. data/docs/V1PartnersIdApplicantsApplicantIdDetailsPostRequest.md +20 -0
  5. data/docs/V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicant.md +18 -0
  6. data/docs/V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicantPartnerDetails.md +26 -0
  7. data/docs/V1PartnersIdApplicantsApplicantIdPut200Response.md +20 -0
  8. data/docs/V1PartnersIdApplicantsApplicantIdPutRequest.md +20 -0
  9. data/docs/V1PartnersIdApplicantsApplicantIdPutRequestApplicant.md +18 -0
  10. data/docs/V1PartnersIdApplicantsApplicantIdPutRequestApplicantLabelsInner.md +20 -0
  11. data/docs/V1PartnersIdApplicantsApplicantIdStatusPostRequest.md +20 -0
  12. data/docs/V1PartnersIdApplicantsApplicantIdStatusPostRequestApplicant.md +18 -0
  13. data/docs/V1PartnersIdApplicantsApplicantIdStatusPostRequestApplicantPartnerStatus.md +26 -0
  14. data/fountain_partner_api_client-0.0.3.gem +0 -0
  15. data/lib/fountain_partner_api_client/api/default_api.rb +222 -0
  16. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_details_post_request.rb +228 -0
  17. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_details_post_request_applicant.rb +219 -0
  18. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_details_post_request_applicant_partner_details.rb +255 -0
  19. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_put200_response.rb +230 -0
  20. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_put_request.rb +228 -0
  21. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_put_request_applicant.rb +221 -0
  22. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_put_request_applicant_labels_inner.rb +228 -0
  23. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_status_post_request.rb +228 -0
  24. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_status_post_request_applicant.rb +219 -0
  25. data/lib/fountain_partner_api_client/models/v1_partners_id_applicants_applicant_id_status_post_request_applicant_partner_status.rb +255 -0
  26. data/lib/fountain_partner_api_client/version.rb +1 -1
  27. data/lib/fountain_partner_api_client.rb +10 -0
  28. data/spec/models/v1_partners_id_applicants_applicant_id_details_post_request_applicant_partner_details_spec.rb +58 -0
  29. data/spec/models/v1_partners_id_applicants_applicant_id_details_post_request_applicant_spec.rb +34 -0
  30. data/spec/models/v1_partners_id_applicants_applicant_id_details_post_request_spec.rb +40 -0
  31. data/spec/models/v1_partners_id_applicants_applicant_id_put200_response_spec.rb +40 -0
  32. data/spec/models/v1_partners_id_applicants_applicant_id_put_request_applicant_labels_inner_spec.rb +40 -0
  33. data/spec/models/v1_partners_id_applicants_applicant_id_put_request_applicant_spec.rb +34 -0
  34. data/spec/models/v1_partners_id_applicants_applicant_id_put_request_spec.rb +40 -0
  35. data/spec/models/v1_partners_id_applicants_applicant_id_status_post_request_applicant_partner_status_spec.rb +58 -0
  36. data/spec/models/v1_partners_id_applicants_applicant_id_status_post_request_applicant_spec.rb +34 -0
  37. data/spec/models/v1_partners_id_applicants_applicant_id_status_post_request_spec.rb +40 -0
  38. metadata +42 -1
@@ -19,6 +19,228 @@ module FountainPartnerApiClient
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Create Applicant Details
23
+ # @param applicant_id [String]
24
+ # @param id [String]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [V1PartnersIdApplicantsApplicantIdDetailsPostRequest] :v1_partners_id_applicants_applicant_id_details_post_request
27
+ # @return [Object]
28
+ def v1_partners_id_applicants_applicant_id_details_post(applicant_id, id, opts = {})
29
+ data, _status_code, _headers = v1_partners_id_applicants_applicant_id_details_post_with_http_info(applicant_id, id, opts)
30
+ data
31
+ end
32
+
33
+ # Create Applicant Details
34
+ # @param applicant_id [String]
35
+ # @param id [String]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [V1PartnersIdApplicantsApplicantIdDetailsPostRequest] :v1_partners_id_applicants_applicant_id_details_post_request
38
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
39
+ def v1_partners_id_applicants_applicant_id_details_post_with_http_info(applicant_id, id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: DefaultApi.v1_partners_id_applicants_applicant_id_details_post ...'
42
+ end
43
+ # verify the required parameter 'applicant_id' is set
44
+ if @api_client.config.client_side_validation && applicant_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'applicant_id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_details_post"
46
+ end
47
+ # verify the required parameter 'id' is set
48
+ if @api_client.config.client_side_validation && id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_details_post"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/partners/{id}/applicants/{applicant_id}/details'.sub('{' + 'applicant_id' + '}', CGI.escape(applicant_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ content_type = @api_client.select_header_content_type(['application/json'])
63
+ if !content_type.nil?
64
+ header_params['Content-Type'] = content_type
65
+ end
66
+
67
+ # form parameters
68
+ form_params = opts[:form_params] || {}
69
+
70
+ # http body (model)
71
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'v1_partners_id_applicants_applicant_id_details_post_request'])
72
+
73
+ # return_type
74
+ return_type = opts[:debug_return_type] || 'Object'
75
+
76
+ # auth_names
77
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
78
+
79
+ new_options = opts.merge(
80
+ :operation => :"DefaultApi.v1_partners_id_applicants_applicant_id_details_post",
81
+ :header_params => header_params,
82
+ :query_params => query_params,
83
+ :form_params => form_params,
84
+ :body => post_body,
85
+ :auth_names => auth_names,
86
+ :return_type => return_type
87
+ )
88
+
89
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: DefaultApi#v1_partners_id_applicants_applicant_id_details_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+
96
+ # Update Applicant
97
+ # @param applicant_id [String]
98
+ # @param id [String]
99
+ # @param [Hash] opts the optional parameters
100
+ # @option opts [V1PartnersIdApplicantsApplicantIdPutRequest] :v1_partners_id_applicants_applicant_id_put_request
101
+ # @return [V1PartnersIdApplicantsApplicantIdPut200Response]
102
+ def v1_partners_id_applicants_applicant_id_put(applicant_id, id, opts = {})
103
+ data, _status_code, _headers = v1_partners_id_applicants_applicant_id_put_with_http_info(applicant_id, id, opts)
104
+ data
105
+ end
106
+
107
+ # Update Applicant
108
+ # @param applicant_id [String]
109
+ # @param id [String]
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [V1PartnersIdApplicantsApplicantIdPutRequest] :v1_partners_id_applicants_applicant_id_put_request
112
+ # @return [Array<(V1PartnersIdApplicantsApplicantIdPut200Response, Integer, Hash)>] V1PartnersIdApplicantsApplicantIdPut200Response data, response status code and response headers
113
+ def v1_partners_id_applicants_applicant_id_put_with_http_info(applicant_id, id, opts = {})
114
+ if @api_client.config.debugging
115
+ @api_client.config.logger.debug 'Calling API: DefaultApi.v1_partners_id_applicants_applicant_id_put ...'
116
+ end
117
+ # verify the required parameter 'applicant_id' is set
118
+ if @api_client.config.client_side_validation && applicant_id.nil?
119
+ fail ArgumentError, "Missing the required parameter 'applicant_id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_put"
120
+ end
121
+ # verify the required parameter 'id' is set
122
+ if @api_client.config.client_side_validation && id.nil?
123
+ fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_put"
124
+ end
125
+ # resource path
126
+ local_var_path = '/v1/partners/{id}/applicants/{applicant_id}'.sub('{' + 'applicant_id' + '}', CGI.escape(applicant_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
127
+
128
+ # query parameters
129
+ query_params = opts[:query_params] || {}
130
+
131
+ # header parameters
132
+ header_params = opts[:header_params] || {}
133
+ # HTTP header 'Accept' (if needed)
134
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
135
+ # HTTP header 'Content-Type'
136
+ content_type = @api_client.select_header_content_type(['application/json'])
137
+ if !content_type.nil?
138
+ header_params['Content-Type'] = content_type
139
+ end
140
+
141
+ # form parameters
142
+ form_params = opts[:form_params] || {}
143
+
144
+ # http body (model)
145
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'v1_partners_id_applicants_applicant_id_put_request'])
146
+
147
+ # return_type
148
+ return_type = opts[:debug_return_type] || 'V1PartnersIdApplicantsApplicantIdPut200Response'
149
+
150
+ # auth_names
151
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
152
+
153
+ new_options = opts.merge(
154
+ :operation => :"DefaultApi.v1_partners_id_applicants_applicant_id_put",
155
+ :header_params => header_params,
156
+ :query_params => query_params,
157
+ :form_params => form_params,
158
+ :body => post_body,
159
+ :auth_names => auth_names,
160
+ :return_type => return_type
161
+ )
162
+
163
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: DefaultApi#v1_partners_id_applicants_applicant_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+
170
+ # Create Applicant Status
171
+ # @param applicant_id [String]
172
+ # @param id [String]
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [V1PartnersIdApplicantsApplicantIdStatusPostRequest] :v1_partners_id_applicants_applicant_id_status_post_request
175
+ # @return [Object]
176
+ def v1_partners_id_applicants_applicant_id_status_post(applicant_id, id, opts = {})
177
+ data, _status_code, _headers = v1_partners_id_applicants_applicant_id_status_post_with_http_info(applicant_id, id, opts)
178
+ data
179
+ end
180
+
181
+ # Create Applicant Status
182
+ # @param applicant_id [String]
183
+ # @param id [String]
184
+ # @param [Hash] opts the optional parameters
185
+ # @option opts [V1PartnersIdApplicantsApplicantIdStatusPostRequest] :v1_partners_id_applicants_applicant_id_status_post_request
186
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
187
+ def v1_partners_id_applicants_applicant_id_status_post_with_http_info(applicant_id, id, opts = {})
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug 'Calling API: DefaultApi.v1_partners_id_applicants_applicant_id_status_post ...'
190
+ end
191
+ # verify the required parameter 'applicant_id' is set
192
+ if @api_client.config.client_side_validation && applicant_id.nil?
193
+ fail ArgumentError, "Missing the required parameter 'applicant_id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_status_post"
194
+ end
195
+ # verify the required parameter 'id' is set
196
+ if @api_client.config.client_side_validation && id.nil?
197
+ fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.v1_partners_id_applicants_applicant_id_status_post"
198
+ end
199
+ # resource path
200
+ local_var_path = '/v1/partners/{id}/applicants/{applicant_id}/status'.sub('{' + 'applicant_id' + '}', CGI.escape(applicant_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
201
+
202
+ # query parameters
203
+ query_params = opts[:query_params] || {}
204
+
205
+ # header parameters
206
+ header_params = opts[:header_params] || {}
207
+ # HTTP header 'Accept' (if needed)
208
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
209
+ # HTTP header 'Content-Type'
210
+ content_type = @api_client.select_header_content_type(['application/json'])
211
+ if !content_type.nil?
212
+ header_params['Content-Type'] = content_type
213
+ end
214
+
215
+ # form parameters
216
+ form_params = opts[:form_params] || {}
217
+
218
+ # http body (model)
219
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'v1_partners_id_applicants_applicant_id_status_post_request'])
220
+
221
+ # return_type
222
+ return_type = opts[:debug_return_type] || 'Object'
223
+
224
+ # auth_names
225
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
226
+
227
+ new_options = opts.merge(
228
+ :operation => :"DefaultApi.v1_partners_id_applicants_applicant_id_status_post",
229
+ :header_params => header_params,
230
+ :query_params => query_params,
231
+ :form_params => form_params,
232
+ :body => post_body,
233
+ :auth_names => auth_names,
234
+ :return_type => return_type
235
+ )
236
+
237
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
238
+ if @api_client.config.debugging
239
+ @api_client.config.logger.debug "API called: DefaultApi#v1_partners_id_applicants_applicant_id_status_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
240
+ end
241
+ return data, status_code, headers
242
+ end
243
+
22
244
  # Show Partner
23
245
  # @param id [String]
24
246
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,228 @@
1
+ =begin
2
+ #Fountain Partner Docs
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FountainPartnerApiClient
17
+ class V1PartnersIdApplicantsApplicantIdDetailsPostRequest
18
+ attr_accessor :applicant
19
+
20
+ attr_accessor :format
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'applicant' => :'applicant',
26
+ :'format' => :'format'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'applicant' => :'V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicant',
39
+ :'format' => :'Object'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FountainPartnerApiClient::V1PartnersIdApplicantsApplicantIdDetailsPostRequest` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FountainPartnerApiClient::V1PartnersIdApplicantsApplicantIdDetailsPostRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'applicant')
65
+ self.applicant = attributes[:'applicant']
66
+ end
67
+
68
+ if attributes.key?(:'format')
69
+ self.format = attributes[:'format']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
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
+ applicant == o.applicant &&
92
+ format == o.format
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [applicant, format].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = FountainPartnerApiClient.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #Fountain Partner Docs
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FountainPartnerApiClient
17
+ class V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicant
18
+ attr_accessor :partner_details
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'partner_details' => :'partner_details'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'partner_details' => :'V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicantPartnerDetails'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FountainPartnerApiClient::V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicant` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FountainPartnerApiClient::V1PartnersIdApplicantsApplicantIdDetailsPostRequestApplicant`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'partner_details')
61
+ self.partner_details = attributes[:'partner_details']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ partner_details == o.partner_details
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [partner_details].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ attributes = attributes.transform_keys(&:to_sym)
111
+ self.class.openapi_types.each_pair do |key, type|
112
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
113
+ self.send("#{key}=", nil)
114
+ elsif type =~ /\AArray<(.*)>/i
115
+ # check to ensure the input is an array given that the attribute
116
+ # is documented as an array but the input is not
117
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
118
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
119
+ end
120
+ elsif !attributes[self.class.attribute_map[key]].nil?
121
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
122
+ end
123
+ end
124
+
125
+ self
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def _deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = FountainPartnerApiClient.const_get(type)
167
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = self.send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ end
218
+
219
+ end