Documentation ¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, params *TokenCreateParameters) (*TokenResponse, error)
- func (c *Client) Delete(ctx context.Context, id uuid.UUID) error
- func (c *Client) Get(ctx context.Context, id uuid.UUID) (*TokenResponse, error)
- func (c *Client) Update(ctx context.Context, params *TokenUpdateParameters) (*TokenResponse, error)
- type TokenAttributes
- type TokenCreateParameters
- type TokenOwner
- type TokenOwnerData
- type TokenOwnerType
- type TokenRelationships
- type TokenResponse
- type TokenUpdateParameters
- type TokensResponse
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) 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 ¶
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 ¶
TokensResponse is the response returned from token operations. TODO(hasheddan): consider making token responses strongly typed.