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,309 @@
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
+ # An identity can be a real human, a service, an IoT device - everything that can be described as an \"actor\" in a system.
18
+ class Identity
19
+ # CreatedAt is a helper struct field for gobuffalo.pop.
20
+ attr_accessor :created_at
21
+
22
+ attr_accessor :id
23
+
24
+ # RecoveryAddresses contains all the addresses that can be used to recover an identity.
25
+ attr_accessor :recovery_addresses
26
+
27
+ # SchemaID is the ID of the JSON Schema to be used for validating the identity's traits.
28
+ attr_accessor :schema_id
29
+
30
+ # SchemaURL is the URL of the endpoint where the identity's traits schema can be fetched from. format: url
31
+ attr_accessor :schema_url
32
+
33
+ # Traits represent an identity's traits. The identity is able to create, modify, and delete traits in a self-service manner. The input will always be validated against the JSON Schema defined in `schema_url`.
34
+ attr_accessor :traits
35
+
36
+ # UpdatedAt is a helper struct field for gobuffalo.pop.
37
+ attr_accessor :updated_at
38
+
39
+ # VerifiableAddresses contains all the addresses that can be verified by the user.
40
+ attr_accessor :verifiable_addresses
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'created_at' => :'created_at',
46
+ :'id' => :'id',
47
+ :'recovery_addresses' => :'recovery_addresses',
48
+ :'schema_id' => :'schema_id',
49
+ :'schema_url' => :'schema_url',
50
+ :'traits' => :'traits',
51
+ :'updated_at' => :'updated_at',
52
+ :'verifiable_addresses' => :'verifiable_addresses'
53
+ }
54
+ end
55
+
56
+ # Returns all the JSON keys this model knows about
57
+ def self.acceptable_attributes
58
+ attribute_map.values
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.openapi_types
63
+ {
64
+ :'created_at' => :'Time',
65
+ :'id' => :'String',
66
+ :'recovery_addresses' => :'Array<RecoveryAddress>',
67
+ :'schema_id' => :'String',
68
+ :'schema_url' => :'String',
69
+ :'traits' => :'AnyType',
70
+ :'updated_at' => :'Time',
71
+ :'verifiable_addresses' => :'Array<VerifiableIdentityAddress>'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'traits',
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::Identity` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::Identity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'created_at')
98
+ self.created_at = attributes[:'created_at']
99
+ end
100
+
101
+ if attributes.key?(:'id')
102
+ self.id = attributes[:'id']
103
+ end
104
+
105
+ if attributes.key?(:'recovery_addresses')
106
+ if (value = attributes[:'recovery_addresses']).is_a?(Array)
107
+ self.recovery_addresses = value
108
+ end
109
+ end
110
+
111
+ if attributes.key?(:'schema_id')
112
+ self.schema_id = attributes[:'schema_id']
113
+ end
114
+
115
+ if attributes.key?(:'schema_url')
116
+ self.schema_url = attributes[:'schema_url']
117
+ end
118
+
119
+ if attributes.key?(:'traits')
120
+ self.traits = attributes[:'traits']
121
+ end
122
+
123
+ if attributes.key?(:'updated_at')
124
+ self.updated_at = attributes[:'updated_at']
125
+ end
126
+
127
+ if attributes.key?(:'verifiable_addresses')
128
+ if (value = attributes[:'verifiable_addresses']).is_a?(Array)
129
+ self.verifiable_addresses = value
130
+ end
131
+ end
132
+ end
133
+
134
+ # Show invalid properties with the reasons. Usually used together with valid?
135
+ # @return Array for valid properties with the reasons
136
+ def list_invalid_properties
137
+ invalid_properties = Array.new
138
+ if @id.nil?
139
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
140
+ end
141
+
142
+ if @schema_id.nil?
143
+ invalid_properties.push('invalid value for "schema_id", schema_id cannot be nil.')
144
+ end
145
+
146
+ if @schema_url.nil?
147
+ invalid_properties.push('invalid value for "schema_url", schema_url cannot be nil.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ return false if @id.nil?
157
+ return false if @schema_id.nil?
158
+ return false if @schema_url.nil?
159
+ true
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ created_at == o.created_at &&
168
+ id == o.id &&
169
+ recovery_addresses == o.recovery_addresses &&
170
+ schema_id == o.schema_id &&
171
+ schema_url == o.schema_url &&
172
+ traits == o.traits &&
173
+ updated_at == o.updated_at &&
174
+ verifiable_addresses == o.verifiable_addresses
175
+ end
176
+
177
+ # @see the `==` method
178
+ # @param [Object] Object to be compared
179
+ def eql?(o)
180
+ self == o
181
+ end
182
+
183
+ # Calculates hash code according to all attributes.
184
+ # @return [Integer] Hash code
185
+ def hash
186
+ [created_at, id, recovery_addresses, schema_id, schema_url, traits, updated_at, verifiable_addresses].hash
187
+ end
188
+
189
+ # Builds the object from hash
190
+ # @param [Hash] attributes Model attributes in the form of hash
191
+ # @return [Object] Returns the model itself
192
+ def self.build_from_hash(attributes)
193
+ new.build_from_hash(attributes)
194
+ end
195
+
196
+ # Builds the object from hash
197
+ # @param [Hash] attributes Model attributes in the form of hash
198
+ # @return [Object] Returns the model itself
199
+ def build_from_hash(attributes)
200
+ return nil unless attributes.is_a?(Hash)
201
+ self.class.openapi_types.each_pair do |key, type|
202
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
203
+ self.send("#{key}=", nil)
204
+ elsif type =~ /\AArray<(.*)>/i
205
+ # check to ensure the input is an array given that the attribute
206
+ # is documented as an array but the input is not
207
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
208
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
209
+ end
210
+ elsif !attributes[self.class.attribute_map[key]].nil?
211
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
+ end
213
+ end
214
+
215
+ self
216
+ end
217
+
218
+ # Deserializes the data based on type
219
+ # @param string type Data type
220
+ # @param string value Value to be deserialized
221
+ # @return [Object] Deserialized data
222
+ def _deserialize(type, value)
223
+ case type.to_sym
224
+ when :Time
225
+ Time.parse(value)
226
+ when :Date
227
+ Date.parse(value)
228
+ when :String
229
+ value.to_s
230
+ when :Integer
231
+ value.to_i
232
+ when :Float
233
+ value.to_f
234
+ when :Boolean
235
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
236
+ true
237
+ else
238
+ false
239
+ end
240
+ when :Object
241
+ # generic object (usually a Hash), return directly
242
+ value
243
+ when /\AArray<(?<inner_type>.+)>\z/
244
+ inner_type = Regexp.last_match[:inner_type]
245
+ value.map { |v| _deserialize(inner_type, v) }
246
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
247
+ k_type = Regexp.last_match[:k_type]
248
+ v_type = Regexp.last_match[:v_type]
249
+ {}.tap do |hash|
250
+ value.each do |k, v|
251
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
252
+ end
253
+ end
254
+ else # model
255
+ # models (e.g. Pet) or oneOf
256
+ klass = OryHydraClient.const_get(type)
257
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ if value.nil?
280
+ is_nullable = self.class.openapi_nullable.include?(attr)
281
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
282
+ end
283
+
284
+ hash[param] = _to_hash(value)
285
+ end
286
+ hash
287
+ end
288
+
289
+ # Outputs non-array value in the form of hash
290
+ # For object, use to_hash. Otherwise, just return the value
291
+ # @param [Object] value Any valid value
292
+ # @return [Hash] Returns the value in the form of hash
293
+ def _to_hash(value)
294
+ if value.is_a?(Array)
295
+ value.compact.map { |v| _to_hash(v) }
296
+ elsif value.is_a?(Hash)
297
+ {}.tap do |hash|
298
+ value.each { |k, v| hash[k] = _to_hash(v) }
299
+ end
300
+ elsif value.respond_to? :to_hash
301
+ value.to_hash
302
+ else
303
+ value
304
+ end
305
+ end
306
+
307
+ end
308
+
309
+ end
@@ -0,0 +1,261 @@
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
+ # Credentials represents a specific credential type
18
+ class IdentityCredentials
19
+ attr_accessor :config
20
+
21
+ # CreatedAt is a helper struct field for gobuffalo.pop.
22
+ attr_accessor :created_at
23
+
24
+ # Identifiers represents a list of unique identifiers this credential type matches.
25
+ attr_accessor :identifiers
26
+
27
+ # and so on.
28
+ attr_accessor :type
29
+
30
+ # UpdatedAt is a helper struct field for gobuffalo.pop.
31
+ attr_accessor :updated_at
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'config' => :'config',
37
+ :'created_at' => :'created_at',
38
+ :'identifiers' => :'identifiers',
39
+ :'type' => :'type',
40
+ :'updated_at' => :'updated_at'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'config' => :'Object',
53
+ :'created_at' => :'Time',
54
+ :'identifiers' => :'Array<String>',
55
+ :'type' => :'String',
56
+ :'updated_at' => :'Time'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::IdentityCredentials` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::IdentityCredentials`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'config')
82
+ self.config = attributes[:'config']
83
+ end
84
+
85
+ if attributes.key?(:'created_at')
86
+ self.created_at = attributes[:'created_at']
87
+ end
88
+
89
+ if attributes.key?(:'identifiers')
90
+ if (value = attributes[:'identifiers']).is_a?(Array)
91
+ self.identifiers = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'type')
96
+ self.type = attributes[:'type']
97
+ end
98
+
99
+ if attributes.key?(:'updated_at')
100
+ self.updated_at = attributes[:'updated_at']
101
+ end
102
+ end
103
+
104
+ # Show invalid properties with the reasons. Usually used together with valid?
105
+ # @return Array for valid properties with the reasons
106
+ def list_invalid_properties
107
+ invalid_properties = Array.new
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ config == o.config &&
123
+ created_at == o.created_at &&
124
+ identifiers == o.identifiers &&
125
+ type == o.type &&
126
+ updated_at == o.updated_at
127
+ end
128
+
129
+ # @see the `==` method
130
+ # @param [Object] Object to be compared
131
+ def eql?(o)
132
+ self == o
133
+ end
134
+
135
+ # Calculates hash code according to all attributes.
136
+ # @return [Integer] Hash code
137
+ def hash
138
+ [config, created_at, identifiers, type, updated_at].hash
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def self.build_from_hash(attributes)
145
+ new.build_from_hash(attributes)
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def build_from_hash(attributes)
152
+ return nil unless attributes.is_a?(Hash)
153
+ self.class.openapi_types.each_pair do |key, type|
154
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
155
+ self.send("#{key}=", nil)
156
+ elsif type =~ /\AArray<(.*)>/i
157
+ # check to ensure the input is an array given that the attribute
158
+ # is documented as an array but the input is not
159
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
160
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
161
+ end
162
+ elsif !attributes[self.class.attribute_map[key]].nil?
163
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
164
+ end
165
+ end
166
+
167
+ self
168
+ end
169
+
170
+ # Deserializes the data based on type
171
+ # @param string type Data type
172
+ # @param string value Value to be deserialized
173
+ # @return [Object] Deserialized data
174
+ def _deserialize(type, value)
175
+ case type.to_sym
176
+ when :Time
177
+ Time.parse(value)
178
+ when :Date
179
+ Date.parse(value)
180
+ when :String
181
+ value.to_s
182
+ when :Integer
183
+ value.to_i
184
+ when :Float
185
+ value.to_f
186
+ when :Boolean
187
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ true
189
+ else
190
+ false
191
+ end
192
+ when :Object
193
+ # generic object (usually a Hash), return directly
194
+ value
195
+ when /\AArray<(?<inner_type>.+)>\z/
196
+ inner_type = Regexp.last_match[:inner_type]
197
+ value.map { |v| _deserialize(inner_type, v) }
198
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ k_type = Regexp.last_match[:k_type]
200
+ v_type = Regexp.last_match[:v_type]
201
+ {}.tap do |hash|
202
+ value.each do |k, v|
203
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
204
+ end
205
+ end
206
+ else # model
207
+ # models (e.g. Pet) or oneOf
208
+ klass = OryHydraClient.const_get(type)
209
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ if value.nil?
232
+ is_nullable = self.class.openapi_nullable.include?(attr)
233
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
234
+ end
235
+
236
+ hash[param] = _to_hash(value)
237
+ end
238
+ hash
239
+ end
240
+
241
+ # Outputs non-array value in the form of hash
242
+ # For object, use to_hash. Otherwise, just return the value
243
+ # @param [Object] value Any valid value
244
+ # @return [Hash] Returns the value in the form of hash
245
+ def _to_hash(value)
246
+ if value.is_a?(Array)
247
+ value.compact.map { |v| _to_hash(v) }
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.each { |k, v| hash[k] = _to_hash(v) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash
254
+ else
255
+ value
256
+ end
257
+ end
258
+
259
+ end
260
+
261
+ end