// M-Files Server gRPC API 26.11. Generated from the M-Files Server IDL; do not edit.
// Documentation: https://developer.m-files.com/APIs/gRPC-API/
syntax = "proto3";

package MFiles;

import "mfiles/api/annotations.proto";
import "mfiles/structs.proto";

option csharp_namespace = "MFiles.Grpc";
option go_package = "github.com/M-Files/mfiles-grpc-api/go/mfiles;mfiles";
option java_multiple_files = true;
option java_package = "com.mfiles.grpc";
option objc_class_prefix = "MF_";

// Reads the common views and every user's private views of a vault, for administrators.
//
// Use this interface to get views.
//
// The service has one method,
// [GetViewsAndUsersAdmin](mfiles:MFiles.IRPCViewsAdmin.GetViewsAndUsersAdmin). M-Files Admin uses
// it when it exports the structure of a vault, to list the views it can include. To read and
// manage the caller's own views and the common views, use [IRPCViews](mfiles:MFiles.IRPCViews).
service IRPCViewsAdmin {
	option (mfiles.api.service) = { book: "admin" level: LEVEL_SPECIALIZED title: "Common views administration" };

	// Gets all common views and the private views of all users, with the owner of each private view.
	//
	// - Requires a vault session with the vault rights `manage_users` and `archive`
	//   ([VaultAccess](mfiles:MFiles.VaultAccess)). The caller does not need a user account in the
	//   vault.
	// - `user_defined_views` and `user_accounts` are parallel lists: `user_accounts[i]` owns
	//   `user_defined_views[i]`, so an owner with several views appears several times. They are
	//   ordered by user ID. Views of the anonymous user are left out.
	// - The owner entries contain the ID, login name, vault roles, permissions and language of the
	//   user; `external_id` is not filled.
	// - The order of the common views is not specified. Names are in the session language.
	rpc GetViewsAndUsersAdmin( GetViewsAndUsersAdminRequest ) returns ( GetViewsAndUsersAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}
}

// The request of GetViewsAndUsersAdmin.
message GetViewsAndUsersAdminRequest {
}

// The response of GetViewsAndUsersAdmin.
message GetViewsAndUsersAdminResponse {

	// The private views of all users. See [View](mfiles:MFiles.View).
	repeated View user_defined_views = 1;

	// The owner of each private view, in the order of `user_defined_views`.
	repeated UserAccount user_accounts = 2;

	// All common views.
	repeated View u_common_views = 3;
}
