// Copyright 2021 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.aiplatform.v1beta1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/aiplatform/v1beta1/encryption_spec.proto";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform";
option java_multiple_files = true;
option java_outer_classname = "FeaturestoreProto";
option java_package = "com.google.cloud.aiplatform.v1beta1";
option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
option ruby_package = "Google::Cloud::AIPlatform::V1beta1";

// Featurestore configuration information on how the Featurestore is configured.
message Featurestore {
  option (google.api.resource) = {
    type: "aiplatform.googleapis.com/Featurestore"
    pattern: "projects/{project}/locations/{location}/featurestores/{featurestore}"
  };

  // OnlineServingConfig specifies the details for provisioning online serving
  // resources.
  message OnlineServingConfig {
    // Required. The number of nodes for each cluster. The number of nodes will not
    // scale automatically but can be scaled manually by providing different
    // values when updating.
    int32 fixed_node_count = 2 [(google.api.field_behavior) = REQUIRED];
  }

  // Possible states a Featurestore can have.
  enum State {
    // Default value. This value is unused.
    STATE_UNSPECIFIED = 0;

    // State when the Featurestore configuration is not being updated and the
    // fields reflect the current configuration of the Featurestore. The
    // Featurestore is usable in this state.
    STABLE = 1;

    // State when the Featurestore configuration is being updated and the fields
    // reflect the updated configuration of the Featurestore, not the current
    // one. For example, `online_serving_config.fixed_node_count` can take
    // minutes to update. While the update is in progress, the Featurestore
    // will be in the UPDATING state and the value of `fixed_node_count` will be
    // the updated value. Until the update completes, the actual number of nodes
    // can still be the original value of `fixed_node_count`. The Featurestore
    // is still usable in this state.
    UPDATING = 2;
  }

  // Output only. Name of the Featurestore. Format:
  // `projects/{project}/locations/{location}/featurestores/{featurestore}`
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp when this Featurestore was created.
  google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Timestamp when this Featurestore was last updated.
  google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. Used to perform consistent read-modify-write updates. If not set, a blind
  // "overwrite" update happens.
  string etag = 5 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The labels with user-defined metadata to organize your Featurestore.
  //
  // Label keys and values can be no longer than 64 characters
  // (Unicode codepoints), can only contain lowercase letters, numeric
  // characters, underscores and dashes. International characters are allowed.
  //
  // See https://goo.gl/xmQnxf for more information on and examples of labels.
  // No more than 64 user labels can be associated with one Featurestore(System
  // labels are excluded)."
  // System reserved label keys are prefixed with "aiplatform.googleapis.com/"
  // and are immutable.
  map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL];

  // Required. Config for online serving resources.
  OnlineServingConfig online_serving_config = 7 [(google.api.field_behavior) = REQUIRED];

  // Output only. State of the featurestore.
  State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}
