// 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 and deletes the content replication packages that wait in cloud storage for import into
// the vault.
//
// Use this interface to list and remove replication packages.
//
// **For M-Files components only.** M-Files Admin calls this service from the **Manage
// Replication** dialog of a content export or import job that uses **replication via cloud
// storage**. Applications should not call it.
//
// - **Session and rights:** a vault session with the vault right `change_full_control_role` (the
//   vault role full control, or a system administrator with `full_control_of_vaults`).
// - **Connection string:** both methods take the connection string of the cloud storage location
//   in the form M-Files Admin composes it from the job's replication settings (storage connection
//   string, folder name and encryption password). The server uses it to open the storage; it does
//   not read it from the vault.
// - **Typical order:** [GetReplicationPackages](mfiles:MFiles.IRPCReplicationPackages.GetReplicationPackages)
//   to list the waiting packages, then
//   [DeleteReplicationPackages](mfiles:MFiles.IRPCReplicationPackages.DeleteReplicationPackages)
//   to remove the ones that should not be imported.
service IRPCReplicationPackages {
	option (mfiles.api.service) = { book: "integration" level: LEVEL_SPECIALIZED title: "Replication packages" };

	// Lists the replication packages in the given cloud storage location that this vault has not
	// imported yet.
	//
	// **For M-Files components only.** M-Files Admin calls it to show the packages in its Manage
	// Replication dialog. Applications should not call it.
	// - Requires a vault session and the vault right `change_full_control_role`. Without it the call
	//   fails with access denied.
	// - Packages already imported into the session's vault are left out.
	// - An empty or malformed `connection_string` fails with an "Invalid pointer." error.
	rpc GetReplicationPackages( GetReplicationPackagesRequest ) returns ( GetReplicationPackagesResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Deletes replication packages from the given cloud storage location.
	//
	// **For M-Files components only.** M-Files Admin calls it from its Manage Replication dialog.
	// Applications should not call it.
	// - Deletes the packages from the cloud storage permanently; they can no longer be imported into
	//   any vault.
	// - Requires a vault session and the vault right `change_full_control_role`.
	rpc DeleteReplicationPackages( DeleteReplicationPackagesRequest ) returns ( DeleteReplicationPackagesResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}
}

// The request of GetReplicationPackages.
message GetReplicationPackagesRequest {

	// The cloud storage connection string as M-Files Admin composes it from the job's replication settings.
	string connection_string = 1;
}

// The response of GetReplicationPackages.
message GetReplicationPackagesResponse {

	// One entry per package: `name` is the package folder name and `status` a display text in the server's language ("In queue", "Next in queue" or "Failed" in English).
	repeated ReplicationPackageInfo replication_packages = 1;
}

// The request of DeleteReplicationPackages.
message DeleteReplicationPackagesRequest {

	// The same connection string as in [GetReplicationPackages](mfiles:MFiles.IRPCReplicationPackages.GetReplicationPackages).
	string connection_string = 1;

	// The `name`s of the packages to delete.
	repeated string replication_packages = 2;
}

// The response of DeleteReplicationPackages.
message DeleteReplicationPackagesResponse {
}
