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,213 @@
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 BulkCreateRequest < ApiModelBase
18
+ # Endpoint slug to process
19
+ attr_accessor :endpoint
20
+
21
+ attr_accessor :items
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'endpoint' => :'endpoint',
49
+ :'items' => :'items'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'endpoint' => :'String',
67
+ :'items' => :'BulkCreateRequestItems'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Checkify::BulkCreateRequest` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Checkify::BulkCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'endpoint')
94
+ self.endpoint = attributes[:'endpoint']
95
+ else
96
+ self.endpoint = nil
97
+ end
98
+
99
+ if attributes.key?(:'items')
100
+ self.items = attributes[:'items']
101
+ else
102
+ self.items = nil
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @endpoint.nil?
112
+ invalid_properties.push('invalid value for "endpoint", endpoint cannot be nil.')
113
+ end
114
+
115
+ if @items.nil?
116
+ invalid_properties.push('invalid value for "items", items cannot be nil.')
117
+ end
118
+
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ return false if @endpoint.nil?
127
+ endpoint_validator = EnumAttributeValidator.new('String', ["address-validation", "reverse", "abn", "acn", "sanctions-screening", "tfn", "director-id", "email", "phone"])
128
+ return false unless endpoint_validator.valid?(@endpoint)
129
+ return false if @items.nil?
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method checking allowed values (enum).
134
+ # @param [Object] endpoint Object to be assigned
135
+ def endpoint=(endpoint)
136
+ validator = EnumAttributeValidator.new('String', ["address-validation", "reverse", "abn", "acn", "sanctions-screening", "tfn", "director-id", "email", "phone"])
137
+ unless validator.valid?(endpoint)
138
+ fail ArgumentError, "invalid value for \"endpoint\", must be one of #{validator.allowable_values}."
139
+ end
140
+ @endpoint = endpoint
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] items Value to be assigned
145
+ def items=(items)
146
+ if items.nil?
147
+ fail ArgumentError, 'items cannot be nil'
148
+ end
149
+
150
+ @items = items
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ endpoint == o.endpoint &&
159
+ items == o.items
160
+ end
161
+
162
+ # @see the `==` method
163
+ # @param [Object] Object to be compared
164
+ def eql?(o)
165
+ self == o
166
+ end
167
+
168
+ # Calculates hash code according to all attributes.
169
+ # @return [Integer] Hash code
170
+ def hash
171
+ [endpoint, items].hash
172
+ end
173
+
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ return nil unless attributes.is_a?(Hash)
179
+ attributes = attributes.transform_keys(&:to_sym)
180
+ transformed_hash = {}
181
+ openapi_types.each_pair do |key, type|
182
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
183
+ transformed_hash["#{key}"] = nil
184
+ elsif type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[attribute_map[key]].is_a?(Array)
188
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
189
+ end
190
+ elsif !attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
192
+ end
193
+ end
194
+ new(transformed_hash)
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = self.send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+ end
213
+ end
@@ -0,0 +1,103 @@
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
+ module BulkCreateRequestItems
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Array<Object>',
23
+ :'Array<String>'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ return find_and_cast_into_type(klass, data)
42
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
43
+ end
44
+ end
45
+
46
+ openapi_one_of.include?(:AnyType) ? data : nil
47
+ end
48
+
49
+ private
50
+
51
+ SchemaMismatchError = Class.new(StandardError)
52
+
53
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
54
+ def find_and_cast_into_type(klass, data)
55
+ return if data.nil?
56
+
57
+ case klass.to_s
58
+ when 'Boolean'
59
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
60
+ when 'Float'
61
+ return data if data.instance_of?(Float)
62
+ when 'Integer'
63
+ return data if data.instance_of?(Integer)
64
+ when 'Time'
65
+ return Time.parse(data)
66
+ when 'Date'
67
+ return Date.iso8601(data)
68
+ when 'String'
69
+ return data if data.instance_of?(String)
70
+ when 'Object' # "type: object"
71
+ return data if data.instance_of?(Hash)
72
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
73
+ if data.instance_of?(Array)
74
+ sub_type = Regexp.last_match[:sub_type]
75
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
76
+ end
77
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
78
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
79
+ sub_type = Regexp.last_match[:sub_type]
80
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
81
+ end
82
+ else # model
83
+ const = Checkify.const_get(klass)
84
+ if const
85
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
86
+ model = const.build(data)
87
+ return model if model
88
+ else
89
+ # raise if data contains keys that are not known to the model
90
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
91
+ model = const.build_from_hash(data)
92
+ return model if model
93
+ end
94
+ end
95
+ end
96
+
97
+ raise # if no match by now, raise
98
+ rescue
99
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,215 @@
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 BulkJob < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :endpoint
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :total_rows
25
+
26
+ attr_accessor :created_at
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'id' => :'id',
54
+ :'endpoint' => :'endpoint',
55
+ :'status' => :'status',
56
+ :'total_rows' => :'total_rows',
57
+ :'created_at' => :'created_at'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'id' => :'Integer',
75
+ :'endpoint' => :'String',
76
+ :'status' => :'String',
77
+ :'total_rows' => :'Integer',
78
+ :'created_at' => :'Time'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Checkify::BulkJob` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ acceptable_attribute_map = self.class.acceptable_attribute_map
97
+ attributes = attributes.each_with_object({}) { |(k, v), h|
98
+ if (!acceptable_attribute_map.key?(k.to_sym))
99
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Checkify::BulkJob`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
100
+ end
101
+ h[k.to_sym] = v
102
+ }
103
+
104
+ if attributes.key?(:'id')
105
+ self.id = attributes[:'id']
106
+ end
107
+
108
+ if attributes.key?(:'endpoint')
109
+ self.endpoint = attributes[:'endpoint']
110
+ end
111
+
112
+ if attributes.key?(:'status')
113
+ self.status = attributes[:'status']
114
+ end
115
+
116
+ if attributes.key?(:'total_rows')
117
+ self.total_rows = attributes[:'total_rows']
118
+ end
119
+
120
+ if attributes.key?(:'created_at')
121
+ self.created_at = attributes[:'created_at']
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ invalid_properties
131
+ end
132
+
133
+ # Check to see if the all the properties in the model are valid
134
+ # @return true if the model is valid
135
+ def valid?
136
+ warn '[DEPRECATED] the `valid?` method is obsolete'
137
+ status_validator = EnumAttributeValidator.new('String', ["pending", "processing", "completed", "failed"])
138
+ return false unless status_validator.valid?(@status)
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] status Object to be assigned
144
+ def status=(status)
145
+ validator = EnumAttributeValidator.new('String', ["pending", "processing", "completed", "failed"])
146
+ unless validator.valid?(status)
147
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @status = status
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ id == o.id &&
158
+ endpoint == o.endpoint &&
159
+ status == o.status &&
160
+ total_rows == o.total_rows &&
161
+ created_at == o.created_at
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [id, endpoint, status, total_rows, created_at].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ return nil unless attributes.is_a?(Hash)
181
+ attributes = attributes.transform_keys(&:to_sym)
182
+ transformed_hash = {}
183
+ openapi_types.each_pair do |key, type|
184
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
185
+ transformed_hash["#{key}"] = nil
186
+ elsif type =~ /\AArray<(.*)>/i
187
+ # check to ensure the input is an array given that the attribute
188
+ # is documented as an array but the input is not
189
+ if attributes[attribute_map[key]].is_a?(Array)
190
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
191
+ end
192
+ elsif !attributes[attribute_map[key]].nil?
193
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
194
+ end
195
+ end
196
+ new(transformed_hash)
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ if value.nil?
206
+ is_nullable = self.class.openapi_nullable.include?(attr)
207
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
208
+ end
209
+
210
+ hash[param] = _to_hash(value)
211
+ end
212
+ hash
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,166 @@
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 BusinessActivity < ApiModelBase
18
+ # Unique activity identifier
19
+ attr_accessor :code
20
+
21
+ # ANZSIC industry classification code
22
+ attr_accessor :industry_code
23
+
24
+ # Business activity description
25
+ attr_accessor :full_name
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'code' => :'code',
31
+ :'industry_code' => :'industryCode',
32
+ :'full_name' => :'fullName'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'code' => :'String',
50
+ :'industry_code' => :'String',
51
+ :'full_name' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Checkify::BusinessActivity` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Checkify::BusinessActivity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'code')
78
+ self.code = attributes[:'code']
79
+ end
80
+
81
+ if attributes.key?(:'industry_code')
82
+ self.industry_code = attributes[:'industry_code']
83
+ end
84
+
85
+ if attributes.key?(:'full_name')
86
+ self.full_name = attributes[:'full_name']
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ code == o.code &&
111
+ industry_code == o.industry_code &&
112
+ full_name == o.full_name
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [code, industry_code, full_name].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+ end
166
+ end