// 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.oracledatabase.v1;

import "google/api/field_behavior.proto";
import "google/api/field_info.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/type/datetime.proto";

option csharp_namespace = "Google.Cloud.OracleDatabase.V1";
option go_package = "cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb;oracledatabasepb";
option java_multiple_files = true;
option java_outer_classname = "ExascaleDbStorageVaultProto";
option java_package = "com.google.cloud.oracledatabase.v1";
option php_namespace = "Google\\Cloud\\OracleDatabase\\V1";
option ruby_package = "Google::Cloud::OracleDatabase::V1";

// ExascaleDbStorageVault represents a storage vault exadb vm cluster resource.
// https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/ExascaleDbStorageVault/
message ExascaleDbStorageVault {
  option (google.api.resource) = {
    type: "oracledatabase.googleapis.com/ExascaleDbStorageVault"
    pattern: "projects/{project}/locations/{location}/exascaleDbStorageVaults/{exascale_db_storage_vault}"
    plural: "exascaleDbStorageVaults"
    singular: "exascaleDbStorageVault"
  };

  // Identifier. The resource name of the ExascaleDbStorageVault.
  // Format:
  // projects/{project}/locations/{location}/exascaleDbStorageVaults/{exascale_db_storage_vault}
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Required. The display name for the ExascaleDbStorageVault. The name does
  // not have to be unique within your project. The name must be 1-255
  // characters long and can only contain alphanumeric characters.
  string display_name = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. The GCP Oracle zone where Oracle ExascaleDbStorageVault is
  // hosted. Example: us-east4-b-r2. If not specified, the system will pick a
  // zone based on availability.
  string gcp_oracle_zone = 3 [(google.api.field_behavior) = OPTIONAL];

  // Required. The properties of the ExascaleDbStorageVault.
  ExascaleDbStorageVaultProperties properties = 4
      [(google.api.field_behavior) = REQUIRED];

  // Output only. The date and time when the ExascaleDbStorageVault was created.
  google.protobuf.Timestamp create_time = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The ID of the subscription entitlement associated with the
  // ExascaleDbStorageVault.
  string entitlement_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The labels or tags associated with the ExascaleDbStorageVault.
  map<string, string> labels = 7 [(google.api.field_behavior) = OPTIONAL];
}

// The properties of the ExascaleDbStorageVault.
// next ID: 12
message ExascaleDbStorageVaultProperties {
  // The state of the ExascaleDbStorageVault.
  enum State {
    // The state of the ExascaleDbStorageVault is unspecified.
    STATE_UNSPECIFIED = 0;

    // The ExascaleDbStorageVault is being provisioned.
    PROVISIONING = 1;

    // The ExascaleDbStorageVault is available.
    AVAILABLE = 2;

    // The ExascaleDbStorageVault is being updated.
    UPDATING = 3;

    // The ExascaleDbStorageVault is being deleted.
    TERMINATING = 4;

    // The ExascaleDbStorageVault has been deleted.
    TERMINATED = 5;

    // The ExascaleDbStorageVault has failed.
    FAILED = 6;
  }

  // The shape attribute of the VM clusters attached to the
  // ExascaleDbStorageVault.
  enum ShapeAttribute {
    // Default unspecified value.
    SHAPE_ATTRIBUTE_UNSPECIFIED = 0;

    // Indicates that the resource is in smart storage.
    SMART_STORAGE = 1;

    // Indicates that the resource is in block storage.
    BLOCK_STORAGE = 2;
  }

  // Output only. The OCID for the ExascaleDbStorageVault.
  string ocid = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The time zone of the ExascaleDbStorageVault.
  google.type.TimeZone time_zone = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Required. The storage details of the ExascaleDbStorageVault.
  ExascaleDbStorageDetails exascale_db_storage_details = 3
      [(google.api.field_behavior) = REQUIRED];

  // Output only. The state of the ExascaleDbStorageVault.
  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The description of the ExascaleDbStorageVault.
  string description = 5 [(google.api.field_behavior) = OPTIONAL];

  // Output only. The list of VM cluster OCIDs associated with the
  // ExascaleDbStorageVault.
  repeated string vm_cluster_ids = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The number of VM clusters associated with the
  // ExascaleDbStorageVault.
  int32 vm_cluster_count = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The size of additional flash cache in percentage of high capacity
  // database storage.
  int32 additional_flash_cache_percent = 7
      [(google.api.field_behavior) = OPTIONAL];

  // Output only. Deep link to the OCI console to view this resource.
  string oci_uri = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The shape attributes of the VM clusters attached to the
  // ExascaleDbStorageVault.
  repeated ShapeAttribute attached_shape_attributes = 10
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The shape attributes available for the VM clusters to be
  // attached to the ExascaleDbStorageVault.
  repeated ShapeAttribute available_shape_attributes = 11
      [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The storage details of the ExascaleDbStorageVault.
message ExascaleDbStorageDetails {
  // Output only. The available storage capacity for the ExascaleDbStorageVault,
  // in gigabytes (GB).
  int32 available_size_gbs = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Required. The total storage allocation for the ExascaleDbStorageVault, in
  // gigabytes (GB).
  int32 total_size_gbs = 2 [(google.api.field_behavior) = REQUIRED];
}

// The request for `ExascaleDbStorageVault.Get`.
message GetExascaleDbStorageVaultRequest {
  // Required. The name of the ExascaleDbStorageVault in the following format:
  // projects/{project}/locations/{location}/exascaleDbStorageVaults/{exascale_db_storage_vault}.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "oracledatabase.googleapis.com/ExascaleDbStorageVault"
    }
  ];
}

// The request for `ExascaleDbStorageVault.List`.
message ListExascaleDbStorageVaultsRequest {
  // Required. The parent value for ExascaleDbStorageVault in the following
  // format: projects/{project}/locations/{location}.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "oracledatabase.googleapis.com/ExascaleDbStorageVault"
    }
  ];

  // Optional. The maximum number of items to return.
  // If unspecified, at most 50 ExascaleDbStorageVaults will be returned.
  // The maximum value is 1000; values above 1000 will be coerced to 1000.
  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. An expression for filtering the results of the request. Filter
  // the list as specified in https://google.aip.dev/160.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. An expression for ordering the results of the request. Order
  // results as specified in https://google.aip.dev/132.
  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
}

// The response for `ExascaleDbStorageVault.List`.
message ListExascaleDbStorageVaultsResponse {
  // The ExascaleDbStorageVaults.
  repeated ExascaleDbStorageVault exascale_db_storage_vaults = 1;

  // A token identifying a page of results the server should return. If present,
  // the next page token can be provided to a subsequent
  // ListExascaleDbStorageVaults call to list the next page.
  // If empty, there are no more pages.
  string next_page_token = 2;
}

// The request for `ExascaleDbStorageVault.Create`.
message CreateExascaleDbStorageVaultRequest {
  // Required. The value for parent of the ExascaleDbStorageVault in the
  // following format: projects/{project}/locations/{location}.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "oracledatabase.googleapis.com/ExascaleDbStorageVault"
    }
  ];

  // Required. The ID of the ExascaleDbStorageVault to create. This value is
  // restricted to (^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$) and must be a maximum of
  // 63 characters in length. The value must start with a letter and end with a
  // letter or a number.
  string exascale_db_storage_vault_id = 2
      [(google.api.field_behavior) = REQUIRED];

  // Required. The resource being created.
  ExascaleDbStorageVault exascale_db_storage_vault = 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
  ];
}

// The request message for `ExascaleDbStorageVault.Delete`.
message DeleteExascaleDbStorageVaultRequest {
  // Required. The name of the ExascaleDbStorageVault in the following format:
  // projects/{project}/locations/{location}/exascaleDbStorageVaults/{exascale_db_storage_vault}.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "oracledatabase.googleapis.com/ExascaleDbStorageVault"
    }
  ];

  // Optional. An optional ID to identify the request. This value is used to
  // identify duplicate requests. If you make a request with the same request ID
  // and the original request is still in progress or completed, the server
  // ignores 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
  ];
}
