syntax = "proto3";

package protoc_gen_crd;

import "google/protobuf/descriptor.proto";

option go_package = "a.yandex-team.ru/library/go/k8s/protoc_gen_crd/proto;crd";
option java_multiple_files = true;
option java_outer_classname = "CRD";
option java_package = "library.go.k8s.protoc_gen_crd.proto";

enum ColumnType {
    // Unspecified column type
    CT_NONE = 0;
    // Non-floating-point numbers
    CT_INTEGER = 1;
    // Floating point numbers
    CT_NUMBER = 2;
    // Strings
    CT_STRING = 3;
    // true or false
    CT_BOOLEAN = 4;
    // Rendered differentially as time since this timestamp
    CT_DATE = 5;
}

enum ColumnFormat {
    // Unspecified column format
    CF_NONE = 0;
    CF_INT32 = 1;
    CF_INT64 = 2;
    CF_FLOAT = 3;
    CF_DOUBLE = 4;
    CF_BYTE = 5;
    CF_DATE = 6;
    CF_DATETIME = 7;
    CF_PASSWORD = 8;
}

message PrinterColumn {
    string name = 1;
    ColumnType type = 2;
    ColumnFormat format = 3;
    string description = 4;
    string json_path = 5;
    int32 priority = 6;
}

message K8sCRD {
    string api_group = 1;
    string kind = 2;
    string singular = 3;
    string plural = 4;
    repeated string short_names = 5;
    // list of grouped resources the custom resource belongs to
    repeated string categories = 6;
    // additional columns available in kubectl get
    repeated PrinterColumn additional_columns = 7;
}

message K8sPatch {
    string merge_key = 1;
    string merge_strategy = 2;
}

extend google.protobuf.MessageOptions {
    K8sCRD k8s_crd = 73394821;
}

extend google.protobuf.FieldOptions {
    K8sPatch k8s_patch = 73394822;
}
