Skip to content

Commit a43e804

Browse files
authored
list: add Limit field to ListResult (#1182)
1 parent 4bb3f89 commit a43e804

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

internal/fwserver/server_listresource.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ type ListRequest struct {
2929
// Resource field in the ListResult struct.
3030
IncludeResource bool
3131

32+
// Limit specifies the maximum number of results that Terraform is
33+
// expecting.
34+
Limit int64
35+
3236
ResourceSchema fwschema.Schema
3337
ResourceIdentitySchema fwschema.Schema
3438
}
@@ -91,6 +95,7 @@ func (s *Server) ListResource(ctx context.Context, fwReq *ListRequest, fwStream
9195
req := list.ListRequest{
9296
Config: *fwReq.Config,
9397
IncludeResource: fwReq.IncludeResource,
98+
Limit: fwReq.Limit,
9499
ResourceSchema: fwReq.ResourceSchema,
95100
ResourceIdentitySchema: fwReq.ResourceIdentitySchema,
96101
}

internal/proto5server/server_listresource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov5.ListResou
6565
ResourceSchema: resourceSchema,
6666
ResourceIdentitySchema: identitySchema,
6767
IncludeResource: protoReq.IncludeResource,
68+
Limit: protoReq.Limit,
6869
}
6970
stream := &fwserver.ListResultsStream{}
7071

internal/proto6server/server_listresource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov6.ListResou
6565
ResourceSchema: resourceSchema,
6666
ResourceIdentitySchema: identitySchema,
6767
IncludeResource: protoReq.IncludeResource,
68+
Limit: protoReq.Limit,
6869
}
6970
stream := &fwserver.ListResultsStream{}
7071

list/list_resource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ type ListRequest struct {
9999
// [ListResult.Resource] field.
100100
IncludeResource bool
101101

102+
// Limit specifies the maximum number of results that Terraform is
103+
// expecting.
104+
Limit int64
105+
102106
ResourceSchema fwschema.Schema
103107
ResourceIdentitySchema fwschema.Schema
104108
}

0 commit comments

Comments
 (0)