Skip to content

Commit f432406

Browse files
Kelsi HoyleKelsi Hoyle
authored andcommitted
make archs optional on patch
1 parent 32d39c5 commit f432406

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

admin_terraform_version.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,16 @@ type AdminTerraformVersionCreateOptions struct {
9999
// AdminTerraformVersionUpdateOptions for updating terraform version.
100100
// https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/terraform-versions#request-body
101101
type AdminTerraformVersionUpdateOptions struct {
102-
Type string `jsonapi:"primary,terraform-versions"`
103-
Version *string `jsonapi:"attr,version,omitempty"`
104-
URL *string `jsonapi:"attr,url,omitempty"`
105-
Sha *string `jsonapi:"attr,sha,omitempty"`
106-
Official *bool `jsonapi:"attr,official,omitempty"`
107-
Deprecated *bool `jsonapi:"attr,deprecated,omitempty"`
108-
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
109-
Enabled *bool `jsonapi:"attr,enabled,omitempty"`
110-
Beta *bool `jsonapi:"attr,beta,omitempty"`
102+
Type string `jsonapi:"primary,terraform-versions"`
103+
Version *string `jsonapi:"attr,version,omitempty"`
104+
URL *string `jsonapi:"attr,url,omitempty"`
105+
Sha *string `jsonapi:"attr,sha,omitempty"`
106+
Official *bool `jsonapi:"attr,official,omitempty"`
107+
Deprecated *bool `jsonapi:"attr,deprecated,omitempty"`
108+
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
109+
Enabled *bool `jsonapi:"attr,enabled,omitempty"`
110+
Beta *bool `jsonapi:"attr,beta,omitempty"`
111+
Archs []*ToolVersionArchitectureOptions `jsonapi:"attr,archs,omitempty"`
111112
}
112113

113114
// AdminTerraformVersionsList represents a list of terraform versions.

examples/projects/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,23 @@ func main() {
2828

2929
// Create a new project
3030
p, err := client.Projects.Create(ctx, "org-test", tfe.ProjectCreateOptions{
31-
Name: "my-app-tst",
31+
Name: "my-app-tst",
3232
})
3333
if err != nil {
3434
log.Fatal(err)
3535
}
3636

3737
// Update the project auto destroy activity duration
3838
p, err = client.Projects.Update(ctx, p.ID, tfe.ProjectUpdateOptions{
39-
AutoDestroyActivityDuration: jsonapi.NewNullableAttrWithValue("3d"),
39+
AutoDestroyActivityDuration: jsonapi.NewNullableAttrWithValue("3d"),
4040
})
4141
if err != nil {
4242
log.Fatal(err)
4343
}
4444

4545
// Disable auto destroy
4646
p, err = client.Projects.Update(ctx, p.ID, tfe.ProjectUpdateOptions{
47-
AutoDestroyActivityDuration: jsonapi.NewNullNullableAttr[string](),
47+
AutoDestroyActivityDuration: jsonapi.NewNullNullableAttr[string](),
4848
})
4949
if err != nil {
5050
log.Fatal(err)

0 commit comments

Comments
 (0)