ory-keto-client 0.4.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (221) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +129 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddOryAccessControlPolicyRoleMembers.md +21 -0
  6. data/docs/AddOryAccessControlPolicyRoleMembersBody.md +17 -0
  7. data/docs/AddOryAccessControlPolicyRoleMembersInternalServerError.md +17 -0
  8. data/docs/AddOryAccessControlPolicyRoleMembersInternalServerErrorBody.md +27 -0
  9. data/docs/AddOryAccessControlPolicyRoleMembersOK.md +17 -0
  10. data/docs/AuthorizationResult.md +17 -0
  11. data/docs/DeleteOryAccessControlPolicy.md +19 -0
  12. data/docs/DeleteOryAccessControlPolicyInternalServerError.md +17 -0
  13. data/docs/DeleteOryAccessControlPolicyInternalServerErrorBody.md +27 -0
  14. data/docs/DeleteOryAccessControlPolicyRole.md +19 -0
  15. data/docs/DeleteOryAccessControlPolicyRoleInternalServerError.md +17 -0
  16. data/docs/DeleteOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
  17. data/docs/DoOryAccessControlPoliciesAllow.md +19 -0
  18. data/docs/DoOryAccessControlPoliciesAllowForbidden.md +17 -0
  19. data/docs/DoOryAccessControlPoliciesAllowInternalServerError.md +17 -0
  20. data/docs/DoOryAccessControlPoliciesAllowInternalServerErrorBody.md +27 -0
  21. data/docs/DoOryAccessControlPoliciesAllowOK.md +17 -0
  22. data/docs/EnginesApi.md +579 -0
  23. data/docs/GetOryAccessControlPolicy.md +19 -0
  24. data/docs/GetOryAccessControlPolicyInternalServerError.md +17 -0
  25. data/docs/GetOryAccessControlPolicyInternalServerErrorBody.md +27 -0
  26. data/docs/GetOryAccessControlPolicyNotFound.md +17 -0
  27. data/docs/GetOryAccessControlPolicyNotFoundBody.md +27 -0
  28. data/docs/GetOryAccessControlPolicyOK.md +17 -0
  29. data/docs/GetOryAccessControlPolicyRole.md +19 -0
  30. data/docs/GetOryAccessControlPolicyRoleInternalServerError.md +17 -0
  31. data/docs/GetOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
  32. data/docs/GetOryAccessControlPolicyRoleNotFound.md +17 -0
  33. data/docs/GetOryAccessControlPolicyRoleNotFoundBody.md +27 -0
  34. data/docs/GetOryAccessControlPolicyRoleOK.md +17 -0
  35. data/docs/HealthApi.md +96 -0
  36. data/docs/HealthNotReadyStatus.md +17 -0
  37. data/docs/HealthStatus.md +17 -0
  38. data/docs/InlineResponse500.md +27 -0
  39. data/docs/Input.md +23 -0
  40. data/docs/IsInstanceAliveInternalServerError.md +17 -0
  41. data/docs/IsInstanceAliveInternalServerErrorBody.md +27 -0
  42. data/docs/IsInstanceAliveOK.md +17 -0
  43. data/docs/ListOryAccessControlPolicies.md +21 -0
  44. data/docs/ListOryAccessControlPoliciesInternalServerError.md +17 -0
  45. data/docs/ListOryAccessControlPoliciesInternalServerErrorBody.md +27 -0
  46. data/docs/ListOryAccessControlPoliciesOK.md +17 -0
  47. data/docs/ListOryAccessControlPolicyRoles.md +21 -0
  48. data/docs/ListOryAccessControlPolicyRolesInternalServerError.md +17 -0
  49. data/docs/ListOryAccessControlPolicyRolesInternalServerErrorBody.md +27 -0
  50. data/docs/ListOryAccessControlPolicyRolesOK.md +17 -0
  51. data/docs/OryAccessControlPolicies.md +17 -0
  52. data/docs/OryAccessControlPolicy.md +29 -0
  53. data/docs/OryAccessControlPolicyAllowedInput.md +23 -0
  54. data/docs/OryAccessControlPolicyRole.md +19 -0
  55. data/docs/OryAccessControlPolicyRoles.md +17 -0
  56. data/docs/Policy.md +29 -0
  57. data/docs/RemoveOryAccessControlPolicyRoleMembers.md +21 -0
  58. data/docs/RemoveOryAccessControlPolicyRoleMembersInternalServerError.md +17 -0
  59. data/docs/RemoveOryAccessControlPolicyRoleMembersInternalServerErrorBody.md +27 -0
  60. data/docs/Role.md +19 -0
  61. data/docs/SwaggerHealthStatus.md +17 -0
  62. data/docs/SwaggerNotReadyStatus.md +17 -0
  63. data/docs/SwaggerVersion.md +17 -0
  64. data/docs/UpsertOryAccessControlPolicy.md +19 -0
  65. data/docs/UpsertOryAccessControlPolicyInternalServerError.md +17 -0
  66. data/docs/UpsertOryAccessControlPolicyInternalServerErrorBody.md +27 -0
  67. data/docs/UpsertOryAccessControlPolicyOK.md +17 -0
  68. data/docs/UpsertOryAccessControlPolicyRole.md +19 -0
  69. data/docs/UpsertOryAccessControlPolicyRoleInternalServerError.md +17 -0
  70. data/docs/UpsertOryAccessControlPolicyRoleInternalServerErrorBody.md +27 -0
  71. data/docs/UpsertOryAccessControlPolicyRoleOK.md +17 -0
  72. data/docs/Version.md +17 -0
  73. data/docs/VersionApi.md +52 -0
  74. data/lib/ory-keto-client.rb +65 -0
  75. data/lib/ory-keto-client/api/engines_api.rb +778 -0
  76. data/lib/ory-keto-client/api/health_api.rb +134 -0
  77. data/lib/ory-keto-client/api/version_api.rb +78 -0
  78. data/lib/ory-keto-client/api_client.rb +385 -0
  79. data/lib/ory-keto-client/api_error.rb +57 -0
  80. data/lib/ory-keto-client/configuration.rb +241 -0
  81. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members.rb +237 -0
  82. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_body.rb +209 -0
  83. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_internal_server_error.rb +207 -0
  84. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_internal_server_error_body.rb +260 -0
  85. data/lib/ory-keto-client/models/add_ory_access_control_policy_role_members_ok.rb +207 -0
  86. data/lib/ory-keto-client/models/authorization_result.rb +212 -0
  87. data/lib/ory-keto-client/models/delete_ory_access_control_policy.rb +228 -0
  88. data/lib/ory-keto-client/models/delete_ory_access_control_policy_internal_server_error.rb +207 -0
  89. data/lib/ory-keto-client/models/delete_ory_access_control_policy_internal_server_error_body.rb +260 -0
  90. data/lib/ory-keto-client/models/delete_ory_access_control_policy_role.rb +228 -0
  91. data/lib/ory-keto-client/models/delete_ory_access_control_policy_role_internal_server_error.rb +207 -0
  92. data/lib/ory-keto-client/models/delete_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
  93. data/lib/ory-keto-client/models/do_ory_access_control_policies_allow.rb +222 -0
  94. data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_forbidden.rb +207 -0
  95. data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_internal_server_error.rb +207 -0
  96. data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_internal_server_error_body.rb +260 -0
  97. data/lib/ory-keto-client/models/do_ory_access_control_policies_allow_ok.rb +207 -0
  98. data/lib/ory-keto-client/models/get_ory_access_control_policy.rb +228 -0
  99. data/lib/ory-keto-client/models/get_ory_access_control_policy_internal_server_error.rb +207 -0
  100. data/lib/ory-keto-client/models/get_ory_access_control_policy_internal_server_error_body.rb +260 -0
  101. data/lib/ory-keto-client/models/get_ory_access_control_policy_not_found.rb +207 -0
  102. data/lib/ory-keto-client/models/get_ory_access_control_policy_not_found_body.rb +260 -0
  103. data/lib/ory-keto-client/models/get_ory_access_control_policy_ok.rb +207 -0
  104. data/lib/ory-keto-client/models/get_ory_access_control_policy_role.rb +228 -0
  105. data/lib/ory-keto-client/models/get_ory_access_control_policy_role_internal_server_error.rb +207 -0
  106. data/lib/ory-keto-client/models/get_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
  107. data/lib/ory-keto-client/models/get_ory_access_control_policy_role_not_found.rb +207 -0
  108. data/lib/ory-keto-client/models/get_ory_access_control_policy_role_not_found_body.rb +260 -0
  109. data/lib/ory-keto-client/models/get_ory_access_control_policy_role_ok.rb +207 -0
  110. data/lib/ory-keto-client/models/health_not_ready_status.rb +210 -0
  111. data/lib/ory-keto-client/models/health_status.rb +207 -0
  112. data/lib/ory-keto-client/models/inline_response500.rb +253 -0
  113. data/lib/ory-keto-client/models/input.rb +239 -0
  114. data/lib/ory-keto-client/models/is_instance_alive_internal_server_error.rb +207 -0
  115. data/lib/ory-keto-client/models/is_instance_alive_internal_server_error_body.rb +260 -0
  116. data/lib/ory-keto-client/models/is_instance_alive_ok.rb +207 -0
  117. data/lib/ory-keto-client/models/list_ory_access_control_policies.rb +233 -0
  118. data/lib/ory-keto-client/models/list_ory_access_control_policies_internal_server_error.rb +207 -0
  119. data/lib/ory-keto-client/models/list_ory_access_control_policies_internal_server_error_body.rb +260 -0
  120. data/lib/ory-keto-client/models/list_ory_access_control_policies_ok.rb +210 -0
  121. data/lib/ory-keto-client/models/list_ory_access_control_policy_roles.rb +233 -0
  122. data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_internal_server_error.rb +207 -0
  123. data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_internal_server_error_body.rb +260 -0
  124. data/lib/ory-keto-client/models/list_ory_access_control_policy_roles_ok.rb +210 -0
  125. data/lib/ory-keto-client/models/ory_access_control_policies.rb +209 -0
  126. data/lib/ory-keto-client/models/ory_access_control_policy.rb +275 -0
  127. data/lib/ory-keto-client/models/ory_access_control_policy_allowed_input.rb +239 -0
  128. data/lib/ory-keto-client/models/ory_access_control_policy_role.rb +220 -0
  129. data/lib/ory-keto-client/models/ory_access_control_policy_roles.rb +209 -0
  130. data/lib/ory-keto-client/models/policy.rb +275 -0
  131. data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members.rb +243 -0
  132. data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members_internal_server_error.rb +207 -0
  133. data/lib/ory-keto-client/models/remove_ory_access_control_policy_role_members_internal_server_error_body.rb +260 -0
  134. data/lib/ory-keto-client/models/role.rb +220 -0
  135. data/lib/ory-keto-client/models/swagger_health_status.rb +208 -0
  136. data/lib/ory-keto-client/models/swagger_not_ready_status.rb +210 -0
  137. data/lib/ory-keto-client/models/swagger_version.rb +208 -0
  138. data/lib/ory-keto-client/models/upsert_ory_access_control_policy.rb +222 -0
  139. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_internal_server_error.rb +207 -0
  140. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_internal_server_error_body.rb +260 -0
  141. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_ok.rb +207 -0
  142. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role.rb +222 -0
  143. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_internal_server_error.rb +207 -0
  144. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_internal_server_error_body.rb +260 -0
  145. data/lib/ory-keto-client/models/upsert_ory_access_control_policy_role_ok.rb +207 -0
  146. data/lib/ory-keto-client/models/version.rb +208 -0
  147. data/lib/ory-keto-client/version.rb +15 -0
  148. data/ory-keto-client.gemspec +39 -0
  149. data/spec/api/engines_api_spec.rb +182 -0
  150. data/spec/api/health_api_spec.rb +57 -0
  151. data/spec/api/version_api_spec.rb +46 -0
  152. data/spec/api_client_spec.rb +226 -0
  153. data/spec/configuration_spec.rb +42 -0
  154. data/spec/models/add_ory_access_control_policy_role_members_body_spec.rb +41 -0
  155. data/spec/models/add_ory_access_control_policy_role_members_internal_server_error_body_spec.rb +71 -0
  156. data/spec/models/add_ory_access_control_policy_role_members_internal_server_error_spec.rb +41 -0
  157. data/spec/models/add_ory_access_control_policy_role_members_ok_spec.rb +41 -0
  158. data/spec/models/add_ory_access_control_policy_role_members_spec.rb +53 -0
  159. data/spec/models/authorization_result_spec.rb +41 -0
  160. data/spec/models/delete_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
  161. data/spec/models/delete_ory_access_control_policy_internal_server_error_spec.rb +41 -0
  162. data/spec/models/delete_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
  163. data/spec/models/delete_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
  164. data/spec/models/delete_ory_access_control_policy_role_spec.rb +47 -0
  165. data/spec/models/delete_ory_access_control_policy_spec.rb +47 -0
  166. data/spec/models/do_ory_access_control_policies_allow_forbidden_spec.rb +41 -0
  167. data/spec/models/do_ory_access_control_policies_allow_internal_server_error_body_spec.rb +71 -0
  168. data/spec/models/do_ory_access_control_policies_allow_internal_server_error_spec.rb +41 -0
  169. data/spec/models/do_ory_access_control_policies_allow_ok_spec.rb +41 -0
  170. data/spec/models/do_ory_access_control_policies_allow_spec.rb +47 -0
  171. data/spec/models/get_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
  172. data/spec/models/get_ory_access_control_policy_internal_server_error_spec.rb +41 -0
  173. data/spec/models/get_ory_access_control_policy_not_found_body_spec.rb +71 -0
  174. data/spec/models/get_ory_access_control_policy_not_found_spec.rb +41 -0
  175. data/spec/models/get_ory_access_control_policy_ok_spec.rb +41 -0
  176. data/spec/models/get_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
  177. data/spec/models/get_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
  178. data/spec/models/get_ory_access_control_policy_role_not_found_body_spec.rb +71 -0
  179. data/spec/models/get_ory_access_control_policy_role_not_found_spec.rb +41 -0
  180. data/spec/models/get_ory_access_control_policy_role_ok_spec.rb +41 -0
  181. data/spec/models/get_ory_access_control_policy_role_spec.rb +47 -0
  182. data/spec/models/get_ory_access_control_policy_spec.rb +47 -0
  183. data/spec/models/health_not_ready_status_spec.rb +41 -0
  184. data/spec/models/health_status_spec.rb +41 -0
  185. data/spec/models/inline_response500_spec.rb +71 -0
  186. data/spec/models/input_spec.rb +59 -0
  187. data/spec/models/is_instance_alive_internal_server_error_body_spec.rb +71 -0
  188. data/spec/models/is_instance_alive_internal_server_error_spec.rb +41 -0
  189. data/spec/models/is_instance_alive_ok_spec.rb +41 -0
  190. data/spec/models/list_ory_access_control_policies_internal_server_error_body_spec.rb +71 -0
  191. data/spec/models/list_ory_access_control_policies_internal_server_error_spec.rb +41 -0
  192. data/spec/models/list_ory_access_control_policies_ok_spec.rb +41 -0
  193. data/spec/models/list_ory_access_control_policies_spec.rb +53 -0
  194. data/spec/models/list_ory_access_control_policy_roles_internal_server_error_body_spec.rb +71 -0
  195. data/spec/models/list_ory_access_control_policy_roles_internal_server_error_spec.rb +41 -0
  196. data/spec/models/list_ory_access_control_policy_roles_ok_spec.rb +41 -0
  197. data/spec/models/list_ory_access_control_policy_roles_spec.rb +53 -0
  198. data/spec/models/ory_access_control_policies_spec.rb +41 -0
  199. data/spec/models/ory_access_control_policy_allowed_input_spec.rb +59 -0
  200. data/spec/models/ory_access_control_policy_role_spec.rb +47 -0
  201. data/spec/models/ory_access_control_policy_roles_spec.rb +41 -0
  202. data/spec/models/ory_access_control_policy_spec.rb +77 -0
  203. data/spec/models/policy_spec.rb +77 -0
  204. data/spec/models/remove_ory_access_control_policy_role_members_internal_server_error_body_spec.rb +71 -0
  205. data/spec/models/remove_ory_access_control_policy_role_members_internal_server_error_spec.rb +41 -0
  206. data/spec/models/remove_ory_access_control_policy_role_members_spec.rb +53 -0
  207. data/spec/models/role_spec.rb +47 -0
  208. data/spec/models/swagger_health_status_spec.rb +41 -0
  209. data/spec/models/swagger_not_ready_status_spec.rb +41 -0
  210. data/spec/models/swagger_version_spec.rb +41 -0
  211. data/spec/models/upsert_ory_access_control_policy_internal_server_error_body_spec.rb +71 -0
  212. data/spec/models/upsert_ory_access_control_policy_internal_server_error_spec.rb +41 -0
  213. data/spec/models/upsert_ory_access_control_policy_ok_spec.rb +41 -0
  214. data/spec/models/upsert_ory_access_control_policy_role_internal_server_error_body_spec.rb +71 -0
  215. data/spec/models/upsert_ory_access_control_policy_role_internal_server_error_spec.rb +41 -0
  216. data/spec/models/upsert_ory_access_control_policy_role_ok_spec.rb +41 -0
  217. data/spec/models/upsert_ory_access_control_policy_role_spec.rb +47 -0
  218. data/spec/models/upsert_ory_access_control_policy_spec.rb +47 -0
  219. data/spec/models/version_spec.rb +41 -0
  220. data/spec/spec_helper.rb +111 -0
  221. metadata +396 -0
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #ORY Keto
3
+
4
+ #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
+
6
+ The version of the OpenAPI document: Latest
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # HealthNotReadyStatus health not ready status
17
+ class HealthNotReadyStatus
18
+ # Errors contains a list of errors that caused the not ready status.
19
+ attr_accessor :errors
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'errors' => :'errors'
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.openapi_types
30
+ {
31
+ :'errors' => :'Hash<String, String>'
32
+ }
33
+ end
34
+
35
+ # List of attributes with nullable: true
36
+ def self.openapi_nullable
37
+ Set.new([
38
+ ])
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ if (!attributes.is_a?(Hash))
45
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::HealthNotReadyStatus` initialize method"
46
+ end
47
+
48
+ # check to see if the attribute exists and convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h|
50
+ if (!self.class.attribute_map.key?(k.to_sym))
51
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::HealthNotReadyStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
52
+ end
53
+ h[k.to_sym] = v
54
+ }
55
+
56
+ if attributes.key?(:'errors')
57
+ if (value = attributes[:'errors']).is_a?(Hash)
58
+ self.errors = value
59
+ end
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ errors == o.errors
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [errors].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.openapi_types.each_pair do |key, type|
109
+ if type =~ /\AArray<(.*)>/i
110
+ # check to ensure the input is an array given that the attribute
111
+ # is documented as an array but the input is not
112
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
113
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
114
+ end
115
+ elsif !attributes[self.class.attribute_map[key]].nil?
116
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ # Deserializes the data based on type
124
+ # @param string type Data type
125
+ # @param string value Value to be deserialized
126
+ # @return [Object] Deserialized data
127
+ def _deserialize(type, value)
128
+ case type.to_sym
129
+ when :DateTime
130
+ DateTime.parse(value)
131
+ when :Date
132
+ Date.parse(value)
133
+ when :String
134
+ value.to_s
135
+ when :Integer
136
+ value.to_i
137
+ when :Float
138
+ value.to_f
139
+ when :Boolean
140
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
+ true
142
+ else
143
+ false
144
+ end
145
+ when :Object
146
+ # generic object (usually a Hash), return directly
147
+ value
148
+ when /\AArray<(?<inner_type>.+)>\z/
149
+ inner_type = Regexp.last_match[:inner_type]
150
+ value.map { |v| _deserialize(inner_type, v) }
151
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
+ k_type = Regexp.last_match[:k_type]
153
+ v_type = Regexp.last_match[:v_type]
154
+ {}.tap do |hash|
155
+ value.each do |k, v|
156
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
+ end
158
+ end
159
+ else # model
160
+ OryHydraClient.const_get(type).build_from_hash(value)
161
+ end
162
+ end
163
+
164
+ # Returns the string representation of the object
165
+ # @return [String] String presentation of the object
166
+ def to_s
167
+ to_hash.to_s
168
+ end
169
+
170
+ # to_body is an alias to to_hash (backward compatibility)
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_body
173
+ to_hash
174
+ end
175
+
176
+ # Returns the object in the form of hash
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_hash
179
+ hash = {}
180
+ self.class.attribute_map.each_pair do |attr, param|
181
+ value = self.send(attr)
182
+ if value.nil?
183
+ is_nullable = self.class.openapi_nullable.include?(attr)
184
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
185
+ end
186
+
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+ end
210
+ end
@@ -0,0 +1,207 @@
1
+ =begin
2
+ #ORY Keto
3
+
4
+ #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
+
6
+ The version of the OpenAPI document: Latest
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class HealthStatus
17
+ # Status always contains \"ok\".
18
+ attr_accessor :status
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'status' => :'status'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'status' => :'String'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::HealthStatus` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::HealthStatus`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'status')
56
+ self.status = attributes[:'status']
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ invalid_properties
65
+ end
66
+
67
+ # Check to see if the all the properties in the model are valid
68
+ # @return true if the model is valid
69
+ def valid?
70
+ true
71
+ end
72
+
73
+ # Checks equality by comparing each attribute.
74
+ # @param [Object] Object to be compared
75
+ def ==(o)
76
+ return true if self.equal?(o)
77
+ self.class == o.class &&
78
+ status == o.status
79
+ end
80
+
81
+ # @see the `==` method
82
+ # @param [Object] Object to be compared
83
+ def eql?(o)
84
+ self == o
85
+ end
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Integer] Hash code
89
+ def hash
90
+ [status].hash
91
+ end
92
+
93
+ # Builds the object from hash
94
+ # @param [Hash] attributes Model attributes in the form of hash
95
+ # @return [Object] Returns the model itself
96
+ def self.build_from_hash(attributes)
97
+ new.build_from_hash(attributes)
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.openapi_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def _deserialize(type, value)
125
+ case type.to_sym
126
+ when :DateTime
127
+ DateTime.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :Boolean
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ OryHydraClient.const_get(type).build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ # Outputs non-array value in the form of hash
190
+ # For object, use to_hash. Otherwise, just return the value
191
+ # @param [Object] value Any valid value
192
+ # @return [Hash] Returns the value in the form of hash
193
+ def _to_hash(value)
194
+ if value.is_a?(Array)
195
+ value.compact.map { |v| _to_hash(v) }
196
+ elsif value.is_a?(Hash)
197
+ {}.tap do |hash|
198
+ value.each { |k, v| hash[k] = _to_hash(v) }
199
+ end
200
+ elsif value.respond_to? :to_hash
201
+ value.to_hash
202
+ else
203
+ value
204
+ end
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,253 @@
1
+ =begin
2
+ #ORY Keto
3
+
4
+ #Ory Keto is a cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
5
+
6
+ The version of the OpenAPI document: Latest
7
+ Contact: hi@ory.sh
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class InlineResponse500
17
+ attr_accessor :code
18
+
19
+ attr_accessor :details
20
+
21
+ attr_accessor :message
22
+
23
+ attr_accessor :reason
24
+
25
+ attr_accessor :request
26
+
27
+ attr_accessor :status
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'code' => :'code',
33
+ :'details' => :'details',
34
+ :'message' => :'message',
35
+ :'reason' => :'reason',
36
+ :'request' => :'request',
37
+ :'status' => :'status'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'code' => :'Integer',
45
+ :'details' => :'Array<Hash<String, Object>>',
46
+ :'message' => :'String',
47
+ :'reason' => :'String',
48
+ :'request' => :'String',
49
+ :'status' => :'String'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::InlineResponse500` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::InlineResponse500`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'code')
75
+ self.code = attributes[:'code']
76
+ end
77
+
78
+ if attributes.key?(:'details')
79
+ if (value = attributes[:'details']).is_a?(Array)
80
+ self.details = value
81
+ end
82
+ end
83
+
84
+ if attributes.key?(:'message')
85
+ self.message = attributes[:'message']
86
+ end
87
+
88
+ if attributes.key?(:'reason')
89
+ self.reason = attributes[:'reason']
90
+ end
91
+
92
+ if attributes.key?(:'request')
93
+ self.request = attributes[:'request']
94
+ end
95
+
96
+ if attributes.key?(:'status')
97
+ self.status = attributes[:'status']
98
+ end
99
+ end
100
+
101
+ # Show invalid properties with the reasons. Usually used together with valid?
102
+ # @return Array for valid properties with the reasons
103
+ def list_invalid_properties
104
+ invalid_properties = Array.new
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ code == o.code &&
120
+ details == o.details &&
121
+ message == o.message &&
122
+ reason == o.reason &&
123
+ request == o.request &&
124
+ status == o.status
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [code, details, message, reason, request, status].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ OryHydraClient.const_get(type).build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+ end
253
+ end