trinsic_api 2.1.1.pre.alpha2 → 2.2.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AppleWalletInput.md +18 -0
  3. data/docs/AttachmentsApi.md +1 -1
  4. data/docs/{CreateAdvancedProviderSessionRequest.md → CreateDirectProviderSessionRequest.md} +5 -3
  5. data/docs/{CreateAdvancedProviderSessionResponse.md → CreateDirectProviderSessionResponse.md} +2 -2
  6. data/docs/CreateHostedProviderSessionRequest.md +3 -1
  7. data/docs/CreateMdlExchangeRequest.md +32 -0
  8. data/docs/CreateMdlExchangeResponse.md +22 -0
  9. data/docs/CreateWidgetSessionRequest.md +3 -1
  10. data/docs/ExternalMdlFieldData.md +20 -0
  11. data/docs/FinalizeMdlExchangeRequest.md +24 -0
  12. data/docs/FinalizeMdlExchangeResponse.md +24 -0
  13. data/docs/GetAttachmentRequest.md +3 -1
  14. data/docs/GoogleWalletInput.md +18 -0
  15. data/docs/MdlApi.md +151 -0
  16. data/docs/MdlCertificateData.md +26 -0
  17. data/docs/MdlExchangeMechanism.md +15 -0
  18. data/docs/MdlFieldDataType.md +15 -0
  19. data/docs/MdlIdentityData.md +22 -0
  20. data/docs/NetworkApi.md +17 -12
  21. data/docs/ProviderContract.md +7 -5
  22. data/docs/ProviderInput.md +4 -0
  23. data/docs/RecommendRequest.md +2 -0
  24. data/docs/SessionsApi.md +110 -34
  25. data/docs/SubmitNativeChallengeResponseRequest.md +20 -0
  26. data/docs/SubmitNativeChallengeResponseResponse.md +18 -0
  27. data/lib/trinsic_api/api/mdl_api.rb +150 -0
  28. data/lib/trinsic_api/api/network_api.rb +20 -8
  29. data/lib/trinsic_api/api/sessions_api.rb +108 -32
  30. data/lib/trinsic_api/models/apple_wallet_input.rb +244 -0
  31. data/lib/trinsic_api/models/{create_advanced_provider_session_request.rb → create_direct_provider_session_request.rb} +32 -5
  32. data/lib/trinsic_api/models/{create_advanced_provider_session_response.rb → create_direct_provider_session_response.rb} +3 -3
  33. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +29 -2
  34. data/lib/trinsic_api/models/create_mdl_exchange_request.rb +404 -0
  35. data/lib/trinsic_api/models/create_mdl_exchange_response.rb +292 -0
  36. data/lib/trinsic_api/models/create_widget_session_request.rb +29 -2
  37. data/lib/trinsic_api/models/external_mdl_field_data.rb +287 -0
  38. data/lib/trinsic_api/models/finalize_mdl_exchange_request.rb +319 -0
  39. data/lib/trinsic_api/models/finalize_mdl_exchange_response.rb +287 -0
  40. data/lib/trinsic_api/models/get_attachment_request.rb +31 -4
  41. data/lib/trinsic_api/models/google_wallet_input.rb +244 -0
  42. data/lib/trinsic_api/models/integration_capability.rb +2 -1
  43. data/lib/trinsic_api/models/integration_launch_method.rb +2 -1
  44. data/lib/trinsic_api/models/integration_step.rb +1 -1
  45. data/lib/trinsic_api/models/mdl_certificate_data.rb +346 -0
  46. data/lib/trinsic_api/models/mdl_exchange_mechanism.rb +40 -0
  47. data/lib/trinsic_api/models/mdl_field_data_type.rb +43 -0
  48. data/lib/trinsic_api/models/mdl_identity_data.rb +294 -0
  49. data/lib/trinsic_api/models/provider_contract.rb +33 -6
  50. data/lib/trinsic_api/models/provider_input.rb +23 -1
  51. data/lib/trinsic_api/models/recommend_request.rb +28 -1
  52. data/lib/trinsic_api/models/result_collection_method.rb +2 -1
  53. data/lib/trinsic_api/models/session_error_code.rb +3 -1
  54. data/lib/trinsic_api/models/submit_native_challenge_response_request.rb +283 -0
  55. data/lib/trinsic_api/models/submit_native_challenge_response_response.rb +238 -0
  56. data/lib/trinsic_api/version.rb +1 -1
  57. data/lib/trinsic_api.rb +16 -2
  58. data/spec/api/mdl_api_spec.rb +59 -0
  59. data/spec/api/network_api_spec.rb +2 -0
  60. data/spec/api/sessions_api_spec.rb +22 -8
  61. data/spec/models/apple_wallet_input_spec.rb +36 -0
  62. data/spec/models/{create_advanced_provider_session_request_spec.rb → create_direct_provider_session_request_spec.rb} +12 -6
  63. data/spec/models/{create_advanced_provider_session_response_spec.rb → create_direct_provider_session_response_spec.rb} +6 -6
  64. data/spec/models/create_hosted_provider_session_request_spec.rb +6 -0
  65. data/spec/models/create_mdl_exchange_request_spec.rb +78 -0
  66. data/spec/models/create_mdl_exchange_response_spec.rb +48 -0
  67. data/spec/models/create_widget_session_request_spec.rb +6 -0
  68. data/spec/models/external_mdl_field_data_spec.rb +42 -0
  69. data/spec/models/finalize_mdl_exchange_request_spec.rb +54 -0
  70. data/spec/models/finalize_mdl_exchange_response_spec.rb +54 -0
  71. data/spec/models/get_attachment_request_spec.rb +6 -0
  72. data/spec/models/google_wallet_input_spec.rb +36 -0
  73. data/spec/models/mdl_certificate_data_spec.rb +60 -0
  74. data/spec/models/mdl_exchange_mechanism_spec.rb +30 -0
  75. data/spec/models/mdl_field_data_type_spec.rb +30 -0
  76. data/spec/models/mdl_identity_data_spec.rb +48 -0
  77. data/spec/models/provider_contract_spec.rb +6 -0
  78. data/spec/models/provider_input_spec.rb +12 -0
  79. data/spec/models/recommend_request_spec.rb +6 -0
  80. data/spec/models/submit_native_challenge_response_request_spec.rb +42 -0
  81. data/spec/models/submit_native_challenge_response_response_spec.rb +36 -0
  82. metadata +124 -68
@@ -0,0 +1,244 @@
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.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class GoogleWalletInput
18
+ # The exchange mechanism to use for this Google Wallet verification. Use `DigitalCredentialsApi` for Digital Credentials API on web, or `NativeApp` for a native Android app.
19
+ attr_accessor :exchange_mechanism
20
+
21
+ class EnumAttributeValidator
22
+ attr_reader :datatype
23
+ attr_reader :allowable_values
24
+
25
+ def initialize(datatype, allowable_values)
26
+ @allowable_values = allowable_values.map do |value|
27
+ case datatype.to_s
28
+ when /Integer/i
29
+ value.to_i
30
+ when /Float/i
31
+ value.to_f
32
+ else
33
+ value
34
+ end
35
+ end
36
+ end
37
+
38
+ def valid?(value)
39
+ !value || allowable_values.include?(value)
40
+ end
41
+ end
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'exchange_mechanism' => :'exchangeMechanism'
47
+ }
48
+ end
49
+
50
+ # Returns attribute mapping this model knows about
51
+ def self.acceptable_attribute_map
52
+ attribute_map
53
+ end
54
+
55
+ # Returns all the JSON keys this model knows about
56
+ def self.acceptable_attributes
57
+ acceptable_attribute_map.values
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'exchange_mechanism' => :'MdlExchangeMechanism'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ :'exchange_mechanism'
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::GoogleWalletInput` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::GoogleWalletInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'exchange_mechanism')
91
+ self.exchange_mechanism = attributes[:'exchange_mechanism']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ warn '[DEPRECATED] the `valid?` method is obsolete'
107
+ true
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ exchange_mechanism == o.exchange_mechanism
116
+ end
117
+
118
+ # @see the `==` method
119
+ # @param [Object] Object to be compared
120
+ def eql?(o)
121
+ self == o
122
+ end
123
+
124
+ # Calculates hash code according to all attributes.
125
+ # @return [Integer] Hash code
126
+ def hash
127
+ [exchange_mechanism].hash
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def self.build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ attributes = attributes.transform_keys(&:to_sym)
136
+ transformed_hash = {}
137
+ openapi_types.each_pair do |key, type|
138
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
139
+ transformed_hash["#{key}"] = nil
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[attribute_map[key]].is_a?(Array)
144
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
145
+ end
146
+ elsif !attributes[attribute_map[key]].nil?
147
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
148
+ end
149
+ end
150
+ new(transformed_hash)
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def self._deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = TrinsicApi.const_get(type)
192
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -22,9 +22,10 @@ module TrinsicApi
22
22
  CAPTURE_REDIRECT = "CaptureRedirect".freeze
23
23
  POLL_RESULT = "PollResult".freeze
24
24
  POLL_AFTER_REDIRECT = "PollAfterRedirect".freeze
25
+ NATIVE_CHALLENGE = "NativeChallenge".freeze
25
26
 
26
27
  def self.all_vars
27
- @all_vars ||= [LAUNCH_BROWSER, DEEPLINK_TO_MOBILE, SHOW_CONTENT, REFRESH_STEP_CONTENT, CAPTURE_REDIRECT, POLL_RESULT, POLL_AFTER_REDIRECT].freeze
28
+ @all_vars ||= [LAUNCH_BROWSER, DEEPLINK_TO_MOBILE, SHOW_CONTENT, REFRESH_STEP_CONTENT, CAPTURE_REDIRECT, POLL_RESULT, POLL_AFTER_REDIRECT, NATIVE_CHALLENGE].freeze
28
29
  end
29
30
 
30
31
  # Builds the enum from string
@@ -19,9 +19,10 @@ module TrinsicApi
19
19
  NONE = "None".freeze
20
20
  DEEPLINK_TO_MOBILE = "DeeplinkToMobile".freeze
21
21
  SHOW_CONTENT = "ShowContent".freeze
22
+ PERFORM_NATIVE_CHALLENGE = "PerformNativeChallenge".freeze
22
23
 
23
24
  def self.all_vars
24
- @all_vars ||= [LAUNCH_BROWSER, NONE, DEEPLINK_TO_MOBILE, SHOW_CONTENT].freeze
25
+ @all_vars ||= [LAUNCH_BROWSER, NONE, DEEPLINK_TO_MOBILE, SHOW_CONTENT, PERFORM_NATIVE_CHALLENGE].freeze
25
26
  end
26
27
 
27
28
  # Builds the enum from string
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TrinsicApi
17
- # A step to perform in the process of executing an Advanced Provider Session
17
+ # A step to perform in the process of executing an Direct Provider Session
18
18
  class IntegrationStep
19
19
  # The launch method to perform
20
20
  attr_accessor :method
@@ -0,0 +1,346 @@
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.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class MdlCertificateData
18
+ # The serial number of the certificate
19
+ attr_accessor :serial_number
20
+
21
+ # The common name (CN) of the certificate
22
+ attr_accessor :common_name
23
+
24
+ # The state or province name (ST) of the certificate. May be an empty string for certificates which are not state-specific (e.g., Google Wallet's ID Pass certificates).
25
+ attr_accessor :state_or_province_name
26
+
27
+ # The date before which this certificate is not valid.
28
+ attr_accessor :not_before
29
+
30
+ # The date after which this certificate is not valid.
31
+ attr_accessor :not_after
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'serial_number' => :'serialNumber',
37
+ :'common_name' => :'commonName',
38
+ :'state_or_province_name' => :'stateOrProvinceName',
39
+ :'not_before' => :'notBefore',
40
+ :'not_after' => :'notAfter'
41
+ }
42
+ end
43
+
44
+ # Returns attribute mapping this model knows about
45
+ def self.acceptable_attribute_map
46
+ attribute_map
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ acceptable_attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'serial_number' => :'String',
58
+ :'common_name' => :'String',
59
+ :'state_or_province_name' => :'String',
60
+ :'not_before' => :'Time',
61
+ :'not_after' => :'Time'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::MdlCertificateData` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::MdlCertificateData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'serial_number')
88
+ self.serial_number = attributes[:'serial_number']
89
+ else
90
+ self.serial_number = nil
91
+ end
92
+
93
+ if attributes.key?(:'common_name')
94
+ self.common_name = attributes[:'common_name']
95
+ else
96
+ self.common_name = nil
97
+ end
98
+
99
+ if attributes.key?(:'state_or_province_name')
100
+ self.state_or_province_name = attributes[:'state_or_province_name']
101
+ else
102
+ self.state_or_province_name = nil
103
+ end
104
+
105
+ if attributes.key?(:'not_before')
106
+ self.not_before = attributes[:'not_before']
107
+ else
108
+ self.not_before = nil
109
+ end
110
+
111
+ if attributes.key?(:'not_after')
112
+ self.not_after = attributes[:'not_after']
113
+ else
114
+ self.not_after = nil
115
+ end
116
+ end
117
+
118
+ # Show invalid properties with the reasons. Usually used together with valid?
119
+ # @return Array for valid properties with the reasons
120
+ def list_invalid_properties
121
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
+ invalid_properties = Array.new
123
+ if @serial_number.nil?
124
+ invalid_properties.push('invalid value for "serial_number", serial_number cannot be nil.')
125
+ end
126
+
127
+ if @common_name.nil?
128
+ invalid_properties.push('invalid value for "common_name", common_name cannot be nil.')
129
+ end
130
+
131
+ if @state_or_province_name.nil?
132
+ invalid_properties.push('invalid value for "state_or_province_name", state_or_province_name cannot be nil.')
133
+ end
134
+
135
+ if @not_before.nil?
136
+ invalid_properties.push('invalid value for "not_before", not_before cannot be nil.')
137
+ end
138
+
139
+ if @not_after.nil?
140
+ invalid_properties.push('invalid value for "not_after", not_after cannot be nil.')
141
+ end
142
+
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ return false if @serial_number.nil?
151
+ return false if @common_name.nil?
152
+ return false if @state_or_province_name.nil?
153
+ return false if @not_before.nil?
154
+ return false if @not_after.nil?
155
+ true
156
+ end
157
+
158
+ # Custom attribute writer method with validation
159
+ # @param [Object] serial_number Value to be assigned
160
+ def serial_number=(serial_number)
161
+ if serial_number.nil?
162
+ fail ArgumentError, 'serial_number cannot be nil'
163
+ end
164
+
165
+ @serial_number = serial_number
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] common_name Value to be assigned
170
+ def common_name=(common_name)
171
+ if common_name.nil?
172
+ fail ArgumentError, 'common_name cannot be nil'
173
+ end
174
+
175
+ @common_name = common_name
176
+ end
177
+
178
+ # Custom attribute writer method with validation
179
+ # @param [Object] state_or_province_name Value to be assigned
180
+ def state_or_province_name=(state_or_province_name)
181
+ if state_or_province_name.nil?
182
+ fail ArgumentError, 'state_or_province_name cannot be nil'
183
+ end
184
+
185
+ @state_or_province_name = state_or_province_name
186
+ end
187
+
188
+ # Custom attribute writer method with validation
189
+ # @param [Object] not_before Value to be assigned
190
+ def not_before=(not_before)
191
+ if not_before.nil?
192
+ fail ArgumentError, 'not_before cannot be nil'
193
+ end
194
+
195
+ @not_before = not_before
196
+ end
197
+
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] not_after Value to be assigned
200
+ def not_after=(not_after)
201
+ if not_after.nil?
202
+ fail ArgumentError, 'not_after cannot be nil'
203
+ end
204
+
205
+ @not_after = not_after
206
+ end
207
+
208
+ # Checks equality by comparing each attribute.
209
+ # @param [Object] Object to be compared
210
+ def ==(o)
211
+ return true if self.equal?(o)
212
+ self.class == o.class &&
213
+ serial_number == o.serial_number &&
214
+ common_name == o.common_name &&
215
+ state_or_province_name == o.state_or_province_name &&
216
+ not_before == o.not_before &&
217
+ not_after == o.not_after
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Integer] Hash code
228
+ def hash
229
+ [serial_number, common_name, state_or_province_name, not_before, not_after].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def self.build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ attributes = attributes.transform_keys(&:to_sym)
238
+ transformed_hash = {}
239
+ openapi_types.each_pair do |key, type|
240
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = nil
242
+ elsif type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[attribute_map[key]].is_a?(Array)
246
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
247
+ end
248
+ elsif !attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
250
+ end
251
+ end
252
+ new(transformed_hash)
253
+ end
254
+
255
+ # Deserializes the data based on type
256
+ # @param string type Data type
257
+ # @param string value Value to be deserialized
258
+ # @return [Object] Deserialized data
259
+ def self._deserialize(type, value)
260
+ case type.to_sym
261
+ when :Time
262
+ Time.parse(value)
263
+ when :Date
264
+ Date.parse(value)
265
+ when :String
266
+ value.to_s
267
+ when :Integer
268
+ value.to_i
269
+ when :Float
270
+ value.to_f
271
+ when :Boolean
272
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ true
274
+ else
275
+ false
276
+ end
277
+ when :Object
278
+ # generic object (usually a Hash), return directly
279
+ value
280
+ when /\AArray<(?<inner_type>.+)>\z/
281
+ inner_type = Regexp.last_match[:inner_type]
282
+ value.map { |v| _deserialize(inner_type, v) }
283
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ k_type = Regexp.last_match[:k_type]
285
+ v_type = Regexp.last_match[:v_type]
286
+ {}.tap do |hash|
287
+ value.each do |k, v|
288
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
289
+ end
290
+ end
291
+ else # model
292
+ # models (e.g. Pet) or oneOf
293
+ klass = TrinsicApi.const_get(type)
294
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
295
+ end
296
+ end
297
+
298
+ # Returns the string representation of the object
299
+ # @return [String] String presentation of the object
300
+ def to_s
301
+ to_hash.to_s
302
+ end
303
+
304
+ # to_body is an alias to to_hash (backward compatibility)
305
+ # @return [Hash] Returns the object in the form of hash
306
+ def to_body
307
+ to_hash
308
+ end
309
+
310
+ # Returns the object in the form of hash
311
+ # @return [Hash] Returns the object in the form of hash
312
+ def to_hash
313
+ hash = {}
314
+ self.class.attribute_map.each_pair do |attr, param|
315
+ value = self.send(attr)
316
+ if value.nil?
317
+ is_nullable = self.class.openapi_nullable.include?(attr)
318
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
319
+ end
320
+
321
+ hash[param] = _to_hash(value)
322
+ end
323
+ hash
324
+ end
325
+
326
+ # Outputs non-array value in the form of hash
327
+ # For object, use to_hash. Otherwise, just return the value
328
+ # @param [Object] value Any valid value
329
+ # @return [Hash] Returns the value in the form of hash
330
+ def _to_hash(value)
331
+ if value.is_a?(Array)
332
+ value.compact.map { |v| _to_hash(v) }
333
+ elsif value.is_a?(Hash)
334
+ {}.tap do |hash|
335
+ value.each { |k, v| hash[k] = _to_hash(v) }
336
+ end
337
+ elsif value.respond_to? :to_hash
338
+ value.to_hash
339
+ else
340
+ value
341
+ end
342
+ end
343
+
344
+ end
345
+
346
+ end
@@ -0,0 +1,40 @@
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.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class MdlExchangeMechanism
18
+ NATIVE_APP = "NativeApp".freeze
19
+ DIGITAL_CREDENTIALS_API = "DigitalCredentialsApi".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [NATIVE_APP, DIGITAL_CREDENTIALS_API].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if MdlExchangeMechanism.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #MdlExchangeMechanism"
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,43 @@
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.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ class MdlFieldDataType
18
+ STRING = "String".freeze
19
+ BOOLEAN = "Boolean".freeze
20
+ NUMBER = "Number".freeze
21
+ BASE64_URL = "Base64Url".freeze
22
+ ENCODED_CBOR = "EncodedCbor".freeze
23
+
24
+ def self.all_vars
25
+ @all_vars ||= [STRING, BOOLEAN, NUMBER, BASE64_URL, ENCODED_CBOR].freeze
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def self.build_from_hash(value)
32
+ new.build_from_hash(value)
33
+ end
34
+
35
+ # Builds the enum from string
36
+ # @param [String] The enum value in the form of the string
37
+ # @return [String] The enum value
38
+ def build_from_hash(value)
39
+ return value if MdlFieldDataType.all_vars.include?(value)
40
+ raise "Invalid ENUM value #{value} for class #MdlFieldDataType"
41
+ end
42
+ end
43
+ end