@@ -18,7 +18,7 @@ type Stacks interface {
18
18
List (ctx context.Context , organization string , options * StackListOptions ) (* StackList , error )
19
19
20
20
// Read returns a stack by its ID.
21
- Read (ctx context.Context , stackID string ) (* Stack , error )
21
+ Read (ctx context.Context , stackID string , options * StackReadOptions ) (* Stack , error )
22
22
23
23
// Create creates a new stack.
24
24
Create (ctx context.Context , options StackCreateOptions ) (* Stack , error )
@@ -143,12 +143,27 @@ type StackState struct {
143
143
ID string `jsonapi:"primary,stack-states"`
144
144
}
145
145
146
+ // StackIncludeOpt represents the include options for a stack.
147
+ type StackIncludeOpt string
148
+
149
+ const (
150
+ StackIncludeOrganization StackIncludeOpt = "organization"
151
+ StackIncludeProject StackIncludeOpt = "project"
152
+ StackIncludeLatestStackConfiguration StackIncludeOpt = "latest_stack_configuration"
153
+ StackIncludeStackDiagnostics StackIncludeOpt = "stack_diagnostics"
154
+ )
155
+
146
156
// StackListOptions represents the options for listing stacks.
147
157
type StackListOptions struct {
148
158
ListOptions
149
- ProjectID string `url:"filter[project[id]],omitempty"`
150
- Sort StackSortColumn `url:"sort,omitempty"`
151
- SearchByName string `url:"search[name],omitempty"`
159
+ ProjectID string `url:"filter[project[id]],omitempty"`
160
+ Sort StackSortColumn `url:"sort,omitempty"`
161
+ SearchByName string `url:"search[name],omitempty"`
162
+ Include []StackIncludeOpt `url:"include,omitempty"`
163
+ }
164
+
165
+ type StackReadOptions struct {
166
+ Include []StackIncludeOpt `url:"include,omitempty"`
152
167
}
153
168
154
169
// StackCreateOptions represents the options for creating a stack. The project
@@ -221,8 +236,8 @@ func (s stacks) List(ctx context.Context, organization string, options *StackLis
221
236
}
222
237
223
238
// Read returns a stack by its ID.
224
- func (s stacks ) Read (ctx context.Context , stackID string ) (* Stack , error ) {
225
- req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stacks/%s" , url .PathEscape (stackID )), nil )
239
+ func (s stacks ) Read (ctx context.Context , stackID string , options * StackReadOptions ) (* Stack , error ) {
240
+ req , err := s .client .NewRequest ("GET" , fmt .Sprintf ("stacks/%s" , url .PathEscape (stackID )), options )
226
241
if err != nil {
227
242
return nil , err
228
243
}
0 commit comments