ory-kratos-client 0.1.0.alpha6 → 0.4.6.alpha1

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