ory-kratos-client 0.6.3.alpha1 → 0.7.3.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +135 -145
  3. data/docs/AdminCreateIdentityBody.md +20 -0
  4. data/docs/AdminCreateSelfServiceRecoveryLinkBody.md +20 -0
  5. data/docs/AdminUpdateIdentityBody.md +22 -0
  6. data/docs/AuthenticateOKBody.md +2 -2
  7. data/docs/ContainerChangeResponseItem.md +2 -2
  8. data/docs/ContainerCreateCreatedBody.md +2 -2
  9. data/docs/ContainerTopOKBody.md +2 -2
  10. data/docs/ContainerUpdateOKBody.md +2 -2
  11. data/docs/ContainerWaitOKBody.md +2 -2
  12. data/docs/ContainerWaitOKBodyError.md +2 -2
  13. data/docs/ErrorResponse.md +2 -2
  14. data/docs/GenericError.md +3 -3
  15. data/docs/GraphDriverData.md +2 -2
  16. data/docs/HealthNotReadyStatus.md +2 -2
  17. data/docs/HealthStatus.md +2 -2
  18. data/docs/IdResponse.md +2 -2
  19. data/docs/Identity.md +8 -2
  20. data/docs/IdentityCredentials.md +2 -2
  21. data/docs/IdentityState.md +15 -0
  22. data/docs/ImageDeleteResponseItem.md +2 -2
  23. data/docs/ImageSummary.md +2 -2
  24. data/docs/InlineResponse200.md +2 -2
  25. data/docs/InlineResponse2001.md +2 -2
  26. data/docs/InlineResponse503.md +2 -2
  27. data/docs/JsonError.md +2 -2
  28. data/docs/Meta.md +2 -2
  29. data/docs/MetadataApi.md +254 -0
  30. data/docs/Plugin.md +2 -2
  31. data/docs/PluginConfig.md +2 -2
  32. data/docs/PluginConfigArgs.md +2 -2
  33. data/docs/PluginConfigInterface.md +2 -2
  34. data/docs/PluginConfigLinux.md +2 -2
  35. data/docs/PluginConfigNetwork.md +2 -2
  36. data/docs/PluginConfigRootfs.md +2 -2
  37. data/docs/PluginConfigUser.md +2 -2
  38. data/docs/PluginDevice.md +2 -2
  39. data/docs/PluginEnv.md +2 -2
  40. data/docs/PluginInterfaceType.md +2 -2
  41. data/docs/PluginMount.md +2 -2
  42. data/docs/PluginSettings.md +2 -2
  43. data/docs/Port.md +2 -2
  44. data/docs/RecoveryAddress.md +2 -2
  45. data/docs/SelfServiceError.md +24 -0
  46. data/docs/SelfServiceLoginFlow.md +36 -0
  47. data/docs/SelfServiceLogoutUrl.md +18 -0
  48. data/docs/SelfServiceRecoveryFlow.md +32 -0
  49. data/docs/SelfServiceRecoveryFlowState.md +15 -0
  50. data/docs/SelfServiceRecoveryLink.md +20 -0
  51. data/docs/SelfServiceRegistrationFlow.md +30 -0
  52. data/docs/SelfServiceSettingsFlow.md +34 -0
  53. data/docs/SelfServiceSettingsFlowState.md +15 -0
  54. data/docs/SelfServiceVerificationFlow.md +32 -0
  55. data/docs/SelfServiceVerificationFlowState.md +15 -0
  56. data/docs/ServiceUpdateResponse.md +2 -2
  57. data/docs/Session.md +6 -6
  58. data/docs/SettingsProfileFormConfig.md +2 -2
  59. data/docs/SubmitSelfServiceLoginFlowBody.md +76 -0
  60. data/docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md +22 -0
  61. data/docs/SubmitSelfServiceLoginFlowWithPasswordMethodBody.md +24 -0
  62. data/docs/SubmitSelfServiceLogoutFlowWithoutBrowserBody.md +18 -0
  63. data/docs/SubmitSelfServiceRecoveryFlowBody.md +75 -0
  64. data/docs/SubmitSelfServiceRecoveryFlowWithLinkMethodBody.md +22 -0
  65. data/docs/SubmitSelfServiceRegistrationFlowBody.md +76 -0
  66. data/docs/SubmitSelfServiceRegistrationFlowWithOidcMethodBody.md +22 -0
  67. data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethodBody.md +24 -0
  68. data/docs/SubmitSelfServiceSettingsFlowBody.md +79 -0
  69. data/docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md +24 -0
  70. data/docs/SubmitSelfServiceSettingsFlowWithPasswordMethodBody.md +22 -0
  71. data/docs/SubmitSelfServiceSettingsFlowWithProfileMethodBody.md +22 -0
  72. data/docs/SubmitSelfServiceVerificationFlowBody.md +75 -0
  73. data/docs/SubmitSelfServiceVerificationFlowWithLinkMethodBody.md +22 -0
  74. data/docs/SuccessfulSelfServiceLoginWithoutBrowser.md +20 -0
  75. data/docs/SuccessfulSelfServiceRegistrationWithoutBrowser.md +22 -0
  76. data/docs/SuccessfulSelfServiceSettingsWithoutBrowser.md +20 -0
  77. data/docs/UiContainer.md +2 -2
  78. data/docs/UiNode.md +2 -2
  79. data/docs/UiNodeAnchorAttributes.md +2 -2
  80. data/docs/UiNodeAttributes.md +4 -4
  81. data/docs/UiNodeImageAttributes.md +2 -2
  82. data/docs/UiNodeInputAttributes.md +3 -3
  83. data/docs/UiNodeTextAttributes.md +2 -2
  84. data/docs/UiText.md +2 -2
  85. data/docs/V0alpha1Api.md +2177 -0
  86. data/docs/VerifiableIdentityAddress.md +2 -2
  87. data/docs/Version.md +2 -2
  88. data/docs/Volume.md +2 -2
  89. data/docs/VolumeUsageData.md +2 -2
  90. data/lib/ory-kratos-client/api/metadata_api.rb +248 -0
  91. data/lib/ory-kratos-client/api/v0alpha1_api.rb +2054 -0
  92. data/lib/ory-kratos-client/api_client.rb +4 -4
  93. data/lib/ory-kratos-client/api_error.rb +3 -3
  94. data/lib/ory-kratos-client/configuration.rb +5 -19
  95. data/lib/ory-kratos-client/models/admin_create_identity_body.rb +239 -0
  96. data/lib/ory-kratos-client/models/admin_create_self_service_recovery_link_body.rb +250 -0
  97. data/lib/ory-kratos-client/models/admin_update_identity_body.rb +248 -0
  98. data/lib/ory-kratos-client/models/authenticate_ok_body.rb +6 -6
  99. data/lib/ory-kratos-client/models/container_change_response_item.rb +6 -6
  100. data/lib/ory-kratos-client/models/container_create_created_body.rb +6 -6
  101. data/lib/ory-kratos-client/models/container_top_ok_body.rb +6 -6
  102. data/lib/ory-kratos-client/models/container_update_ok_body.rb +6 -6
  103. data/lib/ory-kratos-client/models/container_wait_ok_body.rb +6 -6
  104. data/lib/ory-kratos-client/models/container_wait_ok_body_error.rb +6 -6
  105. data/lib/ory-kratos-client/models/error_response.rb +6 -6
  106. data/lib/ory-kratos-client/models/generic_error.rb +8 -10
  107. data/lib/ory-kratos-client/models/graph_driver_data.rb +6 -6
  108. data/lib/ory-kratos-client/models/health_not_ready_status.rb +6 -6
  109. data/lib/ory-kratos-client/models/health_status.rb +6 -6
  110. data/lib/ory-kratos-client/models/id_response.rb +6 -6
  111. data/lib/ory-kratos-client/models/identity.rb +37 -7
  112. data/lib/ory-kratos-client/models/identity_credentials.rb +6 -6
  113. data/lib/ory-kratos-client/models/identity_state.rb +37 -0
  114. data/lib/ory-kratos-client/models/image_delete_response_item.rb +6 -6
  115. data/lib/ory-kratos-client/models/image_summary.rb +6 -6
  116. data/lib/ory-kratos-client/models/inline_response200.rb +6 -6
  117. data/lib/ory-kratos-client/models/inline_response2001.rb +6 -6
  118. data/lib/ory-kratos-client/models/inline_response503.rb +6 -6
  119. data/lib/ory-kratos-client/models/json_error.rb +6 -6
  120. data/lib/ory-kratos-client/models/meta.rb +6 -6
  121. data/lib/ory-kratos-client/models/plugin.rb +6 -6
  122. data/lib/ory-kratos-client/models/plugin_config.rb +6 -6
  123. data/lib/ory-kratos-client/models/plugin_config_args.rb +6 -6
  124. data/lib/ory-kratos-client/models/plugin_config_interface.rb +6 -6
  125. data/lib/ory-kratos-client/models/plugin_config_linux.rb +6 -6
  126. data/lib/ory-kratos-client/models/plugin_config_network.rb +6 -6
  127. data/lib/ory-kratos-client/models/plugin_config_rootfs.rb +6 -6
  128. data/lib/ory-kratos-client/models/plugin_config_user.rb +6 -6
  129. data/lib/ory-kratos-client/models/plugin_device.rb +6 -6
  130. data/lib/ory-kratos-client/models/plugin_env.rb +6 -6
  131. data/lib/ory-kratos-client/models/plugin_interface_type.rb +6 -6
  132. data/lib/ory-kratos-client/models/plugin_mount.rb +6 -6
  133. data/lib/ory-kratos-client/models/plugin_settings.rb +6 -6
  134. data/lib/ory-kratos-client/models/port.rb +6 -6
  135. data/lib/ory-kratos-client/models/recovery_address.rb +6 -6
  136. data/lib/ory-kratos-client/models/self_service_error.rb +252 -0
  137. data/lib/ory-kratos-client/models/self_service_login_flow.rb +338 -0
  138. data/lib/ory-kratos-client/models/self_service_logout_url.rb +219 -0
  139. data/lib/ory-kratos-client/models/self_service_recovery_flow.rb +317 -0
  140. data/lib/ory-kratos-client/models/self_service_recovery_flow_state.rb +38 -0
  141. data/lib/ory-kratos-client/models/self_service_recovery_link.rb +234 -0
  142. data/lib/ory-kratos-client/models/self_service_registration_flow.rb +302 -0
  143. data/lib/ory-kratos-client/models/self_service_settings_flow.rb +331 -0
  144. data/lib/ory-kratos-client/models/self_service_settings_flow_state.rb +37 -0
  145. data/lib/ory-kratos-client/models/self_service_verification_flow.rb +307 -0
  146. data/lib/ory-kratos-client/models/self_service_verification_flow_state.rb +38 -0
  147. data/lib/ory-kratos-client/models/service_update_response.rb +6 -6
  148. data/lib/ory-kratos-client/models/session.rb +11 -21
  149. data/lib/ory-kratos-client/models/settings_profile_form_config.rb +6 -6
  150. data/lib/ory-kratos-client/models/submit_self_service_login_flow_body.rb +54 -0
  151. data/lib/ory-kratos-client/models/submit_self_service_login_flow_with_oidc_method_body.rb +250 -0
  152. data/lib/ory-kratos-client/models/submit_self_service_login_flow_with_password_method_body.rb +298 -0
  153. data/lib/ory-kratos-client/models/submit_self_service_logout_flow_without_browser_body.rb +225 -0
  154. data/lib/ory-kratos-client/models/submit_self_service_recovery_flow_body.rb +53 -0
  155. data/lib/ory-kratos-client/models/submit_self_service_recovery_flow_with_link_method_body.rb +283 -0
  156. data/lib/ory-kratos-client/models/submit_self_service_registration_flow_body.rb +54 -0
  157. data/lib/ory-kratos-client/models/submit_self_service_registration_flow_with_oidc_method_body.rb +250 -0
  158. data/lib/ory-kratos-client/models/submit_self_service_registration_flow_with_password_method_body.rb +299 -0
  159. data/lib/ory-kratos-client/models/submit_self_service_settings_flow_body.rb +56 -0
  160. data/lib/ory-kratos-client/models/submit_self_service_settings_flow_with_oidc_method_body.rb +255 -0
  161. data/lib/ory-kratos-client/models/submit_self_service_settings_flow_with_password_method_body.rb +283 -0
  162. data/lib/ory-kratos-client/models/submit_self_service_settings_flow_with_profile_method_body.rb +250 -0
  163. data/lib/ory-kratos-client/models/submit_self_service_verification_flow_body.rb +54 -0
  164. data/lib/ory-kratos-client/models/submit_self_service_verification_flow_with_link_method_body.rb +283 -0
  165. data/lib/ory-kratos-client/models/successful_self_service_login_without_browser.rb +234 -0
  166. data/lib/ory-kratos-client/models/successful_self_service_registration_without_browser.rb +243 -0
  167. data/lib/ory-kratos-client/models/successful_self_service_settings_without_browser.rb +238 -0
  168. data/lib/ory-kratos-client/models/ui_container.rb +6 -6
  169. data/lib/ory-kratos-client/models/ui_node.rb +6 -6
  170. data/lib/ory-kratos-client/models/ui_node_anchor_attributes.rb +6 -6
  171. data/lib/ory-kratos-client/models/ui_node_attributes.rb +4 -4
  172. data/lib/ory-kratos-client/models/ui_node_image_attributes.rb +6 -6
  173. data/lib/ory-kratos-client/models/ui_node_input_attributes.rb +9 -7
  174. data/lib/ory-kratos-client/models/ui_node_text_attributes.rb +6 -6
  175. data/lib/ory-kratos-client/models/ui_text.rb +6 -6
  176. data/lib/ory-kratos-client/models/verifiable_identity_address.rb +6 -6
  177. data/lib/ory-kratos-client/models/version.rb +6 -6
  178. data/lib/ory-kratos-client/models/volume.rb +6 -6
  179. data/lib/ory-kratos-client/models/volume_usage_data.rb +6 -6
  180. data/lib/ory-kratos-client/version.rb +4 -4
  181. data/lib/ory-kratos-client.rb +39 -31
  182. data/ory-kratos-client.gemspec +3 -3
  183. data/spec/api/metadata_api_spec.rb +79 -0
  184. data/spec/api/v0alpha1_api_spec.rb +429 -0
  185. data/spec/api_client_spec.rb +31 -31
  186. data/spec/configuration_spec.rb +5 -5
  187. data/spec/models/admin_create_identity_body_spec.rb +40 -0
  188. data/spec/models/admin_create_self_service_recovery_link_body_spec.rb +40 -0
  189. data/spec/models/admin_update_identity_body_spec.rb +46 -0
  190. data/spec/models/identity_state_spec.rb +28 -0
  191. data/spec/models/self_service_error_spec.rb +52 -0
  192. data/spec/models/self_service_login_flow_spec.rb +88 -0
  193. data/spec/models/self_service_logout_url_spec.rb +34 -0
  194. data/spec/models/self_service_recovery_flow_spec.rb +76 -0
  195. data/spec/models/self_service_recovery_flow_state_spec.rb +28 -0
  196. data/spec/models/self_service_recovery_link_spec.rb +40 -0
  197. data/spec/models/self_service_registration_flow_spec.rb +70 -0
  198. data/spec/models/self_service_settings_flow_spec.rb +82 -0
  199. data/spec/models/self_service_settings_flow_state_spec.rb +28 -0
  200. data/spec/models/self_service_verification_flow_spec.rb +76 -0
  201. data/spec/models/self_service_verification_flow_state_spec.rb +28 -0
  202. data/spec/models/submit_self_service_login_flow_body_spec.rb +43 -0
  203. data/spec/models/submit_self_service_login_flow_with_oidc_method_body_spec.rb +46 -0
  204. data/spec/models/submit_self_service_login_flow_with_password_method_body_spec.rb +56 -0
  205. data/spec/models/submit_self_service_logout_flow_without_browser_body_spec.rb +34 -0
  206. data/spec/models/submit_self_service_recovery_flow_body_spec.rb +43 -0
  207. data/spec/models/submit_self_service_recovery_flow_with_link_method_body_spec.rb +50 -0
  208. data/spec/models/submit_self_service_registration_flow_body_spec.rb +43 -0
  209. data/spec/models/submit_self_service_registration_flow_with_oidc_method_body_spec.rb +46 -0
  210. data/spec/models/submit_self_service_registration_flow_with_password_method_body_spec.rb +56 -0
  211. data/spec/models/submit_self_service_settings_flow_body_spec.rb +43 -0
  212. data/spec/models/submit_self_service_settings_flow_with_oidc_method_body_spec.rb +52 -0
  213. data/spec/models/submit_self_service_settings_flow_with_password_method_body_spec.rb +50 -0
  214. data/spec/models/submit_self_service_settings_flow_with_profile_method_body_spec.rb +46 -0
  215. data/spec/models/submit_self_service_verification_flow_body_spec.rb +43 -0
  216. data/spec/models/submit_self_service_verification_flow_with_link_method_body_spec.rb +50 -0
  217. data/spec/models/successful_self_service_login_without_browser_spec.rb +40 -0
  218. data/spec/models/successful_self_service_registration_without_browser_spec.rb +46 -0
  219. data/spec/models/successful_self_service_settings_without_browser_spec.rb +40 -0
  220. data/spec/spec_helper.rb +2 -2
  221. metadata +145 -5
@@ -0,0 +1,243 @@
1
+ =begin
2
+ #Ory Kratos API
3
+
4
+ #Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
5
+
6
+ The version of the OpenAPI document: v0.7.3-alpha.1
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OryKratosClient
17
+ # The Response for Registration Flows via API
18
+ class SuccessfulSelfServiceRegistrationWithoutBrowser
19
+ attr_accessor :identity
20
+
21
+ attr_accessor :session
22
+
23
+ # The Session Token This field is only set when the session hook is configured as a post-registration hook. A session token is equivalent to a session cookie, but it can be sent in the HTTP Authorization Header: Authorization: bearer ${session-token} The session token is only issued for API flows, not for Browser flows!
24
+ attr_accessor :session_token
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'identity' => :'identity',
30
+ :'session' => :'session',
31
+ :'session_token' => :'session_token'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'identity' => :'Identity',
44
+ :'session' => :'Session',
45
+ :'session_token' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryKratosClient::SuccessfulSelfServiceRegistrationWithoutBrowser` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryKratosClient::SuccessfulSelfServiceRegistrationWithoutBrowser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'identity')
71
+ self.identity = attributes[:'identity']
72
+ end
73
+
74
+ if attributes.key?(:'session')
75
+ self.session = attributes[:'session']
76
+ end
77
+
78
+ if attributes.key?(:'session_token')
79
+ self.session_token = attributes[:'session_token']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @identity.nil?
88
+ invalid_properties.push('invalid value for "identity", identity cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @identity.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ identity == o.identity &&
107
+ session == o.session &&
108
+ session_token == o.session_token
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [identity, session, session_token].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
137
+ self.send("#{key}=", nil)
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
143
+ end
144
+ elsif !attributes[self.class.attribute_map[key]].nil?
145
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
146
+ end
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :Time
159
+ Time.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ # models (e.g. Pet) or oneOf
190
+ klass = OryKratosClient.const_get(type)
191
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+
223
+ # Outputs non-array value in the form of hash
224
+ # For object, use to_hash. Otherwise, just return the value
225
+ # @param [Object] value Any valid value
226
+ # @return [Hash] Returns the value in the form of hash
227
+ def _to_hash(value)
228
+ if value.is_a?(Array)
229
+ value.compact.map { |v| _to_hash(v) }
230
+ elsif value.is_a?(Hash)
231
+ {}.tap do |hash|
232
+ value.each { |k, v| hash[k] = _to_hash(v) }
233
+ end
234
+ elsif value.respond_to? :to_hash
235
+ value.to_hash
236
+ else
237
+ value
238
+ end
239
+ end
240
+
241
+ end
242
+
243
+ end
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #Ory Kratos API
3
+
4
+ #Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
5
+
6
+ The version of the OpenAPI document: v0.7.3-alpha.1
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OryKratosClient
17
+ # The Response for Settings Flows via API
18
+ class SuccessfulSelfServiceSettingsWithoutBrowser
19
+ attr_accessor :flow
20
+
21
+ attr_accessor :identity
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'flow' => :'flow',
27
+ :'identity' => :'identity'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :'flow' => :'SelfServiceSettingsFlow',
40
+ :'identity' => :'Identity'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryKratosClient::SuccessfulSelfServiceSettingsWithoutBrowser` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryKratosClient::SuccessfulSelfServiceSettingsWithoutBrowser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
62
+ h[k.to_sym] = v
63
+ }
64
+
65
+ if attributes.key?(:'flow')
66
+ self.flow = attributes[:'flow']
67
+ end
68
+
69
+ if attributes.key?(:'identity')
70
+ self.identity = attributes[:'identity']
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ invalid_properties = Array.new
78
+ if @flow.nil?
79
+ invalid_properties.push('invalid value for "flow", flow cannot be nil.')
80
+ end
81
+
82
+ if @identity.nil?
83
+ invalid_properties.push('invalid value for "identity", identity cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ return false if @flow.nil?
93
+ return false if @identity.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ flow == o.flow &&
103
+ identity == o.identity
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [flow, identity].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.openapi_types.each_pair do |key, type|
131
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
132
+ self.send("#{key}=", nil)
133
+ elsif type =~ /\AArray<(.*)>/i
134
+ # check to ensure the input is an array given that the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
138
+ end
139
+ elsif !attributes[self.class.attribute_map[key]].nil?
140
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
141
+ end
142
+ end
143
+
144
+ self
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def _deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = OryKratosClient.const_get(type)
186
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end