From d392e43ebb9769c3e914d5e2e25494153f2fee17 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sat, 26 Jul 2025 14:28:26 +0200 Subject: [PATCH 1/4] Add more properties to tenant --- api/v1/project.pb.go | 122 ++++------- api/v1/quota.pb.go | 38 +--- api/v1/tenant.pb.go | 442 ++++++++++++++++++++++++++++++--------- pkg/datastore/migrate.go | 10 +- pkg/service/project.go | 14 -- pkg/service/tenant.go | 8 - proto/Makefile | 2 +- proto/v1/project.proto | 8 +- proto/v1/quota.proto | 6 +- proto/v1/tenant.proto | 37 +++- 10 files changed, 431 insertions(+), 256 deletions(-) diff --git a/api/v1/project.pb.go b/api/v1/project.pb.go index ac6618b..cdd2537 100644 --- a/api/v1/project.pb.go +++ b/api/v1/project.pb.go @@ -10,7 +10,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -329,25 +328,15 @@ func (x *ProjectGetHistoryRequest) GetAt() *timestamppb.Timestamp { } type ProjectFindRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // TODO: remove in next release: - // - // Deprecated: Marked as deprecated in v1/project.proto. - DeprecatedId *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=deprecated_id,json=deprecatedId,proto3" json:"deprecated_id,omitempty"` - // Deprecated: Marked as deprecated in v1/project.proto. - DeprecatedName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=deprecated_name,json=deprecatedName,proto3" json:"deprecated_name,omitempty"` - // Deprecated: Marked as deprecated in v1/project.proto. - DeprecatedDescription *wrapperspb.StringValue `protobuf:"bytes,3,opt,name=deprecated_description,json=deprecatedDescription,proto3" json:"deprecated_description,omitempty"` - // Deprecated: Marked as deprecated in v1/project.proto. - DeprecatedTenantId *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=deprecated_tenant_id,json=deprecatedTenantId,proto3" json:"deprecated_tenant_id,omitempty"` - Paging *Paging `protobuf:"bytes,5,opt,name=paging,proto3" json:"paging,omitempty"` - Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Id *string `protobuf:"bytes,7,opt,name=id,proto3,oneof" json:"id,omitempty"` - Name *string `protobuf:"bytes,8,opt,name=name,proto3,oneof" json:"name,omitempty"` - Description *string `protobuf:"bytes,9,opt,name=description,proto3,oneof" json:"description,omitempty"` - TenantId *string `protobuf:"bytes,10,opt,name=tenant_id,json=tenantId,proto3,oneof" json:"tenant_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Paging *Paging `protobuf:"bytes,5,opt,name=paging,proto3" json:"paging,omitempty"` + Annotations map[string]string `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Id *string `protobuf:"bytes,7,opt,name=id,proto3,oneof" json:"id,omitempty"` + Name *string `protobuf:"bytes,8,opt,name=name,proto3,oneof" json:"name,omitempty"` + Description *string `protobuf:"bytes,9,opt,name=description,proto3,oneof" json:"description,omitempty"` + TenantId *string `protobuf:"bytes,10,opt,name=tenant_id,json=tenantId,proto3,oneof" json:"tenant_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ProjectFindRequest) Reset() { @@ -380,38 +369,6 @@ func (*ProjectFindRequest) Descriptor() ([]byte, []int) { return file_v1_project_proto_rawDescGZIP(), []int{6} } -// Deprecated: Marked as deprecated in v1/project.proto. -func (x *ProjectFindRequest) GetDeprecatedId() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedId - } - return nil -} - -// Deprecated: Marked as deprecated in v1/project.proto. -func (x *ProjectFindRequest) GetDeprecatedName() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedName - } - return nil -} - -// Deprecated: Marked as deprecated in v1/project.proto. -func (x *ProjectFindRequest) GetDeprecatedDescription() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedDescription - } - return nil -} - -// Deprecated: Marked as deprecated in v1/project.proto. -func (x *ProjectFindRequest) GetDeprecatedTenantId() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedTenantId - } - return nil -} - func (x *ProjectFindRequest) GetPaging() *Paging { if x != nil { return x.Paging @@ -555,7 +512,7 @@ var File_v1_project_proto protoreflect.FileDescriptor const file_v1_project_proto_rawDesc = "" + "\n" + - "\x10v1/project.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x0fv1/common.proto\x1a\rv1/meta.proto\x1a\x0ev1/quota.proto\"\xa0\x01\n" + + "\x10v1/project.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0fv1/common.proto\x1a\rv1/meta.proto\x1a\x0ev1/quota.proto\"\xa0\x01\n" + "\aProject\x12\x1c\n" + "\x04meta\x18\x01 \x01(\v2\b.v1.MetaR\x04meta\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + @@ -572,12 +529,8 @@ const file_v1_project_proto_rawDesc = "" + "\x02id\x18\x01 \x01(\tR\x02id\"V\n" + "\x18ProjectGetHistoryRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12*\n" + - "\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\"\xa7\x05\n" + - "\x12ProjectFindRequest\x12E\n" + - "\rdeprecated_id\x18\x01 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\fdeprecatedId\x12I\n" + - "\x0fdeprecated_name\x18\x02 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\x0edeprecatedName\x12W\n" + - "\x16deprecated_description\x18\x03 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\x15deprecatedDescription\x12R\n" + - "\x14deprecated_tenant_id\x18\x04 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\x12deprecatedTenantId\x12\"\n" + + "\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\"\xce\x03\n" + + "\x12ProjectFindRequest\x12\"\n" + "\x06paging\x18\x05 \x01(\v2\n" + ".v1.PagingR\x06paging\x12I\n" + "\vannotations\x18\x06 \x03(\v2'.v1.ProjectFindRequest.AnnotationsEntryR\vannotations\x12\x13\n" + @@ -593,7 +546,7 @@ const file_v1_project_proto_rawDesc = "" + "\x05_nameB\x0e\n" + "\f_descriptionB\f\n" + "\n" + - "_tenant_id\"8\n" + + "_tenant_idJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05R\rdeprecated_idR\x0fdeprecated_nameR\x16deprecated_descriptionR\x14deprecated_tenant_id\"8\n" + "\x0fProjectResponse\x12%\n" + "\aproject\x18\x01 \x01(\v2\v.v1.ProjectR\aproject\"n\n" + "\x13ProjectListResponse\x12'\n" + @@ -638,8 +591,7 @@ var file_v1_project_proto_goTypes = []any{ (*Meta)(nil), // 10: v1.Meta (*QuotaSet)(nil), // 11: v1.QuotaSet (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (*wrapperspb.StringValue)(nil), // 13: google.protobuf.StringValue - (*Paging)(nil), // 14: v1.Paging + (*Paging)(nil), // 13: v1.Paging } var file_v1_project_proto_depIdxs = []int32{ 10, // 0: v1.Project.meta:type_name -> v1.Meta @@ -647,31 +599,27 @@ var file_v1_project_proto_depIdxs = []int32{ 0, // 2: v1.ProjectCreateRequest.project:type_name -> v1.Project 0, // 3: v1.ProjectUpdateRequest.project:type_name -> v1.Project 12, // 4: v1.ProjectGetHistoryRequest.at:type_name -> google.protobuf.Timestamp - 13, // 5: v1.ProjectFindRequest.deprecated_id:type_name -> google.protobuf.StringValue - 13, // 6: v1.ProjectFindRequest.deprecated_name:type_name -> google.protobuf.StringValue - 13, // 7: v1.ProjectFindRequest.deprecated_description:type_name -> google.protobuf.StringValue - 13, // 8: v1.ProjectFindRequest.deprecated_tenant_id:type_name -> google.protobuf.StringValue - 14, // 9: v1.ProjectFindRequest.paging:type_name -> v1.Paging - 9, // 10: v1.ProjectFindRequest.annotations:type_name -> v1.ProjectFindRequest.AnnotationsEntry - 0, // 11: v1.ProjectResponse.project:type_name -> v1.Project - 0, // 12: v1.ProjectListResponse.projects:type_name -> v1.Project - 1, // 13: v1.ProjectService.Create:input_type -> v1.ProjectCreateRequest - 2, // 14: v1.ProjectService.Update:input_type -> v1.ProjectUpdateRequest - 3, // 15: v1.ProjectService.Delete:input_type -> v1.ProjectDeleteRequest - 4, // 16: v1.ProjectService.Get:input_type -> v1.ProjectGetRequest - 5, // 17: v1.ProjectService.GetHistory:input_type -> v1.ProjectGetHistoryRequest - 6, // 18: v1.ProjectService.Find:input_type -> v1.ProjectFindRequest - 7, // 19: v1.ProjectService.Create:output_type -> v1.ProjectResponse - 7, // 20: v1.ProjectService.Update:output_type -> v1.ProjectResponse - 7, // 21: v1.ProjectService.Delete:output_type -> v1.ProjectResponse - 7, // 22: v1.ProjectService.Get:output_type -> v1.ProjectResponse - 7, // 23: v1.ProjectService.GetHistory:output_type -> v1.ProjectResponse - 8, // 24: v1.ProjectService.Find:output_type -> v1.ProjectListResponse - 19, // [19:25] is the sub-list for method output_type - 13, // [13:19] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 13, // 5: v1.ProjectFindRequest.paging:type_name -> v1.Paging + 9, // 6: v1.ProjectFindRequest.annotations:type_name -> v1.ProjectFindRequest.AnnotationsEntry + 0, // 7: v1.ProjectResponse.project:type_name -> v1.Project + 0, // 8: v1.ProjectListResponse.projects:type_name -> v1.Project + 1, // 9: v1.ProjectService.Create:input_type -> v1.ProjectCreateRequest + 2, // 10: v1.ProjectService.Update:input_type -> v1.ProjectUpdateRequest + 3, // 11: v1.ProjectService.Delete:input_type -> v1.ProjectDeleteRequest + 4, // 12: v1.ProjectService.Get:input_type -> v1.ProjectGetRequest + 5, // 13: v1.ProjectService.GetHistory:input_type -> v1.ProjectGetHistoryRequest + 6, // 14: v1.ProjectService.Find:input_type -> v1.ProjectFindRequest + 7, // 15: v1.ProjectService.Create:output_type -> v1.ProjectResponse + 7, // 16: v1.ProjectService.Update:output_type -> v1.ProjectResponse + 7, // 17: v1.ProjectService.Delete:output_type -> v1.ProjectResponse + 7, // 18: v1.ProjectService.Get:output_type -> v1.ProjectResponse + 7, // 19: v1.ProjectService.GetHistory:output_type -> v1.ProjectResponse + 8, // 20: v1.ProjectService.Find:output_type -> v1.ProjectListResponse + 15, // [15:21] is the sub-list for method output_type + 9, // [9:15] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_v1_project_proto_init() } diff --git a/api/v1/quota.pb.go b/api/v1/quota.pb.go index 90da3ed..2b06668 100644 --- a/api/v1/quota.pb.go +++ b/api/v1/quota.pb.go @@ -9,7 +9,6 @@ package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -101,10 +100,6 @@ func (x *QuotaSet) GetProject() *Quota { // Quota is the actual maximum amount type Quota struct { state protoimpl.MessageState `protogen:"open.v1"` - // TODO: remove in next release: - // - // Deprecated: Marked as deprecated in v1/quota.proto. - Quota *wrapperspb.Int32Value `protobuf:"bytes,1,opt,name=quota,proto3" json:"quota,omitempty"` // max is the maximum amount for the current QuotaSet, can be nil Max *int32 `protobuf:"varint,2,opt,name=max,proto3,oneof" json:"max,omitempty"` unknownFields protoimpl.UnknownFields @@ -141,14 +136,6 @@ func (*Quota) Descriptor() ([]byte, []int) { return file_v1_quota_proto_rawDescGZIP(), []int{1} } -// Deprecated: Marked as deprecated in v1/quota.proto. -func (x *Quota) GetQuota() *wrapperspb.Int32Value { - if x != nil { - return x.Quota - } - return nil -} - func (x *Quota) GetMax() int32 { if x != nil && x.Max != nil { return *x.Max @@ -160,16 +147,15 @@ var File_v1_quota_proto protoreflect.FileDescriptor const file_v1_quota_proto_rawDesc = "" + "\n" + - "\x0ev1/quota.proto\x12\x02v1\x1a\x1egoogle/protobuf/wrappers.proto\"\x94\x01\n" + + "\x0ev1/quota.proto\x12\x02v1\"\x94\x01\n" + "\bQuotaSet\x12#\n" + "\acluster\x18\x01 \x01(\v2\t.v1.QuotaR\acluster\x12#\n" + "\amachine\x18\x02 \x01(\v2\t.v1.QuotaR\amachine\x12\x19\n" + "\x02ip\x18\x03 \x01(\v2\t.v1.QuotaR\x02ip\x12#\n" + - "\aproject\x18\x04 \x01(\v2\t.v1.QuotaR\aproject\"]\n" + - "\x05Quota\x125\n" + - "\x05quota\x18\x01 \x01(\v2\x1b.google.protobuf.Int32ValueB\x02\x18\x01R\x05quota\x12\x15\n" + + "\aproject\x18\x04 \x01(\v2\t.v1.QuotaR\aproject\"3\n" + + "\x05Quota\x12\x15\n" + "\x03max\x18\x02 \x01(\x05H\x00R\x03max\x88\x01\x01B\x06\n" + - "\x04_maxBf\n" + + "\x04_maxJ\x04\b\x01\x10\x02R\x05quotaBf\n" + "\x06com.v1B\n" + "QuotaProtoP\x01Z(github.com/metal-stack/masterdata-api/v1\xa2\x02\x03VXX\xaa\x02\x02V1\xca\x02\x02V1\xe2\x02\x0eV1\\GPBMetadata\xea\x02\x02V1b\x06proto3" @@ -187,21 +173,19 @@ func file_v1_quota_proto_rawDescGZIP() []byte { var file_v1_quota_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_v1_quota_proto_goTypes = []any{ - (*QuotaSet)(nil), // 0: v1.QuotaSet - (*Quota)(nil), // 1: v1.Quota - (*wrapperspb.Int32Value)(nil), // 2: google.protobuf.Int32Value + (*QuotaSet)(nil), // 0: v1.QuotaSet + (*Quota)(nil), // 1: v1.Quota } var file_v1_quota_proto_depIdxs = []int32{ 1, // 0: v1.QuotaSet.cluster:type_name -> v1.Quota 1, // 1: v1.QuotaSet.machine:type_name -> v1.Quota 1, // 2: v1.QuotaSet.ip:type_name -> v1.Quota 1, // 3: v1.QuotaSet.project:type_name -> v1.Quota - 2, // 4: v1.Quota.quota:type_name -> google.protobuf.Int32Value - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_v1_quota_proto_init() } diff --git a/api/v1/tenant.pb.go b/api/v1/tenant.pb.go index be70c3d..8fdb9cd 100644 --- a/api/v1/tenant.pb.go +++ b/api/v1/tenant.pb.go @@ -10,7 +10,6 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" - wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -441,15 +440,17 @@ func (x *TenantWithMembershipAnnotations) GetProjectIds() []string { } type Tenant struct { - state protoimpl.MessageState `protogen:"open.v1"` - Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - DefaultQuotas *QuotaSet `protobuf:"bytes,4,opt,name=default_quotas,json=defaultQuotas,proto3" json:"default_quotas,omitempty"` - Quotas *QuotaSet `protobuf:"bytes,5,opt,name=quotas,proto3" json:"quotas,omitempty"` - IamConfig *IAMConfig `protobuf:"bytes,6,opt,name=iam_config,json=iamConfig,proto3" json:"iam_config,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Meta *Meta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + DefaultQuotas *QuotaSet `protobuf:"bytes,4,opt,name=default_quotas,json=defaultQuotas,proto3" json:"default_quotas,omitempty"` + Quotas *QuotaSet `protobuf:"bytes,5,opt,name=quotas,proto3" json:"quotas,omitempty"` + IamConfig *IAMConfig `protobuf:"bytes,6,opt,name=iam_config,json=iamConfig,proto3" json:"iam_config,omitempty"` + Payment *PaymentDetails `protobuf:"bytes,7,opt,name=payment,proto3" json:"payment,omitempty"` + ContactDetails *ContactDetails `protobuf:"bytes,8,opt,name=contact_details,json=contactDetails,proto3" json:"contact_details,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Tenant) Reset() { @@ -524,6 +525,20 @@ func (x *Tenant) GetIamConfig() *IAMConfig { return nil } +func (x *Tenant) GetPayment() *PaymentDetails { + if x != nil { + return x.Payment + } + return nil +} + +func (x *Tenant) GetContactDetails() *ContactDetails { + if x != nil { + return x.ContactDetails + } + return nil +} + type TenantCreateRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Tenant *Tenant `protobuf:"bytes,1,opt,name=tenant,proto3" json:"tenant,omitempty"` @@ -753,19 +768,13 @@ func (x *TenantGetHistoryRequest) GetAt() *timestamppb.Timestamp { } type TenantFindRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // TODO: remove in next release: - // - // Deprecated: Marked as deprecated in v1/tenant.proto. - DeprecatedId *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=deprecated_id,json=deprecatedId,proto3" json:"deprecated_id,omitempty"` - // Deprecated: Marked as deprecated in v1/tenant.proto. - DeprecatedName *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=deprecated_name,json=deprecatedName,proto3" json:"deprecated_name,omitempty"` - Paging *Paging `protobuf:"bytes,3,opt,name=paging,proto3" json:"paging,omitempty"` - Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Id *string `protobuf:"bytes,5,opt,name=id,proto3,oneof" json:"id,omitempty"` - Name *string `protobuf:"bytes,6,opt,name=name,proto3,oneof" json:"name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Paging *Paging `protobuf:"bytes,3,opt,name=paging,proto3" json:"paging,omitempty"` + Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Id *string `protobuf:"bytes,5,opt,name=id,proto3,oneof" json:"id,omitempty"` + Name *string `protobuf:"bytes,6,opt,name=name,proto3,oneof" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TenantFindRequest) Reset() { @@ -798,22 +807,6 @@ func (*TenantFindRequest) Descriptor() ([]byte, []int) { return file_v1_tenant_proto_rawDescGZIP(), []int{14} } -// Deprecated: Marked as deprecated in v1/tenant.proto. -func (x *TenantFindRequest) GetDeprecatedId() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedId - } - return nil -} - -// Deprecated: Marked as deprecated in v1/tenant.proto. -func (x *TenantFindRequest) GetDeprecatedName() *wrapperspb.StringValue { - if x != nil { - return x.DeprecatedName - } - return nil -} - func (x *TenantFindRequest) GetPaging() *Paging { if x != nil { return x.Paging @@ -939,11 +932,223 @@ func (x *TenantListResponse) GetNextPage() uint64 { return 0 } +// PaymentDetails describe payment specific configurations of a tenant +type PaymentDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Details stored as key value pairs + Details map[string]string `protobuf:"bytes,1,rep,name=details,proto3" json:"details,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Annotations of this payment details + Annotations map[string]string `protobuf:"bytes,2,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Labels of this payment details + Labels []string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PaymentDetails) Reset() { + *x = PaymentDetails{} + mi := &file_v1_tenant_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PaymentDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentDetails) ProtoMessage() {} + +func (x *PaymentDetails) ProtoReflect() protoreflect.Message { + mi := &file_v1_tenant_proto_msgTypes[17] + 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 PaymentDetails.ProtoReflect.Descriptor instead. +func (*PaymentDetails) Descriptor() ([]byte, []int) { + return file_v1_tenant_proto_rawDescGZIP(), []int{17} +} + +func (x *PaymentDetails) GetDetails() map[string]string { + if x != nil { + return x.Details + } + return nil +} + +func (x *PaymentDetails) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *PaymentDetails) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} + +// ContactDetails contain more properties of a tenant +type ContactDetails struct { + state protoimpl.MessageState `protogen:"open.v1"` + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + PhoneNumber string `protobuf:"bytes,2,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` + Address *Address `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + // Annotations of this payment details + Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + // Labels of this payment details + Labels []string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContactDetails) Reset() { + *x = ContactDetails{} + mi := &file_v1_tenant_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContactDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactDetails) ProtoMessage() {} + +func (x *ContactDetails) ProtoReflect() protoreflect.Message { + mi := &file_v1_tenant_proto_msgTypes[18] + 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 ContactDetails.ProtoReflect.Descriptor instead. +func (*ContactDetails) Descriptor() ([]byte, []int) { + return file_v1_tenant_proto_rawDescGZIP(), []int{18} +} + +func (x *ContactDetails) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *ContactDetails) GetPhoneNumber() string { + if x != nil { + return x.PhoneNumber + } + return "" +} + +func (x *ContactDetails) GetAddress() *Address { + if x != nil { + return x.Address + } + return nil +} + +func (x *ContactDetails) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *ContactDetails) GetAnnotations() map[string]string { + if x != nil { + return x.Annotations + } + return nil +} + +func (x *ContactDetails) GetLabels() []string { + if x != nil { + return x.Labels + } + return nil +} + +// Address is the postal address +type Address struct { + state protoimpl.MessageState `protogen:"open.v1"` + AddressLines []string `protobuf:"bytes,1,rep,name=address_lines,json=addressLines,proto3" json:"address_lines,omitempty"` + PostalCode string `protobuf:"bytes,2,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` + Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Address) Reset() { + *x = Address{} + mi := &file_v1_tenant_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Address) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Address) ProtoMessage() {} + +func (x *Address) ProtoReflect() protoreflect.Message { + mi := &file_v1_tenant_proto_msgTypes[19] + 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 Address.ProtoReflect.Descriptor instead. +func (*Address) Descriptor() ([]byte, []int) { + return file_v1_tenant_proto_rawDescGZIP(), []int{19} +} + +func (x *Address) GetAddressLines() []string { + if x != nil { + return x.AddressLines + } + return nil +} + +func (x *Address) GetPostalCode() string { + if x != nil { + return x.PostalCode + } + return "" +} + +func (x *Address) GetCountry() string { + if x != nil { + return x.Country + } + return "" +} + var File_v1_tenant_proto protoreflect.FileDescriptor const file_v1_tenant_proto_rawDesc = "" + "\n" + - "\x0fv1/tenant.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x0fv1/common.proto\x1a\fv1/iam.proto\x1a\rv1/meta.proto\x1a\x10v1/project.proto\x1a\x0ev1/quota.proto\"\x87\x01\n" + + "\x0fv1/tenant.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0fv1/common.proto\x1a\fv1/iam.proto\x1a\rv1/meta.proto\x1a\x10v1/project.proto\x1a\x0ev1/quota.proto\"\x87\x01\n" + " FindParticipatingProjectsRequest\x12\x1b\n" + "\ttenant_id\x18\x01 \x01(\tR\btenantId\x120\n" + "\x11include_inherited\x18\x02 \x01(\bH\x00R\x10includeInherited\x88\x01\x01B\x14\n" + @@ -984,7 +1189,7 @@ const file_v1_tenant_proto_rawDesc = "" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aD\n" + "\x16TenantAnnotationsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xe5\x01\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xd0\x02\n" + "\x06Tenant\x12\x1c\n" + "\x04meta\x18\x01 \x01(\v2\b.v1.MetaR\x04meta\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + @@ -992,7 +1197,9 @@ const file_v1_tenant_proto_rawDesc = "" + "\x0edefault_quotas\x18\x04 \x01(\v2\f.v1.QuotaSetR\rdefaultQuotas\x12$\n" + "\x06quotas\x18\x05 \x01(\v2\f.v1.QuotaSetR\x06quotas\x12,\n" + "\n" + - "iam_config\x18\x06 \x01(\v2\r.v1.IAMConfigR\tiamConfig\"9\n" + + "iam_config\x18\x06 \x01(\v2\r.v1.IAMConfigR\tiamConfig\x12,\n" + + "\apayment\x18\a \x01(\v2\x12.v1.PaymentDetailsR\apayment\x12;\n" + + "\x0fcontact_details\x18\b \x01(\v2\x12.v1.ContactDetailsR\x0econtactDetails\"9\n" + "\x13TenantCreateRequest\x12\"\n" + "\x06tenant\x18\x01 \x01(\v2\n" + ".v1.TenantR\x06tenant\"9\n" + @@ -1005,10 +1212,8 @@ const file_v1_tenant_proto_rawDesc = "" + "\x02id\x18\x01 \x01(\tR\x02id\"U\n" + "\x17TenantGetHistoryRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12*\n" + - "\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\"\x91\x03\n" + - "\x11TenantFindRequest\x12E\n" + - "\rdeprecated_id\x18\x01 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\fdeprecatedId\x12I\n" + - "\x0fdeprecated_name\x18\x02 \x01(\v2\x1c.google.protobuf.StringValueB\x02\x18\x01R\x0edeprecatedName\x12\"\n" + + "\x02at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x02at\"\xab\x02\n" + + "\x11TenantFindRequest\x12\"\n" + "\x06paging\x18\x03 \x01(\v2\n" + ".v1.PagingR\x06paging\x12H\n" + "\vannotations\x18\x04 \x03(\v2&.v1.TenantFindRequest.AnnotationsEntryR\vannotations\x12\x13\n" + @@ -1018,7 +1223,7 @@ const file_v1_tenant_proto_rawDesc = "" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\x05\n" + "\x03_idB\a\n" + - "\x05_name\"4\n" + + "\x05_nameJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03R\rdeprecated_idR\x0fdeprecated_name\"4\n" + "\x0eTenantResponse\x12\"\n" + "\x06tenant\x18\x01 \x01(\v2\n" + ".v1.TenantR\x06tenant\"j\n" + @@ -1027,7 +1232,33 @@ const file_v1_tenant_proto_rawDesc = "" + ".v1.TenantR\atenants\x12 \n" + "\tnext_page\x18\x02 \x01(\x04H\x00R\bnextPage\x88\x01\x01B\f\n" + "\n" + - "_next_page2\xfe\x04\n" + + "_next_page\"\xa6\x02\n" + + "\x0ePaymentDetails\x129\n" + + "\adetails\x18\x01 \x03(\v2\x1f.v1.PaymentDetails.DetailsEntryR\adetails\x12E\n" + + "\vannotations\x18\x02 \x03(\v2#.v1.PaymentDetails.AnnotationsEntryR\vannotations\x12\x16\n" + + "\x06labels\x18\x03 \x03(\tR\x06labels\x1a:\n" + + "\fDetailsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xae\x02\n" + + "\x0eContactDetails\x12\x14\n" + + "\x05email\x18\x01 \x01(\tR\x05email\x12!\n" + + "\fphone_number\x18\x02 \x01(\tR\vphoneNumber\x12%\n" + + "\aaddress\x18\x03 \x01(\v2\v.v1.AddressR\aaddress\x12\x1d\n" + + "\n" + + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12E\n" + + "\vannotations\x18\x05 \x03(\v2#.v1.ContactDetails.AnnotationsEntryR\vannotations\x12\x16\n" + + "\x06labels\x18\x06 \x03(\tR\x06labels\x1a>\n" + + "\x10AnnotationsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"i\n" + + "\aAddress\x12#\n" + + "\raddress_lines\x18\x01 \x03(\tR\faddressLines\x12\x1f\n" + + "\vpostal_code\x18\x02 \x01(\tR\n" + + "postalCode\x12\x18\n" + + "\acountry\x18\x03 \x01(\tR\acountry2\xfe\x04\n" + "\rTenantService\x125\n" + "\x06Create\x12\x17.v1.TenantCreateRequest\x1a\x12.v1.TenantResponse\x125\n" + "\x06Update\x12\x17.v1.TenantUpdateRequest\x1a\x12.v1.TenantResponse\x125\n" + @@ -1053,7 +1284,7 @@ func file_v1_tenant_proto_rawDescGZIP() []byte { return file_v1_tenant_proto_rawDescData } -var file_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 28) var file_v1_tenant_proto_goTypes = []any{ (*FindParticipatingProjectsRequest)(nil), // 0: v1.FindParticipatingProjectsRequest (*FindParticipatingTenantsRequest)(nil), // 1: v1.FindParticipatingTenantsRequest @@ -1072,65 +1303,74 @@ var file_v1_tenant_proto_goTypes = []any{ (*TenantFindRequest)(nil), // 14: v1.TenantFindRequest (*TenantResponse)(nil), // 15: v1.TenantResponse (*TenantListResponse)(nil), // 16: v1.TenantListResponse - nil, // 17: v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry - nil, // 18: v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry - nil, // 19: v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry - nil, // 20: v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry - nil, // 21: v1.TenantFindRequest.AnnotationsEntry - (*Project)(nil), // 22: v1.Project - (*Meta)(nil), // 23: v1.Meta - (*QuotaSet)(nil), // 24: v1.QuotaSet - (*IAMConfig)(nil), // 25: v1.IAMConfig - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp - (*wrapperspb.StringValue)(nil), // 27: google.protobuf.StringValue - (*Paging)(nil), // 28: v1.Paging + (*PaymentDetails)(nil), // 17: v1.PaymentDetails + (*ContactDetails)(nil), // 18: v1.ContactDetails + (*Address)(nil), // 19: v1.Address + nil, // 20: v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry + nil, // 21: v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry + nil, // 22: v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry + nil, // 23: v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry + nil, // 24: v1.TenantFindRequest.AnnotationsEntry + nil, // 25: v1.PaymentDetails.DetailsEntry + nil, // 26: v1.PaymentDetails.AnnotationsEntry + nil, // 27: v1.ContactDetails.AnnotationsEntry + (*Project)(nil), // 28: v1.Project + (*Meta)(nil), // 29: v1.Meta + (*QuotaSet)(nil), // 30: v1.QuotaSet + (*IAMConfig)(nil), // 31: v1.IAMConfig + (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp + (*Paging)(nil), // 33: v1.Paging } var file_v1_tenant_proto_depIdxs = []int32{ 7, // 0: v1.ListTenantMembersResponse.tenants:type_name -> v1.TenantWithMembershipAnnotations 6, // 1: v1.FindParticipatingProjectsResponse.projects:type_name -> v1.ProjectWithMembershipAnnotations 7, // 2: v1.FindParticipatingTenantsResponse.tenants:type_name -> v1.TenantWithMembershipAnnotations - 22, // 3: v1.ProjectWithMembershipAnnotations.project:type_name -> v1.Project - 17, // 4: v1.ProjectWithMembershipAnnotations.project_annotations:type_name -> v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry - 18, // 5: v1.ProjectWithMembershipAnnotations.tenant_annotations:type_name -> v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry + 28, // 3: v1.ProjectWithMembershipAnnotations.project:type_name -> v1.Project + 20, // 4: v1.ProjectWithMembershipAnnotations.project_annotations:type_name -> v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry + 21, // 5: v1.ProjectWithMembershipAnnotations.tenant_annotations:type_name -> v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry 8, // 6: v1.TenantWithMembershipAnnotations.tenant:type_name -> v1.Tenant - 19, // 7: v1.TenantWithMembershipAnnotations.project_annotations:type_name -> v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry - 20, // 8: v1.TenantWithMembershipAnnotations.tenant_annotations:type_name -> v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry - 23, // 9: v1.Tenant.meta:type_name -> v1.Meta - 24, // 10: v1.Tenant.default_quotas:type_name -> v1.QuotaSet - 24, // 11: v1.Tenant.quotas:type_name -> v1.QuotaSet - 25, // 12: v1.Tenant.iam_config:type_name -> v1.IAMConfig - 8, // 13: v1.TenantCreateRequest.tenant:type_name -> v1.Tenant - 8, // 14: v1.TenantUpdateRequest.tenant:type_name -> v1.Tenant - 26, // 15: v1.TenantGetHistoryRequest.at:type_name -> google.protobuf.Timestamp - 27, // 16: v1.TenantFindRequest.deprecated_id:type_name -> google.protobuf.StringValue - 27, // 17: v1.TenantFindRequest.deprecated_name:type_name -> google.protobuf.StringValue - 28, // 18: v1.TenantFindRequest.paging:type_name -> v1.Paging - 21, // 19: v1.TenantFindRequest.annotations:type_name -> v1.TenantFindRequest.AnnotationsEntry + 22, // 7: v1.TenantWithMembershipAnnotations.project_annotations:type_name -> v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry + 23, // 8: v1.TenantWithMembershipAnnotations.tenant_annotations:type_name -> v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry + 29, // 9: v1.Tenant.meta:type_name -> v1.Meta + 30, // 10: v1.Tenant.default_quotas:type_name -> v1.QuotaSet + 30, // 11: v1.Tenant.quotas:type_name -> v1.QuotaSet + 31, // 12: v1.Tenant.iam_config:type_name -> v1.IAMConfig + 17, // 13: v1.Tenant.payment:type_name -> v1.PaymentDetails + 18, // 14: v1.Tenant.contact_details:type_name -> v1.ContactDetails + 8, // 15: v1.TenantCreateRequest.tenant:type_name -> v1.Tenant + 8, // 16: v1.TenantUpdateRequest.tenant:type_name -> v1.Tenant + 32, // 17: v1.TenantGetHistoryRequest.at:type_name -> google.protobuf.Timestamp + 33, // 18: v1.TenantFindRequest.paging:type_name -> v1.Paging + 24, // 19: v1.TenantFindRequest.annotations:type_name -> v1.TenantFindRequest.AnnotationsEntry 8, // 20: v1.TenantResponse.tenant:type_name -> v1.Tenant 8, // 21: v1.TenantListResponse.tenants:type_name -> v1.Tenant - 9, // 22: v1.TenantService.Create:input_type -> v1.TenantCreateRequest - 10, // 23: v1.TenantService.Update:input_type -> v1.TenantUpdateRequest - 11, // 24: v1.TenantService.Delete:input_type -> v1.TenantDeleteRequest - 12, // 25: v1.TenantService.Get:input_type -> v1.TenantGetRequest - 13, // 26: v1.TenantService.GetHistory:input_type -> v1.TenantGetHistoryRequest - 14, // 27: v1.TenantService.Find:input_type -> v1.TenantFindRequest - 2, // 28: v1.TenantService.ListTenantMembers:input_type -> v1.ListTenantMembersRequest - 0, // 29: v1.TenantService.FindParticipatingProjects:input_type -> v1.FindParticipatingProjectsRequest - 1, // 30: v1.TenantService.FindParticipatingTenants:input_type -> v1.FindParticipatingTenantsRequest - 15, // 31: v1.TenantService.Create:output_type -> v1.TenantResponse - 15, // 32: v1.TenantService.Update:output_type -> v1.TenantResponse - 15, // 33: v1.TenantService.Delete:output_type -> v1.TenantResponse - 15, // 34: v1.TenantService.Get:output_type -> v1.TenantResponse - 15, // 35: v1.TenantService.GetHistory:output_type -> v1.TenantResponse - 16, // 36: v1.TenantService.Find:output_type -> v1.TenantListResponse - 3, // 37: v1.TenantService.ListTenantMembers:output_type -> v1.ListTenantMembersResponse - 4, // 38: v1.TenantService.FindParticipatingProjects:output_type -> v1.FindParticipatingProjectsResponse - 5, // 39: v1.TenantService.FindParticipatingTenants:output_type -> v1.FindParticipatingTenantsResponse - 31, // [31:40] is the sub-list for method output_type - 22, // [22:31] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 25, // 22: v1.PaymentDetails.details:type_name -> v1.PaymentDetails.DetailsEntry + 26, // 23: v1.PaymentDetails.annotations:type_name -> v1.PaymentDetails.AnnotationsEntry + 19, // 24: v1.ContactDetails.address:type_name -> v1.Address + 27, // 25: v1.ContactDetails.annotations:type_name -> v1.ContactDetails.AnnotationsEntry + 9, // 26: v1.TenantService.Create:input_type -> v1.TenantCreateRequest + 10, // 27: v1.TenantService.Update:input_type -> v1.TenantUpdateRequest + 11, // 28: v1.TenantService.Delete:input_type -> v1.TenantDeleteRequest + 12, // 29: v1.TenantService.Get:input_type -> v1.TenantGetRequest + 13, // 30: v1.TenantService.GetHistory:input_type -> v1.TenantGetHistoryRequest + 14, // 31: v1.TenantService.Find:input_type -> v1.TenantFindRequest + 2, // 32: v1.TenantService.ListTenantMembers:input_type -> v1.ListTenantMembersRequest + 0, // 33: v1.TenantService.FindParticipatingProjects:input_type -> v1.FindParticipatingProjectsRequest + 1, // 34: v1.TenantService.FindParticipatingTenants:input_type -> v1.FindParticipatingTenantsRequest + 15, // 35: v1.TenantService.Create:output_type -> v1.TenantResponse + 15, // 36: v1.TenantService.Update:output_type -> v1.TenantResponse + 15, // 37: v1.TenantService.Delete:output_type -> v1.TenantResponse + 15, // 38: v1.TenantService.Get:output_type -> v1.TenantResponse + 15, // 39: v1.TenantService.GetHistory:output_type -> v1.TenantResponse + 16, // 40: v1.TenantService.Find:output_type -> v1.TenantListResponse + 3, // 41: v1.TenantService.ListTenantMembers:output_type -> v1.ListTenantMembersResponse + 4, // 42: v1.TenantService.FindParticipatingProjects:output_type -> v1.FindParticipatingProjectsResponse + 5, // 43: v1.TenantService.FindParticipatingTenants:output_type -> v1.FindParticipatingTenantsResponse + 35, // [35:44] is the sub-list for method output_type + 26, // [26:35] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_v1_tenant_proto_init() } @@ -1154,7 +1394,7 @@ func file_v1_tenant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_tenant_proto_rawDesc), len(file_v1_tenant_proto_rawDesc)), NumEnums: 0, - NumMessages: 22, + NumMessages: 28, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/datastore/migrate.go b/pkg/datastore/migrate.go index 2d8bf23..e7a585e 100644 --- a/pkg/datastore/migrate.go +++ b/pkg/datastore/migrate.go @@ -59,10 +59,12 @@ func MigrateDB(log *slog.Logger, db *sqlx.DB, healthServer *health.Server) error continue } - if q.Quota != nil { // nolint:staticcheck - q.Max = &q.Quota.Value // nolint:staticcheck - log.Info("migrating deprecated quota field of tenant", "tenant", tenant.Meta.Id, "value", *q.Max) - } + // We rely on a already deployed v0.12.0 of masterdata-api + // + // if q.Quota != nil { // nolint:staticcheck + // q.Max = &q.Quota.Value // nolint:staticcheck + // log.Info("migrating deprecated quota field of tenant", "tenant", tenant.Meta.Id, "value", *q.Max) + // } } err := ts.Update(ctx, tenant) diff --git a/pkg/service/project.go b/pkg/service/project.go index e6c5488..f8f99ce 100644 --- a/pkg/service/project.go +++ b/pkg/service/project.go @@ -123,20 +123,6 @@ func (s *projectService) GetHistory(ctx context.Context, req *v1.ProjectGetHisto return project.NewProjectResponse(), nil } func (s *projectService) Find(ctx context.Context, req *v1.ProjectFindRequest) (*v1.ProjectListResponse, error) { - // TODO: remove in next release - if req.DeprecatedId != nil && req.Id == nil { // nolint:staticcheck - req.Id = &req.DeprecatedId.Value // nolint:staticcheck - } - if req.DeprecatedDescription != nil && req.Description == nil { // nolint:staticcheck - req.Description = &req.DeprecatedDescription.Value // nolint:staticcheck - } - if req.DeprecatedName != nil && req.Name == nil { // nolint:staticcheck - req.Name = &req.DeprecatedName.Value // nolint:staticcheck - } - if req.DeprecatedTenantId != nil && req.TenantId == nil { // nolint:staticcheck - req.TenantId = &req.DeprecatedTenantId.Value // nolint:staticcheck - } - filter := make(map[string]any) if req.Id != nil { filter["id"] = req.Id diff --git a/pkg/service/tenant.go b/pkg/service/tenant.go index 44630b8..d25cf06 100644 --- a/pkg/service/tenant.go +++ b/pkg/service/tenant.go @@ -117,14 +117,6 @@ func (s *tenantService) GetHistory(ctx context.Context, req *v1.TenantGetHistory } func (s *tenantService) Find(ctx context.Context, req *v1.TenantFindRequest) (*v1.TenantListResponse, error) { - // TODO: remove in next release - if req.DeprecatedId != nil && req.Id == nil { // nolint:staticcheck - req.Id = &req.DeprecatedId.Value // nolint:staticcheck - } - if req.DeprecatedName != nil && req.Name == nil { // nolint:staticcheck - req.Name = &req.DeprecatedName.Value // nolint:staticcheck - } - filter := make(map[string]any) if req.Id != nil { filter["id"] = req.GetId() diff --git a/proto/Makefile b/proto/Makefile index 360795c..a7d16de 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -1,5 +1,5 @@ MAKEFLAGS += --no-print-directory -BUF_VERSION := 1.53.0 +BUF_VERSION := 1.55.1 _buf: docker run --rm \ diff --git a/proto/v1/project.proto b/proto/v1/project.proto index 8370cba..ab7b91a 100644 --- a/proto/v1/project.proto +++ b/proto/v1/project.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package v1; import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; import "v1/common.proto"; import "v1/meta.proto"; import "v1/quota.proto"; @@ -48,11 +47,8 @@ message ProjectGetHistoryRequest { } message ProjectFindRequest { - // TODO: remove in next release: - google.protobuf.StringValue deprecated_id = 1 [deprecated = true]; - google.protobuf.StringValue deprecated_name = 2 [deprecated = true]; - google.protobuf.StringValue deprecated_description = 3 [deprecated = true]; - google.protobuf.StringValue deprecated_tenant_id = 4 [deprecated = true]; + reserved 1, 2, 3, 4; + reserved "deprecated_id", "deprecated_name", "deprecated_description", "deprecated_tenant_id"; Paging paging = 5; map annotations = 6; diff --git a/proto/v1/quota.proto b/proto/v1/quota.proto index 5734668..f4fe0cf 100644 --- a/proto/v1/quota.proto +++ b/proto/v1/quota.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package v1; -import "google/protobuf/wrappers.proto"; - // QuotaSet defines the types of possible Quotas // might be specified by project or tenant // whatever quota is reached first counts @@ -21,8 +19,8 @@ message QuotaSet { // Quota is the actual maximum amount message Quota { - // TODO: remove in next release: - google.protobuf.Int32Value quota = 1 [deprecated = true]; + reserved 1; + reserved "quota"; // max is the maximum amount for the current QuotaSet, can be nil optional int32 max = 2; diff --git a/proto/v1/tenant.proto b/proto/v1/tenant.proto index 167b9c6..2e03cd0 100644 --- a/proto/v1/tenant.proto +++ b/proto/v1/tenant.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package v1; import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; import "v1/common.proto"; import "v1/iam.proto"; import "v1/meta.proto"; @@ -70,6 +69,8 @@ message Tenant { QuotaSet default_quotas = 4; QuotaSet quotas = 5; IAMConfig iam_config = 6; + PaymentDetails payment = 7; + ContactDetails contact_details = 8; } message TenantCreateRequest { @@ -94,9 +95,8 @@ message TenantGetHistoryRequest { } message TenantFindRequest { - // TODO: remove in next release: - google.protobuf.StringValue deprecated_id = 1 [deprecated = true]; - google.protobuf.StringValue deprecated_name = 2 [deprecated = true]; + reserved 1, 2; + reserved "deprecated_id", "deprecated_name"; Paging paging = 3; map annotations = 4; @@ -114,3 +114,32 @@ message TenantListResponse { // next_page is used for pagination, returns the next page to be fetched and must then be provided in the list request. optional uint64 next_page = 2; } + +// PaymentDetails describe payment specific configurations of a tenant +message PaymentDetails { + // Details stored as key value pairs + map details = 1; + // Annotations of this payment details + map annotations = 2; + // Labels of this payment details + repeated string labels = 3; +} + +// ContactDetails contain more properties of a tenant +message ContactDetails { + string email = 1; + string phone_number = 2; + Address address = 3; + string avatar_url = 4; + // Annotations of this payment details + map annotations = 5; + // Labels of this payment details + repeated string labels = 6; +} + +// Address is the postal address +message Address { + repeated string address_lines = 1; + string postal_code = 2; + string country = 3; +} From 6162a4d0359f533e9d5926ba1d0fc5dabbb6e95a Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Sun, 27 Jul 2025 09:34:22 +0200 Subject: [PATCH 2/4] Add created_by --- api/v1/meta.pb.go | 14 ++++++++++++-- proto/v1/meta.proto | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/api/v1/meta.pb.go b/api/v1/meta.pb.go index 438a43c..0ad6646 100644 --- a/api/v1/meta.pb.go +++ b/api/v1/meta.pb.go @@ -32,6 +32,7 @@ type Meta struct { UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"` Annotations map[string]string `protobuf:"bytes,7,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Labels []string `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"` + CreatedBy string `protobuf:"bytes,9,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -122,11 +123,18 @@ func (x *Meta) GetLabels() []string { return nil } +func (x *Meta) GetCreatedBy() string { + if x != nil { + return x.CreatedBy + } + return "" +} + var File_v1_meta_proto protoreflect.FileDescriptor const file_v1_meta_proto_rawDesc = "" + "\n" + - "\rv1/meta.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf7\x02\n" + + "\rv1/meta.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x96\x03\n" + "\x04Meta\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04kind\x18\x02 \x01(\tR\x04kind\x12\x1e\n" + @@ -137,7 +145,9 @@ const file_v1_meta_proto_rawDesc = "" + "\fcreated_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\vcreatedTime\x12=\n" + "\fupdated_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\vupdatedTime\x12;\n" + "\vannotations\x18\a \x03(\v2\x19.v1.Meta.AnnotationsEntryR\vannotations\x12\x16\n" + - "\x06labels\x18\b \x03(\tR\x06labels\x1a>\n" + + "\x06labels\x18\b \x03(\tR\x06labels\x12\x1d\n" + + "\n" + + "created_by\x18\t \x01(\tR\tcreatedBy\x1a>\n" + "\x10AnnotationsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01Be\n" + diff --git a/proto/v1/meta.proto b/proto/v1/meta.proto index 855f0c8..eae73c9 100644 --- a/proto/v1/meta.proto +++ b/proto/v1/meta.proto @@ -13,4 +13,5 @@ message Meta { google.protobuf.Timestamp updated_time = 6; map annotations = 7; repeated string labels = 8; + string created_by = 9; } From 5bb07ed3a1bab06ef74f0339661a6ec4f5bc7084 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 1 Aug 2025 11:42:05 +0200 Subject: [PATCH 3/4] Use postaladdress from google --- api/v1/tenant.pb.go | 147 ++++++++++++------------------------------ proto/buf.yaml | 2 + proto/v1/tenant.proto | 13 ++-- 3 files changed, 48 insertions(+), 114 deletions(-) diff --git a/api/v1/tenant.pb.go b/api/v1/tenant.pb.go index 8fdb9cd..0cfc2f7 100644 --- a/api/v1/tenant.pb.go +++ b/api/v1/tenant.pb.go @@ -7,6 +7,7 @@ package v1 import ( + _type "github.com/metal-stack/masterdata-api/google/type" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" @@ -1001,7 +1002,7 @@ type ContactDetails struct { state protoimpl.MessageState `protogen:"open.v1"` Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` PhoneNumber string `protobuf:"bytes,2,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` - Address *Address `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` + Address *_type.PostalAddress `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` // Annotations of this payment details Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` @@ -1055,7 +1056,7 @@ func (x *ContactDetails) GetPhoneNumber() string { return "" } -func (x *ContactDetails) GetAddress() *Address { +func (x *ContactDetails) GetAddress() *_type.PostalAddress { if x != nil { return x.Address } @@ -1083,72 +1084,11 @@ func (x *ContactDetails) GetLabels() []string { return nil } -// Address is the postal address -type Address struct { - state protoimpl.MessageState `protogen:"open.v1"` - AddressLines []string `protobuf:"bytes,1,rep,name=address_lines,json=addressLines,proto3" json:"address_lines,omitempty"` - PostalCode string `protobuf:"bytes,2,opt,name=postal_code,json=postalCode,proto3" json:"postal_code,omitempty"` - Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Address) Reset() { - *x = Address{} - mi := &file_v1_tenant_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Address) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Address) ProtoMessage() {} - -func (x *Address) ProtoReflect() protoreflect.Message { - mi := &file_v1_tenant_proto_msgTypes[19] - 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 Address.ProtoReflect.Descriptor instead. -func (*Address) Descriptor() ([]byte, []int) { - return file_v1_tenant_proto_rawDescGZIP(), []int{19} -} - -func (x *Address) GetAddressLines() []string { - if x != nil { - return x.AddressLines - } - return nil -} - -func (x *Address) GetPostalCode() string { - if x != nil { - return x.PostalCode - } - return "" -} - -func (x *Address) GetCountry() string { - if x != nil { - return x.Country - } - return "" -} - var File_v1_tenant_proto protoreflect.FileDescriptor const file_v1_tenant_proto_rawDesc = "" + "\n" + - "\x0fv1/tenant.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0fv1/common.proto\x1a\fv1/iam.proto\x1a\rv1/meta.proto\x1a\x10v1/project.proto\x1a\x0ev1/quota.proto\"\x87\x01\n" + + "\x0fv1/tenant.proto\x12\x02v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a google/type/postal_address.proto\x1a\x0fv1/common.proto\x1a\fv1/iam.proto\x1a\rv1/meta.proto\x1a\x10v1/project.proto\x1a\x0ev1/quota.proto\"\x87\x01\n" + " FindParticipatingProjectsRequest\x12\x1b\n" + "\ttenant_id\x18\x01 \x01(\tR\btenantId\x120\n" + "\x11include_inherited\x18\x02 \x01(\bH\x00R\x10includeInherited\x88\x01\x01B\x14\n" + @@ -1242,23 +1182,18 @@ const file_v1_tenant_proto_rawDesc = "" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1a>\n" + "\x10AnnotationsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xae\x02\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xbd\x02\n" + "\x0eContactDetails\x12\x14\n" + "\x05email\x18\x01 \x01(\tR\x05email\x12!\n" + - "\fphone_number\x18\x02 \x01(\tR\vphoneNumber\x12%\n" + - "\aaddress\x18\x03 \x01(\v2\v.v1.AddressR\aaddress\x12\x1d\n" + + "\fphone_number\x18\x02 \x01(\tR\vphoneNumber\x124\n" + + "\aaddress\x18\x03 \x01(\v2\x1a.google.type.PostalAddressR\aaddress\x12\x1d\n" + "\n" + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12E\n" + "\vannotations\x18\x05 \x03(\v2#.v1.ContactDetails.AnnotationsEntryR\vannotations\x12\x16\n" + "\x06labels\x18\x06 \x03(\tR\x06labels\x1a>\n" + "\x10AnnotationsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"i\n" + - "\aAddress\x12#\n" + - "\raddress_lines\x18\x01 \x03(\tR\faddressLines\x12\x1f\n" + - "\vpostal_code\x18\x02 \x01(\tR\n" + - "postalCode\x12\x18\n" + - "\acountry\x18\x03 \x01(\tR\acountry2\xfe\x04\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x012\xfe\x04\n" + "\rTenantService\x125\n" + "\x06Create\x12\x17.v1.TenantCreateRequest\x1a\x12.v1.TenantResponse\x125\n" + "\x06Update\x12\x17.v1.TenantUpdateRequest\x1a\x12.v1.TenantResponse\x125\n" + @@ -1284,7 +1219,7 @@ func file_v1_tenant_proto_rawDescGZIP() []byte { return file_v1_tenant_proto_rawDescData } -var file_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_v1_tenant_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_v1_tenant_proto_goTypes = []any{ (*FindParticipatingProjectsRequest)(nil), // 0: v1.FindParticipatingProjectsRequest (*FindParticipatingTenantsRequest)(nil), // 1: v1.FindParticipatingTenantsRequest @@ -1305,49 +1240,49 @@ var file_v1_tenant_proto_goTypes = []any{ (*TenantListResponse)(nil), // 16: v1.TenantListResponse (*PaymentDetails)(nil), // 17: v1.PaymentDetails (*ContactDetails)(nil), // 18: v1.ContactDetails - (*Address)(nil), // 19: v1.Address - nil, // 20: v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry - nil, // 21: v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry - nil, // 22: v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry - nil, // 23: v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry - nil, // 24: v1.TenantFindRequest.AnnotationsEntry - nil, // 25: v1.PaymentDetails.DetailsEntry - nil, // 26: v1.PaymentDetails.AnnotationsEntry - nil, // 27: v1.ContactDetails.AnnotationsEntry - (*Project)(nil), // 28: v1.Project - (*Meta)(nil), // 29: v1.Meta - (*QuotaSet)(nil), // 30: v1.QuotaSet - (*IAMConfig)(nil), // 31: v1.IAMConfig - (*timestamppb.Timestamp)(nil), // 32: google.protobuf.Timestamp - (*Paging)(nil), // 33: v1.Paging + nil, // 19: v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry + nil, // 20: v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry + nil, // 21: v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry + nil, // 22: v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry + nil, // 23: v1.TenantFindRequest.AnnotationsEntry + nil, // 24: v1.PaymentDetails.DetailsEntry + nil, // 25: v1.PaymentDetails.AnnotationsEntry + nil, // 26: v1.ContactDetails.AnnotationsEntry + (*Project)(nil), // 27: v1.Project + (*Meta)(nil), // 28: v1.Meta + (*QuotaSet)(nil), // 29: v1.QuotaSet + (*IAMConfig)(nil), // 30: v1.IAMConfig + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp + (*Paging)(nil), // 32: v1.Paging + (*_type.PostalAddress)(nil), // 33: google.type.PostalAddress } var file_v1_tenant_proto_depIdxs = []int32{ 7, // 0: v1.ListTenantMembersResponse.tenants:type_name -> v1.TenantWithMembershipAnnotations 6, // 1: v1.FindParticipatingProjectsResponse.projects:type_name -> v1.ProjectWithMembershipAnnotations 7, // 2: v1.FindParticipatingTenantsResponse.tenants:type_name -> v1.TenantWithMembershipAnnotations - 28, // 3: v1.ProjectWithMembershipAnnotations.project:type_name -> v1.Project - 20, // 4: v1.ProjectWithMembershipAnnotations.project_annotations:type_name -> v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry - 21, // 5: v1.ProjectWithMembershipAnnotations.tenant_annotations:type_name -> v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry + 27, // 3: v1.ProjectWithMembershipAnnotations.project:type_name -> v1.Project + 19, // 4: v1.ProjectWithMembershipAnnotations.project_annotations:type_name -> v1.ProjectWithMembershipAnnotations.ProjectAnnotationsEntry + 20, // 5: v1.ProjectWithMembershipAnnotations.tenant_annotations:type_name -> v1.ProjectWithMembershipAnnotations.TenantAnnotationsEntry 8, // 6: v1.TenantWithMembershipAnnotations.tenant:type_name -> v1.Tenant - 22, // 7: v1.TenantWithMembershipAnnotations.project_annotations:type_name -> v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry - 23, // 8: v1.TenantWithMembershipAnnotations.tenant_annotations:type_name -> v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry - 29, // 9: v1.Tenant.meta:type_name -> v1.Meta - 30, // 10: v1.Tenant.default_quotas:type_name -> v1.QuotaSet - 30, // 11: v1.Tenant.quotas:type_name -> v1.QuotaSet - 31, // 12: v1.Tenant.iam_config:type_name -> v1.IAMConfig + 21, // 7: v1.TenantWithMembershipAnnotations.project_annotations:type_name -> v1.TenantWithMembershipAnnotations.ProjectAnnotationsEntry + 22, // 8: v1.TenantWithMembershipAnnotations.tenant_annotations:type_name -> v1.TenantWithMembershipAnnotations.TenantAnnotationsEntry + 28, // 9: v1.Tenant.meta:type_name -> v1.Meta + 29, // 10: v1.Tenant.default_quotas:type_name -> v1.QuotaSet + 29, // 11: v1.Tenant.quotas:type_name -> v1.QuotaSet + 30, // 12: v1.Tenant.iam_config:type_name -> v1.IAMConfig 17, // 13: v1.Tenant.payment:type_name -> v1.PaymentDetails 18, // 14: v1.Tenant.contact_details:type_name -> v1.ContactDetails 8, // 15: v1.TenantCreateRequest.tenant:type_name -> v1.Tenant 8, // 16: v1.TenantUpdateRequest.tenant:type_name -> v1.Tenant - 32, // 17: v1.TenantGetHistoryRequest.at:type_name -> google.protobuf.Timestamp - 33, // 18: v1.TenantFindRequest.paging:type_name -> v1.Paging - 24, // 19: v1.TenantFindRequest.annotations:type_name -> v1.TenantFindRequest.AnnotationsEntry + 31, // 17: v1.TenantGetHistoryRequest.at:type_name -> google.protobuf.Timestamp + 32, // 18: v1.TenantFindRequest.paging:type_name -> v1.Paging + 23, // 19: v1.TenantFindRequest.annotations:type_name -> v1.TenantFindRequest.AnnotationsEntry 8, // 20: v1.TenantResponse.tenant:type_name -> v1.Tenant 8, // 21: v1.TenantListResponse.tenants:type_name -> v1.Tenant - 25, // 22: v1.PaymentDetails.details:type_name -> v1.PaymentDetails.DetailsEntry - 26, // 23: v1.PaymentDetails.annotations:type_name -> v1.PaymentDetails.AnnotationsEntry - 19, // 24: v1.ContactDetails.address:type_name -> v1.Address - 27, // 25: v1.ContactDetails.annotations:type_name -> v1.ContactDetails.AnnotationsEntry + 24, // 22: v1.PaymentDetails.details:type_name -> v1.PaymentDetails.DetailsEntry + 25, // 23: v1.PaymentDetails.annotations:type_name -> v1.PaymentDetails.AnnotationsEntry + 33, // 24: v1.ContactDetails.address:type_name -> google.type.PostalAddress + 26, // 25: v1.ContactDetails.annotations:type_name -> v1.ContactDetails.AnnotationsEntry 9, // 26: v1.TenantService.Create:input_type -> v1.TenantCreateRequest 10, // 27: v1.TenantService.Update:input_type -> v1.TenantUpdateRequest 11, // 28: v1.TenantService.Delete:input_type -> v1.TenantDeleteRequest @@ -1394,7 +1329,7 @@ func file_v1_tenant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_tenant_proto_rawDesc), len(file_v1_tenant_proto_rawDesc)), NumEnums: 0, - NumMessages: 28, + NumMessages: 27, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/buf.yaml b/proto/buf.yaml index f49e32b..01c0351 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,4 +1,6 @@ version: v2 +deps: + - buf.build/googleapis/googleapis lint: use: - STANDARD diff --git a/proto/v1/tenant.proto b/proto/v1/tenant.proto index 2e03cd0..c631a40 100644 --- a/proto/v1/tenant.proto +++ b/proto/v1/tenant.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package v1; import "google/protobuf/timestamp.proto"; +import "google/type/postal_address.proto"; import "v1/common.proto"; import "v1/iam.proto"; import "v1/meta.proto"; @@ -127,19 +128,15 @@ message PaymentDetails { // ContactDetails contain more properties of a tenant message ContactDetails { + // Email of this tenant string email = 1; + // Phone Number of this tenant string phone_number = 2; - Address address = 3; + // Address of this tenant + google.type.PostalAddress address = 3; string avatar_url = 4; // Annotations of this payment details map annotations = 5; // Labels of this payment details repeated string labels = 6; } - -// Address is the postal address -message Address { - repeated string address_lines = 1; - string postal_code = 2; - string country = 3; -} From eda583f9913bb5cadacbb93a9248b78c0c8ebb7d Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 1 Aug 2025 11:42:14 +0200 Subject: [PATCH 4/4] Use postaladdress from google --- proto/buf.lock | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 proto/buf.lock diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 0000000..9a4fa6c --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,6 @@ +# Generated by buf. DO NOT EDIT. +version: v2 +deps: + - name: buf.build/googleapis/googleapis + commit: 61b203b9a9164be9a834f58c37be6f62 + digest: b5:7811a98b35bd2e4ae5c3ac73c8b3d9ae429f3a790da15de188dc98fc2b77d6bb10e45711f14903af9553fa9821dff256054f2e4b7795789265bc476bec2f088c