repositorypermission

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

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 repositories permission client.

func NewClient

func NewClient(cfg *up.Config) *Client

NewClient build a repositories permission client from the passed config.

func (*Client) Create

func (c *Client) Create(ctx context.Context, organization string, teamID uuid.UUID, params CreatePermission) error

Create assigns a specified permission to a team for a repository on Upbound.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, organization string, teamID uuid.UUID, params PermissionIdentifier) error

Delete removes a specified permission from a team for a repository on Upbound.

func (*Client) List

func (c *Client) List(ctx context.Context, organization string, teamID uuid.UUID) (*ListPermissionsResponse, error)

List retrieves all repository permissions assigned to a team on Upbound.

type CreatePermission

type CreatePermission struct {
	Permission RepositoryPermission `json:"permission"`
	Repository string               `json:"repository"`
}

CreatePermission holds the parameters for creating a repository permission.

type ListPermissionsResponse

type ListPermissionsResponse struct {
	Permissions []Permission `json:"permissions"`
	Size        int          `json:"size"`
	Page        int          `json:"page"`
	Count       int          `json:"count"`
}

ListPermissionsResponse represents the response from listing repository permissions.

type Permission

type Permission struct {
	TeamID         uuid.UUID      `json:"teamId"`
	RepositoryID   int            `json:"repositoryId"`
	AccountID      int            `json:"accountId"`
	Privilege      PermissionType `json:"privilege"`
	CreatorID      int            `json:"creatorId"`
	CreatedAt      time.Time      `json:"createdAt"`
	UpdatedAt      *time.Time     `json:"updatedAt,omitempty"`
	RepositoryName string         `json:"repositoryName"`
}

Permission represents a repository permission entry.

type PermissionIdentifier

type PermissionIdentifier struct {
	Repository string `json:"repository"`
}

PermissionIdentifier holds the parameters for a repository permission.

type PermissionType

type PermissionType string

PermissionType represents the type of permission for a repository.

const (
	PermissionAdmin PermissionType = "admin"
	PermissionRead  PermissionType = "read"
	PermissionWrite PermissionType = "write"
	PermissionView  PermissionType = "view"
)

PermissionTypes

type RepositoryPermission

type RepositoryPermission struct {
	Permission PermissionType `json:"permission"`
}

RepositoryPermission represents the permission to be set for a repository.

Jump to

Keyboard shortcuts

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