Skip to content

Commit a7f69e3

Browse files
authored
Merge branch 'main' into netramali/TF-22972-add-project-varset-permission-to-team-project
2 parents b7c71ca + 41f4c7a commit a7f69e3

File tree

5 files changed

+21
-85
lines changed

5 files changed

+21
-85
lines changed

README.md

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -113,78 +113,6 @@ if err != nil {
113113

114114
For complete usage of the API client, see the [full package docs](https://pkg.go.dev/github.com/hashicorp/go-tfe).
115115

116-
## API Coverage
117-
118-
This API client covers most of the existing HCP Terraform API calls and is updated regularly to add new or missing endpoints.
119-
120-
- [x] Account
121-
- [x] Agents
122-
- [x] Agent Pools
123-
- [x] Agent Tokens
124-
- [x] Applies
125-
- [x] Audit Trails
126-
- [x] Changelog
127-
- [x] Comments
128-
- [x] Configuration Versions
129-
- [x] Cost Estimation
130-
- [ ] Feature Sets
131-
- [ ] Invoices
132-
- [x] IP Ranges
133-
- [x] Notification Configurations
134-
- [x] OAuth Clients
135-
- [x] OAuth Tokens
136-
- [x] Organizations
137-
- [x] Organization Memberships
138-
- [x] Organization Tags
139-
- [x] Organization Tokens
140-
- [x] Plan Exports
141-
- [x] Plans
142-
- [x] Policies
143-
- [x] Policy Checks
144-
- [x] Policy Sets
145-
- [x] Policy Set Parameters
146-
- [x] Private Registry
147-
- [x] Modules
148-
- [x] No-Code Modules
149-
- [x] Providers
150-
- [x] Provider Versions and Platforms
151-
- [x] GPG Keys
152-
- [x] Projects
153-
- [x] Runs
154-
- [x] Run Events
155-
- [x] Run Tasks
156-
- [x] Run Tasks Integration
157-
- [x] Run Triggers
158-
- [x] SSH Keys
159-
- [x] Stability Policy
160-
- [x] State Versions
161-
- [x] State Version Outputs
162-
- [ ] Subscriptions
163-
- [x] Team Access
164-
- [x] Team Membership
165-
- [x] Team Tokens
166-
- [x] Teams
167-
- [x] Test Runs
168-
- [x] User Tokens
169-
- [x] Users
170-
- [x] Variable Sets
171-
- [x] Variables
172-
- [ ] VCS Events
173-
- [x] Workspaces
174-
- [x] Workspace-Specific Variables
175-
- [x] Workspace Resources
176-
- [x] Admin
177-
- [x] Module Sharing
178-
- [x] Organizations
179-
- [x] Runs
180-
- [x] Settings
181-
- [x] Terraform Versions
182-
- [x] OPA Versions
183-
- [x] Sentinel Versions
184-
- [x] Users
185-
- [x] Workspaces
186-
187-
188116
## Examples
189117

190118
See the [examples directory](https://github.com/hashicorp/go-tfe/tree/main/examples).

stack.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ type StackVCSRepo struct {
7575
OAuthTokenID string `jsonapi:"attr,oauth-token-id,omitempty"`
7676
}
7777

78+
// StackVCSRepoOptions
79+
type StackVCSRepoOptions struct {
80+
Identifier string `json:"identifier"`
81+
Branch string `json:"branch,omitempty"`
82+
GHAInstallationID string `json:"github-app-installation-id,omitempty"`
83+
OAuthTokenID string `json:"oauth-token-id,omitempty"`
84+
}
85+
7886
// Stack represents a stack.
7987
type Stack struct {
8088
ID string `jsonapi:"primary,stacks"`
@@ -172,11 +180,11 @@ type StackReadOptions struct {
172180
// StackCreateOptions represents the options for creating a stack. The project
173181
// relation is required.
174182
type StackCreateOptions struct {
175-
Type string `jsonapi:"primary,stacks"`
176-
Name string `jsonapi:"attr,name"`
177-
Description *string `jsonapi:"attr,description,omitempty"`
178-
VCSRepo *StackVCSRepo `jsonapi:"attr,vcs-repo"`
179-
Project *Project `jsonapi:"relation,project"`
183+
Type string `jsonapi:"primary,stacks"`
184+
Name string `jsonapi:"attr,name"`
185+
Description *string `jsonapi:"attr,description,omitempty"`
186+
VCSRepo *StackVCSRepoOptions `jsonapi:"attr,vcs-repo"`
187+
Project *Project `jsonapi:"relation,project"`
180188
}
181189

182190
// StackUpdateOptions represents the options for updating a stack.
@@ -326,7 +334,7 @@ func (s StackCreateOptions) valid() error {
326334
return s.VCSRepo.valid()
327335
}
328336

329-
func (s StackVCSRepo) valid() error {
337+
func (s StackVCSRepoOptions) valid() error {
330338
if s.Identifier == "" {
331339
return ErrRequiredVCSRepo
332340
}

stack_integration_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestStackCreateAndList(t *testing.T) {
3131

3232
stack1, err := client.Stacks.Create(ctx, StackCreateOptions{
3333
Name: "aa-test-stack",
34-
VCSRepo: &StackVCSRepo{
34+
VCSRepo: &StackVCSRepoOptions{
3535
Identifier: "hashicorp-guides/pet-nulls-stack",
3636
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
3737
},
@@ -45,7 +45,7 @@ func TestStackCreateAndList(t *testing.T) {
4545

4646
stack2, err := client.Stacks.Create(ctx, StackCreateOptions{
4747
Name: "zz-test-stack",
48-
VCSRepo: &StackVCSRepo{
48+
VCSRepo: &StackVCSRepoOptions{
4949
Identifier: "hashicorp-guides/pet-nulls-stack",
5050
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
5151
},
@@ -143,7 +143,7 @@ func TestStackReadUpdateDelete(t *testing.T) {
143143

144144
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
145145
Name: "test-stack",
146-
VCSRepo: &StackVCSRepo{
146+
VCSRepo: &StackVCSRepoOptions{
147147
Identifier: "brandonc/pet-nulls-stack",
148148
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
149149
Branch: "main",
@@ -200,7 +200,7 @@ func TestStackReadUpdateForceDelete(t *testing.T) {
200200

201201
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
202202
Name: "test-stack",
203-
VCSRepo: &StackVCSRepo{
203+
VCSRepo: &StackVCSRepoOptions{
204204
Identifier: "brandonc/pet-nulls-stack",
205205
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
206206
Branch: "main",
@@ -356,7 +356,7 @@ func TestStackConverged(t *testing.T) {
356356

357357
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
358358
Name: "test-stack",
359-
VCSRepo: &StackVCSRepo{
359+
VCSRepo: &StackVCSRepoOptions{
360360
Identifier: "brandonc/pet-nulls-stack",
361361
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
362362
},

stack_plan_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestStackPlanList(t *testing.T) {
2929

3030
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
3131
Name: "aa-test-stack",
32-
VCSRepo: &StackVCSRepo{
32+
VCSRepo: &StackVCSRepoOptions{
3333
Identifier: "brandonc/pet-nulls-stack",
3434
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
3535
},

stack_source_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestStackSourceCreateUploadAndRead(t *testing.T) {
2626
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
2727
Project: orgTest.DefaultProject,
2828
Name: "test-stack",
29-
VCSRepo: &StackVCSRepo{
29+
VCSRepo: &StackVCSRepoOptions{
3030
Identifier: "hashicorp-guides/pet-nulls-stack",
3131
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
3232
},

0 commit comments

Comments
 (0)