Skip to content

Commit

Permalink
Add CHANGELOG entry, omitempty, and remove Archs from structs not use…
Browse files Browse the repository at this point in the history
…d by terraform releases
  • Loading branch information
natalie-todd committed Dec 31, 2024
1 parent 8724bc7 commit b3dc95d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

## Enhancements

* Add `Archs` field to `AdminTerraformVersionCreateOptions` by @natalie-todd [#1022](https://github.com/hashicorp/go-tfe/pull/1022)

# v1.71.0

## Enhancements
Expand Down
44 changes: 21 additions & 23 deletions admin_terraform_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,17 @@ type adminTerraformVersions struct {

// AdminTerraformVersion represents a Terraform Version
type AdminTerraformVersion struct {
ID string `jsonapi:"primary,terraform-versions"`
Version string `jsonapi:"attr,version"`
URL string `jsonapi:"attr,url"`
Sha string `jsonapi:"attr,sha"`
Deprecated bool `jsonapi:"attr,deprecated"`
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
Official bool `jsonapi:"attr,official"`
Enabled bool `jsonapi:"attr,enabled"`
Beta bool `jsonapi:"attr,beta"`
Usage int `jsonapi:"attr,usage"`
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
Archs []*ToolVersionArchitecture `jsonapi:"attr,archs"`
ID string `jsonapi:"primary,terraform-versions"`
Version string `jsonapi:"attr,version"`
URL string `jsonapi:"attr,url"`
Sha string `jsonapi:"attr,sha"`
Deprecated bool `jsonapi:"attr,deprecated"`
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
Official bool `jsonapi:"attr,official"`
Enabled bool `jsonapi:"attr,enabled"`
Beta bool `jsonapi:"attr,beta"`
Usage int `jsonapi:"attr,usage"`
CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
}

type ToolVersionArchitecture struct {
Expand Down Expand Up @@ -88,22 +87,21 @@ type AdminTerraformVersionCreateOptions struct {
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
Enabled *bool `jsonapi:"attr,enabled,omitempty"`
Beta *bool `jsonapi:"attr,beta,omitempty"`
Archs []*ToolVersionArchitecture `jsonapi:"attr,archs"`
Archs []*ToolVersionArchitecture `jsonapi:"attr,archs,omitempty"`
}

// AdminTerraformVersionUpdateOptions for updating terraform version.
// https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/terraform-versions#request-body
type AdminTerraformVersionUpdateOptions struct {
Type string `jsonapi:"primary,terraform-versions"`
Version *string `jsonapi:"attr,version,omitempty"`
URL *string `jsonapi:"attr,url,omitempty"`
Sha *string `jsonapi:"attr,sha,omitempty"`
Official *bool `jsonapi:"attr,official,omitempty"`
Deprecated *bool `jsonapi:"attr,deprecated,omitempty"`
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
Enabled *bool `jsonapi:"attr,enabled,omitempty"`
Beta *bool `jsonapi:"attr,beta,omitempty"`
Archs []*ToolVersionArchitecture `jsonapi:"attr,archs"`
Type string `jsonapi:"primary,terraform-versions"`
Version *string `jsonapi:"attr,version,omitempty"`
URL *string `jsonapi:"attr,url,omitempty"`
Sha *string `jsonapi:"attr,sha,omitempty"`
Official *bool `jsonapi:"attr,official,omitempty"`
Deprecated *bool `jsonapi:"attr,deprecated,omitempty"`
DeprecatedReason *string `jsonapi:"attr,deprecated-reason,omitempty"`
Enabled *bool `jsonapi:"attr,enabled,omitempty"`
Beta *bool `jsonapi:"attr,beta,omitempty"`
}

// AdminTerraformVersionsList represents a list of terraform versions.
Expand Down

0 comments on commit b3dc95d

Please sign in to comment.