// 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/resource.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 = "MinorVersionProto";
option java_package = "com.google.cloud.oracledatabase.v1";
option php_namespace = "Google\\Cloud\\OracleDatabase\\V1";
option ruby_package = "Google::Cloud::OracleDatabase::V1";

// MinorVersion represents a minor version of a GI.
// https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/GiMinorVersionSummary/
message MinorVersion {
  option (google.api.resource) = {
    type: "oracledatabase.googleapis.com/MinorVersion"
    pattern: "projects/{project}/locations/{location}/giVersions/{gi_version}/minorVersions/{minor_version}"
    plural: "minorVersions"
    singular: "minorVersion"
  };

  // Identifier. The name of the MinorVersion resource with the format:
  // projects/{project}/locations/{region}/giVersions/{gi_version}/minorVersions/{minor_version}
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Optional. The ID of the Grid Image.
  string grid_image_id = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The valid Oracle grid infrastructure software version.
  string version = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The request for `MinorVersion.List`.
message ListMinorVersionsRequest {
  // Required. The parent value for the MinorVersion resource with the format:
  // projects/{project}/locations/{location}/giVersions/{gi_version}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "oracledatabase.googleapis.com/MinorVersion"
    }
  ];

  // Optional. The maximum number of items to return.
  // If unspecified, a maximum of 50 System Versions will be returned.
  // The maximum value is 1000; values above 1000 will be reset to 1000.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A token identifying the requested page of results to return. All
  // fields except the filter should remain the same as in the request that
  // provided this page token.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. An expression for filtering the results of the request.
  // Only shapeFamily and gcp_oracle_zone_id are supported in this format:
  // `shape_family="{shapeFamily}" AND
  // gcp_oracle_zone_id="{gcp_oracle_zone_id}"`.
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
}

// The response for `MinorVersion.List`.
message ListMinorVersionsResponse {
  // The list of MinorVersions.
  repeated MinorVersion minor_versions = 1;

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