checkify 0.1.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 (87) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +319 -0
  5. data/docs/AbnAddress.md +24 -0
  6. data/docs/AbnResponse.md +34 -0
  7. data/docs/AbnResponseAbnDetails.md +22 -0
  8. data/docs/Account.md +36 -0
  9. data/docs/AccountApi.md +74 -0
  10. data/docs/AcnAddress.md +24 -0
  11. data/docs/AcnResponse.md +38 -0
  12. data/docs/AcnResponseAbnDetails.md +18 -0
  13. data/docs/AcnResponseAcnDetails.md +22 -0
  14. data/docs/AddressApi.md +457 -0
  15. data/docs/AddressDetails.md +52 -0
  16. data/docs/AsicDocument.md +28 -0
  17. data/docs/AsicDocumentContentsInner.md +20 -0
  18. data/docs/BatchApi.md +217 -0
  19. data/docs/BulkCreateRequest.md +20 -0
  20. data/docs/BulkCreateRequestItems.md +49 -0
  21. data/docs/BulkJob.md +26 -0
  22. data/docs/BusinessActivity.md +22 -0
  23. data/docs/BusinessActivityResponse.md +22 -0
  24. data/docs/BusinessApi.md +361 -0
  25. data/docs/CommunicationApi.md +151 -0
  26. data/docs/DirectorIdResponse.md +24 -0
  27. data/docs/EmailResponse.md +42 -0
  28. data/docs/EmailResponseDns.md +18 -0
  29. data/docs/EmailResponseFormat.md +22 -0
  30. data/docs/Error.md +22 -0
  31. data/docs/FormerName.md +22 -0
  32. data/docs/IdentityApi.md +225 -0
  33. data/docs/NameAvailability.md +26 -0
  34. data/docs/PhoneResponse.md +32 -0
  35. data/docs/PostcodeResult.md +30 -0
  36. data/docs/ReverseResult.md +38 -0
  37. data/docs/SanctionsResponse.md +20 -0
  38. data/docs/SanctionsResult.md +42 -0
  39. data/docs/SanctionsResultSanctions.md +24 -0
  40. data/docs/SuburbDetails.md +30 -0
  41. data/docs/TfnResponse.md +24 -0
  42. data/lib/checkify/api/account_api.rb +79 -0
  43. data/lib/checkify/api/address_api.rb +490 -0
  44. data/lib/checkify/api/batch_api.rb +216 -0
  45. data/lib/checkify/api/business_api.rb +365 -0
  46. data/lib/checkify/api/communication_api.rb +157 -0
  47. data/lib/checkify/api/identity_api.rb +248 -0
  48. data/lib/checkify/api_client.rb +397 -0
  49. data/lib/checkify/api_error.rb +58 -0
  50. data/lib/checkify/api_model_base.rb +88 -0
  51. data/lib/checkify/client.rb +25 -0
  52. data/lib/checkify/configuration.rb +305 -0
  53. data/lib/checkify/models/abn_address.rb +173 -0
  54. data/lib/checkify/models/abn_response.rb +223 -0
  55. data/lib/checkify/models/abn_response_abn_details.rb +165 -0
  56. data/lib/checkify/models/account.rb +277 -0
  57. data/lib/checkify/models/acn_address.rb +173 -0
  58. data/lib/checkify/models/acn_response.rb +244 -0
  59. data/lib/checkify/models/acn_response_abn_details.rb +145 -0
  60. data/lib/checkify/models/acn_response_acn_details.rb +164 -0
  61. data/lib/checkify/models/address_details.rb +324 -0
  62. data/lib/checkify/models/asic_document.rb +192 -0
  63. data/lib/checkify/models/asic_document_contents_inner.rb +154 -0
  64. data/lib/checkify/models/bulk_create_request.rb +213 -0
  65. data/lib/checkify/models/bulk_create_request_items.rb +103 -0
  66. data/lib/checkify/models/bulk_job.rb +215 -0
  67. data/lib/checkify/models/business_activity.rb +166 -0
  68. data/lib/checkify/models/business_activity_response.rb +165 -0
  69. data/lib/checkify/models/director_id_response.rb +174 -0
  70. data/lib/checkify/models/email_response.rb +292 -0
  71. data/lib/checkify/models/email_response_dns.rb +146 -0
  72. data/lib/checkify/models/email_response_format.rb +167 -0
  73. data/lib/checkify/models/error.rb +166 -0
  74. data/lib/checkify/models/former_name.rb +163 -0
  75. data/lib/checkify/models/name_availability.rb +186 -0
  76. data/lib/checkify/models/phone_response.rb +216 -0
  77. data/lib/checkify/models/postcode_result.rb +201 -0
  78. data/lib/checkify/models/reverse_result.rb +237 -0
  79. data/lib/checkify/models/sanctions_response.rb +157 -0
  80. data/lib/checkify/models/sanctions_result.rb +339 -0
  81. data/lib/checkify/models/sanctions_result_sanctions.rb +172 -0
  82. data/lib/checkify/models/suburb_details.rb +207 -0
  83. data/lib/checkify/models/tfn_response.rb +174 -0
  84. data/lib/checkify/version.rb +15 -0
  85. data/lib/checkify.rb +78 -0
  86. data/openapi.yaml +1373 -0
  87. metadata +182 -0
@@ -0,0 +1,305 @@
1
+ =begin
2
+ #Checkify API
3
+
4
+ #Australian and New Zealand address validation, business lookups, identity checks, and communication validation through a single REST interface.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ module Checkify
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
+ # Overrides the access_token if set
67
+ # @return [Proc]
68
+ attr_accessor :access_token_getter
69
+
70
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
72
+ # Default to false.
73
+ attr_accessor :return_binary_data
74
+
75
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
+ # details will be logged with `logger.debug` (see the `logger` attribute).
77
+ # Default to false.
78
+ #
79
+ # @return [true, false]
80
+ attr_accessor :debugging
81
+
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
90
+ # Defines the logger used for debugging.
91
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
92
+ #
93
+ # @return [#debug]
94
+ attr_accessor :logger
95
+
96
+ # Defines the temporary folder to store downloaded files
97
+ # (for API endpoints that have file response).
98
+ # Default to use `Tempfile`.
99
+ #
100
+ # @return [String]
101
+ attr_accessor :temp_folder_path
102
+
103
+ # The time limit for HTTP request in seconds.
104
+ # Default to 30 seconds; set to 0 to disable the timeout.
105
+ attr_accessor :timeout
106
+
107
+ # Set this to false to skip client side validation in the operation.
108
+ # Default to true.
109
+ # @return [true, false]
110
+ attr_accessor :client_side_validation
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
114
+ # Default to true.
115
+ #
116
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
117
+ #
118
+ # @return [true, false]
119
+ attr_accessor :verify_ssl
120
+
121
+ ### TLS/SSL setting
122
+ # Set this to false to skip verifying SSL host name
123
+ # Default to true.
124
+ #
125
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
126
+ #
127
+ # @return [true, false]
128
+ attr_accessor :verify_ssl_host
129
+
130
+ ### TLS/SSL setting
131
+ # Set this to customize the certificate file to verify the peer.
132
+ #
133
+ # @return [String] the path to the certificate file
134
+ #
135
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
136
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
137
+ attr_accessor :ssl_ca_cert
138
+
139
+ ### TLS/SSL setting
140
+ # Client certificate file (for client certificate)
141
+ attr_accessor :cert_file
142
+
143
+ ### TLS/SSL setting
144
+ # Client private key file (for client certificate)
145
+ attr_accessor :key_file
146
+
147
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
148
+ # Default to nil.
149
+ #
150
+ # @see The params_encoding option of Ethon. Related source code:
151
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
152
+ attr_accessor :params_encoding
153
+
154
+
155
+ attr_accessor :inject_format
156
+
157
+ attr_accessor :force_ending_format
158
+
159
+ def initialize
160
+ @scheme = 'https'
161
+ @host = 'checkify.com.au'
162
+ @base_path = '/api/v1'
163
+ @server_index = nil
164
+ @server_operation_index = {}
165
+ @server_variables = {}
166
+ @server_operation_variables = {}
167
+ @api_key = {}
168
+ @api_key_prefix = {}
169
+ @client_side_validation = true
170
+ @verify_ssl = true
171
+ @verify_ssl_host = true
172
+ @cert_file = nil
173
+ @key_file = nil
174
+ @timeout = 30
175
+ @params_encoding = nil
176
+ @debugging = false
177
+ @ignore_operation_servers = false
178
+ @inject_format = false
179
+ @force_ending_format = false
180
+ @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
181
+
182
+ yield(self) if block_given?
183
+ end
184
+
185
+ # The default Configuration object.
186
+ def self.default
187
+ @@default ||= Configuration.new
188
+ end
189
+
190
+ def configure
191
+ yield(self) if block_given?
192
+ end
193
+
194
+ def scheme=(scheme)
195
+ # remove :// from scheme
196
+ @scheme = scheme.sub(/:\/\//, '')
197
+ end
198
+
199
+ def host=(host)
200
+ # remove http(s):// and anything after a slash
201
+ @host = host.sub(/https?:\/\//, '').split('/').first
202
+ end
203
+
204
+ def base_path=(base_path)
205
+ # Add leading and trailing slashes to base_path
206
+ @base_path = "/#{base_path}".gsub(/\/+/, '/')
207
+ @base_path = '' if @base_path == '/'
208
+ end
209
+
210
+ # Returns base URL for specified operation based on server settings
211
+ def base_url(operation = nil)
212
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
213
+ if operation_server_settings.key?(operation) then
214
+ index = server_operation_index.fetch(operation, server_index)
215
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
216
+ else
217
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
218
+ end
219
+ end
220
+
221
+ # Gets API key (with prefix if set).
222
+ # @param [String] param_name the parameter name of API key auth
223
+ def api_key_with_prefix(param_name, param_alias = nil)
224
+ key = @api_key[param_name]
225
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
226
+ if @api_key_prefix[param_name]
227
+ "#{@api_key_prefix[param_name]} #{key}"
228
+ else
229
+ key
230
+ end
231
+ end
232
+
233
+ # Gets access_token using access_token_getter or uses the static access_token
234
+ def access_token_with_refresh
235
+ return access_token if access_token_getter.nil?
236
+ access_token_getter.call
237
+ end
238
+
239
+ # Gets Basic Auth token string
240
+ def basic_auth_token
241
+ 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
242
+ end
243
+
244
+ # Returns Auth Settings hash for api client.
245
+ def auth_settings
246
+ {
247
+ 'BearerAuth' =>
248
+ {
249
+ type: 'bearer',
250
+ in: 'header',
251
+ key: 'Authorization',
252
+ value: "Bearer #{access_token_with_refresh}"
253
+ },
254
+ }
255
+ end
256
+
257
+ # Returns an array of Server setting
258
+ def server_settings
259
+ [
260
+ {
261
+ url: "https://checkify.com.au/api/v1",
262
+ description: "Production",
263
+ }
264
+ ]
265
+ end
266
+
267
+ def operation_server_settings
268
+ {}
269
+ end
270
+
271
+ # Returns URL based on server settings
272
+ #
273
+ # @param index array index of the server settings
274
+ # @param variables hash of variable and the corresponding value
275
+ def server_url(index, variables = {}, servers = nil)
276
+ servers = server_settings if servers == nil
277
+
278
+ # check array index out of bound
279
+ if (index.nil? || index < 0 || index >= servers.size)
280
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
281
+ end
282
+
283
+ server = servers[index]
284
+ url = server[:url]
285
+
286
+ return url unless server.key? :variables
287
+
288
+ # go through variable and assign a value
289
+ server[:variables].each do |name, variable|
290
+ if variables.key?(name)
291
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
292
+ url.gsub! "{" + name.to_s + "}", variables[name]
293
+ else
294
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
295
+ end
296
+ else
297
+ # use default value
298
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
299
+ end
300
+ end
301
+
302
+ url
303
+ end
304
+ end
305
+ end
@@ -0,0 +1,173 @@
1
+ =begin
2
+ #Checkify API
3
+
4
+ #Australian and New Zealand address validation, business lookups, identity checks, and communication validation through a single REST interface.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Checkify
17
+ class AbnAddress < ApiModelBase
18
+ # Address type (e.g. serviceAddress)
19
+ attr_accessor :type
20
+
21
+ attr_accessor :state
22
+
23
+ attr_accessor :postcode
24
+
25
+ attr_accessor :active_from
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'type' => :'type',
31
+ :'state' => :'state',
32
+ :'postcode' => :'postcode',
33
+ :'active_from' => :'activeFrom'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'type' => :'String',
51
+ :'state' => :'String',
52
+ :'postcode' => :'String',
53
+ :'active_from' => :'Date'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Checkify::AbnAddress` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Checkify::AbnAddress`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'type')
80
+ self.type = attributes[:'type']
81
+ end
82
+
83
+ if attributes.key?(:'state')
84
+ self.state = attributes[:'state']
85
+ end
86
+
87
+ if attributes.key?(:'postcode')
88
+ self.postcode = attributes[:'postcode']
89
+ end
90
+
91
+ if attributes.key?(:'active_from')
92
+ self.active_from = attributes[:'active_from']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ type == o.type &&
117
+ state == o.state &&
118
+ postcode == o.postcode &&
119
+ active_from == o.active_from
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [type, state, postcode, active_from].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #Checkify API
3
+
4
+ #Australian and New Zealand address validation, business lookups, identity checks, and communication validation through a single REST interface.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Checkify
17
+ class AbnResponse < ApiModelBase
18
+ attr_accessor :abn
19
+
20
+ attr_accessor :abn_formatted
21
+
22
+ attr_accessor :acn
23
+
24
+ attr_accessor :acn_formatted
25
+
26
+ attr_accessor :entity_name
27
+
28
+ attr_accessor :entity_type
29
+
30
+ attr_accessor :abn_details
31
+
32
+ attr_accessor :addresses
33
+
34
+ attr_accessor :business_names
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'abn' => :'abn',
40
+ :'abn_formatted' => :'abnFormatted',
41
+ :'acn' => :'acn',
42
+ :'acn_formatted' => :'acnFormatted',
43
+ :'entity_name' => :'entityName',
44
+ :'entity_type' => :'entityType',
45
+ :'abn_details' => :'abnDetails',
46
+ :'addresses' => :'addresses',
47
+ :'business_names' => :'businessNames'
48
+ }
49
+ end
50
+
51
+ # Returns attribute mapping this model knows about
52
+ def self.acceptable_attribute_map
53
+ attribute_map
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ acceptable_attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'abn' => :'String',
65
+ :'abn_formatted' => :'String',
66
+ :'acn' => :'String',
67
+ :'acn_formatted' => :'String',
68
+ :'entity_name' => :'String',
69
+ :'entity_type' => :'String',
70
+ :'abn_details' => :'AbnResponseAbnDetails',
71
+ :'addresses' => :'Array<AbnAddress>',
72
+ :'business_names' => :'Array<String>'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ :'acn',
80
+ :'acn_formatted',
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Checkify::AbnResponse` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Checkify::AbnResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'abn')
101
+ self.abn = attributes[:'abn']
102
+ end
103
+
104
+ if attributes.key?(:'abn_formatted')
105
+ self.abn_formatted = attributes[:'abn_formatted']
106
+ end
107
+
108
+ if attributes.key?(:'acn')
109
+ self.acn = attributes[:'acn']
110
+ end
111
+
112
+ if attributes.key?(:'acn_formatted')
113
+ self.acn_formatted = attributes[:'acn_formatted']
114
+ end
115
+
116
+ if attributes.key?(:'entity_name')
117
+ self.entity_name = attributes[:'entity_name']
118
+ end
119
+
120
+ if attributes.key?(:'entity_type')
121
+ self.entity_type = attributes[:'entity_type']
122
+ end
123
+
124
+ if attributes.key?(:'abn_details')
125
+ self.abn_details = attributes[:'abn_details']
126
+ end
127
+
128
+ if attributes.key?(:'addresses')
129
+ if (value = attributes[:'addresses']).is_a?(Array)
130
+ self.addresses = value
131
+ end
132
+ end
133
+
134
+ if attributes.key?(:'business_names')
135
+ if (value = attributes[:'business_names']).is_a?(Array)
136
+ self.business_names = value
137
+ end
138
+ end
139
+ end
140
+
141
+ # Show invalid properties with the reasons. Usually used together with valid?
142
+ # @return Array for valid properties with the reasons
143
+ def list_invalid_properties
144
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
145
+ invalid_properties = Array.new
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ true
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ abn == o.abn &&
162
+ abn_formatted == o.abn_formatted &&
163
+ acn == o.acn &&
164
+ acn_formatted == o.acn_formatted &&
165
+ entity_name == o.entity_name &&
166
+ entity_type == o.entity_type &&
167
+ abn_details == o.abn_details &&
168
+ addresses == o.addresses &&
169
+ business_names == o.business_names
170
+ end
171
+
172
+ # @see the `==` method
173
+ # @param [Object] Object to be compared
174
+ def eql?(o)
175
+ self == o
176
+ end
177
+
178
+ # Calculates hash code according to all attributes.
179
+ # @return [Integer] Hash code
180
+ def hash
181
+ [abn, abn_formatted, acn, acn_formatted, entity_name, entity_type, abn_details, addresses, business_names].hash
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 self.build_from_hash(attributes)
188
+ return nil unless attributes.is_a?(Hash)
189
+ attributes = attributes.transform_keys(&:to_sym)
190
+ transformed_hash = {}
191
+ openapi_types.each_pair do |key, type|
192
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = nil
194
+ elsif type =~ /\AArray<(.*)>/i
195
+ # check to ensure the input is an array given that the attribute
196
+ # is documented as an array but the input is not
197
+ if attributes[attribute_map[key]].is_a?(Array)
198
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
199
+ end
200
+ elsif !attributes[attribute_map[key]].nil?
201
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
202
+ end
203
+ end
204
+ new(transformed_hash)
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+ end
223
+ end