syntax = "proto3";

package yandex.cloud.serverless.apigateway.v1;

import "google/protobuf/timestamp.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/serverless/apigateway/v1;apigateway";
option java_package = "yandex.cloud.api.serverless.apigateway.v1";

message ApiGateway {
  enum Status {
    STATUS_UNSPECIFIED = 0;

    // API gateway is being created.
    CREATING = 1;

    // API gateway is ready for use.
    ACTIVE = 2;

    // API gateway is being deleted.
    DELETING = 3;

    // API gateway failed. The only allowed action is delete.
    ERROR = 4;

    // API gateway is being updated.
    UPDATING = 5;
  }

  // ID of the API gateway. Generated at creation time.
  string id = 1;

  // ID of the folder that the API gateway belongs to.
  string folder_id = 2;

  // Creation timestamp for the API-gateway.
  google.protobuf.Timestamp created_at = 3;

  // Name of the API gateway. The name is unique within the folder.
  string name = 4;

  // Description of the API gateway.
  string description = 5;

  // API gateway labels as `key:value` pairs.
  map<string, string> labels = 7;

  // Status of the API gateway.
  Status status = 8;

  // Default domain for the API gateway. Generated at creation time.
  string domain = 9;

  // ID of the log group for the API gateway.
  string log_group_id = 10;

  // List of domains attached to API gateway.
  repeated AttachedDomain attached_domains = 11;
}

message AttachedDomain {
  // ID of the domain.
  string domain_id = 1;
  // ID of the domain certificate.
  string certificate_id = 2;
  // Enabling flag.
  bool enabled = 3;
  // Name of the domain.
  string domain = 5;
}
