api_keys

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const RegionNameApSeo1 = shared.RegionNameApSeo1

Equals "ap-seo-1"

View Source
const RegionNameApSin1 = shared.RegionNameApSin1

Equals "ap-sin-1"

View Source
const RegionNameApTyo1 = shared.RegionNameApTyo1

Equals "ap-tyo-1"

View Source
const RegionNameEuFrk1 = shared.RegionNameEuFrk1

Equals "eu-frk-1"

View Source
const RegionNameUsChi1 = shared.RegionNameUsChi1

Equals "us-chi-1"

View Source
const RegionNameUsSea1 = shared.RegionNameUsSea1

Equals "us-sea-1"

View Source
const RegionNameUsSva1 = shared.RegionNameUsSva1

Equals "us-sva-1"

View Source
const RegionNameUsSva2 = shared.RegionNameUsSva2

Equals "us-sva-2"

View Source
const RegionNameUsWdc1 = shared.RegionNameUsWdc1

Equals "us-wdc-1"

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"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	// API Key ID.
	ID string `json:"id,required"`
	// When the API Key was created.
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// When the API Key expires and is no longer valid.
	ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
	// API Key name.
	Name string `json:"name,required"`
	// IP filter configuration for the API Key.
	SourceIPRule APIKeySourceIPRule `json:"source_ip_rule,required"`
	// Status of the API Key.
	//
	// Any of "active", "inactive", "expired".
	Status APIKeyStatus `json:"status,required"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags,required"`
	// When the API Key was updated.
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// API Key. Only returned on creation.
	Key string `json:"key"`
	// When the API Key starts to be valid.
	StartsAt time.Time `json:"starts_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		ExpiresAt    respjson.Field
		Name         respjson.Field
		SourceIPRule respjson.Field
		Status       respjson.Field
		Tags         respjson.Field
		UpdatedAt    respjson.Field
		Key          respjson.Field
		StartsAt     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API Key response.

func (APIKey) RawJSON added in v1.1.0

func (r APIKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKey) UnmarshalJSON

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

type APIKeyList

type APIKeyList struct {
	Items []APIKey `json:"items,required"`
	// Pagination response details.
	Pagination shared.Pagination `json:"pagination,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 (APIKeyList) RawJSON added in v1.1.0

func (r APIKeyList) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKeyList) UnmarshalJSON

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

type APIKeyListParams added in v1.21.0

type APIKeyListParams struct {
	// Pagination cursor returned by a previous request
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (APIKeyListParams) URLQuery added in v1.21.0

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

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

type APIKeyNewParams

type APIKeyNewParams struct {
	// When the API Key expires and is no longer valid.
	ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
	// API Key name.
	Name string `json:"name,required"`
	// When the API Key starts to be valid.
	StartsAt param.Opt[time.Time] `json:"starts_at,omitzero" format:"date-time"`
	// IP filter configuration for the API Key.
	SourceIPRule APIKeyNewParamsSourceIPRule `json:"source_ip_rule,omitzero"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (APIKeyNewParams) MarshalJSON

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

func (*APIKeyNewParams) UnmarshalJSON added in v1.1.0

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

type APIKeyNewParamsSourceIPRule added in v1.30.0

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

IP filter configuration for the API Key.

func (APIKeyNewParamsSourceIPRule) MarshalJSON added in v1.30.0

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

func (*APIKeyNewParamsSourceIPRule) UnmarshalJSON added in v1.30.0

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

type APIKeyService

type APIKeyService struct {
	Options []option.RequestOption
}

APIKeyService 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 NewAPIKeyService method instead.

func NewAPIKeyService

func NewAPIKeyService(opts ...option.RequestOption) (r APIKeyService)

NewAPIKeyService 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 (*APIKeyService) Delete

func (r *APIKeyService) Delete(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (err error)

Delete an API key

func (*APIKeyService) Get

func (r *APIKeyService) Get(ctx context.Context, apiKeyID string, opts ...option.RequestOption) (res *APIKey, err error)

Get details about an API key

func (*APIKeyService) List

func (r *APIKeyService) List(ctx context.Context, query APIKeyListParams, opts ...option.RequestOption) (res *pagination.Cursor[APIKey], err error)

List all API keys for the authenticated user

func (*APIKeyService) ListAutoPaging added in v1.21.0

List all API keys for the authenticated user

func (*APIKeyService) New

func (r *APIKeyService) New(ctx context.Context, body APIKeyNewParams, opts ...option.RequestOption) (res *APIKey, err error)

Create a new API key

func (*APIKeyService) Update added in v0.4.0

func (r *APIKeyService) Update(ctx context.Context, apiKeyID string, body APIKeyUpdateParams, opts ...option.RequestOption) (res *APIKey, err error)

Update an existing API key

type APIKeySourceIPRule added in v1.30.0

type APIKeySourceIPRule struct {
	// List of IPv4/IPv6 CIDR addresses to allow.
	Allowed []string `json:"allowed,required"`
	// List of IPv4/IPv6 CIDR addresses to deny.
	Blocked []string `json:"blocked,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 configuration for the API Key.

func (APIKeySourceIPRule) RawJSON added in v1.30.0

func (r APIKeySourceIPRule) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIKeySourceIPRule) UnmarshalJSON added in v1.30.0

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

type APIKeyStatus

type APIKeyStatus string

Status of the API Key.

const (
	APIKeyStatusActive   APIKeyStatus = "active"
	APIKeyStatusInactive APIKeyStatus = "inactive"
	APIKeyStatusExpired  APIKeyStatus = "expired"
)

type APIKeyUpdateParams added in v0.4.0

type APIKeyUpdateParams struct {
	// API Key name.
	Name param.Opt[string] `json:"name,omitzero"`
	// IP filter configuration for the API Key.
	SourceIPRule APIKeyUpdateParamsSourceIPRule `json:"source_ip_rule,omitzero"`
	// Tags to attach to the API Key.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (APIKeyUpdateParams) MarshalJSON added in v0.4.0

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

func (*APIKeyUpdateParams) UnmarshalJSON added in v1.1.0

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

type APIKeyUpdateParamsSourceIPRule added in v1.30.0

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

IP filter configuration for the API Key.

func (APIKeyUpdateParamsSourceIPRule) MarshalJSON added in v1.30.0

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

func (*APIKeyUpdateParamsSourceIPRule) UnmarshalJSON added in v1.30.0

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

type Error

type Error = apierror.Error

type Pagination added in v1.21.0

type Pagination = shared.Pagination

Pagination response details.

This is an alias to an internal type.

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.

Jump to

Keyboard shortcuts

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