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

// Sets up M-Files Web in Internet Information Services (IIS) on the server computer.
//
// NOTE: Do NOT change the layout of methods and their parameters
// so that older clients could utilize this interface against a newer
// server.
//
// Before client can use this interface, login is needed to the server.
// This can be achieved through the IRPCLogin interface.
//
// **For M-Files components only.** M-Files Admin uses this service in its M-Files Web
// configuration dialog to check the IIS prerequisites and to create or reuse an IIS web site or
// virtual directory for M-Files Web. Applications should not call it.
//
// **Sessions and rights.** Every method requires the system administrator server role (server
// right `edit_web_access_settings` in [ServerAccess](mfiles:MFiles.ServerAccess)); a server-level
// session is enough. Other callers get "Access denied. You do not have the server-level access
// rights required by this operation.".
//
// Typical order in M-Files Admin:
// [CheckCommonRequirements](mfiles:MFiles.IRPCWebAccessAdmin.CheckCommonRequirements) or
// [CheckCommonRequirementsForWeb](mfiles:MFiles.IRPCWebAccessAdmin.CheckCommonRequirementsForWeb),
// then [QueryADSIObjects](mfiles:MFiles.IRPCWebAccessAdmin.QueryADSIObjects) to list the IIS web
// sites, then [UseExistingWebSite](mfiles:MFiles.IRPCWebAccessAdmin.UseExistingWebSite),
// [CreateWebSite](mfiles:MFiles.IRPCWebAccessAdmin.CreateWebSite) or
// [CreateVirtualDirectory](mfiles:MFiles.IRPCWebAccessAdmin.CreateVirtualDirectory).
// The IIS objects are addressed with ADSI paths such as `IIS://localhost/w3svc/2/ROOT`.
service IRPCWebAccessAdmin {
	option (mfiles.api.service) = { book: "admin" level: LEVEL_SPECIALIZED title: "Web access administration" };

	// Lists the child objects of an IIS (ADSI) path on the server computer, for example its web sites.
	//
	// **For M-Files components only.** M-Files Admin uses it to list the IIS web sites. Applications
	// should not call it.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	// - Checks the IIS and ASP.NET prerequisites first and fails if they are missing.
	rpc QueryADSIObjects( QueryADSIObjectsRequest ) returns ( QueryADSIObjectsResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Checks that IIS and ASP.NET are installed and configured as M-Files Web needs.
	//
	// **For M-Files components only.** Used by M-Files Admin. Applications should not call it.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	//   Denied for other callers.
	// - A missing prerequisite fails the call with an error that names it; on success
	//   `requirements_met` is true.
	rpc CheckCommonRequirements( CheckCommonRequirementsRequest ) returns ( CheckCommonRequirementsResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Configures an existing IIS web site for M-Files Web.
	//
	// **For M-Files components only.** Used by M-Files Admin. Applications should not call it.
	// - Changes the IIS configuration of the server computer.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	// - With `enable_new_web`, the IIS URL Rewrite and Application Request Routing modules must also be
	//   installed.
	rpc UseExistingWebSite( UseExistingWebSiteRequest ) returns ( UseExistingWebSiteResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Checks the IIS prerequisites of the new M-Files Web, including the URL Rewrite and Application
	// Request Routing modules.
	//
	// **For M-Files components only.** Used by M-Files Admin. Applications should not call it.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	// - A missing prerequisite fails the call with an error that names it.
	rpc CheckCommonRequirementsForWeb( CheckCommonRequirementsForWebRequest ) returns ( CheckCommonRequirementsForWebResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Creates a new IIS web site for M-Files Web.
	//
	// **For M-Files components only.** Used by M-Files Admin. Applications should not call it.
	// - Changes the IIS configuration of the server computer. Requires Windows Server; other Windows
	//   editions fail.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	rpc CreateWebSite( CreateWebSiteRequest ) returns ( CreateWebSiteResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Creates an IIS virtual directory for M-Files Web under an existing web site.
	//
	// **For M-Files components only.** Used by M-Files Admin. Applications should not call it.
	// - Changes the IIS configuration of the server computer. Requires Windows Server; other Windows
	//   editions fail.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	rpc CreateVirtualDirectory( CreateVirtualDirectoryRequest ) returns ( CreateVirtualDirectoryResponse ) {
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}

	// Tells the server's HTTP-to-gRPC gateway that web client settings (such as add-in settings or the
	// default web client) have changed.
	//
	// **For M-Files components only.** M-Files Admin calls it after saving web settings. Applications
	// should not call it.
	// - Requires the system administrator server role (server right `edit_web_access_settings`).
	// - Only the add-in settings, default web client, default web client (IIS) and classic web URL
	//   redirection flags trigger a notification; other flags are ignored. Errors in delivering the
	//   notification are not returned.
	rpc NotifyHttpGrpcService( NotifyHttpGrpcServiceRequest ) returns ( NotifyHttpGrpcServiceResponse ) {
		option idempotency_level = IDEMPOTENT;
		option (mfiles.api.method) = { session: SESSION_REQUIREMENT_SESSION internal: true };
	}
}

// The request of QueryADSIObjects.
message QueryADSIObjectsRequest {

	// The ADSI path to enumerate, for example `IIS://localhost/w3svc` for the web sites.
	string key = 1;

	// Return only children of this schema class; unset returns all children.
	string schema_class = 2;
}

// The response of QueryADSIObjects.
message QueryADSIObjectsResponse {

	// ADSI objects.
	repeated ADSIObject objects = 1;
}

// The request of CheckCommonRequirements.
message CheckCommonRequirementsRequest {
}

// The response of CheckCommonRequirements.
message CheckCommonRequirementsResponse {

	// True if the requirements are met. When they are not, the call fails with an error that describes the missing requirement.
	bool requirements_met = 1;
}

// The request of UseExistingWebSite.
message UseExistingWebSiteRequest {

	// The ADSI path of the web site, from [QueryADSIObjects](mfiles:MFiles.IRPCWebAccessAdmin.QueryADSIObjects).
	string ads_path_web_site = 1;

	// True to set the site up for the new M-Files Web.
	bool enable_new_web = 2;

	// The name of the web site, used with `enable_new_web`.
	string ads_web_site_name = 3;
}

// The response of UseExistingWebSite.
message UseExistingWebSiteResponse {
}

// The request of CheckCommonRequirementsForWeb.
message CheckCommonRequirementsForWebRequest {
}

// The response of CheckCommonRequirementsForWeb.
message CheckCommonRequirementsForWebResponse {

	// True if the requirements are met. When they are not, the call fails with an error that describes the missing requirement.
	bool requirements_met = 1;
}

// The request of CreateWebSite.
message CreateWebSiteRequest {

	// The name of the new web site.
	string name = 1;

	// True to set the site up for the new M-Files Web.
	bool enable_new_web = 2;

	// The port the site listens on, for example `80`.
	string endpoint = 3;
}

// The response of CreateWebSite.
message CreateWebSiteResponse {

	// The created web site.
	ADSIObject web_site = 1;
}

// The request of CreateVirtualDirectory.
message CreateVirtualDirectoryRequest {

	// The ADSI path of the parent node, for example `IIS://localhost/w3svc/2/ROOT` for the root of the web site whose ID is 2.
	string ads_path_parent = 1;

	// The name of the virtual directory.
	string name = 2;

	// True to set it up for the new M-Files Web.
	bool enable_new_web = 3;
}

// The response of CreateVirtualDirectory.
message CreateVirtualDirectoryResponse {

	// The created virtual directory.
	ADSIObject virtual_dir = 1;
}

// The request of NotifyHttpGrpcService.
message NotifyHttpGrpcServiceRequest {

	// Which settings changed, as [CLIENTSETTINGFLAGS](mfiles:MFiles.CLIENTSETTINGFLAGS).
	SettingsToNotifyHttpGrpcService settings_to_notify_http_grpc_service = 1;
}

// The response of NotifyHttpGrpcService.
message NotifyHttpGrpcServiceResponse {
}
