blob: ced56ea5eb27848130ba8a651fd719829184de3a [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
syntax = "proto3";
option java_multiple_files = true;
package org.apache.custos.core.sharing.api;
enum SearchCondition {
EQUAL = 0;
LIKE = 1;
GTE = 2;
LTE = 3;
NOT = 4;
}
enum EntitySearchField {
NAME = 0;
DESCRIPTION = 1;
ID = 2;
FULL_TEXT = 3;
OWNER_ID = 4;
CREATED_AT = 5;
LAST_MODIFIED_AT = 6;
ENTITY_TYPE_ID = 7;
PARENT_ID = 8;
SHARED_COUNT = 9;
PERMISSION_TYPE_ID = 10;
SHARED_BY=11;
SHARED_WITH=12;
}
message EntityType {
string id = 1;
string name = 2;
string description = 3;
int64 created_at = 4;
int64 updated_at = 5;
}
message PermissionType {
string id = 1;
string name = 2;
string description = 3;
int64 created_at = 4;
int64 updated_at = 5;
}
message Entity {
string id = 1;
string type = 2;
string owner_id = 3;
string parent_id = 4;
string name = 5;
string description = 6;
bytes binary_data = 7;
string full_text = 8;
int64 original_creation_time = 9;
int64 created_at = 10;
int64 updated_at = 11;
int32 shared_count = 12;
SharingMetadata sharing_metadata = 13;
}
message SearchCriteria {
EntitySearchField search_field = 1;
string value = 2;
SearchCondition condition = 3;
}
message SharingMetadata {
Entity entity = 1;
string owner_id = 2;
string owner_type = 3;
repeated PermissionType permissions = 4;
string shared_by = 5;
}
message EntityRequest {
string client_id = 1;
int64 tenant_id = 2;
Entity entity = 3;
string client_sec = 4;
}
message EntityTypeRequest {
string client_id = 1;
int64 tenant_id = 2;
EntityType entity_type = 3;
string client_sec = 4;
}
message PermissionTypeRequest {
string client_id = 1;
int64 tenant_id = 2;
PermissionType permission_type = 3;
string client_sec = 4;
}
message SearchRequest {
string client_id = 1;
int64 tenant_id = 2;
string owner_id = 3;
int32 offset = 4;
int32 limit = 5;
repeated SearchCriteria search_criteria = 6;
string client_sec = 7;
repeated string associating_ids = 8;
bool search_perm_bottom_up=9;
}
message PermissionRequest {
string client_id = 1;
int64 tenant_id = 2;
Entity entity = 3;
PermissionType permission_type = 4;
string client_sec = 5;
}
message SharingRequest {
string client_id = 1;
int64 tenant_id = 2;
Entity entity = 3;
PermissionType permission_type = 4;
repeated string owner_id = 5;
bool cascade = 6;
string client_sec = 7;
string shared_by = 8;
}
message SharesFilteringRequest {
string client_id = 1;
int64 tenant_id = 2;
repeated string owner_id = 5;
bool cascade = 6;
string client_sec = 7;
}
message Status {
bool status = 1;
}
message EntityTypes {
repeated EntityType types = 1;
}
message PermissionTypes {
repeated PermissionType types = 1;
}
message Entities {
repeated Entity entity_array = 1;
}
message SharedOwners {
repeated string owner_ids = 1;
}
message GetAllDirectSharingsResponse {
repeated SharingMetadata shared_data = 1;
}
message GetAllSharingsResponse {
repeated SharingMetadata shared_data = 1;
}