Skip to content

Commit 8b08769

Browse files
committed
Add name filter to list options
1 parent a299d7e commit 8b08769

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stack_deployment_groups.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ type StackDeploymentGroupList struct {
6161
// StackDeploymentGroupListOptions represents additional options when listing stack deployment groups.
6262
type StackDeploymentGroupListOptions struct {
6363
ListOptions
64+
// A query string used to filter by deployment group name.
65+
GroupName string `url:"group_name,omitempty"`
6466
}
6567

6668
// List returns a list of Deployment Groups in a stack, optionally filtered by additional parameters.
@@ -69,11 +71,12 @@ func (s stackDeploymentGroups) List(ctx context.Context, stackConfigID string, o
6971
return nil, fmt.Errorf("invalid stack configuration ID: %s", stackConfigID)
7072
}
7173

72-
if options == nil {
73-
options = &StackDeploymentGroupListOptions{}
74+
u := fmt.Sprintf("stack-configurations/%s/stack-deployment-groups/", url.PathEscape(stackConfigID))
75+
qp, err := decodeQueryParams(options)
76+
if err != nil {
77+
return nil, err
7478
}
75-
76-
req, err := s.client.NewRequest("GET", fmt.Sprintf("stack-configurations/%s/stack-deployment-groups", url.PathEscape(stackConfigID)), options)
79+
req, err := s.client.NewRequestWithAdditionalQueryParams("GET", u, nil, qp)
7780
if err != nil {
7881
return nil, err
7982
}

0 commit comments

Comments
 (0)