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

// Creates, attaches, detaches, destroys, upgrades, backs up, restores and copies the vaults of a
// server, and takes them offline and online.
//
// Use this interface to add, modify and remove vaults.
// Use IRPCVaultsAdminBasic to get document vault definitions.
//
// Server-level vault management: the vault commands of M-Files Admin and of the M-Files API's
// server vault management operations. Use it from administration tools and automation scripts that
// manage the vaults of an on-premises server. Read the definitions of existing vaults with
// [GetVaultsAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetVaultsAdmin) and
// [GetVaultAdmin](mfiles:MFiles.IRPCVaultsAdminBasic.GetVaultAdmin); administer the contents of one
// vault with [IRPCVaultAdmin](mfiles:MFiles.IRPCVaultAdmin).
//
// **Session and rights.** Every method names its vault in the request, so a server-level session is
// enough: log in with `login_data.vault_guid` = `{00000000-0000-0000-0000-000000000000}`. The
// methods need a server right, and only logins with the system administrator server role
// (`SRVROLES.system_administrator`) have server rights:
//
// | Server right (`ServerAccess`) | Methods |
// | --- | --- |
// | `manage_vaults` | All methods not listed below |
// | `backup_vaults` | `BackUpVault` |
// | `restore_vault` | `RestoreVault`, `GetBackupFileContents` |
//
// Exceptions: `UpdateVault` and `GetFullTextSearchInfo` also accept a vault session with full
// control of the vault, and `OptimizeVaultMetaDataDatabase` a vault session with the vault right
// `manage_scheduled_jobs`. A missing server right fails with gRPC status `UNKNOWN` and the message
// "Access denied. You do not have the server-level access rights required by this operation."
// (error codes 0x800400A8 and 0x800407E4).
//
// **Tasks and the usual order of calls:**
//
// - **Create a vault**: [GetDefaultDataFolderPrefix](mfiles:MFiles.IRPCVaultsAdmin.GetDefaultDataFolderPrefix),
//   [TestConnectionToSQLDatabase](mfiles:MFiles.IRPCVaultsAdmin.TestConnectionToSQLDatabase)
//   (SQL Server vaults), then [CreateNewVault](mfiles:MFiles.IRPCVaultsAdmin.CreateNewVault).
// - **Change a vault**: [UpdateVault](mfiles:MFiles.IRPCVaultsAdmin.UpdateVault),
//   [UpgradeVault](mfiles:MFiles.IRPCVaultsAdmin.UpgradeVault).
// - **Take a vault out of use**: [CheckForOpenSessions](mfiles:MFiles.IRPCVaultsAdmin.CheckForOpenSessions),
//   [TakeVaultOffline](mfiles:MFiles.IRPCVaultsAdmin.TakeVaultOffline),
//   [BringVaultOnline](mfiles:MFiles.IRPCVaultsAdmin.BringVaultOnline).
// - **Move a vault between servers**: [DetachVault](mfiles:MFiles.IRPCVaultsAdmin.DetachVault)
//   keeps the data; [AttachExistingVault](mfiles:MFiles.IRPCVaultsAdmin.AttachExistingVault)
//   attaches it again (check first with
//   [AttachVaultToOneDbTest](mfiles:MFiles.IRPCVaultsAdmin.AttachVaultToOneDbTest) when the server
//   has joined a subscription).
// - **Delete a vault and its data**: [DestroyVault](mfiles:MFiles.IRPCVaultsAdmin.DestroyVault).
// - **Back up, restore and copy**: [BackUpVault](mfiles:MFiles.IRPCVaultsAdmin.BackUpVault),
//   [GetBackupFileContents](mfiles:MFiles.IRPCVaultsAdmin.GetBackupFileContents),
//   [RestoreVault](mfiles:MFiles.IRPCVaultsAdmin.RestoreVault),
//   [CopyVault](mfiles:MFiles.IRPCVaultsAdmin.CopyVault).
// - **Maintenance**: [OptimizeVaultMetaDataDatabase](mfiles:MFiles.IRPCVaultsAdmin.OptimizeVaultMetaDataDatabase),
//   [EncryptFileData](mfiles:MFiles.IRPCVaultsAdmin.EncryptFileData),
//   [GetFullTextSearchInfo](mfiles:MFiles.IRPCVaultsAdmin.GetFullTextSearchInfo).
// - **Replica vaults and ground link proxies** (special deployments):
//   [CreateNewReplicaVault](mfiles:MFiles.IRPCVaultsAdmin.CreateNewReplicaVault),
//   [UpdateReplicaVault](mfiles:MFiles.IRPCVaultsAdmin.UpdateReplicaVault),
//   [CreateNewGroundLinkProxy](mfiles:MFiles.IRPCVaultsAdmin.CreateNewGroundLinkProxy),
//   [UpdateGroundLinkProxy](mfiles:MFiles.IRPCVaultsAdmin.UpdateGroundLinkProxy).
//
// **Background jobs.** `BackUpVault`, `CopyVault`, `EncryptFileData`,
// `OptimizeVaultMetaDataDatabase`, `RestoreVault` (unless `synchronous`) and, when they start a
// migration, `UpdateVault` and `UpdateGroundLinkProxy` create a temporary scheduled job and return
// its ID in `task_id` before the work is done. Follow the job like the M-Files API does:
//
// 1. Call [GetScheduledJobRunInfo](mfiles:MFiles.IRPCScheduledJobsAdmin.GetScheduledJobRunInfo)
//    with `scheduled_job` = `task_id` about twice a second.
// 2. The job has finished when `is_running` is false **and** `current_step` is not -1 (-1 means
//    the job has not started yet).
// 3. Check `last_run_succeeded` and `last_run_errors`; `output` holds the job's result.
// 4. Remove the finished job with
//    [RemoveScheduledJob](mfiles:MFiles.IRPCScheduledJobsAdmin.RemoveScheduledJob). Cancel a
//    running job with [CancelScheduledJob](mfiles:MFiles.IRPCScheduledJobsAdmin.CancelScheduledJob).
//
// These jobs are server-level jobs (except an optimization started with a vault session, which is a
// job of that vault). Server-level and vault-level jobs have separate IDs: read a server-level job
// with a server-level session, which needs the server right `manage_jobs`.
service IRPCVaultsAdmin {
	option (mfiles.api.service) = { book: "admin" level: LEVEL_SPECIALIZED title: "Vault management" };

	// Destroys a vault: deletes its metadata database and its file data permanently and removes it from
	// the server.
	//
	// - **Destroys the vault and its data permanently.** Use
	//   [DetachVault](mfiles:MFiles.IRPCVaultsAdmin.DetachVault) to remove the vault from the server
	//   and keep the data.
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - The vault is taken offline first: open sessions to the vault are disconnected.
	// - With `force` false, the call fails if the server cannot connect to the vault's SQL Server; with
	//   `force` true the vault is destroyed anyway and its database may be left on that SQL Server.
	rpc DestroyVault( DestroyVaultRequest ) returns ( DestroyVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Removes the vault from the server's list of registered vaults but does not
	// remove the metadata database or file data files.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Takes the vault offline first: open sessions to the vault are disconnected. The metadata
	//   database and the file data stay, and
	//   [AttachExistingVault](mfiles:MFiles.IRPCVaultsAdmin.AttachExistingVault) can attach them again,
	//   on this or another server.
	rpc DetachVault( DetachVaultRequest ) returns ( DetachVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Upgrades an old document vault to the current version.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Runs in the call and returns when the upgrade is done. `upgraded` is false if the vault already
	//   had the current version.
	rpc UpgradeVault( UpgradeVaultRequest ) returns ( UpgradeVaultResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Takes a vault offline: users cannot log in to it until it is brought online again.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - With `disconnect_users` false, the call fails if the vault has open sessions, with the same
	//   error as [CheckForOpenSessions](mfiles:MFiles.IRPCVaultsAdmin.CheckForOpenSessions). With
	//   `disconnect_users` true, open sessions are terminated.
	// - Bring the vault back with [BringVaultOnline](mfiles:MFiles.IRPCVaultsAdmin.BringVaultOnline).
	rpc TakeVaultOffline( TakeVaultOfflineRequest ) returns ( TakeVaultOfflineResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Brings an offline vault online so that users can log in to it again.
	//
	// Requires the system administrator server role (server right `manage_vaults`).
	rpc BringVaultOnline( BringVaultOnlineRequest ) returns ( BringVaultOnlineResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Gets the default data folder prefix of new document vaults.
	//
	// - Requires the system administrator server role (server right `manage_vaults`); a vault
	//   administrator gets "Access denied".
	// - Read-only. M-Files Admin uses the folder as the starting value of `Vault.main_data_folder` for
	//   a new vault (see [CreateNewVault](mfiles:MFiles.IRPCVaultsAdmin.CreateNewVault)).
	rpc GetDefaultDataFolderPrefix( GetDefaultDataFolderPrefixRequest ) returns ( GetDefaultDataFolderPrefixResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Checks whether users have open sessions to a vault: succeeds if there are none and fails with a
	// list of the sessions otherwise.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Read-only. Call it before [TakeVaultOffline](mfiles:MFiles.IRPCVaultsAdmin.TakeVaultOffline)
	//   with `disconnect_users` false, which fails with the same error.
	// - The error message lists the first 10 open sessions, one per line. Sessions of the server's own
	//   components and of vault applications are not counted.
	rpc CheckForOpenSessions( CheckForOpenSessionsRequest ) returns ( CheckForOpenSessionsResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Gets the languages that the full-text search of a vault supports, or the server's defaults.
	//
	// - Requires either the system administrator server role (server right `manage_vaults`) or a vault
	//   session with full control of the vault (a vault administrator succeeds, a normal user
	//   gets "Access denied").
	// - Read-only.
	rpc GetFullTextSearchInfo( GetFullTextSearchInfoRequest ) returns ( GetFullTextSearchInfoResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Encrypts the existing files of a vault with the vault's latest encryption key.
	//
	// - **Starts a background job and returns before it completes**; follow it with `task_id` (see the
	//   service overview).
	// - Requires the system administrator server role (server right `manage_vaults`).
	rpc EncryptFileData( EncryptFileDataRequest ) returns ( EncryptFileDataResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Backs up a vault into a backup file on the server.
	//
	// - **Starts a background job and returns before it completes**; follow it with `task_id` (see the
	//   service overview).
	// - Requires the system administrator server role (server right `backup_vaults`).
	// - The server writes the file: `target_file` is a path on the server machine, accessed with the
	//   account in `impersonation` (unset means `IMPERSONATION_TYPE_SYSTEM_ACCOUNT`). To back up the
	//   master database, use [BackUpMasterDB](mfiles:MFiles.IRPCServerAdmin.BackUpMasterDB).
	rpc BackUpVault( BackUpVaultRequest ) returns ( BackUpVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Reads the vault identity and data folders stored in a backup file on the server.
	//
	// - Requires the system administrator server role (server right `restore_vault`).
	// - Read-only. Use it before [RestoreVault](mfiles:MFiles.IRPCVaultsAdmin.RestoreVault) to show
	//   which vault a backup holds and where its data was.
	rpc GetBackupFileContents( GetBackupFileContentsRequest ) returns ( GetBackupFileContentsResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Tests whether the server can connect to a Microsoft SQL Server database, for example before
	// creating a vault in it.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Succeeds with an empty response if the connection works; fails with the connection error
	//   otherwise. The server tries once only, so a mistyped server name fails fast.
	rpc TestConnectionToSQLDatabase( TestConnectionToSQLDatabaseRequest ) returns ( TestConnectionToSQLDatabaseResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Optimizes the metadata database of a vault.
	//
	// - **Starts a background job and returns before it completes**; follow it with `task_id` (see the
	//   service overview). A thorough optimization (`flags.is_thorough`) takes the vault offline while
	//   it runs; a quick one does not.
	// - With a server-level session, requires the system administrator server role (server right
	//   `manage_vaults`) and creates a server-level job.
	// - With a vault session, requires the vault right `manage_scheduled_jobs` and creates a job of
	//   that vault; follow it with a session of the same vault.
	rpc OptimizeVaultMetaDataDatabase( OptimizeVaultMetaDataDatabaseRequest ) returns ( OptimizeVaultMetaDataDatabaseResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Checks whether existing vault files can be attached on a server that has joined a subscription,
	// without attaching them.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Does not attach anything. Call it before
	//   [AttachExistingVault](mfiles:MFiles.IRPCVaultsAdmin.AttachExistingVault) on a server that has
	//   joined a subscription (see [JoinSubscription](mfiles:MFiles.IRPCServerAdmin.JoinSubscription)).
	//   It reads the vault files to get the vault's GUID and asks the subscription service whether the
	//   vault can be attached. On a server that has not joined a subscription it checks nothing and
	//   returns `can_be_forced` true.
	rpc AttachVaultToOneDbTest( AttachVaultToOneDbTestRequest ) returns ( AttachVaultToOneDbTestResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Creates a new document vault.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Runs in the call and returns the new vault, with the GUID that the server generated.
	// - The definition is validated in full before anything is created.
	rpc CreateNewVault( CreateNewVaultRequest ) returns ( CreateNewVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Changes the definition of a vault: name and other registration data, data folders, database,
	// file data storage and vault variables.
	//
	// - Requires the system administrator server role (server right `manage_vaults`), or a vault
	//   session with full control of the vault. Without `manage_vaults`, changing the GUID, the data
	//   folders, the database or the file data storage fails with "Access denied", and so does
	//   changing vault variables reserved for system administrators.
	// - The name, description, icon and vault variables change without interrupting users. Changing
	//   the GUID, the data folders, the database or the file data storage can take the vault offline,
	//   disconnecting open sessions.
	// - Changing the database engine (for example from Firebird to Microsoft SQL Server) or the file
	//   data storage of a SQL Server vault starts a background migration job: `task_id` is its ID
	//   (follow it as described in the service overview), or -1 if no migration started.
	rpc UpdateVault( UpdateVaultRequest ) returns ( UpdateVaultResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Creates a ground link proxy, a vault of type `VAULT_TYPE_GROUND_LINK_PROXY`.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Fails with an invalid-argument error unless `vault.vault_type` is
	//   `VAULT_TYPE_GROUND_LINK_PROXY`.
	rpc CreateNewGroundLinkProxy( CreateNewGroundLinkProxyRequest ) returns ( CreateNewGroundLinkProxyResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Attaches an existing vault (metadata database and file data files) to the server.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Runs in the call: the server opens the existing database and file data, registers the vault
	//   and returns its definition.
	// - On a server that has joined a subscription, check first with
	//   [AttachVaultToOneDbTest](mfiles:MFiles.IRPCVaultsAdmin.AttachVaultToOneDbTest).
	rpc AttachExistingVault( AttachExistingVaultRequest ) returns ( AttachExistingVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Creates a new replica vault.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Fails unless the server is configured to allow replica vaults (it fails with an error saying
	//   that configuring replica vaults is not allowed), and with an invalid-argument error unless
	//   `vault.vault_type` is `VAULT_TYPE_REPLICA_VAULT`.
	rpc CreateNewReplicaVault( CreateNewReplicaVaultRequest ) returns ( CreateNewReplicaVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Updates the definition of a replica vault.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Changes the registration data of the replica vault only.
	rpc UpdateReplicaVault( UpdateReplicaVaultRequest ) returns ( UpdateReplicaVaultResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Updates the definition of a ground link proxy.
	//
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - Changes the registration data only. If the change starts a migration, `task_id` is the ID of a
	//   background job (see the service overview); otherwise it is -1.
	rpc UpdateGroundLinkProxy( UpdateGroundLinkProxyRequest ) returns ( UpdateGroundLinkProxyResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Restores a vault from backup files on the server and attaches it.
	//
	// - **Long-running.** With `synchronous` false the call starts a background job and returns before
	//   it completes; follow it with `task_id` (see the service overview). With `synchronous` true the
	//   call returns when the restore is done.
	// - Requires the system administrator server role (server right `restore_vault`).
	// - The backup files are read by the server: paths are on the server machine. Inspect a backup with
	//   [GetBackupFileContents](mfiles:MFiles.IRPCVaultsAdmin.GetBackupFileContents) first.
	// - `restore_job.overwrite_existing_files` true lets the restore overwrite existing files in the
	//   target location.
	rpc RestoreVault( RestoreVaultRequest ) returns ( RestoreVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}

	// Copies the specified vault into a new vault (creates the target vault).
	//
	// - **Starts a background job and returns before it completes**; follow it with `task_id` (see the
	//   service overview).
	// - Requires the system administrator server role (server right `manage_vaults`).
	// - `copy_job.options` selects what is copied; `all_data` copies everything.
	rpc CopyVault( CopyVaultRequest ) returns ( CopyVaultResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION };
	}
}

// The request of DestroyVault.
message DestroyVaultRequest {

	// The GUID of the vault to destroy, in braces, e.g. `{7BBEA0BC-40D8-4BCB-A67D-8A3ACFBDB575}`.
	string vault = 1;

	// True to destroy the vault even if the server cannot connect to the vault's database server; the database may then be left on that server. False to fail in that case.
	bool force = 2;
}

// The response of DestroyVault.
message DestroyVaultResponse {
}

// The request of DetachVault.
message DetachVaultRequest {

	// The GUID of the vault to detach.
	string vault = 1;
}

// The response of DetachVault.
message DetachVaultResponse {
}

// The request of UpgradeVault.
message UpgradeVaultRequest {

	// The GUID of the vault to upgrade.
	string vault = 1;
}

// The response of UpgradeVault.
message UpgradeVaultResponse {

	// If true, the vault was upgraded. If false, the vault was already of the latest version.
	bool upgraded = 1;
}

// The request of TakeVaultOffline.
message TakeVaultOfflineRequest {

	// The GUID of the vault.
	string vault = 1;

	// If true, any existing sessions are terminated. If false, the operation fails if there are open sessions.
	bool disconnect_users = 2;
}

// The response of TakeVaultOffline.
message TakeVaultOfflineResponse {
}

// The request of BringVaultOnline.
message BringVaultOnlineRequest {

	// The GUID of the vault.
	string vault = 1;
}

// The response of BringVaultOnline.
message BringVaultOnlineResponse {
}

// The request of GetDefaultDataFolderPrefix.
message GetDefaultDataFolderPrefixRequest {
}

// The response of GetDefaultDataFolderPrefix.
message GetDefaultDataFolderPrefixResponse {

	// The default parent folder of the data folders of new vaults on the server, e.g. `C:\Program Files\M-Files\Server Vaults\`. Always ends with a backslash.
	string folder = 1;
}

// The request of CheckForOpenSessions.
message CheckForOpenSessionsRequest {

	// The GUID of the vault.
	string vault = 1;
}

// The response of CheckForOpenSessions.
message CheckForOpenSessionsResponse {
}

// The request of GetFullTextSearchInfo.
message GetFullTextSearchInfoRequest {

	// The GUID of the vault. The null GUID `{00000000-0000-0000-0000-000000000000}` returns the server's default values instead of the values of a vault.
	string vault = 1;
}

// The response of GetFullTextSearchInfo.
message GetFullTextSearchInfoResponse {

	// The full-text search capabilities: `supported_languages` lists the languages of the language analyzers as three-letter codes, e.g. `eng`, `fin`, `ger`.
	FullTextSearchInfo pftsinfo = 1;
}

// The request of EncryptFileData.
message EncryptFileDataRequest {

	// The job. Set `vault_guid` to the GUID of the vault.
	EncryptFileDataJob encryptfiledatajob = 1;
}

// The response of EncryptFileData.
message EncryptFileDataResponse {

	// The ID of the server-level scheduled job that encrypts the files. Pass it to [GetScheduledJobRunInfo](mfiles:MFiles.IRPCScheduledJobsAdmin.GetScheduledJobRunInfo).
	int32 task_id = 1;
}

// The request of BackUpVault.
message BackUpVaultRequest {

	// The backup to make: the vault (`vault_guid`), full or differential (`type`), the target file on the server and whether to overwrite it.
	BackupJob backupjob = 1;
}

// The response of BackUpVault.
message BackUpVaultResponse {

	// The ID of the server-level scheduled job that makes the backup. Pass it to [GetScheduledJobRunInfo](mfiles:MFiles.IRPCScheduledJobsAdmin.GetScheduledJobRunInfo).
	int32 task_id = 1;
}

// The request of GetBackupFileContents.
message GetBackupFileContentsRequest {

	// The full backup file, as a path on the server machine.
	string backup_file_full = 1;

	// An optional differential backup file to apply on top of the full backup, as a path on the server machine. Leave empty if none.
	string backup_file_differential = 2;

	// The account the server uses to read the backup files. Unset means `IMPERSONATION_TYPE_SYSTEM_ACCOUNT`.
	Impersonation utf8szimpersonation = 3;
}

// The response of GetBackupFileContents.
message GetBackupFileContentsResponse {

	// True if the file is a backup of the master database, not of a vault.
	bool master_db = 1;

	// Receives the display name of the vault.
	string display_name = 2;

	// Receives the unique ID of the vault.
	string vault = 3;

	// Receives the data folder of the vault.
	string data_folder = 4;

	// Receives the additional file data folders.
	repeated AdditionalFolder file_data_folders = 5;
}

// The request of TestConnectionToSQLDatabase.
message TestConnectionToSQLDatabaseRequest {

	// The database server, database name and credentials to test.
	SQLDatabase sqldb = 1;

	// True to also fail if the database does not exist. False accepts both an existing and a missing database (a new vault can use an existing empty database).
	bool database_should_exist = 2;
}

// The response of TestConnectionToSQLDatabase.
message TestConnectionToSQLDatabaseResponse {
}

// The request of OptimizeVaultMetaDataDatabase.
message OptimizeVaultMetaDataDatabaseRequest {

	// The optimization to run: the vault (`vault_guid`), quick or thorough (`flags.is_thorough`), whether to garbage-collect files of destroyed objects (`flags.garbage_collect_files`), and when to cancel automatically.
	OptimizeVaultJob optimize_vault_job = 1;
}

// The response of OptimizeVaultMetaDataDatabase.
message OptimizeVaultMetaDataDatabaseResponse {

	// The ID of the scheduled job that runs the optimization.
	int32 task_id = 1;
}

// The request of AttachVaultToOneDbTest.
message AttachVaultToOneDbTestRequest {

	// The vault files to check: data folders and database, as for [AttachExistingVault](mfiles:MFiles.IRPCVaultsAdmin.AttachExistingVault).
	Vault vault = 1;

	// Attach options, as for AttachExistingVault.
	AttachVaultOptions options = 2;
}

// The response of AttachVaultToOneDbTest.
message AttachVaultToOneDbTestResponse {

	// True if the subscription service allows attaching the vault (despite the name, this is the answer to the test).
	bool can_be_forced = 1;

	// The vault that the subscription service reports for the vault's GUID, if any; otherwise its `guid` is the null GUID.
	VaultBasic existing_vault = 2;
}

// The request of CreateNewVault.
message CreateNewVaultRequest {

	// The definition of the new vault: name (`vault.vault.display_name`), data folder (`vault.main_data_folder`), database (`vault.database_info`) and file data storage. `vault.vault.guid` is ignored: the server generates a new GUID.
	Vault vault = 1;

	// Vault variables to set in the new vault.
	repeated VaultVariable vault_variables = 2;
}

// The response of CreateNewVault.
message CreateNewVaultResponse {

	// The full definition of the new vault, including its new GUID.
	Vault new_vault = 1;
}

// The request of UpdateVault.
message UpdateVaultRequest {

	// The GUID of the vault to change.
	string guid = 1;

	// The new definition. A `vault_info.vault.guid` different from `guid` changes the vault's GUID. An empty `vault_info.database_info.database_name` leaves the database settings unchanged.
	Vault vault_info = 2;

	// Vault variables to set.
	repeated VaultVariable vault_variables = 3;

	// True to change only the vault's registration on the server (name, locations, database and storage settings): `vault_variables` are not applied and the definition is not validated in full. False to apply `vault_variables` too.
	bool update_only_registration_data = 4;
}

// The response of UpdateVault.
message UpdateVaultResponse {

	// The ID of the server-level migration job, or -1 if no migration started.
	int32 task_id = 1;
}

// The request of CreateNewGroundLinkProxy.
message CreateNewGroundLinkProxyRequest {

	// The definition of the new ground link proxy.
	VaultEx vault = 1;
}

// The response of CreateNewGroundLinkProxy.
message CreateNewGroundLinkProxyResponse {

	// Receives the full definition of the new vault.
	Vault new_vault = 1;
}

// The request of AttachExistingVault.
message AttachExistingVaultRequest {

	// Where the vault's files are: data folders and database. If `vault.vault.guid` is the null GUID, the vault keeps the GUID stored in its files; otherwise its GUID is changed to the given one.
	Vault vault = 1;

	// Options for attaching, such as which external connections to disable and whether to update the attachment GUID.
	AttachVaultOptions options = 2;

	// On a server that has joined a subscription, true attaches the vault even if it is already attached to another server.
	bool attach_always = 3;
}

// The response of AttachExistingVault.
message AttachExistingVaultResponse {

	// Receives the full definition of the attached vault.
	Vault attached_vault = 1;
}

// The request of CreateNewReplicaVault.
message CreateNewReplicaVaultRequest {

	// The definition of the new replica vault.
	VaultEx vault = 1;
}

// The response of CreateNewReplicaVault.
message CreateNewReplicaVaultResponse {
}

// The request of UpdateReplicaVault.
message UpdateReplicaVaultRequest {

	// The new definition of the replica vault. The vault to modify is determined from the vault GUID which cannot change.
	VaultEx vault = 1;
}

// The response of UpdateReplicaVault.
message UpdateReplicaVaultResponse {
}

// The request of UpdateGroundLinkProxy.
message UpdateGroundLinkProxyRequest {

	// The new definition of the ground link proxy. The vault to modify is determined from the vault GUID which cannot change.
	VaultEx vault = 1;
}

// The response of UpdateGroundLinkProxy.
message UpdateGroundLinkProxyResponse {

	// Receives a task identifier associated with vault migration to allow the caller to cancel the operation or/and request status information about it. If -1, no migration is performed.
	int32 task_id = 1;
}

// The request of RestoreVault.
message RestoreVaultRequest {

	// The backup files to restore and the definition of the restored vault. If `target_vault.vault.guid` is the null GUID, the vault keeps the GUID stored in the backup.
	RestoreJob restore_job = 1;

	// True to restore within the call. False to start a background job and return at once.
	bool synchronous = 2;
}

// The response of RestoreVault.
message RestoreVaultResponse {

	// The ID of the server-level restore job when `synchronous` is false; -1 when it is true.
	int32 task_id = 1;

	// The restored vault when `synchronous` is true; empty otherwise (read the result from the job's `output`).
	RestoreJobOutputInfo output_info = 2;
}

// The request of CopyVault.
message CopyVaultRequest {

	// The vault to copy (`source_vault`), what to copy (`options`) and the definition of the new vault (`target_vault`).
	CopyVaultJob copy_job = 1;
}

// The response of CopyVault.
message CopyVaultResponse {

	// The ID of the server-level scheduled job that copies the vault.
	int32 task_id = 1;
}
