shared

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CostQuote

type CostQuote struct {
	// Currency the quote is denominated in. Always "USD" in v1.
	Currency string `json:"currency" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyTotal string `json:"monthly_total" api:"required" format:"decimal"`
	// Timestamp the quote was priced at.
	PricedAt time.Time `json:"priced_at" api:"required" format:"date-time"`
	// Priced rows, one per usage dimension emitted by the resource.
	UsageDimensions []CostQuoteUsageDimension `json:"usage_dimensions" api:"required"`
	// Forward-looking billing summary for an organization. All costs are run-rate
	// projections from the organization's current active usage ("≈ $X/mo at current
	// usage").
	CurrentSummary OrganizationBillingSummary `json:"current_summary"`
	// Forward-looking billing summary for an organization. All costs are run-rate
	// projections from the organization's current active usage ("≈ $X/mo at current
	// usage").
	UpdatedSummary OrganizationBillingSummary `json:"updated_summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency        respjson.Field
		MonthlyTotal    respjson.Field
		PricedAt        respjson.Field
		UsageDimensions respjson.Field
		CurrentSummary  respjson.Field
		UpdatedSummary  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cost quote returned by POST /cost. current_summary and updated_summary hold the org billing summary now and with this resource; omitted when the caller cannot view billing.

func (CostQuote) RawJSON

func (r CostQuote) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuote) UnmarshalJSON

func (r *CostQuote) UnmarshalJSON(data []byte) error

type CostQuoteUpdate

type CostQuoteUpdate struct {
	// Quote for the proposed (post-update) resource state.
	After CostQuoteUpdateAfter `json:"after" api:"required"`
	// Quote for the proposed (post-update) resource state.
	Before CostQuoteUpdateBefore `json:"before" api:"required"`
	// Currency the quote is denominated in. Always "USD" in v1.
	Currency string `json:"currency" api:"required"`
	// Per-dimension and total deltas: after minus before.
	Diff CostQuoteUpdateDiff `json:"diff" api:"required"`
	// Timestamp the quote was priced at.
	PricedAt time.Time `json:"priced_at" api:"required" format:"date-time"`
	// Forward-looking billing summary for an organization. All costs are run-rate
	// projections from the organization's current active usage ("≈ $X/mo at current
	// usage").
	CurrentSummary OrganizationBillingSummary `json:"current_summary"`
	// Forward-looking billing summary for an organization. All costs are run-rate
	// projections from the organization's current active usage ("≈ $X/mo at current
	// usage").
	UpdatedSummary OrganizationBillingSummary `json:"updated_summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After          respjson.Field
		Before         respjson.Field
		Currency       respjson.Field
		Diff           respjson.Field
		PricedAt       respjson.Field
		CurrentSummary respjson.Field
		UpdatedSummary respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cost quote returned by PATCH /:id/cost: current-state quote, post-update quote, and signed diff. current_summary and updated_summary omitted when the caller cannot view billing.

func (CostQuoteUpdate) RawJSON

func (r CostQuoteUpdate) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuoteUpdate) UnmarshalJSON

func (r *CostQuoteUpdate) UnmarshalJSON(data []byte) error

type CostQuoteUpdateAfter

type CostQuoteUpdateAfter struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyTotal string `json:"monthly_total" api:"required" format:"decimal"`
	// Priced rows, one per usage dimension emitted by the resource.
	UsageDimensions []CostQuoteUpdateAfterUsageDimension `json:"usage_dimensions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonthlyTotal    respjson.Field
		UsageDimensions respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Quote for the proposed (post-update) resource state.

func (CostQuoteUpdateAfter) RawJSON

func (r CostQuoteUpdateAfter) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateAfter) UnmarshalJSON

func (r *CostQuoteUpdateAfter) UnmarshalJSON(data []byte) error

type CostQuoteUpdateAfterUsageDimension

type CostQuoteUpdateAfterUsageDimension struct {
	// Usage dimension being priced (e.g. compute_vcpu, storage_abs_gb).
	Dimension string `json:"dimension" api:"required"`
	// User-facing label for the dimension (e.g. "vCPU (hours)").
	DimensionDisplayName string `json:"dimension_display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmount string `json:"monthly_amount" api:"required" format:"decimal"`
	// Quantity of the dimension being priced.
	Quantity int64 `json:"quantity" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dimension            respjson.Field
		DimensionDisplayName respjson.Field
		MonthlyAmount        respjson.Field
		Quantity             respjson.Field
		UnitPrice            respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Priced row for a single usage dimension emitted by a resource.

func (CostQuoteUpdateAfterUsageDimension) RawJSON

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateAfterUsageDimension) UnmarshalJSON

func (r *CostQuoteUpdateAfterUsageDimension) UnmarshalJSON(data []byte) error

type CostQuoteUpdateBefore

type CostQuoteUpdateBefore struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyTotal string `json:"monthly_total" api:"required" format:"decimal"`
	// Priced rows, one per usage dimension emitted by the resource.
	UsageDimensions []CostQuoteUpdateBeforeUsageDimension `json:"usage_dimensions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonthlyTotal    respjson.Field
		UsageDimensions respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Quote for the proposed (post-update) resource state.

func (CostQuoteUpdateBefore) RawJSON

func (r CostQuoteUpdateBefore) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateBefore) UnmarshalJSON

func (r *CostQuoteUpdateBefore) UnmarshalJSON(data []byte) error

type CostQuoteUpdateBeforeUsageDimension

type CostQuoteUpdateBeforeUsageDimension struct {
	// Usage dimension being priced (e.g. compute_vcpu, storage_abs_gb).
	Dimension string `json:"dimension" api:"required"`
	// User-facing label for the dimension (e.g. "vCPU (hours)").
	DimensionDisplayName string `json:"dimension_display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmount string `json:"monthly_amount" api:"required" format:"decimal"`
	// Quantity of the dimension being priced.
	Quantity int64 `json:"quantity" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dimension            respjson.Field
		DimensionDisplayName respjson.Field
		MonthlyAmount        respjson.Field
		Quantity             respjson.Field
		UnitPrice            respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Priced row for a single usage dimension emitted by a resource.

func (CostQuoteUpdateBeforeUsageDimension) RawJSON

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateBeforeUsageDimension) UnmarshalJSON

func (r *CostQuoteUpdateBeforeUsageDimension) UnmarshalJSON(data []byte) error

type CostQuoteUpdateDiff

type CostQuoteUpdateDiff struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyTotalDelta string `json:"monthly_total_delta" api:"required" format:"decimal"`
	// Per-dimension diff entries. Includes every dimension touched by the update.
	UsageDimensions []CostQuoteUpdateDiffUsageDimension `json:"usage_dimensions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonthlyTotalDelta respjson.Field
		UsageDimensions   respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Per-dimension and total deltas: after minus before.

func (CostQuoteUpdateDiff) RawJSON

func (r CostQuoteUpdateDiff) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateDiff) UnmarshalJSON

func (r *CostQuoteUpdateDiff) UnmarshalJSON(data []byte) error

type CostQuoteUpdateDiffUsageDimension

type CostQuoteUpdateDiffUsageDimension struct {
	// Priced row after the update. Always present.
	After CostQuoteUpdateDiffUsageDimensionAfter `json:"after" api:"required"`
	// Priced row after the update. Always present.
	Before CostQuoteUpdateDiffUsageDimensionBefore `json:"before" api:"required"`
	// Usage dimension being priced (e.g. compute_vcpu, storage_abs_gb).
	Dimension string `json:"dimension" api:"required"`
	// User-facing label for the dimension (e.g. "vCPU (hours)").
	DimensionDisplayName string `json:"dimension_display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmountDelta string `json:"monthly_amount_delta" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After                respjson.Field
		Before               respjson.Field
		Dimension            respjson.Field
		DimensionDisplayName respjson.Field
		MonthlyAmountDelta   respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Per-dimension diff entry. Both before and after are always present.

func (CostQuoteUpdateDiffUsageDimension) RawJSON

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateDiffUsageDimension) UnmarshalJSON

func (r *CostQuoteUpdateDiffUsageDimension) UnmarshalJSON(data []byte) error

type CostQuoteUpdateDiffUsageDimensionAfter

type CostQuoteUpdateDiffUsageDimensionAfter struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmount string `json:"monthly_amount" api:"required" format:"decimal"`
	Quantity      int64  `json:"quantity" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonthlyAmount respjson.Field
		Quantity      respjson.Field
		UnitPrice     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Priced row after the update. Always present.

func (CostQuoteUpdateDiffUsageDimensionAfter) RawJSON

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateDiffUsageDimensionAfter) UnmarshalJSON

func (r *CostQuoteUpdateDiffUsageDimensionAfter) UnmarshalJSON(data []byte) error

type CostQuoteUpdateDiffUsageDimensionBefore

type CostQuoteUpdateDiffUsageDimensionBefore struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmount string `json:"monthly_amount" api:"required" format:"decimal"`
	Quantity      int64  `json:"quantity" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonthlyAmount respjson.Field
		Quantity      respjson.Field
		UnitPrice     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Priced row after the update. Always present.

func (CostQuoteUpdateDiffUsageDimensionBefore) RawJSON

Returns the unmodified JSON received from the API

func (*CostQuoteUpdateDiffUsageDimensionBefore) UnmarshalJSON

func (r *CostQuoteUpdateDiffUsageDimensionBefore) UnmarshalJSON(data []byte) error

type CostQuoteUsageDimension

type CostQuoteUsageDimension struct {
	// Usage dimension being priced (e.g. compute_vcpu, storage_abs_gb).
	Dimension string `json:"dimension" api:"required"`
	// User-facing label for the dimension (e.g. "vCPU (hours)").
	DimensionDisplayName string `json:"dimension_display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyAmount string `json:"monthly_amount" api:"required" format:"decimal"`
	// Quantity of the dimension being priced.
	Quantity int64 `json:"quantity" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dimension            respjson.Field
		DimensionDisplayName respjson.Field
		MonthlyAmount        respjson.Field
		Quantity             respjson.Field
		UnitPrice            respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Priced row for a single usage dimension emitted by a resource.

func (CostQuoteUsageDimension) RawJSON

func (r CostQuoteUsageDimension) RawJSON() string

Returns the unmodified JSON received from the API

func (*CostQuoteUsageDimension) UnmarshalJSON

func (r *CostQuoteUsageDimension) UnmarshalJSON(data []byte) error

type OrganizationBillingSummary

type OrganizationBillingSummary struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	DailyCost string `json:"daily_cost" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	EffectiveBalance string `json:"effective_balance" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyCost string `json:"monthly_cost" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	RechargeThresholdDays string `json:"recharge_threshold_days" api:"required" format:"decimal"`
	// Projected date the balance reaches the recharge threshold at the current
	// run-rate. Null when there is no active usage (never charges).
	EstimatedNextChargeAt time.Time `json:"estimated_next_charge_at" api:"nullable" format:"date-time"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	RunwayMonths string `json:"runway_months" api:"nullable" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DailyCost             respjson.Field
		EffectiveBalance      respjson.Field
		MonthlyCost           respjson.Field
		RechargeThresholdDays respjson.Field
		EstimatedNextChargeAt respjson.Field
		RunwayMonths          respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Forward-looking billing summary for an organization. All costs are run-rate projections from the organization's current active usage ("≈ $X/mo at current usage").

func (OrganizationBillingSummary) RawJSON

func (r OrganizationBillingSummary) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationBillingSummary) UnmarshalJSON

func (r *OrganizationBillingSummary) UnmarshalJSON(data []byte) error

type Pagination

type Pagination struct {
	NextCursor     string `json:"next_cursor" api:"required"`
	PreviousCursor string `json:"previous_cursor" api:"required"`
	TotalCount     int64  `json:"total_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NextCursor     respjson.Field
		PreviousCursor respjson.Field
		TotalCount     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pagination response details.

func (Pagination) RawJSON

func (r Pagination) RawJSON() string

Returns the unmodified JSON received from the API

func (*Pagination) UnmarshalJSON

func (r *Pagination) UnmarshalJSON(data []byte) error

type RegionName

type RegionName string

Region the resource is in.

const (
	RegionNameUsSva2 RegionName = "us-sva-2"
	RegionNameUsWdc1 RegionName = "us-wdc-1"
)

type ResourceStatus

type ResourceStatus string

Status of the resource.

const (
	ResourceStatusPending  ResourceStatus = "pending"
	ResourceStatusCreating ResourceStatus = "creating"
	ResourceStatusUpdating ResourceStatus = "updating"
	ResourceStatusReady    ResourceStatus = "ready"
	ResourceStatusDeleting ResourceStatus = "deleting"
	ResourceStatusDeleted  ResourceStatus = "deleted"
	ResourceStatusError    ResourceStatus = "error"
)

type SourceIPRuleParam

type SourceIPRuleParam struct {
	// List of IPv4 CIDR addresses to allow.
	Allowed []string `json:"allowed,omitzero"`
	// List of IPv4 CIDR addresses to deny.
	Blocked []string `json:"blocked,omitzero"`
	// contains filtered or unexported fields
}

IP filter rules.

func (SourceIPRuleParam) MarshalJSON

func (r SourceIPRuleParam) MarshalJSON() (data []byte, err error)

func (*SourceIPRuleParam) UnmarshalJSON

func (r *SourceIPRuleParam) UnmarshalJSON(data []byte) error

type SourceIPRuleResponse

type SourceIPRuleResponse struct {
	// List of IPv4 CIDR addresses to allow.
	Allowed []string `json:"allowed" api:"required"`
	// List of IPv4 CIDR addresses to deny.
	Blocked []string `json:"blocked" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Allowed     respjson.Field
		Blocked     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

IP filter rules.

func (SourceIPRuleResponse) RawJSON

func (r SourceIPRuleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SourceIPRuleResponse) UnmarshalJSON

func (r *SourceIPRuleResponse) UnmarshalJSON(data []byte) error

type VMMetricUnit

type VMMetricUnit string

Unit the values are expressed in.

const (
	VMMetricUnitRatio               VMMetricUnit = "ratio"
	VMMetricUnitBytes               VMMetricUnit = "bytes"
	VMMetricUnitCores               VMMetricUnit = "cores"
	VMMetricUnitBytesPerSecond      VMMetricUnit = "bytes_per_second"
	VMMetricUnitOperationsPerSecond VMMetricUnit = "operations_per_second"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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