diff --git a/components/usage-api/go/v1/billing.pb.go b/components/usage-api/go/v1/billing.pb.go index 20f0c3654cd4be..51a62bc6b6bb30 100644 --- a/components/usage-api/go/v1/billing.pb.go +++ b/components/usage-api/go/v1/billing.pb.go @@ -186,6 +186,82 @@ func (*UpdateInvoicesResponse) Descriptor() ([]byte, []int) { return file_usage_v1_billing_proto_rawDescGZIP(), []int{1} } +type ReconcileInvoicesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReconcileInvoicesRequest) Reset() { + *x = ReconcileInvoicesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_usage_v1_billing_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReconcileInvoicesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconcileInvoicesRequest) ProtoMessage() {} + +func (x *ReconcileInvoicesRequest) ProtoReflect() protoreflect.Message { + mi := &file_usage_v1_billing_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconcileInvoicesRequest.ProtoReflect.Descriptor instead. +func (*ReconcileInvoicesRequest) Descriptor() ([]byte, []int) { + return file_usage_v1_billing_proto_rawDescGZIP(), []int{2} +} + +type ReconcileInvoicesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ReconcileInvoicesResponse) Reset() { + *x = ReconcileInvoicesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_usage_v1_billing_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReconcileInvoicesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReconcileInvoicesResponse) ProtoMessage() {} + +func (x *ReconcileInvoicesResponse) ProtoReflect() protoreflect.Message { + mi := &file_usage_v1_billing_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReconcileInvoicesResponse.ProtoReflect.Descriptor instead. +func (*ReconcileInvoicesResponse) Descriptor() ([]byte, []int) { + return file_usage_v1_billing_proto_rawDescGZIP(), []int{3} +} + type GetUpcomingInvoiceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -201,7 +277,7 @@ type GetUpcomingInvoiceRequest struct { func (x *GetUpcomingInvoiceRequest) Reset() { *x = GetUpcomingInvoiceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[2] + mi := &file_usage_v1_billing_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -214,7 +290,7 @@ func (x *GetUpcomingInvoiceRequest) String() string { func (*GetUpcomingInvoiceRequest) ProtoMessage() {} func (x *GetUpcomingInvoiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[2] + mi := &file_usage_v1_billing_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -227,7 +303,7 @@ func (x *GetUpcomingInvoiceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUpcomingInvoiceRequest.ProtoReflect.Descriptor instead. func (*GetUpcomingInvoiceRequest) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{2} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{4} } func (m *GetUpcomingInvoiceRequest) GetIdentifier() isGetUpcomingInvoiceRequest_Identifier { @@ -281,7 +357,7 @@ type GetUpcomingInvoiceResponse struct { func (x *GetUpcomingInvoiceResponse) Reset() { *x = GetUpcomingInvoiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[3] + mi := &file_usage_v1_billing_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -294,7 +370,7 @@ func (x *GetUpcomingInvoiceResponse) String() string { func (*GetUpcomingInvoiceResponse) ProtoMessage() {} func (x *GetUpcomingInvoiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[3] + mi := &file_usage_v1_billing_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -307,7 +383,7 @@ func (x *GetUpcomingInvoiceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUpcomingInvoiceResponse.ProtoReflect.Descriptor instead. func (*GetUpcomingInvoiceResponse) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{3} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{5} } func (x *GetUpcomingInvoiceResponse) GetInvoiceId() string { @@ -349,7 +425,7 @@ type FinalizeInvoiceRequest struct { func (x *FinalizeInvoiceRequest) Reset() { *x = FinalizeInvoiceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[4] + mi := &file_usage_v1_billing_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -362,7 +438,7 @@ func (x *FinalizeInvoiceRequest) String() string { func (*FinalizeInvoiceRequest) ProtoMessage() {} func (x *FinalizeInvoiceRequest) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[4] + mi := &file_usage_v1_billing_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -375,7 +451,7 @@ func (x *FinalizeInvoiceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeInvoiceRequest.ProtoReflect.Descriptor instead. func (*FinalizeInvoiceRequest) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{4} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{6} } func (x *FinalizeInvoiceRequest) GetInvoiceId() string { @@ -394,7 +470,7 @@ type FinalizeInvoiceResponse struct { func (x *FinalizeInvoiceResponse) Reset() { *x = FinalizeInvoiceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[5] + mi := &file_usage_v1_billing_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -407,7 +483,7 @@ func (x *FinalizeInvoiceResponse) String() string { func (*FinalizeInvoiceResponse) ProtoMessage() {} func (x *FinalizeInvoiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[5] + mi := &file_usage_v1_billing_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -420,7 +496,7 @@ func (x *FinalizeInvoiceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalizeInvoiceResponse.ProtoReflect.Descriptor instead. func (*FinalizeInvoiceResponse) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{5} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{7} } // If there are two billable sessions for this instance ID, @@ -438,7 +514,7 @@ type SetBilledSessionRequest struct { func (x *SetBilledSessionRequest) Reset() { *x = SetBilledSessionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[6] + mi := &file_usage_v1_billing_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -451,7 +527,7 @@ func (x *SetBilledSessionRequest) String() string { func (*SetBilledSessionRequest) ProtoMessage() {} func (x *SetBilledSessionRequest) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[6] + mi := &file_usage_v1_billing_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -464,7 +540,7 @@ func (x *SetBilledSessionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetBilledSessionRequest.ProtoReflect.Descriptor instead. func (*SetBilledSessionRequest) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{6} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{8} } func (x *SetBilledSessionRequest) GetInstanceId() string { @@ -497,7 +573,7 @@ type SetBilledSessionResponse struct { func (x *SetBilledSessionResponse) Reset() { *x = SetBilledSessionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_usage_v1_billing_proto_msgTypes[7] + mi := &file_usage_v1_billing_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -510,7 +586,7 @@ func (x *SetBilledSessionResponse) String() string { func (*SetBilledSessionResponse) ProtoMessage() {} func (x *SetBilledSessionResponse) ProtoReflect() protoreflect.Message { - mi := &file_usage_v1_billing_proto_msgTypes[7] + mi := &file_usage_v1_billing_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -523,7 +599,7 @@ func (x *SetBilledSessionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetBilledSessionResponse.ProtoReflect.Descriptor instead. func (*SetBilledSessionResponse) Descriptor() ([]byte, []int) { - return file_usage_v1_billing_proto_rawDescGZIP(), []int{7} + return file_usage_v1_billing_proto_rawDescGZIP(), []int{9} } var File_usage_v1_billing_proto protoreflect.FileDescriptor @@ -550,70 +626,80 @@ var file_usage_v1_billing_proto_rawDesc = []byte{ 0x0a, 0x09, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x49, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, - 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x74, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x19, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, 0x89, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x70, - 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x69, - 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x64, - 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x64, 0x69, - 0x74, 0x73, 0x22, 0x37, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, - 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x46, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, + 0x6c, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x1b, 0x0a, 0x19, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, 0x49, 0x6e, + 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, + 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x07, 0x74, + 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, + 0x74, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x22, + 0x89, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, + 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x64, 0x69, 0x74, 0x73, 0x22, 0x37, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x42, 0x69, - 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x66, - 0x72, 0x6f, 0x6d, 0x12, 0x28, 0x0a, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x1a, 0x0a, - 0x18, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x45, 0x0a, 0x06, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x59, 0x53, 0x54, 0x45, - 0x4d, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x47, 0x45, 0x42, 0x45, 0x45, 0x10, 0x01, 0x12, 0x11, 0x0a, - 0x0d, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x50, 0x45, 0x10, 0x02, - 0x32, 0x81, 0x03, 0x0a, 0x0e, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, - 0x6f, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1f, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x12, 0x47, 0x65, - 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, - 0x12, 0x23, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, - 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, - 0x0f, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, - 0x12, 0x20, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x42, 0x69, - 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x75, 0x73, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, - 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x6f, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x94, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x28, 0x0a, 0x06, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x06, + 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, - 0x70, 0x6f, 0x64, 0x2f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x65, 0x2a, 0x45, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x0e, + 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x14, 0x0a, 0x10, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x47, + 0x45, 0x42, 0x45, 0x45, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, + 0x5f, 0x53, 0x54, 0x52, 0x49, 0x50, 0x45, 0x10, 0x02, 0x32, 0xe1, 0x03, 0x0a, 0x0e, 0x42, 0x69, + 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x12, 0x1f, + 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x11, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, + 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x76, + 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x75, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x6c, + 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x75, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, + 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x70, 0x63, + 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0f, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x75, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x76, + 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x49, + 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x5b, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x2a, 0x5a, + 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x75, 0x73, 0x61, + 0x67, 0x65, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -629,36 +715,40 @@ func file_usage_v1_billing_proto_rawDescGZIP() []byte { } var file_usage_v1_billing_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_usage_v1_billing_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_usage_v1_billing_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_usage_v1_billing_proto_goTypes = []interface{}{ (System)(0), // 0: usage.v1.System (*UpdateInvoicesRequest)(nil), // 1: usage.v1.UpdateInvoicesRequest (*UpdateInvoicesResponse)(nil), // 2: usage.v1.UpdateInvoicesResponse - (*GetUpcomingInvoiceRequest)(nil), // 3: usage.v1.GetUpcomingInvoiceRequest - (*GetUpcomingInvoiceResponse)(nil), // 4: usage.v1.GetUpcomingInvoiceResponse - (*FinalizeInvoiceRequest)(nil), // 5: usage.v1.FinalizeInvoiceRequest - (*FinalizeInvoiceResponse)(nil), // 6: usage.v1.FinalizeInvoiceResponse - (*SetBilledSessionRequest)(nil), // 7: usage.v1.SetBilledSessionRequest - (*SetBilledSessionResponse)(nil), // 8: usage.v1.SetBilledSessionResponse - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*BilledSession)(nil), // 10: usage.v1.BilledSession + (*ReconcileInvoicesRequest)(nil), // 3: usage.v1.ReconcileInvoicesRequest + (*ReconcileInvoicesResponse)(nil), // 4: usage.v1.ReconcileInvoicesResponse + (*GetUpcomingInvoiceRequest)(nil), // 5: usage.v1.GetUpcomingInvoiceRequest + (*GetUpcomingInvoiceResponse)(nil), // 6: usage.v1.GetUpcomingInvoiceResponse + (*FinalizeInvoiceRequest)(nil), // 7: usage.v1.FinalizeInvoiceRequest + (*FinalizeInvoiceResponse)(nil), // 8: usage.v1.FinalizeInvoiceResponse + (*SetBilledSessionRequest)(nil), // 9: usage.v1.SetBilledSessionRequest + (*SetBilledSessionResponse)(nil), // 10: usage.v1.SetBilledSessionResponse + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp + (*BilledSession)(nil), // 12: usage.v1.BilledSession } var file_usage_v1_billing_proto_depIdxs = []int32{ - 9, // 0: usage.v1.UpdateInvoicesRequest.start_time:type_name -> google.protobuf.Timestamp - 9, // 1: usage.v1.UpdateInvoicesRequest.end_time:type_name -> google.protobuf.Timestamp - 10, // 2: usage.v1.UpdateInvoicesRequest.sessions:type_name -> usage.v1.BilledSession - 9, // 3: usage.v1.SetBilledSessionRequest.from:type_name -> google.protobuf.Timestamp + 11, // 0: usage.v1.UpdateInvoicesRequest.start_time:type_name -> google.protobuf.Timestamp + 11, // 1: usage.v1.UpdateInvoicesRequest.end_time:type_name -> google.protobuf.Timestamp + 12, // 2: usage.v1.UpdateInvoicesRequest.sessions:type_name -> usage.v1.BilledSession + 11, // 3: usage.v1.SetBilledSessionRequest.from:type_name -> google.protobuf.Timestamp 0, // 4: usage.v1.SetBilledSessionRequest.system:type_name -> usage.v1.System 1, // 5: usage.v1.BillingService.UpdateInvoices:input_type -> usage.v1.UpdateInvoicesRequest - 3, // 6: usage.v1.BillingService.GetUpcomingInvoice:input_type -> usage.v1.GetUpcomingInvoiceRequest - 5, // 7: usage.v1.BillingService.FinalizeInvoice:input_type -> usage.v1.FinalizeInvoiceRequest - 7, // 8: usage.v1.BillingService.SetBilledSession:input_type -> usage.v1.SetBilledSessionRequest - 2, // 9: usage.v1.BillingService.UpdateInvoices:output_type -> usage.v1.UpdateInvoicesResponse - 4, // 10: usage.v1.BillingService.GetUpcomingInvoice:output_type -> usage.v1.GetUpcomingInvoiceResponse - 6, // 11: usage.v1.BillingService.FinalizeInvoice:output_type -> usage.v1.FinalizeInvoiceResponse - 8, // 12: usage.v1.BillingService.SetBilledSession:output_type -> usage.v1.SetBilledSessionResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type + 3, // 6: usage.v1.BillingService.ReconcileInvoices:input_type -> usage.v1.ReconcileInvoicesRequest + 5, // 7: usage.v1.BillingService.GetUpcomingInvoice:input_type -> usage.v1.GetUpcomingInvoiceRequest + 7, // 8: usage.v1.BillingService.FinalizeInvoice:input_type -> usage.v1.FinalizeInvoiceRequest + 9, // 9: usage.v1.BillingService.SetBilledSession:input_type -> usage.v1.SetBilledSessionRequest + 2, // 10: usage.v1.BillingService.UpdateInvoices:output_type -> usage.v1.UpdateInvoicesResponse + 4, // 11: usage.v1.BillingService.ReconcileInvoices:output_type -> usage.v1.ReconcileInvoicesResponse + 6, // 12: usage.v1.BillingService.GetUpcomingInvoice:output_type -> usage.v1.GetUpcomingInvoiceResponse + 8, // 13: usage.v1.BillingService.FinalizeInvoice:output_type -> usage.v1.FinalizeInvoiceResponse + 10, // 14: usage.v1.BillingService.SetBilledSession:output_type -> usage.v1.SetBilledSessionResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] 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 @@ -696,7 +786,7 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUpcomingInvoiceRequest); i { + switch v := v.(*ReconcileInvoicesRequest); i { case 0: return &v.state case 1: @@ -708,7 +798,7 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUpcomingInvoiceResponse); i { + switch v := v.(*ReconcileInvoicesResponse); i { case 0: return &v.state case 1: @@ -720,7 +810,7 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FinalizeInvoiceRequest); i { + switch v := v.(*GetUpcomingInvoiceRequest); i { case 0: return &v.state case 1: @@ -732,7 +822,7 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FinalizeInvoiceResponse); i { + switch v := v.(*GetUpcomingInvoiceResponse); i { case 0: return &v.state case 1: @@ -744,7 +834,7 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetBilledSessionRequest); i { + switch v := v.(*FinalizeInvoiceRequest); i { case 0: return &v.state case 1: @@ -756,6 +846,30 @@ func file_usage_v1_billing_proto_init() { } } file_usage_v1_billing_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FinalizeInvoiceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_usage_v1_billing_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetBilledSessionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_usage_v1_billing_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetBilledSessionResponse); i { case 0: return &v.state @@ -768,7 +882,7 @@ func file_usage_v1_billing_proto_init() { } } } - file_usage_v1_billing_proto_msgTypes[2].OneofWrappers = []interface{}{ + file_usage_v1_billing_proto_msgTypes[4].OneofWrappers = []interface{}{ (*GetUpcomingInvoiceRequest_TeamId)(nil), (*GetUpcomingInvoiceRequest_UserId)(nil), } @@ -778,7 +892,7 @@ func file_usage_v1_billing_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_usage_v1_billing_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/components/usage-api/go/v1/billing_grpc.pb.go b/components/usage-api/go/v1/billing_grpc.pb.go index e1c603801666a7..a96bf2bdaca1b2 100644 --- a/components/usage-api/go/v1/billing_grpc.pb.go +++ b/components/usage-api/go/v1/billing_grpc.pb.go @@ -30,6 +30,9 @@ type BillingServiceClient interface { // in a billing system. // This is an Internal RPC used by the usage reconciler and not intended for general consumption. UpdateInvoices(ctx context.Context, in *UpdateInvoicesRequest, opts ...grpc.CallOption) (*UpdateInvoicesResponse, error) + // ReconcileInvoices retrieves current credit balance and reflects it in billing system. + // Internal RPC, not intended for general consumption. + ReconcileInvoices(ctx context.Context, in *ReconcileInvoicesRequest, opts ...grpc.CallOption) (*ReconcileInvoicesResponse, error) // GetUpcomingInvoice retrieves the latest invoice for a given query. GetUpcomingInvoice(ctx context.Context, in *GetUpcomingInvoiceRequest, opts ...grpc.CallOption) (*GetUpcomingInvoiceResponse, error) // FinalizeInvoice marks all sessions occurring in the given Stripe invoice as @@ -56,6 +59,15 @@ func (c *billingServiceClient) UpdateInvoices(ctx context.Context, in *UpdateInv return out, nil } +func (c *billingServiceClient) ReconcileInvoices(ctx context.Context, in *ReconcileInvoicesRequest, opts ...grpc.CallOption) (*ReconcileInvoicesResponse, error) { + out := new(ReconcileInvoicesResponse) + err := c.cc.Invoke(ctx, "/usage.v1.BillingService/ReconcileInvoices", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *billingServiceClient) GetUpcomingInvoice(ctx context.Context, in *GetUpcomingInvoiceRequest, opts ...grpc.CallOption) (*GetUpcomingInvoiceResponse, error) { out := new(GetUpcomingInvoiceResponse) err := c.cc.Invoke(ctx, "/usage.v1.BillingService/GetUpcomingInvoice", in, out, opts...) @@ -91,6 +103,9 @@ type BillingServiceServer interface { // in a billing system. // This is an Internal RPC used by the usage reconciler and not intended for general consumption. UpdateInvoices(context.Context, *UpdateInvoicesRequest) (*UpdateInvoicesResponse, error) + // ReconcileInvoices retrieves current credit balance and reflects it in billing system. + // Internal RPC, not intended for general consumption. + ReconcileInvoices(context.Context, *ReconcileInvoicesRequest) (*ReconcileInvoicesResponse, error) // GetUpcomingInvoice retrieves the latest invoice for a given query. GetUpcomingInvoice(context.Context, *GetUpcomingInvoiceRequest) (*GetUpcomingInvoiceResponse, error) // FinalizeInvoice marks all sessions occurring in the given Stripe invoice as @@ -108,6 +123,9 @@ type UnimplementedBillingServiceServer struct { func (UnimplementedBillingServiceServer) UpdateInvoices(context.Context, *UpdateInvoicesRequest) (*UpdateInvoicesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateInvoices not implemented") } +func (UnimplementedBillingServiceServer) ReconcileInvoices(context.Context, *ReconcileInvoicesRequest) (*ReconcileInvoicesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReconcileInvoices not implemented") +} func (UnimplementedBillingServiceServer) GetUpcomingInvoice(context.Context, *GetUpcomingInvoiceRequest) (*GetUpcomingInvoiceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUpcomingInvoice not implemented") } @@ -148,6 +166,24 @@ func _BillingService_UpdateInvoices_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _BillingService_ReconcileInvoices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ReconcileInvoicesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(BillingServiceServer).ReconcileInvoices(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/usage.v1.BillingService/ReconcileInvoices", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(BillingServiceServer).ReconcileInvoices(ctx, req.(*ReconcileInvoicesRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _BillingService_GetUpcomingInvoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetUpcomingInvoiceRequest) if err := dec(in); err != nil { @@ -213,6 +249,10 @@ var BillingService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateInvoices", Handler: _BillingService_UpdateInvoices_Handler, }, + { + MethodName: "ReconcileInvoices", + Handler: _BillingService_ReconcileInvoices_Handler, + }, { MethodName: "GetUpcomingInvoice", Handler: _BillingService_GetUpcomingInvoice_Handler, diff --git a/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.d.ts b/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.d.ts index 0ee95459faa04f..de8fdddcd67143 100644 --- a/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.d.ts +++ b/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.d.ts @@ -17,6 +17,7 @@ import * as usage_v1_usage_pb from "../../usage/v1/usage_pb"; interface IBillingServiceService extends grpc.ServiceDefinition { updateInvoices: IBillingServiceService_IUpdateInvoices; + reconcileInvoices: IBillingServiceService_IReconcileInvoices; getUpcomingInvoice: IBillingServiceService_IGetUpcomingInvoice; finalizeInvoice: IBillingServiceService_IFinalizeInvoice; setBilledSession: IBillingServiceService_ISetBilledSession; @@ -31,6 +32,15 @@ interface IBillingServiceService_IUpdateInvoices extends grpc.MethodDefinition; responseDeserialize: grpc.deserialize; } +interface IBillingServiceService_IReconcileInvoices extends grpc.MethodDefinition { + path: "/usage.v1.BillingService/ReconcileInvoices"; + requestStream: false; + responseStream: false; + requestSerialize: grpc.serialize; + requestDeserialize: grpc.deserialize; + responseSerialize: grpc.serialize; + responseDeserialize: grpc.deserialize; +} interface IBillingServiceService_IGetUpcomingInvoice extends grpc.MethodDefinition { path: "/usage.v1.BillingService/GetUpcomingInvoice"; requestStream: false; @@ -63,6 +73,7 @@ export const BillingServiceService: IBillingServiceService; export interface IBillingServiceServer extends grpc.UntypedServiceImplementation { updateInvoices: grpc.handleUnaryCall; + reconcileInvoices: grpc.handleUnaryCall; getUpcomingInvoice: grpc.handleUnaryCall; finalizeInvoice: grpc.handleUnaryCall; setBilledSession: grpc.handleUnaryCall; @@ -72,6 +83,9 @@ export interface IBillingServiceClient { updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; + reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; + reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; + reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; @@ -88,6 +102,9 @@ export class BillingServiceClient extends grpc.Client implements IBillingService public updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; public updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; public updateInvoices(request: usage_v1_billing_pb.UpdateInvoicesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.UpdateInvoicesResponse) => void): grpc.ClientUnaryCall; + public reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; + public reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; + public reconcileInvoices(request: usage_v1_billing_pb.ReconcileInvoicesRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.ReconcileInvoicesResponse) => void): grpc.ClientUnaryCall; public getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; public getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; public getUpcomingInvoice(request: usage_v1_billing_pb.GetUpcomingInvoiceRequest, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: usage_v1_billing_pb.GetUpcomingInvoiceResponse) => void): grpc.ClientUnaryCall; diff --git a/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.js b/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.js index 41d6bb903d14de..532d04709d9bb5 100644 --- a/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.js +++ b/components/usage-api/typescript/src/usage/v1/billing_grpc_pb.js @@ -56,6 +56,28 @@ function deserialize_usage_v1_GetUpcomingInvoiceResponse(buffer_arg) { return usage_v1_billing_pb.GetUpcomingInvoiceResponse.deserializeBinary(new Uint8Array(buffer_arg)); } +function serialize_usage_v1_ReconcileInvoicesRequest(arg) { + if (!(arg instanceof usage_v1_billing_pb.ReconcileInvoicesRequest)) { + throw new Error('Expected argument of type usage.v1.ReconcileInvoicesRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_usage_v1_ReconcileInvoicesRequest(buffer_arg) { + return usage_v1_billing_pb.ReconcileInvoicesRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_usage_v1_ReconcileInvoicesResponse(arg) { + if (!(arg instanceof usage_v1_billing_pb.ReconcileInvoicesResponse)) { + throw new Error('Expected argument of type usage.v1.ReconcileInvoicesResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_usage_v1_ReconcileInvoicesResponse(buffer_arg) { + return usage_v1_billing_pb.ReconcileInvoicesResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + function serialize_usage_v1_SetBilledSessionRequest(arg) { if (!(arg instanceof usage_v1_billing_pb.SetBilledSessionRequest)) { throw new Error('Expected argument of type usage.v1.SetBilledSessionRequest'); @@ -116,6 +138,19 @@ updateInvoices: { responseSerialize: serialize_usage_v1_UpdateInvoicesResponse, responseDeserialize: deserialize_usage_v1_UpdateInvoicesResponse, }, + // ReconcileInvoices retrieves current credit balance and reflects it in billing system. +// Internal RPC, not intended for general consumption. +reconcileInvoices: { + path: '/usage.v1.BillingService/ReconcileInvoices', + requestStream: false, + responseStream: false, + requestType: usage_v1_billing_pb.ReconcileInvoicesRequest, + responseType: usage_v1_billing_pb.ReconcileInvoicesResponse, + requestSerialize: serialize_usage_v1_ReconcileInvoicesRequest, + requestDeserialize: deserialize_usage_v1_ReconcileInvoicesRequest, + responseSerialize: serialize_usage_v1_ReconcileInvoicesResponse, + responseDeserialize: deserialize_usage_v1_ReconcileInvoicesResponse, + }, // GetUpcomingInvoice retrieves the latest invoice for a given query. getUpcomingInvoice: { path: '/usage.v1.BillingService/GetUpcomingInvoice', diff --git a/components/usage-api/typescript/src/usage/v1/billing_pb.d.ts b/components/usage-api/typescript/src/usage/v1/billing_pb.d.ts index 89706e8be3671b..ffe8e713c00751 100644 --- a/components/usage-api/typescript/src/usage/v1/billing_pb.d.ts +++ b/components/usage-api/typescript/src/usage/v1/billing_pb.d.ts @@ -68,6 +68,40 @@ export namespace UpdateInvoicesResponse { } } +export class ReconcileInvoicesRequest extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ReconcileInvoicesRequest.AsObject; + static toObject(includeInstance: boolean, msg: ReconcileInvoicesRequest): ReconcileInvoicesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ReconcileInvoicesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ReconcileInvoicesRequest; + static deserializeBinaryFromReader(message: ReconcileInvoicesRequest, reader: jspb.BinaryReader): ReconcileInvoicesRequest; +} + +export namespace ReconcileInvoicesRequest { + export type AsObject = { + } +} + +export class ReconcileInvoicesResponse extends jspb.Message { + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ReconcileInvoicesResponse.AsObject; + static toObject(includeInstance: boolean, msg: ReconcileInvoicesResponse): ReconcileInvoicesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ReconcileInvoicesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ReconcileInvoicesResponse; + static deserializeBinaryFromReader(message: ReconcileInvoicesResponse, reader: jspb.BinaryReader): ReconcileInvoicesResponse; +} + +export namespace ReconcileInvoicesResponse { + export type AsObject = { + } +} + export class GetUpcomingInvoiceRequest extends jspb.Message { hasTeamId(): boolean; diff --git a/components/usage-api/typescript/src/usage/v1/billing_pb.js b/components/usage-api/typescript/src/usage/v1/billing_pb.js index d1301162c46f2f..fa7a8c1502d77a 100644 --- a/components/usage-api/typescript/src/usage/v1/billing_pb.js +++ b/components/usage-api/typescript/src/usage/v1/billing_pb.js @@ -30,6 +30,8 @@ goog.exportSymbol('proto.usage.v1.FinalizeInvoiceResponse', null, global); goog.exportSymbol('proto.usage.v1.GetUpcomingInvoiceRequest', null, global); goog.exportSymbol('proto.usage.v1.GetUpcomingInvoiceRequest.IdentifierCase', null, global); goog.exportSymbol('proto.usage.v1.GetUpcomingInvoiceResponse', null, global); +goog.exportSymbol('proto.usage.v1.ReconcileInvoicesRequest', null, global); +goog.exportSymbol('proto.usage.v1.ReconcileInvoicesResponse', null, global); goog.exportSymbol('proto.usage.v1.SetBilledSessionRequest', null, global); goog.exportSymbol('proto.usage.v1.SetBilledSessionResponse', null, global); goog.exportSymbol('proto.usage.v1.System', null, global); @@ -77,6 +79,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.usage.v1.UpdateInvoicesResponse.displayName = 'proto.usage.v1.UpdateInvoicesResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.usage.v1.ReconcileInvoicesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.usage.v1.ReconcileInvoicesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.usage.v1.ReconcileInvoicesRequest.displayName = 'proto.usage.v1.ReconcileInvoicesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.usage.v1.ReconcileInvoicesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.usage.v1.ReconcileInvoicesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.usage.v1.ReconcileInvoicesResponse.displayName = 'proto.usage.v1.ReconcileInvoicesResponse'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -597,6 +641,208 @@ proto.usage.v1.UpdateInvoicesResponse.serializeBinaryToWriter = function(message + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.usage.v1.ReconcileInvoicesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.usage.v1.ReconcileInvoicesRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.usage.v1.ReconcileInvoicesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.usage.v1.ReconcileInvoicesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.usage.v1.ReconcileInvoicesRequest} + */ +proto.usage.v1.ReconcileInvoicesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.usage.v1.ReconcileInvoicesRequest; + return proto.usage.v1.ReconcileInvoicesRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.usage.v1.ReconcileInvoicesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.usage.v1.ReconcileInvoicesRequest} + */ +proto.usage.v1.ReconcileInvoicesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.usage.v1.ReconcileInvoicesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.usage.v1.ReconcileInvoicesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.usage.v1.ReconcileInvoicesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.usage.v1.ReconcileInvoicesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.usage.v1.ReconcileInvoicesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.usage.v1.ReconcileInvoicesResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.usage.v1.ReconcileInvoicesResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.usage.v1.ReconcileInvoicesResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.usage.v1.ReconcileInvoicesResponse} + */ +proto.usage.v1.ReconcileInvoicesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.usage.v1.ReconcileInvoicesResponse; + return proto.usage.v1.ReconcileInvoicesResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.usage.v1.ReconcileInvoicesResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.usage.v1.ReconcileInvoicesResponse} + */ +proto.usage.v1.ReconcileInvoicesResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.usage.v1.ReconcileInvoicesResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.usage.v1.ReconcileInvoicesResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.usage.v1.ReconcileInvoicesResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.usage.v1.ReconcileInvoicesResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all diff --git a/components/usage-api/usage/v1/billing.proto b/components/usage-api/usage/v1/billing.proto index 796ff0b8cebf73..638aa4b2c4fefa 100644 --- a/components/usage-api/usage/v1/billing.proto +++ b/components/usage-api/usage/v1/billing.proto @@ -13,6 +13,10 @@ service BillingService { // This is an Internal RPC used by the usage reconciler and not intended for general consumption. rpc UpdateInvoices(UpdateInvoicesRequest) returns (UpdateInvoicesResponse) {}; + // ReconcileInvoices retrieves current credit balance and reflects it in billing system. + // Internal RPC, not intended for general consumption. + rpc ReconcileInvoices(ReconcileInvoicesRequest) returns (ReconcileInvoicesResponse) {}; + // GetUpcomingInvoice retrieves the latest invoice for a given query. rpc GetUpcomingInvoice(GetUpcomingInvoiceRequest) returns (GetUpcomingInvoiceResponse) {}; @@ -36,6 +40,10 @@ message UpdateInvoicesRequest { message UpdateInvoicesResponse { } +message ReconcileInvoicesRequest {} + +message ReconcileInvoicesResponse {} + message GetUpcomingInvoiceRequest { oneof identifier { string team_id = 1;