trinsic_api 3.1.0.pre.preview1 → 3.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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AgeOverOutput.md +20 -0
  3. data/docs/AppleWalletProviderOutput.md +2 -0
  4. data/docs/EudiAgeVerificationCredential.md +22 -0
  5. data/docs/EudiPidCredential.md +70 -0
  6. data/docs/FranceIdentiteProviderOutput.md +4 -0
  7. data/docs/GoogleWalletIdPassCredential.md +40 -0
  8. data/docs/GoogleWalletProviderOutput.md +4 -0
  9. data/docs/Iso180132BiometricDataBlockProduct.md +20 -0
  10. data/docs/Iso180132BiometricGroupTemplate.md +18 -0
  11. data/docs/Iso180132BiometricTemplate.md +24 -0
  12. data/docs/Iso180132BiometricTemplateHeader.md +36 -0
  13. data/docs/Iso180132BiometricValidityPeriod.md +20 -0
  14. data/docs/Iso180135AamvaDomesticDrivingPrivilege.md +22 -0
  15. data/docs/Iso180135AamvaDomesticVehicleClass.md +24 -0
  16. data/docs/Iso180135AamvaDomesticVehicleEndorsement.md +20 -0
  17. data/docs/Iso180135AamvaDomesticVehicleRestriction.md +20 -0
  18. data/docs/Iso180135AamvaNamespaceOutput.md +70 -0
  19. data/docs/Iso180135AamvaWeightRange.md +20 -0
  20. data/docs/Iso180135DrivingPrivilege.md +24 -0
  21. data/docs/Iso180135DrivingPrivilegeCode.md +22 -0
  22. data/docs/Iso180135MobileDriversLicenseCredential.md +20 -0
  23. data/docs/Iso180135StandardNamespaceOutput.md +86 -0
  24. data/docs/SamsungWalletProviderOutput.md +2 -0
  25. data/lib/trinsic_api/models/age_over_output.rb +193 -0
  26. data/lib/trinsic_api/models/apple_wallet_provider_output.rb +12 -1
  27. data/lib/trinsic_api/models/eudi_age_verification_credential.rb +174 -0
  28. data/lib/trinsic_api/models/eudi_pid_credential.rb +438 -0
  29. data/lib/trinsic_api/models/france_identite_provider_output.rb +23 -1
  30. data/lib/trinsic_api/models/google_wallet_id_pass_credential.rb +273 -0
  31. data/lib/trinsic_api/models/google_wallet_provider_output.rb +23 -1
  32. data/lib/trinsic_api/models/iso180132_biometric_data_block_product.rb +193 -0
  33. data/lib/trinsic_api/models/iso180132_biometric_group_template.rb +168 -0
  34. data/lib/trinsic_api/models/iso180132_biometric_template.rb +231 -0
  35. data/lib/trinsic_api/models/iso180132_biometric_template_header.rb +297 -0
  36. data/lib/trinsic_api/models/iso180132_biometric_validity_period.rb +193 -0
  37. data/lib/trinsic_api/models/iso180135_aamva_domestic_driving_privilege.rb +176 -0
  38. data/lib/trinsic_api/models/iso180135_aamva_domestic_vehicle_class.rb +215 -0
  39. data/lib/trinsic_api/models/iso180135_aamva_domestic_vehicle_endorsement.rb +177 -0
  40. data/lib/trinsic_api/models/iso180135_aamva_domestic_vehicle_restriction.rb +177 -0
  41. data/lib/trinsic_api/models/iso180135_aamva_namespace_output.rb +438 -0
  42. data/lib/trinsic_api/models/iso180135_aamva_weight_range.rb +177 -0
  43. data/lib/trinsic_api/models/iso180135_driving_privilege.rb +201 -0
  44. data/lib/trinsic_api/models/iso180135_driving_privilege_code.rb +188 -0
  45. data/lib/trinsic_api/models/iso180135_mobile_drivers_license_credential.rb +161 -0
  46. data/lib/trinsic_api/models/iso180135_standard_namespace_output.rb +528 -0
  47. data/lib/trinsic_api/models/samsung_wallet_provider_output.rb +12 -1
  48. data/lib/trinsic_api/version.rb +1 -1
  49. data/lib/trinsic_api.rb +19 -0
  50. data/spec/models/age_over_output_spec.rb +42 -0
  51. data/spec/models/apple_wallet_provider_output_spec.rb +6 -0
  52. data/spec/models/eudi_age_verification_credential_spec.rb +48 -0
  53. data/spec/models/eudi_pid_credential_spec.rb +192 -0
  54. data/spec/models/france_identite_provider_output_spec.rb +12 -0
  55. data/spec/models/google_wallet_id_pass_credential_spec.rb +102 -0
  56. data/spec/models/google_wallet_provider_output_spec.rb +12 -0
  57. data/spec/models/iso180132_biometric_data_block_product_spec.rb +42 -0
  58. data/spec/models/iso180132_biometric_group_template_spec.rb +36 -0
  59. data/spec/models/iso180132_biometric_template_header_spec.rb +90 -0
  60. data/spec/models/iso180132_biometric_template_spec.rb +54 -0
  61. data/spec/models/iso180132_biometric_validity_period_spec.rb +42 -0
  62. data/spec/models/iso180135_aamva_domestic_driving_privilege_spec.rb +48 -0
  63. data/spec/models/iso180135_aamva_domestic_vehicle_class_spec.rb +54 -0
  64. data/spec/models/iso180135_aamva_domestic_vehicle_endorsement_spec.rb +42 -0
  65. data/spec/models/iso180135_aamva_domestic_vehicle_restriction_spec.rb +42 -0
  66. data/spec/models/iso180135_aamva_namespace_output_spec.rb +192 -0
  67. data/spec/models/iso180135_aamva_weight_range_spec.rb +42 -0
  68. data/spec/models/iso180135_driving_privilege_code_spec.rb +48 -0
  69. data/spec/models/iso180135_driving_privilege_spec.rb +54 -0
  70. data/spec/models/iso180135_mobile_drivers_license_credential_spec.rb +42 -0
  71. data/spec/models/iso180135_standard_namespace_output_spec.rb +240 -0
  72. data/spec/models/samsung_wallet_provider_output_spec.rb +6 -0
  73. metadata +78 -2
@@ -0,0 +1,193 @@
1
+ =begin
2
+ #Trinsic API
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
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # Validity period of a biometric data block.
18
+ class Iso180132BiometricValidityPeriod < ApiModelBase
19
+ # Date the biometric data block becomes valid.
20
+ attr_accessor :not_before
21
+
22
+ # Date the biometric data block expires.
23
+ attr_accessor :not_after
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'not_before' => :'notBefore',
29
+ :'not_after' => :'notAfter'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'not_before' => :'Date',
47
+ :'not_after' => :'Date'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::Iso180132BiometricValidityPeriod` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::Iso180132BiometricValidityPeriod`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'not_before')
74
+ self.not_before = attributes[:'not_before']
75
+ else
76
+ self.not_before = nil
77
+ end
78
+
79
+ if attributes.key?(:'not_after')
80
+ self.not_after = attributes[:'not_after']
81
+ else
82
+ self.not_after = nil
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @not_before.nil?
92
+ invalid_properties.push('invalid value for "not_before", not_before cannot be nil.')
93
+ end
94
+
95
+ if @not_after.nil?
96
+ invalid_properties.push('invalid value for "not_after", not_after cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ warn '[DEPRECATED] the `valid?` method is obsolete'
106
+ return false if @not_before.nil?
107
+ return false if @not_after.nil?
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] not_before Value to be assigned
113
+ def not_before=(not_before)
114
+ if not_before.nil?
115
+ fail ArgumentError, 'not_before cannot be nil'
116
+ end
117
+
118
+ @not_before = not_before
119
+ end
120
+
121
+ # Custom attribute writer method with validation
122
+ # @param [Object] not_after Value to be assigned
123
+ def not_after=(not_after)
124
+ if not_after.nil?
125
+ fail ArgumentError, 'not_after cannot be nil'
126
+ end
127
+
128
+ @not_after = not_after
129
+ end
130
+
131
+ # Checks equality by comparing each attribute.
132
+ # @param [Object] Object to be compared
133
+ def ==(o)
134
+ return true if self.equal?(o)
135
+ self.class == o.class &&
136
+ not_before == o.not_before &&
137
+ not_after == o.not_after
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Integer] Hash code
148
+ def hash
149
+ [not_before, not_after].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def self.build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ transformed_hash = {}
159
+ openapi_types.each_pair do |key, type|
160
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
161
+ transformed_hash["#{key}"] = nil
162
+ elsif type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[attribute_map[key]].is_a?(Array)
166
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
167
+ end
168
+ elsif !attributes[attribute_map[key]].nil?
169
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
170
+ end
171
+ end
172
+ new(transformed_hash)
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ if value.nil?
182
+ is_nullable = self.class.openapi_nullable.include?(attr)
183
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
184
+ end
185
+
186
+ hash[param] = _to_hash(value)
187
+ end
188
+ hash
189
+ end
190
+
191
+ end
192
+
193
+ end
@@ -0,0 +1,176 @@
1
+ =begin
2
+ #Trinsic API
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
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # A single domestic driving privilege from the AAMVA `domestic_driving_privileges` field, per AAMVA Section 7.2.4.
18
+ class Iso180135AamvaDomesticDrivingPrivilege < ApiModelBase
19
+ # Vehicle class describing the category of vehicle the holder is authorized to operate.
20
+ attr_accessor :vehicle_class
21
+
22
+ # Restrictions attached to this domestic driving privilege.
23
+ attr_accessor :vehicle_restrictions
24
+
25
+ # Endorsements attached to this domestic driving privilege.
26
+ attr_accessor :vehicle_endorsements
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'vehicle_class' => :'vehicleClass',
32
+ :'vehicle_restrictions' => :'vehicleRestrictions',
33
+ :'vehicle_endorsements' => :'vehicleEndorsements'
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
+ :'vehicle_class' => :'Iso180135AamvaDomesticVehicleClass',
51
+ :'vehicle_restrictions' => :'Array<Iso180135AamvaDomesticVehicleRestriction>',
52
+ :'vehicle_endorsements' => :'Array<Iso180135AamvaDomesticVehicleEndorsement>'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ :'vehicle_class',
60
+ :'vehicle_restrictions',
61
+ :'vehicle_endorsements'
62
+ ])
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ if (!attributes.is_a?(Hash))
69
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::Iso180135AamvaDomesticDrivingPrivilege` initialize method"
70
+ end
71
+
72
+ # check to see if the attribute exists and convert string to symbol for hash key
73
+ acceptable_attribute_map = self.class.acceptable_attribute_map
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!acceptable_attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::Iso180135AamvaDomesticDrivingPrivilege`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'vehicle_class')
82
+ self.vehicle_class = attributes[:'vehicle_class']
83
+ end
84
+
85
+ if attributes.key?(:'vehicle_restrictions')
86
+ if (value = attributes[:'vehicle_restrictions']).is_a?(Array)
87
+ self.vehicle_restrictions = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'vehicle_endorsements')
92
+ if (value = attributes[:'vehicle_endorsements']).is_a?(Array)
93
+ self.vehicle_endorsements = value
94
+ end
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ warn '[DEPRECATED] the `valid?` method is obsolete'
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ vehicle_class == o.vehicle_class &&
119
+ vehicle_restrictions == o.vehicle_restrictions &&
120
+ vehicle_endorsements == o.vehicle_endorsements
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [vehicle_class, vehicle_restrictions, vehicle_endorsements].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ attributes = attributes.transform_keys(&:to_sym)
141
+ transformed_hash = {}
142
+ openapi_types.each_pair do |key, type|
143
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = nil
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[attribute_map[key]].is_a?(Array)
149
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
150
+ end
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = self.send(attr)
164
+ if value.nil?
165
+ is_nullable = self.class.openapi_nullable.include?(attr)
166
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
167
+ end
168
+
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ end
175
+
176
+ end
@@ -0,0 +1,215 @@
1
+ =begin
2
+ #Trinsic API
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
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # Vehicle class for a domestic driving privilege.
18
+ class Iso180135AamvaDomesticVehicleClass < ApiModelBase
19
+ # Vehicle class code.
20
+ attr_accessor :code
21
+
22
+ # Human-readable description of the vehicle class.
23
+ attr_accessor :description
24
+
25
+ # Date when this vehicle class privilege was issued.
26
+ attr_accessor :issue_date
27
+
28
+ # Date when this vehicle class privilege expires.
29
+ attr_accessor :expiry_date
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'code' => :'code',
35
+ :'description' => :'description',
36
+ :'issue_date' => :'issueDate',
37
+ :'expiry_date' => :'expiryDate'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'code' => :'String',
55
+ :'description' => :'String',
56
+ :'issue_date' => :'Date',
57
+ :'expiry_date' => :'Date'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ :'issue_date',
65
+ :'expiry_date'
66
+ ])
67
+ end
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ def initialize(attributes = {})
72
+ if (!attributes.is_a?(Hash))
73
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::Iso180135AamvaDomesticVehicleClass` initialize method"
74
+ end
75
+
76
+ # check to see if the attribute exists and convert string to symbol for hash key
77
+ acceptable_attribute_map = self.class.acceptable_attribute_map
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!acceptable_attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::Iso180135AamvaDomesticVehicleClass`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'code')
86
+ self.code = attributes[:'code']
87
+ else
88
+ self.code = nil
89
+ end
90
+
91
+ if attributes.key?(:'description')
92
+ self.description = attributes[:'description']
93
+ else
94
+ self.description = nil
95
+ end
96
+
97
+ if attributes.key?(:'issue_date')
98
+ self.issue_date = attributes[:'issue_date']
99
+ end
100
+
101
+ if attributes.key?(:'expiry_date')
102
+ self.expiry_date = attributes[:'expiry_date']
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 @code.nil?
112
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
113
+ end
114
+
115
+ if @description.nil?
116
+ invalid_properties.push('invalid value for "description", description 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 @code.nil?
127
+ return false if @description.nil?
128
+ true
129
+ end
130
+
131
+ # Custom attribute writer method with validation
132
+ # @param [Object] code Value to be assigned
133
+ def code=(code)
134
+ if code.nil?
135
+ fail ArgumentError, 'code cannot be nil'
136
+ end
137
+
138
+ @code = code
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] description Value to be assigned
143
+ def description=(description)
144
+ if description.nil?
145
+ fail ArgumentError, 'description cannot be nil'
146
+ end
147
+
148
+ @description = description
149
+ end
150
+
151
+ # Checks equality by comparing each attribute.
152
+ # @param [Object] Object to be compared
153
+ def ==(o)
154
+ return true if self.equal?(o)
155
+ self.class == o.class &&
156
+ code == o.code &&
157
+ description == o.description &&
158
+ issue_date == o.issue_date &&
159
+ expiry_date == o.expiry_date
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
+ [code, description, issue_date, expiry_date].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
+
213
+ end
214
+
215
+ end