// Project is fraser's per-customer isolation unit -- the IA-parity
// public surface for the existing `projects` and `project_members`
// tables that fraser's admin.v1 / Drizzle layer already owns.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        (unknown)
// source: tars/tenancy/v1/project.proto

package tenancyv1

import (
	_ "google.golang.org/genproto/googleapis/api/annotations"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// ProjectState mirrors CustomerState.
type ProjectState int32

const (
	ProjectState_PROJECT_STATE_UNSPECIFIED ProjectState = 0
	ProjectState_PROJECT_STATE_ACTIVE      ProjectState = 1
	ProjectState_PROJECT_STATE_ARCHIVED    ProjectState = 2
)

// Enum value maps for ProjectState.
var (
	ProjectState_name = map[int32]string{
		0: "PROJECT_STATE_UNSPECIFIED",
		1: "PROJECT_STATE_ACTIVE",
		2: "PROJECT_STATE_ARCHIVED",
	}
	ProjectState_value = map[string]int32{
		"PROJECT_STATE_UNSPECIFIED": 0,
		"PROJECT_STATE_ACTIVE":      1,
		"PROJECT_STATE_ARCHIVED":    2,
	}
)

func (x ProjectState) Enum() *ProjectState {
	p := new(ProjectState)
	*p = x
	return p
}

func (x ProjectState) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ProjectState) Descriptor() protoreflect.EnumDescriptor {
	return file_tars_tenancy_v1_project_proto_enumTypes[0].Descriptor()
}

func (ProjectState) Type() protoreflect.EnumType {
	return &file_tars_tenancy_v1_project_proto_enumTypes[0]
}

func (x ProjectState) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ProjectState.Descriptor instead.
func (ProjectState) EnumDescriptor() ([]byte, []int) {
	return file_tars_tenancy_v1_project_proto_rawDescGZIP(), []int{0}
}

// Project carries the per-customer isolation unit. The natural key is
// (customer_id, project_id); `id` is the server-assigned uuid row key.
type Project struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Server-assigned uuid row id. Output-only.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Owning customer slug. Immutable on update.
	CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	// Customer-scoped slug. Required on create; immutable thereafter.
	ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Human-friendly display name.
	DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// Freeform description.
	Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
	// Lifecycle state.
	State ProjectState `protobuf:"varint,6,opt,name=state,proto3,enum=tars.tenancy.v1.ProjectState" json:"state,omitempty"`
	// Freeform labels for filtering / grouping.
	Labels map[string]string `protobuf:"bytes,7,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
	// Row creation time. Output-only.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,50,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Last mutation time. Output-only.
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,51,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// Time the project was archived; unset while ACTIVE. Output-only.
	ArchivedAt    *timestamppb.Timestamp `protobuf:"bytes,52,opt,name=archived_at,json=archivedAt,proto3" json:"archived_at,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Project) Reset() {
	*x = Project{}
	mi := &file_tars_tenancy_v1_project_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Project) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Project) ProtoMessage() {}

func (x *Project) ProtoReflect() protoreflect.Message {
	mi := &file_tars_tenancy_v1_project_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Project.ProtoReflect.Descriptor instead.
func (*Project) Descriptor() ([]byte, []int) {
	return file_tars_tenancy_v1_project_proto_rawDescGZIP(), []int{0}
}

func (x *Project) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *Project) GetCustomerId() string {
	if x != nil {
		return x.CustomerId
	}
	return ""
}

func (x *Project) GetProjectId() string {
	if x != nil {
		return x.ProjectId
	}
	return ""
}

func (x *Project) GetDisplayName() string {
	if x != nil {
		return x.DisplayName
	}
	return ""
}

func (x *Project) GetDescription() string {
	if x != nil {
		return x.Description
	}
	return ""
}

func (x *Project) GetState() ProjectState {
	if x != nil {
		return x.State
	}
	return ProjectState_PROJECT_STATE_UNSPECIFIED
}

func (x *Project) GetLabels() map[string]string {
	if x != nil {
		return x.Labels
	}
	return nil
}

func (x *Project) GetCreatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.CreatedAt
	}
	return nil
}

func (x *Project) GetUpdatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.UpdatedAt
	}
	return nil
}

func (x *Project) GetArchivedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.ArchivedAt
	}
	return nil
}

// ProjectMember binds an Identity to a Project with a role. Fraser's
// underlying schema stores the identity as `user_id` (text) and the
// role as one of "admin" or "member"; the proto exposes those values
// as `identity_id` and a free-form role string to match IA's wire
// shape while remaining compatible with the existing `project_members`
// table.
type ProjectMember struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Server-assigned uuid row id. Output-only.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Owning customer slug.
	CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
	// Owning project slug.
	ProjectId string `protobuf:"bytes,3,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Identity row id (authn.user.id). Required on add.
	IdentityId string `protobuf:"bytes,4,opt,name=identity_id,json=identityId,proto3" json:"identity_id,omitempty"`
	// Role bundle. One of "admin", "member". Required on add / update.
	Role string `protobuf:"bytes,5,opt,name=role,proto3" json:"role,omitempty"`
	// Time the identity was added to the project. Output-only.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,50,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// Last time the membership (e.g. role) changed. Output-only.
	UpdatedAt     *timestamppb.Timestamp `protobuf:"bytes,51,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *ProjectMember) Reset() {
	*x = ProjectMember{}
	mi := &file_tars_tenancy_v1_project_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *ProjectMember) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*ProjectMember) ProtoMessage() {}

func (x *ProjectMember) ProtoReflect() protoreflect.Message {
	mi := &file_tars_tenancy_v1_project_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use ProjectMember.ProtoReflect.Descriptor instead.
func (*ProjectMember) Descriptor() ([]byte, []int) {
	return file_tars_tenancy_v1_project_proto_rawDescGZIP(), []int{1}
}

func (x *ProjectMember) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *ProjectMember) GetCustomerId() string {
	if x != nil {
		return x.CustomerId
	}
	return ""
}

func (x *ProjectMember) GetProjectId() string {
	if x != nil {
		return x.ProjectId
	}
	return ""
}

func (x *ProjectMember) GetIdentityId() string {
	if x != nil {
		return x.IdentityId
	}
	return ""
}

func (x *ProjectMember) GetRole() string {
	if x != nil {
		return x.Role
	}
	return ""
}

func (x *ProjectMember) GetCreatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.CreatedAt
	}
	return nil
}

func (x *ProjectMember) GetUpdatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.UpdatedAt
	}
	return nil
}

var File_tars_tenancy_v1_project_proto protoreflect.FileDescriptor

const file_tars_tenancy_v1_project_proto_rawDesc = "" +
	"\n" +
	"\x1dtars/tenancy/v1/project.proto\x12\x0ftars.tenancy.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa2\x04\n" +
	"\aProject\x12\x13\n" +
	"\x02id\x18\x01 \x01(\tB\x03\xe0A\x03R\x02id\x12$\n" +
	"\vcustomer_id\x18\x02 \x01(\tB\x03\xe0A\x02R\n" +
	"customerId\x12\"\n" +
	"\n" +
	"project_id\x18\x03 \x01(\tB\x03\xe0A\x02R\tprojectId\x12!\n" +
	"\fdisplay_name\x18\x04 \x01(\tR\vdisplayName\x12 \n" +
	"\vdescription\x18\x05 \x01(\tR\vdescription\x128\n" +
	"\x05state\x18\x06 \x01(\x0e2\x1d.tars.tenancy.v1.ProjectStateB\x03\xe0A\x03R\x05state\x12<\n" +
	"\x06labels\x18\a \x03(\v2$.tars.tenancy.v1.Project.LabelsEntryR\x06labels\x12>\n" +
	"\n" +
	"created_at\x182 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\tcreatedAt\x12>\n" +
	"\n" +
	"updated_at\x183 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\tupdatedAt\x12@\n" +
	"\varchived_at\x184 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\n" +
	"archivedAt\x1a9\n" +
	"\vLabelsEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xad\x02\n" +
	"\rProjectMember\x12\x13\n" +
	"\x02id\x18\x01 \x01(\tB\x03\xe0A\x03R\x02id\x12$\n" +
	"\vcustomer_id\x18\x02 \x01(\tB\x03\xe0A\x03R\n" +
	"customerId\x12\"\n" +
	"\n" +
	"project_id\x18\x03 \x01(\tB\x03\xe0A\x03R\tprojectId\x12$\n" +
	"\videntity_id\x18\x04 \x01(\tB\x03\xe0A\x02R\n" +
	"identityId\x12\x17\n" +
	"\x04role\x18\x05 \x01(\tB\x03\xe0A\x02R\x04role\x12>\n" +
	"\n" +
	"created_at\x182 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\tcreatedAt\x12>\n" +
	"\n" +
	"updated_at\x183 \x01(\v2\x1a.google.protobuf.TimestampB\x03\xe0A\x03R\tupdatedAt*c\n" +
	"\fProjectState\x12\x1d\n" +
	"\x19PROJECT_STATE_UNSPECIFIED\x10\x00\x12\x18\n" +
	"\x14PROJECT_STATE_ACTIVE\x10\x01\x12\x1a\n" +
	"\x16PROJECT_STATE_ARCHIVED\x10\x02B\xbc\x01\n" +
	"\x13com.tars.tenancy.v1B\fProjectProtoP\x01Z9github.com/tetrateio/fraser/api/tars/tenancy/v1;tenancyv1\xa2\x02\x03TTX\xaa\x02\x0fTars.Tenancy.V1\xca\x02\x0fTars\\Tenancy\\V1\xe2\x02\x1bTars\\Tenancy\\V1\\GPBMetadata\xea\x02\x11Tars::Tenancy::V1b\x06proto3"

var (
	file_tars_tenancy_v1_project_proto_rawDescOnce sync.Once
	file_tars_tenancy_v1_project_proto_rawDescData []byte
)

func file_tars_tenancy_v1_project_proto_rawDescGZIP() []byte {
	file_tars_tenancy_v1_project_proto_rawDescOnce.Do(func() {
		file_tars_tenancy_v1_project_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tars_tenancy_v1_project_proto_rawDesc), len(file_tars_tenancy_v1_project_proto_rawDesc)))
	})
	return file_tars_tenancy_v1_project_proto_rawDescData
}

var file_tars_tenancy_v1_project_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tars_tenancy_v1_project_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_tars_tenancy_v1_project_proto_goTypes = []any{
	(ProjectState)(0),             // 0: tars.tenancy.v1.ProjectState
	(*Project)(nil),               // 1: tars.tenancy.v1.Project
	(*ProjectMember)(nil),         // 2: tars.tenancy.v1.ProjectMember
	nil,                           // 3: tars.tenancy.v1.Project.LabelsEntry
	(*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp
}
var file_tars_tenancy_v1_project_proto_depIdxs = []int32{
	0, // 0: tars.tenancy.v1.Project.state:type_name -> tars.tenancy.v1.ProjectState
	3, // 1: tars.tenancy.v1.Project.labels:type_name -> tars.tenancy.v1.Project.LabelsEntry
	4, // 2: tars.tenancy.v1.Project.created_at:type_name -> google.protobuf.Timestamp
	4, // 3: tars.tenancy.v1.Project.updated_at:type_name -> google.protobuf.Timestamp
	4, // 4: tars.tenancy.v1.Project.archived_at:type_name -> google.protobuf.Timestamp
	4, // 5: tars.tenancy.v1.ProjectMember.created_at:type_name -> google.protobuf.Timestamp
	4, // 6: tars.tenancy.v1.ProjectMember.updated_at:type_name -> google.protobuf.Timestamp
	7, // [7:7] is the sub-list for method output_type
	7, // [7:7] is the sub-list for method input_type
	7, // [7:7] is the sub-list for extension type_name
	7, // [7:7] is the sub-list for extension extendee
	0, // [0:7] is the sub-list for field type_name
}

func init() { file_tars_tenancy_v1_project_proto_init() }
func file_tars_tenancy_v1_project_proto_init() {
	if File_tars_tenancy_v1_project_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_tars_tenancy_v1_project_proto_rawDesc), len(file_tars_tenancy_v1_project_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_tars_tenancy_v1_project_proto_goTypes,
		DependencyIndexes: file_tars_tenancy_v1_project_proto_depIdxs,
		EnumInfos:         file_tars_tenancy_v1_project_proto_enumTypes,
		MessageInfos:      file_tars_tenancy_v1_project_proto_msgTypes,
	}.Build()
	File_tars_tenancy_v1_project_proto = out.File
	file_tars_tenancy_v1_project_proto_goTypes = nil
	file_tars_tenancy_v1_project_proto_depIdxs = nil
}
