accounts

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name string `json:"name,omitempty"`
	Type Type   `json:"type,omitempty"`
}

Account is an Upbound account.

type AccountResponse

type AccountResponse struct {
	Account      Account                     `json:"account"`
	Organization *organizations.Organization `json:"organization,omitempty"`
	User         *User                       `json:"user,omitempty"`
}

AccountResponse is the API response when requesting information on a account.

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) Get

func (c *Client) Get(ctx context.Context, name string) (*AccountResponse, error)

Get a account on Upbound.

func (*Client) List

func (c *Client) List(ctx context.Context) ([]AccountResponse, error)

List all accounts for the authenticated user on Upbound.

type Type

type Type string

Type is either a user or organization.

const (
	// AccountOrganization is an organization account.
	AccountOrganization Type = "organization"
	// AccountUser is a user account.
	AccountUser Type = "user"
)

type User

type User struct {
	ID              uint       `json:"id"`
	Username        string     `json:"username"`
	FirstName       string     `json:"firstName"`
	LastName        string     `json:"lastName"`
	Email           string     `json:"email,omitempty"`
	Biography       string     `json:"biography,omitempty"`
	Location        string     `json:"location,omitempty"`
	CreatedAt       *time.Time `json:"createdAt,omitempty"`
	UpdatedAt       *time.Time `json:"updatedAt,omitempty"`
	DeletedAt       *time.Time `json:"deletedAt,omitempty"`
	EnterpriseTrial *time.Time `json:"enterpriseTrial,omitempty"`
	PersonalTrial   *time.Time `json:"personalTrial,omitempty"`
}

User is a user on Upbound. TODO(hasheddan): move to user service when implemented.

Jump to

Keyboard shortcuts

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