ory-kratos-client 0.1.0.alpha5 → 0.3.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -11
  3. data/docs/AdminApi.md +116 -21
  4. data/docs/CommonApi.md +116 -21
  5. data/docs/CompleteSelfServiceBrowserSettingsStrategyProfileFlowPayload.md +19 -0
  6. data/docs/Form.md +3 -3
  7. data/docs/FormField.md +7 -7
  8. data/docs/GenericErrorPayload.md +1 -1
  9. data/docs/Identity.md +4 -2
  10. data/docs/LoginRequest.md +7 -5
  11. data/docs/LoginRequestMethod.md +2 -2
  12. data/docs/LoginRequestMethodConfig.md +10 -1
  13. data/docs/ProfileManagementRequest.md +7 -7
  14. data/docs/ProviderCredentialsConfig.md +19 -0
  15. data/docs/PublicApi.md +365 -39
  16. data/docs/RegistrationRequest.md +5 -5
  17. data/docs/RegistrationRequestMethodConfig.md +10 -1
  18. data/docs/RequestMethodConfig.md +23 -0
  19. data/docs/Session.md +5 -5
  20. data/docs/SettingsRequest.md +31 -0
  21. data/docs/SettingsRequestMethod.md +19 -0
  22. data/docs/VerifiableAddress.md +27 -0
  23. data/docs/VerificationRequest.md +29 -0
  24. data/lib/ory-kratos-client.rb +8 -3
  25. data/lib/ory-kratos-client/api/admin_api.rb +159 -36
  26. data/lib/ory-kratos-client/api/common_api.rb +159 -36
  27. data/lib/ory-kratos-client/api/health_api.rb +1 -1
  28. data/lib/ory-kratos-client/api/public_api.rb +493 -59
  29. data/lib/ory-kratos-client/api/version_api.rb +1 -1
  30. data/lib/ory-kratos-client/api_client.rb +1 -1
  31. data/lib/ory-kratos-client/api_error.rb +1 -1
  32. data/lib/ory-kratos-client/configuration.rb +1 -1
  33. data/lib/ory-kratos-client/models/complete_self_service_browser_profile_management_flow_payload.rb +1 -1
  34. data/lib/ory-kratos-client/models/complete_self_service_browser_settings_strategy_profile_flow_payload.rb +222 -0
  35. data/lib/ory-kratos-client/models/error.rb +1 -1
  36. data/lib/ory-kratos-client/models/error_container.rb +1 -1
  37. data/lib/ory-kratos-client/models/form.rb +17 -2
  38. data/lib/ory-kratos-client/models/form_field.rb +18 -9
  39. data/lib/ory-kratos-client/models/generic_error.rb +1 -1
  40. data/lib/ory-kratos-client/models/generic_error_payload.rb +3 -4
  41. data/lib/ory-kratos-client/models/health_not_ready_status.rb +1 -1
  42. data/lib/ory-kratos-client/models/health_status.rb +1 -1
  43. data/lib/ory-kratos-client/models/identity.rb +18 -2
  44. data/lib/ory-kratos-client/models/login_request.rb +37 -2
  45. data/lib/ory-kratos-client/models/login_request_method.rb +11 -1
  46. data/lib/ory-kratos-client/models/login_request_method_config.rb +74 -3
  47. data/lib/ory-kratos-client/models/profile_management_request.rb +36 -1
  48. data/lib/ory-kratos-client/models/provider_credentials_config.rb +215 -0
  49. data/lib/ory-kratos-client/models/registration_request.rb +26 -1
  50. data/lib/ory-kratos-client/models/registration_request_method.rb +1 -1
  51. data/lib/ory-kratos-client/models/registration_request_method_config.rb +74 -3
  52. data/lib/ory-kratos-client/models/request_method_config.rb +256 -0
  53. data/lib/ory-kratos-client/models/session.rb +26 -1
  54. data/lib/ory-kratos-client/models/settings_request.rb +313 -0
  55. data/lib/ory-kratos-client/models/settings_request_method.rb +216 -0
  56. data/lib/ory-kratos-client/models/verifiable_address.rb +276 -0
  57. data/lib/ory-kratos-client/models/verification_request.rb +265 -0
  58. data/lib/ory-kratos-client/models/version.rb +1 -1
  59. data/lib/ory-kratos-client/version.rb +2 -2
  60. data/ory-kratos-client.gemspec +1 -1
  61. data/spec/models/complete_self_service_browser_settings_strategy_profile_flow_payload_spec.rb +47 -0
  62. data/spec/models/provider_credentials_config_spec.rb +47 -0
  63. data/spec/models/request_method_config_spec.rb +59 -0
  64. data/spec/models/settings_request_method_spec.rb +47 -0
  65. data/spec/models/settings_request_spec.rb +83 -0
  66. data/spec/models/verifiable_address_spec.rb +71 -0
  67. data/spec/models/verification_request_spec.rb +77 -0
  68. metadata +43 -15
@@ -0,0 +1,276 @@
1
+ =begin
2
+ #Ory Kratos
3
+
4
+ #Welcome to the ORY Kratos HTTP API documentation!
5
+
6
+ The version of the OpenAPI document: latest
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class VerifiableAddress
17
+ attr_accessor :expires_at
18
+
19
+ attr_accessor :id
20
+
21
+ attr_accessor :value
22
+
23
+ attr_accessor :verified
24
+
25
+ attr_accessor :verified_at
26
+
27
+ attr_accessor :via
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'expires_at' => :'expires_at',
33
+ :'id' => :'id',
34
+ :'value' => :'value',
35
+ :'verified' => :'verified',
36
+ :'verified_at' => :'verified_at',
37
+ :'via' => :'via'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'expires_at' => :'DateTime',
45
+ :'id' => :'String',
46
+ :'value' => :'String',
47
+ :'verified' => :'Boolean',
48
+ :'verified_at' => :'DateTime',
49
+ :'via' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::VerifiableAddress` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::VerifiableAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'expires_at')
75
+ self.expires_at = attributes[:'expires_at']
76
+ end
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'value')
83
+ self.value = attributes[:'value']
84
+ end
85
+
86
+ if attributes.key?(:'verified')
87
+ self.verified = attributes[:'verified']
88
+ end
89
+
90
+ if attributes.key?(:'verified_at')
91
+ self.verified_at = attributes[:'verified_at']
92
+ end
93
+
94
+ if attributes.key?(:'via')
95
+ self.via = attributes[:'via']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @expires_at.nil?
104
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
105
+ end
106
+
107
+ if @id.nil?
108
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
109
+ end
110
+
111
+ if @value.nil?
112
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
113
+ end
114
+
115
+ if @verified.nil?
116
+ invalid_properties.push('invalid value for "verified", verified cannot be nil.')
117
+ end
118
+
119
+ if @via.nil?
120
+ invalid_properties.push('invalid value for "via", via cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ return false if @expires_at.nil?
130
+ return false if @id.nil?
131
+ return false if @value.nil?
132
+ return false if @verified.nil?
133
+ return false if @via.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ expires_at == o.expires_at &&
143
+ id == o.id &&
144
+ value == o.value &&
145
+ verified == o.verified &&
146
+ verified_at == o.verified_at &&
147
+ via == o.via
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [expires_at, id, value, verified, verified_at, via].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :DateTime
196
+ DateTime.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ OryHydraClient.const_get(type).build_from_hash(value)
227
+ end
228
+ end
229
+
230
+ # Returns the string representation of the object
231
+ # @return [String] String presentation of the object
232
+ def to_s
233
+ to_hash.to_s
234
+ end
235
+
236
+ # to_body is an alias to to_hash (backward compatibility)
237
+ # @return [Hash] Returns the object in the form of hash
238
+ def to_body
239
+ to_hash
240
+ end
241
+
242
+ # Returns the object in the form of hash
243
+ # @return [Hash] Returns the object in the form of hash
244
+ def to_hash
245
+ hash = {}
246
+ self.class.attribute_map.each_pair do |attr, param|
247
+ value = self.send(attr)
248
+ if value.nil?
249
+ is_nullable = self.class.openapi_nullable.include?(attr)
250
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
251
+ end
252
+
253
+ hash[param] = _to_hash(value)
254
+ end
255
+ hash
256
+ end
257
+
258
+ # Outputs non-array value in the form of hash
259
+ # For object, use to_hash. Otherwise, just return the value
260
+ # @param [Object] value Any valid value
261
+ # @return [Hash] Returns the value in the form of hash
262
+ def _to_hash(value)
263
+ if value.is_a?(Array)
264
+ value.compact.map { |v| _to_hash(v) }
265
+ elsif value.is_a?(Hash)
266
+ {}.tap do |hash|
267
+ value.each { |k, v| hash[k] = _to_hash(v) }
268
+ end
269
+ elsif value.respond_to? :to_hash
270
+ value.to_hash
271
+ else
272
+ value
273
+ end
274
+ end
275
+ end
276
+ end
@@ -0,0 +1,265 @@
1
+ =begin
2
+ #Ory Kratos
3
+
4
+ #Welcome to the ORY Kratos HTTP API documentation!
5
+
6
+ The version of the OpenAPI document: latest
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # This request is used when an identity wants to verify an out-of-band communication channel such as an email address or a phone number. For more information head over to: https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation
17
+ class VerificationRequest
18
+ # ExpiresAt is the time (UTC) when the request expires. If the user still wishes to verify the address, a new request has to be initiated.
19
+ attr_accessor :expires_at
20
+
21
+ attr_accessor :form
22
+
23
+ attr_accessor :id
24
+
25
+ # IssuedAt is the time (UTC) when the request occurred.
26
+ attr_accessor :issued_at
27
+
28
+ # RequestURL is the initial URL that was requested from ORY Kratos. It can be used to forward information contained in the URL's path or query for example.
29
+ attr_accessor :request_url
30
+
31
+ # Success, if true, implies that the request was completed successfully.
32
+ attr_accessor :success
33
+
34
+ attr_accessor :via
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'expires_at' => :'expires_at',
40
+ :'form' => :'form',
41
+ :'id' => :'id',
42
+ :'issued_at' => :'issued_at',
43
+ :'request_url' => :'request_url',
44
+ :'success' => :'success',
45
+ :'via' => :'via'
46
+ }
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'expires_at' => :'DateTime',
53
+ :'form' => :'Form',
54
+ :'id' => :'String',
55
+ :'issued_at' => :'DateTime',
56
+ :'request_url' => :'String',
57
+ :'success' => :'Boolean',
58
+ :'via' => :'String'
59
+ }
60
+ end
61
+
62
+ # List of attributes with nullable: true
63
+ def self.openapi_nullable
64
+ Set.new([
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::VerificationRequest` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!self.class.attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::VerificationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'expires_at')
84
+ self.expires_at = attributes[:'expires_at']
85
+ end
86
+
87
+ if attributes.key?(:'form')
88
+ self.form = attributes[:'form']
89
+ end
90
+
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
93
+ end
94
+
95
+ if attributes.key?(:'issued_at')
96
+ self.issued_at = attributes[:'issued_at']
97
+ end
98
+
99
+ if attributes.key?(:'request_url')
100
+ self.request_url = attributes[:'request_url']
101
+ end
102
+
103
+ if attributes.key?(:'success')
104
+ self.success = attributes[:'success']
105
+ end
106
+
107
+ if attributes.key?(:'via')
108
+ self.via = attributes[:'via']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ expires_at == o.expires_at &&
131
+ form == o.form &&
132
+ id == o.id &&
133
+ issued_at == o.issued_at &&
134
+ request_url == o.request_url &&
135
+ success == o.success &&
136
+ via == o.via
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [expires_at, form, id, issued_at, request_url, success, via].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ new.build_from_hash(attributes)
156
+ end
157
+
158
+ # Builds the object from hash
159
+ # @param [Hash] attributes Model attributes in the form of hash
160
+ # @return [Object] Returns the model itself
161
+ def build_from_hash(attributes)
162
+ return nil unless attributes.is_a?(Hash)
163
+ self.class.openapi_types.each_pair do |key, type|
164
+ if type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
169
+ end
170
+ elsif !attributes[self.class.attribute_map[key]].nil?
171
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
172
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
173
+ end
174
+
175
+ self
176
+ end
177
+
178
+ # Deserializes the data based on type
179
+ # @param string type Data type
180
+ # @param string value Value to be deserialized
181
+ # @return [Object] Deserialized data
182
+ def _deserialize(type, value)
183
+ case type.to_sym
184
+ when :DateTime
185
+ DateTime.parse(value)
186
+ when :Date
187
+ Date.parse(value)
188
+ when :String
189
+ value.to_s
190
+ when :Integer
191
+ value.to_i
192
+ when :Float
193
+ value.to_f
194
+ when :Boolean
195
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
196
+ true
197
+ else
198
+ false
199
+ end
200
+ when :Object
201
+ # generic object (usually a Hash), return directly
202
+ value
203
+ when /\AArray<(?<inner_type>.+)>\z/
204
+ inner_type = Regexp.last_match[:inner_type]
205
+ value.map { |v| _deserialize(inner_type, v) }
206
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
207
+ k_type = Regexp.last_match[:k_type]
208
+ v_type = Regexp.last_match[:v_type]
209
+ {}.tap do |hash|
210
+ value.each do |k, v|
211
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
212
+ end
213
+ end
214
+ else # model
215
+ OryHydraClient.const_get(type).build_from_hash(value)
216
+ end
217
+ end
218
+
219
+ # Returns the string representation of the object
220
+ # @return [String] String presentation of the object
221
+ def to_s
222
+ to_hash.to_s
223
+ end
224
+
225
+ # to_body is an alias to to_hash (backward compatibility)
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_body
228
+ to_hash
229
+ end
230
+
231
+ # Returns the object in the form of hash
232
+ # @return [Hash] Returns the object in the form of hash
233
+ def to_hash
234
+ hash = {}
235
+ self.class.attribute_map.each_pair do |attr, param|
236
+ value = self.send(attr)
237
+ if value.nil?
238
+ is_nullable = self.class.openapi_nullable.include?(attr)
239
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
240
+ end
241
+
242
+ hash[param] = _to_hash(value)
243
+ end
244
+ hash
245
+ end
246
+
247
+ # Outputs non-array value in the form of hash
248
+ # For object, use to_hash. Otherwise, just return the value
249
+ # @param [Object] value Any valid value
250
+ # @return [Hash] Returns the value in the form of hash
251
+ def _to_hash(value)
252
+ if value.is_a?(Array)
253
+ value.compact.map { |v| _to_hash(v) }
254
+ elsif value.is_a?(Hash)
255
+ {}.tap do |hash|
256
+ value.each { |k, v| hash[k] = _to_hash(v) }
257
+ end
258
+ elsif value.respond_to? :to_hash
259
+ value.to_hash
260
+ else
261
+ value
262
+ end
263
+ end
264
+ end
265
+ end