// 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.configdelivery.v1beta;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.ConfigDelivery.V1Beta";
option go_package = "cloud.google.com/go/configdelivery/apiv1beta/configdeliverypb;configdeliverypb";
option java_multiple_files = true;
option java_outer_classname = "ConfigDeliveryProto";
option java_package = "com.google.cloud.configdelivery.v1beta";
option php_namespace = "Google\\Cloud\\ConfigDelivery\\V1beta";
option ruby_package = "Google::Cloud::ConfigDelivery::V1beta";
option (google.api.resource_definition) = {
  type: "cloudbuild.googleapis.com/Repository"
  pattern: "projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}"
};
option (google.api.resource_definition) = {
  type: "gkehub.googleapis.com/Membership"
  pattern: "projects/{project}/locations/{location}/memberships/{membership}"
};

// ConfigDelivery service manages the deployment of kubernetes configuration to
// a fleet of kubernetes clusters.
service ConfigDelivery {
  option (google.api.default_host) = "configdelivery.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/cloud-platform";

  // Lists ResourceBundles in a given project and location.
  rpc ListResourceBundles(ListResourceBundlesRequest)
      returns (ListResourceBundlesResponse) {
    option (google.api.http) = {
      get: "/v1beta/{parent=projects/*/locations/*}/resourceBundles"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets details of a single ResourceBundle.
  rpc GetResourceBundle(GetResourceBundleRequest) returns (ResourceBundle) {
    option (google.api.http) = {
      get: "/v1beta/{name=projects/*/locations/*/resourceBundles/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a new ResourceBundle in a given project and location.
  rpc CreateResourceBundle(CreateResourceBundleRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{parent=projects/*/locations/*}/resourceBundles"
      body: "resource_bundle"
    };
    option (google.api.method_signature) =
        "parent,resource_bundle,resource_bundle_id";
    option (google.longrunning.operation_info) = {
      response_type: "ResourceBundle"
      metadata_type: "OperationMetadata"
    };
  }

  // Updates the parameters of a single ResourceBundle.
  rpc UpdateResourceBundle(UpdateResourceBundleRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta/{resource_bundle.name=projects/*/locations/*/resourceBundles/*}"
      body: "resource_bundle"
    };
    option (google.api.method_signature) = "resource_bundle,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "ResourceBundle"
      metadata_type: "OperationMetadata"
    };
  }

  // Deletes a single ResourceBundle.
  rpc DeleteResourceBundle(DeleteResourceBundleRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta/{name=projects/*/locations/*/resourceBundles/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "OperationMetadata"
    };
  }

  // Lists FleetPackages in a given project and location.
  rpc ListFleetPackages(ListFleetPackagesRequest)
      returns (ListFleetPackagesResponse) {
    option (google.api.http) = {
      get: "/v1beta/{parent=projects/*/locations/*}/fleetPackages"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets details of a single FleetPackage.
  rpc GetFleetPackage(GetFleetPackageRequest) returns (FleetPackage) {
    option (google.api.http) = {
      get: "/v1beta/{name=projects/*/locations/*/fleetPackages/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a new FleetPackage in a given project and location.
  rpc CreateFleetPackage(CreateFleetPackageRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{parent=projects/*/locations/*}/fleetPackages"
      body: "fleet_package"
    };
    option (google.api.method_signature) =
        "parent,fleet_package,fleet_package_id";
    option (google.longrunning.operation_info) = {
      response_type: "FleetPackage"
      metadata_type: "OperationMetadata"
    };
  }

  // Updates the parameters of a single FleetPackage.
  rpc UpdateFleetPackage(UpdateFleetPackageRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta/{fleet_package.name=projects/*/locations/*/fleetPackages/*}"
      body: "fleet_package"
    };
    option (google.api.method_signature) = "fleet_package,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "FleetPackage"
      metadata_type: "OperationMetadata"
    };
  }

  // Deletes a single FleetPackage.
  rpc DeleteFleetPackage(DeleteFleetPackageRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta/{name=projects/*/locations/*/fleetPackages/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "OperationMetadata"
    };
  }

  // Lists Releases in a given project and location.
  rpc ListReleases(ListReleasesRequest) returns (ListReleasesResponse) {
    option (google.api.http) = {
      get: "/v1beta/{parent=projects/*/locations/*/resourceBundles/*}/releases"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets details of a single Release.
  rpc GetRelease(GetReleaseRequest) returns (Release) {
    option (google.api.http) = {
      get: "/v1beta/{name=projects/*/locations/*/resourceBundles/*/releases/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a new Release in a given project, location and resource bundle.
  rpc CreateRelease(CreateReleaseRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{parent=projects/*/locations/*/resourceBundles/*}/releases"
      body: "release"
    };
    option (google.api.method_signature) = "parent,release,release_id";
    option (google.longrunning.operation_info) = {
      response_type: "Release"
      metadata_type: "OperationMetadata"
    };
  }

  // Updates the parameters of a single Release.
  rpc UpdateRelease(UpdateReleaseRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta/{release.name=projects/*/locations/*/resourceBundles/*/releases/*}"
      body: "release"
    };
    option (google.api.method_signature) = "release,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Release"
      metadata_type: "OperationMetadata"
    };
  }

  // Deletes a single Release.
  rpc DeleteRelease(DeleteReleaseRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta/{name=projects/*/locations/*/resourceBundles/*/releases/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "OperationMetadata"
    };
  }

  // Lists Variants in a given project and location.
  rpc ListVariants(ListVariantsRequest) returns (ListVariantsResponse) {
    option (google.api.http) = {
      get: "/v1beta/{parent=projects/*/locations/*/resourceBundles/*/releases/*}/variants"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets details of a single Variant.
  rpc GetVariant(GetVariantRequest) returns (Variant) {
    option (google.api.http) = {
      get: "/v1beta/{name=projects/*/locations/*/resourceBundles/*/releases/*/variants/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Creates a new Variant in a given project, location, resource bundle, and
  // release.
  rpc CreateVariant(CreateVariantRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{parent=projects/*/locations/*/resourceBundles/*/releases/*}/variants"
      body: "variant"
    };
    option (google.api.method_signature) = "parent,variant,variant_id";
    option (google.longrunning.operation_info) = {
      response_type: "Variant"
      metadata_type: "OperationMetadata"
    };
  }

  // Updates the parameters of a single Variant.
  rpc UpdateVariant(UpdateVariantRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      patch: "/v1beta/{variant.name=projects/*/locations/*/resourceBundles/*/releases/*/variants/*}"
      body: "variant"
    };
    option (google.api.method_signature) = "variant,update_mask";
    option (google.longrunning.operation_info) = {
      response_type: "Variant"
      metadata_type: "OperationMetadata"
    };
  }

  // Deletes a single Variant.
  rpc DeleteVariant(DeleteVariantRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      delete: "/v1beta/{name=projects/*/locations/*/resourceBundles/*/releases/*/variants/*}"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "google.protobuf.Empty"
      metadata_type: "OperationMetadata"
    };
  }

  // Lists Rollouts in a given project, location, and Fleet Package.
  rpc ListRollouts(ListRolloutsRequest) returns (ListRolloutsResponse) {
    option (google.api.http) = {
      get: "/v1beta/{parent=projects/*/locations/*/fleetPackages/*}/rollouts"
    };
    option (google.api.method_signature) = "parent";
  }

  // Gets details of a single Rollout.
  rpc GetRollout(GetRolloutRequest) returns (Rollout) {
    option (google.api.http) = {
      get: "/v1beta/{name=projects/*/locations/*/fleetPackages/*/rollouts/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Suspend a Rollout.
  rpc SuspendRollout(SuspendRolloutRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{name=projects/*/locations/*/fleetPackages/*/rollouts/*}:suspend"
      body: "*"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "Rollout"
      metadata_type: "OperationMetadata"
    };
  }

  // Resume a Rollout.
  rpc ResumeRollout(ResumeRolloutRequest)
      returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{name=projects/*/locations/*/fleetPackages/*/rollouts/*}:resume"
      body: "*"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "Rollout"
      metadata_type: "OperationMetadata"
    };
  }

  // Abort a Rollout.
  rpc AbortRollout(AbortRolloutRequest) returns (google.longrunning.Operation) {
    option (google.api.http) = {
      post: "/v1beta/{name=projects/*/locations/*/fleetPackages/*/rollouts/*}:abort"
      body: "*"
    };
    option (google.api.method_signature) = "name";
    option (google.longrunning.operation_info) = {
      response_type: "Rollout"
      metadata_type: "OperationMetadata"
    };
  }
}

// Deletion Propagation Policy determines what happens to the underlying
// Kubernetes resources on a cluster when the `FleetPackage` managing
// those resources no longer targets the cluster or is deleted.
enum DeletionPropagationPolicy {
  // Unspecified deletion propagation policy. Defaults to FOREGROUND.
  DELETION_PROPAGATION_POLICY_UNSPECIFIED = 0;

  // Foreground deletion propagation policy. Any resources synced to the cluster
  // will be deleted.
  FOREGROUND = 1;

  // Orphan deletion propagation policy. Any resources synced to the cluster
  // will be abandoned.
  ORPHAN = 2;
}

// ResourceBundle represent a collection of kubernetes configuration resources.
message ResourceBundle {
  option (google.api.resource) = {
    type: "configdelivery.googleapis.com/ResourceBundle"
    pattern: "projects/{project}/locations/{location}/resourceBundles/{resource_bundle}"
    plural: "resourceBundles"
    singular: "resourceBundle"
  };

  // Identifier. Name of the `ResourceBundle`. Format is
  // `projects/{project}/locations/{location}/resourceBundle
  // /[a-z][a-z0-9\-]{0,62}`.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Time `ResourceBundle` was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Time `ResourceBundle` was last updated.
  google.protobuf.Timestamp update_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Labels as key value pairs.
  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Human readable description of the `ResourceBundle`.
  string description = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for requesting list of ResourceBundles.
message ListResourceBundlesRequest {
  // Required. Parent value for ListResourceBundlesRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/ResourceBundle"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filtering results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for response to listing ResourceBundles.
message ListResourceBundlesResponse {
  // The list of ResourceBundle.
  repeated ResourceBundle resource_bundles = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

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

// Message for getting a ResourceBundle.
message GetResourceBundleRequest {
  // Required. Name of the resource.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/ResourceBundle"
    }
  ];
}

// Message for creating a ResourceBundle.
message CreateResourceBundleRequest {
  // Required. Value for parent.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/ResourceBundle"
    }
  ];

  // Required. Id of the requesting object
  // If auto-generating Id server-side, remove this field and
  // resource_bundle_id from the method_signature of Create RPC
  string resource_bundle_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being created
  ResourceBundle resource_bundle = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 4 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for updating a ResourceBundle
message UpdateResourceBundleRequest {
  // Required. Field mask is used to specify the fields to be overwritten in the
  // ResourceBundle resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being updated
  ResourceBundle resource_bundle = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 3 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for deleting a ResourceBundle
message DeleteResourceBundleRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/ResourceBundle"
    }
  ];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes after the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 2 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, any releases of this resource bundle will also be
  // deleted. (Otherwise, the request will only work if the resource bundle has
  // no releases.)
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// A `FleetPackage` resource in the Config Delivery API.
//
// A `FleetPackage` defines a package through which kubernetes
// configuration is deployed to a fleet of kubernetes clusters.
message FleetPackage {
  option (google.api.resource) = {
    type: "configdelivery.googleapis.com/FleetPackage"
    pattern: "projects/{project}/locations/{location}/fleetPackages/{fleet_package}"
    plural: "fleetPackages"
    singular: "fleetPackage"
  };

  // Information specifying the source of kubernetes configuration to deploy.
  message ResourceBundleSelector {
    // source can be a directly pushed `ResourceBundle` or
    // `CloudBuildRepository` containing the kubernetes configuration.
    oneof source {
      // Information specifying `ResourceBundle`.
      ResourceBundleTag resource_bundle = 1;

      // Information specifying `CloudBuildRepository`.
      CloudBuildRepository cloud_build_repository = 3;
    }
  }

  // ResourceBundleTag contains the information to refer to a release for a
  // `ResourceBundle`.
  message ResourceBundleTag {
    // Required. Name of the `ResourceBundle`.
    // Format is projects/{p}/locations/{l}/resourceBundles/{r}.
    string name = 1 [
      (google.api.field_behavior) = REQUIRED,
      (google.api.resource_reference) = {
        type: "configdelivery.googleapis.com/ResourceBundle"
      }
    ];

    // Required. Tag refers to a version of the release in a `ResourceBundle`.
    // This is a Git tag in the semantic version format `vX.Y.Z`.
    string tag = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // CloudBuildRepository contains information about fetching Kubernetes
  // configuration from a `CloudBuildRepository`.
  message CloudBuildRepository {
    // variants_pattern is the configuration for how to read the repository
    // to find variants.
    oneof variants {
      // Optional. variants_pattern is a glob pattern that will be used to find
      // variants in the repository. Examples: `variants/*.yaml`, `us-*`
      string variants_pattern = 5 [(google.api.field_behavior) = OPTIONAL];
    }

    // Required. Name of the cloud build repository.
    // Format is projects/{p}/locations/{l}/connections/{c}/repositories/{r}.
    string name = 1 [
      (google.api.field_behavior) = REQUIRED,
      (google.api.resource_reference) = {
        type: "cloudbuild.googleapis.com/Repository"
      }
    ];

    // Optional. path to the directory or file within the repository that
    // contains the kubernetes configuration. If unspecified, path is assumed to
    // the top level root directory of the repository.
    string path = 2 [(google.api.field_behavior) = OPTIONAL];

    // Required. git tag of the underlying git repository.
    // The git tag must be in the semantic version format `vX.Y.Z`.
    string tag = 3 [(google.api.field_behavior) = REQUIRED];

    // Required. Google service account to use in CloudBuild triggers to fetch
    // and store kubernetes configuration.
    string service_account = 4 [(google.api.field_behavior) = REQUIRED];
  }

  // The target defines different ways to target set of kubernetes clusters.
  message Target {
    // target for the fleet package.
    oneof target {
      // The GKE fleet information.
      Fleet fleet = 1;
    }
  }

  // VariantSelector contains information for selecting a variant in
  // `ResourceBundle` to deploy to a target cluster.
  message VariantSelector {
    // strategy for selecting a variant.
    oneof strategy {
      // Required. variant_name_template is a template that can refer to
      // variables containing cluster membership metadata such as location,
      // name, and labels to generate the name of the variant for a target
      // cluster. The variable syntax is similar to the unix shell variables.
      //
      // Available variables are `${membership.name}`, `${membership.location}`,
      // `${membership.project}` and `${membership.labels['label_name']}`.
      //
      // If you want to deploy a specific variant, say "default" to all the
      // clusters, you can use "default" (string without any variables) as
      // the variant_name_template.
      string variant_name_template = 1 [(google.api.field_behavior) = REQUIRED];
    }
  }

  // State indicates the desired state for the fleet package.
  // Unspecified value is equivalent to `ACTIVE`. If state is set to
  // `SUSPENDED`, active rollout (if any) will continue but no new rollouts will
  // be scheduled.
  enum State {
    // Unspecified state.
    STATE_UNSPECIFIED = 0;

    // `FleetPackage` is intended to be active.
    ACTIVE = 1;

    // `FleetPackage` is intended to be suspended.
    SUSPENDED = 2;
  }

  // Identifier. Name of the `FleetPackage`. Format is
  // `projects/{project}/locations/{location}/fleetPackages/{fleetPackage}`.
  // The `fleetPackage` component must match
  // `[a-z][a-z0-9\-]{0,62}`
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Time at which the `FleetPackage` was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Most recent time at which the `FleetPackage` was updated.
  google.protobuf.Timestamp update_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Labels are attributes that can be set and used by both the
  // user and by Config Delivery. Labels must meet the following constraints:
  //
  // * Keys and values can contain only lowercase letters, numeric characters,
  // underscores, and dashes.
  // * All characters must use UTF-8 encoding, and international characters are
  // allowed.
  // * Keys must start with a lowercase letter or international character.
  // * Each resource is limited to a maximum of 64 labels.
  //
  // Both keys and values are additionally constrained to be <= 128 bytes.
  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

  // Required. Information specifying the source of kubernetes configuration to
  // deploy.
  ResourceBundleSelector resource_bundle_selector = 5
      [(google.api.field_behavior) = REQUIRED];

  // Optional. Configuration to select target clusters to deploy kubernetes
  // configuration to.
  Target target = 9 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The strategy to use to deploy kubernetes configuration to
  // clusters.
  RolloutStrategy rollout_strategy = 10
      [(google.api.field_behavior) = OPTIONAL];

  // Required. Information specifying how to map a `ResourceBundle` variant to a
  // target cluster.
  VariantSelector variant_selector = 11
      [(google.api.field_behavior) = REQUIRED];

  // Output only. Information containing the rollout status of the
  // `FleetPackage` across all the target clusters.
  FleetPackageInfo info = 13 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Information around how to handle kubernetes resources at the
  // target clusters when the `FleetPackage` is deleted.
  DeletionPropagationPolicy deletion_propagation_policy = 15
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. The desired state of the fleet package.
  State state = 16 [(google.api.field_behavior) = OPTIONAL];
}

// FleetPackageInfo represents the status of the `FleetPackage` across all the
// target clusters.
message FleetPackageInfo {
  // Possible values for the `FleetPackage` state.
  enum State {
    // Unspecified state.
    STATE_UNSPECIFIED = 0;

    // `FleetPackage` is active.
    ACTIVE = 1;

    // `FleetPackage` is suspended.
    SUSPENDED = 2;

    // `FleetPackage` has failed to reconcile.
    FAILED = 3;

    // `FleetPackage` is being deleted.
    DELETING = 4;
  }

  // Optional. The active rollout, if any. Format is
  // `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/{rollout}`.
  string active_rollout = 1 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. The last completed rollout, if any. Format is
  // `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/{rollout}`.
  string last_completed_rollout = 2 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. Output only. The current state of the `FleetPackage`.
  State state = 3 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. Output only. Errors encountered during configuration deployment
  // (if any).
  repeated FleetPackageError errors = 6 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Information representing an error encountered during rolling out
// configurations.
message FleetPackageError {
  // Optional. A description of the error.
  string error_message = 1 [(google.api.field_behavior) = OPTIONAL];
}

// ClusterInfo represents status of a resource bundle rollout for a cluster.
message ClusterInfo {
  // State of the rollout for the cluster.
  enum State {
    // Unspecified state.
    STATE_UNSPECIFIED = 0;

    // Waiting state.
    WAITING = 1;

    // In progress state.
    IN_PROGRESS = 2;

    // Stalled state.
    STALLED = 3;

    // Completed state.
    COMPLETED = 4;

    // Aborted state.
    ABORTED = 5;

    // Cancelled state.
    CANCELLED = 6;

    // Error state.
    ERROR = 7;

    // Unchanged state.
    UNCHANGED = 8;

    // Skipped state.
    SKIPPED = 9;
  }

  // Output only. gkehub membership of target cluster
  string membership = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "gkehub.googleapis.com/Membership"
    }
  ];

  // Output only. Desired state for the resource bundle.
  ResourceBundleDeploymentInfo desired = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Initial state of the resource bundle prior to the deployment.
  ResourceBundleDeploymentInfo initial = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Current state of the resource bundle.
  ResourceBundleDeploymentInfo current = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. State of the rollout for the cluster.
  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Unordered list. Messages convey additional information related
  // to the deployment.
  repeated string messages = 6 [
    (google.api.field_behavior) = UNORDERED_LIST,
    (google.api.field_behavior) = OUTPUT_ONLY
  ];

  // Output only. Timestamp when reconciliation starts.
  google.protobuf.Timestamp start_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp when reconciliation ends.
  google.protobuf.Timestamp end_time = 8
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// ResourceBundleDeploymentInfo represents the status of a resource bundle
// deployment.
message ResourceBundleDeploymentInfo {
  // Synchronization state of the resource bundle deployment.
  enum SyncState {
    // Unspecified state.
    SYNC_STATE_UNSPECIFIED = 0;

    // Reconciling state.
    RECONCILING = 1;

    // Stalled state.
    STALLED = 2;

    // Synced state.
    SYNCED = 3;

    // Pending state.
    PENDING = 4;

    // Error state.
    ERROR = 5;

    // Deletion pending state.
    DELETION_PENDING = 6;

    // Deleting state.
    DELETING = 7;

    // Deleted state.
    DELETED = 8;
  }

  // Output only. Refers to a `ResourceBundle` release.
  string release = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Release"
    }
  ];

  // Output only. Refers to a version of the `ResourceBundle` release.
  string version = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Refers to a variant in a `ResourceBundle` release.
  string variant = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Synchronization state of the `ResourceBundle` deployment.
  SyncState sync_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Unordered list. Messages contains information related to the
  // `ResourceBundle` deployment. For example, in case of an error, indicate the
  // reason for the error. In case of a pending deployment, reason for why the
  // deployment of new release is pending.
  repeated string messages = 5 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.field_behavior) = UNORDERED_LIST
  ];
}

// The fleet where the `FleetPackage` should be deployed.
message Fleet {
  // A label selector is a label query over a set of resources. An empty label
  // selector matches all objects.
  message LabelSelector {
    // Optional. match_labels is a map of {key,value} pairs. Each {key,value}
    // pair must match an existing label key and value exactly in order to
    // satisfy the match.
    map<string, string> match_labels = 1
        [(google.api.field_behavior) = OPTIONAL];
  }

  // Required. The host project for the GKE fleet. Format is
  // `projects/{project}`.
  string project = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudresourcemanager.googleapis.com/Project"
    }
  ];

  // Optional. selector allows targeting a subset of fleet members using their
  // labels.
  LabelSelector selector = 2 [(google.api.field_behavior) = OPTIONAL];
}

// AllAtOnceStrategy causes all clusters to be updated concurrently.
message AllAtOnceStrategy {}

// RollingStrategy causes a specified number of clusters to be updated
// concurrently until all clusters are updated.
message RollingStrategy {
  // Optional. Maximum number of clusters to update the resource bundle on
  // concurrently.
  int32 max_concurrent = 1 [(google.api.field_behavior) = OPTIONAL];
}

// RolloutStrategy defines different ways to rollout a resource bundle across
// a set of clusters.
message RolloutStrategy {
  // strategy defines how updates to a resource bundle should be rolled out
  // across clusters.
  oneof strategy {
    // AllAtOnceStrategy causes all clusters to be updated concurrently.
    AllAtOnceStrategy all_at_once = 1;

    // RollingStrategy causes a specified number of clusters to be updated
    // concurrently until all clusters are updated.
    RollingStrategy rolling = 2;
  }
}

// RolloutStrategyInfo represents the status of execution of different types of
// rollout strategies. Only the field corresponding to the rollout strategy
// specified at the rollout resource will be populated.
message RolloutStrategyInfo {
  // strategy represents result of applying one of the rollout strategies.
  oneof strategy {
    // AllAtOnceStrategyInfo represents the status of AllAtOnce rollout strategy
    // execution.
    AllAtOnceStrategyInfo all_at_once_strategy_info = 1;

    // RollingStrategyInfo represents the status of Rolling rollout strategy
    // execution.
    RollingStrategyInfo rolling_strategy_info = 2;
  }
}

// AllAtOnceStrategyInfo represents the status of execution of AllAtOnce rollout
// strategy.
message AllAtOnceStrategyInfo {
  // Unordered list. resource bundle's deployment status for all targeted
  // clusters.
  repeated ClusterInfo clusters = 1
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// RollingStrategyInfo represents the status of execution of Rolling rollout
// strategy.
message RollingStrategyInfo {
  // Unordered list. resource bundle's deployment status for all targeted
  // clusters.
  repeated ClusterInfo clusters = 1
      [(google.api.field_behavior) = UNORDERED_LIST];
}

// Message for requesting list of FleetPackage.
message ListFleetPackagesRequest {
  // Required. Parent value for ListFleetPackagesRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/FleetPackage"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filtering results
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for response to listing FleetPackage
message ListFleetPackagesResponse {
  // The list of FleetPackage
  repeated FleetPackage fleet_packages = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

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

// Message for getting a FleetPackage
message GetFleetPackageRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/FleetPackage"
    }
  ];
}

// Message for creating a FleetPackage
message CreateFleetPackageRequest {
  // Required. Value for parent.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/FleetPackage"
    }
  ];

  // Required. Id of the requesting object
  // If auto-generating Id server-side, remove this field and
  // fleet_package_id from the method_signature of Create RPC
  string fleet_package_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being created.
  FleetPackage fleet_package = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 4 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for updating a FleetPackage
message UpdateFleetPackageRequest {
  // Required. Field mask is used to specify the fields to be overwritten in the
  // FleetPackage resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being updated
  FleetPackage fleet_package = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 3 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for deleting a FleetPackage
message DeleteFleetPackageRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/FleetPackage"
    }
  ];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes after the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 2 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, any rollouts for this FleetPackage will also be
  // deleted. (Otherwise, the request will only work if the fleet package has no
  // rollouts.)
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. If set to true, then deleting an already deleted or non existing
  // FleetPackage will succeed.
  bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Represents the metadata of the long-running operation.
message OperationMetadata {
  // Output only. The time the operation was created.
  google.protobuf.Timestamp create_time = 1
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time the operation finished running.
  google.protobuf.Timestamp end_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Server-defined resource path for the target of the operation.
  string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Name of the verb executed by the operation.
  string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Human-readable status of the operation, if any.
  string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Identifies whether the user has requested cancellation
  // of the operation. Operations that have been cancelled successfully
  // have
  // [google.longrunning.Operation.error][google.longrunning.Operation.error]
  // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  // corresponding to `Code.CANCELLED`.
  bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. API version used to start the operation.
  string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// `Release` represents a versioned release containing kubernetes manifests.
message Release {
  option (google.api.resource) = {
    type: "configdelivery.googleapis.com/Release"
    pattern: "projects/{project}/locations/{location}/resourceBundles/{resource_bundle}/releases/{release}"
    plural: "releases"
    singular: "release"
  };

  // Lifecycle indicates the state of the `Release`. A published release is
  // immutable.
  enum Lifecycle {
    // indicates lifecycle has not been specified.
    LIFECYCLE_UNSPECIFIED = 0;

    // indicates that the `Release` is being edited.
    DRAFT = 1;

    // indicates that the `Release` is now published (or released) and
    // immutable.
    PUBLISHED = 2;
  }

  // Identifier. Name of the Release. Format is
  // `projects/{project}/locations/location}/resourceBundles/{resource_bundle}/release/[a-z][a-z0-9\-]{0,62}`.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Time `Release` was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Time `Release` was last updated.
  google.protobuf.Timestamp update_time = 3
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Labels as key value pairs.
  map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. lifecycle of the `Release`.
  Lifecycle lifecycle = 5 [(google.api.field_behavior) = OPTIONAL];

  // Required. version of the `Release`. This must be v<major>.<minor>.<patch>.
  string version = 6 [(google.api.field_behavior) = REQUIRED];

  // Output only. Time the `Release` was published.
  google.protobuf.Timestamp publish_time = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. `ResourceBundle` Release extra information e.g., artifact
  // registry image path.
  ReleaseInfo info = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Variant represents the content of a `ResourceBundle` variant.
message Variant {
  option (google.api.resource) = {
    type: "configdelivery.googleapis.com/Variant"
    pattern: "projects/{project}/locations/{location}/resourceBundles/{resource_bundle}/releases/{release}/variants/{variant}"
    plural: "variants"
    singular: "variant"
  };

  // Optional. labels to represent any metadata associated with the variant.
  map<string, string> labels = 1 [(google.api.field_behavior) = OPTIONAL];

  // Required. Input only. Unordered list. resources contain the kubernetes
  // manifests (YAMLs) for this variant.
  repeated string resources = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.field_behavior) = UNORDERED_LIST,
    (google.api.field_behavior) = INPUT_ONLY
  ];

  // Identifier. Name follows format of
  // projects/{project}/locations/{location}/resourceBundles/{resource_bundle}/releases/{release}/variants/{variant}
  string name = 3 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. [Output only] Create time stamp
  google.protobuf.Timestamp create_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. [Output only] Update time stamp
  google.protobuf.Timestamp update_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Message for requesting list of Variants.
message ListVariantsRequest {
  // Required. Parent value for ListVariantsRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/Variant"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filtering results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for response to listing Variants
message ListVariantsResponse {
  // The list of Variants
  repeated Variant variants = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

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

// Message for getting a Variant
message GetVariantRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Variant"
    }
  ];
}

// Message for creating a Variant
message CreateVariantRequest {
  // Required. Value for parent.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/Variant"
    }
  ];

  // Required. Id of the requesting object
  string variant_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being created
  Variant variant = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 4 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for updating a Variant
message UpdateVariantRequest {
  // Optional. Field mask is used to specify the fields to be overwritten in the
  // Variant resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = OPTIONAL];

  // Required. The resource being updated
  Variant variant = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 3 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for deleting a Variant
message DeleteVariantRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Variant"
    }
  ];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes after the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 2 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// ReleaseInfo contains extra information about the `ResourceBundle` release
// e.g., link to an artifact registry OCI image.
message ReleaseInfo {
  // Output only. path to the oci image the service uploads to on a `Release`
  // creation.
  string oci_image_path = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. per-variant paths to the oci images the service uploads on
  // package release creation
  map<string, string> variant_oci_image_paths = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Message for requesting list of Releases.
message ListReleasesRequest {
  // Required. Parent value for ListReleasesRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/Release"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filtering results.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for response to listing Releases
message ListReleasesResponse {
  // The list of Releases
  repeated Release releases = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

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

// Message for getting a Release
message GetReleaseRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Release"
    }
  ];
}

// Message for creating a Release
message CreateReleaseRequest {
  // Required. Value for parent.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/Release"
    }
  ];

  // Required. Id of the requesting object
  // If auto-generating Id server-side, remove this field and
  // release_id from the method_signature of Create RPC
  string release_id = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being created
  Release release = 3 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 4 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for updating a Release
message UpdateReleaseRequest {
  // Required. Field mask is used to specify the fields to be overwritten in the
  // Release resource by the update.
  // The fields specified in the update_mask are relative to the resource, not
  // the full request. A field will be overwritten if it is in the mask. If the
  // user does not provide a mask then all fields will be overwritten.
  google.protobuf.FieldMask update_mask = 1
      [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being updated
  Release release = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes since the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 3 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];
}

// Message for deleting a Release
message DeleteReleaseRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Release"
    }
  ];

  // Optional. An optional request ID to identify requests. Specify a unique
  // request ID so that if you must retry your request, the server will know to
  // ignore the request if it has already been completed. The server will
  // guarantee that for at least 60 minutes after the first request.
  //
  // For example, consider a situation where you make an initial request and the
  // request times out. If you make the request again with the same request
  // ID, the server can check if original operation with the same request ID
  // was received, and if so, will ignore the second request. This prevents
  // clients from accidentally creating duplicate commitments.
  //
  // The request ID must be a valid UUID with the exception that zero UUID is
  // not supported (00000000-0000-0000-0000-000000000000).
  string request_id = 2 [
    (google.api.field_info).format = UUID4,
    (google.api.field_behavior) = OPTIONAL
  ];

  // Optional. If set to true, any variants of this release will also be
  // deleted. (Otherwise, the request will only work if the release has no
  // variants.)
  bool force = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Message for requesting list of Rollouts
message ListRolloutsRequest {
  // Required. Parent value for ListRolloutsRequest
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. Requested page size. Server may return fewer items than
  // requested. If unspecified, server will pick an appropriate default.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying a page of results the server should return.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Filtering results
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Hint for how to order the results
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Message for response to listing Rollouts
message ListRolloutsResponse {
  // The list of Rollouts
  repeated Rollout rollouts = 1;

  // A token identifying a page of results the server should return.
  string next_page_token = 2;

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

// Message for getting a Rollout
message GetRolloutRequest {
  // Required. Name of the resource
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];
}

// RolloutInfo represents the state of the `FleetPackage` at all the
// clusters the rollout is targeting.
message RolloutInfo {
  // State of the rollout
  enum State {
    // Unspecified state.
    STATE_UNSPECIFIED = 0;

    // Rollout completed.
    COMPLETED = 1;

    // Rollout suspended.
    SUSPENDED = 2;

    // Rollout aborted.
    ABORTED = 3;

    // Rollout in progress.
    IN_PROGRESS = 5;

    // Rollout stalled.
    STALLED = 6;

    // Rollout cancelled.
    CANCELLED = 7;

    // Rollout aborting.
    ABORTING = 8;
  }

  // Output only. state contains the overall status of the Rollout.
  State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Time when the rollout started.
  google.protobuf.Timestamp start_time = 4
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Time when the rollout completed.
  google.protobuf.Timestamp end_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Message containing additional information related to the
  // rollout.
  string message = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Rollout strategy info represents the status of execution of
  // rollout strategy.
  RolloutStrategyInfo rollout_strategy_info = 7
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Rollout resource represents an instance of `FleetPackage` rollout operation
// across a fleet. This is a system generated resource and will be read only for
// end-users. It will be primarily used by the service to process the changes in
// the `FleetPackage` and other changes in the environment.
message Rollout {
  option (google.api.resource) = {
    type: "configdelivery.googleapis.com/Rollout"
    pattern: "projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/{rollout}"
    plural: "rollouts"
    singular: "rollout"
  };

  // Identifier. Name of the Rollout. Format is
  // `projects/{project}/locations/{location}/fleetPackages/{fleet_package}/rollouts/[a-z][a-z0-9\-]{0,62}`.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Reference to the `Release` being rolled out.
  string release = 2 [(google.api.resource_reference) = {
    type: "configdelivery.googleapis.com/Release"
  }];

  // Rollout strategy for rolling out `FleetPackage` to clusters.
  RolloutStrategy rollout_strategy = 4;

  // Current details of the rollout.
  RolloutInfo info = 5;

  // Deletion propagation policy of the rollout.
  DeletionPropagationPolicy deletion_propagation_policy = 7;

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

  // Output only. The time the rollout was most recently updated.
  google.protobuf.Timestamp update_time = 9
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Message for suspending a rollout.
message SuspendRolloutRequest {
  // Required. Name of the Rollout.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. Reason for suspension.
  string reason = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Message for resuming a rollout.
message ResumeRolloutRequest {
  // Required. Name of the Rollout.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. Reason for resuming the rollout.
  string reason = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Message for aborting a rollout.
message AbortRolloutRequest {
  // Required. Name of the Rollout.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "configdelivery.googleapis.com/Rollout"
    }
  ];

  // Optional. Reason for aborting.
  string reason = 2 [(google.api.field_behavior) = OPTIONAL];
}
