syntax = "proto3";
package rafay.dev.types.system.v3;

import "proto/types/commonpb/v3/common.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "proto/types/userpb/v3/group.proto";
import "proto/types/userpb/v3/user.proto";
import "google/api/field_behavior.proto";

message ProjectSpec {
  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
    json_schema : {
      title : "Project Specification"
      description : "project specification"
    }
  };

  bool default = 1
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Default"
        description : "flag to indicate if this is the default project in the "
                      "organization"
      } ];
  repeated rafay.dev.types.user.v3.ProjectNamespaceRole projectNamespaceRoles = 2
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "ProjectNamespaceRoles"
        description : "Project, namespace, role associations with groups"
      } ];
  repeated rafay.dev.types.user.v3.UserRole userRoles = 3
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "UserRoles"
        description : "List of users with roles assigned to projects"
      } ];
}

message Project {
  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
    json_schema : {
      title : "Project"
      description : "Project"
      required : [ "apiVersion", "kind", "metadata", "spec" ]
    }
  };

  string apiVersion = 1
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "API Version",
        description : "API Version of the resource"
        default : "system.k8smgmt.io/v3"
        read_only : true
        
      } ];
  string kind = 2
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Kind",
        description : "Kind of the resource"
        default : "Project"
        read_only : true
      } ];
  rafay.dev.types.common.v3.Metadata metadata = 3
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Metadata",
        description : "Metadata of the resource"
      } ];
  ProjectSpec spec = 4
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Spec",
        description : "Spec of the resource"
      } ];
  rafay.dev.types.common.v3.Status status = 5
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Status",
        description : "Status of the resource"
        read_only : true
      } ];
}

message ProjectList {
  option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
    json_schema : {
      title : "ProjectList"
      description : "Project list"
    }
  };

  string apiVersion = 1
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "API Version",
        description : "API Version of the list resource"
        read_only : true
        default : "system.k8smgmt.io/v3"
      } ];
  string kind = 2
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Kind",
        description : "Kind of the list resource"
        read_only : true
        default : "Project"
      } ];
  rafay.dev.types.common.v3.ListMetadata metadata = 3
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "ListMetadata",
        description : "Metadata of the list resource"
        read_only : true
      } ];
  repeated Project items = 4
      [ (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
        title : "Items",
        description : "List of the resources"
        read_only : true
      } ];
}