// 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_";

// Lists the vaults, replica vaults and Ground Link proxy vaults of the server with their
// administrative details, as far as the caller is allowed to see them.
//
// Use this interface to get document vault definitions. Use IRPCVaultsAdmin to add, modify and remove vaults.
// We have separated these read operations from operations that manipulate vaults to a dedicated interface to get better
// isolation. These read operations do not require the "manage vaults" server-level right. So, users with full control of
// vault can use these methods. These methods need to be supported even if the user does not have the "manage vaults"
// server-level right so that the user could control his vaults, e.g., change various metadata elements. This is the case
// in cloud vault.
//
// M-Files Admin uses this service to fill its "Document Vaults" node. Unlike the vault-changing
// administration services, these read methods are open to any session: the server decides how
// much to return.
//
// **Sessions and rights.** A server-level session is enough (log in with `login_data.vault_guid` =
// `{00000000-0000-0000-0000-000000000000}`); a vault session works too. No right is required, but:
//
// - With the server right `manage_vaults` ([ServerAccess](mfiles:MFiles.ServerAccess); system
//   administrators have it), `can_manage_vaults` is true and the vault data is complete (data
//   folders, database settings, file data storage), except database credentials.
// - Otherwise `can_manage_vaults` is false and only the basic vault data (GUID, name, host names)
//   is filled. [GetVaultAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetVaultAdmin) adds the database
//   engine and file data storage type when called in a vault session with full control of the
//   vault.
// - The vault lists of callers without `manage_vaults` contain only the vaults in which they have
//   a user account.
//
// Methods: [GetVaultsAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetVaultsAdmin) and
// [GetVaultAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetVaultAdmin) for ordinary vaults,
// [GetReplicasOfVaultsAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetReplicasOfVaultsAdmin) and
// [GetReplicaOfVaultAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetReplicaOfVaultAdmin) for replica
// vaults, [GetGroundLinkProxiesAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetGroundLinkProxiesAdmin)
// and [GetGroundLinkProxyAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetGroundLinkProxyAdmin) for
// Ground Link proxy vaults. [GetAddInSettings](mfiles:MFiles.IRPCVaultsAdminBasic.GetAddInSettings)
// is for M-Files' own web components.
//
// To list the vaults a user can log in to, use [IRPCVaults](mfiles:MFiles.IRPCVaults) instead.
service IRPCVaultsAdminBasic {
	option (mfiles.api.service) = { book: "admin" level: LEVEL_SPECIALIZED title: "Vault management (basic)" };

	// Gets the cross-origin (CORS) and cross-frame settings that a vault's add-in configuration
	// allows.
	//
	// **For M-Files components only.** M-Files' web components read it to decide which external sites
	// may call or frame the vaults' web endpoints. Applications should not call it.
	rpc GetAddInSettings( GetAddInSettingsRequest ) returns ( GetAddInSettingsResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_NONE internal: true };
	}

	// Lists the ordinary vaults of the server (not replicas or Ground Link proxies) with their
	// administrative details, including offline vaults.
	//
	// - Any session can call it.
	// - With the server right `manage_vaults`: all vaults, with complete data. Otherwise: only vaults in
	//   which the caller has a user account (enabled or disabled), with basic data only. On servers
	//   with vault login accounts, a caller whose login comes from a vault sees only that vault.
	// - `vaults`, `vault_variables` and `online_states` are parallel lists: entry *i* of each describes
	//   the same vault. The order is not specified.
	// - Waits for vaults that are being brought online or offline before returning.
	rpc GetVaultsAdmin( GetVaultsAdminRequest ) returns ( GetVaultsAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Gets one ordinary vault with its administrative details.
	//
	// - Any session can call it, for any vault GUID of the server.
	// - The detail depends on the caller: with the server right `manage_vaults`, complete data
	//   except database credentials; in a vault session with full control of the session's vault, the
	//   basic data plus `database_info.engine` and `file_data_storage`; otherwise the
	//   basic data only.
	// - An unknown GUID fails with "The specified document vault does not exist."; a
	//   replica vault fails with "The parameter is incorrect.".
	// - Waits if the vault is being brought online or offline.
	rpc GetVaultAdmin( GetVaultAdminRequest ) returns ( GetVaultAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Lists the Ground Link proxy vaults of the server, including offline ones.
	//
	// - Any session can call it. With the server right `manage_vaults` the data is complete;
	//   otherwise only the basic data is filled.
	// - `vaults`, `vault_variables` and `online_states` are parallel lists.
	rpc GetGroundLinkProxiesAdmin( GetGroundLinkProxiesAdminRequest ) returns ( GetGroundLinkProxiesAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Gets one Ground Link proxy vault with its administrative details.
	//
	// - Any session can call it. With the server right `manage_vaults` the data is complete;
	//   otherwise only the basic data is filled.
	// - A GUID that is not a Ground Link proxy vault (also an ordinary vault) fails with "The specified
	//   document vault does not exist.".
	rpc GetGroundLinkProxyAdmin( GetGroundLinkProxyAdminRequest ) returns ( GetGroundLinkProxyAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Lists the replica vaults of the server.
	//
	// - Any session can call it, and every caller sees all replica vaults. With the server right
	//   `manage_vaults` the data is complete; otherwise only the basic data is filled.
	// - `vaults` and `online_states` are parallel lists.
	rpc GetReplicasOfVaultsAdmin( GetReplicasOfVaultsAdminRequest ) returns ( GetReplicasOfVaultsAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Gets one replica vault with its administrative details.
	//
	// - Any session can call it. With the server right `manage_vaults` the data is complete;
	//   otherwise only the basic data is filled.
	// - A GUID of a vault that is not a replica fails with "The parameter is incorrect."; an unknown
	//   GUID with "The specified document vault does not exist.".
	rpc GetReplicaOfVaultAdmin( GetReplicaOfVaultAdminRequest ) returns ( GetReplicaOfVaultAdminResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}
}

// The request of GetAddInSettings.
message GetAddInSettingsRequest {

	// The vault GUID, with braces.
	string vault_guid = 1;
}

// The response of GetAddInSettings.
message GetAddInSettingsResponse {

	// The add-in settings. See [AddInSettingsOfVault](mfiles:MFiles.AddInSettingsOfVault).
	repeated AddInSettingsOfVault add_in_settings_of_vaults = 1;
}

// A structure that specifies get vaults admin request.
message GetVaultsAdminRequest {
}

// A structure that specifies get vaults admin response.
message GetVaultsAdminResponse {

	// True if the caller has the server right `manage_vaults`; then the vault data is complete.
	bool can_manage_vaults = 1;

	// The vaults. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data (`vault`: GUID, name, host names). See [Vault](mfiles:MFiles.Vault).
	repeated Vault vaults = 2;

	// The vault variables of each vault, in the order of `vaults`, for every caller. Not valid for offline vaults.
	repeated VaultVariableArray vault_variables = 3;

	// Whether each vault is online, in the order of `vaults`.
	repeated bool online_states = 4;
}

// A structure that specifies get vault admin request.
message GetVaultAdminRequest {

	// The vault GUID with braces.
	string guid = 1;
}

// A structure that specifies get vault admin response.
message GetVaultAdminResponse {

	// True if the caller has the server right `manage_vaults`.
	bool can_manage_vaults = 1;

	// The vault. The fields filled depend on the caller (see the remarks). See [Vault](mfiles:MFiles.Vault).
	Vault vault = 2;

	// The vault variables, such as the full-text search language and the ACL mode, returned to every caller.
	repeated VaultVariable vault_variables = 3;

	// The online state of the vault.
	bool online_state = 4;

	// The Microsoft 365 tenant IDs where M-Files integrations have been enabled, if the server has this information; otherwise empty.
	StringArray tenants_enabled_for_office = 5;
}

// A structure that specifies get ground link proxies admin request.
message GetGroundLinkProxiesAdminRequest {
}

// A structure that specifies get ground link proxies admin response.
message GetGroundLinkProxiesAdminResponse {

	// True if the caller has the server right `manage_vaults`; then the vault data is complete.
	bool can_manage_vaults = 1;

	// The Ground Link proxy vaults. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data. See [VaultEx](mfiles:MFiles.VaultEx).
	repeated VaultEx vaults = 2;

	// The vault variables of each vault, in the order of `vaults`. Not valid for offline vaults.
	repeated VaultVariableArray vault_variables = 3;

	// Whether each vault is online, in the order of `vaults`.
	repeated bool online_states = 4;
}

// A structure that specifies get ground link proxy admin request.
message GetGroundLinkProxyAdminRequest {

	// The GUID of the Ground Link proxy vault, with braces.
	string guid = 1;
}

// A structure that specifies get ground link proxy admin response.
message GetGroundLinkProxyAdminResponse {

	// True if the caller has the server right `manage_vaults`.
	bool can_manage_vaults = 1;

	// The vault. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data. See [VaultEx](mfiles:MFiles.VaultEx).
	VaultEx vault = 2;

	// Always empty for Ground Link proxy vaults.
	repeated VaultVariable vault_variables = 3;

	// The online state of the vault.
	bool online_state = 4;
}

// A structure that specifies get replicas of vaults admin request.
message GetReplicasOfVaultsAdminRequest {
}

// A structure that specifies get replicas of vaults admin response.
message GetReplicasOfVaultsAdminResponse {

	// True if the caller has the server right `manage_vaults`; then the vault data is complete.
	bool can_manage_vaults = 1;

	// The replica vaults, with `master_server_address`. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data. See [VaultEx](mfiles:MFiles.VaultEx).
	repeated VaultEx vaults = 2;

	// Whether each vault is online, in the order of `vaults`.
	repeated bool online_states = 3;
}

// A structure that specifies get replica of vault admin request.
message GetReplicaOfVaultAdminRequest {

	// The GUID of the replica vault, with braces.
	string guid = 1;
}

// A structure that specifies get replica of vault admin response.
message GetReplicaOfVaultAdminResponse {

	// True if the caller has the server right `manage_vaults`.
	bool can_manage_vaults = 1;

	// The replica vault. With `can_manage_vaults` all fields are filled except database credentials; otherwise only the basic data. See [VaultEx](mfiles:MFiles.VaultEx).
	VaultEx vault = 2;

	// The online state of the vault.
	bool online_state = 3;
}
