types

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types provides structs suitable for marshaling to/from json:api

Index

Constants

View Source
const (
	DefaultPageSize = 20
	MaxPageSize     = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CostEstimate

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

CostEstimate represents a Terraform Enterprise costEstimate.

type CostEstimateStatus

type CostEstimateStatus string

CostEstimateStatus represents a costEstimate state.

const (
	CostEstimateCanceled              CostEstimateStatus = "canceled"
	CostEstimateErrored               CostEstimateStatus = "errored"
	CostEstimateFinished              CostEstimateStatus = "finished"
	CostEstimatePending               CostEstimateStatus = "pending"
	CostEstimateQueued                CostEstimateStatus = "queued"
	CostEstimateSkippedDueToTargeting CostEstimateStatus = "skipped_due_to_targeting"
)

List all available costEstimate statuses.

type CostEstimateStatusTimestamps

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

CostEstimateStatusTimestamps holds the timestamps for individual costEstimate statuses.

type ListOptions

type ListOptions struct {
	// The page number to request. The results vary based on the PageSize.
	PageNumber int `schema:"page[number],omitempty"`
	// The number of elements returned in a single page.
	PageSize int `schema:"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 Pagination

type Pagination struct {
	CurrentPage  int  `json:"current-page"`
	PreviousPage *int `json:"prev-page"`
	NextPage     *int `json:"next-page"`
	TotalPages   int  `json:"total-pages"`
	TotalCount   int  `json:"total-count"`
}

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

type TeamToken added in v0.1.15

type TeamToken struct {
	ID          resource.TfeID `jsonapi:"primary,authentication-tokens"`
	CreatedAt   time.Time      `jsonapi:"attribute" json:"created-at"`
	Description string         `jsonapi:"attribute" json:"description"`
	LastUsedAt  time.Time      `jsonapi:"attribute" json:"last-used-at"`
	Token       string         `jsonapi:"attribute" json:"token"`
	ExpiredAt   *time.Time     `jsonapi:"attribute" json:"expired-at"`
}

TeamToken represents a Terraform Enterprise team token.

type TeamTokenCreateOptions added in v0.1.15

type TeamTokenCreateOptions struct {
	// Optional: The token's expiration date.
	// This feature is available in TFE release v202305-1 and later
	ExpiredAt *time.Time `jsonapi:"attribute" json:"expired-at,omitempty"`
}

TeamTokenCreateOptions contains the options for creating a team token.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL