// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.filestore.v1beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/common/operation_metadata.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";

option csharp_namespace = "Google.Cloud.Filestore.V1Beta1";
option go_package = "cloud.google.com/go/filestore/apiv1beta1/filestorepb;filestorepb";
option java_multiple_files = true;
option java_outer_classname = "CloudFilestoreServiceProto";
option java_package = "com.google.cloud.filestore.v1beta1";
option php_namespace = "Google\\Cloud\\Filestore\\V1beta1";
option (google.api.resource_definition) = {
  type: "managedidentities.googleapis.com/Domain"
  pattern: "projects/{project}/locations/{location}/domains/{domain}"
};

// Configures and manages Filestore resources.
//
// Filestore Manager v1beta1.
//
// The `file.googleapis.com` service implements the Filestore API and
// defines the following model for managing resources:
// * The service works with a collection of cloud projects, named: `/projects/*`
// * Each project has a collection of available locations, named: `/locations/*`
// * Each location has a collection of instances and backups, named:
// `/instances/*` and `/backups/*` respectively.
// * As such, Filestore instances are resources of the form:
//   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
//   backups are resources of the form:
//   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
//
// Note that location_id can represent a Google Cloud `zone` or `region`
// depending on the resource. for example: A zonal Filestore instance:
// * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
// A regional Filestore instance:
// * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
service CloudFilestoreManager {
  option (google.api.default_host) = "file.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/cloud-platform";

  // Lists all instances in a project for either a specified location
  // or for all locations.
  rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*/locations/*}/instances"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets the details of a specific instance.
  rpc GetInstance(GetInstanceRequest) returns (Instance) {
    option (google.api.http) = {
      get: "/v1beta1/{name=projects/*/locations/*/instances/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates an instance.
  // When creating from a backup, the capacity of the new instance needs to be
  // equal to or larger than the capacity of the backup (and also equal to or
  // larger than the minimum capacity of the tier).
  rpc CreateInstance(CreateInstanceRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{parent=projects/*/locations/*}/instances"
      body: "instance"
    };
    option (google.api.method_signature) = "parent,instance,instance_id";
    option (google.longrunning.operation_info) = {
      response_type: "Instance"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Updates the settings of a specific instance.
  rpc UpdateInstance(UpdateInstanceRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}"
      body: "instance"
    };
    option (google.api.method_signature) = "instance,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Instance"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Restores an existing instance's file share from a backup.
  //
  // The capacity of the instance needs to be equal to or larger than the
  // capacity of the backup (and also equal to or larger than the minimum
  // capacity of the tier).
  rpc RestoreInstance(RestoreInstanceRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restore"
      body: "*"
    };
    option (google.longrunning.operation_info) = {
      response_type: "Instance"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Revert an existing instance's file system to a specified snapshot.
  rpc RevertInstance(RevertInstanceRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{name=projects/*/locations/*/instances/*}:revert"
      body: "*"
    };
    option (google.longrunning.operation_info) = {
      response_type: "Instance"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Promote the standby instance (replica).
  rpc PromoteReplica(PromoteReplicaRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{name=projects/*/locations/*/instances/*}:promoteReplica"
      body: "*"
    };
    option (google.longrunning.operation_info) = {
      response_type: "Instance"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Deletes an instance.
  rpc DeleteInstance(DeleteInstanceRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta1/{name=projects/*/locations/*/instances/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Lists all snapshots in a project for either a specified location
  // or for all locations.
  rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets the details of a specific snapshot.
  rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
    option (google.api.http) = {
      get: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a snapshot.
  rpc CreateSnapshot(CreateSnapshotRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots"
      body: "snapshot"
    };
    option (google.api.method_signature) = "parent,snapshot,snapshot_id";
    option (google.longrunning.operation_info) = {
      response_type: "Snapshot"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Deletes a snapshot.
  rpc DeleteSnapshot(DeleteSnapshotRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Updates the settings of a specific snapshot.
  rpc UpdateSnapshot(UpdateSnapshotRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}"
      body: "snapshot"
    };
    option (google.api.method_signature) = "snapshot,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Snapshot"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Lists all backups in a project for either a specified location or for all
  // locations.
  rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*/locations/*}/backups"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets the details of a specific backup.
  rpc GetBackup(GetBackupRequest) returns (Backup) {
    option (google.api.http) = {
      get: "/v1beta1/{name=projects/*/locations/*/backups/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a backup.
  rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{parent=projects/*/locations/*}/backups"
      body: "backup"
    };
    option (google.api.method_signature) = "parent,backup,backup_id";
    option (google.longrunning.operation_info) = {
      response_type: "Backup"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Deletes a backup.
  rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta1/{name=projects/*/locations/*/backups/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Updates the settings of a specific backup.
  rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta1/{backup.name=projects/*/locations/*/backups/*}"
      body: "backup"
    };
    option (google.api.method_signature) = "backup,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Backup"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Lists all shares for a specified instance.
  rpc ListShares(ListSharesRequest) returns (ListSharesResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets the details of a specific share.
  rpc GetShare(GetShareRequest) returns (Share) {
    option (google.api.http) = {
      get: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a share.
  rpc CreateShare(CreateShareRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares"
      body: "share"
    };
    option (google.api.method_signature) = "parent,share,share_id";
    option (google.longrunning.operation_info) = {
      response_type: "Share"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Deletes a share.
  rpc DeleteShare(DeleteShareRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }

  // Updates the settings of a specific share.
  rpc UpdateShare(UpdateShareRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}"
      body: "share"
    };
    option (google.api.method_signature) = "share,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Share"
      metadata_type: "google.cloud.common.OperationMetadata"
    };
  }
}

// Network configuration for the instance.
message NetworkConfig {
  // Internet protocol versions supported by Filestore.
  enum AddressMode {
    // Internet protocol not set.
    ADDRESS_MODE_UNSPECIFIED = 0;

    // Use the IPv4 internet protocol.
    MODE_IPV4 = 1;
  }

  // Available connection modes.
  enum ConnectMode {
    // ConnectMode not set.
    CONNECT_MODE_UNSPECIFIED = 0;

    // Connect via direct peering to the Filestore service.
    DIRECT_PEERING = 1;

    // Connect to your Filestore instance using Private Service
    // Access. Private services access provides an IP address range for multiple
    // Google Cloud services, including Filestore.
    PRIVATE_SERVICE_ACCESS = 2;
  }

  // The name of the Google Compute Engine
  // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
  // instance is connected.
  string network = 1;

  // Internet protocol versions for which the instance has IP addresses
  // assigned. For this version, only MODE_IPV4 is supported.
  repeated AddressMode modes = 3;

  // Optional, reserved_ip_range can have one of the following two types of
  // values.
  //
  // * CIDR range value when using DIRECT_PEERING connect mode.
  // * [Allocated IP address
  // range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
  // when using PRIVATE_SERVICE_ACCESS connect mode.
  //
  // When the name of an allocated IP address range is specified, it must be one
  // of the ranges associated with the private service access connection.
  // When specified as a direct CIDR value, it must be a /29 CIDR block for
  // Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
  // Enterprise tier in one of the [internal IP address
  // ranges](https://www.arin.net/reference/research/statistics/address_filters/)
  // that identifies the range of IP addresses reserved for this instance. For
  // example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
  // range you specify can't overlap with either existing subnets or assigned IP
  // address ranges for other Filestore instances in the selected VPC
  // network.
  string reserved_ip_range = 4;

  // Output only. IPv4 addresses in the format
  // `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
  // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
  repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The network connect mode of the Filestore instance.
  // If not provided, the connect mode defaults to DIRECT_PEERING.
  ConnectMode connect_mode = 6;
}

// File share configuration for the instance.
message FileShareConfig {
  // Required. The name of the file share. Must use 1-16 characters for the
  // basic service tier and 1-63 characters for all other service tiers.
  // Must use lowercase letters, numbers, or underscores `[a-z0-9_]`. Must
  // start with a letter. Immutable.
  string name = 1;

  // File share capacity in gigabytes (GB).
  // Filestore defines 1 GB as 1024^3 bytes.
  int64 capacity_gb = 2;

  // The source that this file share has been restored from. Empty if the file
  // share is created from scratch.
  oneof source {
    // The resource name of the backup, in the format
    // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`, that
    // this file share has been restored from.
    string source_backup = 9 [
      (google.api.resource_reference) = { type: "file.googleapis.com/Backup" }
    ];
  }

  // Nfs Export Options.
  // There is a limit of 10 export options per file share.
  repeated NfsExportOptions nfs_export_options = 8;
}

// NFS export options specifications.
message NfsExportOptions {
  // The access mode.
  enum AccessMode {
    // AccessMode not set.
    ACCESS_MODE_UNSPECIFIED = 0;

    // The client can only read the file share.
    READ_ONLY = 1;

    // The client can read and write the file share (default).
    READ_WRITE = 2;
  }

  // The squash mode.
  enum SquashMode {
    // SquashMode not set.
    SQUASH_MODE_UNSPECIFIED = 0;

    // The Root user has root access to the file share (default).
    NO_ROOT_SQUASH = 1;

    // The Root user has squashed access to the anonymous uid/gid.
    ROOT_SQUASH = 2;
  }

  // The security flavor. In general, a "flavor" represents a designed process
  // or system. A "security flavor" is a system designed for the purpose of
  // authenticating a data originator (client), recipient (server), and the data
  // they transmit between one another.
  enum SecurityFlavor {
    // SecurityFlavor not set.
    SECURITY_FLAVOR_UNSPECIFIED = 0;

    // The user's UNIX user-id and group-ids are transferred "in the clear" (not
    // encrypted) on the network, unauthenticated by the NFS server (default).
    AUTH_SYS = 1;

    // End-user authentication through Kerberos V5.
    KRB5 = 2;

    // krb5 plus integrity protection (data packets are tamper proof).
    KRB5I = 3;

    // krb5i plus privacy protection (data packets are tamper proof and
    // encrypted).
    KRB5P = 4;
  }

  // List of either an IPv4 addresses in the format
  // `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
  // `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
  // file share.
  // Overlapping IP ranges are not allowed, both within and across
  // NfsExportOptions. An error will be returned.
  // The limit is 64 IP ranges/addresses for each FileShareConfig among all
  // NfsExportOptions.
  repeated string ip_ranges = 1;

  // Either READ_ONLY, for allowing only read requests on the exported
  // directory, or READ_WRITE, for allowing both read and write requests.
  // The default is READ_WRITE.
  AccessMode access_mode = 2;

  // Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
  // or ROOT_SQUASH, for not allowing root access. The default is
  // NO_ROOT_SQUASH.
  SquashMode squash_mode = 3;

  // An integer representing the anonymous user id with a default value of
  // 65534.
  // Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
  // returned if this field is specified for other squash_mode settings.
  int64 anon_uid = 4;

  // An integer representing the anonymous group id with a default value of
  // 65534.
  // Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
  // returned if this field is specified for other squash_mode settings.
  int64 anon_gid = 5;

  // The security flavors allowed for mount operations.
  // The default is AUTH_SYS.
  repeated SecurityFlavor security_flavors = 6;
}

// ManagedActiveDirectoryConfig contains all the parameters for connecting
// to Managed Service for Microsoft Active Directory (Managed Microsoft AD).
message ManagedActiveDirectoryConfig {
  // Required. The domain resource name, in the format
  // `projects/{project_id}/locations/global/domains/{domain}`.
  string domain = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "managedidentities.googleapis.com/Domain"
    }
  ];

  // Required. The computer name is used as a prefix in the command to mount the
  // remote target.
  // For example: if the computer is `my-computer`, the mount command will
  // look like: `$mount -o vers=4.1,sec=krb5
  // my-computer.filestore.<domain>:<share> <mount point>`.
  string computer = 2 [(google.api.field_behavior) = REQUIRED];
}

// Directory Services configuration for Kerberos-based authentication.
message DirectoryServicesConfig {
  oneof config {
    // Configuration for Managed Service for Microsoft Active Directory.
    ManagedActiveDirectoryConfig managed_active_directory = 1;
  }
}

// Replica configuration for the instance.
message ReplicaConfig {
  // The replica state.
  enum State {
    // State not set.
    STATE_UNSPECIFIED = 0;

    // The replica is being created.
    CREATING = 1;

    // The replica is ready.
    READY = 3;

    // The replica is being removed.
    REMOVING = 4;

    // The replica is experiencing an issue and might be unusable. You can get
    // further details from the `stateReasons` field of the `ReplicaConfig`
    // object.
    FAILED = 5;
  }

  enum StateReason {
    // Reason not specified.
    STATE_REASON_UNSPECIFIED = 0;

    // The peer instance is unreachable.
    PEER_INSTANCE_UNREACHABLE = 1;

    // The remove replica peer instance operation failed.
    REMOVE_FAILED = 2;
  }

  // Output only. The replica state.
  State state = 1;

  // Output only. Additional information about the replication state, if
  // available.
  repeated StateReason state_reasons = 2;

  // The peer instance.
  string peer_instance = 3 [
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Output only. The timestamp of the latest replication snapshot taken on the
  // active instance and is already replicated safely.
  google.protobuf.Timestamp last_active_sync_time = 10;
}

// Replication specifications.
message Replication {
  // Replication role.
  enum Role {
    // Role not set.
    ROLE_UNSPECIFIED = 0;

    // The instance is the `ACTIVE` replication member, functions as
    // the replication source instance.
    ACTIVE = 1;

    // The instance is the `STANDBY` replication member, functions as
    // the replication destination instance.
    STANDBY = 2;
  }

  // Output only. The replication role.
  Role role = 1;

  // Replication configuration for the replica instance associated with this
  // instance. Only a single replica is supported.
  repeated ReplicaConfig replicas = 2;
}

// A Filestore instance.
message Instance {
  option (google.api.resource) = {
    type: "file.googleapis.com/Instance"
    pattern: "projects/{project}/locations/{location}/instances/{instance}"
  };

  // The instance state.
  enum State {
    // State not set.
    STATE_UNSPECIFIED = 0;

    // The instance is being created.
    CREATING = 1;

    // The instance is available for use.
    READY = 2;

    // Work is being done on the instance. You can get further details from the
    // `statusMessage` field of the `Instance` resource.
    REPAIRING = 3;

    // The instance is shutting down.
    DELETING = 4;

    // The instance is experiencing an issue and might be unusable. You can get
    // further details from the `statusMessage` field of the `Instance`
    // resource.
    ERROR = 6;

    // The instance is restoring a snapshot or backup to an existing file share
    // and may be unusable during this time.
    RESTORING = 7;

    // The instance is suspended. You can get further details from
    // the `suspension_reasons` field of the `Instance` resource.
    SUSPENDED = 8;

    // The instance is reverting to a snapshot.
    REVERTING = 9;

    // The instance is in the process of becoming suspended.
    SUSPENDING = 10;

    // The instance is in the process of becoming active.
    RESUMING = 11;

    // The replica instance is being promoted.
    PROMOTING = 13;
  }

  // Available service tiers.
  enum Tier {
    // Not set.
    TIER_UNSPECIFIED = 0;

    // STANDARD tier. BASIC_HDD is the preferred term for this tier.
    STANDARD = 1;

    // PREMIUM tier. BASIC_SSD is the preferred term for this tier.
    PREMIUM = 2;

    // BASIC instances offer a maximum capacity of 63.9 TB.
    // BASIC_HDD is an alias for STANDARD Tier, offering economical
    // performance backed by HDD.
    BASIC_HDD = 3;

    // BASIC instances offer a maximum capacity of 63.9 TB.
    // BASIC_SSD is an alias for PREMIUM Tier, and offers improved
    // performance backed by SSD.
    BASIC_SSD = 4;

    // HIGH_SCALE instances offer expanded capacity and performance scaling
    // capabilities.
    HIGH_SCALE_SSD = 6;

    // ENTERPRISE instances offer the features and availability needed for
    // mission-critical workloads.
    ENTERPRISE = 7;

    // ZONAL instances offer expanded capacity and performance scaling
    // capabilities.
    ZONAL = 8;

    // REGIONAL instances offer the features and availability needed for
    // mission-critical workloads.
    REGIONAL = 9;
  }

  // SuspensionReason contains the possible reasons for a suspension.
  enum SuspensionReason {
    // Not set.
    SUSPENSION_REASON_UNSPECIFIED = 0;

    // The KMS key used by the instance is either revoked or denied access to.
    KMS_KEY_ISSUE = 1;
  }

  // File access protocol.
  enum FileProtocol {
    // FILE_PROTOCOL_UNSPECIFIED serves a "not set" default value when
    // a FileProtocol is a separate field in a message.
    FILE_PROTOCOL_UNSPECIFIED = 0;

    // NFS 3.0.
    NFS_V3 = 1;

    // NFS 4.1.
    NFS_V4_1 = 2;
  }

  // IOPS per TB.
  // Filestore defines TB as 1024^4 bytes (TiB).
  message IOPSPerTB {
    // Required. Maximum IOPS per TiB.
    int64 max_iops_per_tb = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // Fixed IOPS (input/output operations per second) parameters.
  message FixedIOPS {
    // Required. Maximum IOPS.
    int64 max_iops = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // Used for setting the performance configuration.
  // If the user doesn't specify PerformanceConfig, automatically provision
  // the default performance settings as described in
  // https://cloud.google.com/filestore/docs/performance. Larger instances will
  // be linearly set to more IOPS. If the instance's capacity is increased or
  // decreased, its performance will be automatically adjusted upwards or
  // downwards accordingly (respectively).
  message PerformanceConfig {
    oneof mode {
      // Provision IOPS dynamically based on the capacity of the instance.
      // Provisioned IOPS will be calculated by multiplying the capacity of the
      // instance in TiB by the `iops_per_tb` value. For example, for a 2 TiB
      // instance with an `iops_per_tb` value of 17000 the provisioned IOPS will
      // be 34000.
      //
      // If the calculated value is outside the supported range for the
      // instance's capacity during instance creation, instance creation will
      // fail with an `InvalidArgument` error. Similarly, if an instance
      // capacity update would result in a value outside the supported range,
      // the update will fail with an `InvalidArgument` error.
      IOPSPerTB iops_per_tb = 4;

      // Choose a fixed provisioned IOPS value for the instance, which will
      // remain constant regardless of instance capacity. Value must be a
      // multiple of 1000.
      //
      // If the chosen value is outside the supported range for the instance's
      // capacity during instance creation, instance creation will fail with an
      // `InvalidArgument` error. Similarly, if an instance capacity update
      // would result in a value outside the supported range, the update will
      // fail with an `InvalidArgument` error.
      FixedIOPS fixed_iops = 2;
    }
  }

  // The enforced performance limits, calculated from the instance's performance
  // configuration.
  message PerformanceLimits {
    // Output only. The max IOPS.
    int64 max_iops = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. The max read IOPS.
    int64 max_read_iops = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. The max write IOPS.
    int64 max_write_iops = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. The max read throughput in bytes per second.
    int64 max_read_throughput_bps = 5
        [(google.api.field_behavior) = OUTPUT_ONLY];

    // Output only. The max write throughput in bytes per second.
    int64 max_write_throughput_bps = 6
        [(google.api.field_behavior) = OUTPUT_ONLY];
  }

  // Output only. The resource name of the instance, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The description of the instance (2048 characters or less).
  string description = 2;

  // Output only. The instance state.
  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Additional information about the instance state, if available.
  string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the instance was created.
  google.protobuf.Timestamp create_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // The service tier of the instance.
  Tier tier = 8;

  // Resource labels to represent user provided metadata.
  map<string, string> labels = 9;

  // File system shares on the instance.
  // For this version, only a single file share is supported.
  repeated FileShareConfig file_shares = 10;

  // VPC networks to which the instance is connected.
  // For this version, only a single network is supported.
  repeated NetworkConfig networks = 11;

  // Server-specified ETag for the instance resource to prevent simultaneous
  // updates from overwriting each other.
  string etag = 12;

  // Output only. Reserved for future use.
  google.protobuf.BoolValue satisfies_pzs = 13
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Reserved for future use.
  bool satisfies_pzi = 26 [(google.api.field_behavior) = OUTPUT_ONLY];

  // KMS key name used for data encryption.
  string kms_key_name = 14;

  // Output only. Field indicates all the reasons the instance is in "SUSPENDED"
  // state.
  repeated SuspensionReason suspension_reasons = 15
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The max capacity of the instance.
  int64 max_capacity_gb = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The increase/decrease capacity step size.
  int64 capacity_step_size_gb = 17 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The max number of shares allowed.
  int64 max_share_count = 18;

  // The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
  // This capacity can be increased up to `max_capacity_gb` GB in multipliers
  // of `capacity_step_size_gb` GB.
  int64 capacity_gb = 19;

  // Indicates whether this instance uses a multi-share configuration with which
  // it can have more than one file-share or none at all. File-shares are added,
  // updated and removed through the separate file-share APIs.
  bool multi_share_enabled = 20;

  // Immutable. The protocol indicates the access protocol for all shares in the
  // instance. This field is immutable and it cannot be changed after the
  // instance has been created. Default value: `NFS_V3`.
  FileProtocol protocol = 21 [(google.api.field_behavior) = IMMUTABLE];

  // Optional. Directory Services configuration for Kerberos-based
  // authentication. Should only be set if protocol is "NFS_V4_1".
  DirectoryServicesConfig directory_services = 24
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. Replication configuration.
  Replication replication = 25 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Input only. Immutable. Tag key-value pairs bound to this
  // resource. Each key must be a namespaced name and each value a short name.
  // Example:
  // "123456789012/environment" : "production",
  // "123456789013/costCenter" : "marketing"
  // See the documentation for more information:
  // - Namespaced name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key
  // - Short name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value
  map<string, string> tags = 27 [
    (google.api.field_behavior) = INPUT_ONLY,
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Output only. Indicates whether this instance supports configuring its
  // performance. If true, the user can configure the instance's performance by
  // using the 'performance_config' field.
  bool custom_performance_supported = 28
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Used to configure performance.
  PerformanceConfig performance_config = 29
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. Used for getting performance limits.
  PerformanceLimits performance_limits = 30
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Indicates whether the instance is protected against deletion.
  bool deletion_protection_enabled = 31
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The reason for enabling deletion protection.
  string deletion_protection_reason = 32
      [(google.api.field_behavior) = OPTIONAL];
}

// CreateInstanceRequest creates an instance.
message CreateInstanceRequest {
  // Required. The instance's project and location, in the format
  // `projects/{project_id}/locations/{location}`. In Filestore,
  // locations map to Google Cloud zones, for example **us-west1-b**.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // Required. The ID of the instance to create.
  // The ID must be unique within the specified project and location.
  //
  // This value must start with a lowercase letter followed by up to 62
  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
  string instance_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. An [instance resource][google.cloud.filestore.v1beta1.Instance]
  Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
}

// GetInstanceRequest gets the state of an instance.
message GetInstanceRequest {
  // Required. The instance resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];
}

// UpdateInstanceRequest updates the settings of an instance.
message UpdateInstanceRequest {
  // Required. Mask of fields to update.  At least one path must be supplied in
  // this field.  The elements of the repeated paths field may only include
  // these fields:
  //
  // * "description"
  // * "directory_services"
  // * "file_shares"
  // * "labels"
  // * "performance_config"
  // * "deletion_protection_enabled"
  // * "deletion_protection_reason"
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = REQUIRED];

  // Required. Only fields specified in update_mask are updated.
  Instance instance = 2 [(google.api.field_behavior) = REQUIRED];
}

// RestoreInstanceRequest restores an existing instance's file share from a
// backup.
message RestoreInstanceRequest {
  // Required. The resource name of the instance, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Required. Name of the file share in the Filestore instance that the backup
  // is being restored to.
  string file_share = 2 [(google.api.field_behavior) = REQUIRED];

  oneof source {
    // The resource name of the snapshot, in the format
    // `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`.
    string source_snapshot = 3 [
      deprecated = true,
      (google.api.resource_reference) = { type: "file.googleapis.com/Snapshot" }
    ];

    // The resource name of the backup, in the format
    // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`.
    string source_backup = 4 [
      (google.api.resource_reference) = { type: "file.googleapis.com/Backup" }
    ];
  }
}

// RevertInstanceRequest reverts the given instance's file share to the
// specified snapshot.
message RevertInstanceRequest {
  // Required. The resource name of the instance, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Required. The snapshot resource ID, in the format 'my-snapshot', where the
  // specified ID is the {snapshot_id} of the fully qualified name like
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`
  string target_snapshot_id = 2 [(google.api.field_behavior) = REQUIRED];
}

// DeleteInstanceRequest deletes an instance.
message DeleteInstanceRequest {
  // Required. The instance resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // If set to true, any snapshots of the instance will also be deleted.
  // (Otherwise, the request will only work if the instance has no snapshots.)
  bool force = 2;
}

// ListInstancesRequest lists instances.
message ListInstancesRequest {
  // Required. The project and location for which to retrieve instance
  // information, in the format `projects/{project_id}/locations/{location}`. In
  // Cloud Filestore, locations map to Google Cloud zones, for example
  // **us-west1-b**. To retrieve instance information for all locations, use "-"
  // for the
  // `{location}` value.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // The maximum number of items to return.
  int32 page_size = 2;

  // The next_page_token value to use if there are additional
  // results to retrieve for this list request.
  string page_token = 3;

  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
  string order_by = 4;

  // List filter.
  string filter = 5;
}

// ListInstancesResponse is the result of ListInstancesRequest.
message ListInstancesResponse {
  // A list of instances in the project for the specified location.
  //
  // If the `{location}` value in the request is "-", the response contains a
  // list of instances from all locations. If any location is unreachable, the
  // response will only return instances in reachable locations and the
  // "unreachable" field will be populated with a list of unreachable locations.
  repeated Instance instances = 1;

  // The token you can use to retrieve the next page of results. Not returned
  // if there are no more results in the list.
  string next_page_token = 2;

  // Unordered list. Locations that could not be reached.
  repeated string unreachable = 3
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// PromoteReplicaRequest promotes a Filestore standby instance (replica).
message PromoteReplicaRequest {
  // Required. The resource name of the instance, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Optional. The resource name of the peer instance to promote, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
  // The peer instance is required if the operation is called on an active
  // instance.
  string peer_instance = 2 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];
}

// A Filestore snapshot.
message Snapshot {
  option (google.api.resource) = {
    type: "file.googleapis.com/Snapshot"
    pattern: "projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}"
  };

  // The snapshot state.
  enum State {
    // State not set.
    STATE_UNSPECIFIED = 0;

    // Snapshot is being created.
    CREATING = 1;

    // Snapshot is available for use.
    READY = 3;

    // Snapshot is being deleted.
    DELETING = 4;
  }

  // Output only. The resource name of the snapshot, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`.
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // A description of the snapshot with 2048 characters or less.
  // Requests with longer descriptions will be rejected.
  string description = 2;

  // Output only. The snapshot state.
  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the snapshot was created.
  google.protobuf.Timestamp create_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Resource labels to represent user provided metadata.
  map<string, string> labels = 5;

  // Output only. The amount of bytes needed to allocate a full copy of the
  // snapshot content
  int64 filesystem_used_bytes = 12 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Input only. Immutable. Tag key-value pairs bound to this
  // resource. Each key must be a namespaced name and each value a short name.
  // Example:
  // "123456789012/environment" : "production",
  // "123456789013/costCenter" : "marketing"
  // See the documentation for more information:
  // - Namespaced name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key
  // - Short name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value
  map<string, string> tags = 13 [
    (google.api.field_behavior) = INPUT_ONLY,
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// CreateSnapshotRequest creates a snapshot.
message CreateSnapshotRequest {
  // Required. The Filestore Instance to create the snapshots of, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Required. The ID to use for the snapshot.
  // The ID must be unique within the specified instance.
  //
  // This value must start with a lowercase letter followed by up to 62
  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
  string snapshot_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. A snapshot resource
  Snapshot snapshot = 3 [(google.api.field_behavior) = REQUIRED];
}

// GetSnapshotRequest gets the state of a snapshot.
message GetSnapshotRequest {
  // Required. The snapshot resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Snapshot" }
  ];
}

// DeleteSnapshotRequest deletes a snapshot.
message DeleteSnapshotRequest {
  // Required. The snapshot resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Snapshot" }
  ];
}

// UpdateSnapshotRequest updates description and/or labels for a snapshot.
message UpdateSnapshotRequest {
  // Required. Mask of fields to update.  At least one path must be supplied in
  // this field.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = REQUIRED];

  // Required. A snapshot resource
  Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED];
}

// ListSnapshotsRequest lists snapshots.
message ListSnapshotsRequest {
  // Required. The instance for which to retrieve snapshot information,
  // in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // The maximum number of items to return.
  int32 page_size = 2;

  // The next_page_token value to use if there are additional
  // results to retrieve for this list request.
  string page_token = 3;

  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
  string order_by = 4;

  // List filter.
  string filter = 5;

  // Optional. If true, allow partial responses for multi-regional Aggregated
  // List requests.
  bool return_partial_success = 6 [(google.api.field_behavior) = OPTIONAL];
}

// ListSnapshotsResponse is the result of ListSnapshotsRequest.
message ListSnapshotsResponse {
  // A list of snapshots in the project for the specified instance.
  repeated Snapshot snapshots = 1;

  // The token you can use to retrieve the next page of results. Not returned
  // if there are no more results in the list.
  string next_page_token = 2;

  // Unordered list. Locations that could not be reached.
  repeated string unreachable = 3
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// A Filestore backup.
message Backup {
  option (google.api.resource) = {
    type: "file.googleapis.com/Backup"
    pattern: "projects/{project}/locations/{location}/backups/{backup}"
  };

  // The backup state.
  enum State {
    // State not set.
    STATE_UNSPECIFIED = 0;

    // Backup is being created.
    CREATING = 1;

    // Backup has been taken and the operation is being finalized. At this
    // point, changes to the file share will not be reflected in the backup.
    FINALIZING = 2;

    // Backup is available for use.
    READY = 3;

    // Backup is being deleted.
    DELETING = 4;

    // Backup is not valid and cannot be used for creating new instances or
    // restoring existing instances.
    INVALID = 5;
  }

  // Output only. The resource name of the backup, in the format
  // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`.
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // A description of the backup with 2048 characters or less.
  // Requests with longer descriptions will be rejected.
  string description = 2;

  // Output only. The backup state.
  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the backup was created.
  google.protobuf.Timestamp create_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Resource labels to represent user provided metadata.
  map<string, string> labels = 5;

  // Output only. Capacity of the source file share when the backup was created.
  int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The size of the storage used by the backup. As backups share
  // storage, this number is expected to change with backup creation/deletion.
  int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The resource name of the source Filestore instance, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
  // used to create this backup.
  string source_instance = 8 [
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Name of the file share in the source Filestore instance that the
  // backup is created from.
  string source_file_share = 9;

  // Output only. The service tier of the source Filestore instance that this
  // backup is created from.
  Instance.Tier source_instance_tier = 10
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Amount of bytes that will be downloaded if the backup is
  // restored
  int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Reserved for future use.
  google.protobuf.BoolValue satisfies_pzs = 12
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Reserved for future use.
  bool satisfies_pzi = 14 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Immutable. KMS key name used for data encryption.
  string kms_key_name = 13 [(google.api.field_behavior) = IMMUTABLE];

  // Optional. Input only. Immutable. Tag key-value pairs bound to this
  // resource. Each key must be a namespaced name and each value a short name.
  // Example:
  // "123456789012/environment" : "production",
  // "123456789013/costCenter" : "marketing"
  // See the documentation for more information:
  // - Namespaced name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key
  // - Short name:
  // https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value
  map<string, string> tags = 15 [
    (google.api.field_behavior) = INPUT_ONLY,
    (google.api.field_behavior) = IMMUTABLE,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Output only. The file system protocol of the source Filestore instance that
  // this backup
  //  is created from.
  Instance.FileProtocol file_system_protocol = 16
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// CreateBackupRequest creates a backup.
message CreateBackupRequest {
  // Required. The backup's project and location, in the format
  // `projects/{project_id}/locations/{location}`. In Filestore,
  // backup locations map to Google Cloud regions, for example **us-west1**.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup]
  Backup backup = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The ID to use for the backup.
  // The ID must be unique within the specified project and location.
  //
  // This value must start with a lowercase letter followed by up to 62
  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
  string backup_id = 3 [(google.api.field_behavior) = REQUIRED];
}

// DeleteBackupRequest deletes a backup.
message DeleteBackupRequest {
  // Required. The backup resource name, in the format
  // `projects/{project_id}/locations/{location}/backups/{backup_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Backup" }
  ];
}

// UpdateBackupRequest updates description and/or labels for a backup.
message UpdateBackupRequest {
  // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup]
  Backup backup = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. Mask of fields to update.  At least one path must be supplied in
  // this field.
  google.protobuf.FieldMask update_mask = 2
      [(google.api.field_behavior) = REQUIRED];
}

// GetBackupRequest gets the state of a backup.
message GetBackupRequest {
  // Required. The backup resource name, in the format
  // `projects/{project_id}/locations/{location}/backups/{backup_id}`.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Backup" }
  ];
}

// ListBackupsRequest lists backups.
message ListBackupsRequest {
  // Required. The project and location for which to retrieve backup
  // information, in the format `projects/{project_id}/locations/{location}`. In
  // Filestore, backup locations map to Google Cloud regions, for example
  // **us-west1**. To retrieve backup information for all locations, use "-" for
  // the
  // `{location}` value.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // The maximum number of items to return.
  int32 page_size = 2;

  // The next_page_token value to use if there are additional
  // results to retrieve for this list request.
  string page_token = 3;

  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
  string order_by = 4;

  // List filter.
  string filter = 5;
}

// ListBackupsResponse is the result of ListBackupsRequest.
message ListBackupsResponse {
  // A list of backups in the project for the specified location.
  //
  // If the `{location}` value in the request is "-", the response contains a
  // list of backups from all locations. If any location is unreachable, the
  // response will only return backups in reachable locations and the
  // "unreachable" field will be populated with a list of unreachable
  // locations.
  repeated Backup backups = 1;

  // The token you can use to retrieve the next page of results. Not returned
  // if there are no more results in the list.
  string next_page_token = 2;

  // Unordered list. Locations that could not be reached.
  repeated string unreachable = 3
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// A Filestore share.
message Share {
  option (google.api.resource) = {
    type: "file.googleapis.com/Share"
    pattern: "projects/{project}/locations/{location}/instances/{instance}/shares/{share}"
  };

  // The share state.
  enum State {
    // State not set.
    STATE_UNSPECIFIED = 0;

    // Share is being created.
    CREATING = 1;

    // Share is ready for use.
    READY = 3;

    // Share is being deleted.
    DELETING = 4;
  }

  // Output only. The resource name of the share, in the format
  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // The mount name of the share. Must be 63 characters or less and consist of
  // uppercase or lowercase letters, numbers, and underscores.
  string mount_name = 2;

  // A description of the share with 2048 characters or less. Requests with
  // longer descriptions will be rejected.
  string description = 3;

  // File share capacity in gigabytes (GB). Filestore defines 1 GB as
  // 1024^3 bytes. Must be greater than 0.
  int64 capacity_gb = 4;

  // Nfs Export Options.
  // There is a limit of 10 export options per file share.
  repeated NfsExportOptions nfs_export_options = 5;

  // Output only. The share state.
  State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time when the share was created.
  google.protobuf.Timestamp create_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Resource labels to represent user provided metadata.
  map<string, string> labels = 8;

  // The source that this Share has been restored from. Empty if the Share is
  // created from scratch.
  oneof source {
    // Immutable. Full name of the Cloud Filestore Backup resource that this
    // Share is restored from, in the format of
    // projects/{project_id}/locations/{location_id}/backups/{backup_id}.
    // Empty, if the Share is created from scratch and not restored from a
    // backup.
    string backup = 9 [
      (google.api.field_behavior) = IMMUTABLE,
      (google.api.resource_reference) = { type: "file.googleapis.com/Backup" }
    ];
  }
}

// CreateShareRequest creates a share.
message CreateShareRequest {
  // Required. The Filestore Instance to create the share for, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // Required. The ID to use for the share.
  // The ID must be unique within the specified instance.
  //
  // This value must start with a lowercase letter followed by up to 62
  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
  string share_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. A share resource
  Share share = 3 [(google.api.field_behavior) = REQUIRED];
}

// GetShareRequest gets the state of a share.
message GetShareRequest {
  // Required. The share resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Share" }
  ];
}

// DeleteShareRequest deletes a share.
message DeleteShareRequest {
  // Required. The share resource name, in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Share" }
  ];
}

// ListSharesRequest lists shares.
message ListSharesRequest {
  // Required. The instance for which to retrieve share information,
  // in the format
  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = { type: "file.googleapis.com/Instance" }
  ];

  // The maximum number of items to return.
  int32 page_size = 2;

  // The next_page_token value to use if there are additional
  // results to retrieve for this list request.
  string page_token = 3;

  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
  string order_by = 4;

  // List filter.
  string filter = 5;
}

// ListSharesResponse is the result of ListSharesRequest.
message ListSharesResponse {
  // A list of shares in the project for the specified instance.
  repeated Share shares = 1;

  // The token you can use to retrieve the next page of results. Not returned
  // if there are no more results in the list.
  string next_page_token = 2;

  // Unordered list. Locations that could not be reached.
  repeated string unreachable = 3
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// UpdateShareRequest updates the settings of a share.
message UpdateShareRequest {
  // Required. A share resource.
  // Only fields specified in update_mask are updated.
  Share share = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. Mask of fields to update. At least one path must be supplied in
  // this field. The elements of the repeated paths field may only include these
  // fields:
  //
  // * "description"
  // * "capacity_gb"
  // * "labels"
  // * "nfs_export_options"
  google.protobuf.FieldMask update_mask = 2
      [(google.api.field_behavior) = REQUIRED];
}
