permify 0.0.1 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/Gemfile +6 -1
- data/README.md +241 -16
- data/Rakefile +7 -7
- data/generator/generate-sdk.sh +157 -0
- data/generator/openapi-generator-cli.jar +0 -0
- data/generator/openapi.json +3699 -0
- data/lib/permify/api/bundle_api.rb +238 -0
- data/lib/permify/api/data_api.rb +526 -0
- data/lib/permify/api/permission_api.rb +528 -0
- data/lib/permify/api/schema_api.rb +310 -0
- data/lib/permify/api/tenancy_api.rb +215 -0
- data/lib/permify/api/watch_api.rb +94 -0
- data/lib/permify/api_client.rb +394 -0
- data/lib/permify/api_error.rb +58 -0
- data/lib/permify/configuration.rb +298 -0
- data/lib/permify/models/abstract_type.rb +228 -0
- data/lib/permify/models/any.rb +216 -0
- data/lib/permify/models/argument.rb +215 -0
- data/lib/permify/models/attribute.rb +233 -0
- data/lib/permify/models/attribute_definition.rb +247 -0
- data/lib/permify/models/attribute_filter.rb +226 -0
- data/lib/permify/models/attribute_read_request_metadata.rb +216 -0
- data/lib/permify/models/attribute_read_response.rb +228 -0
- data/lib/permify/models/attribute_type.rb +46 -0
- data/lib/permify/models/bulk_check_body.rb +248 -0
- data/lib/permify/models/bundle_delete_body.rb +216 -0
- data/lib/permify/models/bundle_delete_response.rb +214 -0
- data/lib/permify/models/bundle_read_body.rb +214 -0
- data/lib/permify/models/bundle_read_response.rb +214 -0
- data/lib/permify/models/bundle_run_response.rb +216 -0
- data/lib/permify/models/bundle_write_body.rb +218 -0
- data/lib/permify/models/bundle_write_response.rb +218 -0
- data/lib/permify/models/check_body.rb +264 -0
- data/lib/permify/models/check_result.rb +40 -0
- data/lib/permify/models/checked_expr.rb +258 -0
- data/lib/permify/models/child.rb +224 -0
- data/lib/permify/models/component.rb +41 -0
- data/lib/permify/models/comprehension.rb +281 -0
- data/lib/permify/models/computed_attribute.rb +215 -0
- data/lib/permify/models/computed_user_set.rb +215 -0
- data/lib/permify/models/constant.rb +317 -0
- data/lib/permify/models/context.rb +240 -0
- data/lib/permify/models/create_list.rb +230 -0
- data/lib/permify/models/create_struct.rb +228 -0
- data/lib/permify/models/data_bundle.rb +240 -0
- data/lib/permify/models/data_change.rb +255 -0
- data/lib/permify/models/data_change_operation.rb +40 -0
- data/lib/permify/models/data_changes.rb +228 -0
- data/lib/permify/models/data_delete_body.rb +224 -0
- data/lib/permify/models/data_delete_response.rb +216 -0
- data/lib/permify/models/data_write_body.rb +239 -0
- data/lib/permify/models/data_write_request_metadata.rb +216 -0
- data/lib/permify/models/data_write_response.rb +216 -0
- data/lib/permify/models/delete_relationships_body.rb +214 -0
- data/lib/permify/models/entity.rb +224 -0
- data/lib/permify/models/entity_definition.rb +264 -0
- data/lib/permify/models/entity_definition_reference.rb +41 -0
- data/lib/permify/models/entity_filter.rb +226 -0
- data/lib/permify/models/entry.rb +254 -0
- data/lib/permify/models/expand_leaf.rb +233 -0
- data/lib/permify/models/expand_tree_node.rb +248 -0
- data/lib/permify/models/expand_tree_node_operation.rb +41 -0
- data/lib/permify/models/expr.rb +279 -0
- data/lib/permify/models/expr_call.rb +237 -0
- data/lib/permify/models/extension.rb +236 -0
- data/lib/permify/models/function_type.rb +227 -0
- data/lib/permify/models/ident.rb +216 -0
- data/lib/permify/models/leaf.rb +242 -0
- data/lib/permify/models/list_type.rb +215 -0
- data/lib/permify/models/lookup_entity_body.rb +285 -0
- data/lib/permify/models/lookup_entity_stream_body.rb +285 -0
- data/lib/permify/models/lookup_subject_body.rb +284 -0
- data/lib/permify/models/map_type.rb +224 -0
- data/lib/permify/models/partial_write_body.rb +225 -0
- data/lib/permify/models/partials.rb +238 -0
- data/lib/permify/models/permission_bulk_check_request_item.rb +233 -0
- data/lib/permify/models/permission_bulk_check_response.rb +218 -0
- data/lib/permify/models/permission_check_request_metadata.rb +236 -0
- data/lib/permify/models/permission_check_response.rb +246 -0
- data/lib/permify/models/permission_check_response_metadata.rb +216 -0
- data/lib/permify/models/permission_definition.rb +225 -0
- data/lib/permify/models/permission_expand_body.rb +255 -0
- data/lib/permify/models/permission_expand_request_metadata.rb +226 -0
- data/lib/permify/models/permission_expand_response.rb +215 -0
- data/lib/permify/models/permission_lookup_entity_request_metadata.rb +236 -0
- data/lib/permify/models/permission_lookup_entity_response.rb +228 -0
- data/lib/permify/models/permission_lookup_entity_stream_response.rb +226 -0
- data/lib/permify/models/permission_lookup_subject_request_metadata.rb +236 -0
- data/lib/permify/models/permission_lookup_subject_response.rb +228 -0
- data/lib/permify/models/permission_subject_permission_request_metadata.rb +246 -0
- data/lib/permify/models/permission_subject_permission_response.rb +218 -0
- data/lib/permify/models/primitive_type.rb +44 -0
- data/lib/permify/models/read_attributes_body.rb +244 -0
- data/lib/permify/models/read_relationships_body.rb +244 -0
- data/lib/permify/models/relation_definition.rb +228 -0
- data/lib/permify/models/relation_reference.rb +226 -0
- data/lib/permify/models/relationship_delete_response.rb +215 -0
- data/lib/permify/models/relationship_read_request_metadata.rb +216 -0
- data/lib/permify/models/relationship_read_response.rb +228 -0
- data/lib/permify/models/relationship_write_request_metadata.rb +214 -0
- data/lib/permify/models/relationship_write_response.rb +215 -0
- data/lib/permify/models/rewrite.rb +249 -0
- data/lib/permify/models/rewrite_operation.rb +41 -0
- data/lib/permify/models/rule_definition.rb +237 -0
- data/lib/permify/models/run_bundle_body.rb +228 -0
- data/lib/permify/models/schema_definition.rb +242 -0
- data/lib/permify/models/schema_definition_reference.rb +40 -0
- data/lib/permify/models/schema_list.rb +223 -0
- data/lib/permify/models/schema_list_body.rb +226 -0
- data/lib/permify/models/schema_list_response.rb +235 -0
- data/lib/permify/models/schema_partial_write_request_metadata.rb +216 -0
- data/lib/permify/models/schema_partial_write_response.rb +216 -0
- data/lib/permify/models/schema_read_body.rb +215 -0
- data/lib/permify/models/schema_read_request_metadata.rb +216 -0
- data/lib/permify/models/schema_read_response.rb +215 -0
- data/lib/permify/models/schema_write_body.rb +216 -0
- data/lib/permify/models/schema_write_response.rb +216 -0
- data/lib/permify/models/select.rb +235 -0
- data/lib/permify/models/source_info.rb +274 -0
- data/lib/permify/models/status.rb +234 -0
- data/lib/permify/models/stream_result_of_permission_lookup_entity_stream_response.rb +223 -0
- data/lib/permify/models/stream_result_of_watch_response.rb +223 -0
- data/lib/permify/models/string_array_value.rb +218 -0
- data/lib/permify/models/subject.rb +233 -0
- data/lib/permify/models/subject_filter.rb +235 -0
- data/lib/permify/models/subject_permission_body.rb +242 -0
- data/lib/permify/models/subjects.rb +218 -0
- data/lib/permify/models/tenant.rb +236 -0
- data/lib/permify/models/tenant_create_request.rb +226 -0
- data/lib/permify/models/tenant_create_response.rb +215 -0
- data/lib/permify/models/tenant_delete_response.rb +216 -0
- data/lib/permify/models/tenant_list_request.rb +226 -0
- data/lib/permify/models/tenant_list_response.rb +228 -0
- data/lib/permify/models/tuple.rb +233 -0
- data/lib/permify/models/tuple_filter.rb +233 -0
- data/lib/permify/models/tuple_set.rb +215 -0
- data/lib/permify/models/tuple_to_user_set.rb +224 -0
- data/lib/permify/models/v1_call.rb +226 -0
- data/lib/permify/models/v1_expand.rb +255 -0
- data/lib/permify/models/v1_operation.rb +254 -0
- data/lib/permify/models/v1alpha1_reference.rb +237 -0
- data/lib/permify/models/v1alpha1_type.rb +350 -0
- data/lib/permify/models/values.rb +216 -0
- data/lib/permify/models/version.rb +225 -0
- data/lib/permify/models/watch_body.rb +216 -0
- data/lib/permify/models/watch_response.rb +215 -0
- data/lib/permify/models/well_known_type.rb +41 -0
- data/lib/permify/models/write_relationships_body.rb +227 -0
- data/lib/permify/version.rb +13 -1
- data/lib/permify.rb +175 -15
- data/permify-ruby.gemspec +39 -0
- data/permify.gemspec +38 -27
- data/spec/api/bundle_api_spec.rb +71 -0
- data/spec/api/data_api_spec.rb +119 -0
- data/spec/api/permission_api_spec.rb +120 -0
- data/spec/api/schema_api_spec.rb +83 -0
- data/spec/api/tenancy_api_spec.rb +68 -0
- data/spec/api/watch_api_spec.rb +47 -0
- data/spec/models/abstract_type_spec.rb +42 -0
- data/spec/models/any_spec.rb +36 -0
- data/spec/models/argument_spec.rb +36 -0
- data/spec/models/attribute_definition_spec.rb +42 -0
- data/spec/models/attribute_filter_spec.rb +42 -0
- data/spec/models/attribute_read_request_metadata_spec.rb +36 -0
- data/spec/models/attribute_read_response_spec.rb +42 -0
- data/spec/models/attribute_spec.rb +48 -0
- data/spec/models/attribute_type_spec.rb +30 -0
- data/spec/models/bulk_check_body_spec.rb +54 -0
- data/spec/models/bundle_delete_body_spec.rb +36 -0
- data/spec/models/bundle_delete_response_spec.rb +36 -0
- data/spec/models/bundle_read_body_spec.rb +36 -0
- data/spec/models/bundle_read_response_spec.rb +36 -0
- data/spec/models/bundle_run_response_spec.rb +36 -0
- data/spec/models/bundle_write_body_spec.rb +36 -0
- data/spec/models/bundle_write_response_spec.rb +36 -0
- data/spec/models/check_body_spec.rb +66 -0
- data/spec/models/check_result_spec.rb +30 -0
- data/spec/models/checked_expr_spec.rb +60 -0
- data/spec/models/child_spec.rb +42 -0
- data/spec/models/component_spec.rb +30 -0
- data/spec/models/comprehension_spec.rb +78 -0
- data/spec/models/computed_attribute_spec.rb +36 -0
- data/spec/models/computed_user_set_spec.rb +36 -0
- data/spec/models/constant_spec.rb +84 -0
- data/spec/models/context_spec.rb +48 -0
- data/spec/models/create_list_spec.rb +42 -0
- data/spec/models/create_struct_spec.rb +42 -0
- data/spec/models/data_bundle_spec.rb +48 -0
- data/spec/models/data_change_operation_spec.rb +30 -0
- data/spec/models/data_change_spec.rb +48 -0
- data/spec/models/data_changes_spec.rb +42 -0
- data/spec/models/data_delete_body_spec.rb +42 -0
- data/spec/models/data_delete_response_spec.rb +36 -0
- data/spec/models/data_write_body_spec.rb +48 -0
- data/spec/models/data_write_request_metadata_spec.rb +36 -0
- data/spec/models/data_write_response_spec.rb +36 -0
- data/spec/models/delete_relationships_body_spec.rb +36 -0
- data/spec/models/entity_definition_reference_spec.rb +30 -0
- data/spec/models/entity_definition_spec.rb +60 -0
- data/spec/models/entity_filter_spec.rb +42 -0
- data/spec/models/entity_spec.rb +42 -0
- data/spec/models/entry_spec.rb +60 -0
- data/spec/models/expand_leaf_spec.rb +48 -0
- data/spec/models/expand_tree_node_operation_spec.rb +30 -0
- data/spec/models/expand_tree_node_spec.rb +42 -0
- data/spec/models/expr_call_spec.rb +48 -0
- data/spec/models/expr_spec.rb +78 -0
- data/spec/models/extension_spec.rb +48 -0
- data/spec/models/function_type_spec.rb +42 -0
- data/spec/models/ident_spec.rb +36 -0
- data/spec/models/leaf_spec.rb +54 -0
- data/spec/models/list_type_spec.rb +36 -0
- data/spec/models/lookup_entity_body_spec.rb +78 -0
- data/spec/models/lookup_entity_stream_body_spec.rb +78 -0
- data/spec/models/lookup_subject_body_spec.rb +78 -0
- data/spec/models/map_type_spec.rb +42 -0
- data/spec/models/partial_write_body_spec.rb +42 -0
- data/spec/models/partials_spec.rb +48 -0
- data/spec/models/permission_bulk_check_request_item_spec.rb +48 -0
- data/spec/models/permission_bulk_check_response_spec.rb +36 -0
- data/spec/models/permission_check_request_metadata_spec.rb +48 -0
- data/spec/models/permission_check_response_metadata_spec.rb +36 -0
- data/spec/models/permission_check_response_spec.rb +42 -0
- data/spec/models/permission_definition_spec.rb +42 -0
- data/spec/models/permission_expand_body_spec.rb +60 -0
- data/spec/models/permission_expand_request_metadata_spec.rb +42 -0
- data/spec/models/permission_expand_response_spec.rb +36 -0
- data/spec/models/permission_lookup_entity_request_metadata_spec.rb +48 -0
- data/spec/models/permission_lookup_entity_response_spec.rb +42 -0
- data/spec/models/permission_lookup_entity_stream_response_spec.rb +42 -0
- data/spec/models/permission_lookup_subject_request_metadata_spec.rb +48 -0
- data/spec/models/permission_lookup_subject_response_spec.rb +42 -0
- data/spec/models/permission_subject_permission_request_metadata_spec.rb +54 -0
- data/spec/models/permission_subject_permission_response_spec.rb +36 -0
- data/spec/models/primitive_type_spec.rb +30 -0
- data/spec/models/read_attributes_body_spec.rb +54 -0
- data/spec/models/read_relationships_body_spec.rb +54 -0
- data/spec/models/relation_definition_spec.rb +42 -0
- data/spec/models/relation_reference_spec.rb +42 -0
- data/spec/models/relationship_delete_response_spec.rb +36 -0
- data/spec/models/relationship_read_request_metadata_spec.rb +36 -0
- data/spec/models/relationship_read_response_spec.rb +42 -0
- data/spec/models/relationship_write_request_metadata_spec.rb +36 -0
- data/spec/models/relationship_write_response_spec.rb +36 -0
- data/spec/models/rewrite_operation_spec.rb +30 -0
- data/spec/models/rewrite_spec.rb +42 -0
- data/spec/models/rule_definition_spec.rb +48 -0
- data/spec/models/run_bundle_body_spec.rb +42 -0
- data/spec/models/schema_definition_reference_spec.rb +30 -0
- data/spec/models/schema_definition_spec.rb +48 -0
- data/spec/models/schema_list_body_spec.rb +42 -0
- data/spec/models/schema_list_response_spec.rb +48 -0
- data/spec/models/schema_list_spec.rb +42 -0
- data/spec/models/schema_partial_write_request_metadata_spec.rb +36 -0
- data/spec/models/schema_partial_write_response_spec.rb +36 -0
- data/spec/models/schema_read_body_spec.rb +36 -0
- data/spec/models/schema_read_request_metadata_spec.rb +36 -0
- data/spec/models/schema_read_response_spec.rb +36 -0
- data/spec/models/schema_write_body_spec.rb +36 -0
- data/spec/models/schema_write_response_spec.rb +36 -0
- data/spec/models/select_spec.rb +48 -0
- data/spec/models/source_info_spec.rb +66 -0
- data/spec/models/status_spec.rb +48 -0
- data/spec/models/stream_result_of_permission_lookup_entity_stream_response_spec.rb +42 -0
- data/spec/models/stream_result_of_watch_response_spec.rb +42 -0
- data/spec/models/string_array_value_spec.rb +36 -0
- data/spec/models/subject_filter_spec.rb +48 -0
- data/spec/models/subject_permission_body_spec.rb +54 -0
- data/spec/models/subject_spec.rb +48 -0
- data/spec/models/subjects_spec.rb +36 -0
- data/spec/models/tenant_create_request_spec.rb +42 -0
- data/spec/models/tenant_create_response_spec.rb +36 -0
- data/spec/models/tenant_delete_response_spec.rb +36 -0
- data/spec/models/tenant_list_request_spec.rb +42 -0
- data/spec/models/tenant_list_response_spec.rb +42 -0
- data/spec/models/tenant_spec.rb +48 -0
- data/spec/models/tuple_filter_spec.rb +48 -0
- data/spec/models/tuple_set_spec.rb +36 -0
- data/spec/models/tuple_spec.rb +48 -0
- data/spec/models/tuple_to_user_set_spec.rb +42 -0
- data/spec/models/v1_call_spec.rb +42 -0
- data/spec/models/v1_expand_spec.rb +60 -0
- data/spec/models/v1_operation_spec.rb +54 -0
- data/spec/models/v1alpha1_reference_spec.rb +48 -0
- data/spec/models/v1alpha1_type_spec.rb +108 -0
- data/spec/models/values_spec.rb +36 -0
- data/spec/models/version_spec.rb +42 -0
- data/spec/models/watch_body_spec.rb +36 -0
- data/spec/models/watch_response_spec.rb +36 -0
- data/spec/models/well_known_type_spec.rb +30 -0
- data/spec/models/write_relationships_body_spec.rb +42 -0
- data/spec/spec_helper.rb +101 -3
- metadata +449 -85
- data/.gitignore +0 -17
- data/.rspec +0 -2
- data/LICENSE.txt +0 -22
- data/lib/permify/authorization.rb +0 -17
- data/lib/permify/clearance.rb +0 -29
- data/lib/permify/permission/combination/any.rb +0 -13
- data/lib/permify/permission/combination.rb +0 -4
- data/lib/permify/permission/combination_map.rb +0 -23
- data/lib/permify/permission/dynamic.rb +0 -13
- data/lib/permify/permission/null.rb +0 -7
- data/lib/permify/permission/static.rb +0 -7
- data/lib/permify/permission.rb +0 -10
- data/lib/permify/permission_map.rb +0 -32
- data/lib/permify/repository.rb +0 -68
- data/spec/integration_spec.rb +0 -114
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Permify API
|
|
3
|
+
|
|
4
|
+
#Permify is an open source authorization service for creating fine-grained and scalable authorization systems.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1.5.4
|
|
7
|
+
Contact: hello@permify.co
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 7.2.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Permify
|
|
17
|
+
# PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service.
|
|
18
|
+
class LookupEntityBody
|
|
19
|
+
attr_accessor :metadata
|
|
20
|
+
|
|
21
|
+
# Type of the entity to lookup, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.
|
|
22
|
+
attr_accessor :entity_type
|
|
23
|
+
|
|
24
|
+
# Name of the permission to check, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.
|
|
25
|
+
attr_accessor :permission
|
|
26
|
+
|
|
27
|
+
attr_accessor :subject
|
|
28
|
+
|
|
29
|
+
attr_accessor :context
|
|
30
|
+
|
|
31
|
+
# Scope: A map that associates entity types with lists of identifiers. Each entry helps filter requests by specifying which entities are relevant to the operation.
|
|
32
|
+
attr_accessor :scope
|
|
33
|
+
|
|
34
|
+
# page_size is the number of entities to be returned in the response. The value should be between 1 and 100.
|
|
35
|
+
attr_accessor :page_size
|
|
36
|
+
|
|
37
|
+
# continuous_token is an optional parameter used for pagination. It should be the value received in the previous response.
|
|
38
|
+
attr_accessor :continuous_token
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'metadata' => :'metadata',
|
|
44
|
+
:'entity_type' => :'entity_type',
|
|
45
|
+
:'permission' => :'permission',
|
|
46
|
+
:'subject' => :'subject',
|
|
47
|
+
:'context' => :'context',
|
|
48
|
+
:'scope' => :'scope',
|
|
49
|
+
:'page_size' => :'page_size',
|
|
50
|
+
:'continuous_token' => :'continuous_token'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'metadata' => :'PermissionLookupEntityRequestMetadata',
|
|
63
|
+
:'entity_type' => :'String',
|
|
64
|
+
:'permission' => :'String',
|
|
65
|
+
:'subject' => :'Subject',
|
|
66
|
+
:'context' => :'Context',
|
|
67
|
+
:'scope' => :'Hash<String, StringArrayValue>',
|
|
68
|
+
:'page_size' => :'Integer',
|
|
69
|
+
:'continuous_token' => :'String'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# List of attributes with nullable: true
|
|
74
|
+
def self.openapi_nullable
|
|
75
|
+
Set.new([
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Initializes the object
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
if (!attributes.is_a?(Hash))
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Permify::LookupEntityBody` initialize method"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Permify::LookupEntityBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
90
|
+
end
|
|
91
|
+
h[k.to_sym] = v
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'metadata')
|
|
95
|
+
self.metadata = attributes[:'metadata']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'entity_type')
|
|
99
|
+
self.entity_type = attributes[:'entity_type']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'permission')
|
|
103
|
+
self.permission = attributes[:'permission']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'subject')
|
|
107
|
+
self.subject = attributes[:'subject']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'context')
|
|
111
|
+
self.context = attributes[:'context']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'scope')
|
|
115
|
+
if (value = attributes[:'scope']).is_a?(Hash)
|
|
116
|
+
self.scope = value
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'page_size')
|
|
121
|
+
self.page_size = attributes[:'page_size']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'continuous_token')
|
|
125
|
+
self.continuous_token = attributes[:'continuous_token']
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
130
|
+
# @return Array for valid properties with the reasons
|
|
131
|
+
def list_invalid_properties
|
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
133
|
+
invalid_properties = Array.new
|
|
134
|
+
invalid_properties
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Check to see if the all the properties in the model are valid
|
|
138
|
+
# @return true if the model is valid
|
|
139
|
+
def valid?
|
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Checks equality by comparing each attribute.
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def ==(o)
|
|
147
|
+
return true if self.equal?(o)
|
|
148
|
+
self.class == o.class &&
|
|
149
|
+
metadata == o.metadata &&
|
|
150
|
+
entity_type == o.entity_type &&
|
|
151
|
+
permission == o.permission &&
|
|
152
|
+
subject == o.subject &&
|
|
153
|
+
context == o.context &&
|
|
154
|
+
scope == o.scope &&
|
|
155
|
+
page_size == o.page_size &&
|
|
156
|
+
continuous_token == o.continuous_token
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# @see the `==` method
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def eql?(o)
|
|
162
|
+
self == o
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Calculates hash code according to all attributes.
|
|
166
|
+
# @return [Integer] Hash code
|
|
167
|
+
def hash
|
|
168
|
+
[metadata, entity_type, permission, subject, context, scope, page_size, continuous_token].hash
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Builds the object from hash
|
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
173
|
+
# @return [Object] Returns the model itself
|
|
174
|
+
def self.build_from_hash(attributes)
|
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
177
|
+
transformed_hash = {}
|
|
178
|
+
openapi_types.each_pair do |key, type|
|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = nil
|
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
182
|
+
# check to ensure the input is an array given that the attribute
|
|
183
|
+
# is documented as an array but the input is not
|
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
186
|
+
end
|
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
new(transformed_hash)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Deserializes the data based on type
|
|
195
|
+
# @param string type Data type
|
|
196
|
+
# @param string value Value to be deserialized
|
|
197
|
+
# @return [Object] Deserialized data
|
|
198
|
+
def self._deserialize(type, value)
|
|
199
|
+
case type.to_sym
|
|
200
|
+
when :Time
|
|
201
|
+
Time.parse(value)
|
|
202
|
+
when :Date
|
|
203
|
+
Date.parse(value)
|
|
204
|
+
when :String
|
|
205
|
+
value.to_s
|
|
206
|
+
when :Integer
|
|
207
|
+
value.to_i
|
|
208
|
+
when :Float
|
|
209
|
+
value.to_f
|
|
210
|
+
when :Boolean
|
|
211
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
212
|
+
true
|
|
213
|
+
else
|
|
214
|
+
false
|
|
215
|
+
end
|
|
216
|
+
when :Object
|
|
217
|
+
# generic object (usually a Hash), return directly
|
|
218
|
+
value
|
|
219
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
220
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
221
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
222
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
223
|
+
k_type = Regexp.last_match[:k_type]
|
|
224
|
+
v_type = Regexp.last_match[:v_type]
|
|
225
|
+
{}.tap do |hash|
|
|
226
|
+
value.each do |k, v|
|
|
227
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
else # model
|
|
231
|
+
# models (e.g. Pet) or oneOf
|
|
232
|
+
klass = Permify.const_get(type)
|
|
233
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Returns the string representation of the object
|
|
238
|
+
# @return [String] String presentation of the object
|
|
239
|
+
def to_s
|
|
240
|
+
to_hash.to_s
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
|
245
|
+
def to_body
|
|
246
|
+
to_hash
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Returns the object in the form of hash
|
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
|
251
|
+
def to_hash
|
|
252
|
+
hash = {}
|
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
254
|
+
value = self.send(attr)
|
|
255
|
+
if value.nil?
|
|
256
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
257
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
hash[param] = _to_hash(value)
|
|
261
|
+
end
|
|
262
|
+
hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Outputs non-array value in the form of hash
|
|
266
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
267
|
+
# @param [Object] value Any valid value
|
|
268
|
+
# @return [Hash] Returns the value in the form of hash
|
|
269
|
+
def _to_hash(value)
|
|
270
|
+
if value.is_a?(Array)
|
|
271
|
+
value.compact.map { |v| _to_hash(v) }
|
|
272
|
+
elsif value.is_a?(Hash)
|
|
273
|
+
{}.tap do |hash|
|
|
274
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
275
|
+
end
|
|
276
|
+
elsif value.respond_to? :to_hash
|
|
277
|
+
value.to_hash
|
|
278
|
+
else
|
|
279
|
+
value
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Permify API
|
|
3
|
+
|
|
4
|
+
#Permify is an open source authorization service for creating fine-grained and scalable authorization systems.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v1.5.4
|
|
7
|
+
Contact: hello@permify.co
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
OpenAPI Generator version: 7.2.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Permify
|
|
17
|
+
# PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service.
|
|
18
|
+
class LookupEntityStreamBody
|
|
19
|
+
attr_accessor :metadata
|
|
20
|
+
|
|
21
|
+
# Type of the entity to lookup, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.
|
|
22
|
+
attr_accessor :entity_type
|
|
23
|
+
|
|
24
|
+
# Name of the permission to check, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes.
|
|
25
|
+
attr_accessor :permission
|
|
26
|
+
|
|
27
|
+
attr_accessor :subject
|
|
28
|
+
|
|
29
|
+
attr_accessor :context
|
|
30
|
+
|
|
31
|
+
# Scope: A map that associates entity types with lists of identifiers. Each entry helps filter requests by specifying which entities are relevant to the operation.
|
|
32
|
+
attr_accessor :scope
|
|
33
|
+
|
|
34
|
+
# page_size is the number of entities to be returned in the response. The value should be between 1 and 100.
|
|
35
|
+
attr_accessor :page_size
|
|
36
|
+
|
|
37
|
+
# continuous_token is an optional parameter used for pagination. It should be the value received in the previous response.
|
|
38
|
+
attr_accessor :continuous_token
|
|
39
|
+
|
|
40
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
41
|
+
def self.attribute_map
|
|
42
|
+
{
|
|
43
|
+
:'metadata' => :'metadata',
|
|
44
|
+
:'entity_type' => :'entity_type',
|
|
45
|
+
:'permission' => :'permission',
|
|
46
|
+
:'subject' => :'subject',
|
|
47
|
+
:'context' => :'context',
|
|
48
|
+
:'scope' => :'scope',
|
|
49
|
+
:'page_size' => :'page_size',
|
|
50
|
+
:'continuous_token' => :'continuous_token'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'metadata' => :'PermissionLookupEntityRequestMetadata',
|
|
63
|
+
:'entity_type' => :'String',
|
|
64
|
+
:'permission' => :'String',
|
|
65
|
+
:'subject' => :'Subject',
|
|
66
|
+
:'context' => :'Context',
|
|
67
|
+
:'scope' => :'Hash<String, StringArrayValue>',
|
|
68
|
+
:'page_size' => :'Integer',
|
|
69
|
+
:'continuous_token' => :'String'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# List of attributes with nullable: true
|
|
74
|
+
def self.openapi_nullable
|
|
75
|
+
Set.new([
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Initializes the object
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
if (!attributes.is_a?(Hash))
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Permify::LookupEntityStreamBody` initialize method"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Permify::LookupEntityStreamBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
90
|
+
end
|
|
91
|
+
h[k.to_sym] = v
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'metadata')
|
|
95
|
+
self.metadata = attributes[:'metadata']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'entity_type')
|
|
99
|
+
self.entity_type = attributes[:'entity_type']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'permission')
|
|
103
|
+
self.permission = attributes[:'permission']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'subject')
|
|
107
|
+
self.subject = attributes[:'subject']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'context')
|
|
111
|
+
self.context = attributes[:'context']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'scope')
|
|
115
|
+
if (value = attributes[:'scope']).is_a?(Hash)
|
|
116
|
+
self.scope = value
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'page_size')
|
|
121
|
+
self.page_size = attributes[:'page_size']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'continuous_token')
|
|
125
|
+
self.continuous_token = attributes[:'continuous_token']
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
130
|
+
# @return Array for valid properties with the reasons
|
|
131
|
+
def list_invalid_properties
|
|
132
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
133
|
+
invalid_properties = Array.new
|
|
134
|
+
invalid_properties
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Check to see if the all the properties in the model are valid
|
|
138
|
+
# @return true if the model is valid
|
|
139
|
+
def valid?
|
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Checks equality by comparing each attribute.
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def ==(o)
|
|
147
|
+
return true if self.equal?(o)
|
|
148
|
+
self.class == o.class &&
|
|
149
|
+
metadata == o.metadata &&
|
|
150
|
+
entity_type == o.entity_type &&
|
|
151
|
+
permission == o.permission &&
|
|
152
|
+
subject == o.subject &&
|
|
153
|
+
context == o.context &&
|
|
154
|
+
scope == o.scope &&
|
|
155
|
+
page_size == o.page_size &&
|
|
156
|
+
continuous_token == o.continuous_token
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# @see the `==` method
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def eql?(o)
|
|
162
|
+
self == o
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Calculates hash code according to all attributes.
|
|
166
|
+
# @return [Integer] Hash code
|
|
167
|
+
def hash
|
|
168
|
+
[metadata, entity_type, permission, subject, context, scope, page_size, continuous_token].hash
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Builds the object from hash
|
|
172
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
173
|
+
# @return [Object] Returns the model itself
|
|
174
|
+
def self.build_from_hash(attributes)
|
|
175
|
+
return nil unless attributes.is_a?(Hash)
|
|
176
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
177
|
+
transformed_hash = {}
|
|
178
|
+
openapi_types.each_pair do |key, type|
|
|
179
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = nil
|
|
181
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
182
|
+
# check to ensure the input is an array given that the attribute
|
|
183
|
+
# is documented as an array but the input is not
|
|
184
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
185
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
186
|
+
end
|
|
187
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
188
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
new(transformed_hash)
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Deserializes the data based on type
|
|
195
|
+
# @param string type Data type
|
|
196
|
+
# @param string value Value to be deserialized
|
|
197
|
+
# @return [Object] Deserialized data
|
|
198
|
+
def self._deserialize(type, value)
|
|
199
|
+
case type.to_sym
|
|
200
|
+
when :Time
|
|
201
|
+
Time.parse(value)
|
|
202
|
+
when :Date
|
|
203
|
+
Date.parse(value)
|
|
204
|
+
when :String
|
|
205
|
+
value.to_s
|
|
206
|
+
when :Integer
|
|
207
|
+
value.to_i
|
|
208
|
+
when :Float
|
|
209
|
+
value.to_f
|
|
210
|
+
when :Boolean
|
|
211
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
212
|
+
true
|
|
213
|
+
else
|
|
214
|
+
false
|
|
215
|
+
end
|
|
216
|
+
when :Object
|
|
217
|
+
# generic object (usually a Hash), return directly
|
|
218
|
+
value
|
|
219
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
220
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
221
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
222
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
223
|
+
k_type = Regexp.last_match[:k_type]
|
|
224
|
+
v_type = Regexp.last_match[:v_type]
|
|
225
|
+
{}.tap do |hash|
|
|
226
|
+
value.each do |k, v|
|
|
227
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
else # model
|
|
231
|
+
# models (e.g. Pet) or oneOf
|
|
232
|
+
klass = Permify.const_get(type)
|
|
233
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Returns the string representation of the object
|
|
238
|
+
# @return [String] String presentation of the object
|
|
239
|
+
def to_s
|
|
240
|
+
to_hash.to_s
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
|
245
|
+
def to_body
|
|
246
|
+
to_hash
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Returns the object in the form of hash
|
|
250
|
+
# @return [Hash] Returns the object in the form of hash
|
|
251
|
+
def to_hash
|
|
252
|
+
hash = {}
|
|
253
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
254
|
+
value = self.send(attr)
|
|
255
|
+
if value.nil?
|
|
256
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
257
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
hash[param] = _to_hash(value)
|
|
261
|
+
end
|
|
262
|
+
hash
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Outputs non-array value in the form of hash
|
|
266
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
267
|
+
# @param [Object] value Any valid value
|
|
268
|
+
# @return [Hash] Returns the value in the form of hash
|
|
269
|
+
def _to_hash(value)
|
|
270
|
+
if value.is_a?(Array)
|
|
271
|
+
value.compact.map { |v| _to_hash(v) }
|
|
272
|
+
elsif value.is_a?(Hash)
|
|
273
|
+
{}.tap do |hash|
|
|
274
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
275
|
+
end
|
|
276
|
+
elsif value.respond_to? :to_hash
|
|
277
|
+
value.to_hash
|
|
278
|
+
else
|
|
279
|
+
value
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
end
|