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