A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/hashicorp/go-tfe below:

tfe package - github.com/hashicorp/go-tfe - Go Packages

View Source
const (
	DefaultAddress      = "https://app.terraform.io"
	DefaultBasePath     = "/api/v2/"
	DefaultRegistryPath = "/api/registry/"
	
	PingEndpoint       = "ping"
	ContentTypeJSONAPI = "application/vnd.api+json"
)
View Source
const (
	AuthenticationTokensPath = "authentication-tokens/%s"
)
View Source
var (
	ErrUnauthorized = errors.New("unauthorized")

	
	ErrResourceNotFound = errors.New("resource not found")

	
	ErrMissingDirectory = errors.New("path needs to be an existing directory")

	
	
	ErrNamespaceNotAuthorized = errors.New("namespace not authorized")
)

Generic errors applicable to all resources.

View Source
var (
	ErrUnsupportedOperations = errors.New("operations is deprecated and cannot be specified when execution mode is used")

	ErrUnsupportedPrivateKey = errors.New("private Key can only be present with Azure DevOps Server service provider")

	ErrUnsupportedBothTagsRegexAndFileTriggersEnabled = errors.New(`"TagsRegex" cannot be populated when "FileTriggersEnabled" is true`)

	ErrUnsupportedBothTagsRegexAndTriggerPatterns = errors.New(`"TagsRegex" and "TriggerPrefixes" cannot be populated at the same time`)

	ErrUnsupportedBothTagsRegexAndTriggerPrefixes = errors.New(`"TagsRegex" and "TriggerPatterns" cannot be populated at the same time`)

	ErrUnsupportedRunTriggerType = errors.New(`"RunTriggerType" must be "inbound" when requesting "include" query params`)

	ErrUnsupportedBothTriggerPatternsAndPrefixes = errors.New(`"TriggerPatterns" and "TriggerPrefixes" cannot be populated at the same time`)

	ErrUnsupportedBothNamespaceAndPrivateRegistryName = errors.New(`"Namespace" cannot be populated when "RegistryName" is "private"`)
)

Options/fields that cannot be defined

View Source
var (
	ErrItemsMustBeSlice = errors.New(`model field "Items" must be a slice`) 

	ErrInvalidRequestBody = errors.New("go-tfe bug: DELETE/PATCH/POST body must be nil, ptr, or ptr slice") 

	ErrInvalidStructFormat = errors.New("go-tfe bug: struct can't use both json and jsonapi attributes") 
)

Library errors that usually indicate a bug in the implementation of go-tfe

View Source
var (
	
	ErrWorkspaceLocked = errors.New("workspace already locked")

	
	ErrWorkspaceNotLocked = errors.New("workspace already unlocked")

	
	ErrWorkspaceLockedByRun = errors.New("unable to unlock workspace locked by run")

	
	ErrWorkspaceLockedByTeam = errors.New("unable to unlock workspace locked by team")

	
	ErrWorkspaceLockedByUser = errors.New("unable to unlock workspace locked by user")

	
	
	ErrWorkspaceLockedStateVersionStillPending = errors.New("unable to unlock workspace while state version upload is still pending")

	
	
	
	
	ErrWorkspaceStillProcessing = errors.New("conflict\nLatest workspace state is being processed to discover resources, please try again later")

	
	
	
	
	ErrWorkspaceNotSafeToDelete = errors.New("conflict\nworkspace cannot be safely deleted because it is still managing resources")

	
	
	
	ErrWorkspaceLockedCannotDelete = errors.New("conflict\nWorkspace is currently locked. Workspace must be unlocked before it can be safely deleted")
)

Resource Errors

View Source
var (
	ErrInvalidWorkspaceID = errors.New("invalid value for workspace ID")

	ErrInvalidWorkspaceValue = errors.New("invalid value for workspace")

	ErrInvalidTerraformVersionID = errors.New("invalid value for terraform version ID")

	ErrInvalidTerraformVersionType = errors.New("invalid type for terraform version. Please use 'terraform-version'")

	ErrInvalidOPAVersionID = errors.New("invalid value for OPA version ID")

	ErrInvalidSentinelVersionID = errors.New("invalid value for Sentinel version ID")

	ErrInvalidConfigVersionID = errors.New("invalid value for configuration version ID")

	ErrInvalidCostEstimateID = errors.New("invalid value for cost estimate ID")

	ErrInvalidSMTPAuth = errors.New("invalid smtp auth type")

	ErrInvalidAgentPoolID = errors.New("invalid value for agent pool ID")

	ErrInvalidAgentTokenID = errors.New("invalid value for agent token ID")

	ErrInvalidRunID = errors.New("invalid value for run ID")

	ErrInvalidRunEventID = errors.New("invalid value for run event ID")

	ErrInvalidProjectID = errors.New("invalid value for project ID")


	ErrInvalidReservedTagKeyID = errors.New("invalid value for reserved tag key ID")

	ErrInvalidRunTaskCategory = errors.New(`category must be "task"`)

	ErrInvalidRunTaskID = errors.New("invalid value for run task ID")

	ErrInvalidRunTaskURL = errors.New("invalid url for run task URL")

	ErrInvalidWorkspaceRunTaskID = errors.New("invalid value for workspace run task ID")

	ErrInvalidWorkspaceRunTaskType = errors.New(`invalid value for type, please use "workspace-tasks"`)

	ErrInvalidTaskResultID = errors.New("invalid value for task result ID")

	ErrInvalidTaskStageID = errors.New("invalid value for task stage ID")

	ErrInvalidApplyID = errors.New("invalid value for apply ID")

	ErrInvalidOrg = errors.New("invalid value for organization")

	ErrInvalidName = errors.New("invalid value for name")

	ErrInvalidNotificationConfigID = errors.New("invalid value for notification configuration ID")

	ErrInvalidMembership = errors.New("invalid value for membership")

	ErrInvalidMembershipIDs = errors.New("invalid value for organization membership ids")

	ErrInvalidOauthClientID = errors.New("invalid value for OAuth client ID")

	ErrInvalidOauthTokenID = errors.New("invalid value for OAuth token ID")

	ErrInvalidPolicySetID = errors.New("invalid value for policy set ID")

	ErrInvalidPolicyCheckID = errors.New("invalid value for policy check ID")

	ErrInvalidPolicyEvaluationID = errors.New("invalid value for policy evaluation ID")

	ErrInvalidPolicySetOutcomeID = errors.New("invalid value for policy set outcome ID")

	ErrInvalidTag = errors.New("invalid tag id")

	ErrInvalidPlanExportID = errors.New("invalid value for plan export ID")

	ErrInvalidPlanID = errors.New("invalid value for plan ID")

	ErrInvalidParamID = errors.New("invalid value for parameter ID")

	ErrInvalidPolicyID = errors.New("invalid value for policy ID")

	ErrInvalidProvider = errors.New("invalid value for provider")

	ErrInvalidVersion = errors.New("invalid value for version")

	ErrInvalidRunTriggerID = errors.New("invalid value for run trigger ID")

	ErrInvalidRunTriggerType = errors.New(`invalid value or no value for RunTriggerType. It must be either "inbound" or "outbound"`)

	ErrInvalidIncludeValue = errors.New(`invalid value for "include" field`)

	ErrInvalidSHHKeyID = errors.New("invalid value for SSH key ID")

	ErrInvalidStateVerID = errors.New("invalid value for state version ID")

	ErrInvalidOutputID = errors.New("invalid value for state version output ID")

	ErrInvalidAccessTeamID = errors.New("invalid value for team access ID")

	ErrInvalidTeamProjectAccessID = errors.New("invalid value for team project access ID")

	ErrInvalidTeamProjectAccessType = errors.New("invalid type for team project access")

	ErrInvalidTeamID = errors.New("invalid value for team ID")

	ErrInvalidUsernames = errors.New("invalid value for usernames")

	ErrInvalidUserID = errors.New("invalid value for user ID")

	ErrInvalidUserValue = errors.New("invalid value for user")

	ErrInvalidTokenID = errors.New("invalid value for token ID")

	ErrInvalidCategory = errors.New("category must be policy-set")

	ErrInvalidPolicies = errors.New("must provide at least one policy")

	ErrInvalidVariableID = errors.New("invalid value for variable ID")

	ErrInvalidNotificationTrigger = errors.New("invalid value for notification trigger")

	ErrInvalidVariableSetID = errors.New("invalid variable set ID")


	ErrInvalidCommentBody = errors.New("invalid value for comment body")

	ErrInvalidNamespace = errors.New("invalid value for namespace")

	ErrInvalidKeyID = errors.New("invalid value for key-id")

	ErrInvalidOS = errors.New("invalid value for OS")

	ErrInvalidArch = errors.New("invalid value for arch")

	ErrInvalidAgentID = errors.New("invalid value for Agent ID")

	ErrInvalidModuleID = errors.New("invalid value for module ID")

	ErrInvalidRegistryName = errors.New(`invalid value for registry-name. It must be either "private" or "public"`)

	ErrInvalidCallbackURL = errors.New("invalid value for callback URL")

	ErrInvalidAccessToken = errors.New("invalid value for access token")

	ErrInvalidTaskResultsCallbackStatus = fmt.Errorf("invalid value for task result status. Must be either `%s`, `%s`, or `%s`", TaskFailed, TaskPassed, TaskRunning)

	ErrInvalidDescriptionConflict = errors.New("invalid attributes\n\nValidation failed: Description has already been taken")
)

Invalid values for resources/struct fields

View Source
var (
	ErrRequiredAccess = errors.New("access is required")

	ErrRequiredAgentPoolID = errors.New("'agent' execution mode requires an agent pool ID to be specified")

	ErrRequiredAgentMode                = errors.New("specifying an agent pool ID requires 'agent' execution mode")
	ErrRequiredBranchWhenTestsEnabled   = errors.New("VCS branch is required when enabling tests")
	ErrBranchMustBeEmptyWhenTagsEnabled = errors.New("VCS branch must be empty to enable tags")
	ErrRequiredCategory                 = errors.New("category is required")

	ErrRequiredDestinationType = errors.New("destination type is required")

	ErrRequiredDataType = errors.New("data type is required")

	ErrRequiredKey = errors.New("key is required")

	ErrRequiredName = errors.New("name is required")

	ErrRequiredQuery = errors.New("query cannot be empty")

	ErrRequiredEnabled = errors.New("enabled is required")

	ErrRequiredEnforce = errors.New("enforce or enforcement-level is required")

	ErrConflictingEnforceEnforcementLevel = errors.New("enforce and enforcement-level may not both be specified together")

	ErrRequiredEnforcementPath = errors.New("enforcement path is required")

	ErrRequiredEnforcementMode = errors.New("enforcement mode is required")

	ErrRequiredEmail = errors.New("email is required")

	ErrRequiredM5 = errors.New("MD5 is required")

	ErrRequiredURL = errors.New("url is required")

	ErrRequiredArchsOrURLAndSha = errors.New("valid archs or url and sha are required")

	ErrRequiredAPIURL = errors.New("API URL is required")

	ErrRequiredHTTPURL = errors.New("HTTP URL is required")

	ErrRequiredServiceProvider = errors.New("service provider is required")

	ErrRequiredProvider = errors.New("provider is required")

	ErrRequiredOauthToken = errors.New("OAuth token is required")

	ErrRequiredOauthTokenOrGithubAppInstallationID = errors.New("either oauth token ID or github app installation ID is required")

	ErrRequiredTestNumber = errors.New("TestNumber is required")

	ErrMissingTagIdentifier = errors.New("must specify at least one tag by ID or name")

	ErrAgentTokenDescription = errors.New("agent token description can't be blank")

	ErrRequiredTagID = errors.New("you must specify at least one tag id to remove")

	ErrRequiredTagWorkspaceID = errors.New("you must specify at least one workspace to add tag to")

	ErrRequiredWorkspace = errors.New("workspace is required")

	ErrRequiredProject = errors.New("project is required")

	ErrRequiredWorkspaceID = errors.New("workspace ID is required")

	ErrRequiredProjectID = errors.New("project ID is required")

	ErrWorkspacesRequired = errors.New("workspaces is required")

	ErrWorkspaceMinLimit = errors.New("must provide at least one workspace")

	ErrProjectMinLimit = errors.New("must provide at least one project")

	ErrRequiredPlan = errors.New("plan is required")

	ErrRequiredPolicies = errors.New("policies is required")

	ErrRequiredVersion = errors.New("version is required")

	ErrRequiredVCSRepo = errors.New("vcs repo is required")

	ErrRequiredIdentifier = errors.New("identifier is required")

	ErrRequiredDisplayIdentifier = errors.New("display identifier is required")

	ErrRequiredSha = errors.New("sha is required")

	ErrRequiredSourceable = errors.New("sourceable is required")

	ErrRequiredValue = errors.New("value is required")

	ErrRequiredOrg = errors.New("organization is required")

	ErrRequiredTeam = errors.New("team is required")

	ErrRequiredStateVerListOps = errors.New("StateVersionListOptions is required")

	ErrRequiredTeamAccessListOps = errors.New("TeamAccessListOptions is required")

	ErrRequiredTeamProjectAccessListOps = errors.New("TeamProjectAccessListOptions is required")

	ErrRequiredRunTriggerListOps = errors.New("RunTriggerListOptions is required")

	ErrRequiredTFVerCreateOps = errors.New("version, URL and sha is required for AdminTerraformVersionCreateOptions")

	ErrRequiredOPAVerCreateOps = errors.New("version, URL and sha is required for AdminOPAVersionCreateOptions")

	ErrRequiredSentinelVerCreateOps = errors.New("version, URL and sha is required for AdminSentinelVersionCreateOptions")

	ErrRequiredSerial = errors.New("serial is required")

	ErrRequiredState = errors.New("state is required")

	ErrRequiredSHHKeyID = errors.New("SSH key ID is required")

	ErrRequiredOnlyOneField = errors.New("only one of usernames or organization membership ids can be provided")

	ErrRequiredUsernameOrMembershipIds = errors.New("usernames or organization membership ids are required")

	ErrRequiredGlobalFlag = errors.New("global flag is required")

	ErrRequiredWorkspacesList = errors.New("no workspaces list provided")

	ErrCommentBody = errors.New("comment body is required")

	ErrEmptyTeamName = errors.New("team name can not be empty")

	ErrInvalidEmail = errors.New("email is invalid")

	ErrRequiredPrivateRegistry = errors.New("only private registry is allowed")

	ErrRequiredOS = errors.New("OS is required")

	ErrRequiredArch = errors.New("arch is required")

	ErrRequiredShasum = errors.New("shasum is required")

	ErrRequiredFilename = errors.New("filename is required")

	ErrInvalidAsciiArmor = errors.New("ASCII Armor is invalid")

	ErrRequiredNamespace = errors.New("namespace is required for public registry")

	ErrRequiredRegistryModule = errors.New("registry module is required")

	ErrRequiredTagBindings = errors.New("TagBindings are required")

	ErrInvalidTestRunID = errors.New("invalid value for test run id")

	ErrInvalidQueryRunID = errors.New("invalid value for query run id")

	ErrTerraformVersionValidForPlanOnly = errors.New("setting terraform-version is only valid when plan-only is set to true")

	ErrStateMustBeOmitted = errors.New("when uploading state, the State and JSONState strings must be omitted from options")

	ErrRequiredRawState = errors.New("RawState is required")

	ErrStateVersionUploadNotSupported = errors.New("upload not supported by this version of Terraform Enterprise")
)

Bool returns a pointer to the given bool

ContextWithResponseHeaderHook returns a context that will, if passed to ClientRequest.Do or to any of the wrapper methods that call it, arrange for the given callback to be called with the headers from the raw HTTP response.

This is intended for allowing callers to respond to out-of-band metadata such as cache-control-related headers, rate limiting headers, etc. Hooks must not modify the given http.Header or otherwise attempt to change how the response is handled by ClientRequest.Do.

If the given context already has a response header hook then the returned context will call both the existing hook and the newly-provided one, with the newer being called first.

Int returns a pointer to the given int.

Int64 returns a pointer to the given int64.

String returns a pointer to the given string.

AccessType represents a team access type.

Access returns a pointer to the given team access type.

type Actions struct {
	IsOverridable *bool `jsonapi:"attr,is-overridable"`
}

Actions represents a task stage actions

type AddWorkspacesToTagOptions struct {
	WorkspaceIDs []string 
}

AddWorkspacesToTagOptions represents the request body to add a workspace to a tag

Admin is the the Terraform Enterprise Admin API. It provides access to site wide admin settings. These are only available for Terraform Enterprise and do not function against HCP Terraform

type AdminCostEstimationSetting struct {
	ID                        string `jsonapi:"primary,cost-estimation-settings"`
	Enabled                   bool   `jsonapi:"attr,enabled"`
	AWSAccessKeyID            string `jsonapi:"attr,aws-access-key-id"`
	AWSAccessKey              string `jsonapi:"attr,aws-secret-key"`
	AWSEnabled                bool   `jsonapi:"attr,aws-enabled"`
	AWSInstanceProfileEnabled bool   `jsonapi:"attr,aws-instance-profile-enabled"`
	GCPCredentials            string `jsonapi:"attr,gcp-credentials"`
	GCPEnabled                bool   `jsonapi:"attr,gcp-enabled"`
	AzureEnabled              bool   `jsonapi:"attr,azure-enabled"`
	AzureClientID             string `jsonapi:"attr,azure-client-id"`
	AzureClientSecret         string `jsonapi:"attr,azure-client-secret"`
	AzureSubscriptionID       string `jsonapi:"attr,azure-subscription-id"`
	AzureTenantID             string `jsonapi:"attr,azure-tenant-id"`
}

AdminCostEstimationSetting represents the admin cost estimation settings.

type AdminCostEstimationSettingOptions struct {
	Enabled             *bool   `jsonapi:"attr,enabled,omitempty"`
	AWSAccessKeyID      *string `jsonapi:"attr,aws-access-key-id,omitempty"`
	AWSAccessKey        *string `jsonapi:"attr,aws-secret-key,omitempty"`
	GCPCredentials      *string `jsonapi:"attr,gcp-credentials,omitempty"`
	AzureClientID       *string `jsonapi:"attr,azure-client-id,omitempty"`
	AzureClientSecret   *string `jsonapi:"attr,azure-client-secret,omitempty"`
	AzureSubscriptionID *string `jsonapi:"attr,azure-subscription-id,omitempty"`
	AzureTenantID       *string `jsonapi:"attr,azure-tenant-id,omitempty"`
}

AdminCostEstimationSettingOptions represents the admin options for updating the cost estimation settings. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings#request-body-1

type AdminGeneralSetting struct {
	ID                               string `jsonapi:"primary,general-settings"`
	LimitUserOrganizationCreation    bool   `jsonapi:"attr,limit-user-organization-creation"`
	APIRateLimitingEnabled           bool   `jsonapi:"attr,api-rate-limiting-enabled"`
	APIRateLimit                     int    `jsonapi:"attr,api-rate-limit"`
	SendPassingStatusesEnabled       bool   `jsonapi:"attr,send-passing-statuses-for-untriggered-speculative-plans"`
	AllowSpeculativePlansOnPR        bool   `jsonapi:"attr,allow-speculative-plans-on-pull-requests-from-forks"`
	RequireTwoFactorForAdmin         bool   `jsonapi:"attr,require-two-factor-for-admins"`
	FairRunQueuingEnabled            bool   `jsonapi:"attr,fair-run-queuing-enabled"`
	LimitOrgsPerUser                 bool   `jsonapi:"attr,limit-organizations-per-user"`
	DefaultOrgsPerUserCeiling        int    `jsonapi:"attr,default-organizations-per-user-ceiling"`
	LimitWorkspacesPerOrg            bool   `jsonapi:"attr,limit-workspaces-per-organization"`
	DefaultWorkspacesPerOrgCeiling   int    `jsonapi:"attr,default-workspaces-per-organization-ceiling"`
	TerraformBuildWorkerApplyTimeout string `jsonapi:"attr,terraform-build-worker-apply-timeout"`
	TerraformBuildWorkerPlanTimeout  string `jsonapi:"attr,terraform-build-worker-plan-timeout"`
	ApplyTimeout                     string `jsonapi:"attr,apply-timeout"`
	PlanTimeout                      string `jsonapi:"attr,plan-timeout"`
	DefaultRemoteStateAccess         bool   `jsonapi:"attr,default-remote-state-access"`
}

AdminGeneralSetting represents a the general settings in Terraform Enterprise.

type AdminGeneralSettingsUpdateOptions struct {
	LimitUserOrgCreation              *bool   `jsonapi:"attr,limit-user-organization-creation,omitempty"`
	APIRateLimitingEnabled            *bool   `jsonapi:"attr,api-rate-limiting-enabled,omitempty"`
	APIRateLimit                      *int    `jsonapi:"attr,api-rate-limit,omitempty"`
	SendPassingStatusUntriggeredPlans *bool   `jsonapi:"attr,send-passing-statuses-for-untriggered-speculative-plans,omitempty"`
	AllowSpeculativePlansOnPR         *bool   `jsonapi:"attr,allow-speculative-plans-on-pull-requests-from-forks,omitempty"`
	DefaultRemoteStateAccess          *bool   `jsonapi:"attr,default-remote-state-access,omitempty"`
	ApplyTimeout                      *string `jsonapi:"attr,apply-timeout"`
	PlanTimeout                       *string `jsonapi:"attr,plan-timeout"`
}

AdminGeneralSettingsUpdateOptions represents the admin options for updating general settings. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings#request-body

type AdminOPAVersion struct {
	ID               string                     `jsonapi:"primary,opa-versions"`
	Version          string                     `jsonapi:"attr,version"`
	URL              string                     `jsonapi:"attr,url,omitempty"`
	SHA              string                     `jsonapi:"attr,sha,omitempty"`
	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,omitempty"`
}

AdminOPAVersion represents a OPA Version

type AdminOPAVersionCreateOptions struct {
	Type             string                     `jsonapi:"primary,opa-versions"`
	Version          string                     `jsonapi:"attr,version"`       
	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,omitempty"` 
}

AdminOPAVersionCreateOptions for creating an OPA version.

type AdminOPAVersionUpdateOptions struct {
	Type             string                     `jsonapi:"primary,opa-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,omitempty"`
}

AdminOPAVersionUpdateOptions for updating OPA version.

type AdminOPAVersions interface {
	
	List(ctx context.Context, options *AdminOPAVersionsListOptions) (*AdminOPAVersionsList, error)

	
	Read(ctx context.Context, id string) (*AdminOPAVersion, error)

	
	Create(ctx context.Context, options AdminOPAVersionCreateOptions) (*AdminOPAVersion, error)

	
	Update(ctx context.Context, id string, options AdminOPAVersionUpdateOptions) (*AdminOPAVersion, error)

	
	Delete(ctx context.Context, id string) error
}

AdminOPAVersions describes all the admin OPA versions related methods that the Terraform Enterprise API supports. Note that admin OPA versions are only available in Terraform Enterprise.

TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/opa-versions

AdminOPAVersionsList represents a list of OPA versions.

type AdminOPAVersionsListOptions struct {
	ListOptions

	
	Filter string `url:"filter[version],omitempty"`

	
	Search string `url:"search[version],omitempty"`
}

AdminOPAVersionsListOptions represents the options for listing OPA versions.

type AdminOrganization struct {
	Name                             string `jsonapi:"primary,organizations"`
	AccessBetaTools                  bool   `jsonapi:"attr,access-beta-tools"`
	ExternalID                       string `jsonapi:"attr,external-id"`
	GlobalModuleSharing              *bool  `jsonapi:"attr,global-module-sharing"`
	GlobalProviderSharing            *bool  `jsonapi:"attr,global-provider-sharing"`
	IsDisabled                       bool   `jsonapi:"attr,is-disabled"`
	NotificationEmail                string `jsonapi:"attr,notification-email"`
	SsoEnabled                       bool   `jsonapi:"attr,sso-enabled"`
	TerraformBuildWorkerApplyTimeout string `jsonapi:"attr,terraform-build-worker-apply-timeout"`
	TerraformBuildWorkerPlanTimeout  string `jsonapi:"attr,terraform-build-worker-plan-timeout"`
	ApplyTimeout                     string `jsonapi:"attr,apply-timeout"`
	PlanTimeout                      string `jsonapi:"attr,plan-timeout"`
	TerraformWorkerSudoEnabled       bool   `jsonapi:"attr,terraform-worker-sudo-enabled"`
	WorkspaceLimit                   *int   `jsonapi:"attr,workspace-limit"`

	
	Owners []*User `jsonapi:"relation,owners"`
}

AdminOrganization represents a Terraform Enterprise organization returned from the Admin API.

type AdminOrganizationID struct {
	ID string `jsonapi:"primary,organizations"`
}

AdminOrganizationList represents a list of organizations via Admin API.

type AdminOrganizationListModuleConsumersOptions struct {
	ListOptions
}

AdminOrganizationListModuleConsumersOptions represents the options for listing organization module consumers through the Admin API

AdminOrganizationListOptions represents the options for listing organizations via Admin API.

type AdminOrganizationUpdateOptions struct {
	AccessBetaTools                  *bool   `jsonapi:"attr,access-beta-tools,omitempty"`
	GlobalModuleSharing              *bool   `jsonapi:"attr,global-module-sharing,omitempty"`
	GlobalProviderSharing            *bool   `jsonapi:"attr,global-provider-sharing,omitempty"`
	IsDisabled                       *bool   `jsonapi:"attr,is-disabled,omitempty"`
	TerraformBuildWorkerApplyTimeout *string `jsonapi:"attr,terraform-build-worker-apply-timeout,omitempty"`
	TerraformBuildWorkerPlanTimeout  *string `jsonapi:"attr,terraform-build-worker-plan-timeout,omitempty"`
	ApplyTimeout                     *string `jsonapi:"attr,apply-timeout,omitempty"`
	PlanTimeout                      *string `jsonapi:"attr,plan-timeout,omitempty"`
	TerraformWorkerSudoEnabled       bool    `jsonapi:"attr,terraform-worker-sudo-enabled,omitempty"`
	WorkspaceLimit                   *int    `jsonapi:"attr,workspace-limit,omitempty"`
}

AdminOrganizationUpdateOptions represents the admin options for updating an organization. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/organizations#request-body

type AdminOrganizations interface {
	
	List(ctx context.Context, options *AdminOrganizationListOptions) (*AdminOrganizationList, error)

	
	Read(ctx context.Context, organization string) (*AdminOrganization, error)

	
	Update(ctx context.Context, organization string, options AdminOrganizationUpdateOptions) (*AdminOrganization, error)

	
	Delete(ctx context.Context, organization string) error

	
	ListModuleConsumers(ctx context.Context, organization string, options *AdminOrganizationListModuleConsumersOptions) (*AdminOrganizationList, error)

	
	UpdateModuleConsumers(ctx context.Context, organization string, consumerOrganizations []string) error
}

AdminOrganizations describes all of the admin organization related methods that the Terraform Enterprise API supports. Note that admin settings are only available in Terraform Enterprise.

TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/organizations

type AdminRun struct {
	ID               string               `jsonapi:"primary,runs"`
	CreatedAt        time.Time            `jsonapi:"attr,created-at,iso8601"`
	HasChanges       bool                 `jsonapi:"attr,has-changes"`
	Status           RunStatus            `jsonapi:"attr,status"`
	StatusTimestamps *RunStatusTimestamps `jsonapi:"attr,status-timestamps"`

	
	Workspace    *AdminWorkspace    `jsonapi:"relation,workspace"`
	Organization *AdminOrganization `jsonapi:"relation,workspace.organization"`
}

AdminRun represents AdminRuns interface.

type AdminRunForceCancelOptions struct {
	
	Comment *string `json:"comment,omitempty"`
}

AdminRunForceCancelOptions represents the options for force-canceling a run.

type AdminRunsList struct {
	Items []*AdminRun
}

AdminRunsList represents a list of runs.

type AdminSAMLSetting struct {
	ID                        string `jsonapi:"primary,saml-settings"`
	Enabled                   bool   `jsonapi:"attr,enabled"`
	Debug                     bool   `jsonapi:"attr,debug"`
	AuthnRequestsSigned       bool   `jsonapi:"attr,authn-requests-signed"`
	WantAssertionsSigned      bool   `jsonapi:"attr,want-assertions-signed"`
	TeamManagementEnabled     bool   `jsonapi:"attr,team-management-enabled"`
	OldIDPCert                string `jsonapi:"attr,old-idp-cert"`
	IDPCert                   string `jsonapi:"attr,idp-cert"`
	SLOEndpointURL            string `jsonapi:"attr,slo-endpoint-url"`
	SSOEndpointURL            string `jsonapi:"attr,sso-endpoint-url"`
	AttrUsername              string `jsonapi:"attr,attr-username"`
	AttrGroups                string `jsonapi:"attr,attr-groups"`
	AttrSiteAdmin             string `jsonapi:"attr,attr-site-admin"`
	SiteAdminRole             string `jsonapi:"attr,site-admin-role"`
	SSOAPITokenSessionTimeout int    `jsonapi:"attr,sso-api-token-session-timeout"`
	ACSConsumerURL            string `jsonapi:"attr,acs-consumer-url"`
	MetadataURL               string `jsonapi:"attr,metadata-url"`
	Certificate               string `jsonapi:"attr,certificate"`
	PrivateKey                string `jsonapi:"attr,private-key"`
	SignatureSigningMethod    string `jsonapi:"attr,signature-signing-method"`
	SignatureDigestMethod     string `jsonapi:"attr,signature-digest-method"`
}

AdminSAMLSetting represents the SAML settings in Terraform Enterprise.

type AdminSAMLSettingsUpdateOptions struct {
	Enabled                   *bool   `jsonapi:"attr,enabled,omitempty"`
	Debug                     *bool   `jsonapi:"attr,debug,omitempty"`
	IDPCert                   *string `jsonapi:"attr,idp-cert,omitempty"`
	Certificate               *string `jsonapi:"attr,certificate,omitempty"`
	PrivateKey                *string `jsonapi:"attr,private-key,omitempty"`
	SLOEndpointURL            *string `jsonapi:"attr,slo-endpoint-url,omitempty"`
	SSOEndpointURL            *string `jsonapi:"attr,sso-endpoint-url,omitempty"`
	AttrUsername              *string `jsonapi:"attr,attr-username,omitempty"`
	AttrGroups                *string `jsonapi:"attr,attr-groups,omitempty"`
	AttrSiteAdmin             *string `jsonapi:"attr,attr-site-admin,omitempty"`
	SiteAdminRole             *string `jsonapi:"attr,site-admin-role,omitempty"`
	SSOAPITokenSessionTimeout *int    `jsonapi:"attr,sso-api-token-session-timeout,omitempty"`
	TeamManagementEnabled     *bool   `jsonapi:"attr,team-management-enabled,omitempty"`
	AuthnRequestsSigned       *bool   `jsonapi:"attr,authn-requests-signed,omitempty"`
	WantAssertionsSigned      *bool   `jsonapi:"attr,want-assertions-signed,omitempty"`
	SignatureSigningMethod    *string `jsonapi:"attr,signature-signing-method,omitempty"`
	SignatureDigestMethod     *string `jsonapi:"attr,signature-digest-method,omitempty"`
}

AdminSAMLSettingsUpdateOptions represents the admin options for updating SAML settings. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings#request-body-2

type AdminSMTPSetting struct {
	ID       string       `jsonapi:"primary,smtp-settings"`
	Enabled  bool         `jsonapi:"attr,enabled"`
	Host     string       `jsonapi:"attr,host"`
	Port     int          `jsonapi:"attr,port"`
	Sender   string       `jsonapi:"attr,sender"`
	Auth     SMTPAuthType `jsonapi:"attr,auth"`
	Username string       `jsonapi:"attr,username"`
}

AdminSMTPSetting represents a the SMTP settings in Terraform Enterprise.

type AdminSMTPSettingsUpdateOptions struct {
	Enabled          *bool         `jsonapi:"attr,enabled,omitempty"`
	Host             *string       `jsonapi:"attr,host,omitempty"`
	Port             *int          `jsonapi:"attr,port,omitempty"`
	Sender           *string       `jsonapi:"attr,sender,omitempty"`
	Auth             *SMTPAuthType `jsonapi:"attr,auth,omitempty"`
	Username         *string       `jsonapi:"attr,username,omitempty"`
	Password         *string       `jsonapi:"attr,password,omitempty"`
	TestEmailAddress *string       `jsonapi:"attr,test-email-address,omitempty"`
}

AdminSMTPSettingsUpdateOptions represents the admin options for updating SMTP settings. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/settings#request-body-3

type AdminSentinelVersion struct {
	ID               string                     `jsonapi:"primary,sentinel-versions"`
	Version          string                     `jsonapi:"attr,version"`
	URL              string                     `jsonapi:"attr,url,omitempty"`
	SHA              string                     `jsonapi:"attr,sha,omitempty"`
	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,omitempty"`
}

AdminSentinelVersion represents a Sentinel Version

type AdminSentinelVersionCreateOptions struct {
	Type             string                     `jsonapi:"primary,sentinel-versions"`
	Version          string                     `jsonapi:"attr,version"`       
	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,omitempty"` 
}

AdminSentinelVersionCreateOptions for creating an Sentinel version.

type AdminSentinelVersionUpdateOptions struct {
	Type             string                     `jsonapi:"primary,sentinel-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,omitempty"`
}

AdminSentinelVersionUpdateOptions for updating Sentinel version.

type AdminSentinelVersions interface {
	
	List(ctx context.Context, options *AdminSentinelVersionsListOptions) (*AdminSentinelVersionsList, error)

	
	Read(ctx context.Context, id string) (*AdminSentinelVersion, error)

	
	Create(ctx context.Context, options AdminSentinelVersionCreateOptions) (*AdminSentinelVersion, error)

	
	Update(ctx context.Context, id string, options AdminSentinelVersionUpdateOptions) (*AdminSentinelVersion, error)

	
	Delete(ctx context.Context, id string) error
}

AdminSentinelVersions describes all the admin Sentinel versions related methods that the Terraform Enterprise API supports. Note that admin Sentinel versions are only available in Terraform Enterprise.

TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/sentinel-versions

AdminSentinelVersionsList represents a list of Sentinel versions.

type AdminSentinelVersionsListOptions struct {
	ListOptions

	
	Filter string `url:"filter[version],omitempty"`

	
	Search string `url:"search[version],omitempty"`
}

AdminSentinelVersionsListOptions represents the options for listing Sentinel versions.

type AdminTerraformVersion struct {
	ID               string                     `jsonapi:"primary,terraform-versions"`
	Version          string                     `jsonapi:"attr,version"`
	URL              string                     `jsonapi:"attr,url,omitempty"`
	Sha              string                     `jsonapi:"attr,sha,omitempty"`
	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,omitempty"`
}

AdminTerraformVersion represents a Terraform Version

type AdminTerraformVersionCreateOptions struct {
	Type             string                     `jsonapi:"primary,terraform-versions"`
	Version          *string                    `jsonapi:"attr,version"` 
	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,omitempty"`
}

AdminTerraformVersionCreateOptions for creating a 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,omitempty"`
}

AdminTerraformVersionUpdateOptions for updating terraform version. https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/terraform-versions#request-body

type AdminTerraformVersions interface {
	
	List(ctx context.Context, options *AdminTerraformVersionsListOptions) (*AdminTerraformVersionsList, error)

	
	Read(ctx context.Context, id string) (*AdminTerraformVersion, error)

	
	Create(ctx context.Context, options AdminTerraformVersionCreateOptions) (*AdminTerraformVersion, error)

	
	Update(ctx context.Context, id string, options AdminTerraformVersionUpdateOptions) (*AdminTerraformVersion, error)

	
	Delete(ctx context.Context, id string) error
}

AdminTerraformVersions describes all the admin terraform versions related methods that the Terraform Enterprise API supports. Note that admin terraform versions are only available in Terraform Enterprise.

TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/terraform-versions

AdminTerraformVersionsList represents a list of terraform versions.

type AdminTerraformVersionsListOptions struct {
	ListOptions

	
	Filter string `url:"filter[version],omitempty"`

	
	Search string `url:"search[version],omitempty"`
}

AdminTerraformVersionsListOptions represents the options for listing terraform versions.

type AdminTwilioSetting struct {
	ID         string `jsonapi:"primary,twilio-settings"`
	Enabled    bool   `jsonapi:"attr,enabled"`
	AccountSid string `jsonapi:"attr,account-sid"`
	FromNumber string `jsonapi:"attr,from-number"`
}

AdminTwilioSetting represents the Twilio settings in Terraform Enterprise.

type AdminUser struct {
	ID               string     `jsonapi:"primary,users"`
	Email            string     `jsonapi:"attr,email"`
	Username         string     `jsonapi:"attr,username"`
	AvatarURL        string     `jsonapi:"attr,avatar-url"`
	TwoFactor        *TwoFactor `jsonapi:"attr,two-factor"`
	IsAdmin          bool       `jsonapi:"attr,is-admin"`
	IsSuspended      bool       `jsonapi:"attr,is-suspended"`
	IsServiceAccount bool       `jsonapi:"attr,is-service-account"`

	
	Organizations []*Organization `jsonapi:"relation,organizations"`
}

AdminUser represents a user as seen by an Admin.

type AdminUserList struct {
	Items []*AdminUser
}

AdminUserList represents a list of users.

type AdminUsers interface {
	
	List(ctx context.Context, options *AdminUserListOptions) (*AdminUserList, error)

	
	Delete(ctx context.Context, userID string) error

	
	Suspend(ctx context.Context, userID string) (*AdminUser, error)

	
	Unsuspend(ctx context.Context, userID string) (*AdminUser, error)

	
	GrantAdmin(ctx context.Context, userID string) (*AdminUser, error)

	
	RevokeAdmin(ctx context.Context, userID string) (*AdminUser, error)

	
	
	Disable2FA(ctx context.Context, userID string) (*AdminUser, error)
}

AdminUsers describes all the admin user related methods that the Terraform Enterprise API supports. It contains endpoints to help site administrators manage their users.

TFE API docs: https://developer.hashicorp.com/terraform/enterprise/api-docs/admin/users

type AdminVCSRepo struct {
	Identifier string `jsonapi:"attr,identifier"`
}

AdminVCSRepo represents a VCS repository

type AdminWorkspace struct {
	ID      string        `jsonapi:"primary,workspaces"`
	Name    string        `jsonapi:"attr,name"`
	Locked  bool          `jsonapi:"attr,locked"`
	VCSRepo *AdminVCSRepo `jsonapi:"attr,vcs-repo"`

	
	Organization *Organization `jsonapi:"relation,organization"`
	CurrentRun   *Run          `jsonapi:"relation,current-run"`
}

AdminWorkspaces represents a Terraform Enterprise admin workspace.

AdminWorkspaceList represents a list of workspaces.

AdminWorkspaceListOptions represents the options for listing workspaces.

type Agent struct {
	ID         string `jsonapi:"primary,agents"`
	Name       string `jsonapi:"attr,name"`
	IP         string `jsonapi:"attr,ip-address"`
	Status     string `jsonapi:"attr,status"`
	LastPingAt string `jsonapi:"attr,last-ping-at"`
}

Agent represents a HCP Terraform agent.

type AgentList struct {
	Items []*Agent
}

AgentList represents a list of agents.

type AgentListOptions struct {
	ListOptions

	
	LastPingSince time.Time `url:"filter[last-ping-since],omitempty,iso8601"`
}
type AgentPool struct {
	ID                 string `jsonapi:"primary,agent-pools"`
	Name               string `jsonapi:"attr,name"`
	AgentCount         int    `jsonapi:"attr,agent-count"`
	OrganizationScoped bool   `jsonapi:"attr,organization-scoped"`

	
	Organization      *Organization `jsonapi:"relation,organization"`
	Workspaces        []*Workspace  `jsonapi:"relation,workspaces"`
	AllowedWorkspaces []*Workspace  `jsonapi:"relation,allowed-workspaces"`
}

AgentPool represents a HCP Terraform agent pool.

type AgentPoolAllowedWorkspacesUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,agent-pools"`

	
	AllowedWorkspaces []*Workspace `jsonapi:"relation,allowed-workspaces"`
}

AgentPoolUpdateAllowedWorkspacesOptions represents the options for updating the allowed workspace on an agent pool

type AgentPoolCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,agent-pools"`

	
	Name *string `jsonapi:"attr,name"`

	
	OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`

	
	AllowedWorkspaces []*Workspace `jsonapi:"relation,allowed-workspaces,omitempty"`
}

AgentPoolCreateOptions represents the options for creating an agent pool.

type AgentPoolList struct {
	Items []*AgentPool
}

AgentPoolList represents a list of agent pools.

type AgentPoolListOptions struct {
	ListOptions
	
	
	Include []AgentPoolIncludeOpt `url:"include,omitempty"`

	
	Query string `url:"q,omitempty"`

	
	AllowedWorkspacesName string `url:"filter[allowed_workspaces][name],omitempty"`
}

AgentPoolListOptions represents the options for listing agent pools.

type AgentPoolUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,agent-pools"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`

	
	AllowedWorkspaces []*Workspace `jsonapi:"relation,allowed-workspaces,omitempty"`
}

AgentPoolUpdateOptions represents the options for updating an agent pool.

type AgentPools interface {
	
	List(ctx context.Context, organization string, options *AgentPoolListOptions) (*AgentPoolList, error)

	
	Create(ctx context.Context, organization string, options AgentPoolCreateOptions) (*AgentPool, error)

	
	Read(ctx context.Context, agentPoolID string) (*AgentPool, error)

	
	ReadWithOptions(ctx context.Context, agentPoolID string, options *AgentPoolReadOptions) (*AgentPool, error)

	
	Update(ctx context.Context, agentPool string, options AgentPoolUpdateOptions) (*AgentPool, error)

	
	UpdateAllowedWorkspaces(ctx context.Context, agentPool string, options AgentPoolAllowedWorkspacesUpdateOptions) (*AgentPool, error)

	
	Delete(ctx context.Context, agentPoolID string) error
}

AgentPools describes all the agent pool related methods that the HCP Terraform API supports. Note that agents are not available in Terraform Enterprise.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/agents

type AgentToken struct {
	ID          string    `jsonapi:"primary,authentication-tokens"`
	CreatedAt   time.Time `jsonapi:"attr,created-at,iso8601"`
	Description string    `jsonapi:"attr,description"`
	LastUsedAt  time.Time `jsonapi:"attr,last-used-at,iso8601"`
	Token       string    `jsonapi:"attr,token"`
}

AgentToken represents a HCP Terraform agent token.

type AgentTokenCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,agent-tokens"`

	
	Description *string `jsonapi:"attr,description"`
}

AgentTokenCreateOptions represents the options for creating an agent token.

type AgentTokenList struct {
	Items []*AgentToken
}

AgentTokenList represents a list of agent tokens.

type Apply struct {
	ID                   string                 `jsonapi:"primary,applies"`
	LogReadURL           string                 `jsonapi:"attr,log-read-url"`
	ResourceAdditions    int                    `jsonapi:"attr,resource-additions"`
	ResourceChanges      int                    `jsonapi:"attr,resource-changes"`
	ResourceDestructions int                    `jsonapi:"attr,resource-destructions"`
	ResourceImports      int                    `jsonapi:"attr,resource-imports"`
	Status               ApplyStatus            `jsonapi:"attr,status"`
	StatusTimestamps     *ApplyStatusTimestamps `jsonapi:"attr,status-timestamps"`
}

Apply represents a Terraform Enterprise apply.

ApplyStatus represents an apply state.

List all available apply statuses.

type ApplyStatusTimestamps struct {
	CanceledAt      time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt       time.Time `jsonapi:"attr,errored-at,rfc3339"`
	FinishedAt      time.Time `jsonapi:"attr,finished-at,rfc3339"`
	ForceCanceledAt time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
	QueuedAt        time.Time `jsonapi:"attr,queued-at,rfc3339"`
	StartedAt       time.Time `jsonapi:"attr,started-at,rfc3339"`
}

ApplyStatusTimestamps holds the timestamps for individual apply statuses.

AuditTrail represents an event in the HCP Terraform audit log.

type AuditTrailAuth struct {
	AccessorID     string  `json:"accessor_id"`
	Description    string  `json:"description"`
	Type           string  `json:"type"`
	ImpersonatorID *string `json:"impersonator_id"`
	OrganizationID string  `json:"organization_id"`
}

AuditTrailAuth represents the details of the actor that invoked the audit event.

type AuditTrailList struct {
	Items                 []*AuditTrail `json:"data"`
}

AuditTrailList represents a list of audit trails.

AuditTrailListOptions represents the options for listing audit trails.

type AuditTrailPagination struct {
}
type AuditTrailRequest struct {
	ID string `json:"id"`
}

AuditTrailRequest represents the request details of the audit event.

type AuditTrailResource struct {
	ID     string                 `json:"id"`
	Type   string                 `json:"type"`
	Action string                 `json:"action"`
	Meta   map[string]interface{} `json:"meta"`
}

AuditTrailResource represents the details of the API resource in the audit event.

AuditTrails describes all the audit event related methods that the HCP Terraform API supports. **Note:** These methods require the client to be configured with an organization token for an organization in the Business tier. Furthermore, these methods are only available in HCP Terraform.

HCP Terraform API Docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/audit-trails

AuthPolicyType represents an authentication policy type.

List of available authentication policies.

AuthPolicy returns a pointer to the given authentication poliy.

type CVStatusTimestamps struct {
	ArchivedAt time.Time `jsonapi:"attr,archived-at,rfc3339"`
	FetchingAt time.Time `jsonapi:"attr,fetching-at,rfc3339"`
	FinishedAt time.Time `jsonapi:"attr,finished-at,rfc3339"`
	QueuedAt   time.Time `jsonapi:"attr,queued-at,rfc3339"`
	StartedAt  time.Time `jsonapi:"attr,started-at,rfc3339"`
}

CVStatusTimestamps holds the timestamps for individual configuration version statuses.

type Capacity struct {
	Organization string `jsonapi:"primary,organization-capacity"`
	Pending      int    `jsonapi:"attr,pending"`
	Running      int    `jsonapi:"attr,running"`
}

Capacity represents the current run capacity of an organization.

CategoryType represents a category type.

List all available categories.

Category returns a pointer to the given category type.

Change represents the change of a resource instance in a plan.

ChangeAction are the actions a change can have: no-op, create, read, update, delte, forget.

Client is the Terraform Enterprise API client. It provides the basic connectivity and configuration for accessing the TFE API

NewClient creates a new Terraform Enterprise API client.

AppName returns the name of the instance.

BaseRegistryURL returns the registry base URL as configured in the client

BaseURL returns the base URL as configured in the client

IsCloud returns true if the client is configured against a HCP Terraform instance.

Whether an instance is HCP Terraform or Terraform Enterprise is derived from the TFP-AppName header.

IsEnterprise returns true if the client is configured against a Terraform Enterprise instance.

Whether an instance is HCP Terraform or TFE is derived from the TFP-AppName header. Note: not all TFE releases include this header in API responses.

NewRequest performs some basic API request preparation based on the method specified. For GET requests, the reqBody is encoded as query parameters. For DELETE, PATCH, and POST requests, the request body is serialized as JSONAPI. For PUT requests, the request body is sent as a stream of bytes.

NewRequestWithAdditionalQueryParams performs some basic API request preparation based on the method specified. For GET requests, the reqBody is encoded as query parameters. For DELETE, PATCH, and POST requests, the request body is serialized as JSONAPI. For PUT requests, the request body is sent as a stream of bytes. Additional query parameters can be added to the request as a string map. Note that if a key exists in both the reqBody and additionalQueryParams, the value in additionalQueryParams will be used.

RemoteAPIVersion returns the server's declared API version string.

A HCP Terraform or Enterprise API server returns its API version in an HTTP header field in all responses. The NewClient function saves the version number returned in its initial setup request and RemoteAPIVersion returns that cached value.

The API protocol calls for this string to be a dotted-decimal version number like 2.3.0, where the first number indicates the API major version while the second indicates a minor version which may have introduced some backward-compatible additional features compared to its predecessor.

Explicit API versioning was added to the HCP Terraform and Enterprise APIs as a later addition, so older servers will not return version information. In that case, this function returns an empty string as the version.

RemoteTFEVersion returns the server's declared TFE version string.

A Terraform Enterprise API server includes its current version in an HTTP header field in all responses. This value is saved by the client during the initial setup request and RemoteTFEVersion returns that cached value. This function returns an empty string for any Terraform Enterprise version earlier than v202208-3 and for HCP Terraform.

RetryServerErrors configures the retry HTTP check to also retry unexpected errors or requests that failed with a server error.

func (c *Client) SetFakeRemoteAPIVersion(fakeAPIVersion string)

SetFakeRemoteAPIVersion allows setting a given string as the client's remoteAPIVersion, overriding the value pulled from the API header during client initialization.

This is intended for use in tests, when you may want to configure your TFE client to return something different than the actual API version in order to test error handling.

ClientRequest encapsulates a request sent by the Client

DoJSON is similar to Do except that it should be used when a plain JSON response is expected as opposed to json-api.

type Comment struct {
	Body string `jsonapi:"attr,body"`
}

Comment represents a Terraform Enterprise comment.

type CommentCreateOptions struct {
	
	
	
	Type string `jsonapi:"primary,comments"`

	
	Body string `jsonapi:"attr,body"`
}
type CommentList struct {
}

CommentList represents a list of comments.

type Commit struct {
	ID              string `jsonapi:"primary,commit"`
	Sha             string `jsonapi:"attr,sha"`
	Date            string `jsonapi:"attr,date"`
	URL             string `jsonapi:"attr,url"`
	Author          string `jsonapi:"attr,author"`
	AuthorAvatarURL string `jsonapi:"attr,author-avatar-url"`
	AuthorHTMLURL   string `jsonapi:"attr,author-html-url"`
	Message         string `jsonapi:"attr,message"`
}

Commit represents a commit

type CommitList struct {
	Items []*Commit
}

CommitList represents a list of the latest commits from the registry module

type ConfigurationSource string

ConfigurationSource represents a source of a configuration version.

List all available configuration version sources.

type ConfigurationStatus string

ConfigurationStatus represents a configuration version status.

List all available configuration version statuses.

type ConfigurationVersion struct {
	ID               string              `jsonapi:"primary,configuration-versions"`
	AutoQueueRuns    bool                `jsonapi:"attr,auto-queue-runs"`
	Error            string              `jsonapi:"attr,error"`
	ErrorMessage     string              `jsonapi:"attr,error-message"`
	Source           ConfigurationSource `jsonapi:"attr,source"`
	Speculative      bool                `jsonapi:"attr,speculative"`
	Provisional      bool                `jsonapi:"attr,provisional"`
	Status           ConfigurationStatus `jsonapi:"attr,status"`
	StatusTimestamps *CVStatusTimestamps `jsonapi:"attr,status-timestamps"`
	UploadURL        string              `jsonapi:"attr,upload-url"`

	
	IngressAttributes *IngressAttributes `jsonapi:"relation,ingress-attributes"`
}

ConfigurationVersion is a representation of an uploaded or ingressed Terraform configuration in TFE. A workspace must have at least one configuration version before any runs may be queued on it.

type ConfigurationVersionCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,configuration-versions"`

	
	
	AutoQueueRuns *bool `jsonapi:"attr,auto-queue-runs,omitempty"`

	
	Speculative *bool `jsonapi:"attr,speculative,omitempty"`

	
	
	Provisional *bool `jsonapi:"attr,provisional,omitempty"`
}

ConfigurationVersionCreateOptions represents the options for creating a configuration version.

ConfigurationVersionList represents a list of configuration versions.

ConfigurationVersionListOptions represents the options for listing configuration versions.

type ConfigurationVersionReadOptions struct {
	
	
	Include []ConfigVerIncludeOpt `url:"include,omitempty"`
}

ConfigurationVersionReadOptions represents the options for reading a configuration version.

type ConfigurationVersions interface {
	
	List(ctx context.Context, workspaceID string, options *ConfigurationVersionListOptions) (*ConfigurationVersionList, error)

	
	
	Create(ctx context.Context, workspaceID string, options ConfigurationVersionCreateOptions) (*ConfigurationVersion, error)

	
	
	
	
	
	CreateForRegistryModule(ctx context.Context, moduleID RegistryModuleID) (*ConfigurationVersion, error)

	
	Read(ctx context.Context, cvID string) (*ConfigurationVersion, error)

	
	ReadWithOptions(ctx context.Context, cvID string, options *ConfigurationVersionReadOptions) (*ConfigurationVersion, error)

	
	
	
	Upload(ctx context.Context, url string, path string) error

	
	UploadTarGzip(ctx context.Context, url string, archive io.Reader) error

	
	
	Archive(ctx context.Context, cvID string) error

	
	Download(ctx context.Context, cvID string) ([]byte, error)

	
	
	SoftDeleteBackingData(ctx context.Context, svID string) error

	
	
	RestoreBackingData(ctx context.Context, svID string) error

	
	
	PermanentlyDeleteBackingData(ctx context.Context, svID string) error
}

ConfigurationVersions describes all the configuration version related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/configuration-versions

type CostEstimate struct {
	ID                      string                        `jsonapi:"primary,cost-estimates"`
	DeltaMonthlyCost        string                        `jsonapi:"attr,delta-monthly-cost"`
	ErrorMessage            string                        `jsonapi:"attr,error-message"`
	MatchedResourcesCount   int                           `jsonapi:"attr,matched-resources-count"`
	PriorMonthlyCost        string                        `jsonapi:"attr,prior-monthly-cost"`
	ProposedMonthlyCost     string                        `jsonapi:"attr,proposed-monthly-cost"`
	ResourcesCount          int                           `jsonapi:"attr,resources-count"`
	Status                  CostEstimateStatus            `jsonapi:"attr,status"`
	StatusTimestamps        *CostEstimateStatusTimestamps `jsonapi:"attr,status-timestamps"`
	UnmatchedResourcesCount int                           `jsonapi:"attr,unmatched-resources-count"`
}

CostEstimate represents a Terraform Enterprise costEstimate.

type CostEstimateStatus string

CostEstimateStatus represents a costEstimate state.

List all available costEstimate statuses.

type CostEstimateStatusTimestamps struct {
	CanceledAt              time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt               time.Time `jsonapi:"attr,errored-at,rfc3339"`
	FinishedAt              time.Time `jsonapi:"attr,finished-at,rfc3339"`
	PendingAt               time.Time `jsonapi:"attr,pending-at,rfc3339"`
	QueuedAt                time.Time `jsonapi:"attr,queued-at,rfc3339"`
	SkippedDueToTargetingAt time.Time `jsonapi:"attr,skipped-due-to-targeting-at,rfc3339"`
}

CostEstimateStatusTimestamps holds the timestamps for individual costEstimate statuses.

type CreateStackConfigurationOptions struct {
	SelectedDeployments []string `jsonapi:"attr,selected-deployments,omitempty"`
	SpeculativeEnabled  *bool    `jsonapi:"attr,speculative,omitempty"`
}
type CreateStackSourceOptions struct {
	SelectedDeployments []string `jsonapi:"attr,selected-deployments,omitempty"`
	SpeculativeEnabled  *bool    `jsonapi:"attr,speculative,omitempty"`
}

CreatedByChoice is a choice type struct that represents the possible values within a polymorphic relation. If a value is available, exactly one field will be non-nil.

CustomizationSettings describes all the Customization admin settings.

type DataRetentionPolicy struct {
	ID                   string `jsonapi:"primary,data-retention-policies"`
	DeleteOlderThanNDays int    `jsonapi:"attr,delete-older-than-n-days"`
}

DataRetentionPolicy describes the retention policy of deleting records older than the specified number of days.

Deprecated: Use DataRetentionPolicyDeleteOlder instead. This is the original representation of a data retention policy, only present in TFE v202311-1 and v202312-1

DataRetentionPolicyChoice is a choice type struct that represents the possible types of a drp returned by a polymorphic relationship. If a value is available, exactly one field will be non-nil.

Convert the DataRetentionPolicyChoice to the legacy DataRetentionPolicy struct Returns nil if the policy cannot be represented by a legacy DataRetentionPolicy

Returns whether one of the choices is populated

type DataRetentionPolicyDeleteOlder struct {
	ID string `jsonapi:"primary,data-retention-policy-delete-olders"`

	
	DeleteOlderThanNDays int `jsonapi:"attr,delete-older-than-n-days"`
}

DataRetentionPolicyDeleteOlder describes the retention policy of deleting records older than the specified number of days.

type DataRetentionPolicyDeleteOlderSetOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,data-retention-policy-delete-olders"`

	
	DeleteOlderThanNDays int `jsonapi:"attr,delete-older-than-n-days"`
}

DataRetentionPolicyDeleteOlderSetOptions describes the options for a creating a DataRetentionPolicyDeleteOlder.

type DataRetentionPolicyDontDelete struct {
	ID string `jsonapi:"primary,data-retention-policy-dont-deletes"`
}

DataRetentionPolicyDontDelete describes the retention policy of never deleting records.

type DataRetentionPolicyDontDeleteSetOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,data-retention-policy-dont-deletes"`
}

DataRetentionPolicyDontDeleteSetOptions describes the options for a creating a DataRetentionPolicyDontDelete.

type DataRetentionPolicySetOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,data-retention-policies"`

	
	DeleteOlderThanNDays int `jsonapi:"attr,delete-older-than-n-days"`
}

DataRetentionPolicySetOptions is the options for a creating a DataRetentionPolicy.

Deprecated: Use DataRetentionPolicyDeleteOlder variations instead

type DeliveryResponse struct {
	Body       string              `jsonapi:"attr,body"`
	Code       string              `jsonapi:"attr,code"`
	SentAt     time.Time           `jsonapi:"attr,sent-at,rfc3339"`
	Successful string              `jsonapi:"attr,successful"`
	URL        string              `jsonapi:"attr,url"`
}

DeliveryResponse represents a notification configuration delivery response.

type DeploymentGroupStatus string
type DiagnosticPos struct {
	
	Line int `jsonapi:"attr,line"`

	
	Column int `jsonapi:"attr,column"`

	
	Byte int `jsonapi:"attr,byte"`
}

DiagnosticPos represents a position in the source code.

type DiagnosticRange struct {
	Filename string        `jsonapi:"attr,filename"`
	Source   string        `jsonapi:"attr,source"`
	Start    DiagnosticPos `jsonapi:"attr,start"`
	End      DiagnosticPos `jsonapi:"attr,end"`
}

DiagnosticRange represents the filename and position of the diagnostic subject. This defines the range of the source to be highlighted in the output. Note that the snippet may include additional surrounding source code if the diagnostic has a context range.

The stacks-specific source field represents the full source bundle address of the file, while the filename field is the sub path relative to its enclosing package. This represents an attempt to be somewhat backwards compatible with the existing Terraform JSON diagnostic format, where filename is root module relative.

The Start position is inclusive, and the End position is exclusive. Exact positions are intended for highlighting for human interpretation only and are subject to change.

type EffectiveTagBinding struct {
	ID    string                 `jsonapi:"primary,effective-tag-bindings"`
	Key   string                 `jsonapi:"attr,key"`
	Value string                 `jsonapi:"attr,value,omitempty"`
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

Enforcement describes a enforcement.

EnforcementLevel represents an enforcement level.

List the available enforcement types.

EnforcementMode returns a pointer to the given enforcement level.

EnforcementOptions represents the enforcement options of a policy.

type Entitlements struct {
	ID                         string `jsonapi:"primary,entitlement-sets"`
	Agents                     bool   `jsonapi:"attr,agents"`
	AuditLogging               bool   `jsonapi:"attr,audit-logging"`
	CostEstimation             bool   `jsonapi:"attr,cost-estimation"`
	GlobalRunTasks             bool   `jsonapi:"attr,global-run-tasks"`
	Operations                 bool   `jsonapi:"attr,operations"`
	PrivateModuleRegistry      bool   `jsonapi:"attr,private-module-registry"`
	PrivateRunTasks            bool   `jsonapi:"attr,private-run-tasks"`
	RunTasks                   bool   `jsonapi:"attr,run-tasks"`
	SSO                        bool   `jsonapi:"attr,sso"`
	Sentinel                   bool   `jsonapi:"attr,sentinel"`
	StateStorage               bool   `jsonapi:"attr,state-storage"`
	Teams                      bool   `jsonapi:"attr,teams"`
	VCSIntegrations            bool   `jsonapi:"attr,vcs-integrations"`
	WaypointActions            bool   `jsonapi:"attr,waypoint-actions"`
	WaypointTemplatesAndAddons bool   `jsonapi:"attr,waypoint-templates-and-addons"`
}

Entitlements represents the entitlements of an organization.

type GHAInstallation struct {
	ID             *string `jsonapi:"primary,github-app-installations"`
	InstallationID *int    `jsonapi:"attr,installation-id"`
	Name           *string `jsonapi:"attr,name"`
}

GHAInstallation represents a github app installation

GHAInstallationList represents a list of github installations.

GHAInstallationListOptions represents the options for listing.

type GPGKey struct {
	ID             string    `jsonapi:"primary,gpg-keys"`
	AsciiArmor     string    `jsonapi:"attr,ascii-armor"`
	CreatedAt      time.Time `jsonapi:"attr,created-at,iso8601"`
	KeyID          string    `jsonapi:"attr,key-id"`
	Namespace      string    `jsonapi:"attr,namespace"`
	Source         string    `jsonapi:"attr,source"`
	SourceURL      *string   `jsonapi:"attr,source-url"`
	TrustSignature string    `jsonapi:"attr,trust-signature"`
	UpdatedAt      time.Time `jsonapi:"attr,updated-at,iso8601"`
}

GPGKey represents a signed GPG key for a HCP Terraform or Terraform Enterprise private provider.

type GPGKeyCreateOptions struct {
	Type       string `jsonapi:"primary,gpg-keys"`
	Namespace  string `jsonapi:"attr,namespace"`
	AsciiArmor string `jsonapi:"attr,ascii-armor"`
}

GPGKeyCreateOptions represents all the available options used to create a GPG key.

GPGKeyID represents the set of identifiers used to fetch a GPG key.

type GPGKeyList struct {
	Items []*GPGKey
}

GPGKeyList represents a list of GPG keys.

type GPGKeyListOptions struct {
	ListOptions

	
	Namespaces []string `url:"filter[namespace]"`
}

GPGKeyListOptions represents all the available options to list keys in a registry.

type GPGKeyUpdateOptions struct {
	Type      string `jsonapi:"primary,gpg-keys"`
	Namespace string `jsonapi:"attr,namespace"`
}

GPGKeyCreateOptions represents all the available options used to update a GPG key.

type GPGKeys interface {
	
	ListPrivate(ctx context.Context, options GPGKeyListOptions) (*GPGKeyList, error)

	
	Create(ctx context.Context, registryName RegistryName, options GPGKeyCreateOptions) (*GPGKey, error)

	
	Read(ctx context.Context, keyID GPGKeyID) (*GPGKey, error)

	
	Update(ctx context.Context, keyID GPGKeyID, options GPGKeyUpdateOptions) (*GPGKey, error)

	
	Delete(ctx context.Context, keyID GPGKeyID) error
}

GPGKeys describes all the GPG key related methods that the Terraform Private Registry API supports.

TFE API Docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/gpg-keys

type GlobalRunTask struct {
	Enabled          bool                 `jsonapi:"attr,enabled"`
	Stages           []Stage              `jsonapi:"attr,stages"`
	EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level"`
}

GlobalRunTask represents the global configuration of a HCP Terraform or Terraform Enterprise run task

type GlobalRunTaskOptions struct {
	Enabled          *bool                 `jsonapi:"attr,enabled,omitempty"`
	Stages           *[]Stage              `jsonapi:"attr,stages,omitempty"`
	EnforcementLevel *TaskEnforcementLevel `jsonapi:"attr,enforcement-level,omitempty"`
}

GlobalRunTask represents the optional global configuration of a HCP Terraform or Terraform Enterprise run task

type IPRange struct {
	
	API []string `json:"api"`
	
	Notifications []string `json:"notifications"`
	
	Sentinel []string `json:"sentinel"`
	
	VCS []string `json:"vcs"`
}

IPRange represents a list of HCP Terraform's IP ranges

type IngressAttributes struct {
	ID                string `jsonapi:"primary,ingress-attributes"`
	Branch            string `jsonapi:"attr,branch"`
	CloneURL          string `jsonapi:"attr,clone-url"`
	CommitMessage     string `jsonapi:"attr,commit-message"`
	CommitSHA         string `jsonapi:"attr,commit-sha"`
	CommitURL         string `jsonapi:"attr,commit-url"`
	CompareURL        string `jsonapi:"attr,compare-url"`
	Identifier        string `jsonapi:"attr,identifier"`
	IsPullRequest     bool   `jsonapi:"attr,is-pull-request"`
	OnDefaultBranch   bool   `jsonapi:"attr,on-default-branch"`
	PullRequestNumber int    `jsonapi:"attr,pull-request-number"`
	PullRequestURL    string `jsonapi:"attr,pull-request-url"`
	PullRequestTitle  string `jsonapi:"attr,pull-request-title"`
	PullRequestBody   string `jsonapi:"attr,pull-request-body"`
	Tag               string `jsonapi:"attr,tag"`
	SenderUsername    string `jsonapi:"attr,sender-username"`
	SenderAvatarURL   string `jsonapi:"attr,sender-avatar-url"`
	SenderHTMLURL     string `jsonapi:"attr,sender-html-url"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

IngressAttributes include commit information associated with configuration versions sourced from VCS.

type Input struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Default     string `json:"default"`
	Required    bool   `json:"required"`
}

JSONChangeDesc represents a change description of a stack plan / apply operation.

type JSONComponent struct {
	Address             string         `json:"address"`
	ComponentAddress    string         `json:"component_address"`
	InstanceCorrelator  string         `json:"instance_correlator"`
	ComponentCorrelator string         `json:"component_correlator"`
	Actions             []ChangeAction `json:"actions"`
	Complete            bool           `json:"complete"`
}

JSONComponent represents a change description of a single component in a plan.

type JSONDeferred struct {
	Reason string `json:"reason"`
}

JSONDeferred contains the reason why a resource instance is deferred: instance_count_unknown, resource_config_unknown, provider_config_unknown, provider_config_unknown, or deferred_prereq.

type JSONImporting struct {
	
	Unknown         bool   `json:"unknown"`
	ID              string `json:"id"`
	GeneratedConfig string `json:"generated_config"`
}

JSONImporting represents the import status of a resource instance in a plan.

JSONOutput is the value of a single output in a plan.

type JSONResourceInstance struct {
	ComponentInstanceCorrelator      string          `json:"component_instance_correlator"`
	ComponentInstanceAddress         string          `json:"component_instance_address"`
	Address                          string          `json:"address"`
	PreviousComponentInstanceAddress string          `json:"previous_component_instance_address,omitempty"`
	PreviousAddress                  string          `json:"previous_address,omitempty"`
	DeposedKey                       string          `json:"deposed,omitempty"`
	ResourceMode                     string          `json:"mode,omitempty"`
	ResourceType                     string          `json:"type"`
	ProviderAddr                     string          `json:"provider_name"`
	Change                           Change          `json:"change"`
	ResourceName                     string          `json:"resource_name"`
	Index                            json.RawMessage `json:"index"`
	IndexUnknown                     bool            `json:"index_unknown"`
	ModuleAddr                       string          `json:"module_address"`
	ActionReason                     string          `json:"action_reason,omitempty"`
}

JSONResourceInstance is the change description of a single resource instance in a plan.

JSONResourceInstanceDeferral is the change description of a single resource instance that is deferred.

type ListOptions struct {
	
	PageNumber int `url:"page[number],omitempty"`

	
	PageSize int `url:"page[size],omitempty"`
}

ListOptions is used to specify pagination options when making API requests. Pagination allows breaking up large result sets into chunks, or "pages".

type LockedByChoice struct {
	Run  *Run
	User *User
	Team *Team
}

LockedByChoice is a choice type struct that represents the possible values within a polymorphic relation. If a value is available, exactly one field will be non-nil.

type LogReader struct {
	
}

LogReader implements io.Reader for streaming logs.

Meta contains any HCP Terraform APIs which provide data about the API itself.

type NoCodeVariableOption struct {
	
	
	Type string `jsonapi:"primary,variable-options"`

	
	VariableName string `jsonapi:"attr,variable-name"`

	
	VariableType string `jsonapi:"attr,variable-type"`

	
	Options []string `jsonapi:"attr,options"`
}

NoCodeVariableOption represents a registry no-code module variable and its options.

type NotificationConfiguration struct {
	ID                string                      `jsonapi:"primary,notification-configurations"`
	CreatedAt         time.Time                   `jsonapi:"attr,created-at,iso8601"`
	DeliveryResponses []*DeliveryResponse         `jsonapi:"attr,delivery-responses"`
	DestinationType   NotificationDestinationType `jsonapi:"attr,destination-type"`
	Enabled           bool                        `jsonapi:"attr,enabled"`
	Name              string                      `jsonapi:"attr,name"`
	Token             string                      `jsonapi:"attr,token"`
	Triggers          []string                    `jsonapi:"attr,triggers"`
	UpdatedAt         time.Time                   `jsonapi:"attr,updated-at,iso8601"`
	URL               string                      `jsonapi:"attr,url"`

	
	EmailAddresses []string `jsonapi:"attr,email-addresses"`

	
	
	Subscribable       *Workspace                                   `jsonapi:"relation,subscribable,omitempty"`
	SubscribableChoice *NotificationConfigurationSubscribableChoice `jsonapi:"polyrelation,subscribable"`

	EmailUsers []*User `jsonapi:"relation,users"`
}

NotificationConfiguration represents a Notification Configuration.

type NotificationConfigurationCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,notification-configurations"`

	
	DestinationType *NotificationDestinationType `jsonapi:"attr,destination-type"`

	
	Enabled *bool `jsonapi:"attr,enabled"`

	
	Name *string `jsonapi:"attr,name"`

	
	Token *string `jsonapi:"attr,token,omitempty"`

	
	Triggers []NotificationTriggerType `jsonapi:"attr,triggers,omitempty"`

	
	URL *string `jsonapi:"attr,url,omitempty"`

	
	
	EmailAddresses []string `jsonapi:"attr,email-addresses,omitempty"`

	
	EmailUsers []*User `jsonapi:"relation,users,omitempty"`

	
	SubscribableChoice *NotificationConfigurationSubscribableChoice `jsonapi:"polyrelation,subscribable,omitempty"`
}

NotificationConfigurationCreateOptions represents the options for creating a new notification configuration.

NotificationConfigurationList represents a list of Notification Configurations.

NotificationConfigurationListOptions represents the options for listing notification configurations.

type NotificationConfigurationSubscribableChoice struct {
	Team      *Team
	Workspace *Workspace
}

NotificationConfigurationSubscribableChoice is a choice type struct that represents the possible values within a polymorphic relation. If a value is available, exactly one field will be non-nil.

type NotificationConfigurationUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,notification-configurations"`

	
	Enabled *bool `jsonapi:"attr,enabled,omitempty"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Token *string `jsonapi:"attr,token,omitempty"`

	
	Triggers []NotificationTriggerType `jsonapi:"attr,triggers,omitempty"`

	
	URL *string `jsonapi:"attr,url,omitempty"`

	
	
	EmailAddresses []string `jsonapi:"attr,email-addresses,omitempty"`

	
	EmailUsers []*User `jsonapi:"relation,users,omitempty"`
}

NotificationConfigurationUpdateOptions represents the options for updating a existing notification configuration.

type NotificationConfigurations interface {
	
	List(ctx context.Context, subscribableID string, options *NotificationConfigurationListOptions) (*NotificationConfigurationList, error)

	
	Create(ctx context.Context, subscribableID string, options NotificationConfigurationCreateOptions) (*NotificationConfiguration, error)

	
	Read(ctx context.Context, notificationConfigurationID string) (*NotificationConfiguration, error)

	
	Update(ctx context.Context, notificationConfigurationID string, options NotificationConfigurationUpdateOptions) (*NotificationConfiguration, error)

	
	Delete(ctx context.Context, notificationConfigurationID string) error

	
	Verify(ctx context.Context, notificationConfigurationID string) (*NotificationConfiguration, error)
}

NotificationConfigurations describes all the Notification Configuration related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/notification-configurations

type NotificationDestinationType string

NotificationDestinationType represents the destination type of the notification configuration.

List of available notification destination types.

NotificationDestination returns a pointer to the given notification configuration destination type

type NotificationTriggerType string

NotificationTriggerType represents the different TFE notifications that can be sent as a run's progress transitions between different states

type OAuthClient struct {
	ID                  string              `jsonapi:"primary,oauth-clients"`
	APIURL              string              `jsonapi:"attr,api-url"`
	CallbackURL         string              `jsonapi:"attr,callback-url"`
	ConnectPath         string              `jsonapi:"attr,connect-path"`
	CreatedAt           time.Time           `jsonapi:"attr,created-at,iso8601"`
	HTTPURL             string              `jsonapi:"attr,http-url"`
	Key                 string              `jsonapi:"attr,key"`
	RSAPublicKey        string              `jsonapi:"attr,rsa-public-key"`
	Name                *string             `jsonapi:"attr,name"`
	Secret              string              `jsonapi:"attr,secret"`
	ServiceProvider     ServiceProviderType `jsonapi:"attr,service-provider"`
	ServiceProviderName string              `jsonapi:"attr,service-provider-display-name"`
	OrganizationScoped  *bool               `jsonapi:"attr,organization-scoped"`

	
	Organization *Organization `jsonapi:"relation,organization"`
	OAuthTokens  []*OAuthToken `jsonapi:"relation,oauth-tokens"`
	AgentPool    *AgentPool    `jsonapi:"relation,agent-pool"`
	
	Projects []*Project `jsonapi:"relation,projects"`
}

OAuthClient represents a connection between an organization and a VCS provider.

type OAuthClientAddProjectsOptions struct {
	
	Projects []*Project
}

OAuthClientAddProjectsOptions represents the options for adding projects to an oauth client.

type OAuthClientCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,oauth-clients"`

	
	Name *string `jsonapi:"attr,name"`

	
	APIURL *string `jsonapi:"attr,api-url"`

	
	HTTPURL *string `jsonapi:"attr,http-url"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	OAuthToken *string `jsonapi:"attr,oauth-token-string,omitempty"`

	
	Projects []*Project `jsonapi:"relation,projects,omitempty"`

	
	PrivateKey *string `jsonapi:"attr,private-key,omitempty"`

	
	Secret *string `jsonapi:"attr,secret,omitempty"`

	
	
	RSAPublicKey *string `jsonapi:"attr,rsa-public-key,omitempty"`

	
	ServiceProvider *ServiceProviderType `jsonapi:"attr,service-provider"`

	
	AgentPool *AgentPool `jsonapi:"relation,agent-pool,omitempty"`

	
	
	OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`
}

OAuthClientCreateOptions represents the options for creating an OAuth client.

type OAuthClientIncludeOpt string

A list of relations to include

OAuthClientList represents a list of OAuth clients.

OAuthClientListOptions represents the options for listing OAuth clients.

type OAuthClientRemoveProjectsOptions struct {
	
	Projects []*Project
}

OAuthClientRemoveProjectsOptions represents the options for removing projects from an oauth client.

type OAuthClientUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,oauth-clients"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	Secret *string `jsonapi:"attr,secret,omitempty"`

	
	
	RSAPublicKey *string `jsonapi:"attr,rsa-public-key,omitempty"`

	
	OAuthToken *string `jsonapi:"attr,oauth-token-string,omitempty"`

	
	AgentPool *AgentPool `jsonapi:"relation,agent-pool,omitempty"`

	
	
	OrganizationScoped *bool `jsonapi:"attr,organization-scoped,omitempty"`
}

OAuthClientUpdateOptions represents the options for updating an OAuth client.

type OAuthClients interface {
	
	List(ctx context.Context, organization string, options *OAuthClientListOptions) (*OAuthClientList, error)

	
	Create(ctx context.Context, organization string, options OAuthClientCreateOptions) (*OAuthClient, error)

	
	Read(ctx context.Context, oAuthClientID string) (*OAuthClient, error)

	
	ReadWithOptions(ctx context.Context, oAuthClientID string, options *OAuthClientReadOptions) (*OAuthClient, error)

	
	Update(ctx context.Context, oAuthClientID string, options OAuthClientUpdateOptions) (*OAuthClient, error)

	
	Delete(ctx context.Context, oAuthClientID string) error

	
	AddProjects(ctx context.Context, oAuthClientID string, options OAuthClientAddProjectsOptions) error

	
	RemoveProjects(ctx context.Context, oAuthClientID string, options OAuthClientRemoveProjectsOptions) error
}

OAuthClients describes all the OAuth client related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/oauth-clients

type OAuthToken struct {
	ID                  string    `jsonapi:"primary,oauth-tokens"`
	UID                 string    `jsonapi:"attr,uid"`
	CreatedAt           time.Time `jsonapi:"attr,created-at,iso8601"`
	HasSSHKey           bool      `jsonapi:"attr,has-ssh-key"`
	ServiceProviderUser string    `jsonapi:"attr,service-provider-user"`

	
	OAuthClient *OAuthClient `jsonapi:"relation,oauth-client"`
}

OAuthToken represents a VCS configuration including the associated OAuth token

type OAuthTokenList struct {
	Items []*OAuthToken
}

OAuthTokenList represents a list of OAuth tokens.

OAuthTokenListOptions represents the options for listing OAuth tokens.

type OAuthTokenUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,oauth-tokens"`

	
	PrivateSSHKey *string `jsonapi:"attr,ssh-key,omitempty"`
}

OAuthTokenUpdateOptions represents the options for updating an OAuth token.

type Organization struct {
	Name                                              string                   `jsonapi:"primary,organizations"`
	AssessmentsEnforced                               bool                     `jsonapi:"attr,assessments-enforced"`
	CollaboratorAuthPolicy                            AuthPolicyType           `jsonapi:"attr,collaborator-auth-policy"`
	CostEstimationEnabled                             bool                     `jsonapi:"attr,cost-estimation-enabled"`
	CreatedAt                                         time.Time                `jsonapi:"attr,created-at,iso8601"`
	DefaultExecutionMode                              string                   `jsonapi:"attr,default-execution-mode"`
	Email                                             string                   `jsonapi:"attr,email"`
	ExternalID                                        string                   `jsonapi:"attr,external-id"`
	IsUnified                                         bool                     `jsonapi:"attr,is-unified"`
	OwnersTeamSAMLRoleID                              string                   `jsonapi:"attr,owners-team-saml-role-id"`
	Permissions                                       *OrganizationPermissions `jsonapi:"attr,permissions"`
	SAMLEnabled                                       bool                     `jsonapi:"attr,saml-enabled"`
	SessionRemember                                   int                      `jsonapi:"attr,session-remember"`
	SessionTimeout                                    int                      `jsonapi:"attr,session-timeout"`
	TrialExpiresAt                                    time.Time                `jsonapi:"attr,trial-expires-at,iso8601"`
	TwoFactorConformant                               bool                     `jsonapi:"attr,two-factor-conformant"`
	SendPassingStatusesForUntriggeredSpeculativePlans bool                     `jsonapi:"attr,send-passing-statuses-for-untriggered-speculative-plans"`
	RemainingTestableCount                            int                      `jsonapi:"attr,remaining-testable-count"`
	SpeculativePlanManagementEnabled                  bool                     `jsonapi:"attr,speculative-plan-management-enabled"`
	
	AggregatedCommitStatusEnabled bool `jsonapi:"attr,aggregated-commit-status-enabled,omitempty"`
	
	
	AllowForceDeleteWorkspaces bool `jsonapi:"attr,allow-force-delete-workspaces"`

	
	DefaultProject   *Project   `jsonapi:"relation,default-project"`
	DefaultAgentPool *AgentPool `jsonapi:"relation,default-agent-pool"`

	
	DataRetentionPolicy *DataRetentionPolicy

	
	DataRetentionPolicyChoice *DataRetentionPolicyChoice `jsonapi:"polyrelation,data-retention-policy"`
}

Organization represents a Terraform Enterprise organization.

type OrganizationAccess struct {
	ManagePolicies           bool `jsonapi:"attr,manage-policies"`
	ManagePolicyOverrides    bool `jsonapi:"attr,manage-policy-overrides"`
	ManageWorkspaces         bool `jsonapi:"attr,manage-workspaces"`
	ManageVCSSettings        bool `jsonapi:"attr,manage-vcs-settings"`
	ManageProviders          bool `jsonapi:"attr,manage-providers"`
	ManageModules            bool `jsonapi:"attr,manage-modules"`
	ManageRunTasks           bool `jsonapi:"attr,manage-run-tasks"`
	ManageProjects           bool `jsonapi:"attr,manage-projects"`
	ReadWorkspaces           bool `jsonapi:"attr,read-workspaces"`
	ReadProjects             bool `jsonapi:"attr,read-projects"`
	ManageMembership         bool `jsonapi:"attr,manage-membership"`
	ManageTeams              bool `jsonapi:"attr,manage-teams"`
	ManageOrganizationAccess bool `jsonapi:"attr,manage-organization-access"`
	AccessSecretTeams        bool `jsonapi:"attr,access-secret-teams"`
	ManageAgentPools         bool `jsonapi:"attr,manage-agent-pools"`
}

OrganizationAccess represents the team's permissions on its organization

type OrganizationAccessOptions struct {
	ManagePolicies           *bool `json:"manage-policies,omitempty"`
	ManagePolicyOverrides    *bool `json:"manage-policy-overrides,omitempty"`
	ManageWorkspaces         *bool `json:"manage-workspaces,omitempty"`
	ManageVCSSettings        *bool `json:"manage-vcs-settings,omitempty"`
	ManageProviders          *bool `json:"manage-providers,omitempty"`
	ManageModules            *bool `json:"manage-modules,omitempty"`
	ManageRunTasks           *bool `json:"manage-run-tasks,omitempty"`
	ManageProjects           *bool `json:"manage-projects,omitempty"`
	ReadWorkspaces           *bool `json:"read-workspaces,omitempty"`
	ReadProjects             *bool `json:"read-projects,omitempty"`
	ManageMembership         *bool `json:"manage-membership,omitempty"`
	ManageTeams              *bool `json:"manage-teams,omitempty"`
	ManageOrganizationAccess *bool `json:"manage-organization-access,omitempty"`
	AccessSecretTeams        *bool `json:"access-secret-teams,omitempty"`
	ManageAgentPools         *bool `json:"manage-agent-pools,omitempty"`
}

OrganizationAccessOptions represents the organization access options of a team.

type OrganizationAuditConfigAuditStreaming struct {
	Enabled                bool   `jsonapi:"attr,enabled"`
	OrganizationID         string `jsonapi:"attr,organization-id"`
	UseDefaultOrganization bool   `jsonapi:"attr,use-default-organization"`
}
type OrganizationAuditConfigAuditTrails struct {
	Enabled bool `jsonapi:"attr,enabled"`
}
type OrganizationAuditConfigPermissions struct {
	CanEnableHCPAuditLogStreaming              bool `jsonapi:"attr,can-enable-hcp-audit-log-streaming"`
	CanSetHCPAuditLogStreamingOrganization     bool `jsonapi:"attr,can-set-hcp-audit-log-streaming-organization-id"`
	CanUseDefaultAuditLogStreamingOrganization bool `jsonapi:"attr,can-use-default-audit-log-streaming-organization"`
}
type OrganizationAuditConfigTimestamps struct {
	AuditTrailsDisabledAt           *time.Time `jsonapi:"attr,audit-trails-disabled-at,iso8601,omitempty"`
	AuditTrailsEnabledAt            *time.Time `jsonapi:"attr,audit-trails-enabled-at,iso8601,omitempty"`
	AuditTrailsLastFailure          *time.Time `jsonapi:"attr,audit-trails-last-failure,iso8601,omitempty"`
	AuditTrailsLastSuccess          *time.Time `jsonapi:"attr,audit-trails-last-success,iso8601,omitempty"`
	HCPAuditLogStreamingDisabledAt  *time.Time `jsonapi:"attr,hcp-audit-log-streaming-disabled-at,iso8601,omitempty"`
	HCPAuditLogStreamingEnabledAt   *time.Time `jsonapi:"attr,hcp-audit-log-streaming-enabled-at,iso8601,omitempty"`
	HCPAuditLogStreamingLastFailure *time.Time `jsonapi:"attr,hcp-audit-log-streaming-last-failure,iso8601,omitempty"`
	HCPAuditLogStreamingLastSuccess *time.Time `jsonapi:"attr,hcp-audit-log-streaming-last-success,iso8601,omitempty"`
}
type OrganizationAuditConfiguration struct {
	AuditTrails          *OrganizationAuditConfigAuditTrails    `jsonapi:"attr,audit-trails,omitempty"`
	HCPAuditLogStreaming *OrganizationAuditConfigAuditStreaming `jsonapi:"attr,hcp-audit-log-streaming,omitempty"`
	ID                   string                                 `jsonapi:"primary,audit-configurations"`
	Permissions          *OrganizationAuditConfigPermissions    `jsonapi:"attr,permissions,omitempty"`
	Timestamps           *OrganizationAuditConfigTimestamps     `jsonapi:"attr,timestamps,omitempty"`
	UpdatedAt            time.Time                              `jsonapi:"attr,updated-at,iso8601"`

	Organization *Organization `jsonapi:"relation,organization"`
}

OrganizationAuditConfiguration represents the auditing configuration for a HCP Terraform Organization.

type OrganizationAuditConfigurationTest struct {
	RequestID *string `json:"request-id,omitempty"`
}

OrganizationAuditConfigurations describes the configuration for auditing events for the organization.

type OrganizationCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,organizations"`

	
	Name *string `jsonapi:"attr,name"`

	
	AssessmentsEnforced *bool `jsonapi:"attr,assessments-enforced,omitempty"`

	
	Email *string `jsonapi:"attr,email"`

	
	SessionRemember *int `jsonapi:"attr,session-remember,omitempty"`

	
	SessionTimeout *int `jsonapi:"attr,session-timeout,omitempty"`

	
	CollaboratorAuthPolicy *AuthPolicyType `jsonapi:"attr,collaborator-auth-policy,omitempty"`

	
	CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"`

	
	OwnersTeamSAMLRoleID *string `jsonapi:"attr,owners-team-saml-role-id,omitempty"`

	
	SendPassingStatusesForUntriggeredSpeculativePlans *bool `jsonapi:"attr,send-passing-statuses-for-untriggered-speculative-plans,omitempty"`

	
	AggregatedCommitStatusEnabled *bool `jsonapi:"attr,aggregated-commit-status-enabled,omitempty"`

	
	SpeculativePlanManagementEnabled *bool `jsonapi:"attr,speculative-plan-management-enabled,omitempty"`

	
	AllowForceDeleteWorkspaces *bool `jsonapi:"attr,allow-force-delete-workspaces,omitempty"`

	
	DefaultExecutionMode *string `jsonapi:"attr,default-execution-mode,omitempty"`

	
	
	StacksEnabled *bool `jsonapi:"attr,stacks-enabled,omitempty"`

	
	RegistryMonorepoSupportEnabled *bool `jsonapi:"attr,registry-monorepo-support-enabled,omitempty"`
}

OrganizationCreateOptions represents the options for creating an organization.

OrganizationList represents a list of organizations.

OrganizationListOptions represents the options for listing organizations.

type OrganizationMembership struct {
	ID     string                       `jsonapi:"primary,organization-memberships"`
	Status OrganizationMembershipStatus `jsonapi:"attr,status"`
	Email  string                       `jsonapi:"attr,email"`

	
	Organization *Organization `jsonapi:"relation,organization"`
	User         *User         `jsonapi:"relation,user"`
	Teams        []*Team       `jsonapi:"relation,teams"`
}

OrganizationMembership represents a Terraform Enterprise organization membership.

type OrganizationMembershipCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,organization-memberships"`

	
	Email *string `jsonapi:"attr,email"`

	
	Teams []*Team `jsonapi:"relation,teams,omitempty"`
}

OrganizationMembershipCreateOptions represents the options for creating an organization membership.

OrganizationMembershipList represents a list of organization memberships.

OrganizationMembershipListOptions represents the options for listing organization memberships.

OrganizationMembershipReadOptions represents the options for reading organization memberships.

type OrganizationMembershipStatus string

OrganizationMembershipStatus represents an organization membership status.

type OrganizationMemberships interface {
	
	List(ctx context.Context, organization string, options *OrganizationMembershipListOptions) (*OrganizationMembershipList, error)

	
	Create(ctx context.Context, organization string, options OrganizationMembershipCreateOptions) (*OrganizationMembership, error)

	
	Read(ctx context.Context, organizationMembershipID string) (*OrganizationMembership, error)

	
	ReadWithOptions(ctx context.Context, organizationMembershipID string, options OrganizationMembershipReadOptions) (*OrganizationMembership, error)

	
	Delete(ctx context.Context, organizationMembershipID string) error
}

OrganizationMemberships describes all the organization membership related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/organization-memberships

type OrganizationPermissions struct {
	CanCreateTeam               bool `jsonapi:"attr,can-create-team"`
	CanCreateWorkspace          bool `jsonapi:"attr,can-create-workspace"`
	CanCreateWorkspaceMigration bool `jsonapi:"attr,can-create-workspace-migration"`
	CanDeployNoCodeModules      bool `jsonapi:"attr,can-deploy-no-code-modules"`
	CanDestroy                  bool `jsonapi:"attr,can-destroy"`
	CanManageAuditing           bool `jsonapi:"attr,can-manage-auditing"`
	CanManageNoCodeModules      bool `jsonapi:"attr,can-manage-no-code-modules"`
	CanManageRunTasks           bool `jsonapi:"attr,can-manage-run-tasks"`
	CanTraverse                 bool `jsonapi:"attr,can-traverse"`
	CanUpdate                   bool `jsonapi:"attr,can-update"`
	CanUpdateAPIToken           bool `jsonapi:"attr,can-update-api-token"`
	CanUpdateOAuth              bool `jsonapi:"attr,can-update-oauth"`
	CanUpdateSentinel           bool `jsonapi:"attr,can-update-sentinel"`
}

OrganizationPermissions represents the organization permissions.

OrganizationReadOptions represents the options for reading organizations.

type OrganizationRunList struct {
	Items []*Run
}

OrganizationRunList represents a list of runs across an organization. It differs from the RunList in that it does not include a TotalCount of records in the pagination details

type OrganizationTag struct {
	ID string `jsonapi:"primary,tags"`
	
	Name string `jsonapi:"attr,name,omitempty"`

	
	InstanceCount int `jsonapi:"attr,instance-count,omitempty"`

	
	Organization *Organization `jsonapi:"relation,organization"`
}

OrganizationTag represents a Terraform Enterprise Organization tag

type OrganizationTagsDeleteOptions struct {
	IDs []string 
}

OrganizationTagsDeleteOptions represents the request body for deleting a tag in an organization

OrganizationTagsList represents a list of organization tags

type OrganizationTagsListOptions struct {
	ListOptions
	
	Filter string `url:"filter[exclude][taggable][id],omitempty"`

	
	Query string `url:"q,omitempty"`
}

OrganizationTagsListOptions represents the options for listing organization tags

type OrganizationToken struct {
	ID          string           `jsonapi:"primary,authentication-tokens"`
	CreatedAt   time.Time        `jsonapi:"attr,created-at,iso8601"`
	Description string           `jsonapi:"attr,description"`
	LastUsedAt  time.Time        `jsonapi:"attr,last-used-at,iso8601"`
	Token       string           `jsonapi:"attr,token"`
	ExpiredAt   time.Time        `jsonapi:"attr,expired-at,iso8601"`
	CreatedBy   *CreatedByChoice `jsonapi:"polyrelation,created-by"`
}

OrganizationToken represents a Terraform Enterprise organization token.

type OrganizationTokenCreateOptions struct {
	
	
	ExpiredAt *time.Time `jsonapi:"attr,expired-at,iso8601,omitempty" url:"-"`
	
	
	TokenType *TokenType `url:"token,omitempty"`
}

OrganizationTokenCreateOptions contains the options for creating an organization token.

type OrganizationTokenDeleteOptions struct {
	
	
	TokenType *TokenType `url:"token,omitempty"`
}

OrganizationTokenDeleteOptions contains the options for deleting an organization token.

type OrganizationTokenReadOptions struct {
	
	
	TokenType *TokenType `url:"token,omitempty"`
}

OrganizationTokenReadOptions contains the options for reading an organization token.

type OrganizationTokens interface {
	
	Create(ctx context.Context, organization string) (*OrganizationToken, error)

	
	CreateWithOptions(ctx context.Context, organization string, options OrganizationTokenCreateOptions) (*OrganizationToken, error)

	
	Read(ctx context.Context, organization string) (*OrganizationToken, error)

	
	ReadWithOptions(ctx context.Context, organization string, options OrganizationTokenReadOptions) (*OrganizationToken, error)

	
	Delete(ctx context.Context, organization string) error

	
	DeleteWithOptions(ctx context.Context, organization string, options OrganizationTokenDeleteOptions) error
}

OrganizationTokens describes all the organization token related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/organization-tokens

type OrganizationUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,organizations"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	AssessmentsEnforced *bool `jsonapi:"attr,assessments-enforced,omitempty"`

	
	Email *string `jsonapi:"attr,email,omitempty"`

	
	SessionRemember *int `jsonapi:"attr,session-remember,omitempty"`

	
	SessionTimeout *int `jsonapi:"attr,session-timeout,omitempty"`

	
	CollaboratorAuthPolicy *AuthPolicyType `jsonapi:"attr,collaborator-auth-policy,omitempty"`

	
	CostEstimationEnabled *bool `jsonapi:"attr,cost-estimation-enabled,omitempty"`

	
	OwnersTeamSAMLRoleID *string `jsonapi:"attr,owners-team-saml-role-id,omitempty"`

	
	SendPassingStatusesForUntriggeredSpeculativePlans *bool `jsonapi:"attr,send-passing-statuses-for-untriggered-speculative-plans,omitempty"`

	
	AggregatedCommitStatusEnabled *bool `jsonapi:"attr,aggregated-commit-status-enabled,omitempty"`

	
	SpeculativePlanManagementEnabled *bool `jsonapi:"attr,speculative-plan-management-enabled,omitempty"`

	
	AllowForceDeleteWorkspaces *bool `jsonapi:"attr,allow-force-delete-workspaces,omitempty"`

	
	DefaultExecutionMode *string `jsonapi:"attr,default-execution-mode,omitempty"`

	
	DefaultAgentPool *AgentPool `jsonapi:"relation,default-agent-pool,omitempty"`

	
	
	StacksEnabled *bool `jsonapi:"attr,stacks-enabled,omitempty"`

	
	RegistryMonorepoSupportEnabled *bool `jsonapi:"attr,registry-monorepo-support-enabled,omitempty"`
}

OrganizationUpdateOptions represents the options for updating an organization.

type Organizations interface {
	
	List(ctx context.Context, options *OrganizationListOptions) (*OrganizationList, error)

	
	Create(ctx context.Context, options OrganizationCreateOptions) (*Organization, error)

	
	Read(ctx context.Context, organization string) (*Organization, error)

	
	ReadWithOptions(ctx context.Context, organization string, options OrganizationReadOptions) (*Organization, error)

	
	Update(ctx context.Context, organization string, options OrganizationUpdateOptions) (*Organization, error)

	
	Delete(ctx context.Context, organization string) error

	
	ReadCapacity(ctx context.Context, organization string) (*Capacity, error)

	
	ReadEntitlements(ctx context.Context, organization string) (*Entitlements, error)

	
	ReadRunQueue(ctx context.Context, organization string, options ReadRunQueueOptions) (*RunQueue, error)

	
	
	
	
	ReadDataRetentionPolicy(ctx context.Context, organization string) (*DataRetentionPolicy, error)

	
	
	ReadDataRetentionPolicyChoice(ctx context.Context, organization string) (*DataRetentionPolicyChoice, error)

	
	
	
	
	SetDataRetentionPolicy(ctx context.Context, organization string, options DataRetentionPolicySetOptions) (*DataRetentionPolicy, error)

	
	
	SetDataRetentionPolicyDeleteOlder(ctx context.Context, organization string, options DataRetentionPolicyDeleteOlderSetOptions) (*DataRetentionPolicyDeleteOlder, error)

	
	
	SetDataRetentionPolicyDontDelete(ctx context.Context, organization string, options DataRetentionPolicyDontDeleteSetOptions) (*DataRetentionPolicyDontDelete, error)

	
	
	DeleteDataRetentionPolicy(ctx context.Context, organization string) error
}

Organizations describes all the organization related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/organizations

config := &Config{
	Token:             "insert-your-token-here",
	RetryServerErrors: true,
}

client, err := NewClient(config)
if err != nil {
	log.Fatal(err)
}

// Create a context
ctx := context.Background()

// Create a new organization
options := OrganizationCreateOptions{
	Name:  String("example"),
	Email: String("info@example.com"),
}

org, err := client.Organizations.Create(ctx, options)
if err != nil {
	log.Fatal(err)
}

// Delete an organization
err = client.Organizations.Delete(ctx, org.Name)
if err != nil {
	log.Fatal(err)
}
type Outcome struct {
	EnforcementLevel EnforcementLevel `jsonapi:"attr,enforcement_level"`
	Query            string           `jsonapi:"attr,query"`
	Status           string           `jsonapi:"attr,status"`
	PolicyName       string           `jsonapi:"attr,policy_name"`
	Description      string           `jsonapi:"attr,description"`
}

Outcome represents the outcome of the individual policy

type Output struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}
type Pagination struct {
}

Pagination is used to return the pagination details of an API request including TotalCount.

type PaginationNextPrev struct {
}

PaginationNextPrev is used to return the pagination details of an API request.

Parent represents the variable set's parent (currently only organizations and projects are supported). This relation is considered BETA, SUBJECT TO CHANGE, and likely unavailable to most users.

type Permissions struct {
	CanOverridePolicy *bool `jsonapi:"attr,can-override-policy"`
	CanOverrideTasks  *bool `jsonapi:"attr,can-override-tasks"`
	CanOverride       *bool `jsonapi:"attr,can-override"`
}

Permissions represents the permission types for overridding a task stage

type Plan struct {
	ID                     string                `jsonapi:"primary,plans"`
	HasChanges             bool                  `jsonapi:"attr,has-changes"`
	GeneratedConfiguration bool                  `jsonapi:"attr,generated-configuration"`
	LogReadURL             string                `jsonapi:"attr,log-read-url"`
	ResourceAdditions      int                   `jsonapi:"attr,resource-additions"`
	ResourceChanges        int                   `jsonapi:"attr,resource-changes"`
	ResourceDestructions   int                   `jsonapi:"attr,resource-destructions"`
	ResourceImports        int                   `jsonapi:"attr,resource-imports"`
	Status                 PlanStatus            `jsonapi:"attr,status"`
	StatusTimestamps       *PlanStatusTimestamps `jsonapi:"attr,status-timestamps"`

	
	Exports []*PlanExport `jsonapi:"relation,exports"`
}

Plan represents a Terraform Enterprise plan.

type PlanChanges struct {
	Add    int `jsonapi:"attr,add"`
	Total  int `jsonapi:"attr,total"`
	Change int `jsonapi:"attr,change"`
	Import int `jsonapi:"attr,import"`
	Remove int `jsonapi:"attr,remove"`
}

PlanChanges is the summary of the planned changes

PlanExport represents an export of Terraform Enterprise plan data.

type PlanExportCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,plan-exports"`

	
	Plan *Plan `jsonapi:"relation,plan"`

	
	DataType *PlanExportDataType `jsonapi:"attr,data-type"`
}

PlanExportCreateOptions represents the options for exporting data from a plan.

type PlanExportDataType string

PlanExportDataType represents the type of data exported from a plan.

List all available plan export data types.

PlanExportType returns a pointer to the given plan export data type.

PlanExportStatus represents a plan export state.

List all available plan export statuses.

type PlanExportStatusTimestamps struct {
	CanceledAt time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt  time.Time `jsonapi:"attr,errored-at,rfc3339"`
	ExpiredAt  time.Time `jsonapi:"attr,expired-at,rfc3339"`
	FinishedAt time.Time `jsonapi:"attr,finished-at,rfc3339"`
	QueuedAt   time.Time `jsonapi:"attr,queued-at,rfc3339"`
}

PlanExportStatusTimestamps holds the timestamps for plan export statuses.

PlanStatus represents a plan state.

List all available plan statuses.

type PlanStatusTimestamps struct {
	CanceledAt      time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt       time.Time `jsonapi:"attr,errored-at,rfc3339"`
	FinishedAt      time.Time `jsonapi:"attr,finished-at,rfc3339"`
	ForceCanceledAt time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
	QueuedAt        time.Time `jsonapi:"attr,queued-at,rfc3339"`
	StartedAt       time.Time `jsonapi:"attr,started-at,rfc3339"`
}

PlanStatusTimestamps holds the timestamps for individual plan statuses.

type Policies interface {
	
	List(ctx context.Context, organization string, options *PolicyListOptions) (*PolicyList, error)

	
	Create(ctx context.Context, organization string, options PolicyCreateOptions) (*Policy, error)

	
	Read(ctx context.Context, policyID string) (*Policy, error)

	
	Update(ctx context.Context, policyID string, options PolicyUpdateOptions) (*Policy, error)

	
	Delete(ctx context.Context, policyID string) error

	
	Upload(ctx context.Context, policyID string, content []byte) error

	
	Download(ctx context.Context, policyID string) ([]byte, error)
}

Policies describes all the policy related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policies

type Policy struct {
	ID          string     `jsonapi:"primary,policies"`
	Name        string     `jsonapi:"attr,name"`
	Kind        PolicyKind `jsonapi:"attr,kind"`
	Query       *string    `jsonapi:"attr,query"`
	Description string     `jsonapi:"attr,description"`
	
	Enforce          []*Enforcement   `jsonapi:"attr,enforce"`
	EnforcementLevel EnforcementLevel `jsonapi:"attr,enforcement-level"`
	PolicySetCount   int              `jsonapi:"attr,policy-set-count"`
	UpdatedAt        time.Time        `jsonapi:"attr,updated-at,iso8601"`

	
	Organization *Organization `jsonapi:"relation,organization"`
}

Policy represents a Terraform Enterprise policy.

type PolicyActions struct {
	IsOverridable bool `jsonapi:"attr,is-overridable"`
}

PolicyActions represents the policy check actions.

type PolicyAttachable struct {
	ID   string `jsonapi:"attr,id"`
	Type string `jsonapi:"attr,type"`
}

The task stage the policy evaluation belongs to

PolicyCheck represents a Terraform Enterprise policy check..

PolicyCheckList represents a list of policy checks.

PolicyCheckListOptions represents the options for listing policy checks.

type PolicyCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,policies"`

	
	Name *string `jsonapi:"attr,name"`

	
	Kind PolicyKind `jsonapi:"attr,kind,omitempty"`

	
	Query *string `jsonapi:"attr,query,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	
	
	Enforce []*EnforcementOptions `jsonapi:"attr,enforce,omitempty"`

	
	
	EnforcementLevel *EnforcementLevel `jsonapi:"attr,enforcement-level,omitempty"`
}

PolicyCreateOptions represents the options for creating a new policy.

type PolicyEvaluation struct {
	ID               string                           `jsonapi:"primary,policy-evaluations"`
	Status           PolicyEvaluationStatus           `jsonapi:"attr,status"`
	PolicyKind       PolicyKind                       `jsonapi:"attr,policy-kind"`
	StatusTimestamps PolicyEvaluationStatusTimestamps `jsonapi:"attr,status-timestamps"`
	ResultCount      *PolicyResultCount               `jsonapi:"attr,result-count"`
	CreatedAt        time.Time                        `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt        time.Time                        `jsonapi:"attr,updated-at,iso8601"`

	
	TaskStage *PolicyAttachable `jsonapi:"relation,policy-attachable"`
}

PolicyEvaluation represents the policy evaluations that are part of the task stage.

PolicyEvaluationList represents a list of policy evaluation.

type PolicyEvaluationListOptions struct {
	ListOptions
}

PolicyEvaluationListOptions represents the options for listing policy evaluations.

type PolicyEvaluationStatus string

PolicyEvaluationStatus is an enum that represents all possible statuses for a policy evaluation

type PolicyEvaluationStatusTimestamps struct {
	ErroredAt  time.Time `jsonapi:"attr,errored-at,rfc3339"`
	RunningAt  time.Time `jsonapi:"attr,running-at,rfc3339"`
	CanceledAt time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	FailedAt   time.Time `jsonapi:"attr,failed-at,rfc3339"`
	PassedAt   time.Time `jsonapi:"attr,passed-at,rfc3339"`
}

PolicyEvaluationStatusTimestamps represents the set of timestamps recorded for a policy evaluation

PolicyKind is an indicator of the underlying technology that the policy or policy set supports. There are two kinds documented in the enum.

type PolicyList struct {
	Items []*Policy
}

PolicyList represents a list of policies..

type PolicyListOptions struct {
	ListOptions

	
	Search string `url:"search[name],omitempty"`

	
	Kind PolicyKind `url:"filter[kind],omitempty"`
}

PolicyListOptions represents the options for listing policies.

type PolicyPermissions struct {
	CanOverride bool `jsonapi:"attr,can-override"`
}

PolicyPermissions represents the policy check permissions.

type PolicyResult struct {
	AdvisoryFailed int  `jsonapi:"attr,advisory-failed"`
	Duration       int  `jsonapi:"attr,duration"`
	HardFailed     int  `jsonapi:"attr,hard-failed"`
	Passed         int  `jsonapi:"attr,passed"`
	Result         bool `jsonapi:"attr,result"`
	SoftFailed     int  `jsonapi:"attr,soft-failed"`
	TotalFailed    int  `jsonapi:"attr,total-failed"`
	Sentinel       any  `jsonapi:"attr,sentinel"`
}

PolicyResult represents the complete policy check result,

type PolicyResultCount struct {
	AdvisoryFailed  int `jsonapi:"attr,advisory-failed"`
	MandatoryFailed int `jsonapi:"attr,mandatory-failed"`
	Passed          int `jsonapi:"attr,passed"`
	Errored         int `jsonapi:"attr,errored"`
}

PolicyResultCount represents the count of the policy results

PolicyScope represents a policy scope.

List all available policy scopes.

type PolicySet struct {
	ID           string     `jsonapi:"primary,policy-sets"`
	Name         string     `jsonapi:"attr,name"`
	Description  string     `jsonapi:"attr,description"`
	Kind         PolicyKind `jsonapi:"attr,kind"`
	Overridable  *bool      `jsonapi:"attr,overridable"`
	Global       bool       `jsonapi:"attr,global"`
	PoliciesPath string     `jsonapi:"attr,policies-path"`
	
	PolicyCount       int       `jsonapi:"attr,policy-count"`
	VCSRepo           *VCSRepo  `jsonapi:"attr,vcs-repo"`
	WorkspaceCount    int       `jsonapi:"attr,workspace-count"`
	ProjectCount      int       `jsonapi:"attr,project-count"`
	CreatedAt         time.Time `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt         time.Time `jsonapi:"attr,updated-at,iso8601"`
	AgentEnabled      bool      `jsonapi:"attr,agent-enabled"`
	PolicyToolVersion string    `jsonapi:"attr,policy-tool-version"`

	
	
	Organization *Organization `jsonapi:"relation,organization"`
	
	Workspaces []*Workspace `jsonapi:"relation,workspaces"`
	
	Policies []*Policy `jsonapi:"relation,policies"`
	
	
	
	NewestVersion *PolicySetVersion `jsonapi:"relation,newest-version"`
	
	CurrentVersion *PolicySetVersion `jsonapi:"relation,current-version"`
	
	WorkspaceExclusions []*Workspace `jsonapi:"relation,workspace-exclusions"`
	
	Projects []*Project `jsonapi:"relation,projects"`
}

PolicySet represents a Terraform Enterprise policy set.

type PolicySetAddPoliciesOptions struct {
	
	Policies []*Policy
}

PolicySetAddPoliciesOptions represents the options for adding policies to a policy set.

type PolicySetAddProjectsOptions struct {
	
	Projects []*Project
}

PolicySetAddProjectsOptions represents the options for adding projects to a policy set.

type PolicySetAddWorkspaceExclusionsOptions struct {
	
	WorkspaceExclusions []*Workspace
}

PolicySetAddWorkspaceExclusionsOptions represents the options for adding workspace exclusions to a policy set.

type PolicySetAddWorkspacesOptions struct {
	
	Workspaces []*Workspace
}

PolicySetAddWorkspacesOptions represents the options for adding workspaces to a policy set.

type PolicySetCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,policy-sets"`

	
	Name *string `jsonapi:"attr,name"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Global *bool `jsonapi:"attr,global,omitempty"`

	
	Kind PolicyKind `jsonapi:"attr,kind,omitempty"`

	
	
	Overridable *bool `jsonapi:"attr,overridable,omitempty"`

	
	AgentEnabled *bool `jsonapi:"attr,agent-enabled,omitempty"`

	
	PolicyToolVersion *string `jsonapi:"attr,policy-tool-version,omitempty"`

	
	
	
	PoliciesPath *string `jsonapi:"attr,policies-path,omitempty"`

	
	Policies []*Policy `jsonapi:"relation,policies,omitempty"`

	
	
	
	
	
	VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"`

	
	Workspaces []*Workspace `jsonapi:"relation,workspaces,omitempty"`

	
	WorkspaceExclusions []*Workspace `jsonapi:"relation,workspace-exclusions,omitempty"`

	
	Projects []*Project `jsonapi:"relation,projects,omitempty"`
}

PolicySetCreateOptions represents the options for creating a new policy set.

type PolicySetIngressAttributes struct {
	CommitSHA  string `jsonapi:"attr,commit-sha"`
	CommitURL  string `jsonapi:"attr,commit-url"`
	Identifier string `jsonapi:"attr,identifier"`
}
type PolicySetList struct {
	Items []*PolicySet
}

PolicySetList represents a list of policy sets.

PolicySetListOptions represents the options for listing policy sets.

type PolicySetOutcome struct {
	ID                   string            `jsonapi:"primary,policy-set-outcomes"`
	Outcomes             []Outcome         `jsonapi:"attr,outcomes"`
	Error                string            `jsonapi:"attr,error"`
	Overridable          *bool             `jsonapi:"attr,overridable"`
	PolicySetName        string            `jsonapi:"attr,policy-set-name"`
	PolicySetDescription string            `jsonapi:"attr,policy-set-description"`
	ResultCount          PolicyResultCount `jsonapi:"attr,result_count"`

	
	PolicyEvaluation *PolicyEvaluation `jsonapi:"relation,policy-evaluation"`
}

PolicySetOutcome represents outcome of the policy set that are part of the policy evaluation

PolicySetOutcomeList represents a list of policy set outcomes.

type PolicySetOutcomeListFilter struct {
	
	
	Status string

	
	
	EnforcementLevel string
}

PolicySetOutcomeListFilter represents the filters that are supported while listing a policy set outcome

PolicySetOutcomeListOptions represents the options for listing policy set outcomes.

type PolicySetParameter struct {
	ID        string       `jsonapi:"primary,vars"`
	Key       string       `jsonapi:"attr,key"`
	Value     string       `jsonapi:"attr,value"`
	Category  CategoryType `jsonapi:"attr,category"`
	Sensitive bool         `jsonapi:"attr,sensitive"`

	
	PolicySet *PolicySet `jsonapi:"relation,configurable"`
}

PolicySetParameter represents a Policy Set parameter

type PolicySetParameterCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Category *CategoryType `jsonapi:"attr,category"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

PolicySetParameterCreateOptions represents the options for creating a new parameter.

PolicySetParameterList represents a list of parameters.

type PolicySetParameterListOptions struct {
	ListOptions
}

PolicySetParameterListOptions represents the options for listing parameters.

type PolicySetParameterUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

PolicySetParameterUpdateOptions represents the options for updating a parameter.

type PolicySetParameters interface {
	
	List(ctx context.Context, policySetID string, options *PolicySetParameterListOptions) (*PolicySetParameterList, error)

	
	Create(ctx context.Context, policySetID string, options PolicySetParameterCreateOptions) (*PolicySetParameter, error)

	
	Read(ctx context.Context, policySetID string, parameterID string) (*PolicySetParameter, error)

	
	Update(ctx context.Context, policySetID string, parameterID string, options PolicySetParameterUpdateOptions) (*PolicySetParameter, error)

	
	Delete(ctx context.Context, policySetID string, parameterID string) error
}

PolicySetParameters describes all the parameter related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-set-params

type PolicySetRemovePoliciesOptions struct {
	
	Policies []*Policy
}

PolicySetRemovePoliciesOptions represents the options for removing policies from a policy set.

type PolicySetRemoveProjectsOptions struct {
	
	Projects []*Project
}

PolicySetRemoveProjectsOptions represents the options for removing projects from a policy set.

type PolicySetRemoveWorkspaceExclusionsOptions struct {
	
	WorkspaceExclusions []*Workspace
}

PolicySetRemoveWorkspaceExclusionsOptions represents the options for removing workspace exclusions from a policy set.

type PolicySetRemoveWorkspacesOptions struct {
	
	Workspaces []*Workspace
}

PolicySetRemoveWorkspacesOptions represents the options for removing workspaces from a policy set.

type PolicySetUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,policy-sets"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Global *bool `jsonapi:"attr,global,omitempty"`

	
	
	Overridable *bool `jsonapi:"attr,overridable,omitempty"`

	
	AgentEnabled *bool `jsonapi:"attr,agent-enabled,omitempty"`

	
	PolicyToolVersion *string `jsonapi:"attr,policy-tool-version,omitempty"`

	
	
	
	PoliciesPath *string `jsonapi:"attr,policies-path,omitempty"`

	
	
	
	
	
	
	VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"`
}

PolicySetUpdateOptions represents the options for updating a policy set.

type PolicySetVersion struct {
	ID                string                           `jsonapi:"primary,policy-set-versions"`
	Source            PolicySetVersionSource           `jsonapi:"attr,source"`
	Status            PolicySetVersionStatus           `jsonapi:"attr,status"`
	StatusTimestamps  PolicySetVersionStatusTimestamps `jsonapi:"attr,status-timestamps"`
	Error             string                           `jsonapi:"attr,error"`
	ErrorMessage      string                           `jsonapi:"attr,error-message"`
	CreatedAt         time.Time                        `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt         time.Time                        `jsonapi:"attr,updated-at,iso8601"`
	IngressAttributes *PolicySetIngressAttributes      `jsonapi:"attr,ingress-attributes"`

	
	PolicySet *PolicySet `jsonapi:"relation,policy-set"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

PolicySetVersion represents a Terraform Enterprise Policy Set Version

type PolicySetVersionSource string

PolicySetVersionSource represents a source type of a policy set version.

List all available sources for a Policy Set Version.

type PolicySetVersionStatus string

PolicySetVersionStatus represents a policy set version status.

List all available policy set version statuses.

type PolicySetVersionStatusTimestamps struct {
	PendingAt    time.Time `jsonapi:"attr,pending-at,rfc3339"`
	IngressingAt time.Time `jsonapi:"attr,ingressing-at,rfc3339"`
	ReadyAt      time.Time `jsonapi:"attr,ready-at,rfc3339"`
	ErroredAt    time.Time `jsonapi:"attr,errored-at,rfc3339"`
}

PolicySetVersionStatusTimestamps holds the timestamps for individual policy set version statuses.

type PolicySets interface {
	
	List(ctx context.Context, organization string, options *PolicySetListOptions) (*PolicySetList, error)

	
	Create(ctx context.Context, organization string, options PolicySetCreateOptions) (*PolicySet, error)

	
	Read(ctx context.Context, policySetID string) (*PolicySet, error)

	
	ReadWithOptions(ctx context.Context, policySetID string, options *PolicySetReadOptions) (*PolicySet, error)

	
	Update(ctx context.Context, policySetID string, options PolicySetUpdateOptions) (*PolicySet, error)

	
	
	AddPolicies(ctx context.Context, policySetID string, options PolicySetAddPoliciesOptions) error

	
	
	RemovePolicies(ctx context.Context, policySetID string, options PolicySetRemovePoliciesOptions) error

	
	AddWorkspaces(ctx context.Context, policySetID string, options PolicySetAddWorkspacesOptions) error

	
	RemoveWorkspaces(ctx context.Context, policySetID string, options PolicySetRemoveWorkspacesOptions) error

	
	AddWorkspaceExclusions(ctx context.Context, policySetID string, options PolicySetAddWorkspaceExclusionsOptions) error

	
	RemoveWorkspaceExclusions(ctx context.Context, policySetID string, options PolicySetRemoveWorkspaceExclusionsOptions) error

	
	AddProjects(ctx context.Context, policySetID string, options PolicySetAddProjectsOptions) error

	
	RemoveProjects(ctx context.Context, policySetID string, options PolicySetRemoveProjectsOptions) error

	
	Delete(ctx context.Context, policyID string) error
}

PolicySets describes all the policy set related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/policy-sets

PolicyStatus represents a policy check state.

List all available policy check statuses.

type PolicyStatusTimestamps struct {
	ErroredAt    time.Time `jsonapi:"attr,errored-at,rfc3339"`
	HardFailedAt time.Time `jsonapi:"attr,hard-failed-at,rfc3339"`
	PassedAt     time.Time `jsonapi:"attr,passed-at,rfc3339"`
	QueuedAt     time.Time `jsonapi:"attr,queued-at,rfc3339"`
	SoftFailedAt time.Time `jsonapi:"attr,soft-failed-at,rfc3339"`
}

PolicyStatusTimestamps holds the timestamps for individual policy check statuses.

type PolicyUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,policies"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Query *string `jsonapi:"attr,query,omitempty"`

	
	
	
	Enforce []*EnforcementOptions `jsonapi:"attr,enforce,omitempty"`

	
	EnforcementLevel *EnforcementLevel `jsonapi:"attr,enforcement-level,omitempty"`
}

PolicyUpdateOptions represents the options for updating a policy.

type Project struct {
	ID        string `jsonapi:"primary,projects"`
	IsUnified bool   `jsonapi:"attr,is-unified"`
	Name      string `jsonapi:"attr,name"`

	Description string `jsonapi:"attr,description"`

	AutoDestroyActivityDuration jsonapi.NullableAttr[string] `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`

	
	Organization         *Organization          `jsonapi:"relation,organization"`
	EffectiveTagBindings []*EffectiveTagBinding `jsonapi:"relation,effective-tag-bindings"`
}

Project represents a Terraform Enterprise project

type ProjectAddTagBindingsOptions struct {
	TagBindings []*TagBinding
}

ProjectAddTagBindingsOptions represents the options for adding tag bindings to a project.

type ProjectCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,projects"`

	
	Name string `jsonapi:"attr,name"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	TagBindings []*TagBinding `jsonapi:"relation,tag-bindings,omitempty"`

	
	
	
	AutoDestroyActivityDuration jsonapi.NullableAttr[string] `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`
}

ProjectCreateOptions represents the options for creating a project

type ProjectList struct {
	Items []*Project
}

ProjectList represents a list of projects

ProjectListOptions represents the options for listing projects

type ProjectReadOptions struct {
	
	Include []ProjectIncludeOpt `url:"include,omitempty"`
}
type ProjectSettingsPermissionType string

ProjectSettingsPermissionType represents the permissiontype to a project's settings

ProjectSettingsPermission returns a pointer to the given team access project type.

type ProjectTeamsPermissionType string

ProjectTeamsPermissionType represents the permissiontype to a project's teams

ProjectTeamsPermission returns a pointer to the given team access project type.

type ProjectUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,projects"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	
	TagBindings []*TagBinding `jsonapi:"relation,tag-bindings,omitempty"`

	
	
	
	AutoDestroyActivityDuration jsonapi.NullableAttr[string] `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`
}

ProjectUpdateOptions represents the options for updating a project

type ProjectVariableSetsPermissionType string

ProjectVariableSetsPermissionType represents the permission type to a project's variable sets

ProjectVariableSetsPermission returns a pointer to the given team access project type.

type Projects interface {
	
	List(ctx context.Context, organization string, options *ProjectListOptions) (*ProjectList, error)

	
	Create(ctx context.Context, organization string, options ProjectCreateOptions) (*Project, error)

	
	Read(ctx context.Context, projectID string) (*Project, error)

	
	ReadWithOptions(ctx context.Context, projectID string, options ProjectReadOptions) (*Project, error)

	
	Update(ctx context.Context, projectID string, options ProjectUpdateOptions) (*Project, error)

	
	Delete(ctx context.Context, projectID string) error

	
	ListTagBindings(ctx context.Context, projectID string) ([]*TagBinding, error)

	
	
	
	ListEffectiveTagBindings(ctx context.Context, workspaceID string) ([]*EffectiveTagBinding, error)

	
	AddTagBindings(ctx context.Context, projectID string, options ProjectAddTagBindingsOptions) ([]*TagBinding, error)

	
	DeleteAllTagBindings(ctx context.Context, projectID string) error
}

Projects describes all the project related methods that the Terraform Enterprise API supports

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/projects

type ProviderData struct {
	NullResource         int `json:"null-resource"`
	TerraformRemoteState int `json:"data.terraform-remote-state"`
}
type ProviderDependency struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Source    string `json:"source"`
	Version   string `json:"version"`
}
type PublishingMechanism string
type QueryRun struct {
	ID               string               `jsonapi:"primary,queries"`
	CreatedAt        time.Time            `jsonapi:"attr,created-at,iso8601"`
	Source           RunSource            `jsonapi:"attr,source"`
	Status           RunStatus            `jsonapi:"attr,status"`
	StatusTimestamps *RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
	TerraformVersion string               `jsonapi:"attr,terraform-version"`
	Variables        []*RunVariableAttr   `jsonapi:"attr,variables"`

	
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`
	CreatedBy            *User                 `jsonapi:"relation,created-by"`
	CanceledBy           *User                 `jsonapi:"relation,canceled-by"`
	Workspace            *Workspace            `jsonapi:"relation,workspace"`
}

QueryRun represents a Terraform Enterprise query run.

type QueryRunCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,queries"`

	
	
	TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"`

	Source QueryRunSource `jsonapi:"attr,source"`

	
	
	
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`

	
	Workspace *Workspace `jsonapi:"relation,workspace"`

	
	
	Variables []*RunVariable `jsonapi:"attr,variables,omitempty"`
}

QueryRunCreateOptions represents the options for creating a new run.

type QueryRunList struct {
	Items []*QueryRun
}

QueryRunList represents a list of query runs.

QueryRunListOptions represents the options for listing query runs.

type QueryRunReadOptions struct {
	Include []QueryRunIncludeOpt `url:"include,omitempty"`
}

QueryRunReadOptions represents the options for reading a query run.

QueryRunSource represents the available sources for query runs.

List all available run sources.

type QueryRunStatusTimestamps struct {
	CanceledAt      time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt       time.Time `jsonapi:"attr,errored-at,rfc3339"`
	ForceCanceledAt time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
	QueuingAt       time.Time `jsonapi:"attr,queuing-at,rfc3339"`
	FinishedAt      time.Time `jsonapi:"attr,finished-at,rfc3339"`
	RunningAt       time.Time `jsonapi:"attr,running-at,rfc3339"`
}

QueryRunStatusTimestamps holds the timestamps for individual run statuses.

type QueryRuns interface {
	
	List(ctx context.Context, workspaceID string, options *QueryRunListOptions) (*QueryRunList, error)

	
	Create(ctx context.Context, options QueryRunCreateOptions) (*QueryRun, error)

	
	Read(ctx context.Context, queryRunID string) (*QueryRun, error)

	
	ReadWithOptions(ctx context.Context, queryRunID string, options *QueryRunReadOptions) (*QueryRun, error)

	
	Cancel(ctx context.Context, runID string) error

	
	ForceCancel(ctx context.Context, runID string) error
}

QueryRuns describes all the run related methods that the Terraform Enterprise API supports.

NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

ReadRunQueueOptions represents the options for showing the queue.

type RegistryModule struct {
	ID                  string                          `jsonapi:"primary,registry-modules"`
	Name                string                          `jsonapi:"attr,name"`
	Provider            string                          `jsonapi:"attr,provider"`
	RegistryName        RegistryName                    `jsonapi:"attr,registry-name"`
	Namespace           string                          `jsonapi:"attr,namespace"`
	NoCode              bool                            `jsonapi:"attr,no-code"`
	Permissions         *RegistryModulePermissions      `jsonapi:"attr,permissions"`
	PublishingMechanism PublishingMechanism             `jsonapi:"attr,publishing-mechanism"`
	Status              RegistryModuleStatus            `jsonapi:"attr,status"`
	TestConfig          *TestConfig                     `jsonapi:"attr,test-config"`
	VCSRepo             *VCSRepo                        `jsonapi:"attr,vcs-repo"`
	VersionStatuses     []RegistryModuleVersionStatuses `jsonapi:"attr,version-statuses"`
	CreatedAt           string                          `jsonapi:"attr,created-at"`
	UpdatedAt           string                          `jsonapi:"attr,updated-at"`

	
	Organization *Organization `jsonapi:"relation,organization"`

	RegistryNoCodeModule []*RegistryNoCodeModule `jsonapi:"relation,no-code-modules"`
}

RegistryModule represents a registry module

type RegistryModuleCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,registry-modules"`
	
	Name *string `jsonapi:"attr,name"`
	
	Provider *string `jsonapi:"attr,provider"`
	
	
	RegistryName RegistryName `jsonapi:"attr,registry-name,omitempty"`
	
	Namespace string `jsonapi:"attr,namespace,omitempty"`
	
	
	NoCode *bool `jsonapi:"attr,no-code,omitempty"`
}

RegistryModuleCreateOptions is used when creating a registry module without a VCS repo

type RegistryModuleCreateVersionOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,registry-module-versions"`

	Version *string `jsonapi:"attr,version"`

	CommitSHA *string `jsonapi:"attr,commit-sha"`
}

RegistryModuleCreateVersionOptions is used when creating a registry module version

RegistryModuleCreateWithVCSConnectionOptions is used when creating a registry module with a VCS repo

RegistryModuleList represents a list of registry modules.

type RegistryModuleListIncludeOpt string

RegistryModuleListOptions represents the options for listing registry modules.

type RegistryModulePermissions struct {
	CanDelete bool `jsonapi:"attr,can-delete"`
	CanResync bool `jsonapi:"attr,can-resync"`
	CanRetry  bool `jsonapi:"attr,can-retry"`
}
type RegistryModuleStatus string

RegistryModuleStatus represents the status of the registry module

List of available registry module statuses

type RegistryModuleTestConfigOptions struct {
	TestsEnabled *bool `jsonapi:"attr,tests-enabled,omitempty"`
}

RegistryModuleCreateVersionOptions is used when updating a registry module

type RegistryModuleVCSRepoOptions struct {
	Identifier        *string `json:"identifier"` 
	OAuthTokenID      *string `json:"oauth-token-id,omitempty"`
	DisplayIdentifier *string `json:"display-identifier,omitempty"` 
	GHAInstallationID *string `json:"github-app-installation-id,omitempty"`
	OrganizationName  *string `json:"organization-name,omitempty"`

	
	
	
	
	Branch *string `json:"branch,omitempty"`
	Tags   *bool   `json:"tags,omitempty"`

	
	SourceDirectory *string `json:"source-directory,omitempty"`
	TagPrefix       *string `json:"tag-prefix,omitempty"`
}
type RegistryModuleVCSRepoUpdateOptions struct {
	
	
	
	
	
	Branch *string `json:"branch,omitempty"`
	Tags   *bool   `json:"tags,omitempty"`

	
	SourceDirectory *string `json:"source-directory,omitempty"`
	TagPrefix       *string `json:"tag-prefix,omitempty"`
}
type RegistryModuleVariable struct {
	
	ID string `jsonapi:"primary,registry-module-variables"`

	
	Name string `jsonapi:"attr,name"`

	
	VariableType string `jsonapi:"attr,type"`

	
	Description string `jsonapi:"attr,description"`

	
	Required bool `jsonapi:"attr,required"`

	
	Sensitive bool `jsonapi:"attr,sensitive"`

	
	Options []string `jsonapi:"attr,options"`

	
	HasGlobal bool `jsonapi:"attr,has-global"`
}

RegistryModuleVariable represents a registry module variable.

RegistryModuleVariableList is a list of registry module variables. **Note: This API is still in BETA and subject to change.**

type RegistryModuleVersion struct {
	ID        string                      `jsonapi:"primary,registry-module-versions"`
	Source    string                      `jsonapi:"attr,source"`
	Status    RegistryModuleVersionStatus `jsonapi:"attr,status"`
	Version   string                      `jsonapi:"attr,version"`
	CreatedAt string                      `jsonapi:"attr,created-at"`
	UpdatedAt string                      `jsonapi:"attr,updated-at"`

	
	RegistryModule *RegistryModule `jsonapi:"relation,registry-module"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

RegistryModuleVersion represents a registry module version

type RegistryModuleVersionStatus string

RegistryModuleVersionStatus represents the status of a specific version of a registry module

List of available registry module version statuses

type RegistryModules interface {
	
	List(ctx context.Context, organization string, options *RegistryModuleListOptions) (*RegistryModuleList, error)

	
	
	
	ListCommits(ctx context.Context, moduleID RegistryModuleID) (*CommitList, error)

	
	Create(ctx context.Context, organization string, options RegistryModuleCreateOptions) (*RegistryModule, error)

	
	CreateVersion(ctx context.Context, moduleID RegistryModuleID, options RegistryModuleCreateVersionOptions) (*RegistryModuleVersion, error)

	
	CreateWithVCSConnection(ctx context.Context, options RegistryModuleCreateWithVCSConnectionOptions) (*RegistryModule, error)

	
	Read(ctx context.Context, moduleID RegistryModuleID) (*RegistryModule, error)

	
	ReadVersion(ctx context.Context, moduleID RegistryModuleID, version string) (*RegistryModuleVersion, error)

	
	
	
	
	ReadTerraformRegistryModule(ctx context.Context, moduleID RegistryModuleID, version string) (*TerraformRegistryModule, error)

	
	
	Delete(ctx context.Context, organization string, name string) error

	
	DeleteByName(ctx context.Context, module RegistryModuleID) error

	
	DeleteProvider(ctx context.Context, moduleID RegistryModuleID) error

	
	DeleteVersion(ctx context.Context, moduleID RegistryModuleID, version string) error

	
	Update(ctx context.Context, moduleID RegistryModuleID, options RegistryModuleUpdateOptions) (*RegistryModule, error)

	
	
	
	Upload(ctx context.Context, rmv RegistryModuleVersion, path string) error

	
	UploadTarGzip(ctx context.Context, url string, r io.Reader) error
}

RegistryModules describes all the registry module related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/modules

RegistryName represents which registry is being targeted

List of available registry names

type RegistryNoCodeModule struct {
	ID         string `jsonapi:"primary,no-code-modules"`
	VersionPin string `jsonapi:"attr,version-pin"`
	Enabled    bool   `jsonapi:"attr,enabled"`

	
	Organization    *Organization           `jsonapi:"relation,organization"`
	RegistryModule  *RegistryModule         `jsonapi:"relation,registry-module"`
	VariableOptions []*NoCodeVariableOption `jsonapi:"relation,variable-options"`
}

RegistryNoCodeModule represents a registry no-code module

type RegistryNoCodeModuleCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,no-code-modules"`

	
	RegistryModule *RegistryModule `jsonapi:"relation,registry-module"`

	
	Enabled *bool `jsonapi:"attr,enabled,omitempty"`

	
	VersionPin string `jsonapi:"attr,version-pin,omitempty"`

	
	VariableOptions []*NoCodeVariableOption `jsonapi:"relation,variable-options,omitempty"`
}

RegistryNoCodeModuleCreateOptions is used when creating a registry no-code module

type RegistryNoCodeModuleCreateWorkspaceOptions struct {
	Type string `jsonapi:"primary,no-code-module-workspace"`

	
	
	
	Name string `jsonapi:"attr,name"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"`

	
	
	Project *Project `jsonapi:"relation,project,omitempty"`

	
	
	Variables []*Variable `jsonapi:"relation,vars,omitempty"`

	
	SourceName *string `jsonapi:"attr,source-name,omitempty"`

	
	SourceURL *string `jsonapi:"attr,source-url,omitempty"`

	
	ExecutionMode *string `jsonapi:"attr,execution-mode,omitempty"`

	
	
	
	AgentPoolID *string `jsonapi:"attr,agent-pool-id,omitempty"`
}
type RegistryNoCodeModuleIncludeOpt string

RegistryNoCodeModuleIncludeOpt represents the available options for include query params.

RegistryNoCodeModuleReadOptions is used when reading a registry no-code module

type RegistryNoCodeModuleReadVariablesOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,no-code-modules"`
}

RegistryNoCodeModuleReadVariablesOptions is used when reading the variables for a no-code module.

type RegistryNoCodeModuleUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,no-code-modules"`

	
	RegistryModule *RegistryModule `jsonapi:"relation,registry-module"`

	
	VersionPin string `jsonapi:"attr,version-pin,omitempty"`

	
	Enabled *bool `jsonapi:"attr,enabled,omitempty"`

	
	VariableOptions []*NoCodeVariableOption `jsonapi:"relation,variable-options,omitempty"`
}

RegistryNoCodeModuleUpdateOptions is used when updating a registry no-code module

type RegistryNoCodeModuleUpgradeWorkspaceOptions struct {
	Type string `jsonapi:"primary,no-code-module-workspace"`

	
	
	Variables []*Variable `jsonapi:"relation,vars,omitempty"`
}
type RegistryNoCodeModules interface {

	
	
	Create(ctx context.Context, organization string, options RegistryNoCodeModuleCreateOptions) (*RegistryNoCodeModule, error)

	
	
	Read(ctx context.Context, noCodeModuleID string, options *RegistryNoCodeModuleReadOptions) (*RegistryNoCodeModule, error)

	
	
	ReadVariables(ctx context.Context, noCodeModuleID, noCodeModuleVersion string, options *RegistryNoCodeModuleReadVariablesOptions) (*RegistryModuleVariableList, error)

	
	
	Update(ctx context.Context, noCodeModuleID string, options RegistryNoCodeModuleUpdateOptions) (*RegistryNoCodeModule, error)

	
	
	Delete(ctx context.Context, ID string) error

	
	CreateWorkspace(ctx context.Context, noCodeModuleID string, options *RegistryNoCodeModuleCreateWorkspaceOptions) (*Workspace, error)

	
	UpgradeWorkspace(ctx context.Context, noCodeModuleID string, workspaceID string, options *RegistryNoCodeModuleUpgradeWorkspaceOptions) (*WorkspaceUpgrade, error)
}

RegistryNoCodeModules describes all the registry no-code module related methods that the Terraform Enterprise API supports.

TFE API docs: (TODO: Add link to API docs)

type RegistryProvider struct {
	ID           string                      `jsonapi:"primary,registry-providers"`
	Name         string                      `jsonapi:"attr,name"`
	Namespace    string                      `jsonapi:"attr,namespace"`
	CreatedAt    string                      `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt    string                      `jsonapi:"attr,updated-at,iso8601"`
	RegistryName RegistryName                `jsonapi:"attr,registry-name"`
	Permissions  RegistryProviderPermissions `jsonapi:"attr,permissions"`

	
	Organization             *Organization              `jsonapi:"relation,organization"`
	RegistryProviderVersions []*RegistryProviderVersion `jsonapi:"relation,registry-provider-versions"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

RegistryProvider represents a registry provider

type RegistryProviderCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,registry-providers"`

	
	Name string `jsonapi:"attr,name"`

	
	Namespace string `jsonapi:"attr,namespace"`

	
	RegistryName RegistryName `jsonapi:"attr,registry-name"`
}

RegistryProviderCreateOptions is used when creating a registry provider

RegistryProviderID is the multi key ID for addressing a provider

type RegistryProviderIncludeOps string

RegistryProviderIncludeOps represents which jsonapi include can be used with registry providers

List of available includes

type RegistryProviderPermissions struct {
	CanDelete bool `jsonapi:"attr,can-delete"`
}
type RegistryProviderPlatform struct {
	ID                     string `jsonapi:"primary,registry-provider-platforms"`
	OS                     string `jsonapi:"attr,os"`
	Arch                   string `jsonapi:"attr,arch"`
	Filename               string `jsonapi:"attr,filename"`
	Shasum                 string `jsonapi:"attr,shasum"`
	ProviderBinaryUploaded bool   `jsonapi:"attr,provider-binary-uploaded"`

	
	RegistryProviderVersion *RegistryProviderVersion `jsonapi:"relation,registry-provider-version"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

RegistryProviderPlatform represents a registry provider platform

type RegistryProviderPlatformCreateOptions struct {
	
	OS string `jsonapi:"attr,os"`

	
	Arch string `jsonapi:"attr,arch"`

	
	Shasum string `jsonapi:"attr,shasum"`

	
	Filename string `jsonapi:"attr,filename"`
}

RegistryProviderPlatformCreateOptions represents the set of options for creating a registry provider platform

RegistryProviderPlatformID is the multi key ID for identifying a provider platform

type RegistryProviderPlatformListOptions struct {
	ListOptions
}
type RegistryProviderVersion struct {
	ID                 string                             `jsonapi:"primary,registry-provider-versions"`
	Version            string                             `jsonapi:"attr,version"`
	CreatedAt          string                             `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt          string                             `jsonapi:"attr,updated-at,iso8601"`
	KeyID              string                             `jsonapi:"attr,key-id"`
	Protocols          []string                           `jsonapi:"attr,protocols"`
	Permissions        RegistryProviderVersionPermissions `jsonapi:"attr,permissions"`
	ShasumsUploaded    bool                               `jsonapi:"attr,shasums-uploaded"`
	ShasumsSigUploaded bool                               `jsonapi:"attr,shasums-sig-uploaded"`

	
	RegistryProvider          *RegistryProvider           `jsonapi:"relation,registry-provider"`
	RegistryProviderPlatforms []*RegistryProviderPlatform `jsonapi:"relation,platforms"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

RegistryProviderVersion represents a registry provider version

ShasumsDownloadURL returns the URL to download the shasums for the registry version

ShasumsSigDownloadURL returns the URL to download the shasums sig for the registry version

ShasumsSigUploadURL returns the URL to upload a shasums sig

ShasumsUploadURL returns the upload URL to upload shasums if one is available

type RegistryProviderVersionCreateOptions struct {
	
	Version string `jsonapi:"attr,version"`

	
	KeyID string `jsonapi:"attr,key-id"`

	
	Protocols []string `jsonapi:"attr,protocols"`
}

RegistryProviderVersionID is the multi key ID for addressing a version provider

type RegistryProviderVersionListOptions struct {
	ListOptions
}
type RegistryProviderVersionPermissions struct {
	CanDelete      bool `jsonapi:"attr,can-delete"`
	CanUploadAsset bool `jsonapi:"attr,can-upload-asset"`
}
type RegistryProviders interface {
	
	List(ctx context.Context, organization string, options *RegistryProviderListOptions) (*RegistryProviderList, error)

	
	Create(ctx context.Context, organization string, options RegistryProviderCreateOptions) (*RegistryProvider, error)

	
	Read(ctx context.Context, providerID RegistryProviderID, options *RegistryProviderReadOptions) (*RegistryProvider, error)

	
	Delete(ctx context.Context, providerID RegistryProviderID) error
}

RegistryProviders describes all the registry provider-related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/providers

type RemoteStateConsumersListOptions struct {
	ListOptions
}
type ReservedTagKey struct {
	ID               string    `jsonapi:"primary,reserved-tag-keys"`
	Key              string    `jsonapi:"attr,key"`
	DisableOverrides bool      `jsonapi:"attr,disable-overrides"`
	CreatedAt        time.Time `jsonapi:"attr,created_at,iso8601"`
	UpdatedAt        time.Time `jsonapi:"attr,updated_at,iso8601"`
}

ReservedTagKey represents a Terraform Enterprise reserved tag key.

type ReservedTagKeyCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,reserved-tag-keys"`

	
	Key string `jsonapi:"attr,key"`

	
	
	DisableOverrides *bool `jsonapi:"attr,disable-overrides,omitempty"`
}

ReservedTagKeyCreateOptions represents the options for creating a reserved tag key.

ReservedTagKeyList represents a list of reserved tag keys.

ReservedTagKeyListOptions represents the options for listing reserved tag keys.

type ReservedTagKeyUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,reserved-tag-keys"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	
	DisableOverrides *bool `jsonapi:"attr,disable-overrides,omitempty"`
}

ReservedTagKeyUpdateOptions represents the options for updating a reserved tag key.

type ReservedTagKeys interface {
	
	List(ctx context.Context, organization string, options *ReservedTagKeyListOptions) (*ReservedTagKeyList, error)

	
	Create(ctx context.Context, organization string, options ReservedTagKeyCreateOptions) (*ReservedTagKey, error)

	
	Update(ctx context.Context, reservedTagKeyID string, options ReservedTagKeyUpdateOptions) (*ReservedTagKey, error)

	
	Delete(ctx context.Context, reservedTagKeyID string) error
}

ReservedTagKeys describes all the reserved tag key endpoints that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/reserved-tag-keys

type Resource struct {
	Name string `json:"name"`
	Type string `json:"type"`
}
type Root struct {
	Path                 string               `json:"path"`
	Name                 string               `json:"name"`
	Readme               string               `json:"readme"`
	Empty                bool                 `json:"empty"`
	Inputs               []Input              `json:"inputs"`
	Outputs              []Output             `json:"outputs"`
	ProviderDependencies []ProviderDependency `json:"provider_dependencies"`
	Resources            []Resource           `json:"resources"`
}
type Run struct {
	ID                     string               `jsonapi:"primary,runs"`
	Actions                *RunActions          `jsonapi:"attr,actions"`
	AutoApply              bool                 `jsonapi:"attr,auto-apply,omitempty"`
	AllowConfigGeneration  *bool                `jsonapi:"attr,allow-config-generation,omitempty"`
	AllowEmptyApply        bool                 `jsonapi:"attr,allow-empty-apply"`
	CreatedAt              time.Time            `jsonapi:"attr,created-at,iso8601"`
	ForceCancelAvailableAt time.Time            `jsonapi:"attr,force-cancel-available-at,iso8601"`
	HasChanges             bool                 `jsonapi:"attr,has-changes"`
	IsDestroy              bool                 `jsonapi:"attr,is-destroy"`
	Message                string               `jsonapi:"attr,message"`
	Permissions            *RunPermissions      `jsonapi:"attr,permissions"`
	PolicyPaths            []string             `jsonapi:"attr,policy-paths,omitempty"`
	PositionInQueue        int                  `jsonapi:"attr,position-in-queue"`
	PlanOnly               bool                 `jsonapi:"attr,plan-only"`
	Refresh                bool                 `jsonapi:"attr,refresh"`
	RefreshOnly            bool                 `jsonapi:"attr,refresh-only"`
	ReplaceAddrs           []string             `jsonapi:"attr,replace-addrs,omitempty"`
	SavePlan               bool                 `jsonapi:"attr,save-plan,omitempty"`
	Source                 RunSource            `jsonapi:"attr,source"`
	Status                 RunStatus            `jsonapi:"attr,status"`
	StatusTimestamps       *RunStatusTimestamps `jsonapi:"attr,status-timestamps"`
	TargetAddrs            []string             `jsonapi:"attr,target-addrs,omitempty"`
	TerraformVersion       string               `jsonapi:"attr,terraform-version"`
	Variables              []*RunVariableAttr   `jsonapi:"attr,variables"`

	
	Apply                *Apply                `jsonapi:"relation,apply"`
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`
	CostEstimate         *CostEstimate         `jsonapi:"relation,cost-estimate"`
	CreatedBy            *User                 `jsonapi:"relation,created-by"`
	ConfirmedBy          *User                 `jsonapi:"relation,confirmed-by"`
	Plan                 *Plan                 `jsonapi:"relation,plan"`
	PolicyChecks         []*PolicyCheck        `jsonapi:"relation,policy-checks"`
	TaskStages           []*TaskStage          `jsonapi:"relation,task-stages,omitempty"`
	Workspace            *Workspace            `jsonapi:"relation,workspace"`
}

Run represents a Terraform Enterprise run.

type RunActions struct {
	IsCancelable      bool `jsonapi:"attr,is-cancelable"`
	IsConfirmable     bool `jsonapi:"attr,is-confirmable"`
	IsDiscardable     bool `jsonapi:"attr,is-discardable"`
	IsForceCancelable bool `jsonapi:"attr,is-force-cancelable"`
}

RunActions represents the run actions.

type RunApplyOptions struct {
	Comment *string `json:"comment,omitempty"`
}

RunApplyOptions represents the options for applying a run.

type RunCancelOptions struct {
	Comment *string `json:"comment,omitempty"`
}

RunCancelOptions represents the options for canceling a run.

type RunCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,runs"`

	
	
	
	AllowConfigGeneration *bool `jsonapi:"attr,allow-config-generation,omitempty"`

	
	
	AllowEmptyApply *bool `jsonapi:"attr,allow-empty-apply,omitempty"`

	
	
	TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"`

	
	
	PlanOnly *bool `jsonapi:"attr,plan-only,omitempty"`

	
	
	IsDestroy *bool `jsonapi:"attr,is-destroy,omitempty"`

	
	
	Refresh *bool `jsonapi:"attr,refresh,omitempty"`

	
	
	RefreshOnly *bool `jsonapi:"attr,refresh-only,omitempty"`

	
	
	
	SavePlan *bool `jsonapi:"attr,save-plan,omitempty"`

	
	Message *string `jsonapi:"attr,message,omitempty"`

	
	
	
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`

	
	Workspace *Workspace `jsonapi:"relation,workspace"`

	
	
	
	
	
	
	
	
	
	
	
	TargetAddrs []string `jsonapi:"attr,target-addrs,omitempty"`

	
	
	
	ReplaceAddrs []string `jsonapi:"attr,replace-addrs,omitempty"`

	
	
	
	
	PolicyPaths []string `jsonapi:"attr,policy-paths,omitempty"`

	
	
	AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"`

	
	
	Variables []*RunVariable `jsonapi:"attr,variables,omitempty"`
}

RunCreateOptions represents the options for creating a new run.

type RunDiscardOptions struct {
	Comment *string `json:"comment,omitempty"`
}

RunDiscardOptions represents the options for discarding a run.

type RunEvent struct {
	ID          string    `jsonapi:"primary,run-events"`
	Action      string    `jsonapi:"attr,action"`
	CreatedAt   time.Time `jsonapi:"attr,created-at,iso8601"`
	Description string    `jsonapi:"attr,description"`

	
	Actor   *User    `jsonapi:"relation,actor"`
}

RunEvent represents a Terraform Enterprise run event.

type RunEventIncludeOpt string

RunEventIncludeOpt represents the available options for include query params.

type RunEventList struct {
	
	Items []*RunEvent
}

RunEventList represents a list of run events.

type RunEventListOptions struct {
	
	Include []RunEventIncludeOpt `url:"include,omitempty"`
}

RunEventListOptions represents the options for listing run events.

type RunEventReadOptions struct {
	
	Include []RunEventIncludeOpt `url:"include,omitempty"`
}

RunEventReadOptions represents the options for reading a run event.

type RunForceCancelOptions struct {
	Comment *string `json:"comment,omitempty"`
}

RunForceCancelOptions represents the options for force-canceling a run.

type RunList struct {
	Items []*Run
}

RunList represents a list of runs.

type RunListForOrganizationOptions struct {
	ListOptions

	
	User string `url:"search[user],omitempty"`

	
	Commit string `url:"search[commit],omitempty"`

	
	
	Basic string `url:"search[basic],omitempty"`

	
	
	
	Status string `url:"filter[status],omitempty"`

	
	
	
	Source string `url:"filter[source],omitempty"`

	
	
	
	Operation string `url:"filter[operation],omitempty"`

	
	AgentPoolNames string `url:"filter[agent_pool_names],omitempty"`

	
	StatusGroup string `url:"filter[status_group],omitempty"`

	
	Timeframe string `url:"filter[timeframe],omitempty"`

	
	WorkspaceNames string `url:"filter[workspace_names],omitempty"`

	
	
	Include []RunIncludeOpt `url:"include,omitempty"`
}

RunListForOrganizationOptions represents the options for listing runs for an organization.

type RunListOptions struct {
	ListOptions

	
	User string `url:"search[user],omitempty"`

	
	Commit string `url:"search[commit],omitempty"`

	
	
	Search string `url:"search[basic],omitempty"`

	
	
	
	Status string `url:"filter[status],omitempty"`

	
	
	
	Source string `url:"filter[source],omitempty"`

	
	
	
	Operation string `url:"filter[operation],omitempty"`

	
	
	Include []RunIncludeOpt `url:"include,omitempty"`
}

RunListOptions represents the options for listing runs.

RunOperation represents an operation type of run.

List all available run operations.

type RunPermissions struct {
	CanApply        bool `jsonapi:"attr,can-apply"`
	CanCancel       bool `jsonapi:"attr,can-cancel"`
	CanDiscard      bool `jsonapi:"attr,can-discard"`
	CanForceCancel  bool `jsonapi:"attr,can-force-cancel"`
	CanForceExecute bool `jsonapi:"attr,can-force-execute"`
}

RunPermissions represents the run permissions.

type RunQueue struct {
	Items []*Run
}

RunQueue represents the current run queue of an organization.

type RunReadOptions struct {
	
	
	Include []RunIncludeOpt `url:"include,omitempty"`
}

RunReadOptions represents the options for reading a run.

RunSource represents a source type of a run.

const (
	RunSourceAPI                  RunSource = "tfe-api"
	RunSourceConfigurationVersion RunSource = "tfe-configuration-version"
	RunSourceUI                   RunSource = "tfe-ui"
)

List all available run sources.

RunStatus represents a run state.

List all available run statuses.

type RunStatusTimestamps struct {
	AppliedAt            time.Time `jsonapi:"attr,applied-at,rfc3339"`
	ApplyingAt           time.Time `jsonapi:"attr,applying-at,rfc3339"`
	ApplyQueuedAt        time.Time `jsonapi:"attr,apply-queued-at,rfc3339"`
	CanceledAt           time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ConfirmedAt          time.Time `jsonapi:"attr,confirmed-at,rfc3339"`
	CostEstimatedAt      time.Time `jsonapi:"attr,cost-estimated-at,rfc3339"`
	CostEstimatingAt     time.Time `jsonapi:"attr,cost-estimating-at,rfc3339"`
	DiscardedAt          time.Time `jsonapi:"attr,discarded-at,rfc3339"`
	ErroredAt            time.Time `jsonapi:"attr,errored-at,rfc3339"`
	FetchedAt            time.Time `jsonapi:"attr,fetched-at,rfc3339"`
	FetchingAt           time.Time `jsonapi:"attr,fetching-at,rfc3339"`
	ForceCanceledAt      time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
	PlannedAndFinishedAt time.Time `jsonapi:"attr,planned-and-finished-at,rfc3339"`
	PlannedAndSavedAt    time.Time `jsonapi:"attr,planned-and-saved-at,rfc3339"`
	PlannedAt            time.Time `jsonapi:"attr,planned-at,rfc3339"`
	PlanningAt           time.Time `jsonapi:"attr,planning-at,rfc3339"`
	PlanQueueableAt      time.Time `jsonapi:"attr,plan-queueable-at,rfc3339"`
	PlanQueuedAt         time.Time `jsonapi:"attr,plan-queued-at,rfc3339"`
	PolicyCheckedAt      time.Time `jsonapi:"attr,policy-checked-at,rfc3339"`
	PolicySoftFailedAt   time.Time `jsonapi:"attr,policy-soft-failed-at,rfc3339"`
	PostPlanCompletedAt  time.Time `jsonapi:"attr,post-plan-completed-at,rfc3339"`
	PostPlanRunningAt    time.Time `jsonapi:"attr,post-plan-running-at,rfc3339"`
	PrePlanCompletedAt   time.Time `jsonapi:"attr,pre-plan-completed-at,rfc3339"`
	PrePlanRunningAt     time.Time `jsonapi:"attr,pre-plan-running-at,rfc3339"`
	QueuingAt            time.Time `jsonapi:"attr,queuing-at,rfc3339"`
}

RunStatusTimestamps holds the timestamps for individual run statuses.

type RunTask struct {
	ID          string         `jsonapi:"primary,tasks"`
	Name        string         `jsonapi:"attr,name"`
	URL         string         `jsonapi:"attr,url"`
	Description string         `jsonapi:"attr,description"`
	Category    string         `jsonapi:"attr,category"`
	HMACKey     *string        `jsonapi:"attr,hmac-key,omitempty"`
	Enabled     bool           `jsonapi:"attr,enabled"`
	Global      *GlobalRunTask `jsonapi:"attr,global-configuration,omitempty"`

	AgentPool         *AgentPool          `jsonapi:"relation,agent-pool"`
	Organization      *Organization       `jsonapi:"relation,organization"`
	WorkspaceRunTasks []*WorkspaceRunTask `jsonapi:"relation,workspace-tasks"`
}

RunTask represents a HCP Terraform or Terraform Enterprise run task

type RunTaskCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,tasks"`

	
	Name string `jsonapi:"attr,name"`

	
	URL string `jsonapi:"attr,url"`

	
	Description *string `jsonapi:"attr,description"`

	
	Category string `jsonapi:"attr,category"`

	
	HMACKey *string `jsonapi:"attr,hmac-key,omitempty"`

	
	Enabled *bool `jsonapi:"attr,enabled,omitempty"`

	
	Global *GlobalRunTaskOptions `jsonapi:"attr,global-configuration,omitempty"`

	
	
	AgentPool *AgentPool `jsonapi:"relation,agent-pool,omitempty"`
}

RunTaskCreateOptions represents the set of options for creating a run task

type RunTaskList struct {
	Items []*RunTask
}

RunTaskList represents a list of run tasks

RunTaskListOptions represents the set of options for listing run tasks

type RunTaskReadOptions struct {
	
	
	Include []RunTaskIncludeOpt `url:"include,omitempty"`
}

RunTaskReadOptions represents the set of options for reading a run task

type RunTaskRequest struct {
	AccessToken                     string                      `json:"access_token"`
	Capabilitites                   RunTaskRequestCapabilitites `json:"capabilitites,omitempty"`
	ConfigurationVersionDownloadURL string                      `json:"configuration_version_download_url,omitempty"`
	ConfigurationVersionID          string                      `json:"configuration_version_id,omitempty"`
	IsSpeculative                   bool                        `json:"is_speculative"`
	OrganizationName                string                      `json:"organization_name"`
	PayloadVersion                  int                         `json:"payload_version"`
	PlanJSONAPIURL                  string                      `json:"plan_json_api_url,omitempty"` 
	RunAppURL                       string                      `json:"run_app_url"`
	RunCreatedAt                    time.Time                   `json:"run_created_at"`
	RunCreatedBy                    string                      `json:"run_created_by"`
	RunID                           string                      `json:"run_id"`
	RunMessage                      string                      `json:"run_message"`
	Stage                           string                      `json:"stage"`
	TaskResultCallbackURL           string                      `json:"task_result_callback_url"`
	TaskResultEnforcementLevel      string                      `json:"task_result_enforcement_level"`
	TaskResultID                    string                      `json:"task_result_id"`
	VcsBranch                       string                      `json:"vcs_branch,omitempty"`
	VcsCommitURL                    string                      `json:"vcs_commit_url,omitempty"`
	VcsPullRequestURL               string                      `json:"vcs_pull_request_url,omitempty"`
	VcsRepoURL                      string                      `json:"vcs_repo_url,omitempty"`
	WorkspaceAppURL                 string                      `json:"workspace_app_url"`
	WorkspaceID                     string                      `json:"workspace_id"`
	WorkspaceName                   string                      `json:"workspace_name"`
	WorkspaceWorkingDirectory       string                      `json:"workspace_working_directory,omitempty"`
}

RunTaskRequest is the payload object that TFC/E sends to the Run Task's URL. https://developer.hashicorp.com/terraform/enterprise/api-docs/run-tasks/run-tasks-integration#common-properties

type RunTaskRequestCapabilitites struct {
	Outcomes bool `json:"outcomes"`
}

RunTaskRequestCapabilitites defines the capabilities that the caller supports.

type RunTaskUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,tasks"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	URL *string `jsonapi:"attr,url,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Category *string `jsonapi:"attr,category,omitempty"`

	
	HMACKey *string `jsonapi:"attr,hmac-key,omitempty"`

	
	Enabled *bool `jsonapi:"attr,enabled,omitempty"`

	
	Global *GlobalRunTaskOptions `jsonapi:"attr,global-configuration,omitempty"`

	
	
	AgentPool *AgentPool `jsonapi:"relation,agent-pool,omitempty"`
}

RunTaskUpdateOptions represents the set of options for updating an organization's run task

type RunTasks interface {
	
	Create(ctx context.Context, organization string, options RunTaskCreateOptions) (*RunTask, error)

	
	List(ctx context.Context, organization string, options *RunTaskListOptions) (*RunTaskList, error)

	
	Read(ctx context.Context, runTaskID string) (*RunTask, error)

	
	ReadWithOptions(ctx context.Context, runTaskID string, options *RunTaskReadOptions) (*RunTask, error)

	
	Update(ctx context.Context, runTaskID string, options RunTaskUpdateOptions) (*RunTask, error)

	
	Delete(ctx context.Context, runTaskID string) error

	
	AttachToWorkspace(ctx context.Context, workspaceID string, runTaskID string, enforcementLevel TaskEnforcementLevel) (*WorkspaceRunTask, error)
}

RunTasks represents all the run task related methods in the context of an organization that the HCP Terraform and Terraform Enterprise API supports. https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run-tasks/run-tasks#run-tasks-api

type RunTrigger struct {
	ID             string    `jsonapi:"primary,run-triggers"`
	CreatedAt      time.Time `jsonapi:"attr,created-at,iso8601"`
	SourceableName string    `jsonapi:"attr,sourceable-name"`
	WorkspaceName  string    `jsonapi:"attr,workspace-name"`
	
	Sourceable       *Workspace        `jsonapi:"relation,sourceable"`
	SourceableChoice *SourceableChoice `jsonapi:"polyrelation,sourceable"`
	Workspace        *Workspace        `jsonapi:"relation,workspace"`
}

RunTrigger represents a run trigger.

type RunTriggerCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,run-triggers"`

	
	Sourceable *Workspace `jsonapi:"relation,sourceable"`
}

RunTriggerCreateOptions represents the options for creating a new run trigger.

type RunTriggerList struct {
	Items []*RunTrigger
}

RunTriggerList represents a list of Run Triggers

RunTriggerListOptions represents the options for listing run triggers.

type RunVariableAttr struct {
	Key   string `jsonapi:"attr,key"`
	Value string `jsonapi:"attr,value"`
}
type Runs interface {
	
	List(ctx context.Context, workspaceID string, options *RunListOptions) (*RunList, error)

	
	ListForOrganization(ctx context.Context, organization string, options *RunListForOrganizationOptions) (*OrganizationRunList, error)

	
	Create(ctx context.Context, options RunCreateOptions) (*Run, error)

	
	Read(ctx context.Context, runID string) (*Run, error)

	
	ReadWithOptions(ctx context.Context, runID string, options *RunReadOptions) (*Run, error)

	
	Apply(ctx context.Context, runID string, options RunApplyOptions) error

	
	Cancel(ctx context.Context, runID string, options RunCancelOptions) error

	
	ForceCancel(ctx context.Context, runID string, options RunForceCancelOptions) error

	
	ForceExecute(ctx context.Context, runID string) error

	
	Discard(ctx context.Context, runID string, options RunDiscardOptions) error
}

Runs describes all the run related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/run

type RunsPermissionType string

RunsPermissionType represents the permissiontype to a workspace's runs.

RunsPermission returns a pointer to the given team runs permission type.

const (
	SDRDeploymentGroup SDRIncludeOpt = "stack-deployment-group"
)

SMTPAuthType represents valid SMTP Auth types.

List of all SMTP auth types.

SMTPAuthValue returns a pointer to a given smtp auth type.

type SSHKey struct {
	ID   string `jsonapi:"primary,ssh-keys"`
	Name string `jsonapi:"attr,name"`
}

SSHKey represents a SSH key.

type SSHKeyCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,ssh-keys"`

	
	Name *string `jsonapi:"attr,name"`

	
	Value *string `jsonapi:"attr,value"`
}

SSHKeyCreateOptions represents the options for creating an SSH key.

type SSHKeyList struct {
	Items []*SSHKey
}

SSHKeyList represents a list of SSH keys.

SSHKeyListOptions represents the options for listing SSH keys.

type SSHKeyUpdateOptions struct {
	
	ID string `jsonapi:"primary,ssh-keys"`

	
	Name *string `jsonapi:"attr,name,omitempty"`
}

SSHKeyUpdateOptions represents the options for updating an SSH key.

type SSHKeys interface {
	
	List(ctx context.Context, organization string, options *SSHKeyListOptions) (*SSHKeyList, error)

	
	Create(ctx context.Context, organization string, options SSHKeyCreateOptions) (*SSHKey, error)

	
	Read(ctx context.Context, sshKeyID string) (*SSHKey, error)

	
	Update(ctx context.Context, sshKeyID string, options SSHKeyUpdateOptions) (*SSHKey, error)

	
	Delete(ctx context.Context, sshKeyID string) error
}

SSHKeys describes all the SSH key related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/ssh-keys

type SentinelMocksPermissionType string

SentinelMocksPermissionType represents the permissiontype to a workspace's Sentinel mocks.

SentinelMocksPermission returns a pointer to the given team Sentinel mocks permission type.

type ServiceProviderType string

ServiceProviderType represents a VCS type.

List of available VCS types.

ServiceProvider returns a pointer to the given service provider type.

type SourceableChoice struct {
	Workspace *Workspace
}

SourceableChoice is a choice type struct that represents the possible values within a polymorphic relation. If a value is available, exactly one field will be non-nil.

type Stack struct {
	ID                 string        `jsonapi:"primary,stacks"`
	Name               string        `jsonapi:"attr,name"`
	Description        string        `jsonapi:"attr,description"`
	DeploymentNames    []string      `jsonapi:"attr,deployment-names"`
	VCSRepo            *StackVCSRepo `jsonapi:"attr,vcs-repo"`
	ErrorsCount        int           `jsonapi:"attr,errors-count"`
	WarningsCount      int           `jsonapi:"attr,warnings-count"`
	SpeculativeEnabled bool          `jsonapi:"attr,speculative-enabled"`
	CreatedAt          time.Time     `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt          time.Time     `jsonapi:"attr,updated-at,iso8601"`

	
	Project                  *Project            `jsonapi:"relation,project"`
	LatestStackConfiguration *StackConfiguration `jsonapi:"relation,latest-stack-configuration"`
}

Stack represents a stack.

type StackComponent struct {
	Name       string `json:"name"`
	Correlator string `json:"correlator"`
	Expanded   bool   `json:"expanded"`
}

StackComponent represents a stack component, specified by configuration

type StackConfiguration struct {
	
	ID                   string                              `jsonapi:"primary,stack-configurations"`
	Status               string                              `jsonapi:"attr,status"`
	StatusTimestamps     *StackConfigurationStatusTimestamps `jsonapi:"attr,status-timestamps"`
	SequenceNumber       int                                 `jsonapi:"attr,sequence-number"`
	DeploymentNames      []string                            `jsonapi:"attr,deployment-names"`
	ConvergedDeployments []string                            `jsonapi:"attr,converged-deployments"`
	Components           []*StackComponent                   `jsonapi:"attr,components"`
	ErrorMessage         *string                             `jsonapi:"attr,error-message"`
	EventStreamURL       string                              `jsonapi:"attr,event-stream-url"`
	Diagnostics          []*StackDiagnostic                  `jsonapi:"attr,diags"`
	CreatedAt            time.Time                           `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt            time.Time                           `jsonapi:"attr,updated-at,iso8601"`

	Stack *Stack `jsonapi:"relation,stack"`
}

StackConfiguration represents a stack configuration snapshot

StackConfigurationList represents a paginated list of stack configurations.

type StackConfigurationListOptions struct {
	ListOptions
}

StackConfigurationListOptions represents the options for listing stack configurations.

type StackConfigurationStatus string
type StackConfigurationStatusTimestamps struct {
	QueuedAt     *time.Time `jsonapi:"attr,queued-at,omitempty,rfc3339"`
	CompletedAt  *time.Time `jsonapi:"attr,completed-at,omitempty,rfc3339"`
	PreparingAt  *time.Time `jsonapi:"attr,preparing-at,omitempty,rfc3339"`
	EnqueueingAt *time.Time `jsonapi:"attr,enqueueing-at,omitempty,rfc3339"`
	CanceledAt   *time.Time `jsonapi:"attr,canceled-at,omitempty,rfc3339"`
	ErroredAt    *time.Time `jsonapi:"attr,errored-at,omitempty,rfc3339"`
}

StackConfigurationStatusTimestamps represents the timestamps for a stack configuration

type StackConfigurations interface {
	
	
	CreateAndUpload(ctx context.Context, stackID string, path string, opts *CreateStackConfigurationOptions) (*StackConfiguration, error)

	
	Read(ctx context.Context, id string) (*StackConfiguration, error)

	
	List(ctx context.Context, stackID string, options *StackConfigurationListOptions) (*StackConfigurationList, error)

	
	JSONSchemas(ctx context.Context, stackConfigurationID string) ([]byte, error)

	
	
	
	AwaitCompleted(ctx context.Context, stackConfigurationID string) <-chan WaitForStatusResult

	
	
	
	AwaitStatus(ctx context.Context, stackConfigurationID string, status StackConfigurationStatus) <-chan WaitForStatusResult
}

StackConfigurations describes all the stacks configurations-related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackCreateOptions struct {
	Type        string               `jsonapi:"primary,stacks"`
	Name        string               `jsonapi:"attr,name"`
	Description *string              `jsonapi:"attr,description,omitempty"`
	VCSRepo     *StackVCSRepoOptions `jsonapi:"attr,vcs-repo"`
	Project     *Project             `jsonapi:"relation,project"`
}

StackCreateOptions represents the options for creating a stack. The project relation is required.

type StackDeployment struct {
	
	ID            string    `jsonapi:"primary,stack-deployments"`
	Name          string    `jsonapi:"attr,name"`
	Status        string    `jsonapi:"attr,status"`
	DeployedAt    time.Time `jsonapi:"attr,deployed-at,iso8601"`
	ErrorsCount   int       `jsonapi:"attr,errors-count"`
	WarningsCount int       `jsonapi:"attr,warnings-count"`
	PausedCount   int       `jsonapi:"attr,paused-count"`

	
	CurrentStackState *StackState `jsonapi:"relation,current-stack-state"`
}

StackDeployment represents a stack deployment, specified by configuration

type StackDeploymentGroup struct {
	
	ID        string    `jsonapi:"primary,stack-deployment-groups"`
	Name      string    `jsonapi:"attr,name"`
	Status    string    `jsonapi:"attr,status"`
	CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt time.Time `jsonapi:"attr,updated-at,iso8601"`

	
	StackConfiguration *StackConfiguration `jsonapi:"relation,stack-configuration"`
}

StackDeploymentGroup represents a stack deployment group.

StackDeploymentGroupList represents a list of stack deployment groups.

type StackDeploymentGroupListOptions struct {
	ListOptions
}

StackDeploymentGroupListOptions represents additional options when listing stack deployment groups.

type StackDeploymentGroupRerunOptions struct {
	
	Deployments []string
}

StackDeploymentGroupRerunOptions represents options for rerunning deployments in a stack deployment group.

type StackDeploymentGroups interface {
	
	List(ctx context.Context, stackConfigID string, options *StackDeploymentGroupListOptions) (*StackDeploymentGroupList, error)

	
	Read(ctx context.Context, stackDeploymentGroupID string) (*StackDeploymentGroup, error)

	
	ReadByName(ctx context.Context, stackConfigurationID, stackDeploymentName string) (*StackDeploymentGroup, error)

	
	ApproveAllPlans(ctx context.Context, stackDeploymentGroupID string) error

	
	Rerun(ctx context.Context, stackDeploymentGroupID string, options *StackDeploymentGroupRerunOptions) error
}

StackDeploymentGroups describes all the stack-deployment-groups related methods that the HCP Terraform API supports.

type StackDeploymentRun struct {
	ID          string    `jsonapi:"primary,stack-deployment-runs"`
	Status      string    `jsonapi:"attr,status"`
	StartedAt   time.Time `jsonapi:"attr,started-at,iso8601"`
	CompletedAt time.Time `jsonapi:"attr,completed-at,iso8601"`

	
	StackDeploymentGroup *StackDeploymentGroup `jsonapi:"relation,stack-deployment-group"`
}

StackDeploymentRun represents a stack deployment run.

StackDeploymentRunList represents a list of stack deployment runs.

StackDeploymentRunListOptions represents the options for listing stack deployment runs.

type StackDeploymentRunReadOptions struct {
	
	Include []SDRIncludeOpt `url:"include,omitempty"`
}
type StackDeploymentRuns interface {
	
	List(ctx context.Context, deploymentGroupID string, options *StackDeploymentRunListOptions) (*StackDeploymentRunList, error)
	Read(ctx context.Context, stackDeploymentRunID string) (*StackDeploymentRun, error)
	ReadWithOptions(ctx context.Context, stackDeploymentRunID string, options *StackDeploymentRunReadOptions) (*StackDeploymentRun, error)
	ApproveAllPlans(ctx context.Context, deploymentRunID string) error
	Cancel(ctx context.Context, stackDeploymentRunID string) error
}

StackDeploymentRuns describes all the stack deployment runs-related methods that the HCP Terraform API supports.

type StackDeploymentStep struct {
	
	ID        string    `jsonapi:"primary,stack-deployment-steps"`
	Status    string    `jsonapi:"attr,status"`
	CreatedAt time.Time `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt time.Time `jsonapi:"attr,created-at,iso8601"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`

	
	StackDeploymentRun *StackDeploymentRun `jsonapi:"relation,stack-deployment-run"`
}

StackDeploymentStep represents a step from a stack deployment

StackDeploymentStepList represents a list of stack deployment steps

StackDeploymentSteps describes all the stacks deployment step-related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackDeploymentStepsListOptions struct {
	ListOptions
}

StackDeploymentStepsListOptions represents the options for listing stack deployment steps.

StackDeployments describes all the stacks deployments-related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackDiagnostic struct {
	Severity string           `jsonapi:"attr,severity"`
	Summary  string           `jsonapi:"attr,summary"`
	Detail   string           `jsonapi:"attr,detail"`
	Range    *DiagnosticRange `jsonapi:"attr,range"`
}

StackDiagnostic represents any sourcebundle.Diagnostic value. The simplest form has just a severity, single line summary, and optional detail. If there is more information about the source of the diagnostic, this is represented in the range field.

StackIncludeOpt represents the include options for a stack.

type StackList struct {
	Items []*Stack
}

StackList represents a list of stacks.

StackListOptions represents the options for listing stacks.

type StackPlan struct {
	ID               string                     `jsonapi:"primary,stack-plans"`
	PlanMode         string                     `jsonapi:"attr,plan-mode"`
	PlanNumber       string                     `jsonapi:"attr,plan-number"`
	Status           StackPlanStatus            `jsonapi:"attr,status"`
	StatusTimestamps *StackPlanStatusTimestamps `jsonapi:"attr,status-timestamps"`
	IsPlanned        bool                       `jsonapi:"attr,is-planned"`
	Changes          *PlanChanges               `jsonapi:"attr,changes"`
	Deployment       string                     `jsonapi:"attr,deployment"`

	
	StackConfiguration  *StackConfiguration   `jsonapi:"relation,stack-configuration"`
	Stack               *Stack                `jsonapi:"relation,stack"`
	StackPlanOperations []*StackPlanOperation `jsonapi:"relation,stack-plan-operations"`
}

StackPlan represents a plan for a stack.

type StackPlanList struct {
	Items []*StackPlan
}
type StackPlanOperation struct {
	ID             string             `jsonapi:"primary,stack-plan-operations"`
	Type           string             `jsonapi:"attr,operation-type"`
	Status         string             `jsonapi:"attr,status"`
	EventStreamURL string             `jsonapi:"attr,event-stream-url"`
	Diagnostics    []*StackDiagnostic `jsonapi:"attr,diags"`

	
	StackPlan *StackPlan `jsonapi:"relation,stack-plan"`
}

NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackPlanStatusTimestamps struct {
	CreatedAt  time.Time `jsonapi:"attr,created-at,rfc3339"`
	RunningAt  time.Time `jsonapi:"attr,running-at,rfc3339"`
	PausedAt   time.Time `jsonapi:"attr,paused-at,rfc3339"`
	FinishedAt time.Time `jsonapi:"attr,finished-at,rfc3339"`
}

StackPlanStatusTimestamps are the timestamps of the status changes for a stack

type StackPlans interface {
	
	Read(ctx context.Context, stackPlanID string) (*StackPlan, error)

	
	ListByConfiguration(ctx context.Context, stackConfigurationID string, options *StackPlansListOptions) (*StackPlanList, error)

	
	Approve(ctx context.Context, stackPlanID string) error

	
	Cancel(ctx context.Context, stackPlanID string) error

	
	Discard(ctx context.Context, stackPlanID string) error

	
	PlanDescription(ctx context.Context, stackPlanID string) (*JSONChangeDesc, error)

	
	
	AwaitTerminal(ctx context.Context, stackPlanID string) <-chan WaitForStatusResult

	
	
	AwaitRunning(ctx context.Context, stackPlanID string) <-chan WaitForStatusResult
}

StackPlans describes all the stacks plans-related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackPlansIncludeOpt string
type StackPlansStatusFilter string
type StackReadOptions struct {
	Include []StackIncludeOpt `url:"include,omitempty"`
}
type StackSortColumn ¶ added in v1.58.0

StackSortColumn represents a string that can be used to sort items when using the List method.

type StackSource struct {
	ID                 string              `jsonapi:"primary,stack-sources"`
	UploadURL          *string             `jsonapi:"attr,upload-url"`
	StackConfiguration *StackConfiguration `jsonapi:"relation,stack-configuration"`
	Stack              *Stack              `jsonapi:"relation,stack"`
}

StackSource represents a source of Terraform Stacks configuration files.

StackSources describes all the stack-sources related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

type StackState struct {
	
	ID string `jsonapi:"primary,stack-states"`
}

StackState represents a stack state

type StackUpdateOptions struct {
	Name        *string              `jsonapi:"attr,name,omitempty"`
	Description *string              `jsonapi:"attr,description,omitempty"`
	VCSRepo     *StackVCSRepoOptions `jsonapi:"attr,vcs-repo"`
}

StackUpdateOptions represents the options for updating a stack.

type StackVCSRepo struct {
	Identifier        string `jsonapi:"attr,identifier"`
	Branch            string `jsonapi:"attr,branch,omitempty"`
	GHAInstallationID string `jsonapi:"attr,github-app-installation-id,omitempty"`
	OAuthTokenID      string `jsonapi:"attr,oauth-token-id,omitempty"`
}

StackVCSRepo represents the version control system repository for a stack.

type StackVCSRepoOptions struct {
	Identifier        string `json:"identifier"`
	Branch            string `json:"branch,omitempty"`
	GHAInstallationID string `json:"github-app-installation-id,omitempty"`
	OAuthTokenID      string `json:"oauth-token-id,omitempty"`
}

StackVCSRepoOptions

type Stacks interface {
	
	List(ctx context.Context, organization string, options *StackListOptions) (*StackList, error)

	
	Read(ctx context.Context, stackID string, options *StackReadOptions) (*Stack, error)

	
	Create(ctx context.Context, options StackCreateOptions) (*Stack, error)

	
	Update(ctx context.Context, stackID string, options StackUpdateOptions) (*Stack, error)

	
	Delete(ctx context.Context, stackID string) error

	
	ForceDelete(ctx context.Context, stackID string) error

	
	UpdateConfiguration(ctx context.Context, stackID string) (*Stack, error)
}

Stacks describes all the stacks-related methods that the HCP Terraform API supports. NOTE WELL: This is a beta feature and is subject to change until noted otherwise in the release notes.

Stage is an enum that represents the possible run stages for run tasks

const (
	PrePlan   Stage = "pre_plan"
	PostPlan  Stage = "post_plan"
	PreApply  Stage = "pre_apply"
	PostApply Stage = "post_apply"
)
type StateVersion struct {
	ID               string             `jsonapi:"primary,state-versions"`
	CreatedAt        time.Time          `jsonapi:"attr,created-at,iso8601"`
	DownloadURL      string             `jsonapi:"attr,hosted-state-download-url"`
	UploadURL        string             `jsonapi:"attr,hosted-state-upload-url"`
	Status           StateVersionStatus `jsonapi:"attr,status"`
	JSONUploadURL    string             `jsonapi:"attr,hosted-json-state-upload-url"`
	JSONDownloadURL  string             `jsonapi:"attr,hosted-json-state-download-url"`
	Serial           int64              `jsonapi:"attr,serial"`
	VCSCommitSHA     string             `jsonapi:"attr,vcs-commit-sha"`
	VCSCommitURL     string             `jsonapi:"attr,vcs-commit-url"`
	BillableRUMCount *uint32            `jsonapi:"attr,billable-rum-count"`
	
	
	
	ResourcesProcessed bool `jsonapi:"attr,resources-processed"`
	StateVersion       int  `jsonapi:"attr,state-version"`
	
	TerraformVersion string `jsonapi:"attr,terraform-version"`
	
	Modules *StateVersionModules `jsonapi:"attr,modules"`
	
	Providers *StateVersionProviders `jsonapi:"attr,providers"`
	
	Resources []*StateVersionResources `jsonapi:"attr,resources"`

	
	Run     *Run                  `jsonapi:"relation,run"`
	Outputs []*StateVersionOutput `jsonapi:"relation,outputs"`
}

StateVersion represents a Terraform Enterprise state version.

type StateVersionCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,state-versions"`

	
	Lineage *string `jsonapi:"attr,lineage,omitempty"`

	
	MD5 *string `jsonapi:"attr,md5"`

	
	Serial *int64 `jsonapi:"attr,serial"`

	
	State *string `jsonapi:"attr,state,omitempty"`

	
	
	Force *bool `jsonapi:"attr,force,omitempty"`

	
	Run *Run `jsonapi:"relation,run,omitempty"`

	
	
	
	
	JSONState *string `jsonapi:"attr,json-state,omitempty"`
	
	
	
	
	JSONStateOutputs *string `jsonapi:"attr,json-state-outputs,omitempty"`
}

StateVersionCreateOptions represents the options for creating a state version.

StateVersionCurrentOptions represents the options for reading the current state version.

StateVersionList represents a list of state versions.

type StateVersionListOptions struct {
	ListOptions
	Organization string `url:"filter[organization][name]"`
	Workspace    string `url:"filter[workspace][name]"`
}

StateVersionListOptions represents the options for listing state versions.

type StateVersionModuleRoot struct {
	NullResource         int `jsonapi:"attr,null-resource"`
	TerraformRemoteState int `jsonapi:"attr,data.terraform-remote-state"`
}
type StateVersionOutput struct {
	ID        string      `jsonapi:"primary,state-version-outputs"`
	Name      string      `jsonapi:"attr,name"`
	Sensitive bool        `jsonapi:"attr,sensitive"`
	Type      string      `jsonapi:"attr,type"`
	Value     interface{} `jsonapi:"attr,value"`
	
	DetailedType interface{} `jsonapi:"attr,detailed-type"`
}

StateVersionOutput represents a State Version Outputs

StateVersionOutputsList represents a list of StateVersionOutput items.

type StateVersionOutputsListOptions struct {
	ListOptions
}

StateVersionOutputsListOptions represents the options for listing state version outputs.

type StateVersionProviders struct {
	Data ProviderData `jsonapi:"attr,provider[map]string"`
}

StateVersionReadOptions represents the options for reading state version.

type StateVersionResources struct {
	Name     string `jsonapi:"attr,name"`
	Count    int    `jsonapi:"attr,count"`
	Type     string `jsonapi:"attr,type"`
	Module   string `jsonapi:"attr,module"`
	Provider string `jsonapi:"attr,provider"`
}
type StateVersionStatus string

StateVersionStatus are available state version status values

Available state version statuses.

type StateVersions interface {
	
	List(ctx context.Context, options *StateVersionListOptions) (*StateVersionList, error)

	
	Create(ctx context.Context, workspaceID string, options StateVersionCreateOptions) (*StateVersion, error)

	
	
	Upload(ctx context.Context, workspaceID string, options StateVersionUploadOptions) (*StateVersion, error)

	
	Read(ctx context.Context, svID string) (*StateVersion, error)

	
	ReadWithOptions(ctx context.Context, svID string, options *StateVersionReadOptions) (*StateVersion, error)

	
	ReadCurrent(ctx context.Context, workspaceID string) (*StateVersion, error)

	
	ReadCurrentWithOptions(ctx context.Context, workspaceID string, options *StateVersionCurrentOptions) (*StateVersion, error)

	
	Download(ctx context.Context, url string) ([]byte, error)

	
	
	
	ListOutputs(ctx context.Context, svID string, options *StateVersionOutputsListOptions) (*StateVersionOutputsList, error)

	
	
	SoftDeleteBackingData(ctx context.Context, svID string) error

	
	
	RestoreBackingData(ctx context.Context, svID string) error

	
	
	PermanentlyDeleteBackingData(ctx context.Context, svID string) error
}

StateVersions describes all the state version related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/state-versions

type StateVersionsPermissionType string

StateVersionsPermissionType represents the permissiontype to a workspace's state versions.

StateVersionsPermission returns a pointer to the given team state versions permission type.

type Tag struct {
	ID   string `jsonapi:"primary,tags"`
	Name string `jsonapi:"attr,name,omitempty"`
}

Tag is owned by an organization and applied to workspaces. Used for grouping and search.

type TagBinding struct {
	ID    string `jsonapi:"primary,tag-bindings"`
	Key   string `jsonapi:"attr,key"`
	Value string `jsonapi:"attr,value,omitempty"`
}
type TagList struct {
	Items []*Tag
}
type TaskEnforcementLevel string

TaskEnforcementLevel is an enum that describes the enforcement levels for a run task

type TaskResult struct {
	ID                            string                     `jsonapi:"primary,task-results"`
	Status                        TaskResultStatus           `jsonapi:"attr,status"`
	Message                       string                     `jsonapi:"attr,message"`
	StatusTimestamps              TaskResultStatusTimestamps `jsonapi:"attr,status-timestamps"`
	URL                           string                     `jsonapi:"attr,url"`
	CreatedAt                     time.Time                  `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt                     time.Time                  `jsonapi:"attr,updated-at,iso8601"`
	TaskID                        string                     `jsonapi:"attr,task-id"`
	TaskName                      string                     `jsonapi:"attr,task-name"`
	TaskURL                       string                     `jsonapi:"attr,task-url"`
	WorkspaceTaskID               string                     `jsonapi:"attr,workspace-task-id"`
	WorkspaceTaskEnforcementLevel TaskEnforcementLevel       `jsonapi:"attr,workspace-task-enforcement-level"`
	AgentPoolID                   *string                    `jsonapi:"attr,agent-pool-id,omitempty"`

	
	TaskStage *TaskStage `jsonapi:"relation,task_stage"`
}

TaskResult represents the result of a HCP Terraform or Terraform Enterprise run task

type TaskResultOutcome struct {
	Type        string                      `jsonapi:"primary,task-result-outcomes"`
	OutcomeID   string                      `jsonapi:"attr,outcome-id,omitempty"`
	Description string                      `jsonapi:"attr,description,omitempty"`
	Body        string                      `jsonapi:"attr,body,omitempty"`
	URL         string                      `jsonapi:"attr,url,omitempty"`
	Tags        map[string][]*TaskResultTag `jsonapi:"attr,tags,omitempty"`
}

TaskResultOutcome represents a detailed TFC/E run task outcome, which improves result visibility and content in the TFC/E UI. https://developer.hashicorp.com/terraform/enterprise/api-docs/run-tasks/run-tasks-integration#outcomes-payload-body

TaskResultStatus is an enum that represents all possible statuses for a task result

type TaskResultStatusTimestamps struct {
	ErroredAt  time.Time `jsonapi:"attr,errored-at,rfc3339"`
	RunningAt  time.Time `jsonapi:"attr,running-at,rfc3339"`
	CanceledAt time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	FailedAt   time.Time `jsonapi:"attr,failed-at,rfc3339"`
	PassedAt   time.Time `jsonapi:"attr,passed-at,rfc3339"`
}

TaskResultStatusTimestamps represents the set of timestamps recorded for a task result

TaskResults describes all the task result related methods that the HCP Terraform or Terraform Enterprise API supports.

type TaskStage struct {
	ID               string                    `jsonapi:"primary,task-stages"`
	Stage            Stage                     `jsonapi:"attr,stage"`
	Status           TaskStageStatus           `jsonapi:"attr,status"`
	StatusTimestamps TaskStageStatusTimestamps `jsonapi:"attr,status-timestamps"`
	CreatedAt        time.Time                 `jsonapi:"attr,created-at,iso8601"`
	UpdatedAt        time.Time                 `jsonapi:"attr,updated-at,iso8601"`
	Permissions      *Permissions              `jsonapi:"attr,permissions"`
	Actions          *Actions                  `jsonapi:"attr,actions"`

	Run               *Run                `jsonapi:"relation,run"`
	TaskResults       []*TaskResult       `jsonapi:"relation,task-results"`
	PolicyEvaluations []*PolicyEvaluation `jsonapi:"relation,policy-evaluations"`
}

TaskStage represents a HCP Terraform or Terraform Enterprise run's stage where run tasks can occur

type TaskStageIncludeOpt string

TaskStageIncludeOpt represents the available options for include query params.

**Note: This field is still in BETA and subject to change.**

type TaskStageList struct {
	Items []*TaskStage
}

TaskStageList represents a list of task stages

TaskStageListOptions represents the options for listing task stages for a run

type TaskStageOverrideOptions struct {
	Comment *string `json:"comment,omitempty"`
}

TaskStageOverrideOptions represents the options for overriding a TaskStage.

TaskStageReadOptions represents the set of options when reading a task stage

TaskStageStatus is an enum that represents all possible statuses for a task stage

type TaskStageStatusTimestamps struct {
	ErroredAt  time.Time `jsonapi:"attr,errored-at,rfc3339"`
	RunningAt  time.Time `jsonapi:"attr,running-at,rfc3339"`
	CanceledAt time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	FailedAt   time.Time `jsonapi:"attr,failed-at,rfc3339"`
	PassedAt   time.Time `jsonapi:"attr,passed-at,rfc3339"`
}

TaskStageStatusTimestamps represents the set of timestamps recorded for a task stage

TaskStages describes all the task stage related methods that the HCP Terraform and Terraform Enterprise API supports.

type Team struct {
	ID                 string              `jsonapi:"primary,teams"`
	IsUnified          bool                `jsonapi:"attr,is-unified"`
	Name               string              `jsonapi:"attr,name"`
	OrganizationAccess *OrganizationAccess `jsonapi:"attr,organization-access"`
	Visibility         string              `jsonapi:"attr,visibility"`
	Permissions        *TeamPermissions    `jsonapi:"attr,permissions"`
	UserCount          int                 `jsonapi:"attr,users-count"`
	SSOTeamID          string              `jsonapi:"attr,sso-team-id"`
	
	AllowMemberTokenManagement bool `jsonapi:"attr,allow-member-token-management"`

	
	Users                   []*User                   `jsonapi:"relation,users"`
	OrganizationMemberships []*OrganizationMembership `jsonapi:"relation,organization-memberships"`
}

Team represents a Terraform Enterprise team.

type TeamAccess struct {
	ID               string                      `jsonapi:"primary,team-workspaces"`
	Access           AccessType                  `jsonapi:"attr,access"`
	Runs             RunsPermissionType          `jsonapi:"attr,runs"`
	Variables        VariablesPermissionType     `jsonapi:"attr,variables"`
	StateVersions    StateVersionsPermissionType `jsonapi:"attr,state-versions"`
	SentinelMocks    SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks"`
	WorkspaceLocking bool                        `jsonapi:"attr,workspace-locking"`
	RunTasks         bool                        `jsonapi:"attr,run-tasks"`

	
	Team      *Team      `jsonapi:"relation,team"`
	Workspace *Workspace `jsonapi:"relation,workspace"`
}

TeamAccess represents the workspace access for a team.

type TeamAccessAddOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,team-workspaces"`

	
	Access *AccessType `jsonapi:"attr,access"`

	
	
	Runs             *RunsPermissionType          `jsonapi:"attr,runs,omitempty"`
	Variables        *VariablesPermissionType     `jsonapi:"attr,variables,omitempty"`
	StateVersions    *StateVersionsPermissionType `jsonapi:"attr,state-versions,omitempty"`
	SentinelMocks    *SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks,omitempty"`
	WorkspaceLocking *bool                        `jsonapi:"attr,workspace-locking,omitempty"`
	RunTasks         *bool                        `jsonapi:"attr,run-tasks,omitempty"`

	
	Team *Team `jsonapi:"relation,team"`

	
	Workspace *Workspace `jsonapi:"relation,workspace"`
}

TeamAccessAddOptions represents the options for adding team access.

type TeamAccessList struct {
	Items []*TeamAccess
}

TeamAccessList represents a list of team accesses.

type TeamAccessListOptions struct {
	ListOptions
	WorkspaceID string `url:"filter[workspace][id]"`
}

TeamAccessListOptions represents the options for listing team accesses.

type TeamAccessUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,team-workspaces"`

	
	Access *AccessType `jsonapi:"attr,access,omitempty"`

	
	
	Runs             *RunsPermissionType          `jsonapi:"attr,runs,omitempty"`
	Variables        *VariablesPermissionType     `jsonapi:"attr,variables,omitempty"`
	StateVersions    *StateVersionsPermissionType `jsonapi:"attr,state-versions,omitempty"`
	SentinelMocks    *SentinelMocksPermissionType `jsonapi:"attr,sentinel-mocks,omitempty"`
	WorkspaceLocking *bool                        `jsonapi:"attr,workspace-locking,omitempty"`
	RunTasks         *bool                        `jsonapi:"attr,run-tasks,omitempty"`
}

TeamAccessUpdateOptions represents the options for updating team access.

type TeamAccesses interface {
	
	List(ctx context.Context, options *TeamAccessListOptions) (*TeamAccessList, error)

	
	Add(ctx context.Context, options TeamAccessAddOptions) (*TeamAccess, error)

	
	Read(ctx context.Context, teamAccessID string) (*TeamAccess, error)

	
	Update(ctx context.Context, teamAccessID string, options TeamAccessUpdateOptions) (*TeamAccess, error)

	
	Remove(ctx context.Context, teamAccessID string) error
}

TeamAccesses describes all the team access related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/team-access

type TeamCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,teams"`

	
	Name *string `jsonapi:"attr,name"`

	
	SSOTeamID *string `jsonapi:"attr,sso-team-id,omitempty"`

	
	OrganizationAccess *OrganizationAccessOptions `jsonapi:"attr,organization-access,omitempty"`

	
	Visibility *string `jsonapi:"attr,visibility,omitempty"`

	
	AllowMemberTokenManagement *bool `jsonapi:"attr,allow-member-token-management,omitempty"`
}

TeamCreateOptions represents the options for creating a team.

type TeamList struct {
	Items []*Team
}

TeamList represents a list of teams.

TeamListOptions represents the options for listing teams.

type TeamMemberAddOptions struct {
	Usernames                 []string
	OrganizationMembershipIDs []string
}

TeamMemberAddOptions represents the options for adding or removing team members.

type TeamMemberRemoveOptions struct {
	Usernames                 []string
	OrganizationMembershipIDs []string
}

TeamMemberRemoveOptions represents the options for adding or removing team members.

type TeamMembers interface {
	
	
	List(ctx context.Context, teamID string) ([]*User, error)

	
	ListUsers(ctx context.Context, teamID string) ([]*User, error)

	
	ListOrganizationMemberships(ctx context.Context, teamID string) ([]*OrganizationMembership, error)

	
	Add(ctx context.Context, teamID string, options TeamMemberAddOptions) error

	
	Remove(ctx context.Context, teamID string, options TeamMemberRemoveOptions) error
}

TeamMembers describes all the team member related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/team-members

type TeamPermissions struct {
	CanDestroy          bool `jsonapi:"attr,can-destroy"`
	CanUpdateMembership bool `jsonapi:"attr,can-update-membership"`
}

TeamPermissions represents the current user's permissions on the team.

TeamProjectAccess represents a project access for a team

TeamProjectAccessAddOptions represents the options for adding team access for a project

TeamProjectAccessList represents a list of team project accesses

type TeamProjectAccessListOptions struct {
	ListOptions
	ProjectID string `url:"filter[project][id]"`
}

TeamProjectAccessListOptions represents the options for listing team project accesses

ProjectPermissions represents the team's permissions on its project

type TeamProjectAccessType string

TeamProjectAccessType represents a team project access type.

ProjectAccess returns a pointer to the given team access project type.

TeamProjectAccessUpdateOptions represents the options for updating a team project access

WorkspacePermissions represents the team's permission on all workspaces in its project

type TeamProjectAccesses interface {
	
	List(ctx context.Context, options TeamProjectAccessListOptions) (*TeamProjectAccessList, error)

	
	Add(ctx context.Context, options TeamProjectAccessAddOptions) (*TeamProjectAccess, error)

	
	Read(ctx context.Context, teamProjectAccessID string) (*TeamProjectAccess, error)

	
	Update(ctx context.Context, teamProjectAccessID string, options TeamProjectAccessUpdateOptions) (*TeamProjectAccess, error)

	
	Remove(ctx context.Context, teamProjectAccessID string) error
}

TeamProjectAccesses describes all the team project access related methods that the Terraform Enterprise API supports

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/project-team-access

type TeamToken struct {
	ID          string           `jsonapi:"primary,authentication-tokens"`
	CreatedAt   time.Time        `jsonapi:"attr,created-at,iso8601"`
	Description *string          `jsonapi:"attr,description"`
	LastUsedAt  time.Time        `jsonapi:"attr,last-used-at,iso8601"`
	Token       string           `jsonapi:"attr,token"`
	ExpiredAt   time.Time        `jsonapi:"attr,expired-at,iso8601"`
	CreatedBy   *CreatedByChoice `jsonapi:"polyrelation,created-by"`
	Team        *Team            `jsonapi:"relation,team"`
}

TeamToken represents a Terraform Enterprise team token.

type TeamTokenCreateOptions struct {
	
	
	ExpiredAt *time.Time `jsonapi:"attr,expired-at,iso8601,omitempty"`

	
	
	Description *string `jsonapi:"attr,description,omitempty"`
}

TeamTokenCreateOptions contains the options for creating a team token.

type TeamTokenList struct {
	Items []*TeamToken
}

TeamTokenList represents a list of team tokens.

type TeamTokenListOptions struct {
	ListOptions

	
	
	Query string `url:"q,omitempty"`

	
	
	Sort string `url:"sort,omitempty"`
}

TeamTokenListOptions contains the options for listing team tokens.

type TeamTokens interface {
	
	
	Create(ctx context.Context, teamID string) (*TeamToken, error)

	
	
	
	CreateWithOptions(ctx context.Context, teamID string, options TeamTokenCreateOptions) (*TeamToken, error)

	
	Read(ctx context.Context, teamID string) (*TeamToken, error)

	
	ReadByID(ctx context.Context, teamID string) (*TeamToken, error)

	
	List(ctx context.Context, organizationID string, options *TeamTokenListOptions) (*TeamTokenList, error)

	
	Delete(ctx context.Context, teamID string) error

	
	DeleteByID(ctx context.Context, tokenID string) error
}

TeamTokens describes all the team token related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/team-tokens

type TeamUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,teams"`

	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	SSOTeamID *string `jsonapi:"attr,sso-team-id,omitempty"`

	
	OrganizationAccess *OrganizationAccessOptions `jsonapi:"attr,organization-access,omitempty"`

	
	Visibility *string `jsonapi:"attr,visibility,omitempty"`

	
	AllowMemberTokenManagement *bool `jsonapi:"attr,allow-member-token-management,omitempty"`
}

TeamUpdateOptions represents the options for updating a team.

type Teams interface {
	
	List(ctx context.Context, organization string, options *TeamListOptions) (*TeamList, error)

	
	Create(ctx context.Context, organization string, options TeamCreateOptions) (*Team, error)

	
	Read(ctx context.Context, teamID string) (*Team, error)

	
	Update(ctx context.Context, teamID string, options TeamUpdateOptions) (*Team, error)

	
	Delete(ctx context.Context, teamID string) error
}

Teams describes all the team related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/teams

type TerraformRegistryModule struct {
	ID              string   `json:"id"`
	Owner           string   `json:"owner"`
	Namespace       string   `json:"namespace"`
	Name            string   `json:"name"`
	Version         string   `json:"version"`
	Provider        string   `json:"provider"`
	ProviderLogoURL string   `json:"provider_logo_url"`
	Description     string   `json:"description"`
	Source          string   `json:"source"`
	Tag             string   `json:"tag"`
	PublishedAt     string   `json:"published_at"`
	Downloads       int      `json:"downloads"`
	Verified        bool     `json:"verified"`
	Root            Root     `json:"root"`
	Providers       []string `json:"providers"`
	Versions        []string `json:"versions"`
}

TerraformRegistryModule contains data about a module from the Terraform Registry.

type TestConfig struct {
	TestsEnabled bool `jsonapi:"attr,tests-enabled"`
}
type TestRun struct {
	ID               string                  `jsonapi:"primary,test-runs"`
	Status           TestRunStatus           `jsonapi:"attr,status"`
	StatusTimestamps TestRunStatusTimestamps `jsonapi:"attr,status-timestamps"`
	TestStatus       TestStatus              `jsonapi:"attr,test-status"`
	TestsPassed      int                     `jsonapi:"attr,tests-passed"`
	TestsFailed      int                     `jsonapi:"attr,tests-failed"`
	TestsErrored     int                     `jsonapi:"attr,tests-errored"`
	TestsSkipped     int                     `jsonapi:"attr,tests-skipped"`
	LogReadURL       string                  `jsonapi:"attr,log-read-url"`

	
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`
	RegistryModule       *RegistryModule       `jsonapi:"relation,registry-module"`
}

TestRun represents a Terraform Enterprise test run.

type TestRunCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,test-runs"`

	
	
	Filters []string `jsonapi:"attr,filters,omitempty"`

	
	
	TestDirectory *string `jsonapi:"attr,test-directory,omitempty"`

	
	
	Verbose *bool `jsonapi:"attr,verbose,omitempty"`

	
	Parallelism *int `jsonapi:"attr,parallelism,omitempty"`

	
	
	Variables []*RunVariable `jsonapi:"attr,variables,omitempty"`

	
	
	ConfigurationVersion *ConfigurationVersion `jsonapi:"relation,configuration-version"`

	
	
	RegistryModule *RegistryModule `jsonapi:"relation,registry-module"`
}

TestRunCreateOptions represents the options for creating a run.

type TestRunList struct {
	Items []*TestRun
}

TestRunList represents a list of test runs.

TestRunListOptions represents the options for listing runs.

TestRunStatus represents the status of a test run.

List all available test run statuses.

type TestRunStatusTimestamps struct {
	CanceledAt      time.Time `jsonapi:"attr,canceled-at,rfc3339"`
	ErroredAt       time.Time `jsonapi:"attr,errored-at,rfc3339"`
	FinishedAt      time.Time `jsonapi:"attr,finished-at,rfc3339"`
	ForceCanceledAt time.Time `jsonapi:"attr,force-canceled-at,rfc3339"`
	QueuedAt        time.Time `jsonapi:"attr,queued-at,rfc3339"`
	StartedAt       time.Time `jsonapi:"attr,started-at,rfc3339"`
}

TestRunStatusTimestamps holds the timestamps for individual test run statuses.

type TestRuns interface {
	
	List(ctx context.Context, moduleID RegistryModuleID, options *TestRunListOptions) (*TestRunList, error)

	
	Read(ctx context.Context, moduleID RegistryModuleID, testRunID string) (*TestRun, error)

	
	Create(ctx context.Context, options TestRunCreateOptions) (*TestRun, error)

	
	Logs(ctx context.Context, moduleID RegistryModuleID, testRunID string) (io.Reader, error)

	
	Cancel(ctx context.Context, moduleID RegistryModuleID, testRunID string) error

	
	ForceCancel(ctx context.Context, moduleID RegistryModuleID, testRunID string) error
}

TestRuns describes all the test run related methods that the Terraform Enterprise API supports.

**Note: These methods are still in BETA and subject to change.**

TestStatus represents the status of an individual test within an overall test run.

List all available test statuses.

type TestVariables interface {
	
	List(ctx context.Context, moduleID RegistryModuleID, options *VariableListOptions) (*VariableList, error)

	
	Read(ctx context.Context, moduleID RegistryModuleID, variableID string) (*Variable, error)

	
	Create(ctx context.Context, moduleID RegistryModuleID, options VariableCreateOptions) (*Variable, error)

	
	Update(ctx context.Context, moduleID RegistryModuleID, variableID string, options VariableUpdateOptions) (*Variable, error)

	
	Delete(ctx context.Context, moduleID RegistryModuleID, variableID string) error
}

Variables describes all the variable related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/private-registry/tests

const (
	
	
	AuditTrailToken TokenType = "audit-trails"
)
type ToolVersionArchitecture struct {
	URL  string `jsonapi:"attr,url"`
	Sha  string `jsonapi:"attr,sha"`
	OS   string `jsonapi:"attr,os"`
	Arch string `jsonapi:"attr,arch"`
}
type TwoFactor struct {
	Enabled  bool `jsonapi:"attr,enabled"`
	Verified bool `jsonapi:"attr,verified"`
}

TwoFactor represents the organization permissions.

type User struct {
	ID               string     `jsonapi:"primary,users"`
	AvatarURL        string     `jsonapi:"attr,avatar-url"`
	Email            string     `jsonapi:"attr,email"`
	IsServiceAccount bool       `jsonapi:"attr,is-service-account"`
	TwoFactor        *TwoFactor `jsonapi:"attr,two-factor"`
	UnconfirmedEmail string     `jsonapi:"attr,unconfirmed-email"`
	Username         string     `jsonapi:"attr,username"`
	V2Only           bool       `jsonapi:"attr,v2-only"`
	
	IsSiteAdmin *bool            `jsonapi:"attr,is-site-admin"`
	IsAdmin     *bool            `jsonapi:"attr,is-admin"`
	IsSsoLogin  *bool            `jsonapi:"attr,is-sso-login"`
	Permissions *UserPermissions `jsonapi:"attr,permissions"`
}

User represents a Terraform Enterprise user.

type UserPermissions struct {
	CanCreateOrganizations bool `jsonapi:"attr,can-create-organizations"`
	CanChangeEmail         bool `jsonapi:"attr,can-change-email"`
	CanChangeUsername      bool `jsonapi:"attr,can-change-username"`
	CanManageUserTokens    bool `jsonapi:"attr,can-manage-user-tokens"`
	CanView2FaSettings     bool `jsonapi:"attr,can-view2fa-settings"`
	CanManageHcpAccount    bool `jsonapi:"attr,can-manage-hcp-account"`
}

UserPermissions represents the user permissions.

type UserToken struct {
	ID          string           `jsonapi:"primary,authentication-tokens"`
	CreatedAt   time.Time        `jsonapi:"attr,created-at,iso8601"`
	Description string           `jsonapi:"attr,description"`
	LastUsedAt  time.Time        `jsonapi:"attr,last-used-at,iso8601"`
	Token       string           `jsonapi:"attr,token"`
	ExpiredAt   time.Time        `jsonapi:"attr,expired-at,iso8601"`
	CreatedBy   *CreatedByChoice `jsonapi:"polyrelation,created-by"`
}

UserToken represents a Terraform Enterprise user token.

type UserTokenCreateOptions struct {
	Description string `jsonapi:"attr,description,omitempty"`
	
	
	ExpiredAt *time.Time `jsonapi:"attr,expired-at,iso8601,omitempty"`
}

UserTokenCreateOptions contains the options for creating a user token.

type UserTokenList struct {
	Items []*UserToken
}

UserTokenList is a list of tokens for the given user ID.

type UserUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,users"`

	
	Username *string `jsonapi:"attr,username,omitempty"`

	
	Email *string `jsonapi:"attr,email,omitempty"`
}

UserUpdateOptions represents the options for updating a user.

type VCSRepo struct {
	Branch            string `jsonapi:"attr,branch"`
	DisplayIdentifier string `jsonapi:"attr,display-identifier"`
	Identifier        string `jsonapi:"attr,identifier"`
	IngressSubmodules bool   `jsonapi:"attr,ingress-submodules"`
	OAuthTokenID      string `jsonapi:"attr,oauth-token-id"`
	GHAInstallationID string `jsonapi:"attr,github-app-installation-id"`
	RepositoryHTTPURL string `jsonapi:"attr,repository-http-url"`
	ServiceProvider   string `jsonapi:"attr,service-provider"`
	Tags              bool   `jsonapi:"attr,tags"`
	TagsRegex         string `jsonapi:"attr,tags-regex"`
	WebhookURL        string `jsonapi:"attr,webhook-url"`
	SourceDirectory   string `jsonapi:"attr,source-directory"`
	TagPrefix         string `jsonapi:"attr,tag-prefix"`
}

VCSRepo contains the configuration of a VCS integration.

type VCSRepoOptions struct {
	Branch            *string `json:"branch,omitempty"`
	Identifier        *string `json:"identifier,omitempty"`
	IngressSubmodules *bool   `json:"ingress-submodules,omitempty"`
	OAuthTokenID      *string `json:"oauth-token-id,omitempty"`
	TagsRegex         *string `json:"tags-regex,omitempty"`
	GHAInstallationID *string `json:"github-app-installation-id,omitempty"`
}

TODO: move this struct out. VCSRepoOptions is used by workspaces, policy sets, and registry modules VCSRepoOptions represents the configuration options of a VCS integration.

type Variable struct {
	ID          string       `jsonapi:"primary,vars"`
	Key         string       `jsonapi:"attr,key"`
	Value       string       `jsonapi:"attr,value"`
	Description string       `jsonapi:"attr,description"`
	Category    CategoryType `jsonapi:"attr,category"`
	HCL         bool         `jsonapi:"attr,hcl"`
	Sensitive   bool         `jsonapi:"attr,sensitive"`
	VersionID   string       `jsonapi:"attr,version-id"`

	
	Workspace *Workspace `jsonapi:"relation,configurable"`
}

Variable represents a Terraform Enterprise variable.

type VariableCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Category *CategoryType `jsonapi:"attr,category"`

	
	HCL *bool `jsonapi:"attr,hcl,omitempty"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

VariableCreateOptions represents the options for creating a new variable.

type VariableList struct {
	Items []*Variable
}

VariableList represents a list of variables.

VariableListOptions represents the options for listing variables.

type VariableSet struct {
	ID          string `jsonapi:"primary,varsets"`
	Name        string `jsonapi:"attr,name"`
	Description string `jsonapi:"attr,description"`
	Global      bool   `jsonapi:"attr,global"`
	Priority    bool   `jsonapi:"attr,priority"`

	
	Organization *Organization `jsonapi:"relation,organization"`
	
	
	Parent     *Parent                `jsonapi:"polyrelation,parent"`
	Workspaces []*Workspace           `jsonapi:"relation,workspaces,omitempty"`
	Projects   []*Project             `jsonapi:"relation,projects,omitempty"`
	Variables  []*VariableSetVariable `jsonapi:"relation,vars,omitempty"`
}

VariableSet represents a Terraform Enterprise variable set.

type VariableSetApplyToProjectsOptions struct {
	
	Projects []*Project
}

VariableSetApplyToProjectsOptions represents the options for applying variable sets to projects.

type VariableSetApplyToWorkspacesOptions struct {
	
	Workspaces []*Workspace
}

VariableSetApplyToWorkspacesOptions represents the options for applying variable sets to workspaces.

type VariableSetCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,varsets"`

	
	
	
	Name *string `jsonapi:"attr,name"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Global *bool `jsonapi:"attr,global,omitempty"`

	
	
	Priority *bool `jsonapi:"attr,priority,omitempty"`

	
	
	Parent *Parent `jsonapi:"polyrelation,parent"`
}

VariableSetCreateOptions represents the options for creating a new variable set within in a organization.

VariableSetList represents a list of variable sets.

VariableSetListOptions represents the options for listing variable sets.

VariableSetReadOptions represents the options for reading variable sets.

type VariableSetRemoveFromProjectsOptions struct {
	
	Projects []*Project
}

VariableSetRemoveFromProjectsOptions represents the options for removing variable sets from projects.

type VariableSetRemoveFromWorkspacesOptions struct {
	
	Workspaces []*Workspace
}

VariableSetRemoveFromWorkspacesOptions represents the options for removing variable sets from workspaces.

type VariableSetUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,varsets"`

	
	
	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Global *bool `jsonapi:"attr,global,omitempty"`

	
	
	Priority *bool `jsonapi:"attr,priority,omitempty"`
}

VariableSetUpdateOptions represents the options for updating a variable set.

type VariableSetUpdateWorkspacesOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,varsets"`

	
	Workspaces []*Workspace `jsonapi:"relation,workspaces"`
}

VariableSetUpdateWorkspacesOptions represents a subset of update options specifically for applying variable sets to workspaces

type VariableSetVariable struct {
	ID          string       `jsonapi:"primary,vars"`
	Key         string       `jsonapi:"attr,key"`
	Value       string       `jsonapi:"attr,value"`
	Description string       `jsonapi:"attr,description"`
	Category    CategoryType `jsonapi:"attr,category"`
	HCL         bool         `jsonapi:"attr,hcl"`
	Sensitive   bool         `jsonapi:"attr,sensitive"`
	VersionID   string       `jsonapi:"attr,version-id"`

	
	VariableSet *VariableSet `jsonapi:"relation,varset"`
}
type VariableSetVariableCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Category *CategoryType `jsonapi:"attr,category"`

	
	HCL *bool `jsonapi:"attr,hcl,omitempty"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

VariableSetVariableCreatOptions represents the options for creating a new variable within a variable set

type VariableSetVariableListOptions struct {
	ListOptions
}
type VariableSetVariableUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	HCL *bool `jsonapi:"attr,hcl,omitempty"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

VariableSetVariableUpdateOptions represents the options for updating a variable.

type VariableSetVariables interface {
	
	List(ctx context.Context, variableSetID string, options *VariableSetVariableListOptions) (*VariableSetVariableList, error)

	
	Create(ctx context.Context, variableSetID string, options *VariableSetVariableCreateOptions) (*VariableSetVariable, error)

	
	Read(ctx context.Context, variableSetID string, variableID string) (*VariableSetVariable, error)

	
	Update(ctx context.Context, variableSetID string, variableID string, options *VariableSetVariableUpdateOptions) (*VariableSetVariable, error)

	
	Delete(ctx context.Context, variableSetID string, variableID string) error
}

VariableSetVariables describes all variable variable related methods within the scope of Variable Sets that the Terraform Enterprise API supports

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/variable-sets#variable-relationships

type VariableSets interface {
	
	List(ctx context.Context, organization string, options *VariableSetListOptions) (*VariableSetList, error)

	
	ListForWorkspace(ctx context.Context, workspaceID string, options *VariableSetListOptions) (*VariableSetList, error)

	
	ListForProject(ctx context.Context, projectID string, options *VariableSetListOptions) (*VariableSetList, error)

	
	Create(ctx context.Context, organization string, options *VariableSetCreateOptions) (*VariableSet, error)

	
	Read(ctx context.Context, variableSetID string, options *VariableSetReadOptions) (*VariableSet, error)

	
	Update(ctx context.Context, variableSetID string, options *VariableSetUpdateOptions) (*VariableSet, error)

	
	Delete(ctx context.Context, variableSetID string) error

	
	ApplyToWorkspaces(ctx context.Context, variableSetID string, options *VariableSetApplyToWorkspacesOptions) error

	
	RemoveFromWorkspaces(ctx context.Context, variableSetID string, options *VariableSetRemoveFromWorkspacesOptions) error

	
	ApplyToProjects(ctx context.Context, variableSetID string, options VariableSetApplyToProjectsOptions) error

	
	RemoveFromProjects(ctx context.Context, variableSetID string, options VariableSetRemoveFromProjectsOptions) error

	
	UpdateWorkspaces(ctx context.Context, variableSetID string, options *VariableSetUpdateWorkspacesOptions) (*VariableSet, error)
}

VariableSets describes all the Variable Set related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/variable-sets

type VariableUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,vars"`

	
	Key *string `jsonapi:"attr,key,omitempty"`

	
	Value *string `jsonapi:"attr,value,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	Category *CategoryType `jsonapi:"attr,category,omitempty"`

	
	HCL *bool `jsonapi:"attr,hcl,omitempty"`

	
	Sensitive *bool `jsonapi:"attr,sensitive,omitempty"`
}

VariableUpdateOptions represents the options for updating a variable.

type Variables interface {
	
	List(ctx context.Context, workspaceID string, options *VariableListOptions) (*VariableList, error)

	
	ListAll(ctx context.Context, workspaceID string, options *VariableListOptions) (*VariableList, error)

	
	Create(ctx context.Context, workspaceID string, options VariableCreateOptions) (*Variable, error)

	
	Read(ctx context.Context, workspaceID string, variableID string) (*Variable, error)

	
	Update(ctx context.Context, workspaceID string, variableID string, options VariableUpdateOptions) (*Variable, error)

	
	Delete(ctx context.Context, workspaceID string, variableID string) error
}

Variables describes all the variable related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspace-variables

type VariablesPermissionType string

VariablesPermissionType represents the permissiontype to a workspace's variables.

VariablesPermission returns a pointer to the given team variables permission type.

WaitForStatusResult is the data structure that is sent over the channel returned by various status polling functions. For each result, either the Error or the Status will be set, but not both. If the Quit field is set, the channel will be closed. If the Quit field is set and the Error is nil, the Status field will be set to a specified quit status.

type Workspace struct {
	ID                          string                          `jsonapi:"primary,workspaces"`
	Actions                     *WorkspaceActions               `jsonapi:"attr,actions"`
	AllowDestroyPlan            bool                            `jsonapi:"attr,allow-destroy-plan"`
	AssessmentsEnabled          bool                            `jsonapi:"attr,assessments-enabled"`
	AutoApply                   bool                            `jsonapi:"attr,auto-apply"`
	AutoApplyRunTrigger         bool                            `jsonapi:"attr,auto-apply-run-trigger"`
	AutoDestroyAt               jsonapi.NullableAttr[time.Time] `jsonapi:"attr,auto-destroy-at,iso8601,omitempty"`
	AutoDestroyActivityDuration jsonapi.NullableAttr[string]    `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`
	CanQueueDestroyPlan         bool                            `jsonapi:"attr,can-queue-destroy-plan"`
	CreatedAt                   time.Time                       `jsonapi:"attr,created-at,iso8601"`
	Description                 string                          `jsonapi:"attr,description"`
	Environment                 string                          `jsonapi:"attr,environment"`
	ExecutionMode               string                          `jsonapi:"attr,execution-mode"`
	FileTriggersEnabled         bool                            `jsonapi:"attr,file-triggers-enabled"`
	GlobalRemoteState           bool                            `jsonapi:"attr,global-remote-state"`
	InheritsProjectAutoDestroy  bool                            `jsonapi:"attr,inherits-project-auto-destroy"`
	Locked                      bool                            `jsonapi:"attr,locked"`
	MigrationEnvironment        string                          `jsonapi:"attr,migration-environment"`
	Name                        string                          `jsonapi:"attr,name"`
	NoCodeUpgradeAvailable      bool                            `jsonapi:"attr,no-code-upgrade-available"`
	Operations                  bool                            `jsonapi:"attr,operations"`
	Permissions                 *WorkspacePermissions           `jsonapi:"attr,permissions"`
	QueueAllRuns                bool                            `jsonapi:"attr,queue-all-runs"`
	SpeculativeEnabled          bool                            `jsonapi:"attr,speculative-enabled"`
	SourceName                  string                          `jsonapi:"attr,source-name"`
	SourceURL                   string                          `jsonapi:"attr,source-url"`
	StructuredRunOutputEnabled  bool                            `jsonapi:"attr,structured-run-output-enabled"`
	TerraformVersion            string                          `jsonapi:"attr,terraform-version"`
	TriggerPrefixes             []string                        `jsonapi:"attr,trigger-prefixes"`
	TriggerPatterns             []string                        `jsonapi:"attr,trigger-patterns"`
	VCSRepo                     *VCSRepo                        `jsonapi:"attr,vcs-repo"`
	WorkingDirectory            string                          `jsonapi:"attr,working-directory"`
	UpdatedAt                   time.Time                       `jsonapi:"attr,updated-at,iso8601"`
	ResourceCount               int                             `jsonapi:"attr,resource-count"`
	ApplyDurationAverage        time.Duration                   `jsonapi:"attr,apply-duration-average"`
	PlanDurationAverage         time.Duration                   `jsonapi:"attr,plan-duration-average"`
	PolicyCheckFailures         int                             `jsonapi:"attr,policy-check-failures"`
	RunFailures                 int                             `jsonapi:"attr,run-failures"`
	RunsCount                   int                             `jsonapi:"attr,workspace-kpis-runs-count"`
	TagNames                    []string                        `jsonapi:"attr,tag-names"`
	SettingOverwrites           *WorkspaceSettingOverwrites     `jsonapi:"attr,setting-overwrites"`

	
	AgentPool                   *AgentPool             `jsonapi:"relation,agent-pool"`
	CurrentRun                  *Run                   `jsonapi:"relation,current-run"`
	CurrentStateVersion         *StateVersion          `jsonapi:"relation,current-state-version"`
	Organization                *Organization          `jsonapi:"relation,organization"`
	SSHKey                      *SSHKey                `jsonapi:"relation,ssh-key"`
	Outputs                     []*WorkspaceOutputs    `jsonapi:"relation,outputs"`
	Project                     *Project               `jsonapi:"relation,project"`
	Tags                        []*Tag                 `jsonapi:"relation,tags"`
	CurrentConfigurationVersion *ConfigurationVersion  `jsonapi:"relation,current-configuration-version,omitempty"`
	LockedBy                    *LockedByChoice        `jsonapi:"polyrelation,locked-by"`
	Variables                   []*Variable            `jsonapi:"relation,vars"`
	TagBindings                 []*TagBinding          `jsonapi:"relation,tag-bindings"`
	EffectiveTagBindings        []*EffectiveTagBinding `jsonapi:"relation,effective-tag-bindings"`

	
	DataRetentionPolicy *DataRetentionPolicy
	
	DataRetentionPolicyChoice *DataRetentionPolicyChoice `jsonapi:"polyrelation,data-retention-policy"`

	
	Links map[string]interface{} `jsonapi:"links,omitempty"`
}

Workspace represents a Terraform Enterprise workspace.

type WorkspaceActions struct {
	IsDestroyable bool `jsonapi:"attr,is-destroyable"`
}

WorkspaceActions represents the workspace actions.

type WorkspaceAddRemoteStateConsumersOptions struct {
	
	Workspaces []*Workspace
}

WorkspaceAddRemoteStateConsumersOptions represents the options for adding remote state consumers to a workspace.

type WorkspaceAddTagBindingsOptions struct {
	TagBindings []*TagBinding
}

WorkspaceAddTagBindingsOptions represents the options for adding tag bindings to a workspace.

type WorkspaceAddTagsOptions struct {
	Tags []*Tag
}
type WorkspaceAssignSSHKeyOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,workspaces"`

	
	SSHKeyID *string `jsonapi:"attr,id"`
}

WorkspaceAssignSSHKeyOptions represents the options to assign an SSH key to a workspace.

type WorkspaceCreateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,workspaces"`

	
	
	
	AgentPoolID *string `jsonapi:"attr,agent-pool-id,omitempty"`

	
	AllowDestroyPlan *bool `jsonapi:"attr,allow-destroy-plan,omitempty"`

	
	
	
	AssessmentsEnabled *bool `jsonapi:"attr,assessments-enabled,omitempty"`

	
	AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"`

	
	
	AutoApplyRunTrigger *bool `jsonapi:"attr,auto-apply-run-trigger,omitempty"`

	
	AutoDestroyAt jsonapi.NullableAttr[time.Time] `jsonapi:"attr,auto-destroy-at,iso8601,omitempty"`

	
	
	AutoDestroyActivityDuration jsonapi.NullableAttr[string] `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`

	
	InheritsProjectAutoDestroy *bool `jsonapi:"attr,inherits-project-auto-destroy,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	
	
	
	ExecutionMode *string `jsonapi:"attr,execution-mode,omitempty"`

	
	
	
	
	FileTriggersEnabled *bool `jsonapi:"attr,file-triggers-enabled,omitempty"`

	GlobalRemoteState *bool `jsonapi:"attr,global-remote-state,omitempty"`

	
	
	
	MigrationEnvironment *string `jsonapi:"attr,migration-environment,omitempty"`

	
	
	
	Name *string `jsonapi:"attr,name"`

	
	
	Operations *bool `jsonapi:"attr,operations,omitempty"`

	
	
	QueueAllRuns *bool `jsonapi:"attr,queue-all-runs,omitempty"`

	
	
	
	
	SpeculativeEnabled *bool `jsonapi:"attr,speculative-enabled,omitempty"`

	
	
	
	SourceName *string `jsonapi:"attr,source-name,omitempty"`

	
	
	
	SourceURL *string `jsonapi:"attr,source-url,omitempty"`

	
	
	
	
	StructuredRunOutputEnabled *bool `jsonapi:"attr,structured-run-output-enabled,omitempty"`

	
	
	TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"`

	
	
	TriggerPrefixes []string `jsonapi:"attr,trigger-prefixes,omitempty"`

	
	
	TriggerPatterns []string `jsonapi:"attr,trigger-patterns,omitempty"`

	
	
	
	VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"`

	
	
	
	WorkingDirectory *string `jsonapi:"attr,working-directory,omitempty"`

	
	
	Tags []*Tag `jsonapi:"relation,tags,omitempty"`

	
	
	
	
	
	
	
	
	
	
	
	SettingOverwrites *WorkspaceSettingOverwritesOptions `jsonapi:"attr,setting-overwrites,omitempty"`

	
	
	Project *Project `jsonapi:"relation,project,omitempty"`

	
	TagBindings []*TagBinding `jsonapi:"relation,tag-bindings,omitempty"`
}

WorkspaceCreateOptions represents the options for creating a new workspace.

type WorkspaceList struct {
	Items []*Workspace
}

WorkspaceList represents a list of workspaces.

type WorkspaceListOptions struct {
	ListOptions

	
	Search string `url:"search[name],omitempty"`

	
	Tags string `url:"search[tags],omitempty"`

	
	ExcludeTags string `url:"search[exclude-tags],omitempty"`

	
	WildcardName string `url:"search[wildcard-name],omitempty"`

	
	ProjectID string `url:"filter[project][id],omitempty"`

	
	CurrentRunStatus string `url:"filter[current-run][status],omitempty"`

	
	
	TagBindings []*TagBinding

	
	Include []WSIncludeOpt `url:"include,omitempty"`

	
	
	Sort string `url:"sort,omitempty"`
}

WorkspaceListOptions represents the options for listing workspaces.

type WorkspaceLockOptions struct {
	
	Reason *string `jsonapi:"attr,reason,omitempty"`
}

WorkspaceLockOptions represents the options for locking a workspace.

type WorkspaceOutputs struct {
	ID        string      `jsonapi:"primary,workspace-outputs"`
	Name      string      `jsonapi:"attr,name"`
	Sensitive bool        `jsonapi:"attr,sensitive"`
	Type      string      `jsonapi:"attr,output-type"`
	Value     interface{} `jsonapi:"attr,value"`
}
type WorkspacePermissions struct {
	CanDestroy        bool  `jsonapi:"attr,can-destroy"`
	CanForceUnlock    bool  `jsonapi:"attr,can-force-unlock"`
	CanLock           bool  `jsonapi:"attr,can-lock"`
	CanManageRunTasks bool  `jsonapi:"attr,can-manage-run-tasks"`
	CanQueueApply     bool  `jsonapi:"attr,can-queue-apply"`
	CanQueueDestroy   bool  `jsonapi:"attr,can-queue-destroy"`
	CanQueueRun       bool  `jsonapi:"attr,can-queue-run"`
	CanReadSettings   bool  `jsonapi:"attr,can-read-settings"`
	CanUnlock         bool  `jsonapi:"attr,can-unlock"`
	CanUpdate         bool  `jsonapi:"attr,can-update"`
	CanUpdateVariable bool  `jsonapi:"attr,can-update-variable"`
	CanForceDelete    *bool `jsonapi:"attr,can-force-delete"` 
}

WorkspacePermissions represents the workspace permissions.

type WorkspaceReadOptions struct {
	
	
	Include []WSIncludeOpt `url:"include,omitempty"`
}

WorkspaceReadOptions represents the options for reading a workspace.

type WorkspaceRemoveRemoteStateConsumersOptions struct {
	
	Workspaces []*Workspace
}

WorkspaceRemoveRemoteStateConsumersOptions represents the options for removing remote state consumers from a workspace.

type WorkspaceRemoveTagsOptions struct {
	Tags []*Tag
}
type WorkspaceResource struct {
	ID                       string  `jsonapi:"primary,resources"`
	Address                  string  `jsonapi:"attr,address"`
	Name                     string  `jsonapi:"attr,name"`
	CreatedAt                string  `jsonapi:"attr,created-at"`
	UpdatedAt                string  `jsonapi:"attr,updated-at"`
	Module                   string  `jsonapi:"attr,module"`
	Provider                 string  `jsonapi:"attr,provider"`
	ProviderType             string  `jsonapi:"attr,provider-type"`
	ModifiedByStateVersionID string  `jsonapi:"attr,modified-by-state-version-id"`
	NameIndex                *string `jsonapi:"attr,name-index"`
}

WorkspaceResource represents a Terraform Enterprise workspace resource.

type WorkspaceResourceListOptions struct {
	ListOptions
}

WorkspaceResourceListOptions represents the options for listing workspace resources.

WorkspaceResourcesList represents a list of workspace resources.

type WorkspaceRunTask struct {
	ID               string               `jsonapi:"primary,workspace-tasks"`
	EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level"`
	
	Stage  Stage   `jsonapi:"attr,stage"`
	Stages []Stage `jsonapi:"attr,stages"`

	RunTask   *RunTask   `jsonapi:"relation,task"`
	Workspace *Workspace `jsonapi:"relation,workspace"`
}

WorkspaceRunTask represents a HCP Terraform or Terraform Enterprise run task that belongs to a workspace

type WorkspaceRunTaskCreateOptions struct {
	Type string `jsonapi:"primary,workspace-tasks"`
	
	EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level"`
	
	RunTask *RunTask `jsonapi:"relation,task"`
	
	Stage *Stage `jsonapi:"attr,stage,omitempty"`
	
	Stages *[]Stage `jsonapi:"attr,stages,omitempty"`
}

WorkspaceRunTaskCreateOptions represents the set of options for creating a workspace run task

WorkspaceRunTaskList represents a list of workspace run tasks

type WorkspaceRunTaskListOptions struct {
	ListOptions
}

WorkspaceRunTaskListOptions represents the set of options for listing workspace run tasks

type WorkspaceRunTaskUpdateOptions struct {
	Type             string               `jsonapi:"primary,workspace-tasks"`
	EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level,omitempty"`
	
	Stage *Stage `jsonapi:"attr,stage,omitempty"`
	
	Stages *[]Stage `jsonapi:"attr,stages,omitempty"`
}

WorkspaceRunTaskUpdateOptions represent the set of options for updating a workspace run task.

type WorkspaceRunTasks interface {
	
	Create(ctx context.Context, workspaceID string, options WorkspaceRunTaskCreateOptions) (*WorkspaceRunTask, error)

	
	List(ctx context.Context, workspaceID string, options *WorkspaceRunTaskListOptions) (*WorkspaceRunTaskList, error)

	
	Read(ctx context.Context, workspaceID string, workspaceTaskID string) (*WorkspaceRunTask, error)

	
	Update(ctx context.Context, workspaceID string, workspaceTaskID string, options WorkspaceRunTaskUpdateOptions) (*WorkspaceRunTask, error)

	
	Delete(ctx context.Context, workspaceID string, workspaceTaskID string) error
}

WorkspaceRunTasks represent all the run task related methods in the context of a workspace that the HCP Terraform and Terraform Enterprise API supports.

type WorkspaceRunsPermissionType string

WorkspaceRunsPermissionType represents the permissiontype to project workspaces' runs

WorkspaceRunsPermission returns a pointer to the given team access project type.

type WorkspaceSentinelMocksPermissionType string

WorkspaceSentinelMocksPermissionType represents the permissiontype to project workspaces' sentinel-mocks

WorkspaceSentinelMocksPermission returns a pointer to the given team access project type.

type WorkspaceSettingOverwrites struct {
	ExecutionMode *bool `jsonapi:"attr,execution-mode"`
	AgentPool     *bool `jsonapi:"attr,agent-pool"`
}

Note: the fields of this struct are bool pointers instead of bool values, in order to simplify support for future TFE versions that support *some but not all* of the inherited defaults that go-tfe knows about.

type WorkspaceSettingOverwritesOptions struct {
	
	ExecutionMode *bool `json:"execution-mode,omitempty"`
	
	AgentPool *bool `json:"agent-pool,omitempty"`
}
type WorkspaceStateVersionsPermissionType string

WorkspaceStateVersionsPermissionType represents the permissiontype to project workspaces' state-versions

WorkspaceStateVersionsPermission returns a pointer to the given team access project type.

type WorkspaceTagListOptions struct {
	ListOptions

	
	
	Query *string `url:"name,omitempty"`
}
type WorkspaceUpdateOptions struct {
	
	
	
	
	Type string `jsonapi:"primary,workspaces"`

	
	
	
	AgentPoolID *string `jsonapi:"attr,agent-pool-id,omitempty"`

	
	AllowDestroyPlan *bool `jsonapi:"attr,allow-destroy-plan,omitempty"`

	
	
	
	AssessmentsEnabled *bool `jsonapi:"attr,assessments-enabled,omitempty"`

	
	AutoApply *bool `jsonapi:"attr,auto-apply,omitempty"`

	
	
	AutoApplyRunTrigger *bool `jsonapi:"attr,auto-apply-run-trigger,omitempty"`

	
	AutoDestroyAt jsonapi.NullableAttr[time.Time] `jsonapi:"attr,auto-destroy-at,iso8601,omitempty"`

	
	
	AutoDestroyActivityDuration jsonapi.NullableAttr[string] `jsonapi:"attr,auto-destroy-activity-duration,omitempty"`

	
	InheritsProjectAutoDestroy *bool `jsonapi:"attr,inherits-project-auto-destroy,omitempty"`

	
	
	
	
	Name *string `jsonapi:"attr,name,omitempty"`

	
	Description *string `jsonapi:"attr,description,omitempty"`

	
	
	
	
	ExecutionMode *string `jsonapi:"attr,execution-mode,omitempty"`

	
	
	
	
	FileTriggersEnabled *bool `jsonapi:"attr,file-triggers-enabled,omitempty"`

	
	GlobalRemoteState *bool `jsonapi:"attr,global-remote-state,omitempty"`

	
	
	Operations *bool `jsonapi:"attr,operations,omitempty"`

	
	
	QueueAllRuns *bool `jsonapi:"attr,queue-all-runs,omitempty"`

	
	
	
	
	SpeculativeEnabled *bool `jsonapi:"attr,speculative-enabled,omitempty"`

	
	
	
	
	StructuredRunOutputEnabled *bool `jsonapi:"attr,structured-run-output-enabled,omitempty"`

	
	TerraformVersion *string `jsonapi:"attr,terraform-version,omitempty"`

	
	
	TriggerPrefixes []string `jsonapi:"attr,trigger-prefixes,omitempty"`

	
	
	TriggerPatterns []string `jsonapi:"attr,trigger-patterns,omitempty"`

	
	
	
	
	
	VCSRepo *VCSRepoOptions `jsonapi:"attr,vcs-repo,omitempty"`

	
	
	
	
	WorkingDirectory *string `jsonapi:"attr,working-directory,omitempty"`

	
	
	
	
	
	
	
	
	
	
	
	SettingOverwrites *WorkspaceSettingOverwritesOptions `jsonapi:"attr,setting-overwrites,omitempty"`

	
	
	Project *Project `jsonapi:"relation,project,omitempty"`

	
	
	TagBindings []*TagBinding `jsonapi:"relation,tag-bindings,omitempty"`
}

WorkspaceUpdateOptions represents the options for updating a workspace.

type WorkspaceUpdateRemoteStateConsumersOptions struct {
	
	Workspaces []*Workspace
}

WorkspaceUpdateRemoteStateConsumersOptions represents the options for updatintg remote state consumers from a workspace.

type WorkspaceUpgrade struct {
	
	Status string `jsonapi:"attr,status"`

	
	PlanURL string `jsonapi:"attr,plan-url"`

	
	Message string `jsonapi:"attr,message"`
}

WorkspaceUpgrade contains the data returned by the no-code workspace upgrade API endpoint.

type WorkspaceVariablesPermissionType string

WorkspaceVariablesPermissionType represents the permissiontype to project workspaces' variables

WorkspaceStateVersionsPermission returns a pointer to the given team access project type.

type Workspaces interface {
	
	List(ctx context.Context, organization string, options *WorkspaceListOptions) (*WorkspaceList, error)

	
	Create(ctx context.Context, organization string, options WorkspaceCreateOptions) (*Workspace, error)

	
	Read(ctx context.Context, organization string, workspace string) (*Workspace, error)

	
	ReadWithOptions(ctx context.Context, organization string, workspace string, options *WorkspaceReadOptions) (*Workspace, error)

	
	Readme(ctx context.Context, workspaceID string) (io.Reader, error)

	
	ReadByID(ctx context.Context, workspaceID string) (*Workspace, error)

	
	ReadByIDWithOptions(ctx context.Context, workspaceID string, options *WorkspaceReadOptions) (*Workspace, error)

	
	Update(ctx context.Context, organization string, workspace string, options WorkspaceUpdateOptions) (*Workspace, error)

	
	UpdateByID(ctx context.Context, workspaceID string, options WorkspaceUpdateOptions) (*Workspace, error)

	
	Delete(ctx context.Context, organization string, workspace string) error

	
	DeleteByID(ctx context.Context, workspaceID string) error

	
	SafeDelete(ctx context.Context, organization string, workspace string) error

	
	SafeDeleteByID(ctx context.Context, workspaceID string) error

	
	RemoveVCSConnection(ctx context.Context, organization, workspace string) (*Workspace, error)

	
	RemoveVCSConnectionByID(ctx context.Context, workspaceID string) (*Workspace, error)

	
	Lock(ctx context.Context, workspaceID string, options WorkspaceLockOptions) (*Workspace, error)

	
	Unlock(ctx context.Context, workspaceID string) (*Workspace, error)

	
	ForceUnlock(ctx context.Context, workspaceID string) (*Workspace, error)

	
	AssignSSHKey(ctx context.Context, workspaceID string, options WorkspaceAssignSSHKeyOptions) (*Workspace, error)

	
	UnassignSSHKey(ctx context.Context, workspaceID string) (*Workspace, error)

	
	ListRemoteStateConsumers(ctx context.Context, workspaceID string, options *RemoteStateConsumersListOptions) (*WorkspaceList, error)

	
	AddRemoteStateConsumers(ctx context.Context, workspaceID string, options WorkspaceAddRemoteStateConsumersOptions) error

	
	RemoveRemoteStateConsumers(ctx context.Context, workspaceID string, options WorkspaceRemoveRemoteStateConsumersOptions) error

	
	
	UpdateRemoteStateConsumers(ctx context.Context, workspaceID string, options WorkspaceUpdateRemoteStateConsumersOptions) error

	
	ListTags(ctx context.Context, workspaceID string, options *WorkspaceTagListOptions) (*TagList, error)

	
	AddTags(ctx context.Context, workspaceID string, options WorkspaceAddTagsOptions) error

	
	RemoveTags(ctx context.Context, workspaceID string, options WorkspaceRemoveTagsOptions) error

	
	
	
	
	ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*DataRetentionPolicy, error)

	
	
	ReadDataRetentionPolicyChoice(ctx context.Context, workspaceID string) (*DataRetentionPolicyChoice, error)

	
	
	
	
	SetDataRetentionPolicy(ctx context.Context, workspaceID string, options DataRetentionPolicySetOptions) (*DataRetentionPolicy, error)

	
	
	SetDataRetentionPolicyDeleteOlder(ctx context.Context, workspaceID string, options DataRetentionPolicyDeleteOlderSetOptions) (*DataRetentionPolicyDeleteOlder, error)

	
	
	SetDataRetentionPolicyDontDelete(ctx context.Context, workspaceID string, options DataRetentionPolicyDontDeleteSetOptions) (*DataRetentionPolicyDontDelete, error)

	
	
	DeleteDataRetentionPolicy(ctx context.Context, workspaceID string) error

	
	ListTagBindings(ctx context.Context, workspaceID string) ([]*TagBinding, error)

	
	
	ListEffectiveTagBindings(ctx context.Context, workspaceID string) ([]*EffectiveTagBinding, error)

	
	AddTagBindings(ctx context.Context, workspaceID string, options WorkspaceAddTagBindingsOptions) ([]*TagBinding, error)

	
	DeleteAllTagBindings(ctx context.Context, workspaceID string) error
}

Workspaces describes all the workspace related methods that the Terraform Enterprise API supports.

TFE API docs: https://developer.hashicorp.com/terraform/cloud-docs/api-docs/workspaces

config := &Config{
	Token:             "insert-your-token-here",
	RetryServerErrors: true,
}

client, err := NewClient(config)
if err != nil {
	log.Fatal(err)
}

// Create a context
ctx := context.Background()

// Create a new workspace
w, err := client.Workspaces.Create(ctx, "org-name", WorkspaceCreateOptions{
	Name: String("my-app-tst"),
})
if err != nil {
	log.Fatal(err)
}

// Update the workspace
w, err = client.Workspaces.Update(ctx, "org-name", w.Name, WorkspaceUpdateOptions{
	AutoApply:        Bool(false),
	TerraformVersion: String("0.11.1"),
	WorkingDirectory: String("my-app/infra"),
})
if err != nil {
	log.Fatal(err)
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4