From f42957d73c7e7bc0309ddf50cf150b8e6ec0dcdf Mon Sep 17 00:00:00 2001 From: natalie-todd Date: Fri, 10 Jan 2025 10:02:27 -0800 Subject: [PATCH] Rename ToolVersionArchitecture to ToolVersionArchitectureOptions for convention --- admin_terraform_version.go | 22 ++++++++++----------- admin_terraform_version_integration_test.go | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/admin_terraform_version.go b/admin_terraform_version.go index e1d00561f..01a69f84b 100644 --- a/admin_terraform_version.go +++ b/admin_terraform_version.go @@ -62,7 +62,7 @@ type AdminTerraformVersion struct { CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"` } -type ToolVersionArchitecture struct { +type ToolVersionArchitectureOptions struct { URL string `json:"url"` Sha string `json:"sha"` OS string `json:"os"` @@ -84,16 +84,16 @@ type AdminTerraformVersionsListOptions struct { // AdminTerraformVersionCreateOptions for creating a terraform version. // https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/terraform-versions#request-body type AdminTerraformVersionCreateOptions struct { - Type string `jsonapi:"primary,terraform-versions"` - Version *string `jsonapi:"attr,version"` // Required - URL *string `jsonapi:"attr,url"` // Required - Sha *string `jsonapi:"attr,sha"` // Required - 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,omitempty"` + Type string `jsonapi:"primary,terraform-versions"` + Version *string `jsonapi:"attr,version"` // Required + URL *string `jsonapi:"attr,url"` // Required + Sha *string `jsonapi:"attr,sha"` // Required + 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 []*ToolVersionArchitectureOptions `jsonapi:"attr,archs,omitempty"` } // AdminTerraformVersionUpdateOptions for updating terraform version. diff --git a/admin_terraform_version_integration_test.go b/admin_terraform_version_integration_test.go index defffeb70..67898e256 100644 --- a/admin_terraform_version_integration_test.go +++ b/admin_terraform_version_integration_test.go @@ -109,7 +109,7 @@ func TestAdminTerraformVersions_CreateDelete(t *testing.T) { Official: Bool(false), Enabled: Bool(false), Beta: Bool(false), - Archs: []*ToolVersionArchitecture{ + Archs: []*ToolVersionArchitectureOptions{ { URL: "https://www.hashicorp.com", Sha: *String(genSha(t)), @@ -219,7 +219,7 @@ func TestAdminTerraformVersions_ReadUpdate(t *testing.T) { DeprecatedReason: String("Test Reason"), Enabled: Bool(false), Beta: Bool(false), - Archs: []*ToolVersionArchitecture{{ + Archs: []*ToolVersionArchitectureOptions{{ URL: "https://www.hashicorp.com", Sha: *sha, OS: linux,