ory-client 0.0.1.alpha5

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 +2922 -0
  15. data/docs/ErrorResponse.md +18 -0
  16. data/docs/GenericError.md +30 -0
  17. data/docs/GraphDriverData.md +20 -0
  18. data/docs/HealthNotReadyStatus.md +18 -0
  19. data/docs/HealthStatus.md +18 -0
  20. data/docs/IdResponse.md +18 -0
  21. data/docs/Identity.md +32 -0
  22. data/docs/IdentityCredentials.md +26 -0
  23. data/docs/ImageDeleteResponseItem.md +20 -0
  24. data/docs/ImageSummary.md +36 -0
  25. data/docs/InlineResponse200.md +18 -0
  26. data/docs/InlineResponse2001.md +18 -0
  27. data/docs/InlineResponse503.md +18 -0
  28. data/docs/JsonError.md +18 -0
  29. data/docs/LoginFlow.md +36 -0
  30. data/docs/LoginViaApiResponse.md +20 -0
  31. data/docs/Meta.md +18 -0
  32. data/docs/Plugin.md +28 -0
  33. data/docs/PluginConfig.md +48 -0
  34. data/docs/PluginConfigArgs.md +24 -0
  35. data/docs/PluginConfigInterface.md +20 -0
  36. data/docs/PluginConfigLinux.md +22 -0
  37. data/docs/PluginConfigNetwork.md +18 -0
  38. data/docs/PluginConfigRootfs.md +20 -0
  39. data/docs/PluginConfigUser.md +20 -0
  40. data/docs/PluginDevice.md +24 -0
  41. data/docs/PluginEnv.md +24 -0
  42. data/docs/PluginInterfaceType.md +22 -0
  43. data/docs/PluginMount.md +30 -0
  44. data/docs/PluginSettings.md +24 -0
  45. data/docs/Port.md +24 -0
  46. data/docs/RecoveryAddress.md +26 -0
  47. data/docs/RecoveryFlow.md +32 -0
  48. data/docs/RecoveryLink.md +20 -0
  49. data/docs/RegistrationFlow.md +30 -0
  50. data/docs/RegistrationViaApiResponse.md +22 -0
  51. data/docs/RevokeSession.md +18 -0
  52. data/docs/SelfServiceErrorContainer.md +24 -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.rb +117 -0
  84. data/lib/ory-client/api/default_api.rb +2705 -0
  85. data/lib/ory-client/api_client.rb +390 -0
  86. data/lib/ory-client/api_error.rb +57 -0
  87. data/lib/ory-client/configuration.rb +297 -0
  88. data/lib/ory-client/models/authenticate_ok_body.rb +240 -0
  89. data/lib/ory-client/models/container_change_response_item.rb +240 -0
  90. data/lib/ory-client/models/container_create_created_body.rb +242 -0
  91. data/lib/ory-client/models/container_top_ok_body.rb +244 -0
  92. data/lib/ory-client/models/container_update_ok_body.rb +227 -0
  93. data/lib/ory-client/models/container_wait_ok_body.rb +239 -0
  94. data/lib/ory-client/models/container_wait_ok_body_error.rb +220 -0
  95. data/lib/ory-client/models/create_identity.rb +239 -0
  96. data/lib/ory-client/models/create_recovery_link.rb +250 -0
  97. data/lib/ory-client/models/error_response.rb +224 -0
  98. data/lib/ory-client/models/generic_error.rb +286 -0
  99. data/lib/ory-client/models/graph_driver_data.rb +241 -0
  100. data/lib/ory-client/models/health_not_ready_status.rb +221 -0
  101. data/lib/ory-client/models/health_status.rb +219 -0
  102. data/lib/ory-client/models/id_response.rb +225 -0
  103. data/lib/ory-client/models/identity.rb +309 -0
  104. data/lib/ory-client/models/identity_credentials.rb +261 -0
  105. data/lib/ory-client/models/image_delete_response_item.rb +230 -0
  106. data/lib/ory-client/models/image_summary.rb +366 -0
  107. data/lib/ory-client/models/inline_response200.rb +224 -0
  108. data/lib/ory-client/models/inline_response2001.rb +224 -0
  109. data/lib/ory-client/models/inline_response503.rb +226 -0
  110. data/lib/ory-client/models/json_error.rb +224 -0
  111. data/lib/ory-client/models/login_flow.rb +338 -0
  112. data/lib/ory-client/models/login_via_api_response.rb +239 -0
  113. data/lib/ory-client/models/meta.rb +219 -0
  114. data/lib/ory-client/models/plugin.rb +288 -0
  115. data/lib/ory-client/models/plugin_config.rb +434 -0
  116. data/lib/ory-client/models/plugin_config_args.rb +274 -0
  117. data/lib/ory-client/models/plugin_config_interface.rb +242 -0
  118. data/lib/ory-client/models/plugin_config_linux.rb +259 -0
  119. data/lib/ory-client/models/plugin_config_network.rb +225 -0
  120. data/lib/ory-client/models/plugin_config_rootfs.rb +232 -0
  121. data/lib/ory-client/models/plugin_config_user.rb +230 -0
  122. data/lib/ory-client/models/plugin_device.rb +272 -0
  123. data/lib/ory-client/models/plugin_env.rb +272 -0
  124. data/lib/ory-client/models/plugin_interface_type.rb +255 -0
  125. data/lib/ory-client/models/plugin_mount.rb +319 -0
  126. data/lib/ory-client/models/plugin_settings.rb +277 -0
  127. data/lib/ory-client/models/port.rb +260 -0
  128. data/lib/ory-client/models/recovery_address.rb +271 -0
  129. data/lib/ory-client/models/recovery_flow.rb +317 -0
  130. data/lib/ory-client/models/recovery_link.rb +234 -0
  131. data/lib/ory-client/models/registration_flow.rb +302 -0
  132. data/lib/ory-client/models/registration_via_api_response.rb +248 -0
  133. data/lib/ory-client/models/revoke_session.rb +224 -0
  134. data/lib/ory-client/models/self_service_error_container.rb +260 -0
  135. data/lib/ory-client/models/service_update_response.rb +222 -0
  136. data/lib/ory-client/models/session.rb +288 -0
  137. data/lib/ory-client/models/settings_flow.rb +331 -0
  138. data/lib/ory-client/models/settings_profile_form_config.rb +266 -0
  139. data/lib/ory-client/models/settings_via_api_response.rb +238 -0
  140. data/lib/ory-client/models/submit_self_service_browser_settings_oidc_flow_payload.rb +239 -0
  141. data/lib/ory-client/models/submit_self_service_login_flow.rb +104 -0
  142. data/lib/ory-client/models/submit_self_service_login_flow_with_password_method.rb +249 -0
  143. data/lib/ory-client/models/submit_self_service_recovery_flow_with_link_method.rb +229 -0
  144. data/lib/ory-client/models/submit_self_service_registration_flow.rb +104 -0
  145. data/lib/ory-client/models/submit_self_service_registration_flow_with_password_method.rb +276 -0
  146. data/lib/ory-client/models/submit_self_service_settings_flow.rb +105 -0
  147. data/lib/ory-client/models/submit_self_service_settings_flow_with_password_method.rb +244 -0
  148. data/lib/ory-client/models/submit_self_service_settings_flow_with_profile_method.rb +245 -0
  149. data/lib/ory-client/models/submit_self_service_verification_flow_with_link_method.rb +230 -0
  150. data/lib/ory-client/models/ui_container.rb +267 -0
  151. data/lib/ory-client/models/ui_node.rb +282 -0
  152. data/lib/ory-client/models/ui_node_anchor_attributes.rb +238 -0
  153. data/lib/ory-client/models/ui_node_attributes.rb +107 -0
  154. data/lib/ory-client/models/ui_node_image_attributes.rb +224 -0
  155. data/lib/ory-client/models/ui_node_input_attributes.rb +292 -0
  156. data/lib/ory-client/models/ui_node_input_attributes_value.rb +106 -0
  157. data/lib/ory-client/models/ui_node_text_attributes.rb +223 -0
  158. data/lib/ory-client/models/ui_text.rb +262 -0
  159. data/lib/ory-client/models/update_identity.rb +234 -0
  160. data/lib/ory-client/models/verifiable_identity_address.rb +313 -0
  161. data/lib/ory-client/models/verification_flow.rb +307 -0
  162. data/lib/ory-client/models/version.rb +219 -0
  163. data/lib/ory-client/models/volume.rb +335 -0
  164. data/lib/ory-client/models/volume_usage_data.rb +240 -0
  165. data/lib/ory-client/version.rb +15 -0
  166. data/ory-client.gemspec +38 -0
  167. data/spec/api/default_api_spec.rb +549 -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_response_spec.rb +34 -0
  180. data/spec/models/generic_error_spec.rb +70 -0
  181. data/spec/models/graph_driver_data_spec.rb +40 -0
  182. data/spec/models/health_not_ready_status_spec.rb +34 -0
  183. data/spec/models/health_status_spec.rb +34 -0
  184. data/spec/models/id_response_spec.rb +34 -0
  185. data/spec/models/identity_credentials_spec.rb +58 -0
  186. data/spec/models/identity_spec.rb +76 -0
  187. data/spec/models/image_delete_response_item_spec.rb +40 -0
  188. data/spec/models/image_summary_spec.rb +88 -0
  189. data/spec/models/inline_response2001_spec.rb +34 -0
  190. data/spec/models/inline_response200_spec.rb +34 -0
  191. data/spec/models/inline_response503_spec.rb +34 -0
  192. data/spec/models/json_error_spec.rb +34 -0
  193. data/spec/models/login_flow_spec.rb +88 -0
  194. data/spec/models/login_via_api_response_spec.rb +40 -0
  195. data/spec/models/meta_spec.rb +34 -0
  196. data/spec/models/plugin_config_args_spec.rb +52 -0
  197. data/spec/models/plugin_config_interface_spec.rb +40 -0
  198. data/spec/models/plugin_config_linux_spec.rb +46 -0
  199. data/spec/models/plugin_config_network_spec.rb +34 -0
  200. data/spec/models/plugin_config_rootfs_spec.rb +40 -0
  201. data/spec/models/plugin_config_spec.rb +124 -0
  202. data/spec/models/plugin_config_user_spec.rb +40 -0
  203. data/spec/models/plugin_device_spec.rb +52 -0
  204. data/spec/models/plugin_env_spec.rb +52 -0
  205. data/spec/models/plugin_interface_type_spec.rb +46 -0
  206. data/spec/models/plugin_mount_spec.rb +70 -0
  207. data/spec/models/plugin_settings_spec.rb +52 -0
  208. data/spec/models/plugin_spec.rb +64 -0
  209. data/spec/models/port_spec.rb +52 -0
  210. data/spec/models/recovery_address_spec.rb +58 -0
  211. data/spec/models/recovery_flow_spec.rb +76 -0
  212. data/spec/models/recovery_link_spec.rb +40 -0
  213. data/spec/models/registration_flow_spec.rb +70 -0
  214. data/spec/models/registration_via_api_response_spec.rb +46 -0
  215. data/spec/models/revoke_session_spec.rb +34 -0
  216. data/spec/models/self_service_error_container_spec.rb +52 -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,224 @@
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.5
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
+ # The standard Ory JSON API error format.
18
+ class JsonError
19
+ attr_accessor :error
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'error' => :'error'
25
+ }
26
+ end
27
+
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'error' => :'GenericError'
37
+ }
38
+ end
39
+
40
+ # List of attributes with nullable: true
41
+ def self.openapi_nullable
42
+ Set.new([
43
+ ])
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::JsonError` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::JsonError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'error')
62
+ self.error = attributes[:'error']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @error.nil?
71
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
72
+ end
73
+
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @error.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ error == o.error
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Integer] Hash code
100
+ def hash
101
+ [error].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def self.build_from_hash(attributes)
108
+ new.build_from_hash(attributes)
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+ self.class.openapi_types.each_pair do |key, type|
117
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
118
+ self.send("#{key}=", nil)
119
+ elsif type =~ /\AArray<(.*)>/i
120
+ # check to ensure the input is an array given that the attribute
121
+ # is documented as an array but the input is not
122
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
123
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
124
+ end
125
+ elsif !attributes[self.class.attribute_map[key]].nil?
126
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
+ end
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def _deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = OryHydraClient.const_get(type)
172
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = self.send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end
@@ -0,0 +1,338 @@
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.5
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 object represents a login flow. A login flow is initiated at the \"Initiate Login API / Browser Flow\" endpoint by a client. Once a login flow is completed successfully, a session cookie or session token will be issued.
18
+ class LoginFlow
19
+ # and so on.
20
+ attr_accessor :active
21
+
22
+ # CreatedAt is a helper struct field for gobuffalo.pop.
23
+ attr_accessor :created_at
24
+
25
+ # ExpiresAt is the time (UTC) when the flow expires. If the user still wishes to log in, a new flow has to be initiated.
26
+ attr_accessor :expires_at
27
+
28
+ # Forced stores whether this login flow should enforce re-authentication.
29
+ attr_accessor :forced
30
+
31
+ attr_accessor :id
32
+
33
+ # IssuedAt is the time (UTC) when the flow started.
34
+ attr_accessor :issued_at
35
+
36
+ # 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.
37
+ attr_accessor :request_url
38
+
39
+ # The flow type can either be `api` or `browser`.
40
+ attr_accessor :type
41
+
42
+ attr_accessor :ui
43
+
44
+ # UpdatedAt is a helper struct field for gobuffalo.pop.
45
+ attr_accessor :updated_at
46
+
47
+ # Attribute mapping from ruby-style variable name to JSON key.
48
+ def self.attribute_map
49
+ {
50
+ :'active' => :'active',
51
+ :'created_at' => :'created_at',
52
+ :'expires_at' => :'expires_at',
53
+ :'forced' => :'forced',
54
+ :'id' => :'id',
55
+ :'issued_at' => :'issued_at',
56
+ :'request_url' => :'request_url',
57
+ :'type' => :'type',
58
+ :'ui' => :'ui',
59
+ :'updated_at' => :'updated_at'
60
+ }
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'active' => :'String',
72
+ :'created_at' => :'Time',
73
+ :'expires_at' => :'Time',
74
+ :'forced' => :'Boolean',
75
+ :'id' => :'String',
76
+ :'issued_at' => :'Time',
77
+ :'request_url' => :'String',
78
+ :'type' => :'String',
79
+ :'ui' => :'UiContainer',
80
+ :'updated_at' => :'Time'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::LoginFlow` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::LoginFlow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'active')
106
+ self.active = attributes[:'active']
107
+ end
108
+
109
+ if attributes.key?(:'created_at')
110
+ self.created_at = attributes[:'created_at']
111
+ end
112
+
113
+ if attributes.key?(:'expires_at')
114
+ self.expires_at = attributes[:'expires_at']
115
+ end
116
+
117
+ if attributes.key?(:'forced')
118
+ self.forced = attributes[:'forced']
119
+ end
120
+
121
+ if attributes.key?(:'id')
122
+ self.id = attributes[:'id']
123
+ end
124
+
125
+ if attributes.key?(:'issued_at')
126
+ self.issued_at = attributes[:'issued_at']
127
+ end
128
+
129
+ if attributes.key?(:'request_url')
130
+ self.request_url = attributes[:'request_url']
131
+ end
132
+
133
+ if attributes.key?(:'type')
134
+ self.type = attributes[:'type']
135
+ end
136
+
137
+ if attributes.key?(:'ui')
138
+ self.ui = attributes[:'ui']
139
+ end
140
+
141
+ if attributes.key?(:'updated_at')
142
+ self.updated_at = attributes[:'updated_at']
143
+ end
144
+ end
145
+
146
+ # Show invalid properties with the reasons. Usually used together with valid?
147
+ # @return Array for valid properties with the reasons
148
+ def list_invalid_properties
149
+ invalid_properties = Array.new
150
+ if @expires_at.nil?
151
+ invalid_properties.push('invalid value for "expires_at", expires_at cannot be nil.')
152
+ end
153
+
154
+ if @id.nil?
155
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
156
+ end
157
+
158
+ if @issued_at.nil?
159
+ invalid_properties.push('invalid value for "issued_at", issued_at cannot be nil.')
160
+ end
161
+
162
+ if @request_url.nil?
163
+ invalid_properties.push('invalid value for "request_url", request_url cannot be nil.')
164
+ end
165
+
166
+ if @type.nil?
167
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
168
+ end
169
+
170
+ if @ui.nil?
171
+ invalid_properties.push('invalid value for "ui", ui cannot be nil.')
172
+ end
173
+
174
+ invalid_properties
175
+ end
176
+
177
+ # Check to see if the all the properties in the model are valid
178
+ # @return true if the model is valid
179
+ def valid?
180
+ return false if @expires_at.nil?
181
+ return false if @id.nil?
182
+ return false if @issued_at.nil?
183
+ return false if @request_url.nil?
184
+ return false if @type.nil?
185
+ return false if @ui.nil?
186
+ true
187
+ end
188
+
189
+ # Checks equality by comparing each attribute.
190
+ # @param [Object] Object to be compared
191
+ def ==(o)
192
+ return true if self.equal?(o)
193
+ self.class == o.class &&
194
+ active == o.active &&
195
+ created_at == o.created_at &&
196
+ expires_at == o.expires_at &&
197
+ forced == o.forced &&
198
+ id == o.id &&
199
+ issued_at == o.issued_at &&
200
+ request_url == o.request_url &&
201
+ type == o.type &&
202
+ ui == o.ui &&
203
+ updated_at == o.updated_at
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [active, created_at, expires_at, forced, id, issued_at, request_url, type, ui, updated_at].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ new.build_from_hash(attributes)
223
+ end
224
+
225
+ # Builds the object from hash
226
+ # @param [Hash] attributes Model attributes in the form of hash
227
+ # @return [Object] Returns the model itself
228
+ def build_from_hash(attributes)
229
+ return nil unless attributes.is_a?(Hash)
230
+ self.class.openapi_types.each_pair do |key, type|
231
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
232
+ self.send("#{key}=", nil)
233
+ elsif type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
237
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
238
+ end
239
+ elsif !attributes[self.class.attribute_map[key]].nil?
240
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
241
+ end
242
+ end
243
+
244
+ self
245
+ end
246
+
247
+ # Deserializes the data based on type
248
+ # @param string type Data type
249
+ # @param string value Value to be deserialized
250
+ # @return [Object] Deserialized data
251
+ def _deserialize(type, value)
252
+ case type.to_sym
253
+ when :Time
254
+ Time.parse(value)
255
+ when :Date
256
+ Date.parse(value)
257
+ when :String
258
+ value.to_s
259
+ when :Integer
260
+ value.to_i
261
+ when :Float
262
+ value.to_f
263
+ when :Boolean
264
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
265
+ true
266
+ else
267
+ false
268
+ end
269
+ when :Object
270
+ # generic object (usually a Hash), return directly
271
+ value
272
+ when /\AArray<(?<inner_type>.+)>\z/
273
+ inner_type = Regexp.last_match[:inner_type]
274
+ value.map { |v| _deserialize(inner_type, v) }
275
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
276
+ k_type = Regexp.last_match[:k_type]
277
+ v_type = Regexp.last_match[:v_type]
278
+ {}.tap do |hash|
279
+ value.each do |k, v|
280
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
281
+ end
282
+ end
283
+ else # model
284
+ # models (e.g. Pet) or oneOf
285
+ klass = OryHydraClient.const_get(type)
286
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
287
+ end
288
+ end
289
+
290
+ # Returns the string representation of the object
291
+ # @return [String] String presentation of the object
292
+ def to_s
293
+ to_hash.to_s
294
+ end
295
+
296
+ # to_body is an alias to to_hash (backward compatibility)
297
+ # @return [Hash] Returns the object in the form of hash
298
+ def to_body
299
+ to_hash
300
+ end
301
+
302
+ # Returns the object in the form of hash
303
+ # @return [Hash] Returns the object in the form of hash
304
+ def to_hash
305
+ hash = {}
306
+ self.class.attribute_map.each_pair do |attr, param|
307
+ value = self.send(attr)
308
+ if value.nil?
309
+ is_nullable = self.class.openapi_nullable.include?(attr)
310
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
311
+ end
312
+
313
+ hash[param] = _to_hash(value)
314
+ end
315
+ hash
316
+ end
317
+
318
+ # Outputs non-array value in the form of hash
319
+ # For object, use to_hash. Otherwise, just return the value
320
+ # @param [Object] value Any valid value
321
+ # @return [Hash] Returns the value in the form of hash
322
+ def _to_hash(value)
323
+ if value.is_a?(Array)
324
+ value.compact.map { |v| _to_hash(v) }
325
+ elsif value.is_a?(Hash)
326
+ {}.tap do |hash|
327
+ value.each { |k, v| hash[k] = _to_hash(v) }
328
+ end
329
+ elsif value.respond_to? :to_hash
330
+ value.to_hash
331
+ else
332
+ value
333
+ end
334
+ end
335
+
336
+ end
337
+
338
+ end