Documentation ¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, params *OrganizationCreateParameters) error
- func (c *Client) CreateInvite(ctx context.Context, orgID uint, params *OrganizationInviteCreateParameters) error
- func (c *Client) Delete(ctx context.Context, id uint) error
- func (c *Client) DeleteInvite(ctx context.Context, orgID uint, inviteID uint) error
- func (c *Client) Get(ctx context.Context, id uint) (*Organization, error)
- func (c *Client) GetOrgID(ctx context.Context, name string) (uint, error)
- func (c *Client) List(ctx context.Context) ([]Organization, error)
- func (c *Client) ListInvites(ctx context.Context, orgID uint) ([]Invite, error)
- func (c *Client) ListMembers(ctx context.Context, orgID uint) ([]Member, error)
- func (c *Client) ListRobots(ctx context.Context, id uint) ([]Robot, error)
- func (c *Client) ListTeams(ctx context.Context, id uint) ([]Team, error)
- func (c *Client) RemoveMember(ctx context.Context, orgID uint, userID uint) error
- type Invite
- type Member
- type Organization
- type OrganizationCreateParameters
- type OrganizationInviteCreateParameters
- type OrganizationPermissionGroup
- type Robot
- type Team
- type User
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 an organizations client.
func NewClient ¶
func NewClient(cfg *up.Config) *Client
NewClient builds an organizations client from the passed config.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, params *OrganizationCreateParameters) error
Create an organization on Upbound.
func (*Client) CreateInvite ¶
func (c *Client) CreateInvite(ctx context.Context, orgID uint, params *OrganizationInviteCreateParameters) error
CreateInvite creates an invite for the organization on Upbound.
func (*Client) DeleteInvite ¶
DeleteInvite deletes an invite for the organization on Upbound.
func (*Client) GetOrgID ¶
GetOrgID returns the ID of an org given its name. There is a requirement that orgs are uniquely named, so we know there is at most one org with the given name.
func (*Client) List ¶
func (c *Client) List(ctx context.Context) ([]Organization, error)
List all organizations for the authenticated user on Upbound.
func (*Client) ListInvites ¶
ListInvites list all invites for the organization on Upbound.
func (*Client) ListMembers ¶
ListMembers list all members for the organization on Upbound.
func (*Client) ListRobots ¶
ListRobots list all robots the user can access in the organization on Upbound. TODO(hasheddan): move this to robots client when API is updated.
type Invite ¶
type Invite struct { ID uint `json:"id"` Email string `json:"email"` Permission OrganizationPermissionGroup `json:"permission"` CreatedAt string `json:"createdAt"` }
Invite is a pending organization member.
type Member ¶
type Member struct { Permission OrganizationPermissionGroup `json:"permission"` User User `json:"user"` }
Member is a member of an organization.
type Organization ¶
type Organization struct { ID uint `json:"id"` Name string `json:"name"` DisplayName string `json:"displayName"` CreatorID uint `json:"creatorId"` Role OrganizationPermissionGroup `json:"role"` ReservedEnvironments int `json:"reservedEnvironments"` }
Organization is an organization on Upbound.
type OrganizationCreateParameters ¶
type OrganizationCreateParameters struct { Name string `json:"name"` DisplayName string `json:"displayName"` }
OrganizationCreateParameters are the parameters for creating an organization.
type OrganizationInviteCreateParameters ¶
type OrganizationInviteCreateParameters struct { Email string `json:"email"` Permission OrganizationPermissionGroup `json:"organizationPermission"` }
OrganizationInviteCreateParameters are the parameters for creating a user invite to an organization.
type OrganizationPermissionGroup ¶
type OrganizationPermissionGroup string
OrganizationPermissionGroup is the type of permission a user has in the organization.
const ( // OrganizationMember denotes basic permission on an organization. OrganizationMember OrganizationPermissionGroup = "member" // OrganizationOwner denotes full access permission on an organization. OrganizationOwner OrganizationPermissionGroup = "owner" )
type Robot ¶
type Robot struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Description string `json:"description"` TeamIDs []uuid.UUID `json:"teamIDs"` TokenIDs []uuid.UUID `json:"tokenIDs"` CreatedAt time.Time `json:"createdAt"` }
Robot is a robot account on Upbound.