Skip to content

Commit 7a814fd

Browse files
author
Andrew Farries
committed
Rename GetBilledUsage method in server impl
1 parent dcb709b commit 7a814fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/usage/pkg/apiv1/usage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type UsageService struct {
2222
v1.UnimplementedUsageServiceServer
2323
}
2424

25-
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (*v1.GetBilledUsageResponse, error) {
25+
func (us *UsageService) ListBilledUsage(ctx context.Context, in *v1.ListBilledUsageRequest) (*v1.ListBilledUsageResponse, error) {
2626
usageRecords, err := db.ListUsage(ctx, us.conn, db.AttributionID(in.GetAttributionId()))
2727
if err != nil {
2828
return nil, status.Error(codes.Internal, "unable to retrieve billed usage")
@@ -50,7 +50,7 @@ func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsag
5050
billedSessions = append(billedSessions, billedSession)
5151
}
5252

53-
return &v1.GetBilledUsageResponse{
53+
return &v1.ListBilledUsageResponse{
5454
Sessions: billedSessions,
5555
}, nil
5656
}

components/usage/pkg/apiv1/usage_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"google.golang.org/protobuf/types/known/timestamppb"
2323
)
2424

25-
func TestUsageService_GetBilledUsage(t *testing.T) {
25+
func TestUsageService_ListBilledUsage(t *testing.T) {
2626
srv := baseserver.NewForTests(t,
2727
baseserver.WithGRPC(baseserver.MustUseRandomLocalAddress(t)),
2828
)
@@ -75,7 +75,7 @@ func TestUsageService_GetBilledUsage(t *testing.T) {
7575

7676
for _, scenario := range scenarios {
7777
t.Run(scenario.name, func(t *testing.T) {
78-
resp, err := client.GetBilledUsage(ctx, &v1.GetBilledUsageRequest{
78+
resp, err := client.ListBilledUsage(ctx, &v1.ListBilledUsageRequest{
7979
AttributionId: scenario.AttributionID,
8080
})
8181
var instanceIds []string

0 commit comments

Comments
 (0)