ory-client-client 0.0.1.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +231 -0
  4. data/Rakefile +10 -0
  5. data/docs/AuthenticateOKBody.md +20 -0
  6. data/docs/ContainerChangeResponseItem.md +20 -0
  7. data/docs/ContainerCreateCreatedBody.md +20 -0
  8. data/docs/ContainerTopOKBody.md +20 -0
  9. data/docs/ContainerUpdateOKBody.md +18 -0
  10. data/docs/ContainerWaitOKBody.md +20 -0
  11. data/docs/ContainerWaitOKBodyError.md +18 -0
  12. data/docs/CreateIdentity.md +20 -0
  13. data/docs/CreateRecoveryLink.md +20 -0
  14. data/docs/DefaultApi.md +2902 -0
  15. data/docs/ErrorContainer.md +20 -0
  16. data/docs/ErrorResponse.md +18 -0
  17. data/docs/GenericError.md +30 -0
  18. data/docs/GraphDriverData.md +20 -0
  19. data/docs/HealthNotReadyStatus.md +18 -0
  20. data/docs/HealthStatus.md +18 -0
  21. data/docs/IdResponse.md +18 -0
  22. data/docs/Identity.md +28 -0
  23. data/docs/IdentityCredentials.md +22 -0
  24. data/docs/ImageDeleteResponseItem.md +20 -0
  25. data/docs/ImageSummary.md +36 -0
  26. data/docs/InlineResponse200.md +18 -0
  27. data/docs/InlineResponse2001.md +18 -0
  28. data/docs/InlineResponse503.md +18 -0
  29. data/docs/JsonError.md +18 -0
  30. data/docs/LoginFlow.md +32 -0
  31. data/docs/LoginViaApiResponse.md +20 -0
  32. data/docs/Meta.md +18 -0
  33. data/docs/Plugin.md +28 -0
  34. data/docs/PluginConfig.md +48 -0
  35. data/docs/PluginConfigArgs.md +24 -0
  36. data/docs/PluginConfigInterface.md +20 -0
  37. data/docs/PluginConfigLinux.md +22 -0
  38. data/docs/PluginConfigNetwork.md +18 -0
  39. data/docs/PluginConfigRootfs.md +20 -0
  40. data/docs/PluginConfigUser.md +20 -0
  41. data/docs/PluginDevice.md +24 -0
  42. data/docs/PluginEnv.md +24 -0
  43. data/docs/PluginInterfaceType.md +22 -0
  44. data/docs/PluginMount.md +30 -0
  45. data/docs/PluginSettings.md +24 -0
  46. data/docs/Port.md +24 -0
  47. data/docs/RecoveryAddress.md +22 -0
  48. data/docs/RecoveryFlow.md +32 -0
  49. data/docs/RecoveryLink.md +20 -0
  50. data/docs/RegistrationFlow.md +30 -0
  51. data/docs/RegistrationViaApiResponse.md +22 -0
  52. data/docs/RevokeSession.md +18 -0
  53. data/docs/ServiceUpdateResponse.md +18 -0
  54. data/docs/Session.md +28 -0
  55. data/docs/SettingsFlow.md +34 -0
  56. data/docs/SettingsProfileFormConfig.md +24 -0
  57. data/docs/SettingsViaApiResponse.md +20 -0
  58. data/docs/SubmitSelfServiceBrowserSettingsOIDCFlowPayload.md +22 -0
  59. data/docs/SubmitSelfServiceLoginFlow.md +47 -0
  60. data/docs/SubmitSelfServiceLoginFlowWithPasswordMethod.md +24 -0
  61. data/docs/SubmitSelfServiceRecoveryFlowWithLinkMethod.md +20 -0
  62. data/docs/SubmitSelfServiceRegistrationFlow.md +47 -0
  63. data/docs/SubmitSelfServiceRegistrationFlowWithPasswordMethod.md +24 -0
  64. data/docs/SubmitSelfServiceSettingsFlow.md +49 -0
  65. data/docs/SubmitSelfServiceSettingsFlowWithPasswordMethod.md +22 -0
  66. data/docs/SubmitSelfServiceSettingsFlowWithProfileMethod.md +22 -0
  67. data/docs/SubmitSelfServiceVerificationFlowWithLinkMethod.md +20 -0
  68. data/docs/UiContainer.md +24 -0
  69. data/docs/UiNode.md +26 -0
  70. data/docs/UiNodeAnchorAttributes.md +20 -0
  71. data/docs/UiNodeAttributes.md +53 -0
  72. data/docs/UiNodeImageAttributes.md +18 -0
  73. data/docs/UiNodeInputAttributes.md +30 -0
  74. data/docs/UiNodeInputAttributesValue.md +51 -0
  75. data/docs/UiNodeTextAttributes.md +18 -0
  76. data/docs/UiText.md +24 -0
  77. data/docs/UpdateIdentity.md +20 -0
  78. data/docs/VerifiableIdentityAddress.md +32 -0
  79. data/docs/VerificationFlow.md +32 -0
  80. data/docs/Version.md +18 -0
  81. data/docs/Volume.md +34 -0
  82. data/docs/VolumeUsageData.md +20 -0
  83. data/lib/ory-client-client.rb +117 -0
  84. data/lib/ory-client-client/api/default_api.rb +2690 -0
  85. data/lib/ory-client-client/api_client.rb +390 -0
  86. data/lib/ory-client-client/api_error.rb +57 -0
  87. data/lib/ory-client-client/configuration.rb +297 -0
  88. data/lib/ory-client-client/models/authenticate_ok_body.rb +240 -0
  89. data/lib/ory-client-client/models/container_change_response_item.rb +240 -0
  90. data/lib/ory-client-client/models/container_create_created_body.rb +242 -0
  91. data/lib/ory-client-client/models/container_top_ok_body.rb +244 -0
  92. data/lib/ory-client-client/models/container_update_ok_body.rb +227 -0
  93. data/lib/ory-client-client/models/container_wait_ok_body.rb +239 -0
  94. data/lib/ory-client-client/models/container_wait_ok_body_error.rb +220 -0
  95. data/lib/ory-client-client/models/create_identity.rb +239 -0
  96. data/lib/ory-client-client/models/create_recovery_link.rb +250 -0
  97. data/lib/ory-client-client/models/error_container.rb +240 -0
  98. data/lib/ory-client-client/models/error_response.rb +224 -0
  99. data/lib/ory-client-client/models/generic_error.rb +286 -0
  100. data/lib/ory-client-client/models/graph_driver_data.rb +241 -0
  101. data/lib/ory-client-client/models/health_not_ready_status.rb +221 -0
  102. data/lib/ory-client-client/models/health_status.rb +219 -0
  103. data/lib/ory-client-client/models/id_response.rb +225 -0
  104. data/lib/ory-client-client/models/identity.rb +289 -0
  105. data/lib/ory-client-client/models/identity_credentials.rb +241 -0
  106. data/lib/ory-client-client/models/image_delete_response_item.rb +230 -0
  107. data/lib/ory-client-client/models/image_summary.rb +366 -0
  108. data/lib/ory-client-client/models/inline_response200.rb +224 -0
  109. data/lib/ory-client-client/models/inline_response2001.rb +224 -0
  110. data/lib/ory-client-client/models/inline_response503.rb +226 -0
  111. data/lib/ory-client-client/models/json_error.rb +224 -0
  112. data/lib/ory-client-client/models/login_flow.rb +318 -0
  113. data/lib/ory-client-client/models/login_via_api_response.rb +239 -0
  114. data/lib/ory-client-client/models/meta.rb +219 -0
  115. data/lib/ory-client-client/models/plugin.rb +288 -0
  116. data/lib/ory-client-client/models/plugin_config.rb +434 -0
  117. data/lib/ory-client-client/models/plugin_config_args.rb +274 -0
  118. data/lib/ory-client-client/models/plugin_config_interface.rb +242 -0
  119. data/lib/ory-client-client/models/plugin_config_linux.rb +259 -0
  120. data/lib/ory-client-client/models/plugin_config_network.rb +225 -0
  121. data/lib/ory-client-client/models/plugin_config_rootfs.rb +232 -0
  122. data/lib/ory-client-client/models/plugin_config_user.rb +230 -0
  123. data/lib/ory-client-client/models/plugin_device.rb +272 -0
  124. data/lib/ory-client-client/models/plugin_env.rb +272 -0
  125. data/lib/ory-client-client/models/plugin_interface_type.rb +255 -0
  126. data/lib/ory-client-client/models/plugin_mount.rb +319 -0
  127. data/lib/ory-client-client/models/plugin_settings.rb +277 -0
  128. data/lib/ory-client-client/models/port.rb +260 -0
  129. data/lib/ory-client-client/models/recovery_address.rb +251 -0
  130. data/lib/ory-client-client/models/recovery_flow.rb +317 -0
  131. data/lib/ory-client-client/models/recovery_link.rb +234 -0
  132. data/lib/ory-client-client/models/registration_flow.rb +302 -0
  133. data/lib/ory-client-client/models/registration_via_api_response.rb +248 -0
  134. data/lib/ory-client-client/models/revoke_session.rb +224 -0
  135. data/lib/ory-client-client/models/service_update_response.rb +222 -0
  136. data/lib/ory-client-client/models/session.rb +288 -0
  137. data/lib/ory-client-client/models/settings_flow.rb +331 -0
  138. data/lib/ory-client-client/models/settings_profile_form_config.rb +266 -0
  139. data/lib/ory-client-client/models/settings_via_api_response.rb +238 -0
  140. data/lib/ory-client-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +239 -0
  141. data/lib/ory-client-client/models/submit_self_service_login_flow.rb +104 -0
  142. data/lib/ory-client-client/models/submit_self_service_login_flow_with_password_method.rb +249 -0
  143. data/lib/ory-client-client/models/submit_self_service_recovery_flow_with_link_method.rb +229 -0
  144. data/lib/ory-client-client/models/submit_self_service_registration_flow.rb +104 -0
  145. data/lib/ory-client-client/models/submit_self_service_registration_flow_with_password_method.rb +276 -0
  146. data/lib/ory-client-client/models/submit_self_service_settings_flow.rb +105 -0
  147. data/lib/ory-client-client/models/submit_self_service_settings_flow_with_password_method.rb +244 -0
  148. data/lib/ory-client-client/models/submit_self_service_settings_flow_with_profile_method.rb +245 -0
  149. data/lib/ory-client-client/models/submit_self_service_verification_flow_with_link_method.rb +230 -0
  150. data/lib/ory-client-client/models/ui_container.rb +267 -0
  151. data/lib/ory-client-client/models/ui_node.rb +282 -0
  152. data/lib/ory-client-client/models/ui_node_anchor_attributes.rb +238 -0
  153. data/lib/ory-client-client/models/ui_node_attributes.rb +107 -0
  154. data/lib/ory-client-client/models/ui_node_image_attributes.rb +224 -0
  155. data/lib/ory-client-client/models/ui_node_input_attributes.rb +292 -0
  156. data/lib/ory-client-client/models/ui_node_input_attributes_value.rb +106 -0
  157. data/lib/ory-client-client/models/ui_node_text_attributes.rb +223 -0
  158. data/lib/ory-client-client/models/ui_text.rb +262 -0
  159. data/lib/ory-client-client/models/update_identity.rb +234 -0
  160. data/lib/ory-client-client/models/verifiable_identity_address.rb +313 -0
  161. data/lib/ory-client-client/models/verification_flow.rb +307 -0
  162. data/lib/ory-client-client/models/version.rb +219 -0
  163. data/lib/ory-client-client/models/volume.rb +335 -0
  164. data/lib/ory-client-client/models/volume_usage_data.rb +240 -0
  165. data/lib/ory-client-client/version.rb +15 -0
  166. data/ory-client-client.gemspec +38 -0
  167. data/spec/api/default_api_spec.rb +544 -0
  168. data/spec/api_client_spec.rb +226 -0
  169. data/spec/configuration_spec.rb +42 -0
  170. data/spec/models/authenticate_ok_body_spec.rb +40 -0
  171. data/spec/models/container_change_response_item_spec.rb +40 -0
  172. data/spec/models/container_create_created_body_spec.rb +40 -0
  173. data/spec/models/container_top_ok_body_spec.rb +40 -0
  174. data/spec/models/container_update_ok_body_spec.rb +34 -0
  175. data/spec/models/container_wait_ok_body_error_spec.rb +34 -0
  176. data/spec/models/container_wait_ok_body_spec.rb +40 -0
  177. data/spec/models/create_identity_spec.rb +40 -0
  178. data/spec/models/create_recovery_link_spec.rb +40 -0
  179. data/spec/models/error_container_spec.rb +40 -0
  180. data/spec/models/error_response_spec.rb +34 -0
  181. data/spec/models/generic_error_spec.rb +70 -0
  182. data/spec/models/graph_driver_data_spec.rb +40 -0
  183. data/spec/models/health_not_ready_status_spec.rb +34 -0
  184. data/spec/models/health_status_spec.rb +34 -0
  185. data/spec/models/id_response_spec.rb +34 -0
  186. data/spec/models/identity_credentials_spec.rb +46 -0
  187. data/spec/models/identity_spec.rb +64 -0
  188. data/spec/models/image_delete_response_item_spec.rb +40 -0
  189. data/spec/models/image_summary_spec.rb +88 -0
  190. data/spec/models/inline_response2001_spec.rb +34 -0
  191. data/spec/models/inline_response200_spec.rb +34 -0
  192. data/spec/models/inline_response503_spec.rb +34 -0
  193. data/spec/models/json_error_spec.rb +34 -0
  194. data/spec/models/login_flow_spec.rb +76 -0
  195. data/spec/models/login_via_api_response_spec.rb +40 -0
  196. data/spec/models/meta_spec.rb +34 -0
  197. data/spec/models/plugin_config_args_spec.rb +52 -0
  198. data/spec/models/plugin_config_interface_spec.rb +40 -0
  199. data/spec/models/plugin_config_linux_spec.rb +46 -0
  200. data/spec/models/plugin_config_network_spec.rb +34 -0
  201. data/spec/models/plugin_config_rootfs_spec.rb +40 -0
  202. data/spec/models/plugin_config_spec.rb +124 -0
  203. data/spec/models/plugin_config_user_spec.rb +40 -0
  204. data/spec/models/plugin_device_spec.rb +52 -0
  205. data/spec/models/plugin_env_spec.rb +52 -0
  206. data/spec/models/plugin_interface_type_spec.rb +46 -0
  207. data/spec/models/plugin_mount_spec.rb +70 -0
  208. data/spec/models/plugin_settings_spec.rb +52 -0
  209. data/spec/models/plugin_spec.rb +64 -0
  210. data/spec/models/port_spec.rb +52 -0
  211. data/spec/models/recovery_address_spec.rb +46 -0
  212. data/spec/models/recovery_flow_spec.rb +76 -0
  213. data/spec/models/recovery_link_spec.rb +40 -0
  214. data/spec/models/registration_flow_spec.rb +70 -0
  215. data/spec/models/registration_via_api_response_spec.rb +46 -0
  216. data/spec/models/revoke_session_spec.rb +34 -0
  217. data/spec/models/service_update_response_spec.rb +34 -0
  218. data/spec/models/session_spec.rb +64 -0
  219. data/spec/models/settings_flow_spec.rb +82 -0
  220. data/spec/models/settings_profile_form_config_spec.rb +52 -0
  221. data/spec/models/settings_via_api_response_spec.rb +40 -0
  222. data/spec/models/submit_self_service_browser_settings_oidc_flow_payload_spec.rb +46 -0
  223. data/spec/models/submit_self_service_login_flow_spec.rb +31 -0
  224. data/spec/models/submit_self_service_login_flow_with_password_method_spec.rb +52 -0
  225. data/spec/models/submit_self_service_recovery_flow_with_link_method_spec.rb +40 -0
  226. data/spec/models/submit_self_service_registration_flow_spec.rb +31 -0
  227. data/spec/models/submit_self_service_registration_flow_with_password_method_spec.rb +52 -0
  228. data/spec/models/submit_self_service_settings_flow_spec.rb +31 -0
  229. data/spec/models/submit_self_service_settings_flow_with_password_method_spec.rb +46 -0
  230. data/spec/models/submit_self_service_settings_flow_with_profile_method_spec.rb +46 -0
  231. data/spec/models/submit_self_service_verification_flow_with_link_method_spec.rb +40 -0
  232. data/spec/models/ui_container_spec.rb +52 -0
  233. data/spec/models/ui_node_anchor_attributes_spec.rb +40 -0
  234. data/spec/models/ui_node_attributes_spec.rb +31 -0
  235. data/spec/models/ui_node_image_attributes_spec.rb +34 -0
  236. data/spec/models/ui_node_input_attributes_spec.rb +70 -0
  237. data/spec/models/ui_node_input_attributes_value_spec.rb +31 -0
  238. data/spec/models/ui_node_spec.rb +58 -0
  239. data/spec/models/ui_node_text_attributes_spec.rb +34 -0
  240. data/spec/models/ui_text_spec.rb +52 -0
  241. data/spec/models/update_identity_spec.rb +40 -0
  242. data/spec/models/verifiable_identity_address_spec.rb +76 -0
  243. data/spec/models/verification_flow_spec.rb +76 -0
  244. data/spec/models/version_spec.rb +34 -0
  245. data/spec/models/volume_spec.rb +82 -0
  246. data/spec/models/volume_usage_data_spec.rb +40 -0
  247. data/spec/spec_helper.rb +111 -0
  248. metadata +413 -0
@@ -0,0 +1,251 @@
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.1
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 'date'
14
+ require 'time'
15
+
16
+ module OryHydraClient
17
+ class RecoveryAddress
18
+ attr_accessor :id
19
+
20
+ attr_accessor :value
21
+
22
+ attr_accessor :via
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'id' => :'id',
28
+ :'value' => :'value',
29
+ :'via' => :'via'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'id' => :'String',
42
+ :'value' => :'String',
43
+ :'via' => :'String'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::RecoveryAddress` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::RecoveryAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'id')
69
+ self.id = attributes[:'id']
70
+ end
71
+
72
+ if attributes.key?(:'value')
73
+ self.value = attributes[:'value']
74
+ end
75
+
76
+ if attributes.key?(:'via')
77
+ self.via = attributes[:'via']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ if @id.nil?
86
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
87
+ end
88
+
89
+ if @value.nil?
90
+ invalid_properties.push('invalid value for "value", value cannot be nil.')
91
+ end
92
+
93
+ if @via.nil?
94
+ invalid_properties.push('invalid value for "via", via cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @id.nil?
104
+ return false if @value.nil?
105
+ return false if @via.nil?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ id == o.id &&
115
+ value == o.value &&
116
+ via == o.via
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [id, value, via].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
145
+ self.send("#{key}=", nil)
146
+ elsif type =~ /\AArray<(.*)>/i
147
+ # check to ensure the input is an array given that the attribute
148
+ # is documented as an array but the input is not
149
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
150
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
151
+ end
152
+ elsif !attributes[self.class.attribute_map[key]].nil?
153
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
154
+ end
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = OryHydraClient.const_get(type)
199
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end
@@ -0,0 +1,317 @@
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.1
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 'date'
14
+ require 'time'
15
+
16
+ module OryHydraClient
17
+ # This request is used when an identity wants to recover their account. We recommend reading the [Account Recovery Documentation](../self-service/flows/password-reset-account-recovery)
18
+ class RecoveryFlow
19
+ # Active, if set, contains the registration method that is being used. It is initially not set.
20
+ attr_accessor :active
21
+
22
+ # ExpiresAt is the time (UTC) when the request expires. If the user still wishes to update the setting, a new request has to be initiated.
23
+ attr_accessor :expires_at
24
+
25
+ attr_accessor :id
26
+
27
+ # IssuedAt is the time (UTC) when the request occurred.
28
+ attr_accessor :issued_at
29
+
30
+ # RequestURL is the initial URL that was requested from Ory Kratos. It can be used to forward information contained in the URL's path or query for example.
31
+ attr_accessor :request_url
32
+
33
+ attr_accessor :state
34
+
35
+ # The flow type can either be `api` or `browser`.
36
+ attr_accessor :type
37
+
38
+ attr_accessor :ui
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'active' => :'active',
44
+ :'expires_at' => :'expires_at',
45
+ :'id' => :'id',
46
+ :'issued_at' => :'issued_at',
47
+ :'request_url' => :'request_url',
48
+ :'state' => :'state',
49
+ :'type' => :'type',
50
+ :'ui' => :'ui'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'active' => :'String',
63
+ :'expires_at' => :'Time',
64
+ :'id' => :'String',
65
+ :'issued_at' => :'Time',
66
+ :'request_url' => :'String',
67
+ :'state' => :'String',
68
+ :'type' => :'String',
69
+ :'ui' => :'UiContainer'
70
+ }
71
+ end
72
+
73
+ # List of attributes with nullable: true
74
+ def self.openapi_nullable
75
+ Set.new([
76
+ ])
77
+ end
78
+
79
+ # Initializes the object
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ def initialize(attributes = {})
82
+ if (!attributes.is_a?(Hash))
83
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::RecoveryFlow` initialize method"
84
+ end
85
+
86
+ # check to see if the attribute exists and convert string to symbol for hash key
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!self.class.attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::RecoveryFlow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'active')
95
+ self.active = attributes[:'active']
96
+ end
97
+
98
+ if attributes.key?(:'expires_at')
99
+ self.expires_at = attributes[:'expires_at']
100
+ end
101
+
102
+ if attributes.key?(:'id')
103
+ self.id = attributes[:'id']
104
+ end
105
+
106
+ if attributes.key?(:'issued_at')
107
+ self.issued_at = attributes[:'issued_at']
108
+ end
109
+
110
+ if attributes.key?(:'request_url')
111
+ self.request_url = attributes[:'request_url']
112
+ end
113
+
114
+ if attributes.key?(:'state')
115
+ self.state = attributes[:'state']
116
+ end
117
+
118
+ if attributes.key?(:'type')
119
+ self.type = attributes[:'type']
120
+ end
121
+
122
+ if attributes.key?(:'ui')
123
+ self.ui = attributes[:'ui']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ invalid_properties = Array.new
131
+ if @expires_at.nil?
132
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
133
+ end
134
+
135
+ if @id.nil?
136
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
137
+ end
138
+
139
+ if @issued_at.nil?
140
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
141
+ end
142
+
143
+ if @request_url.nil?
144
+ invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
145
+ end
146
+
147
+ if @state.nil?
148
+ invalid_properties.push('invalid value for "state", state cannot be nil.')
149
+ end
150
+
151
+ if @ui.nil?
152
+ invalid_properties.push('invalid value for "ui", ui cannot be nil.')
153
+ end
154
+
155
+ invalid_properties
156
+ end
157
+
158
+ # Check to see if the all the properties in the model are valid
159
+ # @return true if the model is valid
160
+ def valid?
161
+ return false if @expires_at.nil?
162
+ return false if @id.nil?
163
+ return false if @issued_at.nil?
164
+ return false if @request_url.nil?
165
+ return false if @state.nil?
166
+ return false if @ui.nil?
167
+ true
168
+ end
169
+
170
+ # Checks equality by comparing each attribute.
171
+ # @param [Object] Object to be compared
172
+ def ==(o)
173
+ return true if self.equal?(o)
174
+ self.class == o.class &&
175
+ active == o.active &&
176
+ expires_at == o.expires_at &&
177
+ id == o.id &&
178
+ issued_at == o.issued_at &&
179
+ request_url == o.request_url &&
180
+ state == o.state &&
181
+ type == o.type &&
182
+ ui == o.ui
183
+ end
184
+
185
+ # @see the `==` method
186
+ # @param [Object] Object to be compared
187
+ def eql?(o)
188
+ self == o
189
+ end
190
+
191
+ # Calculates hash code according to all attributes.
192
+ # @return [Integer] Hash code
193
+ def hash
194
+ [active, expires_at, id, issued_at, request_url, state, type, ui].hash
195
+ end
196
+
197
+ # Builds the object from hash
198
+ # @param [Hash] attributes Model attributes in the form of hash
199
+ # @return [Object] Returns the model itself
200
+ def self.build_from_hash(attributes)
201
+ new.build_from_hash(attributes)
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ self.class.openapi_types.each_pair do |key, type|
210
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
211
+ self.send("#{key}=", nil)
212
+ elsif type =~ /\AArray<(.*)>/i
213
+ # check to ensure the input is an array given that the attribute
214
+ # is documented as an array but the input is not
215
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
216
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
217
+ end
218
+ elsif !attributes[self.class.attribute_map[key]].nil?
219
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
220
+ end
221
+ end
222
+
223
+ self
224
+ end
225
+
226
+ # Deserializes the data based on type
227
+ # @param string type Data type
228
+ # @param string value Value to be deserialized
229
+ # @return [Object] Deserialized data
230
+ def _deserialize(type, value)
231
+ case type.to_sym
232
+ when :Time
233
+ Time.parse(value)
234
+ when :Date
235
+ Date.parse(value)
236
+ when :String
237
+ value.to_s
238
+ when :Integer
239
+ value.to_i
240
+ when :Float
241
+ value.to_f
242
+ when :Boolean
243
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
244
+ true
245
+ else
246
+ false
247
+ end
248
+ when :Object
249
+ # generic object (usually a Hash), return directly
250
+ value
251
+ when /\AArray<(?<inner_type>.+)>\z/
252
+ inner_type = Regexp.last_match[:inner_type]
253
+ value.map { |v| _deserialize(inner_type, v) }
254
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
255
+ k_type = Regexp.last_match[:k_type]
256
+ v_type = Regexp.last_match[:v_type]
257
+ {}.tap do |hash|
258
+ value.each do |k, v|
259
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
260
+ end
261
+ end
262
+ else # model
263
+ # models (e.g. Pet) or oneOf
264
+ klass = OryHydraClient.const_get(type)
265
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
266
+ end
267
+ end
268
+
269
+ # Returns the string representation of the object
270
+ # @return [String] String presentation of the object
271
+ def to_s
272
+ to_hash.to_s
273
+ end
274
+
275
+ # to_body is an alias to to_hash (backward compatibility)
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_body
278
+ to_hash
279
+ end
280
+
281
+ # Returns the object in the form of hash
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_hash
284
+ hash = {}
285
+ self.class.attribute_map.each_pair do |attr, param|
286
+ value = self.send(attr)
287
+ if value.nil?
288
+ is_nullable = self.class.openapi_nullable.include?(attr)
289
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
290
+ end
291
+
292
+ hash[param] = _to_hash(value)
293
+ end
294
+ hash
295
+ end
296
+
297
+ # Outputs non-array value in the form of hash
298
+ # For object, use to_hash. Otherwise, just return the value
299
+ # @param [Object] value Any valid value
300
+ # @return [Hash] Returns the value in the form of hash
301
+ def _to_hash(value)
302
+ if value.is_a?(Array)
303
+ value.compact.map { |v| _to_hash(v) }
304
+ elsif value.is_a?(Hash)
305
+ {}.tap do |hash|
306
+ value.each { |k, v| hash[k] = _to_hash(v) }
307
+ end
308
+ elsif value.respond_to? :to_hash
309
+ value.to_hash
310
+ else
311
+ value
312
+ end
313
+ end
314
+
315
+ end
316
+
317
+ end