ory-kratos-client 0.1.0.alpha5 → 0.1.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -4
  3. data/docs/AdminApi.md +48 -0
  4. data/docs/CommonApi.md +48 -0
  5. data/docs/Form.md +3 -3
  6. data/docs/FormField.md +4 -4
  7. data/docs/Identity.md +4 -2
  8. data/docs/LoginRequest.md +5 -5
  9. data/docs/LoginRequestMethod.md +2 -2
  10. data/docs/LoginRequestMethodConfig.md +10 -1
  11. data/docs/ProfileManagementRequest.md +7 -7
  12. data/docs/PublicApi.md +189 -0
  13. data/docs/RegistrationRequest.md +6 -6
  14. data/docs/RegistrationRequestMethodConfig.md +10 -1
  15. data/docs/Session.md +5 -5
  16. data/docs/VerifiableAddress.md +27 -0
  17. data/docs/VerificationRequest.md +29 -0
  18. data/lib/ory-kratos-client.rb +3 -1
  19. data/lib/ory-kratos-client/api/admin_api.rb +64 -1
  20. data/lib/ory-kratos-client/api/common_api.rb +64 -1
  21. data/lib/ory-kratos-client/api/health_api.rb +1 -1
  22. data/lib/ory-kratos-client/api/public_api.rb +251 -1
  23. data/lib/ory-kratos-client/api/version_api.rb +1 -1
  24. data/lib/ory-kratos-client/api_client.rb +1 -1
  25. data/lib/ory-kratos-client/api_error.rb +1 -1
  26. data/lib/ory-kratos-client/configuration.rb +1 -1
  27. data/lib/ory-kratos-client/models/complete_self_service_browser_profile_management_flow_payload.rb +1 -1
  28. data/lib/ory-kratos-client/models/error.rb +1 -1
  29. data/lib/ory-kratos-client/models/error_container.rb +1 -1
  30. data/lib/ory-kratos-client/models/form.rb +16 -1
  31. data/lib/ory-kratos-client/models/form_field.rb +17 -2
  32. data/lib/ory-kratos-client/models/generic_error.rb +1 -1
  33. data/lib/ory-kratos-client/models/generic_error_payload.rb +1 -1
  34. data/lib/ory-kratos-client/models/health_not_ready_status.rb +1 -1
  35. data/lib/ory-kratos-client/models/health_status.rb +1 -1
  36. data/lib/ory-kratos-client/models/identity.rb +18 -2
  37. data/lib/ory-kratos-client/models/login_request.rb +26 -1
  38. data/lib/ory-kratos-client/models/login_request_method.rb +11 -1
  39. data/lib/ory-kratos-client/models/login_request_method_config.rb +74 -3
  40. data/lib/ory-kratos-client/models/profile_management_request.rb +36 -1
  41. data/lib/ory-kratos-client/models/registration_request.rb +31 -1
  42. data/lib/ory-kratos-client/models/registration_request_method.rb +1 -1
  43. data/lib/ory-kratos-client/models/registration_request_method_config.rb +74 -3
  44. data/lib/ory-kratos-client/models/session.rb +26 -1
  45. data/lib/ory-kratos-client/models/verifiable_address.rb +281 -0
  46. data/lib/ory-kratos-client/models/verification_request.rb +265 -0
  47. data/lib/ory-kratos-client/models/version.rb +1 -1
  48. data/lib/ory-kratos-client/version.rb +2 -2
  49. data/ory-kratos-client.gemspec +1 -1
  50. data/spec/models/verifiable_address_spec.rb +71 -0
  51. data/spec/models/verification_request_spec.rb +77 -0
  52. metadata +28 -20
@@ -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 update the profile, 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
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
@@ -6,10 +6,10 @@
6
6
  The version of the OpenAPI document: latest
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.2
9
+ OpenAPI Generator version: 4.2.3
10
10
 
11
11
  =end
12
12
 
13
13
  module OryHydraClient
14
- VERSION = '0.1.0.alpha5'
14
+ VERSION = '0.1.0.alpha6'
15
15
  end
@@ -8,7 +8,7 @@
8
8
  The version of the OpenAPI document: latest
9
9
 
10
10
  Generated by: https://openapi-generator.tech
11
- OpenAPI Generator version: 4.2.2
11
+ OpenAPI Generator version: 4.2.3
12
12
 
13
13
  =end
14
14
 
@@ -0,0 +1,71 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for OryHydraClient::VerifiableAddress
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'VerifiableAddress' do
21
+ before do
22
+ # run before each test
23
+ @instance = OryHydraClient::VerifiableAddress.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of VerifiableAddress' do
31
+ it 'should create an instance of VerifiableAddress' do
32
+ expect(@instance).to be_instance_of(OryHydraClient::VerifiableAddress)
33
+ end
34
+ end
35
+ describe 'test attribute "expires_at"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "id"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "value"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "verified"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "verified_at"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "via"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ end
@@ -0,0 +1,77 @@
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 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for OryHydraClient::VerificationRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe 'VerificationRequest' do
21
+ before do
22
+ # run before each test
23
+ @instance = OryHydraClient::VerificationRequest.new
24
+ end
25
+
26
+ after do
27
+ # run after each test
28
+ end
29
+
30
+ describe 'test an instance of VerificationRequest' do
31
+ it 'should create an instance of VerificationRequest' do
32
+ expect(@instance).to be_instance_of(OryHydraClient::VerificationRequest)
33
+ end
34
+ end
35
+ describe 'test attribute "expires_at"' do
36
+ it 'should work' do
37
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
38
+ end
39
+ end
40
+
41
+ describe 'test attribute "form"' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ describe 'test attribute "id"' do
48
+ it 'should work' do
49
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
50
+ end
51
+ end
52
+
53
+ describe 'test attribute "issued_at"' do
54
+ it 'should work' do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ describe 'test attribute "request_url"' do
60
+ it 'should work' do
61
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
62
+ end
63
+ end
64
+
65
+ describe 'test attribute "success"' do
66
+ it 'should work' do
67
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
68
+ end
69
+ end
70
+
71
+ describe 'test attribute "via"' do
72
+ it 'should work' do
73
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
74
+ end
75
+ end
76
+
77
+ end