pathology/orchestrator/v1main/users.proto (133 lines of code) (raw):

// Copyright 2024 Google LLC // // Licensed 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"; package pathology.orchestrator.v1main; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/field_mask.proto"; option java_package = "com.pathology.orchestrator.v1main"; option java_outer_classname = "UsersProto"; option java_multiple_files = true; // PathologyUsers are users of DPAS that can own cohorts and sharing links. message PathologyUser { option (google.api.resource) = { type: "digitalpathology.googleapis.com/PathologyUser" pattern: "pathologyUsers/{pathology_users}" }; // Resource name for a user. Empty when creating. string name = 1 [(google.api.resource_reference).type = "digitalpathology.googleapis.com/PathologyUser"]; // Unique internal id for a user. Empty when creating. string user_id = 2 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.field_behavior) = IMMUTABLE ]; // Aliases for a user. repeated PathologyUserAlias aliases = 3; } // Alias for a PathologyUser. message PathologyUserAlias { // Alias for user. string alias = 1 [(google.api.field_behavior) = REQUIRED]; // Alias type. PathologyUserAliasType alias_type = 2 [(google.api.field_behavior) = REQUIRED]; } // Defines a user's access to a resource. message PathologyUserAccess { // Email of PathologyUser to grant access to. string user_email = 1 [(google.api.field_behavior) = REQUIRED]; // Access role for a cohort. optional PathologyUserAccessRole access_role = 2; } // Request for CreatePathologyUser rpc. // User is a top level field so there is no parent field. message CreatePathologyUserRequest { // User to create. PathologyUser pathology_user = 1 [(google.api.field_behavior) = REQUIRED]; } // Request for GetPathologyUser. message GetPathologyUserRequest { // Resource name of user to retrieve. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference).type = "digitalpathology.googleapis.com/PathologyUser" ]; // Specifies the view of the aliases list that is returned. PathologyUserAliasListView view = 2; } // Request for UpdatePathologyUser. message UpdatePathologyUserRequest { // User to update. PathologyUser pathology_user = 1 [(google.api.field_behavior) = REQUIRED]; // List of fields to update. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } // Request for ListPathologyUser. // (-- api-linter: core::0132::request-parent-required=disabled // aip.dev/not-precedent: User is a top level field without a parent. --). message ListPathologyUsersRequest { // Allows for filtering by alias. string filter = 1; // Default is 20. int32 page_size = 2; // A page token, received from a ListPathologyCohorts call. string page_token = 3; // Specifies the view of the aliases list that is returned. PathologyUserAliasListView view = 4; } // Response for ListPathologyUser. message ListPathologyUsersResponse { // List of users. repeated PathologyUser pathology_users = 1; // Token to get subsequent page if present. string next_page_token = 2; } // Request for IdentifyCurrentUser. message IdentifyCurrentUserRequest {} // Describes the type of alias. enum PathologyUserAliasType { // Default alias type. PATHOLOGY_USER_ALIAS_TYPE_UNSPECIFIED = 0; // Email address of user. PATHOLOGY_USER_ALIAS_TYPE_EMAIL = 1; // Name of user. PATHOLOGY_USER_ALIAS_TYPE_NAME = 2; } // Specifies the type of aliases Get and List calls return for users. enum PathologyUserAliasListView { // Default view is equivalent to 'NO_ALIASES'. PATHOLOGY_USER_ALIAS_LIST_VIEW_UNSPECIFIED = 0; // Contains name only. PATHOLOGY_USER_ALIAS_LIST_VIEW_NAME_ONLY = 1; // Contains all alias types. PATHOLOGY_USER_ALIAS_LIST_VIEW_FULL = 2; // Contains no aliases. PATHOLOGY_USER_ALIAS_LIST_VIEW_NO_ALIASES = 3; } // Access roles for users. enum PathologyUserAccessRole { // Default is no access. PATHOLOGY_USER_ACCESS_ROLE_UNSPECIFIED = 0; // Resource owner. Creator of resource. PATHOLOGY_USER_ACCESS_ROLE_OWNER = 1; // Resource admin. A secondary user with same privileges as resource owner. PATHOLOGY_USER_ACCESS_ROLE_ADMIN = 2; // Edit access. PATHOLOGY_USER_ACCESS_ROLE_EDITOR = 3; // View only access. PATHOLOGY_USER_ACCESS_ROLE_VIEWER = 4; }