tokens

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*up.Config
}

Client is a accounts client.

func NewClient

func NewClient(cfg *up.Config) *Client

NewClient builds a accounts client from the passed config.

func (*Client) Create

func (c *Client) Create(ctx context.Context, params *TokenCreateParameters) (*TokenResponse, error)

Create a token on Upbound.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id uuid.UUID) error

Delete a token on Upbound.

func (*Client) Get

func (c *Client) Get(ctx context.Context, id uuid.UUID) (*TokenResponse, error)

Get a token on Upbound.

func (*Client) Update

func (c *Client) Update(ctx context.Context, params *TokenUpdateParameters) (*TokenResponse, error)

Update a token on Upbound.

type TokenAttributes

type TokenAttributes struct {
	Name string `json:"name"`
}

TokenAttributes represents attributes of a token.

type TokenCreateParameters

type TokenCreateParameters struct {
	Attributes    TokenAttributes    `json:"attributes"`
	Relationships TokenRelationships `json:"relationships,omitempty"`
}

TokenCreateParameters are the parameters for creating a token.

type TokenOwner

type TokenOwner struct {
	Data TokenOwnerData `json:"data"`
}

TokenOwner represents owner of a token.

type TokenOwnerData

type TokenOwnerData struct {
	Type TokenOwnerType `json:"type"`
	ID   string         `json:"id"`
}

TokenOwnerData describes a token owner.

type TokenOwnerType

type TokenOwnerType string

TokenOwnerType is the type of owner of the token.

const (
	TokenOwnerUser         TokenOwnerType = "users"
	TokenOwnerControlPlane TokenOwnerType = "controlPlanes"
	TokenOwnerRobot        TokenOwnerType = "robots"
)

Tokens can be owned by a user, control plane, or robot.

type TokenRelationships

type TokenRelationships struct {
	Owner TokenOwner
}

TokenRelationships represents relationships for a token.

type TokenResponse

type TokenResponse struct {
	common.DataSet `json:"data"`
}

TokenResponse is the response returned from token operations. TODO(hasheddan): consider making token responses strongly typed.

type TokenUpdateParameters

type TokenUpdateParameters struct {
	ID         uuid.UUID       `json:"id"`
	Attributes TokenAttributes `json:"attributes"`
}

TokenUpdateParameters are the parameters for updating a token.

type TokensResponse

type TokensResponse struct {
	DataSet []common.DataSet `json:"data"`
}

TokensResponse is the response returned from token operations. TODO(hasheddan): consider making token responses strongly typed.

Jump to

Keyboard shortcuts

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