// Copyright 2026 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.tasks.v2beta3;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option go_package = "cloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb";
option java_multiple_files = true;
option java_outer_classname = "CmekConfigProto";
option java_package = "com.google.cloud.tasks.v2beta3";
option (google.api.resource_definition) = {
  type: "cloudkms.googleapis.com/CryptoKey"
  pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
};

// Describes the customer-managed encryption key (CMEK) configuration associated
// with a project and location.
message CmekConfig {
  option (google.api.resource) = {
    type: "cloudtasks.googleapis.com/CmekConfig"
    pattern: "projects/{project}/locations/{location}/cmekConfig"
  };

  // Output only. The config resource name which includes the project and
  // location and must end in 'cmekConfig', in the format
  // projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Resource name of the Cloud KMS key, of the form
  // `projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING_ID/cryptoKeys/KEY_ID`,
  // that will be used to encrypt the Queues & Tasks in the region. Setting
  // this as blank will turn off CMEK encryption.
  string kms_key = 2 [(google.api.resource_reference) = {
    type: "cloudkms.googleapis.com/CryptoKey"
  }];
}
