ory-client 0.0.1.alpha14 → 0.0.1.alpha18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +144 -150
  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/AuthenticatorAssuranceLevel.md +15 -0
  8. data/docs/ContainerChangeResponseItem.md +2 -2
  9. data/docs/ContainerCreateCreatedBody.md +2 -2
  10. data/docs/ContainerTopOKBody.md +2 -2
  11. data/docs/ContainerUpdateOKBody.md +2 -2
  12. data/docs/ContainerWaitOKBody.md +2 -2
  13. data/docs/ContainerWaitOKBodyError.md +2 -2
  14. data/docs/ErrorResponse.md +2 -2
  15. data/docs/GenericError.md +3 -3
  16. data/docs/GraphDriverData.md +2 -2
  17. data/docs/HealthNotReadyStatus.md +2 -2
  18. data/docs/HealthStatus.md +2 -2
  19. data/docs/IdResponse.md +2 -2
  20. data/docs/Identity.md +8 -2
  21. data/docs/IdentityCredentials.md +3 -3
  22. data/docs/IdentityCredentialsType.md +15 -0
  23. data/docs/IdentityState.md +15 -0
  24. data/docs/ImageDeleteResponseItem.md +2 -2
  25. data/docs/ImageSummary.md +2 -2
  26. data/docs/InlineResponse200.md +2 -2
  27. data/docs/InlineResponse2001.md +2 -2
  28. data/docs/InlineResponse503.md +2 -2
  29. data/docs/JsonError.md +2 -2
  30. data/docs/Meta.md +2 -2
  31. data/docs/MetadataApi.md +254 -0
  32. data/docs/Plugin.md +2 -2
  33. data/docs/PluginConfig.md +2 -2
  34. data/docs/PluginConfigArgs.md +2 -2
  35. data/docs/PluginConfigInterface.md +2 -2
  36. data/docs/PluginConfigLinux.md +2 -2
  37. data/docs/PluginConfigNetwork.md +2 -2
  38. data/docs/PluginConfigRootfs.md +2 -2
  39. data/docs/PluginConfigUser.md +2 -2
  40. data/docs/PluginDevice.md +2 -2
  41. data/docs/PluginEnv.md +2 -2
  42. data/docs/PluginInterfaceType.md +2 -2
  43. data/docs/PluginMount.md +2 -2
  44. data/docs/PluginSettings.md +2 -2
  45. data/docs/Port.md +2 -2
  46. data/docs/RecoveryAddress.md +2 -2
  47. data/docs/SelfServiceError.md +24 -0
  48. data/docs/SelfServiceLoginFlow.md +38 -0
  49. data/docs/SelfServiceLogoutUrl.md +18 -0
  50. data/docs/SelfServiceRecoveryFlow.md +32 -0
  51. data/docs/SelfServiceRecoveryFlowState.md +15 -0
  52. data/docs/SelfServiceRecoveryLink.md +20 -0
  53. data/docs/SelfServiceRegistrationFlow.md +30 -0
  54. data/docs/SelfServiceSettingsFlow.md +34 -0
  55. data/docs/SelfServiceSettingsFlowState.md +15 -0
  56. data/docs/SelfServiceVerificationFlow.md +32 -0
  57. data/docs/SelfServiceVerificationFlowState.md +15 -0
  58. data/docs/ServiceUpdateResponse.md +2 -2
  59. data/docs/Session.md +10 -6
  60. data/docs/SessionAuthenticationMethod.md +20 -0
  61. data/docs/SessionDevice.md +18 -0
  62. data/docs/SettingsProfileFormConfig.md +2 -2
  63. data/docs/SubmitSelfServiceLoginFlowBody.md +81 -0
  64. data/docs/SubmitSelfServiceLoginFlowWithLookupSecretMethodBody.md +22 -0
  65. data/docs/SubmitSelfServiceLoginFlowWithOidcMethodBody.md +22 -0
  66. data/docs/SubmitSelfServiceLoginFlowWithPasswordMethodBody.md +24 -0
  67. data/docs/SubmitSelfServiceLoginFlowWithTotpMethodBody.md +22 -0
  68. data/docs/SubmitSelfServiceLoginFlowWithWebAuthnMethodBody.md +22 -0
  69. data/docs/SubmitSelfServiceLogoutFlowWithoutBrowserBody.md +18 -0
  70. data/docs/SubmitSelfServiceRecoveryFlowBody.md +75 -0
  71. data/docs/SubmitSelfServiceRecoveryFlowWithLinkMethodBody.md +22 -0
  72. data/docs/SubmitSelfServiceRegistrationFlowBody.md +76 -0
  73. data/docs/SubmitSelfServiceRegistrationFlowWithOidcMethodBody.md +22 -0
  74. data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethodBody.md +24 -0
  75. data/docs/SubmitSelfServiceSettingsFlowBody.md +84 -0
  76. data/docs/SubmitSelfServiceSettingsFlowWithLookupMethodBody.md +26 -0
  77. data/docs/SubmitSelfServiceSettingsFlowWithOidcMethodBody.md +24 -0
  78. data/docs/SubmitSelfServiceSettingsFlowWithPasswordMethodBody.md +22 -0
  79. data/docs/SubmitSelfServiceSettingsFlowWithProfileMethodBody.md +22 -0
  80. data/docs/SubmitSelfServiceSettingsFlowWithTotpMethodBody.md +24 -0
  81. data/docs/SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody.md +26 -0
  82. data/docs/SubmitSelfServiceVerificationFlowBody.md +75 -0
  83. data/docs/SubmitSelfServiceVerificationFlowWithLinkMethodBody.md +22 -0
  84. data/docs/SuccessfulSelfServiceLoginWithoutBrowser.md +20 -0
  85. data/docs/SuccessfulSelfServiceRegistrationWithoutBrowser.md +22 -0
  86. data/docs/SuccessfulSelfServiceSettingsWithoutBrowser.md +20 -0
  87. data/docs/UiContainer.md +2 -2
  88. data/docs/UiNode.md +2 -2
  89. data/docs/UiNodeAnchorAttributes.md +4 -2
  90. data/docs/UiNodeAttributes.md +4 -4
  91. data/docs/UiNodeImageAttributes.md +9 -3
  92. data/docs/UiNodeInputAttributes.md +4 -2
  93. data/docs/UiNodeTextAttributes.md +4 -2
  94. data/docs/UiText.md +2 -2
  95. data/docs/V0alpha1Api.md +2184 -0
  96. data/docs/V0alpha2Api.md +2194 -0
  97. data/docs/VerifiableIdentityAddress.md +2 -2
  98. data/docs/Version.md +2 -2
  99. data/docs/Volume.md +2 -2
  100. data/docs/VolumeUsageData.md +2 -2
  101. data/lib/ory-client/api/default_api.rb +1 -1
  102. data/lib/ory-client/api/metadata_api.rb +248 -0
  103. data/lib/ory-client/api/v0alpha1_api.rb +2054 -0
  104. data/lib/ory-client/api/v0alpha2_api.rb +2069 -0
  105. data/lib/ory-client/api_client.rb +4 -4
  106. data/lib/ory-client/api_error.rb +3 -3
  107. data/lib/ory-client/configuration.rb +5 -19
  108. data/lib/ory-client/models/admin_create_identity_body.rb +239 -0
  109. data/lib/ory-client/models/admin_create_self_service_recovery_link_body.rb +250 -0
  110. data/lib/ory-client/models/admin_update_identity_body.rb +248 -0
  111. data/lib/ory-client/models/authenticate_ok_body.rb +6 -6
  112. data/lib/ory-client/models/authenticator_assurance_level.rb +39 -0
  113. data/lib/ory-client/models/container_change_response_item.rb +6 -6
  114. data/lib/ory-client/models/container_create_created_body.rb +6 -6
  115. data/lib/ory-client/models/container_top_ok_body.rb +6 -6
  116. data/lib/ory-client/models/container_update_ok_body.rb +6 -6
  117. data/lib/ory-client/models/container_wait_ok_body.rb +6 -6
  118. data/lib/ory-client/models/container_wait_ok_body_error.rb +6 -6
  119. data/lib/ory-client/models/create_identity.rb +1 -1
  120. data/lib/ory-client/models/create_recovery_link.rb +1 -1
  121. data/lib/ory-client/models/error_response.rb +6 -6
  122. data/lib/ory-client/models/generic_error.rb +8 -10
  123. data/lib/ory-client/models/graph_driver_data.rb +6 -6
  124. data/lib/ory-client/models/health_not_ready_status.rb +6 -6
  125. data/lib/ory-client/models/health_status.rb +6 -6
  126. data/lib/ory-client/models/id_response.rb +6 -6
  127. data/lib/ory-client/models/identity.rb +37 -7
  128. data/lib/ory-client/models/identity_credentials.rb +7 -8
  129. data/lib/ory-client/models/identity_credentials_type.rb +38 -0
  130. data/lib/ory-client/models/identity_state.rb +37 -0
  131. data/lib/ory-client/models/image_delete_response_item.rb +6 -6
  132. data/lib/ory-client/models/image_summary.rb +6 -6
  133. data/lib/ory-client/models/inline_response200.rb +6 -6
  134. data/lib/ory-client/models/inline_response2001.rb +6 -6
  135. data/lib/ory-client/models/inline_response503.rb +6 -6
  136. data/lib/ory-client/models/json_error.rb +6 -6
  137. data/lib/ory-client/models/login_flow.rb +1 -1
  138. data/lib/ory-client/models/login_via_api_response.rb +1 -1
  139. data/lib/ory-client/models/meta.rb +6 -6
  140. data/lib/ory-client/models/plugin.rb +6 -6
  141. data/lib/ory-client/models/plugin_config.rb +6 -6
  142. data/lib/ory-client/models/plugin_config_args.rb +6 -6
  143. data/lib/ory-client/models/plugin_config_interface.rb +6 -6
  144. data/lib/ory-client/models/plugin_config_linux.rb +6 -6
  145. data/lib/ory-client/models/plugin_config_network.rb +6 -6
  146. data/lib/ory-client/models/plugin_config_rootfs.rb +6 -6
  147. data/lib/ory-client/models/plugin_config_user.rb +6 -6
  148. data/lib/ory-client/models/plugin_device.rb +6 -6
  149. data/lib/ory-client/models/plugin_env.rb +6 -6
  150. data/lib/ory-client/models/plugin_interface_type.rb +6 -6
  151. data/lib/ory-client/models/plugin_mount.rb +6 -6
  152. data/lib/ory-client/models/plugin_settings.rb +6 -6
  153. data/lib/ory-client/models/port.rb +6 -6
  154. data/lib/ory-client/models/recovery_address.rb +6 -6
  155. data/lib/ory-client/models/recovery_flow.rb +1 -1
  156. data/lib/ory-client/models/recovery_link.rb +1 -1
  157. data/lib/ory-client/models/registration_flow.rb +1 -1
  158. data/lib/ory-client/models/registration_via_api_response.rb +1 -1
  159. data/lib/ory-client/models/revoke_session.rb +1 -1
  160. data/lib/ory-client/models/self_service_error.rb +252 -0
  161. data/lib/ory-client/models/self_service_error_container.rb +1 -1
  162. data/lib/ory-client/models/self_service_login_flow.rb +346 -0
  163. data/lib/ory-client/models/self_service_logout_url.rb +219 -0
  164. data/lib/ory-client/models/self_service_recovery_flow.rb +317 -0
  165. data/lib/ory-client/models/self_service_recovery_flow_state.rb +38 -0
  166. data/lib/ory-client/models/self_service_recovery_link.rb +234 -0
  167. data/lib/ory-client/models/self_service_registration_flow.rb +301 -0
  168. data/lib/ory-client/models/self_service_settings_flow.rb +331 -0
  169. data/lib/ory-client/models/self_service_settings_flow_state.rb +37 -0
  170. data/lib/ory-client/models/self_service_verification_flow.rb +307 -0
  171. data/lib/ory-client/models/self_service_verification_flow_state.rb +38 -0
  172. data/lib/ory-client/models/service_update_response.rb +6 -6
  173. data/lib/ory-client/models/session.rb +33 -22
  174. data/lib/ory-client/models/session_authentication_method.rb +263 -0
  175. data/lib/ory-client/models/session_device.rb +219 -0
  176. data/lib/ory-client/models/settings_flow.rb +1 -1
  177. data/lib/ory-client/models/settings_profile_form_config.rb +6 -6
  178. data/lib/ory-client/models/settings_via_api_response.rb +1 -1
  179. data/lib/ory-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +1 -1
  180. data/lib/ory-client/models/submit_self_service_login_flow.rb +1 -1
  181. data/lib/ory-client/models/submit_self_service_login_flow_body.rb +57 -0
  182. data/lib/ory-client/models/submit_self_service_login_flow_with_lookup_secret_method_body.rb +249 -0
  183. data/lib/ory-client/models/submit_self_service_login_flow_with_oidc_method_body.rb +250 -0
  184. data/lib/ory-client/models/submit_self_service_login_flow_with_password_method.rb +1 -1
  185. data/lib/ory-client/models/submit_self_service_login_flow_with_password_method_body.rb +298 -0
  186. data/lib/ory-client/models/submit_self_service_login_flow_with_totp_method_body.rb +249 -0
  187. data/lib/ory-client/models/submit_self_service_login_flow_with_web_authn_method_body.rb +244 -0
  188. data/lib/ory-client/models/submit_self_service_logout_flow_without_browser_body.rb +225 -0
  189. data/lib/ory-client/models/submit_self_service_recovery_flow_body.rb +53 -0
  190. data/lib/ory-client/models/submit_self_service_recovery_flow_with_link_method.rb +1 -1
  191. data/lib/ory-client/models/submit_self_service_recovery_flow_with_link_method_body.rb +283 -0
  192. data/lib/ory-client/models/submit_self_service_registration_flow.rb +1 -1
  193. data/lib/ory-client/models/submit_self_service_registration_flow_body.rb +54 -0
  194. data/lib/ory-client/models/submit_self_service_registration_flow_with_oidc_method_body.rb +250 -0
  195. data/lib/ory-client/models/submit_self_service_registration_flow_with_password_method.rb +1 -1
  196. data/lib/ory-client/models/submit_self_service_registration_flow_with_password_method_body.rb +299 -0
  197. data/lib/ory-client/models/submit_self_service_settings_flow.rb +1 -1
  198. data/lib/ory-client/models/submit_self_service_settings_flow_body.rb +59 -0
  199. data/lib/ory-client/models/submit_self_service_settings_flow_with_lookup_method_body.rb +264 -0
  200. data/lib/ory-client/models/submit_self_service_settings_flow_with_oidc_method_body.rb +255 -0
  201. data/lib/ory-client/models/submit_self_service_settings_flow_with_password_method.rb +1 -1
  202. data/lib/ory-client/models/submit_self_service_settings_flow_with_password_method_body.rb +283 -0
  203. data/lib/ory-client/models/submit_self_service_settings_flow_with_profile_method.rb +1 -1
  204. data/lib/ory-client/models/submit_self_service_settings_flow_with_profile_method_body.rb +250 -0
  205. data/lib/ory-client/models/submit_self_service_settings_flow_with_totp_method_body.rb +254 -0
  206. data/lib/ory-client/models/submit_self_service_settings_flow_with_web_authn_method_body.rb +264 -0
  207. data/lib/ory-client/models/submit_self_service_verification_flow_body.rb +54 -0
  208. data/lib/ory-client/models/submit_self_service_verification_flow_with_link_method.rb +1 -1
  209. data/lib/ory-client/models/submit_self_service_verification_flow_with_link_method_body.rb +283 -0
  210. data/lib/ory-client/models/successful_self_service_login_without_browser.rb +234 -0
  211. data/lib/ory-client/models/successful_self_service_registration_without_browser.rb +243 -0
  212. data/lib/ory-client/models/successful_self_service_settings_without_browser.rb +238 -0
  213. data/lib/ory-client/models/ui_container.rb +6 -6
  214. data/lib/ory-client/models/ui_node.rb +6 -6
  215. data/lib/ory-client/models/ui_node_anchor_attributes.rb +22 -7
  216. data/lib/ory-client/models/ui_node_attributes.rb +4 -4
  217. data/lib/ory-client/models/ui_node_image_attributes.rb +45 -10
  218. data/lib/ory-client/models/ui_node_input_attributes.rb +17 -7
  219. data/lib/ory-client/models/ui_node_text_attributes.rb +22 -7
  220. data/lib/ory-client/models/ui_text.rb +6 -6
  221. data/lib/ory-client/models/update_identity.rb +1 -1
  222. data/lib/ory-client/models/verifiable_identity_address.rb +6 -6
  223. data/lib/ory-client/models/verification_flow.rb +1 -1
  224. data/lib/ory-client/models/version.rb +6 -6
  225. data/lib/ory-client/models/volume.rb +6 -6
  226. data/lib/ory-client/models/volume_usage_data.rb +6 -6
  227. data/lib/ory-client/version.rb +4 -4
  228. data/lib/ory-client.rb +48 -29
  229. data/ory-client.gemspec +3 -3
  230. data/spec/api/metadata_api_spec.rb +79 -0
  231. data/spec/api/v0alpha1_api_spec.rb +429 -0
  232. data/spec/api/v0alpha2_api_spec.rb +434 -0
  233. data/spec/api_client_spec.rb +31 -31
  234. data/spec/configuration_spec.rb +5 -5
  235. data/spec/models/admin_create_identity_body_spec.rb +40 -0
  236. data/spec/models/admin_create_self_service_recovery_link_body_spec.rb +40 -0
  237. data/spec/models/admin_update_identity_body_spec.rb +46 -0
  238. data/spec/models/authenticator_assurance_level_spec.rb +28 -0
  239. data/spec/models/identity_credentials_type_spec.rb +28 -0
  240. data/spec/models/identity_state_spec.rb +28 -0
  241. data/spec/models/self_service_error_spec.rb +52 -0
  242. data/spec/models/self_service_login_flow_spec.rb +88 -0
  243. data/spec/models/self_service_logout_url_spec.rb +34 -0
  244. data/spec/models/self_service_recovery_flow_spec.rb +76 -0
  245. data/spec/models/self_service_recovery_flow_state_spec.rb +28 -0
  246. data/spec/models/self_service_recovery_link_spec.rb +40 -0
  247. data/spec/models/self_service_registration_flow_spec.rb +70 -0
  248. data/spec/models/self_service_settings_flow_spec.rb +82 -0
  249. data/spec/models/self_service_settings_flow_state_spec.rb +28 -0
  250. data/spec/models/self_service_verification_flow_spec.rb +76 -0
  251. data/spec/models/self_service_verification_flow_state_spec.rb +28 -0
  252. data/spec/models/session_authentication_method_spec.rb +44 -0
  253. data/spec/models/session_device_spec.rb +34 -0
  254. data/spec/models/submit_self_service_login_flow_body_spec.rb +43 -0
  255. data/spec/models/submit_self_service_login_flow_with_lookup_secret_method_body_spec.rb +46 -0
  256. data/spec/models/submit_self_service_login_flow_with_oidc_method_body_spec.rb +46 -0
  257. data/spec/models/submit_self_service_login_flow_with_password_method_body_spec.rb +56 -0
  258. data/spec/models/submit_self_service_login_flow_with_totp_method_body_spec.rb +46 -0
  259. data/spec/models/submit_self_service_login_flow_with_web_authn_method_body_spec.rb +46 -0
  260. data/spec/models/submit_self_service_logout_flow_without_browser_body_spec.rb +34 -0
  261. data/spec/models/submit_self_service_recovery_flow_body_spec.rb +43 -0
  262. data/spec/models/submit_self_service_recovery_flow_with_link_method_body_spec.rb +50 -0
  263. data/spec/models/submit_self_service_registration_flow_body_spec.rb +43 -0
  264. data/spec/models/submit_self_service_registration_flow_with_oidc_method_body_spec.rb +46 -0
  265. data/spec/models/submit_self_service_registration_flow_with_password_method_body_spec.rb +56 -0
  266. data/spec/models/submit_self_service_settings_flow_body_spec.rb +43 -0
  267. data/spec/models/submit_self_service_settings_flow_with_lookup_method_body_spec.rb +58 -0
  268. data/spec/models/submit_self_service_settings_flow_with_oidc_method_body_spec.rb +52 -0
  269. data/spec/models/submit_self_service_settings_flow_with_password_method_body_spec.rb +50 -0
  270. data/spec/models/submit_self_service_settings_flow_with_profile_method_body_spec.rb +46 -0
  271. data/spec/models/submit_self_service_settings_flow_with_totp_method_body_spec.rb +52 -0
  272. data/spec/models/submit_self_service_settings_flow_with_web_authn_method_body_spec.rb +58 -0
  273. data/spec/models/submit_self_service_verification_flow_body_spec.rb +43 -0
  274. data/spec/models/submit_self_service_verification_flow_with_link_method_body_spec.rb +50 -0
  275. data/spec/models/successful_self_service_login_without_browser_spec.rb +40 -0
  276. data/spec/models/successful_self_service_registration_without_browser_spec.rb +46 -0
  277. data/spec/models/successful_self_service_settings_without_browser_spec.rb +40 -0
  278. data/spec/spec_helper.rb +2 -2
  279. metadata +186 -2
@@ -1,4 +1,4 @@
1
- # OryHydraClient::VerifiableIdentityAddress
1
+ # OryClient::VerifiableIdentityAddress
2
2
 
3
3
  ## Properties
4
4
 
@@ -18,7 +18,7 @@
18
18
  ```ruby
19
19
  require 'ory-client'
20
20
 
21
- instance = OryHydraClient::VerifiableIdentityAddress.new(
21
+ instance = OryClient::VerifiableIdentityAddress.new(
22
22
  created_at: 2014-01-01T23:28:56.782Z,
23
23
  id: null,
24
24
  status: null,
data/docs/Version.md CHANGED
@@ -1,4 +1,4 @@
1
- # OryHydraClient::Version
1
+ # OryClient::Version
2
2
 
3
3
  ## Properties
4
4
 
@@ -11,7 +11,7 @@
11
11
  ```ruby
12
12
  require 'ory-client'
13
13
 
14
- instance = OryHydraClient::Version.new(
14
+ instance = OryClient::Version.new(
15
15
  version: null
16
16
  )
17
17
  ```
data/docs/Volume.md CHANGED
@@ -1,4 +1,4 @@
1
- # OryHydraClient::Volume
1
+ # OryClient::Volume
2
2
 
3
3
  ## Properties
4
4
 
@@ -19,7 +19,7 @@
19
19
  ```ruby
20
20
  require 'ory-client'
21
21
 
22
- instance = OryHydraClient::Volume.new(
22
+ instance = OryClient::Volume.new(
23
23
  created_at: null,
24
24
  driver: null,
25
25
  labels: null,
@@ -1,4 +1,4 @@
1
- # OryHydraClient::VolumeUsageData
1
+ # OryClient::VolumeUsageData
2
2
 
3
3
  ## Properties
4
4
 
@@ -12,7 +12,7 @@
12
12
  ```ruby
13
13
  require 'ory-client'
14
14
 
15
- instance = OryHydraClient::VolumeUsageData.new(
15
+ instance = OryClient::VolumeUsageData.new(
16
16
  ref_count: null,
17
17
  size: null
18
18
  )
@@ -3,7 +3,7 @@
3
3
 
4
4
  #Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
5
5
 
6
- The version of the OpenAPI document: v0.0.1-alpha.14
6
+ The version of the OpenAPI document: v0.0.1-alpha.15
7
7
  Contact: support@ory.sh
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.1.1
@@ -0,0 +1,248 @@
1
+ =begin
2
+ #Ory APIs
3
+
4
+ #Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
5
+
6
+ The version of the OpenAPI document: v0.0.1-alpha.18
7
+ Contact: support@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OryClient
16
+ class MetadataApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Return Running Software Version.
23
+ # This endpoint returns the version of Ory Kratos. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the version will never refer to the cluster state, only to a single instance.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [InlineResponse2001]
26
+ def get_version(opts = {})
27
+ data, _status_code, _headers = get_version_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Return Running Software Version.
32
+ # This endpoint returns the version of Ory Kratos. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the version will never refer to the cluster state, only to a single instance.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
35
+ def get_version_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: MetadataApi.get_version ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/api/kratos/public/version'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'InlineResponse2001'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || []
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"MetadataApi.get_version",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: MetadataApi#get_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Check HTTP Server Status
80
+ # This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming HTTP requests. This status does currently not include checks whether the database connection is working. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [InlineResponse200]
83
+ def is_alive(opts = {})
84
+ data, _status_code, _headers = is_alive_with_http_info(opts)
85
+ data
86
+ end
87
+
88
+ # Check HTTP Server Status
89
+ # This endpoint returns a HTTP 200 status code when Ory Kratos is accepting incoming HTTP requests. This status does currently not include checks whether the database connection is working. If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set. Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
92
+ def is_alive_with_http_info(opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: MetadataApi.is_alive ...'
95
+ end
96
+ # resource path
97
+ local_var_path = '/api/kratos/public/health/alive'
98
+
99
+ # query parameters
100
+ query_params = opts[:query_params] || {}
101
+
102
+ # header parameters
103
+ header_params = opts[:header_params] || {}
104
+ # HTTP header 'Accept' (if needed)
105
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
106
+
107
+ # form parameters
108
+ form_params = opts[:form_params] || {}
109
+
110
+ # http body (model)
111
+ post_body = opts[:debug_body]
112
+
113
+ # return_type
114
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
115
+
116
+ # auth_names
117
+ auth_names = opts[:debug_auth_names] || []
118
+
119
+ new_options = opts.merge(
120
+ :operation => :"MetadataApi.is_alive",
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => return_type
127
+ )
128
+
129
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
130
+ if @api_client.config.debugging
131
+ @api_client.config.logger.debug "API called: MetadataApi#is_alive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
132
+ end
133
+ return data, status_code, headers
134
+ end
135
+
136
+ # Check HTTP Server and Database Status
137
+ # This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g. the database) are responsive as well. If the service supports TLS Edge Termination, this endpoint does not require the `X-Forwarded-Proto` header to be set. Be aware that if you are running multiple nodes of Ory Kratos, the health status will never refer to the cluster state, only to a single instance.
138
+ # @param [Hash] opts the optional parameters
139
+ # @return [InlineResponse200]
140
+ def is_ready(opts = {})
141
+ data, _status_code, _headers = is_ready_with_http_info(opts)
142
+ data
143
+ end
144
+
145
+ # Check HTTP Server and Database Status
146
+ # This endpoint returns a HTTP 200 status code when Ory Kratos is up running and the environment dependencies (e.g. the database) are responsive as well. If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set. Be aware that if you are running multiple nodes of Ory Kratos, the health status will never refer to the cluster state, only to a single instance.
147
+ # @param [Hash] opts the optional parameters
148
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
149
+ def is_ready_with_http_info(opts = {})
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug 'Calling API: MetadataApi.is_ready ...'
152
+ end
153
+ # resource path
154
+ local_var_path = '/api/kratos/public/health/ready'
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+
159
+ # header parameters
160
+ header_params = opts[:header_params] || {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
163
+
164
+ # form parameters
165
+ form_params = opts[:form_params] || {}
166
+
167
+ # http body (model)
168
+ post_body = opts[:debug_body]
169
+
170
+ # return_type
171
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
172
+
173
+ # auth_names
174
+ auth_names = opts[:debug_auth_names] || []
175
+
176
+ new_options = opts.merge(
177
+ :operation => :"MetadataApi.is_ready",
178
+ :header_params => header_params,
179
+ :query_params => query_params,
180
+ :form_params => form_params,
181
+ :body => post_body,
182
+ :auth_names => auth_names,
183
+ :return_type => return_type
184
+ )
185
+
186
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: MetadataApi#is_ready\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+
193
+ # Get snapshot metrics from the service. If you're using k8s, you can then add annotations to your deployment like so:
194
+ # ``` metadata: annotations: prometheus.io/port: \"4434\" prometheus.io/path: \"/metrics/prometheus\" ```
195
+ # @param [Hash] opts the optional parameters
196
+ # @return [nil]
197
+ def prometheus(opts = {})
198
+ prometheus_with_http_info(opts)
199
+ nil
200
+ end
201
+
202
+ # Get snapshot metrics from the service. If you&#39;re using k8s, you can then add annotations to your deployment like so:
203
+ # &#x60;&#x60;&#x60; metadata: annotations: prometheus.io/port: \&quot;4434\&quot; prometheus.io/path: \&quot;/metrics/prometheus\&quot; &#x60;&#x60;&#x60;
204
+ # @param [Hash] opts the optional parameters
205
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
206
+ def prometheus_with_http_info(opts = {})
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug 'Calling API: MetadataApi.prometheus ...'
209
+ end
210
+ # resource path
211
+ local_var_path = '/api/kratos/public/metrics/prometheus'
212
+
213
+ # query parameters
214
+ query_params = opts[:query_params] || {}
215
+
216
+ # header parameters
217
+ header_params = opts[:header_params] || {}
218
+
219
+ # form parameters
220
+ form_params = opts[:form_params] || {}
221
+
222
+ # http body (model)
223
+ post_body = opts[:debug_body]
224
+
225
+ # return_type
226
+ return_type = opts[:debug_return_type]
227
+
228
+ # auth_names
229
+ auth_names = opts[:debug_auth_names] || []
230
+
231
+ new_options = opts.merge(
232
+ :operation => :"MetadataApi.prometheus",
233
+ :header_params => header_params,
234
+ :query_params => query_params,
235
+ :form_params => form_params,
236
+ :body => post_body,
237
+ :auth_names => auth_names,
238
+ :return_type => return_type
239
+ )
240
+
241
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
242
+ if @api_client.config.debugging
243
+ @api_client.config.logger.debug "API called: MetadataApi#prometheus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
244
+ end
245
+ return data, status_code, headers
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,2054 @@
1
+ =begin
2
+ #Ory APIs
3
+
4
+ #Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
5
+
6
+ The version of the OpenAPI document: v0.0.1-alpha.17
7
+ Contact: support@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module OryHydraClient
16
+ class V0alpha1Api
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create an Identity
23
+ # This endpoint creates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [AdminCreateIdentityBody] :admin_create_identity_body
26
+ # @return [Identity]
27
+ def admin_create_identity(opts = {})
28
+ data, _status_code, _headers = admin_create_identity_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Create an Identity
33
+ # This endpoint creates an identity. It is NOT possible to set an identity&#39;s credentials (password, ...) using this method! A way to achieve that will be introduced in the future. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [AdminCreateIdentityBody] :admin_create_identity_body
36
+ # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers
37
+ def admin_create_identity_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_create_identity ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/api/kratos/admin/identities'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
51
+ # HTTP header 'Content-Type'
52
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
53
+
54
+ # form parameters
55
+ form_params = opts[:form_params] || {}
56
+
57
+ # http body (model)
58
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'admin_create_identity_body'])
59
+
60
+ # return_type
61
+ return_type = opts[:debug_return_type] || 'Identity'
62
+
63
+ # auth_names
64
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
65
+
66
+ new_options = opts.merge(
67
+ :operation => :"V0alpha1Api.admin_create_identity",
68
+ :header_params => header_params,
69
+ :query_params => query_params,
70
+ :form_params => form_params,
71
+ :body => post_body,
72
+ :auth_names => auth_names,
73
+ :return_type => return_type
74
+ )
75
+
76
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
77
+ if @api_client.config.debugging
78
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_create_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
79
+ end
80
+ return data, status_code, headers
81
+ end
82
+
83
+ # Create a Recovery Link
84
+ # This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.
85
+ # @param [Hash] opts the optional parameters
86
+ # @option opts [AdminCreateSelfServiceRecoveryLinkBody] :admin_create_self_service_recovery_link_body
87
+ # @return [SelfServiceRecoveryLink]
88
+ def admin_create_self_service_recovery_link(opts = {})
89
+ data, _status_code, _headers = admin_create_self_service_recovery_link_with_http_info(opts)
90
+ data
91
+ end
92
+
93
+ # Create a Recovery Link
94
+ # This endpoint creates a recovery link which should be given to the user in order for them to recover (or activate) their account.
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [AdminCreateSelfServiceRecoveryLinkBody] :admin_create_self_service_recovery_link_body
97
+ # @return [Array<(SelfServiceRecoveryLink, Integer, Hash)>] SelfServiceRecoveryLink data, response status code and response headers
98
+ def admin_create_self_service_recovery_link_with_http_info(opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_create_self_service_recovery_link ...'
101
+ end
102
+ # resource path
103
+ local_var_path = '/api/kratos/admin/recovery/link'
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
112
+ # HTTP header 'Content-Type'
113
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
114
+
115
+ # form parameters
116
+ form_params = opts[:form_params] || {}
117
+
118
+ # http body (model)
119
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'admin_create_self_service_recovery_link_body'])
120
+
121
+ # return_type
122
+ return_type = opts[:debug_return_type] || 'SelfServiceRecoveryLink'
123
+
124
+ # auth_names
125
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
126
+
127
+ new_options = opts.merge(
128
+ :operation => :"V0alpha1Api.admin_create_self_service_recovery_link",
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => return_type
135
+ )
136
+
137
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
138
+ if @api_client.config.debugging
139
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_create_self_service_recovery_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
140
+ end
141
+ return data, status_code, headers
142
+ end
143
+
144
+ # Delete an Identity
145
+ # Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
146
+ # @param id [String] ID is the identity&#39;s ID.
147
+ # @param [Hash] opts the optional parameters
148
+ # @return [nil]
149
+ def admin_delete_identity(id, opts = {})
150
+ admin_delete_identity_with_http_info(id, opts)
151
+ nil
152
+ end
153
+
154
+ # Delete an Identity
155
+ # Calling this endpoint irrecoverably and permanently deletes the identity given its ID. This action can not be undone. This endpoint returns 204 when the identity was deleted or when the identity was not found, in which case it is assumed that is has been deleted already. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
156
+ # @param id [String] ID is the identity&#39;s ID.
157
+ # @param [Hash] opts the optional parameters
158
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
159
+ def admin_delete_identity_with_http_info(id, opts = {})
160
+ if @api_client.config.debugging
161
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_delete_identity ...'
162
+ end
163
+ # verify the required parameter 'id' is set
164
+ if @api_client.config.client_side_validation && id.nil?
165
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.admin_delete_identity"
166
+ end
167
+ # resource path
168
+ local_var_path = '/api/kratos/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
169
+
170
+ # query parameters
171
+ query_params = opts[:query_params] || {}
172
+
173
+ # header parameters
174
+ header_params = opts[:header_params] || {}
175
+ # HTTP header 'Accept' (if needed)
176
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
177
+
178
+ # form parameters
179
+ form_params = opts[:form_params] || {}
180
+
181
+ # http body (model)
182
+ post_body = opts[:debug_body]
183
+
184
+ # return_type
185
+ return_type = opts[:debug_return_type]
186
+
187
+ # auth_names
188
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
189
+
190
+ new_options = opts.merge(
191
+ :operation => :"V0alpha1Api.admin_delete_identity",
192
+ :header_params => header_params,
193
+ :query_params => query_params,
194
+ :form_params => form_params,
195
+ :body => post_body,
196
+ :auth_names => auth_names,
197
+ :return_type => return_type
198
+ )
199
+
200
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
201
+ if @api_client.config.debugging
202
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_delete_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
203
+ end
204
+ return data, status_code, headers
205
+ end
206
+
207
+ # Get an Identity
208
+ # Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
209
+ # @param id [String] ID must be set to the ID of identity you want to get
210
+ # @param [Hash] opts the optional parameters
211
+ # @return [Identity]
212
+ def admin_get_identity(id, opts = {})
213
+ data, _status_code, _headers = admin_get_identity_with_http_info(id, opts)
214
+ data
215
+ end
216
+
217
+ # Get an Identity
218
+ # Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
219
+ # @param id [String] ID must be set to the ID of identity you want to get
220
+ # @param [Hash] opts the optional parameters
221
+ # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers
222
+ def admin_get_identity_with_http_info(id, opts = {})
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_get_identity ...'
225
+ end
226
+ # verify the required parameter 'id' is set
227
+ if @api_client.config.client_side_validation && id.nil?
228
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.admin_get_identity"
229
+ end
230
+ # resource path
231
+ local_var_path = '/api/kratos/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
232
+
233
+ # query parameters
234
+ query_params = opts[:query_params] || {}
235
+
236
+ # header parameters
237
+ header_params = opts[:header_params] || {}
238
+ # HTTP header 'Accept' (if needed)
239
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
240
+
241
+ # form parameters
242
+ form_params = opts[:form_params] || {}
243
+
244
+ # http body (model)
245
+ post_body = opts[:debug_body]
246
+
247
+ # return_type
248
+ return_type = opts[:debug_return_type] || 'Identity'
249
+
250
+ # auth_names
251
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
252
+
253
+ new_options = opts.merge(
254
+ :operation => :"V0alpha1Api.admin_get_identity",
255
+ :header_params => header_params,
256
+ :query_params => query_params,
257
+ :form_params => form_params,
258
+ :body => post_body,
259
+ :auth_names => auth_names,
260
+ :return_type => return_type
261
+ )
262
+
263
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
264
+ if @api_client.config.debugging
265
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_get_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
266
+ end
267
+ return data, status_code, headers
268
+ end
269
+
270
+ # List Identities
271
+ # Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
272
+ # @param [Hash] opts the optional parameters
273
+ # @option opts [Integer] :per_page Items per Page This is the number of items per page. (default to 100)
274
+ # @option opts [Integer] :page Pagination Page (default to 0)
275
+ # @return [Array<Identity>]
276
+ def admin_list_identities(opts = {})
277
+ data, _status_code, _headers = admin_list_identities_with_http_info(opts)
278
+ data
279
+ end
280
+
281
+ # List Identities
282
+ # Lists all identities. Does not support search at the moment. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
283
+ # @param [Hash] opts the optional parameters
284
+ # @option opts [Integer] :per_page Items per Page This is the number of items per page.
285
+ # @option opts [Integer] :page Pagination Page
286
+ # @return [Array<(Array<Identity>, Integer, Hash)>] Array<Identity> data, response status code and response headers
287
+ def admin_list_identities_with_http_info(opts = {})
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_list_identities ...'
290
+ end
291
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 500
292
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling V0alpha1Api.admin_list_identities, must be smaller than or equal to 500.'
293
+ end
294
+
295
+ if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
296
+ fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling V0alpha1Api.admin_list_identities, must be greater than or equal to 1.'
297
+ end
298
+
299
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 0
300
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling V0alpha1Api.admin_list_identities, must be greater than or equal to 0.'
301
+ end
302
+
303
+ # resource path
304
+ local_var_path = '/api/kratos/admin/identities'
305
+
306
+ # query parameters
307
+ query_params = opts[:query_params] || {}
308
+ query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
309
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
310
+
311
+ # header parameters
312
+ header_params = opts[:header_params] || {}
313
+ # HTTP header 'Accept' (if needed)
314
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
315
+
316
+ # form parameters
317
+ form_params = opts[:form_params] || {}
318
+
319
+ # http body (model)
320
+ post_body = opts[:debug_body]
321
+
322
+ # return_type
323
+ return_type = opts[:debug_return_type] || 'Array<Identity>'
324
+
325
+ # auth_names
326
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
327
+
328
+ new_options = opts.merge(
329
+ :operation => :"V0alpha1Api.admin_list_identities",
330
+ :header_params => header_params,
331
+ :query_params => query_params,
332
+ :form_params => form_params,
333
+ :body => post_body,
334
+ :auth_names => auth_names,
335
+ :return_type => return_type
336
+ )
337
+
338
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
339
+ if @api_client.config.debugging
340
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_list_identities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
341
+ end
342
+ return data, status_code, headers
343
+ end
344
+
345
+ # Update an Identity
346
+ # This endpoint updates an identity. It is NOT possible to set an identity's credentials (password, ...) using this method! A way to achieve that will be introduced in the future. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [Ory Kratos' User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
347
+ # @param id [String] ID must be set to the ID of identity you want to update
348
+ # @param [Hash] opts the optional parameters
349
+ # @option opts [AdminUpdateIdentityBody] :admin_update_identity_body
350
+ # @return [Identity]
351
+ def admin_update_identity(id, opts = {})
352
+ data, _status_code, _headers = admin_update_identity_with_http_info(id, opts)
353
+ data
354
+ end
355
+
356
+ # Update an Identity
357
+ # This endpoint updates an identity. It is NOT possible to set an identity&#39;s credentials (password, ...) using this method! A way to achieve that will be introduced in the future. The full identity payload (except credentials) is expected. This endpoint does not support patching. Learn how identities work in [Ory Kratos&#39; User And Identity Model Documentation](https://www.ory.sh/docs/next/kratos/concepts/identity-user-model).
358
+ # @param id [String] ID must be set to the ID of identity you want to update
359
+ # @param [Hash] opts the optional parameters
360
+ # @option opts [AdminUpdateIdentityBody] :admin_update_identity_body
361
+ # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers
362
+ def admin_update_identity_with_http_info(id, opts = {})
363
+ if @api_client.config.debugging
364
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.admin_update_identity ...'
365
+ end
366
+ # verify the required parameter 'id' is set
367
+ if @api_client.config.client_side_validation && id.nil?
368
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.admin_update_identity"
369
+ end
370
+ # resource path
371
+ local_var_path = '/api/kratos/admin/identities/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
372
+
373
+ # query parameters
374
+ query_params = opts[:query_params] || {}
375
+
376
+ # header parameters
377
+ header_params = opts[:header_params] || {}
378
+ # HTTP header 'Accept' (if needed)
379
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
380
+ # HTTP header 'Content-Type'
381
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
382
+
383
+ # form parameters
384
+ form_params = opts[:form_params] || {}
385
+
386
+ # http body (model)
387
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'admin_update_identity_body'])
388
+
389
+ # return_type
390
+ return_type = opts[:debug_return_type] || 'Identity'
391
+
392
+ # auth_names
393
+ auth_names = opts[:debug_auth_names] || ['oryAccessToken']
394
+
395
+ new_options = opts.merge(
396
+ :operation => :"V0alpha1Api.admin_update_identity",
397
+ :header_params => header_params,
398
+ :query_params => query_params,
399
+ :form_params => form_params,
400
+ :body => post_body,
401
+ :auth_names => auth_names,
402
+ :return_type => return_type
403
+ )
404
+
405
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
406
+ if @api_client.config.debugging
407
+ @api_client.config.logger.debug "API called: V0alpha1Api#admin_update_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
408
+ end
409
+ return data, status_code, headers
410
+ end
411
+
412
+ # Create a Logout URL for Browsers
413
+ # This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the `/self-service/logout/api` URL directly with the Ory Session Token. The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error. When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.
414
+ # @param [Hash] opts the optional parameters
415
+ # @option opts [String] :cookie HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request.
416
+ # @return [SelfServiceLogoutUrl]
417
+ def create_self_service_logout_flow_url_for_browsers(opts = {})
418
+ data, _status_code, _headers = create_self_service_logout_flow_url_for_browsers_with_http_info(opts)
419
+ data
420
+ end
421
+
422
+ # Create a Logout URL for Browsers
423
+ # This endpoint initializes a browser-based user logout flow and a URL which can be used to log out the user. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the &#x60;/self-service/logout/api&#x60; URL directly with the Ory Session Token. The URL is only valid for the currently signed in user. If no user is signed in, this endpoint returns a 401 error. When calling this endpoint from a backend, please ensure to properly forward the HTTP cookies.
424
+ # @param [Hash] opts the optional parameters
425
+ # @option opts [String] :cookie HTTP Cookies If you call this endpoint from a backend, please include the original Cookie header in the request.
426
+ # @return [Array<(SelfServiceLogoutUrl, Integer, Hash)>] SelfServiceLogoutUrl data, response status code and response headers
427
+ def create_self_service_logout_flow_url_for_browsers_with_http_info(opts = {})
428
+ if @api_client.config.debugging
429
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.create_self_service_logout_flow_url_for_browsers ...'
430
+ end
431
+ # resource path
432
+ local_var_path = '/api/kratos/public/self-service/logout/browser'
433
+
434
+ # query parameters
435
+ query_params = opts[:query_params] || {}
436
+
437
+ # header parameters
438
+ header_params = opts[:header_params] || {}
439
+ # HTTP header 'Accept' (if needed)
440
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
441
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
442
+
443
+ # form parameters
444
+ form_params = opts[:form_params] || {}
445
+
446
+ # http body (model)
447
+ post_body = opts[:debug_body]
448
+
449
+ # return_type
450
+ return_type = opts[:debug_return_type] || 'SelfServiceLogoutUrl'
451
+
452
+ # auth_names
453
+ auth_names = opts[:debug_auth_names] || []
454
+
455
+ new_options = opts.merge(
456
+ :operation => :"V0alpha1Api.create_self_service_logout_flow_url_for_browsers",
457
+ :header_params => header_params,
458
+ :query_params => query_params,
459
+ :form_params => form_params,
460
+ :body => post_body,
461
+ :auth_names => auth_names,
462
+ :return_type => return_type
463
+ )
464
+
465
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
466
+ if @api_client.config.debugging
467
+ @api_client.config.logger.debug "API called: V0alpha1Api#create_self_service_logout_flow_url_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
468
+ end
469
+ return data, status_code, headers
470
+ end
471
+
472
+ # Get a JSON Schema
473
+ # @param id [String] ID must be set to the ID of schema you want to get
474
+ # @param [Hash] opts the optional parameters
475
+ # @return [Object]
476
+ def get_json_schema(id, opts = {})
477
+ data, _status_code, _headers = get_json_schema_with_http_info(id, opts)
478
+ data
479
+ end
480
+
481
+ # Get a JSON Schema
482
+ # @param id [String] ID must be set to the ID of schema you want to get
483
+ # @param [Hash] opts the optional parameters
484
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
485
+ def get_json_schema_with_http_info(id, opts = {})
486
+ if @api_client.config.debugging
487
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_json_schema ...'
488
+ end
489
+ # verify the required parameter 'id' is set
490
+ if @api_client.config.client_side_validation && id.nil?
491
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_json_schema"
492
+ end
493
+ # resource path
494
+ local_var_path = '/api/kratos/public/schemas/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
495
+
496
+ # query parameters
497
+ query_params = opts[:query_params] || {}
498
+
499
+ # header parameters
500
+ header_params = opts[:header_params] || {}
501
+ # HTTP header 'Accept' (if needed)
502
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
503
+
504
+ # form parameters
505
+ form_params = opts[:form_params] || {}
506
+
507
+ # http body (model)
508
+ post_body = opts[:debug_body]
509
+
510
+ # return_type
511
+ return_type = opts[:debug_return_type] || 'Object'
512
+
513
+ # auth_names
514
+ auth_names = opts[:debug_auth_names] || []
515
+
516
+ new_options = opts.merge(
517
+ :operation => :"V0alpha1Api.get_json_schema",
518
+ :header_params => header_params,
519
+ :query_params => query_params,
520
+ :form_params => form_params,
521
+ :body => post_body,
522
+ :auth_names => auth_names,
523
+ :return_type => return_type
524
+ )
525
+
526
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
527
+ if @api_client.config.debugging
528
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_json_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
529
+ end
530
+ return data, status_code, headers
531
+ end
532
+
533
+ # Get Self-Service Errors
534
+ # This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: `?id=stub:500` - returns a stub 500 (Internal Server Error) error. More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
535
+ # @param id [String] Error is the error&#39;s ID
536
+ # @param [Hash] opts the optional parameters
537
+ # @return [SelfServiceError]
538
+ def get_self_service_error(id, opts = {})
539
+ data, _status_code, _headers = get_self_service_error_with_http_info(id, opts)
540
+ data
541
+ end
542
+
543
+ # Get Self-Service Errors
544
+ # This endpoint returns the error associated with a user-facing self service errors. This endpoint supports stub values to help you implement the error UI: &#x60;?id&#x3D;stub:500&#x60; - returns a stub 500 (Internal Server Error) error. More information can be found at [Ory Kratos User User Facing Error Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-facing-errors).
545
+ # @param id [String] Error is the error&#39;s ID
546
+ # @param [Hash] opts the optional parameters
547
+ # @return [Array<(SelfServiceError, Integer, Hash)>] SelfServiceError data, response status code and response headers
548
+ def get_self_service_error_with_http_info(id, opts = {})
549
+ if @api_client.config.debugging
550
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_error ...'
551
+ end
552
+ # verify the required parameter 'id' is set
553
+ if @api_client.config.client_side_validation && id.nil?
554
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_error"
555
+ end
556
+ # resource path
557
+ local_var_path = '/api/kratos/public/self-service/errors'
558
+
559
+ # query parameters
560
+ query_params = opts[:query_params] || {}
561
+ query_params[:'id'] = id
562
+
563
+ # header parameters
564
+ header_params = opts[:header_params] || {}
565
+ # HTTP header 'Accept' (if needed)
566
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
567
+
568
+ # form parameters
569
+ form_params = opts[:form_params] || {}
570
+
571
+ # http body (model)
572
+ post_body = opts[:debug_body]
573
+
574
+ # return_type
575
+ return_type = opts[:debug_return_type] || 'SelfServiceError'
576
+
577
+ # auth_names
578
+ auth_names = opts[:debug_auth_names] || []
579
+
580
+ new_options = opts.merge(
581
+ :operation => :"V0alpha1Api.get_self_service_error",
582
+ :header_params => header_params,
583
+ :query_params => query_params,
584
+ :form_params => form_params,
585
+ :body => post_body,
586
+ :auth_names => auth_names,
587
+ :return_type => return_type
588
+ )
589
+
590
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
591
+ if @api_client.config.debugging
592
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_error\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
593
+ end
594
+ return data, status_code, headers
595
+ end
596
+
597
+ # Get Login Flow
598
+ # This endpoint returns a login flow's context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request's HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: ```js pseudo-code example router.get('/login', async function (req, res) { const flow = await client.getSelfServiceLoginFlow(req.header('cookie'), req.query['flow']) res.render('login', flow) }) ``` More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
599
+ # @param id [String] The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).
600
+ # @param [Hash] opts the optional parameters
601
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
602
+ # @return [SelfServiceLoginFlow]
603
+ def get_self_service_login_flow(id, opts = {})
604
+ data, _status_code, _headers = get_self_service_login_flow_with_http_info(id, opts)
605
+ data
606
+ end
607
+
608
+ # Get Login Flow
609
+ # This endpoint returns a login flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;s HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/login&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceLoginFlow(req.header(&#39;cookie&#39;), req.query[&#39;flow&#39;]) res.render(&#39;login&#39;, flow) }) &#x60;&#x60;&#x60; More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
610
+ # @param id [String] The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).
611
+ # @param [Hash] opts the optional parameters
612
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
613
+ # @return [Array<(SelfServiceLoginFlow, Integer, Hash)>] SelfServiceLoginFlow data, response status code and response headers
614
+ def get_self_service_login_flow_with_http_info(id, opts = {})
615
+ if @api_client.config.debugging
616
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_login_flow ...'
617
+ end
618
+ # verify the required parameter 'id' is set
619
+ if @api_client.config.client_side_validation && id.nil?
620
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_login_flow"
621
+ end
622
+ # resource path
623
+ local_var_path = '/api/kratos/public/self-service/login/flows'
624
+
625
+ # query parameters
626
+ query_params = opts[:query_params] || {}
627
+ query_params[:'id'] = id
628
+
629
+ # header parameters
630
+ header_params = opts[:header_params] || {}
631
+ # HTTP header 'Accept' (if needed)
632
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
633
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
634
+
635
+ # form parameters
636
+ form_params = opts[:form_params] || {}
637
+
638
+ # http body (model)
639
+ post_body = opts[:debug_body]
640
+
641
+ # return_type
642
+ return_type = opts[:debug_return_type] || 'SelfServiceLoginFlow'
643
+
644
+ # auth_names
645
+ auth_names = opts[:debug_auth_names] || []
646
+
647
+ new_options = opts.merge(
648
+ :operation => :"V0alpha1Api.get_self_service_login_flow",
649
+ :header_params => header_params,
650
+ :query_params => query_params,
651
+ :form_params => form_params,
652
+ :body => post_body,
653
+ :auth_names => auth_names,
654
+ :return_type => return_type
655
+ )
656
+
657
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
658
+ if @api_client.config.debugging
659
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
660
+ end
661
+ return data, status_code, headers
662
+ end
663
+
664
+ # Get Recovery Flow
665
+ # This endpoint returns a recovery flow's context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request's HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: ```js pseudo-code example router.get('/recovery', async function (req, res) { const flow = await client.getSelfServiceRecoveryFlow(req.header('Cookie'), req.query['flow']) res.render('recovery', flow) }) ``` More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
666
+ # @param id [String] The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).
667
+ # @param [Hash] opts the optional parameters
668
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
669
+ # @return [SelfServiceRecoveryFlow]
670
+ def get_self_service_recovery_flow(id, opts = {})
671
+ data, _status_code, _headers = get_self_service_recovery_flow_with_http_info(id, opts)
672
+ data
673
+ end
674
+
675
+ # Get Recovery Flow
676
+ # This endpoint returns a recovery flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;s HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/recovery&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceRecoveryFlow(req.header(&#39;Cookie&#39;), req.query[&#39;flow&#39;]) res.render(&#39;recovery&#39;, flow) }) &#x60;&#x60;&#x60; More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
677
+ # @param id [String] The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).
678
+ # @param [Hash] opts the optional parameters
679
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
680
+ # @return [Array<(SelfServiceRecoveryFlow, Integer, Hash)>] SelfServiceRecoveryFlow data, response status code and response headers
681
+ def get_self_service_recovery_flow_with_http_info(id, opts = {})
682
+ if @api_client.config.debugging
683
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_recovery_flow ...'
684
+ end
685
+ # verify the required parameter 'id' is set
686
+ if @api_client.config.client_side_validation && id.nil?
687
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_recovery_flow"
688
+ end
689
+ # resource path
690
+ local_var_path = '/api/kratos/public/self-service/recovery/flows'
691
+
692
+ # query parameters
693
+ query_params = opts[:query_params] || {}
694
+ query_params[:'id'] = id
695
+
696
+ # header parameters
697
+ header_params = opts[:header_params] || {}
698
+ # HTTP header 'Accept' (if needed)
699
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
700
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
701
+
702
+ # form parameters
703
+ form_params = opts[:form_params] || {}
704
+
705
+ # http body (model)
706
+ post_body = opts[:debug_body]
707
+
708
+ # return_type
709
+ return_type = opts[:debug_return_type] || 'SelfServiceRecoveryFlow'
710
+
711
+ # auth_names
712
+ auth_names = opts[:debug_auth_names] || []
713
+
714
+ new_options = opts.merge(
715
+ :operation => :"V0alpha1Api.get_self_service_recovery_flow",
716
+ :header_params => header_params,
717
+ :query_params => query_params,
718
+ :form_params => form_params,
719
+ :body => post_body,
720
+ :auth_names => auth_names,
721
+ :return_type => return_type
722
+ )
723
+
724
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
725
+ if @api_client.config.debugging
726
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
727
+ end
728
+ return data, status_code, headers
729
+ end
730
+
731
+ # Get Registration Flow
732
+ # This endpoint returns a registration flow's context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request's HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: ```js pseudo-code example router.get('/registration', async function (req, res) { const flow = await client.getSelfServiceRegistrationFlow(req.header('cookie'), req.query['flow']) res.render('registration', flow) }) ``` More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
733
+ # @param id [String] The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).
734
+ # @param [Hash] opts the optional parameters
735
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
736
+ # @return [SelfServiceRegistrationFlow]
737
+ def get_self_service_registration_flow(id, opts = {})
738
+ data, _status_code, _headers = get_self_service_registration_flow_with_http_info(id, opts)
739
+ data
740
+ end
741
+
742
+ # Get Registration Flow
743
+ # This endpoint returns a registration flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;s HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/registration&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceRegistrationFlow(req.header(&#39;cookie&#39;), req.query[&#39;flow&#39;]) res.render(&#39;registration&#39;, flow) }) &#x60;&#x60;&#x60; More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
744
+ # @param id [String] The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).
745
+ # @param [Hash] opts the optional parameters
746
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
747
+ # @return [Array<(SelfServiceRegistrationFlow, Integer, Hash)>] SelfServiceRegistrationFlow data, response status code and response headers
748
+ def get_self_service_registration_flow_with_http_info(id, opts = {})
749
+ if @api_client.config.debugging
750
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_registration_flow ...'
751
+ end
752
+ # verify the required parameter 'id' is set
753
+ if @api_client.config.client_side_validation && id.nil?
754
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_registration_flow"
755
+ end
756
+ # resource path
757
+ local_var_path = '/api/kratos/public/self-service/registration/flows'
758
+
759
+ # query parameters
760
+ query_params = opts[:query_params] || {}
761
+ query_params[:'id'] = id
762
+
763
+ # header parameters
764
+ header_params = opts[:header_params] || {}
765
+ # HTTP header 'Accept' (if needed)
766
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
767
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
768
+
769
+ # form parameters
770
+ form_params = opts[:form_params] || {}
771
+
772
+ # http body (model)
773
+ post_body = opts[:debug_body]
774
+
775
+ # return_type
776
+ return_type = opts[:debug_return_type] || 'SelfServiceRegistrationFlow'
777
+
778
+ # auth_names
779
+ auth_names = opts[:debug_auth_names] || []
780
+
781
+ new_options = opts.merge(
782
+ :operation => :"V0alpha1Api.get_self_service_registration_flow",
783
+ :header_params => header_params,
784
+ :query_params => query_params,
785
+ :form_params => form_params,
786
+ :body => post_body,
787
+ :auth_names => auth_names,
788
+ :return_type => return_type
789
+ )
790
+
791
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
792
+ if @api_client.config.debugging
793
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
794
+ end
795
+ return data, status_code, headers
796
+ end
797
+
798
+ # Get Settings Flow
799
+ # When accessing this endpoint through Ory Kratos' Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy. You can access this endpoint without credentials when using Ory Kratos' Admin API. More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
800
+ # @param id [String] ID is the Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).
801
+ # @param [Hash] opts the optional parameters
802
+ # @option opts [String] :x_session_token The Session Token When using the SDK in an app without a browser, please include the session token here.
803
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here. You only need to do this for browser- based flows.
804
+ # @return [SelfServiceSettingsFlow]
805
+ def get_self_service_settings_flow(id, opts = {})
806
+ data, _status_code, _headers = get_self_service_settings_flow_with_http_info(id, opts)
807
+ data
808
+ end
809
+
810
+ # Get Settings Flow
811
+ # When accessing this endpoint through Ory Kratos&#39; Public API you must ensure that either the Ory Kratos Session Cookie or the Ory Kratos Session Token are set. The public endpoint does not return 404 status codes but instead 403 or 500 to improve data privacy. You can access this endpoint without credentials when using Ory Kratos&#39; Admin API. More information can be found at [Ory Kratos User Settings &amp; Profile Management Documentation](../self-service/flows/user-settings).
812
+ # @param id [String] ID is the Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).
813
+ # @param [Hash] opts the optional parameters
814
+ # @option opts [String] :x_session_token The Session Token When using the SDK in an app without a browser, please include the session token here.
815
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here. You only need to do this for browser- based flows.
816
+ # @return [Array<(SelfServiceSettingsFlow, Integer, Hash)>] SelfServiceSettingsFlow data, response status code and response headers
817
+ def get_self_service_settings_flow_with_http_info(id, opts = {})
818
+ if @api_client.config.debugging
819
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_settings_flow ...'
820
+ end
821
+ # verify the required parameter 'id' is set
822
+ if @api_client.config.client_side_validation && id.nil?
823
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_settings_flow"
824
+ end
825
+ # resource path
826
+ local_var_path = '/api/kratos/public/self-service/settings/flows'
827
+
828
+ # query parameters
829
+ query_params = opts[:query_params] || {}
830
+ query_params[:'id'] = id
831
+
832
+ # header parameters
833
+ header_params = opts[:header_params] || {}
834
+ # HTTP header 'Accept' (if needed)
835
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
836
+ header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
837
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
838
+
839
+ # form parameters
840
+ form_params = opts[:form_params] || {}
841
+
842
+ # http body (model)
843
+ post_body = opts[:debug_body]
844
+
845
+ # return_type
846
+ return_type = opts[:debug_return_type] || 'SelfServiceSettingsFlow'
847
+
848
+ # auth_names
849
+ auth_names = opts[:debug_auth_names] || []
850
+
851
+ new_options = opts.merge(
852
+ :operation => :"V0alpha1Api.get_self_service_settings_flow",
853
+ :header_params => header_params,
854
+ :query_params => query_params,
855
+ :form_params => form_params,
856
+ :body => post_body,
857
+ :auth_names => auth_names,
858
+ :return_type => return_type
859
+ )
860
+
861
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
862
+ if @api_client.config.debugging
863
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
864
+ end
865
+ return data, status_code, headers
866
+ end
867
+
868
+ # Get Verification Flow
869
+ # This endpoint returns a verification flow's context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request's HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: ```js pseudo-code example router.get('/recovery', async function (req, res) { const flow = await client.getSelfServiceVerificationFlow(req.header('cookie'), req.query['flow']) res.render('verification', flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
870
+ # @param id [String] The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).
871
+ # @param [Hash] opts the optional parameters
872
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
873
+ # @return [SelfServiceVerificationFlow]
874
+ def get_self_service_verification_flow(id, opts = {})
875
+ data, _status_code, _headers = get_self_service_verification_flow_with_http_info(id, opts)
876
+ data
877
+ end
878
+
879
+ # Get Verification Flow
880
+ # This endpoint returns a verification flow&#39;s context with, for example, error details and other information. Browser flows expect the anti-CSRF cookie to be included in the request&#39;s HTTP Cookie Header. For AJAX requests you must ensure that cookies are included in the request or requests will fail. If you use the browser-flow for server-side apps, the services need to run on a common top-level-domain and you need to forward the incoming HTTP Cookie header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/recovery&#39;, async function (req, res) { const flow &#x3D; await client.getSelfServiceVerificationFlow(req.header(&#39;cookie&#39;), req.query[&#39;flow&#39;]) res.render(&#39;verification&#39;, flow) }) More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
881
+ # @param id [String] The Flow ID The value for this parameter comes from &#x60;request&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).
882
+ # @param [Hash] opts the optional parameters
883
+ # @option opts [String] :cookie HTTP Cookies When using the SDK on the server side you must include the HTTP Cookie Header originally sent to your HTTP handler here.
884
+ # @return [Array<(SelfServiceVerificationFlow, Integer, Hash)>] SelfServiceVerificationFlow data, response status code and response headers
885
+ def get_self_service_verification_flow_with_http_info(id, opts = {})
886
+ if @api_client.config.debugging
887
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.get_self_service_verification_flow ...'
888
+ end
889
+ # verify the required parameter 'id' is set
890
+ if @api_client.config.client_side_validation && id.nil?
891
+ fail ArgumentError, "Missing the required parameter 'id' when calling V0alpha1Api.get_self_service_verification_flow"
892
+ end
893
+ # resource path
894
+ local_var_path = '/api/kratos/public/self-service/verification/flows'
895
+
896
+ # query parameters
897
+ query_params = opts[:query_params] || {}
898
+ query_params[:'id'] = id
899
+
900
+ # header parameters
901
+ header_params = opts[:header_params] || {}
902
+ # HTTP header 'Accept' (if needed)
903
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
904
+ header_params[:'cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
905
+
906
+ # form parameters
907
+ form_params = opts[:form_params] || {}
908
+
909
+ # http body (model)
910
+ post_body = opts[:debug_body]
911
+
912
+ # return_type
913
+ return_type = opts[:debug_return_type] || 'SelfServiceVerificationFlow'
914
+
915
+ # auth_names
916
+ auth_names = opts[:debug_auth_names] || []
917
+
918
+ new_options = opts.merge(
919
+ :operation => :"V0alpha1Api.get_self_service_verification_flow",
920
+ :header_params => header_params,
921
+ :query_params => query_params,
922
+ :form_params => form_params,
923
+ :body => post_body,
924
+ :auth_names => auth_names,
925
+ :return_type => return_type
926
+ )
927
+
928
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
929
+ if @api_client.config.debugging
930
+ @api_client.config.logger.debug "API called: V0alpha1Api#get_self_service_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
931
+ end
932
+ return data, status_code, headers
933
+ end
934
+
935
+ # Initialize Login Flow for Browsers
936
+ # This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.login.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url` unless the query parameter `?refresh=true` was set. If this endpoint is called via an AJAX request, the response contains the login flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
937
+ # @param [Hash] opts the optional parameters
938
+ # @option opts [Boolean] :refresh Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
939
+ # @return [SelfServiceLoginFlow]
940
+ def initialize_self_service_login_flow_for_browsers(opts = {})
941
+ data, _status_code, _headers = initialize_self_service_login_flow_for_browsers_with_http_info(opts)
942
+ data
943
+ end
944
+
945
+ # Initialize Login Flow for Browsers
946
+ # This endpoint initializes a browser-based user login flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. If this endpoint is opened as a link in the browser, it will be redirected to &#x60;selfservice.flows.login.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If a valid user session exists already, the browser will be redirected to &#x60;urls.default_redirect_url&#x60; unless the query parameter &#x60;?refresh&#x3D;true&#x60; was set. If this endpoint is called via an AJAX request, the response contains the login flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
947
+ # @param [Hash] opts the optional parameters
948
+ # @option opts [Boolean] :refresh Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
949
+ # @return [Array<(SelfServiceLoginFlow, Integer, Hash)>] SelfServiceLoginFlow data, response status code and response headers
950
+ def initialize_self_service_login_flow_for_browsers_with_http_info(opts = {})
951
+ if @api_client.config.debugging
952
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_login_flow_for_browsers ...'
953
+ end
954
+ # resource path
955
+ local_var_path = '/api/kratos/public/self-service/login/browser'
956
+
957
+ # query parameters
958
+ query_params = opts[:query_params] || {}
959
+ query_params[:'refresh'] = opts[:'refresh'] if !opts[:'refresh'].nil?
960
+
961
+ # header parameters
962
+ header_params = opts[:header_params] || {}
963
+ # HTTP header 'Accept' (if needed)
964
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
965
+
966
+ # form parameters
967
+ form_params = opts[:form_params] || {}
968
+
969
+ # http body (model)
970
+ post_body = opts[:debug_body]
971
+
972
+ # return_type
973
+ return_type = opts[:debug_return_type] || 'SelfServiceLoginFlow'
974
+
975
+ # auth_names
976
+ auth_names = opts[:debug_auth_names] || []
977
+
978
+ new_options = opts.merge(
979
+ :operation => :"V0alpha1Api.initialize_self_service_login_flow_for_browsers",
980
+ :header_params => header_params,
981
+ :query_params => query_params,
982
+ :form_params => form_params,
983
+ :body => post_body,
984
+ :auth_names => auth_names,
985
+ :return_type => return_type
986
+ )
987
+
988
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
989
+ if @api_client.config.debugging
990
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_login_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
991
+ end
992
+ return data, status_code, headers
993
+ end
994
+
995
+ # Initialize Login Flow for APIs, Services, Apps, ...
996
+ # This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing login flow call `/self-service/login/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
997
+ # @param [Hash] opts the optional parameters
998
+ # @option opts [Boolean] :refresh Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
999
+ # @return [SelfServiceLoginFlow]
1000
+ def initialize_self_service_login_flow_without_browser(opts = {})
1001
+ data, _status_code, _headers = initialize_self_service_login_flow_without_browser_with_http_info(opts)
1002
+ data
1003
+ end
1004
+
1005
+ # Initialize Login Flow for APIs, Services, Apps, ...
1006
+ # This endpoint initiates a login flow for API clients that do not use a browser, such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter &#x60;?refresh&#x3D;true&#x60; is set. To fetch an existing login flow call &#x60;/self-service/login/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks, including CSRF login attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1007
+ # @param [Hash] opts the optional parameters
1008
+ # @option opts [Boolean] :refresh Refresh a login session If set to true, this will refresh an existing login session by asking the user to sign in again. This will reset the authenticated_at time of the session.
1009
+ # @return [Array<(SelfServiceLoginFlow, Integer, Hash)>] SelfServiceLoginFlow data, response status code and response headers
1010
+ def initialize_self_service_login_flow_without_browser_with_http_info(opts = {})
1011
+ if @api_client.config.debugging
1012
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_login_flow_without_browser ...'
1013
+ end
1014
+ # resource path
1015
+ local_var_path = '/api/kratos/public/self-service/login/api'
1016
+
1017
+ # query parameters
1018
+ query_params = opts[:query_params] || {}
1019
+ query_params[:'refresh'] = opts[:'refresh'] if !opts[:'refresh'].nil?
1020
+
1021
+ # header parameters
1022
+ header_params = opts[:header_params] || {}
1023
+ # HTTP header 'Accept' (if needed)
1024
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1025
+
1026
+ # form parameters
1027
+ form_params = opts[:form_params] || {}
1028
+
1029
+ # http body (model)
1030
+ post_body = opts[:debug_body]
1031
+
1032
+ # return_type
1033
+ return_type = opts[:debug_return_type] || 'SelfServiceLoginFlow'
1034
+
1035
+ # auth_names
1036
+ auth_names = opts[:debug_auth_names] || []
1037
+
1038
+ new_options = opts.merge(
1039
+ :operation => :"V0alpha1Api.initialize_self_service_login_flow_without_browser",
1040
+ :header_params => header_params,
1041
+ :query_params => query_params,
1042
+ :form_params => form_params,
1043
+ :body => post_body,
1044
+ :auth_names => auth_names,
1045
+ :return_type => return_type
1046
+ )
1047
+
1048
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1049
+ if @api_client.config.debugging
1050
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_login_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1051
+ end
1052
+ return data, status_code, headers
1053
+ end
1054
+
1055
+ # Initialize Recovery Flow for Browsers
1056
+ # This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to `selfservice.flows.recovery.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists, the browser is returned to the configured return URL. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects or a 400 bad request error if the user is already authenticated. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1057
+ # @param [Hash] opts the optional parameters
1058
+ # @return [SelfServiceRecoveryFlow]
1059
+ def initialize_self_service_recovery_flow_for_browsers(opts = {})
1060
+ data, _status_code, _headers = initialize_self_service_recovery_flow_for_browsers_with_http_info(opts)
1061
+ data
1062
+ end
1063
+
1064
+ # Initialize Recovery Flow for Browsers
1065
+ # This endpoint initializes a browser-based account recovery flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.recovery.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If a valid user session exists, the browser is returned to the configured return URL. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects or a 400 bad request error if the user is already authenticated. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1066
+ # @param [Hash] opts the optional parameters
1067
+ # @return [Array<(SelfServiceRecoveryFlow, Integer, Hash)>] SelfServiceRecoveryFlow data, response status code and response headers
1068
+ def initialize_self_service_recovery_flow_for_browsers_with_http_info(opts = {})
1069
+ if @api_client.config.debugging
1070
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_recovery_flow_for_browsers ...'
1071
+ end
1072
+ # resource path
1073
+ local_var_path = '/api/kratos/public/self-service/recovery/browser'
1074
+
1075
+ # query parameters
1076
+ query_params = opts[:query_params] || {}
1077
+
1078
+ # header parameters
1079
+ header_params = opts[:header_params] || {}
1080
+ # HTTP header 'Accept' (if needed)
1081
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1082
+
1083
+ # form parameters
1084
+ form_params = opts[:form_params] || {}
1085
+
1086
+ # http body (model)
1087
+ post_body = opts[:debug_body]
1088
+
1089
+ # return_type
1090
+ return_type = opts[:debug_return_type] || 'SelfServiceRecoveryFlow'
1091
+
1092
+ # auth_names
1093
+ auth_names = opts[:debug_auth_names] || []
1094
+
1095
+ new_options = opts.merge(
1096
+ :operation => :"V0alpha1Api.initialize_self_service_recovery_flow_for_browsers",
1097
+ :header_params => header_params,
1098
+ :query_params => query_params,
1099
+ :form_params => form_params,
1100
+ :body => post_body,
1101
+ :auth_names => auth_names,
1102
+ :return_type => return_type
1103
+ )
1104
+
1105
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1106
+ if @api_client.config.debugging
1107
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_recovery_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1108
+ end
1109
+ return data, status_code, headers
1110
+ end
1111
+
1112
+ # Initialize Recovery Flow for APIs, Services, Apps, ...
1113
+ # This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error. To fetch an existing recovery flow call `/self-service/recovery/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1114
+ # @param [Hash] opts the optional parameters
1115
+ # @return [SelfServiceRecoveryFlow]
1116
+ def initialize_self_service_recovery_flow_without_browser(opts = {})
1117
+ data, _status_code, _headers = initialize_self_service_recovery_flow_without_browser_with_http_info(opts)
1118
+ data
1119
+ end
1120
+
1121
+ # Initialize Recovery Flow for APIs, Services, Apps, ...
1122
+ # This endpoint initiates a recovery flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error. To fetch an existing recovery flow call &#x60;/self-service/recovery/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1123
+ # @param [Hash] opts the optional parameters
1124
+ # @return [Array<(SelfServiceRecoveryFlow, Integer, Hash)>] SelfServiceRecoveryFlow data, response status code and response headers
1125
+ def initialize_self_service_recovery_flow_without_browser_with_http_info(opts = {})
1126
+ if @api_client.config.debugging
1127
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_recovery_flow_without_browser ...'
1128
+ end
1129
+ # resource path
1130
+ local_var_path = '/api/kratos/public/self-service/recovery/api'
1131
+
1132
+ # query parameters
1133
+ query_params = opts[:query_params] || {}
1134
+
1135
+ # header parameters
1136
+ header_params = opts[:header_params] || {}
1137
+ # HTTP header 'Accept' (if needed)
1138
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1139
+
1140
+ # form parameters
1141
+ form_params = opts[:form_params] || {}
1142
+
1143
+ # http body (model)
1144
+ post_body = opts[:debug_body]
1145
+
1146
+ # return_type
1147
+ return_type = opts[:debug_return_type] || 'SelfServiceRecoveryFlow'
1148
+
1149
+ # auth_names
1150
+ auth_names = opts[:debug_auth_names] || []
1151
+
1152
+ new_options = opts.merge(
1153
+ :operation => :"V0alpha1Api.initialize_self_service_recovery_flow_without_browser",
1154
+ :header_params => header_params,
1155
+ :query_params => query_params,
1156
+ :form_params => form_params,
1157
+ :body => post_body,
1158
+ :auth_names => auth_names,
1159
+ :return_type => return_type
1160
+ )
1161
+
1162
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1163
+ if @api_client.config.debugging
1164
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_recovery_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1165
+ end
1166
+ return data, status_code, headers
1167
+ end
1168
+
1169
+ # Initialize Registration Flow for Browsers
1170
+ # This endpoint initializes a browser-based user registration flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. ::: If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.registration.ui_url` with the flow ID set as the query parameter `?flow=`. If a valid user session exists already, the browser will be redirected to `urls.default_redirect_url`. If this endpoint is called via an AJAX request, the response contains the registration flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1171
+ # @param [Hash] opts the optional parameters
1172
+ # @return [SelfServiceRegistrationFlow]
1173
+ def initialize_self_service_registration_flow_for_browsers(opts = {})
1174
+ data, _status_code, _headers = initialize_self_service_registration_flow_for_browsers_with_http_info(opts)
1175
+ data
1176
+ end
1177
+
1178
+ # Initialize Registration Flow for Browsers
1179
+ # This endpoint initializes a browser-based user registration flow. This endpoint will set the appropriate cookies and anti-CSRF measures required for browser-based flows. :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. ::: If this endpoint is opened as a link in the browser, it will be redirected to &#x60;selfservice.flows.registration.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If a valid user session exists already, the browser will be redirected to &#x60;urls.default_redirect_url&#x60;. If this endpoint is called via an AJAX request, the response contains the registration flow without a redirect. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1180
+ # @param [Hash] opts the optional parameters
1181
+ # @return [Array<(SelfServiceRegistrationFlow, Integer, Hash)>] SelfServiceRegistrationFlow data, response status code and response headers
1182
+ def initialize_self_service_registration_flow_for_browsers_with_http_info(opts = {})
1183
+ if @api_client.config.debugging
1184
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_registration_flow_for_browsers ...'
1185
+ end
1186
+ # resource path
1187
+ local_var_path = '/api/kratos/public/self-service/registration/browser'
1188
+
1189
+ # query parameters
1190
+ query_params = opts[:query_params] || {}
1191
+
1192
+ # header parameters
1193
+ header_params = opts[:header_params] || {}
1194
+ # HTTP header 'Accept' (if needed)
1195
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1196
+
1197
+ # form parameters
1198
+ form_params = opts[:form_params] || {}
1199
+
1200
+ # http body (model)
1201
+ post_body = opts[:debug_body]
1202
+
1203
+ # return_type
1204
+ return_type = opts[:debug_return_type] || 'SelfServiceRegistrationFlow'
1205
+
1206
+ # auth_names
1207
+ auth_names = opts[:debug_auth_names] || []
1208
+
1209
+ new_options = opts.merge(
1210
+ :operation => :"V0alpha1Api.initialize_self_service_registration_flow_for_browsers",
1211
+ :header_params => header_params,
1212
+ :query_params => query_params,
1213
+ :form_params => form_params,
1214
+ :body => post_body,
1215
+ :auth_names => auth_names,
1216
+ :return_type => return_type
1217
+ )
1218
+
1219
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1220
+ if @api_client.config.debugging
1221
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_registration_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1222
+ end
1223
+ return data, status_code, headers
1224
+ end
1225
+
1226
+ # Initialize Registration Flow for APIs, Services, Apps, ...
1227
+ # This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter `?refresh=true` is set. To fetch an existing registration flow call `/self-service/registration/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1228
+ # @param [Hash] opts the optional parameters
1229
+ # @return [SelfServiceRegistrationFlow]
1230
+ def initialize_self_service_registration_flow_without_browser(opts = {})
1231
+ data, _status_code, _headers = initialize_self_service_registration_flow_without_browser_with_http_info(opts)
1232
+ data
1233
+ end
1234
+
1235
+ # Initialize Registration Flow for APIs, Services, Apps, ...
1236
+ # This endpoint initiates a registration flow for API clients such as mobile devices, smart TVs, and so on. If a valid provided session cookie or session token is provided, a 400 Bad Request error will be returned unless the URL query parameter &#x60;?refresh&#x3D;true&#x60; is set. To fetch an existing registration flow call &#x60;/self-service/registration/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1237
+ # @param [Hash] opts the optional parameters
1238
+ # @return [Array<(SelfServiceRegistrationFlow, Integer, Hash)>] SelfServiceRegistrationFlow data, response status code and response headers
1239
+ def initialize_self_service_registration_flow_without_browser_with_http_info(opts = {})
1240
+ if @api_client.config.debugging
1241
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_registration_flow_without_browser ...'
1242
+ end
1243
+ # resource path
1244
+ local_var_path = '/api/kratos/public/self-service/registration/api'
1245
+
1246
+ # query parameters
1247
+ query_params = opts[:query_params] || {}
1248
+
1249
+ # header parameters
1250
+ header_params = opts[:header_params] || {}
1251
+ # HTTP header 'Accept' (if needed)
1252
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1253
+
1254
+ # form parameters
1255
+ form_params = opts[:form_params] || {}
1256
+
1257
+ # http body (model)
1258
+ post_body = opts[:debug_body]
1259
+
1260
+ # return_type
1261
+ return_type = opts[:debug_return_type] || 'SelfServiceRegistrationFlow'
1262
+
1263
+ # auth_names
1264
+ auth_names = opts[:debug_auth_names] || []
1265
+
1266
+ new_options = opts.merge(
1267
+ :operation => :"V0alpha1Api.initialize_self_service_registration_flow_without_browser",
1268
+ :header_params => header_params,
1269
+ :query_params => query_params,
1270
+ :form_params => form_params,
1271
+ :body => post_body,
1272
+ :auth_names => auth_names,
1273
+ :return_type => return_type
1274
+ )
1275
+
1276
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1277
+ if @api_client.config.debugging
1278
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_registration_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1279
+ end
1280
+ return data, status_code, headers
1281
+ end
1282
+
1283
+ # Initialize Settings Flow for Browsers
1284
+ # This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized. If this endpoint is opened as a link in the browser, it will be redirected to `selfservice.flows.settings.ui_url` with the flow ID set as the query parameter `?flow=`. If no valid user session was set, the browser will be redirected to the login endpoint. If this endpoint is called via an AJAX request, the response contains the settings flow without any redirects or a 403 forbidden error if no valid session was set. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1285
+ # @param [Hash] opts the optional parameters
1286
+ # @option opts [String] :cookie The Session Cookie of the Identity performing the settings flow.
1287
+ # @return [SelfServiceSettingsFlow]
1288
+ def initialize_self_service_settings_flow_for_browsers(opts = {})
1289
+ data, _status_code, _headers = initialize_self_service_settings_flow_for_browsers_with_http_info(opts)
1290
+ data
1291
+ end
1292
+
1293
+ # Initialize Settings Flow for Browsers
1294
+ # This endpoint initializes a browser-based user settings flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.settings.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If no valid Ory Kratos Session Cookie is included in the request, a login flow will be initialized. If this endpoint is opened as a link in the browser, it will be redirected to &#x60;selfservice.flows.settings.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If no valid user session was set, the browser will be redirected to the login endpoint. If this endpoint is called via an AJAX request, the response contains the settings flow without any redirects or a 403 forbidden error if no valid session was set. This endpoint is NOT INTENDED for clients that do not have a browser (Chrome, Firefox, ...) as cookies are needed. More information can be found at [Ory Kratos User Settings &amp; Profile Management Documentation](../self-service/flows/user-settings).
1295
+ # @param [Hash] opts the optional parameters
1296
+ # @option opts [String] :cookie The Session Cookie of the Identity performing the settings flow.
1297
+ # @return [Array<(SelfServiceSettingsFlow, Integer, Hash)>] SelfServiceSettingsFlow data, response status code and response headers
1298
+ def initialize_self_service_settings_flow_for_browsers_with_http_info(opts = {})
1299
+ if @api_client.config.debugging
1300
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_settings_flow_for_browsers ...'
1301
+ end
1302
+ # resource path
1303
+ local_var_path = '/api/kratos/public/self-service/settings/browser'
1304
+
1305
+ # query parameters
1306
+ query_params = opts[:query_params] || {}
1307
+
1308
+ # header parameters
1309
+ header_params = opts[:header_params] || {}
1310
+ # HTTP header 'Accept' (if needed)
1311
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1312
+ header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
1313
+
1314
+ # form parameters
1315
+ form_params = opts[:form_params] || {}
1316
+
1317
+ # http body (model)
1318
+ post_body = opts[:debug_body]
1319
+
1320
+ # return_type
1321
+ return_type = opts[:debug_return_type] || 'SelfServiceSettingsFlow'
1322
+
1323
+ # auth_names
1324
+ auth_names = opts[:debug_auth_names] || []
1325
+
1326
+ new_options = opts.merge(
1327
+ :operation => :"V0alpha1Api.initialize_self_service_settings_flow_for_browsers",
1328
+ :header_params => header_params,
1329
+ :query_params => query_params,
1330
+ :form_params => form_params,
1331
+ :body => post_body,
1332
+ :auth_names => auth_names,
1333
+ :return_type => return_type
1334
+ )
1335
+
1336
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1337
+ if @api_client.config.debugging
1338
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_settings_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1339
+ end
1340
+ return data, status_code, headers
1341
+ end
1342
+
1343
+ # Initialize Settings Flow for APIs, Services, Apps, ...
1344
+ # This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK. To fetch an existing settings flow call `/self-service/settings/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1345
+ # @param [Hash] opts the optional parameters
1346
+ # @option opts [String] :x_session_token The Session Token of the Identity performing the settings flow.
1347
+ # @return [SelfServiceSettingsFlow]
1348
+ def initialize_self_service_settings_flow_without_browser(opts = {})
1349
+ data, _status_code, _headers = initialize_self_service_settings_flow_without_browser_with_http_info(opts)
1350
+ data
1351
+ end
1352
+
1353
+ # Initialize Settings Flow for APIs, Services, Apps, ...
1354
+ # This endpoint initiates a settings flow for API clients such as mobile devices, smart TVs, and so on. You must provide a valid Ory Kratos Session Token for this endpoint to respond with HTTP 200 OK. To fetch an existing settings flow call &#x60;/self-service/settings/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos User Settings &amp; Profile Management Documentation](../self-service/flows/user-settings).
1355
+ # @param [Hash] opts the optional parameters
1356
+ # @option opts [String] :x_session_token The Session Token of the Identity performing the settings flow.
1357
+ # @return [Array<(SelfServiceSettingsFlow, Integer, Hash)>] SelfServiceSettingsFlow data, response status code and response headers
1358
+ def initialize_self_service_settings_flow_without_browser_with_http_info(opts = {})
1359
+ if @api_client.config.debugging
1360
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_settings_flow_without_browser ...'
1361
+ end
1362
+ # resource path
1363
+ local_var_path = '/api/kratos/public/self-service/settings/api'
1364
+
1365
+ # query parameters
1366
+ query_params = opts[:query_params] || {}
1367
+
1368
+ # header parameters
1369
+ header_params = opts[:header_params] || {}
1370
+ # HTTP header 'Accept' (if needed)
1371
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1372
+ header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
1373
+
1374
+ # form parameters
1375
+ form_params = opts[:form_params] || {}
1376
+
1377
+ # http body (model)
1378
+ post_body = opts[:debug_body]
1379
+
1380
+ # return_type
1381
+ return_type = opts[:debug_return_type] || 'SelfServiceSettingsFlow'
1382
+
1383
+ # auth_names
1384
+ auth_names = opts[:debug_auth_names] || []
1385
+
1386
+ new_options = opts.merge(
1387
+ :operation => :"V0alpha1Api.initialize_self_service_settings_flow_without_browser",
1388
+ :header_params => header_params,
1389
+ :query_params => query_params,
1390
+ :form_params => form_params,
1391
+ :body => post_body,
1392
+ :auth_names => auth_names,
1393
+ :return_type => return_type
1394
+ )
1395
+
1396
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1397
+ if @api_client.config.debugging
1398
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_settings_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1399
+ end
1400
+ return data, status_code, headers
1401
+ end
1402
+
1403
+ # Initialize Verification Flow for Browser Clients
1404
+ # This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to `selfservice.flows.verification.ui_url` with the flow ID set as the query parameter `?flow=`. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1405
+ # @param [Hash] opts the optional parameters
1406
+ # @return [SelfServiceVerificationFlow]
1407
+ def initialize_self_service_verification_flow_for_browsers(opts = {})
1408
+ data, _status_code, _headers = initialize_self_service_verification_flow_for_browsers_with_http_info(opts)
1409
+ data
1410
+ end
1411
+
1412
+ # Initialize Verification Flow for Browser Clients
1413
+ # This endpoint initializes a browser-based account verification flow. Once initialized, the browser will be redirected to &#x60;selfservice.flows.verification.ui_url&#x60; with the flow ID set as the query parameter &#x60;?flow&#x3D;&#x60;. If this endpoint is called via an AJAX request, the response contains the recovery flow without any redirects. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1414
+ # @param [Hash] opts the optional parameters
1415
+ # @return [Array<(SelfServiceVerificationFlow, Integer, Hash)>] SelfServiceVerificationFlow data, response status code and response headers
1416
+ def initialize_self_service_verification_flow_for_browsers_with_http_info(opts = {})
1417
+ if @api_client.config.debugging
1418
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_verification_flow_for_browsers ...'
1419
+ end
1420
+ # resource path
1421
+ local_var_path = '/api/kratos/public/self-service/verification/browser'
1422
+
1423
+ # query parameters
1424
+ query_params = opts[:query_params] || {}
1425
+
1426
+ # header parameters
1427
+ header_params = opts[:header_params] || {}
1428
+ # HTTP header 'Accept' (if needed)
1429
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1430
+
1431
+ # form parameters
1432
+ form_params = opts[:form_params] || {}
1433
+
1434
+ # http body (model)
1435
+ post_body = opts[:debug_body]
1436
+
1437
+ # return_type
1438
+ return_type = opts[:debug_return_type] || 'SelfServiceVerificationFlow'
1439
+
1440
+ # auth_names
1441
+ auth_names = opts[:debug_auth_names] || []
1442
+
1443
+ new_options = opts.merge(
1444
+ :operation => :"V0alpha1Api.initialize_self_service_verification_flow_for_browsers",
1445
+ :header_params => header_params,
1446
+ :query_params => query_params,
1447
+ :form_params => form_params,
1448
+ :body => post_body,
1449
+ :auth_names => auth_names,
1450
+ :return_type => return_type
1451
+ )
1452
+
1453
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1454
+ if @api_client.config.debugging
1455
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_verification_flow_for_browsers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1456
+ end
1457
+ return data, status_code, headers
1458
+ end
1459
+
1460
+ # Initialize Verification Flow for APIs, Services, Apps, ...
1461
+ # This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. To fetch an existing verification flow call `/self-service/verification/flows?flow=<flow_id>`. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1462
+ # @param [Hash] opts the optional parameters
1463
+ # @return [SelfServiceVerificationFlow]
1464
+ def initialize_self_service_verification_flow_without_browser(opts = {})
1465
+ data, _status_code, _headers = initialize_self_service_verification_flow_without_browser_with_http_info(opts)
1466
+ data
1467
+ end
1468
+
1469
+ # Initialize Verification Flow for APIs, Services, Apps, ...
1470
+ # This endpoint initiates a verification flow for API clients such as mobile devices, smart TVs, and so on. To fetch an existing verification flow call &#x60;/self-service/verification/flows?flow&#x3D;&lt;flow_id&gt;&#x60;. You MUST NOT use this endpoint in client-side (Single Page Apps, ReactJS, AngularJS) nor server-side (Java Server Pages, NodeJS, PHP, Golang, ...) browser applications. Using this endpoint in these applications will make you vulnerable to a variety of CSRF attacks. This endpoint MUST ONLY be used in scenarios such as native mobile apps (React Native, Objective C, Swift, Java, ...). More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1471
+ # @param [Hash] opts the optional parameters
1472
+ # @return [Array<(SelfServiceVerificationFlow, Integer, Hash)>] SelfServiceVerificationFlow data, response status code and response headers
1473
+ def initialize_self_service_verification_flow_without_browser_with_http_info(opts = {})
1474
+ if @api_client.config.debugging
1475
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.initialize_self_service_verification_flow_without_browser ...'
1476
+ end
1477
+ # resource path
1478
+ local_var_path = '/api/kratos/public/self-service/verification/api'
1479
+
1480
+ # query parameters
1481
+ query_params = opts[:query_params] || {}
1482
+
1483
+ # header parameters
1484
+ header_params = opts[:header_params] || {}
1485
+ # HTTP header 'Accept' (if needed)
1486
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1487
+
1488
+ # form parameters
1489
+ form_params = opts[:form_params] || {}
1490
+
1491
+ # http body (model)
1492
+ post_body = opts[:debug_body]
1493
+
1494
+ # return_type
1495
+ return_type = opts[:debug_return_type] || 'SelfServiceVerificationFlow'
1496
+
1497
+ # auth_names
1498
+ auth_names = opts[:debug_auth_names] || []
1499
+
1500
+ new_options = opts.merge(
1501
+ :operation => :"V0alpha1Api.initialize_self_service_verification_flow_without_browser",
1502
+ :header_params => header_params,
1503
+ :query_params => query_params,
1504
+ :form_params => form_params,
1505
+ :body => post_body,
1506
+ :auth_names => auth_names,
1507
+ :return_type => return_type
1508
+ )
1509
+
1510
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1511
+ if @api_client.config.debugging
1512
+ @api_client.config.logger.debug "API called: V0alpha1Api#initialize_self_service_verification_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1513
+ end
1514
+ return data, status_code, headers
1515
+ end
1516
+
1517
+ # Submit a Login Flow
1518
+ # :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. ::: Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows. API flows expect `application/json` to be sent in the body and responds with HTTP 200 and a application/json body with the session token on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. Browser flows expect a Content-Type of `application/x-www-form-urlencoded` or `application/json` to be sent in the body and respond with a HTTP 302 redirect to the post/after login URL or the `return_to` value if it was set and if the login succeeded; a HTTP 302 redirect to the login UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of `application/json` will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a `Set-Cookie` header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1519
+ # @param flow [String] The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).
1520
+ # @param [Hash] opts the optional parameters
1521
+ # @option opts [SubmitSelfServiceLoginFlowBody] :submit_self_service_login_flow_body
1522
+ # @return [SuccessfulSelfServiceLoginWithoutBrowser]
1523
+ def submit_self_service_login_flow(flow, opts = {})
1524
+ data, _status_code, _headers = submit_self_service_login_flow_with_http_info(flow, opts)
1525
+ data
1526
+ end
1527
+
1528
+ # Submit a Login Flow
1529
+ # :::info This endpoint is EXPERIMENTAL and subject to potential breaking changes in the future. ::: Use this endpoint to complete a login flow. This endpoint behaves differently for API and browser flows. API flows expect &#x60;application/json&#x60; to be sent in the body and responds with HTTP 200 and a application/json body with the session token on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. Browser flows expect a Content-Type of &#x60;application/x-www-form-urlencoded&#x60; or &#x60;application/json&#x60; to be sent in the body and respond with a HTTP 302 redirect to the post/after login URL or the &#x60;return_to&#x60; value if it was set and if the login succeeded; a HTTP 302 redirect to the login UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of &#x60;application/json&#x60; will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1530
+ # @param flow [String] The Login Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/login?flow&#x3D;abcde&#x60;).
1531
+ # @param [Hash] opts the optional parameters
1532
+ # @option opts [SubmitSelfServiceLoginFlowBody] :submit_self_service_login_flow_body
1533
+ # @return [Array<(SuccessfulSelfServiceLoginWithoutBrowser, Integer, Hash)>] SuccessfulSelfServiceLoginWithoutBrowser data, response status code and response headers
1534
+ def submit_self_service_login_flow_with_http_info(flow, opts = {})
1535
+ if @api_client.config.debugging
1536
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_login_flow ...'
1537
+ end
1538
+ # verify the required parameter 'flow' is set
1539
+ if @api_client.config.client_side_validation && flow.nil?
1540
+ fail ArgumentError, "Missing the required parameter 'flow' when calling V0alpha1Api.submit_self_service_login_flow"
1541
+ end
1542
+ # resource path
1543
+ local_var_path = '/api/kratos/public/self-service/login'
1544
+
1545
+ # query parameters
1546
+ query_params = opts[:query_params] || {}
1547
+ query_params[:'flow'] = flow
1548
+
1549
+ # header parameters
1550
+ header_params = opts[:header_params] || {}
1551
+ # HTTP header 'Accept' (if needed)
1552
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1553
+ # HTTP header 'Content-Type'
1554
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
1555
+
1556
+ # form parameters
1557
+ form_params = opts[:form_params] || {}
1558
+
1559
+ # http body (model)
1560
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'submit_self_service_login_flow_body'])
1561
+
1562
+ # return_type
1563
+ return_type = opts[:debug_return_type] || 'SuccessfulSelfServiceLoginWithoutBrowser'
1564
+
1565
+ # auth_names
1566
+ auth_names = opts[:debug_auth_names] || []
1567
+
1568
+ new_options = opts.merge(
1569
+ :operation => :"V0alpha1Api.submit_self_service_login_flow",
1570
+ :header_params => header_params,
1571
+ :query_params => query_params,
1572
+ :form_params => form_params,
1573
+ :body => post_body,
1574
+ :auth_names => auth_names,
1575
+ :return_type => return_type
1576
+ )
1577
+
1578
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1579
+ if @api_client.config.debugging
1580
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_login_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1581
+ end
1582
+ return data, status_code, headers
1583
+ end
1584
+
1585
+ # Complete Self-Service Logout
1586
+ # This endpoint logs out an identity in a self-service manner. If the `Accept` HTTP header is not set to `application/json`, the browser will be redirected (HTTP 302 Found) to the `return_to` parameter of the initial request or fall back to `urls.default_return_to`. If the `Accept` HTTP header is set to `application/json`, a 204 No Content response will be sent on successful logout instead. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the `/self-service/logout/api` URL directly with the Ory Session Token. More information can be found at [Ory Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout).
1587
+ # @param [Hash] opts the optional parameters
1588
+ # @option opts [String] :token A Valid Logout Token If you do not have a logout token because you only have a session cookie, call &#x60;/self-service/logout/urls&#x60; to generate a URL for this endpoint.
1589
+ # @return [nil]
1590
+ def submit_self_service_logout_flow(opts = {})
1591
+ submit_self_service_logout_flow_with_http_info(opts)
1592
+ nil
1593
+ end
1594
+
1595
+ # Complete Self-Service Logout
1596
+ # This endpoint logs out an identity in a self-service manner. If the &#x60;Accept&#x60; HTTP header is not set to &#x60;application/json&#x60;, the browser will be redirected (HTTP 302 Found) to the &#x60;return_to&#x60; parameter of the initial request or fall back to &#x60;urls.default_return_to&#x60;. If the &#x60;Accept&#x60; HTTP header is set to &#x60;application/json&#x60;, a 204 No Content response will be sent on successful logout instead. This endpoint is NOT INTENDED for API clients and only works with browsers (Chrome, Firefox, ...). For API clients you can call the &#x60;/self-service/logout/api&#x60; URL directly with the Ory Session Token. More information can be found at [Ory Kratos User Logout Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-logout).
1597
+ # @param [Hash] opts the optional parameters
1598
+ # @option opts [String] :token A Valid Logout Token If you do not have a logout token because you only have a session cookie, call &#x60;/self-service/logout/urls&#x60; to generate a URL for this endpoint.
1599
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1600
+ def submit_self_service_logout_flow_with_http_info(opts = {})
1601
+ if @api_client.config.debugging
1602
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_logout_flow ...'
1603
+ end
1604
+ # resource path
1605
+ local_var_path = '/api/kratos/public/self-service/logout'
1606
+
1607
+ # query parameters
1608
+ query_params = opts[:query_params] || {}
1609
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
1610
+
1611
+ # header parameters
1612
+ header_params = opts[:header_params] || {}
1613
+ # HTTP header 'Accept' (if needed)
1614
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1615
+
1616
+ # form parameters
1617
+ form_params = opts[:form_params] || {}
1618
+
1619
+ # http body (model)
1620
+ post_body = opts[:debug_body]
1621
+
1622
+ # return_type
1623
+ return_type = opts[:debug_return_type]
1624
+
1625
+ # auth_names
1626
+ auth_names = opts[:debug_auth_names] || []
1627
+
1628
+ new_options = opts.merge(
1629
+ :operation => :"V0alpha1Api.submit_self_service_logout_flow",
1630
+ :header_params => header_params,
1631
+ :query_params => query_params,
1632
+ :form_params => form_params,
1633
+ :body => post_body,
1634
+ :auth_names => auth_names,
1635
+ :return_type => return_type
1636
+ )
1637
+
1638
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1639
+ if @api_client.config.debugging
1640
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_logout_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1641
+ end
1642
+ return data, status_code, headers
1643
+ end
1644
+
1645
+ # Perform Logout for APIs, Services, Apps, ...
1646
+ # Use this endpoint to log out an identity using an Ory Session Token. If the Ory Session Token was successfully revoked, the server returns a 204 No Content response. A 204 No Content response is also sent when the Ory Session Token has been revoked already before. If the Ory Session Token is malformed or does not exist a 403 Forbidden response will be returned. This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.
1647
+ # @param submit_self_service_logout_flow_without_browser_body [SubmitSelfServiceLogoutFlowWithoutBrowserBody]
1648
+ # @param [Hash] opts the optional parameters
1649
+ # @return [nil]
1650
+ def submit_self_service_logout_flow_without_browser(submit_self_service_logout_flow_without_browser_body, opts = {})
1651
+ submit_self_service_logout_flow_without_browser_with_http_info(submit_self_service_logout_flow_without_browser_body, opts)
1652
+ nil
1653
+ end
1654
+
1655
+ # Perform Logout for APIs, Services, Apps, ...
1656
+ # Use this endpoint to log out an identity using an Ory Session Token. If the Ory Session Token was successfully revoked, the server returns a 204 No Content response. A 204 No Content response is also sent when the Ory Session Token has been revoked already before. If the Ory Session Token is malformed or does not exist a 403 Forbidden response will be returned. This endpoint does not remove any HTTP Cookies - use the Browser-Based Self-Service Logout Flow instead.
1657
+ # @param submit_self_service_logout_flow_without_browser_body [SubmitSelfServiceLogoutFlowWithoutBrowserBody]
1658
+ # @param [Hash] opts the optional parameters
1659
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1660
+ def submit_self_service_logout_flow_without_browser_with_http_info(submit_self_service_logout_flow_without_browser_body, opts = {})
1661
+ if @api_client.config.debugging
1662
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_logout_flow_without_browser ...'
1663
+ end
1664
+ # verify the required parameter 'submit_self_service_logout_flow_without_browser_body' is set
1665
+ if @api_client.config.client_side_validation && submit_self_service_logout_flow_without_browser_body.nil?
1666
+ fail ArgumentError, "Missing the required parameter 'submit_self_service_logout_flow_without_browser_body' when calling V0alpha1Api.submit_self_service_logout_flow_without_browser"
1667
+ end
1668
+ # resource path
1669
+ local_var_path = '/api/kratos/public/self-service/logout/api'
1670
+
1671
+ # query parameters
1672
+ query_params = opts[:query_params] || {}
1673
+
1674
+ # header parameters
1675
+ header_params = opts[:header_params] || {}
1676
+ # HTTP header 'Accept' (if needed)
1677
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1678
+ # HTTP header 'Content-Type'
1679
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1680
+
1681
+ # form parameters
1682
+ form_params = opts[:form_params] || {}
1683
+
1684
+ # http body (model)
1685
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_self_service_logout_flow_without_browser_body)
1686
+
1687
+ # return_type
1688
+ return_type = opts[:debug_return_type]
1689
+
1690
+ # auth_names
1691
+ auth_names = opts[:debug_auth_names] || []
1692
+
1693
+ new_options = opts.merge(
1694
+ :operation => :"V0alpha1Api.submit_self_service_logout_flow_without_browser",
1695
+ :header_params => header_params,
1696
+ :query_params => query_params,
1697
+ :form_params => form_params,
1698
+ :body => post_body,
1699
+ :auth_names => auth_names,
1700
+ :return_type => return_type
1701
+ )
1702
+
1703
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1704
+ if @api_client.config.debugging
1705
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_logout_flow_without_browser\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1706
+ end
1707
+ return data, status_code, headers
1708
+ end
1709
+
1710
+ # Complete Recovery Flow
1711
+ # Use this endpoint to complete a recovery flow. This endpoint behaves differently for API and browser flows and has several states: `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header `Accept: application/json` it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid. and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header `Accept` or with `Accept: text/*` it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. `sent_email` is the success state after `choose_method` for the `link` method and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a recovery link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1712
+ # @param flow [String] The Recovery Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).
1713
+ # @param [Hash] opts the optional parameters
1714
+ # @option opts [String] :token Recovery Token The recovery token which completes the recovery request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call.
1715
+ # @option opts [SubmitSelfServiceRecoveryFlowBody] :submit_self_service_recovery_flow_body
1716
+ # @return [SelfServiceRecoveryFlow]
1717
+ def submit_self_service_recovery_flow(flow, opts = {})
1718
+ data, _status_code, _headers = submit_self_service_recovery_flow_with_http_info(flow, opts)
1719
+ data
1720
+ end
1721
+
1722
+ # Complete Recovery Flow
1723
+ # Use this endpoint to complete a recovery flow. This endpoint behaves differently for API and browser flows and has several states: &#x60;choose_method&#x60; expects &#x60;flow&#x60; (in the URL query) and &#x60;email&#x60; (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header &#x60;Accept: application/json&#x60; it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid. and a HTTP 302 Found redirect with a fresh recovery flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; it returns a HTTP 302 Found redirect to the Recovery UI URL with the Recovery Flow ID appended. &#x60;sent_email&#x60; is the success state after &#x60;choose_method&#x60; for the &#x60;link&#x60; method and allows the user to request another recovery email. It works for both API and Browser-initiated flows and returns the same responses as the flow in &#x60;choose_method&#x60; state. &#x60;passed_challenge&#x60; expects a &#x60;token&#x60; to be sent in the URL query and given the nature of the flow (\&quot;sending a recovery link\&quot;) does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Recover UI URL with a new Recovery Flow ID which contains an error message that the recovery link was invalid. More information can be found at [Ory Kratos Account Recovery Documentation](../self-service/flows/account-recovery.mdx).
1724
+ # @param flow [String] The Recovery Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/recovery?flow&#x3D;abcde&#x60;).
1725
+ # @param [Hash] opts the optional parameters
1726
+ # @option opts [String] :token Recovery Token The recovery token which completes the recovery request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call.
1727
+ # @option opts [SubmitSelfServiceRecoveryFlowBody] :submit_self_service_recovery_flow_body
1728
+ # @return [Array<(SelfServiceRecoveryFlow, Integer, Hash)>] SelfServiceRecoveryFlow data, response status code and response headers
1729
+ def submit_self_service_recovery_flow_with_http_info(flow, opts = {})
1730
+ if @api_client.config.debugging
1731
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_recovery_flow ...'
1732
+ end
1733
+ # verify the required parameter 'flow' is set
1734
+ if @api_client.config.client_side_validation && flow.nil?
1735
+ fail ArgumentError, "Missing the required parameter 'flow' when calling V0alpha1Api.submit_self_service_recovery_flow"
1736
+ end
1737
+ # resource path
1738
+ local_var_path = '/api/kratos/public/self-service/recovery'
1739
+
1740
+ # query parameters
1741
+ query_params = opts[:query_params] || {}
1742
+ query_params[:'flow'] = flow
1743
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
1744
+
1745
+ # header parameters
1746
+ header_params = opts[:header_params] || {}
1747
+ # HTTP header 'Accept' (if needed)
1748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1749
+ # HTTP header 'Content-Type'
1750
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
1751
+
1752
+ # form parameters
1753
+ form_params = opts[:form_params] || {}
1754
+
1755
+ # http body (model)
1756
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'submit_self_service_recovery_flow_body'])
1757
+
1758
+ # return_type
1759
+ return_type = opts[:debug_return_type] || 'SelfServiceRecoveryFlow'
1760
+
1761
+ # auth_names
1762
+ auth_names = opts[:debug_auth_names] || []
1763
+
1764
+ new_options = opts.merge(
1765
+ :operation => :"V0alpha1Api.submit_self_service_recovery_flow",
1766
+ :header_params => header_params,
1767
+ :query_params => query_params,
1768
+ :form_params => form_params,
1769
+ :body => post_body,
1770
+ :auth_names => auth_names,
1771
+ :return_type => return_type
1772
+ )
1773
+
1774
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1775
+ if @api_client.config.debugging
1776
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_recovery_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1777
+ end
1778
+ return data, status_code, headers
1779
+ end
1780
+
1781
+ # Submit a Registration Flow
1782
+ # Use this endpoint to complete a registration flow by sending an identity's traits and password. This endpoint behaves differently for API and browser flows. API flows expect `application/json` to be sent in the body and respond with HTTP 200 and a application/json body with the created identity success - if the session hook is configured the `session` and `session_token` will also be included; HTTP 302 redirect to a fresh registration flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. Browser flows expect a Content-Type of `application/x-www-form-urlencoded` or `application/json` to be sent in the body and respond with a HTTP 302 redirect to the post/after registration URL or the `return_to` value if it was set and if the registration succeeded; a HTTP 302 redirect to the registration UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of `application/json` will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a `Set-Cookie` header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1783
+ # @param flow [String] The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).
1784
+ # @param [Hash] opts the optional parameters
1785
+ # @option opts [SubmitSelfServiceRegistrationFlowBody] :submit_self_service_registration_flow_body
1786
+ # @return [SuccessfulSelfServiceRegistrationWithoutBrowser]
1787
+ def submit_self_service_registration_flow(flow, opts = {})
1788
+ data, _status_code, _headers = submit_self_service_registration_flow_with_http_info(flow, opts)
1789
+ data
1790
+ end
1791
+
1792
+ # Submit a Registration Flow
1793
+ # Use this endpoint to complete a registration flow by sending an identity&#39;s traits and password. This endpoint behaves differently for API and browser flows. API flows expect &#x60;application/json&#x60; to be sent in the body and respond with HTTP 200 and a application/json body with the created identity success - if the session hook is configured the &#x60;session&#x60; and &#x60;session_token&#x60; will also be included; HTTP 302 redirect to a fresh registration flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. Browser flows expect a Content-Type of &#x60;application/x-www-form-urlencoded&#x60; or &#x60;application/json&#x60; to be sent in the body and respond with a HTTP 302 redirect to the post/after registration URL or the &#x60;return_to&#x60; value if it was set and if the registration succeeded; a HTTP 302 redirect to the registration UI URL with the flow ID containing the validation errors otherwise. Browser flows with an accept header of &#x60;application/json&#x60; will not redirect but instead respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Login and User Registration Documentation](https://www.ory.sh/docs/next/kratos/self-service/flows/user-login-user-registration).
1794
+ # @param flow [String] The Registration Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/registration?flow&#x3D;abcde&#x60;).
1795
+ # @param [Hash] opts the optional parameters
1796
+ # @option opts [SubmitSelfServiceRegistrationFlowBody] :submit_self_service_registration_flow_body
1797
+ # @return [Array<(SuccessfulSelfServiceRegistrationWithoutBrowser, Integer, Hash)>] SuccessfulSelfServiceRegistrationWithoutBrowser data, response status code and response headers
1798
+ def submit_self_service_registration_flow_with_http_info(flow, opts = {})
1799
+ if @api_client.config.debugging
1800
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_registration_flow ...'
1801
+ end
1802
+ # verify the required parameter 'flow' is set
1803
+ if @api_client.config.client_side_validation && flow.nil?
1804
+ fail ArgumentError, "Missing the required parameter 'flow' when calling V0alpha1Api.submit_self_service_registration_flow"
1805
+ end
1806
+ # resource path
1807
+ local_var_path = '/api/kratos/public/self-service/registration'
1808
+
1809
+ # query parameters
1810
+ query_params = opts[:query_params] || {}
1811
+ query_params[:'flow'] = flow
1812
+
1813
+ # header parameters
1814
+ header_params = opts[:header_params] || {}
1815
+ # HTTP header 'Accept' (if needed)
1816
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1817
+ # HTTP header 'Content-Type'
1818
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
1819
+
1820
+ # form parameters
1821
+ form_params = opts[:form_params] || {}
1822
+
1823
+ # http body (model)
1824
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'submit_self_service_registration_flow_body'])
1825
+
1826
+ # return_type
1827
+ return_type = opts[:debug_return_type] || 'SuccessfulSelfServiceRegistrationWithoutBrowser'
1828
+
1829
+ # auth_names
1830
+ auth_names = opts[:debug_auth_names] || []
1831
+
1832
+ new_options = opts.merge(
1833
+ :operation => :"V0alpha1Api.submit_self_service_registration_flow",
1834
+ :header_params => header_params,
1835
+ :query_params => query_params,
1836
+ :form_params => form_params,
1837
+ :body => post_body,
1838
+ :auth_names => auth_names,
1839
+ :return_type => return_type
1840
+ )
1841
+
1842
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1843
+ if @api_client.config.debugging
1844
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_registration_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1845
+ end
1846
+ return data, status_code, headers
1847
+ end
1848
+
1849
+ # Complete Settings Flow
1850
+ # Use this endpoint to complete a settings flow by sending an identity's updated password. This endpoint behaves differently for API and browser flows. API-initiated flows expect `application/json` to be sent in the body and respond with HTTP 200 and an application/json body with the session token on success; HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 when the endpoint is called without a valid session token. HTTP 403 when `selfservice.flows.settings.privileged_session_max_age` was reached. Implies that the user needs to re-authenticate. Browser flows without HTTP Header `Accept` or with `Accept: text/*` respond with a HTTP 302 redirect to the post/after settings URL or the `return_to` value if it was set and if the flow succeeded; a HTTP 302 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. a HTTP 302 redirect to the login endpoint when `selfservice.flows.settings.privileged_session_max_age` was reached. Browser flows with HTTP Header `Accept: application/json` respond with HTTP 200 and a application/json body with the signed in identity and a `Set-Cookie` header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 403 when the page is accessed without a session cookie. HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Settings & Profile Management Documentation](../self-service/flows/user-settings).
1851
+ # @param flow [String] The Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).
1852
+ # @param [Hash] opts the optional parameters
1853
+ # @option opts [String] :x_session_token The Session Token of the Identity performing the settings flow.
1854
+ # @option opts [SubmitSelfServiceSettingsFlowBody] :submit_self_service_settings_flow_body
1855
+ # @return [SuccessfulSelfServiceSettingsWithoutBrowser]
1856
+ def submit_self_service_settings_flow(flow, opts = {})
1857
+ data, _status_code, _headers = submit_self_service_settings_flow_with_http_info(flow, opts)
1858
+ data
1859
+ end
1860
+
1861
+ # Complete Settings Flow
1862
+ # Use this endpoint to complete a settings flow by sending an identity&#39;s updated password. This endpoint behaves differently for API and browser flows. API-initiated flows expect &#x60;application/json&#x60; to be sent in the body and respond with HTTP 200 and an application/json body with the session token on success; HTTP 302 redirect to a fresh settings flow if the original flow expired with the appropriate error messages set; HTTP 400 on form validation errors. HTTP 401 when the endpoint is called without a valid session token. HTTP 403 when &#x60;selfservice.flows.settings.privileged_session_max_age&#x60; was reached. Implies that the user needs to re-authenticate. Browser flows without HTTP Header &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; respond with a HTTP 302 redirect to the post/after settings URL or the &#x60;return_to&#x60; value if it was set and if the flow succeeded; a HTTP 302 redirect to the Settings UI URL with the flow ID containing the validation errors otherwise. a HTTP 302 redirect to the login endpoint when &#x60;selfservice.flows.settings.privileged_session_max_age&#x60; was reached. Browser flows with HTTP Header &#x60;Accept: application/json&#x60; respond with HTTP 200 and a application/json body with the signed in identity and a &#x60;Set-Cookie&#x60; header on success; HTTP 302 redirect to a fresh login flow if the original flow expired with the appropriate error messages set; HTTP 403 when the page is accessed without a session cookie. HTTP 400 on form validation errors. More information can be found at [Ory Kratos User Settings &amp; Profile Management Documentation](../self-service/flows/user-settings).
1863
+ # @param flow [String] The Settings Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/settings?flow&#x3D;abcde&#x60;).
1864
+ # @param [Hash] opts the optional parameters
1865
+ # @option opts [String] :x_session_token The Session Token of the Identity performing the settings flow.
1866
+ # @option opts [SubmitSelfServiceSettingsFlowBody] :submit_self_service_settings_flow_body
1867
+ # @return [Array<(SuccessfulSelfServiceSettingsWithoutBrowser, Integer, Hash)>] SuccessfulSelfServiceSettingsWithoutBrowser data, response status code and response headers
1868
+ def submit_self_service_settings_flow_with_http_info(flow, opts = {})
1869
+ if @api_client.config.debugging
1870
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_settings_flow ...'
1871
+ end
1872
+ # verify the required parameter 'flow' is set
1873
+ if @api_client.config.client_side_validation && flow.nil?
1874
+ fail ArgumentError, "Missing the required parameter 'flow' when calling V0alpha1Api.submit_self_service_settings_flow"
1875
+ end
1876
+ # resource path
1877
+ local_var_path = '/api/kratos/public/self-service/settings'
1878
+
1879
+ # query parameters
1880
+ query_params = opts[:query_params] || {}
1881
+ query_params[:'flow'] = flow
1882
+
1883
+ # header parameters
1884
+ header_params = opts[:header_params] || {}
1885
+ # HTTP header 'Accept' (if needed)
1886
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1887
+ # HTTP header 'Content-Type'
1888
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
1889
+ header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
1890
+
1891
+ # form parameters
1892
+ form_params = opts[:form_params] || {}
1893
+
1894
+ # http body (model)
1895
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'submit_self_service_settings_flow_body'])
1896
+
1897
+ # return_type
1898
+ return_type = opts[:debug_return_type] || 'SuccessfulSelfServiceSettingsWithoutBrowser'
1899
+
1900
+ # auth_names
1901
+ auth_names = opts[:debug_auth_names] || []
1902
+
1903
+ new_options = opts.merge(
1904
+ :operation => :"V0alpha1Api.submit_self_service_settings_flow",
1905
+ :header_params => header_params,
1906
+ :query_params => query_params,
1907
+ :form_params => form_params,
1908
+ :body => post_body,
1909
+ :auth_names => auth_names,
1910
+ :return_type => return_type
1911
+ )
1912
+
1913
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1914
+ if @api_client.config.debugging
1915
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_settings_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1916
+ end
1917
+ return data, status_code, headers
1918
+ end
1919
+
1920
+ # Complete Verification Flow
1921
+ # Use this endpoint to complete a verification flow. This endpoint behaves differently for API and browser flows and has several states: `choose_method` expects `flow` (in the URL query) and `email` (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header `Accept: application/json` it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header `Accept` or with `Accept: text/*` it returns a HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID appended. `sent_email` is the success state after `choose_method` when using the `link` method and allows the user to request another verification email. It works for both API and Browser-initiated flows and returns the same responses as the flow in `choose_method` state. `passed_challenge` expects a `token` to be sent in the URL query and given the nature of the flow (\"sending a verification link\") does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with a new Verification Flow ID which contains an error message that the verification link was invalid. More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1922
+ # @param flow [String] The Verification Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).
1923
+ # @param [Hash] opts the optional parameters
1924
+ # @option opts [String] :token Verification Token The verification token which completes the verification request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call.
1925
+ # @option opts [SubmitSelfServiceVerificationFlowBody] :submit_self_service_verification_flow_body
1926
+ # @return [SelfServiceVerificationFlow]
1927
+ def submit_self_service_verification_flow(flow, opts = {})
1928
+ data, _status_code, _headers = submit_self_service_verification_flow_with_http_info(flow, opts)
1929
+ data
1930
+ end
1931
+
1932
+ # Complete Verification Flow
1933
+ # Use this endpoint to complete a verification flow. This endpoint behaves differently for API and browser flows and has several states: &#x60;choose_method&#x60; expects &#x60;flow&#x60; (in the URL query) and &#x60;email&#x60; (in the body) to be sent and works with API- and Browser-initiated flows. For API clients and Browser clients with HTTP Header &#x60;Accept: application/json&#x60; it either returns a HTTP 200 OK when the form is valid and HTTP 400 OK when the form is invalid and a HTTP 302 Found redirect with a fresh verification flow if the flow was otherwise invalid (e.g. expired). For Browser clients without HTTP Header &#x60;Accept&#x60; or with &#x60;Accept: text/*&#x60; it returns a HTTP 302 Found redirect to the Verification UI URL with the Verification Flow ID appended. &#x60;sent_email&#x60; is the success state after &#x60;choose_method&#x60; when using the &#x60;link&#x60; method and allows the user to request another verification email. It works for both API and Browser-initiated flows and returns the same responses as the flow in &#x60;choose_method&#x60; state. &#x60;passed_challenge&#x60; expects a &#x60;token&#x60; to be sent in the URL query and given the nature of the flow (\&quot;sending a verification link\&quot;) does not have any API capabilities. The server responds with a HTTP 302 Found redirect either to the Settings UI URL (if the link was valid) and instructs the user to update their password, or a redirect to the Verification UI URL with a new Verification Flow ID which contains an error message that the verification link was invalid. More information can be found at [Ory Kratos Email and Phone Verification Documentation](https://www.ory.sh/docs/kratos/selfservice/flows/verify-email-account-activation).
1934
+ # @param flow [String] The Verification Flow ID The value for this parameter comes from &#x60;flow&#x60; URL Query parameter sent to your application (e.g. &#x60;/verification?flow&#x3D;abcde&#x60;).
1935
+ # @param [Hash] opts the optional parameters
1936
+ # @option opts [String] :token Verification Token The verification token which completes the verification request. If the token is invalid (e.g. expired) an error will be shown to the end-user. This parameter is usually set in a link and not used by any direct API call.
1937
+ # @option opts [SubmitSelfServiceVerificationFlowBody] :submit_self_service_verification_flow_body
1938
+ # @return [Array<(SelfServiceVerificationFlow, Integer, Hash)>] SelfServiceVerificationFlow data, response status code and response headers
1939
+ def submit_self_service_verification_flow_with_http_info(flow, opts = {})
1940
+ if @api_client.config.debugging
1941
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.submit_self_service_verification_flow ...'
1942
+ end
1943
+ # verify the required parameter 'flow' is set
1944
+ if @api_client.config.client_side_validation && flow.nil?
1945
+ fail ArgumentError, "Missing the required parameter 'flow' when calling V0alpha1Api.submit_self_service_verification_flow"
1946
+ end
1947
+ # resource path
1948
+ local_var_path = '/api/kratos/public/self-service/verification'
1949
+
1950
+ # query parameters
1951
+ query_params = opts[:query_params] || {}
1952
+ query_params[:'flow'] = flow
1953
+ query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
1954
+
1955
+ # header parameters
1956
+ header_params = opts[:header_params] || {}
1957
+ # HTTP header 'Accept' (if needed)
1958
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1959
+ # HTTP header 'Content-Type'
1960
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])
1961
+
1962
+ # form parameters
1963
+ form_params = opts[:form_params] || {}
1964
+
1965
+ # http body (model)
1966
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'submit_self_service_verification_flow_body'])
1967
+
1968
+ # return_type
1969
+ return_type = opts[:debug_return_type] || 'SelfServiceVerificationFlow'
1970
+
1971
+ # auth_names
1972
+ auth_names = opts[:debug_auth_names] || []
1973
+
1974
+ new_options = opts.merge(
1975
+ :operation => :"V0alpha1Api.submit_self_service_verification_flow",
1976
+ :header_params => header_params,
1977
+ :query_params => query_params,
1978
+ :form_params => form_params,
1979
+ :body => post_body,
1980
+ :auth_names => auth_names,
1981
+ :return_type => return_type
1982
+ )
1983
+
1984
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1985
+ if @api_client.config.debugging
1986
+ @api_client.config.logger.debug "API called: V0alpha1Api#submit_self_service_verification_flow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1987
+ end
1988
+ return data, status_code, headers
1989
+ end
1990
+
1991
+ # Check Who the Current HTTP Session Belongs To
1992
+ # Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. Additionally when the request it successful it adds the user ID to the 'X-Kratos-Authenticated-Identity-Id' header in the response. If you call this endpoint from a server-side application, you must forward the HTTP Cookie Header to this endpoint: ```js pseudo-code example router.get('/protected-endpoint', async function (req, res) { const session = await client.toSession(undefined, req.header('cookie')) console.log(session) }) ``` When calling this endpoint from a non-browser application (e.g. mobile app) you must include the session token: ```js pseudo-code example ... const session = await client.toSession(\"the-session-token\") console.log(session) ``` This endpoint is useful for: AJAX calls. Remember to send credentials and set up CORS correctly! Reverse proxies and API Gateways Server-side calls - use the `X-Session-Token` header! This endpoint authenticates users by checking if the `Cookie` HTTP header was set containing an Ory Kratos Session Cookie; if the `Authorization: bearer <ory-session-token>` HTTP header was set with a valid Ory Kratos Session Token; if the `X-Session-Token` HTTP header was set with a valid Ory Kratos Session Token. If none of these headers are set or the cooke or token are invalid, the endpoint returns a HTTP 401 status code.
1993
+ # @param [Hash] opts the optional parameters
1994
+ # @option opts [String] :x_session_token Set the Session Token when calling from non-browser clients. A session token has a format of &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.
1995
+ # @option opts [String] :cookie Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.
1996
+ # @return [Session]
1997
+ def to_session(opts = {})
1998
+ data, _status_code, _headers = to_session_with_http_info(opts)
1999
+ data
2000
+ end
2001
+
2002
+ # Check Who the Current HTTP Session Belongs To
2003
+ # Uses the HTTP Headers in the GET request to determine (e.g. by using checking the cookies) who is authenticated. Returns a session object in the body or 401 if the credentials are invalid or no credentials were sent. Additionally when the request it successful it adds the user ID to the &#39;X-Kratos-Authenticated-Identity-Id&#39; header in the response. If you call this endpoint from a server-side application, you must forward the HTTP Cookie Header to this endpoint: &#x60;&#x60;&#x60;js pseudo-code example router.get(&#39;/protected-endpoint&#39;, async function (req, res) { const session &#x3D; await client.toSession(undefined, req.header(&#39;cookie&#39;)) console.log(session) }) &#x60;&#x60;&#x60; When calling this endpoint from a non-browser application (e.g. mobile app) you must include the session token: &#x60;&#x60;&#x60;js pseudo-code example ... const session &#x3D; await client.toSession(\&quot;the-session-token\&quot;) console.log(session) &#x60;&#x60;&#x60; This endpoint is useful for: AJAX calls. Remember to send credentials and set up CORS correctly! Reverse proxies and API Gateways Server-side calls - use the &#x60;X-Session-Token&#x60; header! This endpoint authenticates users by checking if the &#x60;Cookie&#x60; HTTP header was set containing an Ory Kratos Session Cookie; if the &#x60;Authorization: bearer &lt;ory-session-token&gt;&#x60; HTTP header was set with a valid Ory Kratos Session Token; if the &#x60;X-Session-Token&#x60; HTTP header was set with a valid Ory Kratos Session Token. If none of these headers are set or the cooke or token are invalid, the endpoint returns a HTTP 401 status code.
2004
+ # @param [Hash] opts the optional parameters
2005
+ # @option opts [String] :x_session_token Set the Session Token when calling from non-browser clients. A session token has a format of &#x60;MP2YWEMeM8MxjkGKpH4dqOQ4Q4DlSPaj&#x60;.
2006
+ # @option opts [String] :cookie Set the Cookie Header. This is especially useful when calling this endpoint from a server-side application. In that scenario you must include the HTTP Cookie Header which originally was included in the request to your server. An example of a session in the HTTP Cookie Header is: &#x60;ory_kratos_session&#x3D;a19iOVAbdzdgl70Rq1QZmrKmcjDtdsviCTZx7m9a9yHIUS8Wa9T7hvqyGTsLHi6Qifn2WUfpAKx9DWp0SJGleIn9vh2YF4A16id93kXFTgIgmwIOvbVAScyrx7yVl6bPZnCx27ec4WQDtaTewC1CpgudeDV2jQQnSaCP6ny3xa8qLH-QUgYqdQuoA_LF1phxgRCUfIrCLQOkolX5nv3ze_f&#x3D;&#x3D;&#x60;. It is ok if more than one cookie are included here as all other cookies will be ignored.
2007
+ # @return [Array<(Session, Integer, Hash)>] Session data, response status code and response headers
2008
+ def to_session_with_http_info(opts = {})
2009
+ if @api_client.config.debugging
2010
+ @api_client.config.logger.debug 'Calling API: V0alpha1Api.to_session ...'
2011
+ end
2012
+ # resource path
2013
+ local_var_path = '/api/kratos/public/sessions/whoami'
2014
+
2015
+ # query parameters
2016
+ query_params = opts[:query_params] || {}
2017
+
2018
+ # header parameters
2019
+ header_params = opts[:header_params] || {}
2020
+ # HTTP header 'Accept' (if needed)
2021
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2022
+ header_params[:'X-Session-Token'] = opts[:'x_session_token'] if !opts[:'x_session_token'].nil?
2023
+ header_params[:'Cookie'] = opts[:'cookie'] if !opts[:'cookie'].nil?
2024
+
2025
+ # form parameters
2026
+ form_params = opts[:form_params] || {}
2027
+
2028
+ # http body (model)
2029
+ post_body = opts[:debug_body]
2030
+
2031
+ # return_type
2032
+ return_type = opts[:debug_return_type] || 'Session'
2033
+
2034
+ # auth_names
2035
+ auth_names = opts[:debug_auth_names] || []
2036
+
2037
+ new_options = opts.merge(
2038
+ :operation => :"V0alpha1Api.to_session",
2039
+ :header_params => header_params,
2040
+ :query_params => query_params,
2041
+ :form_params => form_params,
2042
+ :body => post_body,
2043
+ :auth_names => auth_names,
2044
+ :return_type => return_type
2045
+ )
2046
+
2047
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2048
+ if @api_client.config.debugging
2049
+ @api_client.config.logger.debug "API called: V0alpha1Api#to_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2050
+ end
2051
+ return data, status_code, headers
2052
+ end
2053
+ end
2054
+ end