organizations

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 17 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

View Source
const RegionNameUsSva2 = shared.RegionNameUsSva2

Equals "us-sva-2"

View Source
const ResourceStatusCreating = shared.ResourceStatusCreating

Equals "creating"

View Source
const ResourceStatusDeleted = shared.ResourceStatusDeleted

Equals "deleted"

View Source
const ResourceStatusDeleting = shared.ResourceStatusDeleting

Equals "deleting"

View Source
const ResourceStatusError = shared.ResourceStatusError

Equals "error"

View Source
const ResourceStatusPending = shared.ResourceStatusPending

Equals "pending"

View Source
const ResourceStatusReady = shared.ResourceStatusReady

Equals "ready"

View Source
const ResourceStatusUpdating = shared.ResourceStatusUpdating

Equals "updating"

View Source
const VMMetricUnitBytes = shared.VMMetricUnitBytes

Equals "bytes"

View Source
const VMMetricUnitBytesPerSecond = shared.VMMetricUnitBytesPerSecond

Equals "bytes_per_second"

View Source
const VMMetricUnitCores = shared.VMMetricUnitCores

Equals "cores"

View Source
const VMMetricUnitOperationsPerSecond = shared.VMMetricUnitOperationsPerSecond

Equals "operations_per_second"

View Source
const VMMetricUnitRatio = shared.VMMetricUnitRatio

Equals "ratio"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressNewParams

type AddressNewParams struct {
	// City or locality.
	City string `json:"city" api:"required"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country string `json:"country" api:"required"`
	// First line of the street address.
	Line1 string `json:"line1" api:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" api:"required"`
	// Second line of the street address (suite, unit, building).
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// State, province, or region. Required by some tax jurisdictions (e.g. US, CA).
	State param.Opt[string] `json:"state,omitzero"`
	// Tax identification number (e.g. VAT, EIN, ABN). Optional.
	TaxID param.Opt[string] `json:"tax_id,omitzero"`
	// Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).
	// Optional.
	TaxIDType param.Opt[string] `json:"tax_id_type,omitzero"`
	// contains filtered or unexported fields
}

func (AddressNewParams) MarshalJSON

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

func (*AddressNewParams) UnmarshalJSON

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

type AddressService

type AddressService struct {
	Options []option.RequestOption
}

AddressService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAddressService method instead.

func NewAddressService

func NewAddressService(opts ...option.RequestOption) (r AddressService)

NewAddressService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AddressService) Get

func (r *AddressService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Get the address for an organization

func (*AddressService) New

func (r *AddressService) New(ctx context.Context, organizationID string, body AddressNewParams, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Create the address for an organization

func (*AddressService) Update

func (r *AddressService) Update(ctx context.Context, organizationID string, body AddressUpdateParams, opts ...option.RequestOption) (res *OrganizationAddress, err error)

Update the address for an organization

type AddressUpdateParams

type AddressUpdateParams struct {
	// Second line of the street address (suite, unit, building). Omit to leave
	// unchanged, send null to clear, or send a value to set it.
	Line2 param.Opt[string] `json:"line2,omitzero"`
	// State, province, or region. Omit to leave unchanged, send null to clear, or send
	// a value to set it.
	State param.Opt[string] `json:"state,omitzero"`
	// Tax identification number (e.g. VAT, EIN, ABN). Omit to leave unchanged, send
	// null to clear, or send a value to set it.
	TaxID param.Opt[string] `json:"tax_id,omitzero"`
	// Type of the tax identification number (e.g. eu_vat, us_ein, gb_vat, au_abn).
	// Omit to leave unchanged, send null to clear, or send a value to set it.
	TaxIDType param.Opt[string] `json:"tax_id_type,omitzero"`
	// City or locality.
	City param.Opt[string] `json:"city,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country param.Opt[string] `json:"country,omitzero"`
	// First line of the street address.
	Line1 param.Opt[string] `json:"line1,omitzero"`
	// Postal or ZIP code.
	PostalCode param.Opt[string] `json:"postal_code,omitzero"`
	// contains filtered or unexported fields
}

func (AddressUpdateParams) MarshalJSON

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

func (*AddressUpdateParams) UnmarshalJSON

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

type AutomaticPolicyArgs

type AutomaticPolicyArgs struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Fixed string `json:"fixed" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	RunwayDays string `json:"runway_days" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyCap string `json:"monthly_cap" api:"nullable" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Fixed       respjson.Field
		RunwayDays  respjson.Field
		MonthlyCap  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

PolicyArgs carries the threshold parameters. Required when policy is "automatic"; must be omitted when policy is "manual".

func (AutomaticPolicyArgs) RawJSON

func (r AutomaticPolicyArgs) RawJSON() string

Returns the unmodified JSON received from the API

func (AutomaticPolicyArgs) ToParam

ToParam converts this AutomaticPolicyArgs to a AutomaticPolicyArgsParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with AutomaticPolicyArgsParam.Overrides()

func (*AutomaticPolicyArgs) UnmarshalJSON

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

type AutomaticPolicyArgsParam

type AutomaticPolicyArgsParam struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Fixed string `json:"fixed" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	RunwayDays string `json:"runway_days" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	MonthlyCap param.Opt[string] `json:"monthly_cap,omitzero" format:"decimal"`
	// contains filtered or unexported fields
}

PolicyArgs carries the threshold parameters. Required when policy is "automatic"; must be omitted when policy is "manual".

The properties Fixed, RunwayDays are required.

func (AutomaticPolicyArgsParam) MarshalJSON

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

func (*AutomaticPolicyArgsParam) UnmarshalJSON

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

type BillingCostParams

type BillingCostParams struct {
	// Inclusive start day, YYYY-MM-DD (UTC). Defaults to 30 days before to.
	From param.Opt[time.Time] `query:"from,omitzero" format:"date" json:"-"`
	// Inclusive end day, YYYY-MM-DD (UTC). Defaults to today.
	To param.Opt[time.Time] `query:"to,omitzero" format:"date" json:"-"`
	// contains filtered or unexported fields
}

func (BillingCostParams) URLQuery

func (r BillingCostParams) URLQuery() (v url.Values, err error)

URLQuery serializes BillingCostParams's query parameters as `url.Values`.

type BillingHistoryEntry

type BillingHistoryEntry struct {
	// Unique identifier for the entry.
	ID string `json:"id" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Amount string `json:"amount" api:"required" format:"decimal"`
	// When the entry was recorded.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// ISO 4217 currency code.
	Currency string `json:"currency" api:"required"`
	// Kind of entry.
	//
	// Any of "grant", "adjustment".
	Type BillingHistoryEntryType `json:"type" api:"required"`
	// Human-readable note describing the entry, when available.
	Description string `json:"description" api:"nullable"`
	// Why this entry exists: for a grant, the funding flow ("first_charge",
	// "auto_recharge", "manual_top_up", "manual_recharge") or "bonus_grant" for credit
	// issued with no payment behind it; for an adjustment, the reason the balance was
	// reduced ("refund", "dispute", "bonus_void" for issued credit withdrawn,
	// "bonus_expiry" for credit that lapsed unspent). Null for adjustments with no
	// recorded reason.
	//
	// Any of "first_charge", "auto_recharge", "manual_top_up", "manual_recharge",
	// "bonus_grant", "bonus_void", "bonus_expiry", "refund", "dispute".
	Purpose BillingHistoryEntryPurpose `json:"purpose" api:"nullable"`
	// Link to the hosted receipt for the payment behind this entry, when one is
	// available. Present for prepaid credits funded by a card charge; absent for
	// manual adjustments and while a payment's receipt is still being finalized.
	ReceiptURL string `json:"receipt_url" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Amount      respjson.Field
		CreatedAt   respjson.Field
		Currency    respjson.Field
		Type        respjson.Field
		Description respjson.Field
		Purpose     respjson.Field
		ReceiptURL  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single billing history line item: a prepaid credit or a manual adjustment.

func (BillingHistoryEntry) RawJSON

func (r BillingHistoryEntry) RawJSON() string

Returns the unmodified JSON received from the API

func (*BillingHistoryEntry) UnmarshalJSON

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

type BillingHistoryEntryList

type BillingHistoryEntryList struct {
	Items []BillingHistoryEntry `json:"items" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BillingHistoryEntryList) RawJSON

func (r BillingHistoryEntryList) RawJSON() string

Returns the unmodified JSON received from the API

func (*BillingHistoryEntryList) UnmarshalJSON

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

type BillingHistoryEntryPurpose

type BillingHistoryEntryPurpose string

Why this entry exists: for a grant, the funding flow ("first_charge", "auto_recharge", "manual_top_up", "manual_recharge") or "bonus_grant" for credit issued with no payment behind it; for an adjustment, the reason the balance was reduced ("refund", "dispute", "bonus_void" for issued credit withdrawn, "bonus_expiry" for credit that lapsed unspent). Null for adjustments with no recorded reason.

const (
	BillingHistoryEntryPurposeFirstCharge    BillingHistoryEntryPurpose = "first_charge"
	BillingHistoryEntryPurposeAutoRecharge   BillingHistoryEntryPurpose = "auto_recharge"
	BillingHistoryEntryPurposeManualTopUp    BillingHistoryEntryPurpose = "manual_top_up"
	BillingHistoryEntryPurposeManualRecharge BillingHistoryEntryPurpose = "manual_recharge"
	BillingHistoryEntryPurposeBonusGrant     BillingHistoryEntryPurpose = "bonus_grant"
	BillingHistoryEntryPurposeBonusVoid      BillingHistoryEntryPurpose = "bonus_void"
	BillingHistoryEntryPurposeBonusExpiry    BillingHistoryEntryPurpose = "bonus_expiry"
	BillingHistoryEntryPurposeRefund         BillingHistoryEntryPurpose = "refund"
	BillingHistoryEntryPurposeDispute        BillingHistoryEntryPurpose = "dispute"
)

type BillingHistoryEntryType

type BillingHistoryEntryType string

Kind of entry.

const (
	BillingHistoryEntryTypeGrant      BillingHistoryEntryType = "grant"
	BillingHistoryEntryTypeAdjustment BillingHistoryEntryType = "adjustment"
)

type BillingHistoryParams

type BillingHistoryParams struct {
	// Only entries at or before this RFC 3339 instant
	CreatedAtMax param.Opt[time.Time] `query:"created_at_max,omitzero" format:"date-time" json:"-"`
	// Only entries at or after this RFC 3339 instant
	CreatedAtMin param.Opt[time.Time] `query:"created_at_min,omitzero" format:"date-time" json:"-"`
	// Filter by currency, as an ISO 4217 code. Case-insensitive.
	Currency param.Opt[string] `query:"currency,omitzero" json:"-"`
	// Pagination cursor returned by a previous request. Only valid for the same
	// filters and sort order.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by the funding flow a credit came from
	Purpose param.Opt[string] `query:"purpose,omitzero" json:"-"`
	// Comma-separated sort terms in precedence order, each field:asc or field:desc.
	// Fields: created_at, amount
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by entry type
	Type param.Opt[string] `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BillingHistoryParams) URLQuery

func (r BillingHistoryParams) URLQuery() (v url.Values, err error)

URLQuery serializes BillingHistoryParams's query parameters as `url.Values`.

type BillingRechargeParams

type BillingRechargeParams struct {
	IdempotencyKey string `header:"Idempotency-Key" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type BillingRechargePolicyService

type BillingRechargePolicyService struct {
	Options []option.RequestOption
}

BillingRechargePolicyService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBillingRechargePolicyService method instead.

func NewBillingRechargePolicyService

func NewBillingRechargePolicyService(opts ...option.RequestOption) (r BillingRechargePolicyService)

NewBillingRechargePolicyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BillingRechargePolicyService) Get

Get the organization's recharge configuration: the top-up mode, the fixed and proportional threshold components, and when the current mode took effect.

func (*BillingRechargePolicyService) Update

Update the organization's recharge mode: manual for self-serve top-ups, or automatic to charge the card on file at the recharge threshold (fixed and proportional required).

type BillingRechargePolicyUpdateParams

type BillingRechargePolicyUpdateParams struct {
	// Policy is the top-up mode.
	//
	// Any of "manual", "automatic".
	Policy RechargePolicyMode `json:"policy,omitzero" api:"required"`
	// PolicyArgs carries the threshold parameters. Required when policy is
	// "automatic"; must be omitted when policy is "manual".
	PolicyArgs AutomaticPolicyArgsParam `json:"policy_args,omitzero"`
	// contains filtered or unexported fields
}

func (BillingRechargePolicyUpdateParams) MarshalJSON

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

func (*BillingRechargePolicyUpdateParams) UnmarshalJSON

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

type BillingService

type BillingService struct {
	Options        []option.RequestOption
	RechargePolicy BillingRechargePolicyService
}

BillingService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBillingService method instead.

func NewBillingService

func NewBillingService(opts ...option.RequestOption) (r BillingService)

NewBillingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BillingService) Cost

func (r *BillingService) Cost(ctx context.Context, organizationID string, query BillingCostParams, opts ...option.RequestOption) (res *OrganizationDailyCost, err error)

Get the organization's total usage cost per UTC day over a date range (max 90 days), summing open and closed resources. One entry per day, oldest first. Defaults to the last 30 days.

func (*BillingService) History

func (r *BillingService) History(ctx context.Context, organizationID string, query BillingHistoryParams, opts ...option.RequestOption) (res *BillingHistoryEntryList, err error)

List the organization's billing history: prepaid credits, top-ups, and manual adjustments, newest first. Paginated with an opaque cursor.

func (*BillingService) Recharge

func (r *BillingService) Recharge(ctx context.Context, organizationID string, body BillingRechargeParams, opts ...option.RequestOption) (res *shared.OrganizationBillingSummary, err error)

Charge the card on file up to the recharge target now instead of waiting for the scheduled retry. Automatic-policy prepaid organizations only. Idempotency-Key header required.

func (*BillingService) Statements

func (r *BillingService) Statements(ctx context.Context, organizationID string, query BillingStatementsParams, opts ...option.RequestOption) (res *OrganizationUsageStatement, err error)

Get the itemized monthly usage statement: consumption grouped by project, resource type, and dimension, priced from recorded usage. Defaults to the current month.

func (*BillingService) Summary

func (r *BillingService) Summary(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *shared.OrganizationBillingSummary, err error)

Get the organization's billing summary: effective balance, monthly and daily run-rate cost, runway, and the projected next-recharge date. Costs are run-rate projections.

func (*BillingService) TopUp

func (r *BillingService) TopUp(ctx context.Context, organizationID string, params BillingTopUpParams, opts ...option.RequestOption) (res *shared.OrganizationBillingSummary, err error)

Charge the card on file and credit the prepaid balance. An Idempotency-Key header is required. Reuse the same key when retrying, so a top-up that timed out isn't charged twice.

type BillingStatementsParams

type BillingStatementsParams struct {
	// Billing month, YYYY-MM (UTC). Defaults to the current month.
	Month param.Opt[string] `query:"month,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BillingStatementsParams) URLQuery

func (r BillingStatementsParams) URLQuery() (v url.Values, err error)

URLQuery serializes BillingStatementsParams's query parameters as `url.Values`.

type BillingTopUpParams

type BillingTopUpParams struct {
	// Amount to charge and credit, in USD. Must be at least 1.00, at most two decimal
	// places, and at most 10000.
	Amount         string `json:"amount" api:"required" format:"decimal"`
	IdempotencyKey string `header:"Idempotency-Key" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (BillingTopUpParams) MarshalJSON

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

func (*BillingTopUpParams) UnmarshalJSON

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

type CostQuote

type CostQuote = shared.CostQuote

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.

This is an alias to an internal type.

type CostQuoteUpdate

type CostQuoteUpdate = shared.CostQuoteUpdate

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.

This is an alias to an internal type.

type CostQuoteUpdateAfter

type CostQuoteUpdateAfter = shared.CostQuoteUpdateAfter

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

This is an alias to an internal type.

type CostQuoteUpdateAfterUsageDimension

type CostQuoteUpdateAfterUsageDimension = shared.CostQuoteUpdateAfterUsageDimension

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

This is an alias to an internal type.

type CostQuoteUpdateBefore

type CostQuoteUpdateBefore = shared.CostQuoteUpdateBefore

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

This is an alias to an internal type.

type CostQuoteUpdateBeforeUsageDimension

type CostQuoteUpdateBeforeUsageDimension = shared.CostQuoteUpdateBeforeUsageDimension

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

This is an alias to an internal type.

type CostQuoteUpdateDiff

type CostQuoteUpdateDiff = shared.CostQuoteUpdateDiff

Per-dimension and total deltas: after minus before.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimension

type CostQuoteUpdateDiffUsageDimension = shared.CostQuoteUpdateDiffUsageDimension

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

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimensionAfter

type CostQuoteUpdateDiffUsageDimensionAfter = shared.CostQuoteUpdateDiffUsageDimensionAfter

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUpdateDiffUsageDimensionBefore

type CostQuoteUpdateDiffUsageDimensionBefore = shared.CostQuoteUpdateDiffUsageDimensionBefore

Priced row after the update. Always present.

This is an alias to an internal type.

type CostQuoteUsageDimension

type CostQuoteUsageDimension = shared.CostQuoteUsageDimension

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

This is an alias to an internal type.

type DailyCostPoint

type DailyCostPoint struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Cost string `json:"cost" api:"required" format:"decimal"`
	// UTC calendar day (YYYY-MM-DD).
	Date string `json:"date" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cost        respjson.Field
		Date        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Total usage cost for a single UTC day.

func (DailyCostPoint) RawJSON

func (r DailyCostPoint) RawJSON() string

Returns the unmodified JSON received from the API

func (*DailyCostPoint) UnmarshalJSON

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

type Error

type Error = apierror.Error

type MembershipInvitationNewParams added in v2.2.0

type MembershipInvitationNewParams struct {
	// Email address to invite. Inviting an address that already belongs to a member of
	// the organization fails.
	Email string `json:"email" api:"required"`
	// Role of the user in the organization.
	//
	// Any of "owner", "admin", "billing", "member".
	Role MembershipInvitationNewParamsRole `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (MembershipInvitationNewParams) MarshalJSON added in v2.2.0

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

func (*MembershipInvitationNewParams) UnmarshalJSON added in v2.2.0

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

type MembershipInvitationNewParamsRole added in v2.2.0

type MembershipInvitationNewParamsRole string

Role of the user in the organization.

const (
	MembershipInvitationNewParamsRoleOwner   MembershipInvitationNewParamsRole = "owner"
	MembershipInvitationNewParamsRoleAdmin   MembershipInvitationNewParamsRole = "admin"
	MembershipInvitationNewParamsRoleBilling MembershipInvitationNewParamsRole = "billing"
	MembershipInvitationNewParamsRoleMember  MembershipInvitationNewParamsRole = "member"
)

type MembershipInvitationService added in v2.2.0

type MembershipInvitationService struct {
	Options []option.RequestOption
}

MembershipInvitationService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMembershipInvitationService method instead.

func NewMembershipInvitationService added in v2.2.0

func NewMembershipInvitationService(opts ...option.RequestOption) (r MembershipInvitationService)

NewMembershipInvitationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MembershipInvitationService) Delete added in v2.2.0

func (r *MembershipInvitationService) Delete(ctx context.Context, organizationID string, invitationID string, opts ...option.RequestOption) (err error)

Revoke a pending invitation so it can no longer be accepted. Owners may revoke any invitation; admins may revoke invitations with the admin, billing or member role.

func (*MembershipInvitationService) List added in v2.2.0

func (r *MembershipInvitationService) List(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationInvitationList, err error)

List the invitations to an organization that are still pending: not yet accepted, revoked or expired. Only owners and admins may list invitations.

func (*MembershipInvitationService) New added in v2.2.0

Invite an email address to join an organization with a role. The membership is created when the invitee accepts. Owners may invite with any role; admins may invite with admin, billing or member.

func (*MembershipInvitationService) Resend added in v2.2.0

func (r *MembershipInvitationService) Resend(ctx context.Context, organizationID string, invitationID string, opts ...option.RequestOption) (res *OrganizationInvitation, err error)

Send a pending invitation's email again. Owners may resend any invitation; admins may resend invitations with the admin, billing or member role.

type MembershipListParams

type MembershipListParams struct {
	// Pagination cursor returned by a previous request. Only valid for the same
	// filters and sort order.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Comma-separated sort terms in precedence order, each field:asc or field:desc.
	// Fields: created_at, updated_at, role
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by the member's user ID
	UserID param.Opt[string] `query:"user_id,omitzero" json:"-"`
	// Filter by membership role
	//
	// Any of "owner", "admin", "billing", "member".
	Role MembershipListParamsRole `query:"role,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MembershipListParams) URLQuery

func (r MembershipListParams) URLQuery() (v url.Values, err error)

URLQuery serializes MembershipListParams's query parameters as `url.Values`.

type MembershipListParamsRole

type MembershipListParamsRole string

Filter by membership role

const (
	MembershipListParamsRoleOwner   MembershipListParamsRole = "owner"
	MembershipListParamsRoleAdmin   MembershipListParamsRole = "admin"
	MembershipListParamsRoleBilling MembershipListParamsRole = "billing"
	MembershipListParamsRoleMember  MembershipListParamsRole = "member"
)

type MembershipService

type MembershipService struct {
	Options     []option.RequestOption
	Invitations MembershipInvitationService
}

MembershipService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMembershipService method instead.

func NewMembershipService

func NewMembershipService(opts ...option.RequestOption) (r MembershipService)

NewMembershipService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MembershipService) Delete added in v2.2.0

func (r *MembershipService) Delete(ctx context.Context, organizationID string, membershipID string, opts ...option.RequestOption) (err error)

Remove a member from an organization. Admins cannot remove an owner, and the last owner cannot be removed.

func (*MembershipService) Get

func (r *MembershipService) Get(ctx context.Context, organizationID string, membershipID string, opts ...option.RequestOption) (res *OrganizationMembership, err error)

Get details about an organization membership

func (*MembershipService) List

List all memberships for an organization

func (*MembershipService) ListAutoPaging

List all memberships for an organization

func (*MembershipService) Update added in v2.2.0

func (r *MembershipService) Update(ctx context.Context, organizationID string, membershipID string, body MembershipUpdateParams, opts ...option.RequestOption) (res *OrganizationMembership, err error)

Change the role of a member of an organization. Owners may assign any role. Admins may assign admin, billing or member, and cannot change the role of an owner. The last owner cannot be demoted, and members cannot change their own role except for an owner stepping down while another owner remains.

type MembershipUpdateParams added in v2.2.0

type MembershipUpdateParams struct {
	// Role of the user in the organization.
	//
	// Any of "owner", "admin", "billing", "member".
	Role MembershipUpdateParamsRole `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (MembershipUpdateParams) MarshalJSON added in v2.2.0

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

func (*MembershipUpdateParams) UnmarshalJSON added in v2.2.0

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

type MembershipUpdateParamsRole added in v2.2.0

type MembershipUpdateParamsRole string

Role of the user in the organization.

const (
	MembershipUpdateParamsRoleOwner   MembershipUpdateParamsRole = "owner"
	MembershipUpdateParamsRoleAdmin   MembershipUpdateParamsRole = "admin"
	MembershipUpdateParamsRoleBilling MembershipUpdateParamsRole = "billing"
	MembershipUpdateParamsRoleMember  MembershipUpdateParamsRole = "member"
)

type Organization

type Organization struct {
	// Organization ID.
	ID string `json:"id" api:"required"`
	// Billing email. Null when no custom billing email is set (reverts to the oldest
	// owner's email).
	BillingEmail string `json:"billing_email" api:"required"`
	// Organization billing lifecycle state.
	//
	// Any of "unfunded", "active", "requires_action", "suspended", "closed".
	BillingState OrganizationBillingState `json:"billing_state" api:"required"`
	// When the organization entered its current billing state.
	BillingStateSince time.Time `json:"billing_state_since" api:"required" format:"date-time"`
	// How the organization is charged for resource usage.
	//
	// Any of "manual", "prepaid".
	ChargingModel OrganizationChargingModel `json:"charging_model" api:"required"`
	// When the Organization was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Domains associated with the organization.
	Domains []OrganizationDomain `json:"domains" api:"required"`
	// Organization name.
	Name string `json:"name" api:"required"`
	// Whether the organization is a personal Organization.
	Personal bool `json:"personal" api:"required"`
	// Services that the Organization has access to.
	Services OrganizationServices `json:"services" api:"required"`
	// Stripe customer ID.
	StripeCustomerID string `json:"stripe_customer_id" api:"required"`
	// Organization type.
	//
	// Any of "personal", "company".
	Type OrganizationType `json:"type" api:"required"`
	// When the Organization was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Authentication provider organization ID.
	AuthID string `json:"auth_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		BillingEmail      respjson.Field
		BillingState      respjson.Field
		BillingStateSince respjson.Field
		ChargingModel     respjson.Field
		CreatedAt         respjson.Field
		Domains           respjson.Field
		Name              respjson.Field
		Personal          respjson.Field
		Services          respjson.Field
		StripeCustomerID  respjson.Field
		Type              respjson.Field
		UpdatedAt         respjson.Field
		AuthID            respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization response.

func (Organization) RawJSON

func (r Organization) RawJSON() string

Returns the unmodified JSON received from the API

func (*Organization) UnmarshalJSON

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

type OrganizationAddress

type OrganizationAddress struct {
	// Address ID.
	ID string `json:"id" api:"required"`
	// City or locality.
	City string `json:"city" api:"required"`
	// Two-letter ISO 3166-1 alpha-2 country code.
	Country string `json:"country" api:"required"`
	// When the address was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// First line of the street address.
	Line1 string `json:"line1" api:"required"`
	// Second line of the street address. Null when not provided.
	Line2 string `json:"line2" api:"required"`
	// Organization ID the address belongs to.
	OrganizationID string `json:"organization_id" api:"required"`
	// Postal or ZIP code.
	PostalCode string `json:"postal_code" api:"required"`
	// State, province, or region. Null when not provided.
	State string `json:"state" api:"required"`
	// Tax identification number. Null when not provided.
	TaxID string `json:"tax_id" api:"required"`
	// Type of the tax identification number. Null when not provided.
	TaxIDType string `json:"tax_id_type" api:"required"`
	// When the address was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		City           respjson.Field
		Country        respjson.Field
		CreatedAt      respjson.Field
		Line1          respjson.Field
		Line2          respjson.Field
		OrganizationID respjson.Field
		PostalCode     respjson.Field
		State          respjson.Field
		TaxID          respjson.Field
		TaxIDType      respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization address details.

func (OrganizationAddress) RawJSON

func (r OrganizationAddress) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationAddress) UnmarshalJSON

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

type OrganizationBillingState

type OrganizationBillingState string

Organization billing lifecycle state.

const (
	OrganizationBillingStateUnfunded       OrganizationBillingState = "unfunded"
	OrganizationBillingStateActive         OrganizationBillingState = "active"
	OrganizationBillingStateRequiresAction OrganizationBillingState = "requires_action"
	OrganizationBillingStateSuspended      OrganizationBillingState = "suspended"
	OrganizationBillingStateClosed         OrganizationBillingState = "closed"
)

type OrganizationBillingSummary

type OrganizationBillingSummary = shared.OrganizationBillingSummary

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").

This is an alias to an internal type.

type OrganizationChargingModel

type OrganizationChargingModel string

How the organization is charged for resource usage.

const (
	OrganizationChargingModelManual  OrganizationChargingModel = "manual"
	OrganizationChargingModelPrepaid OrganizationChargingModel = "prepaid"
)

type OrganizationDailyCost

type OrganizationDailyCost struct {
	// ISO 4217 currency code.
	Currency string `json:"currency" api:"required"`
	// One entry per UTC day in the range, oldest first.
	Days []DailyCostPoint `json:"days" api:"required"`
	// Inclusive start of the range, as a UTC calendar day (YYYY-MM-DD).
	From string `json:"from" api:"required"`
	// Inclusive end of the range, as a UTC calendar day (YYYY-MM-DD).
	To string `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Days        respjson.Field
		From        respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Daily usage cost over a date range: one entry per UTC day (zero on idle days), summing open and closed resources. Suitable for a daily cost bar chart.

func (OrganizationDailyCost) RawJSON

func (r OrganizationDailyCost) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationDailyCost) UnmarshalJSON

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

type OrganizationDomain

type OrganizationDomain struct {
	// Domain ID.
	ID string `json:"id" api:"required"`
	// Domain name.
	Domain string `json:"domain" api:"required"`
	// Whether the domain has been verified.
	Verified bool `json:"verified" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Domain      respjson.Field
		Verified    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization domain details.

func (OrganizationDomain) RawJSON

func (r OrganizationDomain) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationDomain) UnmarshalJSON

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

type OrganizationInvitation added in v2.2.0

type OrganizationInvitation struct {
	// Invitation ID.
	ID string `json:"id" api:"required"`
	// When the invitation was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Email address the invitation was sent to.
	Email string `json:"email" api:"required"`
	// When the invitation expires.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// ID of the user who sent the invitation, or null when the sender is not known.
	InviterUserID string `json:"inviter_user_id" api:"required"`
	// Organization ID.
	OrganizationID string `json:"organization_id" api:"required"`
	// Role of the user in the organization.
	//
	// Any of "owner", "admin", "billing", "member".
	Role OrganizationInvitationRole `json:"role" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		CreatedAt      respjson.Field
		Email          respjson.Field
		ExpiresAt      respjson.Field
		InviterUserID  respjson.Field
		OrganizationID respjson.Field
		Role           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization invitation details.

func (OrganizationInvitation) RawJSON added in v2.2.0

func (r OrganizationInvitation) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationInvitation) UnmarshalJSON added in v2.2.0

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

type OrganizationInvitationList added in v2.2.0

type OrganizationInvitationList struct {
	Items []OrganizationInvitation `json:"items" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationInvitationList) RawJSON added in v2.2.0

func (r OrganizationInvitationList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationInvitationList) UnmarshalJSON added in v2.2.0

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

type OrganizationInvitationRole added in v2.2.0

type OrganizationInvitationRole string

Role of the user in the organization.

const (
	OrganizationInvitationRoleOwner   OrganizationInvitationRole = "owner"
	OrganizationInvitationRoleAdmin   OrganizationInvitationRole = "admin"
	OrganizationInvitationRoleBilling OrganizationInvitationRole = "billing"
	OrganizationInvitationRoleMember  OrganizationInvitationRole = "member"
)

type OrganizationList

type OrganizationList struct {
	Items []Organization `json:"items" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationList) RawJSON

func (r OrganizationList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationList) UnmarshalJSON

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

type OrganizationListParams

type OrganizationListParams struct {
	// Pagination cursor returned by a previous request. Only valid for the same
	// filters and sort order.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by a case-insensitive substring of the organization name
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Comma-separated sort terms in precedence order, each field:asc or field:desc.
	// Fields: created_at, updated_at, name
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Filter by organization type
	//
	// Any of "personal", "company".
	Type OrganizationListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OrganizationListParams) URLQuery

func (r OrganizationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes OrganizationListParams's query parameters as `url.Values`.

type OrganizationListParamsType

type OrganizationListParamsType string

Filter by organization type

const (
	OrganizationListParamsTypePersonal OrganizationListParamsType = "personal"
	OrganizationListParamsTypeCompany  OrganizationListParamsType = "company"
)

type OrganizationMembership

type OrganizationMembership struct {
	// Membership ID.
	ID string `json:"id" api:"required"`
	// When the membership was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Email address of the user.
	Email string `json:"email" api:"required"`
	// First name of the user.
	FirstName string `json:"first_name" api:"required"`
	// Last name of the user.
	LastName string `json:"last_name" api:"required"`
	// Organization ID.
	OrganizationID string `json:"organization_id" api:"required"`
	// Role of the user in the organization.
	//
	// Any of "owner", "admin", "billing", "member".
	Role OrganizationMembershipRole `json:"role" api:"required"`
	// When the membership was updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// User ID.
	UserID string `json:"user_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		CreatedAt      respjson.Field
		Email          respjson.Field
		FirstName      respjson.Field
		LastName       respjson.Field
		OrganizationID respjson.Field
		Role           respjson.Field
		UpdatedAt      respjson.Field
		UserID         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Organization membership details.

func (OrganizationMembership) RawJSON

func (r OrganizationMembership) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationMembership) UnmarshalJSON

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

type OrganizationMembershipList

type OrganizationMembershipList struct {
	Items []OrganizationMembership `json:"items" api:"required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items       respjson.Field
		Pagination  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrganizationMembershipList) RawJSON

func (r OrganizationMembershipList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationMembershipList) UnmarshalJSON

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

type OrganizationMembershipRole

type OrganizationMembershipRole string

Role of the user in the organization.

const (
	OrganizationMembershipRoleOwner   OrganizationMembershipRole = "owner"
	OrganizationMembershipRoleAdmin   OrganizationMembershipRole = "admin"
	OrganizationMembershipRoleBilling OrganizationMembershipRole = "billing"
	OrganizationMembershipRoleMember  OrganizationMembershipRole = "member"
)

type OrganizationNewParams

type OrganizationNewParams struct {
	// Organization name.
	Name string `json:"name" api:"required"`
	// Optional billing email. When omitted, the oldest owner's email is used.
	BillingEmail param.Opt[string] `json:"billing_email,omitzero"`
	// contains filtered or unexported fields
}

func (OrganizationNewParams) MarshalJSON

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

func (*OrganizationNewParams) UnmarshalJSON

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

type OrganizationRechargePolicy

type OrganizationRechargePolicy struct {
	// Policy is the top-up mode.
	//
	// Any of "manual", "automatic".
	Policy RechargePolicyMode `json:"policy" api:"required"`
	// PolicyArgs carries the threshold parameters. Required when policy is
	// "automatic"; must be omitted when policy is "manual".
	PolicyArgs AutomaticPolicyArgs `json:"policy_args" api:"required"`
	// PolicySince is when the policy currently in force took effect. Any change moves
	// it, including an edit to the threshold parameters of an automatic policy.
	PolicySince time.Time `json:"policy_since" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Policy      respjson.Field
		PolicyArgs  respjson.Field
		PolicySince respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An organization's current recharge policy. policy_args is null for a manual policy.

func (OrganizationRechargePolicy) RawJSON

func (r OrganizationRechargePolicy) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationRechargePolicy) UnmarshalJSON

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

type OrganizationService

type OrganizationService struct {
	Options     []option.RequestOption
	Memberships MembershipService
	Address     AddressService
	Billing     BillingService
}

OrganizationService contains methods and other services that help with interacting with the Nirvana Labs API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrganizationService method instead.

func NewOrganizationService

func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)

NewOrganizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*OrganizationService) Get

func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)

Get details about an Organization

func (*OrganizationService) Leave

func (r *OrganizationService) Leave(ctx context.Context, organizationID string, opts ...option.RequestOption) (err error)

Leave an Organization

func (*OrganizationService) List

List organizations

func (*OrganizationService) ListAutoPaging

List organizations

func (*OrganizationService) New

Create a new organization

func (*OrganizationService) Update

func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, opts ...option.RequestOption) (res *Organization, err error)

Update an existing organization

type OrganizationServices

type OrganizationServices struct {
	// Whether cloud services are enabled for the organization.
	Cloud bool `json:"cloud" api:"required"`
	// Whether just-in-time provisioning is enabled for the organization.
	JitProvisioning bool `json:"jit_provisioning" api:"required"`
	// Whether SCIM provisioning is enabled for the organization.
	SCIM bool `json:"scim" api:"required"`
	// Whether SIEM integration is enabled for the organization.
	SIEM bool `json:"siem" api:"required"`
	// Whether single sign-on is enabled for the organization.
	SSO bool `json:"sso" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cloud           respjson.Field
		JitProvisioning respjson.Field
		SCIM            respjson.Field
		SIEM            respjson.Field
		SSO             respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Services that the Organization has access to.

func (OrganizationServices) RawJSON

func (r OrganizationServices) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationServices) UnmarshalJSON

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

type OrganizationType

type OrganizationType string

Organization type.

const (
	OrganizationTypePersonal OrganizationType = "personal"
	OrganizationTypeCompany  OrganizationType = "company"
)

type OrganizationUpdateParams

type OrganizationUpdateParams struct {
	// Billing email. Omit to leave unchanged, send null to clear (reverts to the
	// oldest owner's email), or send a value to set it.
	BillingEmail param.Opt[string] `json:"billing_email,omitzero"`
	// Organization name.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (OrganizationUpdateParams) MarshalJSON

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

func (*OrganizationUpdateParams) UnmarshalJSON

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

type OrganizationUsageStatement

type OrganizationUsageStatement struct {
	// ISO 4217 currency code.
	Currency string `json:"currency" api:"required"`
	// Billing month the statement covers, as YYYY-MM (UTC).
	Month string `json:"month" api:"required"`
	// One entry per project with consumption in the month, ordered by name.
	Projects []StatementProject `json:"projects" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Total string `json:"total" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency    respjson.Field
		Month       respjson.Field
		Projects    respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Itemized usage statement for a billing month: consumption grouped by project, resource type, and dimension. Costs are recorded at consumption time, not re-priced.

func (OrganizationUsageStatement) RawJSON

func (r OrganizationUsageStatement) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationUsageStatement) UnmarshalJSON

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

type Pagination

type Pagination = shared.Pagination

Pagination response details.

This is an alias to an internal type.

type RechargePolicyMode

type RechargePolicyMode string

Policy is the top-up mode.

const (
	RechargePolicyModeManual    RechargePolicyMode = "manual"
	RechargePolicyModeAutomatic RechargePolicyMode = "automatic"
)

type RegionName

type RegionName = shared.RegionName

Region the resource is in.

This is an alias to an internal type.

type ResourceStatus

type ResourceStatus = shared.ResourceStatus

Status of the resource.

This is an alias to an internal type.

type SourceIPRuleParam

type SourceIPRuleParam = shared.SourceIPRuleParam

IP filter rules.

This is an alias to an internal type.

type SourceIPRuleResponse

type SourceIPRuleResponse = shared.SourceIPRuleResponse

IP filter rules.

This is an alias to an internal type.

type StatementLineItem

type StatementLineItem struct {
	// Component dimensions nested under this one (e.g. vCPU and memory under an
	// instance type). Empty for a leaf.
	Children []StatementLineItemLeaf `json:"children" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Cost string `json:"cost" api:"required" format:"decimal"`
	// Metered dimension identifier (e.g. "compute_n1_standard_8", "storage_abs_gb").
	Dimension string `json:"dimension" api:"required"`
	// Human-readable label for the dimension.
	DisplayName string `json:"display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	QuantityHours string `json:"quantity_hours" api:"required" format:"decimal"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	UnitPrice string `json:"unit_price" api:"nullable" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Children      respjson.Field
		Cost          respjson.Field
		Dimension     respjson.Field
		DisplayName   respjson.Field
		QuantityHours respjson.Field
		UnitPrice     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A top-level metered dimension. Heads nest components as children (cost is the subtotal, unit_price null); standalone dimensions carry a unit price and an empty children array.

func (StatementLineItem) RawJSON

func (r StatementLineItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*StatementLineItem) UnmarshalJSON

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

type StatementLineItemLeaf

type StatementLineItemLeaf struct {
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Cost string `json:"cost" api:"required" format:"decimal"`
	// Metered dimension identifier (e.g. "compute_vcpu", "compute_memory_gb").
	Dimension string `json:"dimension" api:"required"`
	// Human-readable label for the dimension.
	DisplayName string `json:"display_name" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	QuantityHours string `json:"quantity_hours" api:"required" format:"decimal"`
	// 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 {
		Cost          respjson.Field
		Dimension     respjson.Field
		DisplayName   respjson.Field
		QuantityHours respjson.Field
		UnitPrice     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A priced dimension line: a component nested under a head, or one rate segment of a dimension whose price changed mid-period.

func (StatementLineItemLeaf) RawJSON

func (r StatementLineItemLeaf) RawJSON() string

Returns the unmodified JSON received from the API

func (*StatementLineItemLeaf) UnmarshalJSON

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

type StatementProject

type StatementProject struct {
	// Project identifier.
	ProjectID string `json:"project_id" api:"required"`
	// Human-readable project name.
	ProjectName string `json:"project_name" api:"required"`
	// Consumption grouped by resource type.
	ResourceTypes []StatementResourceType `json:"resource_types" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Subtotal string `json:"subtotal" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProjectID     respjson.Field
		ProjectName   respjson.Field
		ResourceTypes respjson.Field
		Subtotal      respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single project's consumption within a usage statement.

func (StatementProject) RawJSON

func (r StatementProject) RawJSON() string

Returns the unmodified JSON received from the API

func (*StatementProject) UnmarshalJSON

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

type StatementResourceType

type StatementResourceType struct {
	// Top-level metered dimensions; a dimension expanded into components carries them
	// in children.
	Items []StatementLineItem `json:"items" api:"required"`
	// Resource type the line items belong to (e.g. "vm", "volume", "nks_node_pool").
	ResourceType string `json:"resource_type" api:"required"`
	// Arbitrary-precision decimal serialized as a string (e.g. "58.40").
	Subtotal string `json:"subtotal" api:"required" format:"decimal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Items        respjson.Field
		ResourceType respjson.Field
		Subtotal     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Consumption for one resource type within a project (e.g. every VM, every volume).

func (StatementResourceType) RawJSON

func (r StatementResourceType) RawJSON() string

Returns the unmodified JSON received from the API

func (*StatementResourceType) UnmarshalJSON

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

type VMMetricUnit

type VMMetricUnit = shared.VMMetricUnit

Unit the values are expressed in.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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