@@ -3,11 +3,12 @@ package tfe
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "net/url"
6
7
)
7
8
8
9
type StackDeploymentGroups interface {
9
10
// List returns a list of Deployment Groups in a stack.
10
- List (ctx context.Context , stackConfigID string ) (* StackDeploymentGroupList , error )
11
+ List (ctx context.Context , stackConfigID string , options * StackDeploymentGroupListOptions ) (* StackDeploymentGroupList , error )
11
12
}
12
13
13
14
type DeploymentGroupStatus string
@@ -50,12 +51,20 @@ type StackDeploymentGroupList struct {
50
51
Items []* StackDeploymentGroup
51
52
}
52
53
53
- func (s stackDeploymentGroups ) List (ctx context.Context , stackConfigID string ) (* StackDeploymentGroupList , error ) {
54
+ type StackDeploymentGroupListOptions struct {
55
+ ListOptions
56
+ }
57
+
58
+ func (s stackDeploymentGroups ) List (ctx context.Context , stackConfigID string , options * StackDeploymentGroupListOptions ) (* StackDeploymentGroupList , error ) {
54
59
if ! validStringID (& stackConfigID ) {
55
60
return nil , fmt .Errorf ("invalid stack configuration ID: %s" , stackConfigID )
56
61
}
57
62
58
- req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stack-configurations/%s/stack-deployment-groups" , stackConfigID ), nil )
63
+ if options == nil {
64
+ options = & StackDeploymentGroupListOptions {}
65
+ }
66
+
67
+ req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stack-configurations/%s/stack-deployment-groups" , url .PathEscape (stackConfigID )), options )
59
68
if err != nil {
60
69
return nil , err
61
70
}
0 commit comments