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,313 @@
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 update settings (e.g. profile data, passwords, ...) in a selfservice manner. We recommend reading the [User Settings Documentation](../self-service/flows/user-settings)
17
+ class SettingsRequest
18
+ # Active, if set, contains the registration method that is being used. It is initially not set.
19
+ attr_accessor :active
20
+
21
+ # ExpiresAt is the time (UTC) when the request expires. If the user still wishes to update the setting, a new request has to be initiated.
22
+ attr_accessor :expires_at
23
+
24
+ attr_accessor :id
25
+
26
+ attr_accessor :identity
27
+
28
+ # IssuedAt is the time (UTC) when the request occurred.
29
+ attr_accessor :issued_at
30
+
31
+ # Methods contains context for all enabled registration methods. If a registration request has been processed, but for example the password is incorrect, this will contain error messages.
32
+ attr_accessor :methods
33
+
34
+ # 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.
35
+ attr_accessor :request_url
36
+
37
+ # UpdateSuccessful, if true, indicates that the settings request has been updated successfully with the provided data. Done will stay true when repeatedly checking. If set to true, done will revert back to false only when a request with invalid (e.g. \"please use a valid phone number\") data was sent.
38
+ attr_accessor :update_successful
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'active' => :'active',
44
+ :'expires_at' => :'expires_at',
45
+ :'id' => :'id',
46
+ :'identity' => :'identity',
47
+ :'issued_at' => :'issued_at',
48
+ :'methods' => :'methods',
49
+ :'request_url' => :'request_url',
50
+ :'update_successful' => :'update_successful'
51
+ }
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'active' => :'String',
58
+ :'expires_at' => :'DateTime',
59
+ :'id' => :'String',
60
+ :'identity' => :'Identity',
61
+ :'issued_at' => :'DateTime',
62
+ :'methods' => :'Hash<String, SettingsRequestMethod>',
63
+ :'request_url' => :'String',
64
+ :'update_successful' => :'Boolean'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
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 `OryHydraClient::SettingsRequest` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!self.class.attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SettingsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'active')
90
+ self.active = attributes[:'active']
91
+ end
92
+
93
+ if attributes.key?(:'expires_at')
94
+ self.expires_at = attributes[:'expires_at']
95
+ end
96
+
97
+ if attributes.key?(:'id')
98
+ self.id = attributes[:'id']
99
+ end
100
+
101
+ if attributes.key?(:'identity')
102
+ self.identity = attributes[:'identity']
103
+ end
104
+
105
+ if attributes.key?(:'issued_at')
106
+ self.issued_at = attributes[:'issued_at']
107
+ end
108
+
109
+ if attributes.key?(:'methods')
110
+ if (value = attributes[:'methods']).is_a?(Hash)
111
+ self.methods = value
112
+ end
113
+ end
114
+
115
+ if attributes.key?(:'request_url')
116
+ self.request_url = attributes[:'request_url']
117
+ end
118
+
119
+ if attributes.key?(:'update_successful')
120
+ self.update_successful = attributes[:'update_successful']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ if @expires_at.nil?
129
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
130
+ end
131
+
132
+ if @id.nil?
133
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
134
+ end
135
+
136
+ if @identity.nil?
137
+ invalid_properties.push('invalid value for "identity", identity cannot be nil.')
138
+ end
139
+
140
+ if @issued_at.nil?
141
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
142
+ end
143
+
144
+ if @methods.nil?
145
+ invalid_properties.push('invalid value for "methods", methods cannot be nil.')
146
+ end
147
+
148
+ if @request_url.nil?
149
+ invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
150
+ end
151
+
152
+ if @update_successful.nil?
153
+ invalid_properties.push('invalid value for "update_successful", update_successful cannot be nil.')
154
+ end
155
+
156
+ invalid_properties
157
+ end
158
+
159
+ # Check to see if the all the properties in the model are valid
160
+ # @return true if the model is valid
161
+ def valid?
162
+ return false if @expires_at.nil?
163
+ return false if @id.nil?
164
+ return false if @identity.nil?
165
+ return false if @issued_at.nil?
166
+ return false if @methods.nil?
167
+ return false if @request_url.nil?
168
+ return false if @update_successful.nil?
169
+ true
170
+ end
171
+
172
+ # Checks equality by comparing each attribute.
173
+ # @param [Object] Object to be compared
174
+ def ==(o)
175
+ return true if self.equal?(o)
176
+ self.class == o.class &&
177
+ active == o.active &&
178
+ expires_at == o.expires_at &&
179
+ id == o.id &&
180
+ identity == o.identity &&
181
+ issued_at == o.issued_at &&
182
+ methods == o.methods &&
183
+ request_url == o.request_url &&
184
+ update_successful == o.update_successful
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Integer] Hash code
195
+ def hash
196
+ [active, expires_at, id, identity, issued_at, methods, request_url, update_successful].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def self.build_from_hash(attributes)
203
+ new.build_from_hash(attributes)
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ self.class.openapi_types.each_pair do |key, type|
212
+ if type =~ /\AArray<(.*)>/i
213
+ # check to ensure the input is an array given that the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
216
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
217
+ end
218
+ elsif !attributes[self.class.attribute_map[key]].nil?
219
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
220
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
221
+ end
222
+
223
+ self
224
+ end
225
+
226
+ # Deserializes the data based on type
227
+ # @param string type Data type
228
+ # @param string value Value to be deserialized
229
+ # @return [Object] Deserialized data
230
+ def _deserialize(type, value)
231
+ case type.to_sym
232
+ when :DateTime
233
+ DateTime.parse(value)
234
+ when :Date
235
+ Date.parse(value)
236
+ when :String
237
+ value.to_s
238
+ when :Integer
239
+ value.to_i
240
+ when :Float
241
+ value.to_f
242
+ when :Boolean
243
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
244
+ true
245
+ else
246
+ false
247
+ end
248
+ when :Object
249
+ # generic object (usually a Hash), return directly
250
+ value
251
+ when /\AArray<(?<inner_type>.+)>\z/
252
+ inner_type = Regexp.last_match[:inner_type]
253
+ value.map { |v| _deserialize(inner_type, v) }
254
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
255
+ k_type = Regexp.last_match[:k_type]
256
+ v_type = Regexp.last_match[:v_type]
257
+ {}.tap do |hash|
258
+ value.each do |k, v|
259
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
260
+ end
261
+ end
262
+ else # model
263
+ OryHydraClient.const_get(type).build_from_hash(value)
264
+ end
265
+ end
266
+
267
+ # Returns the string representation of the object
268
+ # @return [String] String presentation of the object
269
+ def to_s
270
+ to_hash.to_s
271
+ end
272
+
273
+ # to_body is an alias to to_hash (backward compatibility)
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_body
276
+ to_hash
277
+ end
278
+
279
+ # Returns the object in the form of hash
280
+ # @return [Hash] Returns the object in the form of hash
281
+ def to_hash
282
+ hash = {}
283
+ self.class.attribute_map.each_pair do |attr, param|
284
+ value = self.send(attr)
285
+ if value.nil?
286
+ is_nullable = self.class.openapi_nullable.include?(attr)
287
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
288
+ end
289
+
290
+ hash[param] = _to_hash(value)
291
+ end
292
+ hash
293
+ end
294
+
295
+ # Outputs non-array value in the form of hash
296
+ # For object, use to_hash. Otherwise, just return the value
297
+ # @param [Object] value Any valid value
298
+ # @return [Hash] Returns the value in the form of hash
299
+ def _to_hash(value)
300
+ if value.is_a?(Array)
301
+ value.compact.map { |v| _to_hash(v) }
302
+ elsif value.is_a?(Hash)
303
+ {}.tap do |hash|
304
+ value.each { |k, v| hash[k] = _to_hash(v) }
305
+ end
306
+ elsif value.respond_to? :to_hash
307
+ value.to_hash
308
+ else
309
+ value
310
+ end
311
+ end
312
+ end
313
+ end
@@ -0,0 +1,216 @@
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 SettingsRequestMethod
17
+ attr_accessor :config
18
+
19
+ # Method contains the request credentials type.
20
+ attr_accessor :method
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'config' => :'config',
26
+ :'method' => :'method'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'config' => :'RequestMethodConfig',
34
+ :'method' => :'String'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.openapi_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::SettingsRequestMethod` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::SettingsRequestMethod`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'config')
60
+ self.config = attributes[:'config']
61
+ end
62
+
63
+ if attributes.key?(:'method')
64
+ self.method = attributes[:'method']
65
+ end
66
+ end
67
+
68
+ # Show invalid properties with the reasons. Usually used together with valid?
69
+ # @return Array for valid properties with the reasons
70
+ def list_invalid_properties
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ true
79
+ end
80
+
81
+ # Checks equality by comparing each attribute.
82
+ # @param [Object] Object to be compared
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ config == o.config &&
87
+ method == o.method
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [config, method].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ new.build_from_hash(attributes)
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def build_from_hash(attributes)
113
+ return nil unless attributes.is_a?(Hash)
114
+ self.class.openapi_types.each_pair do |key, type|
115
+ if type =~ /\AArray<(.*)>/i
116
+ # check to ensure the input is an array given that the attribute
117
+ # is documented as an array but the input is not
118
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
119
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
123
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
124
+ end
125
+
126
+ self
127
+ end
128
+
129
+ # Deserializes the data based on type
130
+ # @param string type Data type
131
+ # @param string value Value to be deserialized
132
+ # @return [Object] Deserialized data
133
+ def _deserialize(type, value)
134
+ case type.to_sym
135
+ when :DateTime
136
+ DateTime.parse(value)
137
+ when :Date
138
+ Date.parse(value)
139
+ when :String
140
+ value.to_s
141
+ when :Integer
142
+ value.to_i
143
+ when :Float
144
+ value.to_f
145
+ when :Boolean
146
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
147
+ true
148
+ else
149
+ false
150
+ end
151
+ when :Object
152
+ # generic object (usually a Hash), return directly
153
+ value
154
+ when /\AArray<(?<inner_type>.+)>\z/
155
+ inner_type = Regexp.last_match[:inner_type]
156
+ value.map { |v| _deserialize(inner_type, v) }
157
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
158
+ k_type = Regexp.last_match[:k_type]
159
+ v_type = Regexp.last_match[:v_type]
160
+ {}.tap do |hash|
161
+ value.each do |k, v|
162
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
163
+ end
164
+ end
165
+ else # model
166
+ OryHydraClient.const_get(type).build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.openapi_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+ end
216
+ end