client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountMembershipsClient

type AccountMembershipsClient struct {
	// contains filtered or unexported fields
}

func (*AccountMembershipsClient) List

List returns a list of account memberships, based on the provided filter.

type AccountRolesClient

type AccountRolesClient struct {
	// contains filtered or unexported fields
}

func (*AccountRolesClient) Get

func (c *AccountRolesClient) Get(ctx context.Context, roleID uuid.UUID) (*api.AccountRole, error)

Get returns an account role by ID.

func (*AccountRolesClient) List

func (c *AccountRolesClient) List(ctx context.Context, roleNames []string) ([]*api.AccountRole, error)

List returns a list of account roles, based on the provided filter.

type AccountsClient

type AccountsClient struct {
	// contains filtered or unexported fields
}

AccountsClient is a client for working with accounts.

func (*AccountsClient) Delete

func (c *AccountsClient) Delete(ctx context.Context) error

Delete removes an account by ID.

func (*AccountsClient) Get

Get returns details for an account by ID.

func (*AccountsClient) Update

func (c *AccountsClient) Update(ctx context.Context, data api.AccountUpdate) error

Update modifies an existing account by ID.

type Client

type Client struct {
	// contains filtered or unexported fields
}

func MustNew

func MustNew(opts ...Option) *Client

MustNew returns a new client or panics if an error occurred.

func New

func New(opts ...Option) (*Client, error)

New creates and returns new client instance.

func (*Client) AccountMemberships

func (c *Client) AccountMemberships(accountID uuid.UUID) (api.AccountMembershipsClient, error)

AccountMemberships is a factory that initializes and returns a AccountMembershipsClient.

func (*Client) AccountRoles

func (c *Client) AccountRoles(accountID uuid.UUID) (api.AccountRolesClient, error)

AccountRoles is a factory that initializes and returns a AccountRolesClient.

func (*Client) Accounts

func (c *Client) Accounts(accountID uuid.UUID) (api.AccountsClient, error)

Accounts returns an AccountsClient.

func (*Client) Collections

func (c *Client) Collections() (api.CollectionsClient, error)

Collections returns an CollectionsClient.

func (*Client) ServiceAccounts

func (c *Client) ServiceAccounts(accountID uuid.UUID) (api.ServiceAccountsClient, error)

func (*Client) Teams

func (c *Client) Teams(accountID uuid.UUID) (api.TeamsClient, error)

Teams is a factory that initializes and returns a TeamsClient.

func (*Client) Variables

func (c *Client) Variables(accountID uuid.UUID, workspaceID uuid.UUID) (api.VariablesClient, error)

Variables returns a VariablesClient.

func (*Client) WorkPools

func (c *Client) WorkPools(accountID uuid.UUID, workspaceID uuid.UUID) (api.WorkPoolsClient, error)

WorkPools returns a WorkPoolsClient.

func (*Client) WorkspaceAccess

func (c *Client) WorkspaceAccess(accountID uuid.UUID, workspaceID uuid.UUID) (api.WorkspaceAccessClient, error)

WorkspaceAccess is a factory that initializes and returns a WorkspaceAccessClient.

func (*Client) WorkspaceRoles

func (c *Client) WorkspaceRoles(accountID uuid.UUID) (api.WorkspaceRolesClient, error)

WorkspaceRoles is a factory that initializes and returns a WorkspaceRolesClient.

func (*Client) Workspaces

func (c *Client) Workspaces(accountID uuid.UUID) (api.WorkspacesClient, error)

Workspaces returns a WorkspacesClient.

type CollectionsClient

type CollectionsClient struct {
	// contains filtered or unexported fields
}

func (*CollectionsClient) GetWorkerMetadataViews

func (c *CollectionsClient) GetWorkerMetadataViews(ctx context.Context) (api.WorkerTypeByPackage, error)

GetWorkerMetadataViews returns a map of worker metadata views by prefect package name. This endpoint serves base job configurations for the primary worker types.

type Option

type Option func(c *Client) error

func WithAPIKey

func WithAPIKey(apiKey string) Option

WithAPIKey configures the API Key to use to authenticate to Prefect.

func WithClient

func WithClient(httpClient *http.Client) Option

WithClient configures the underlying http.Client used to send requests.

func WithDefaults

func WithDefaults(accountID uuid.UUID, workspaceID uuid.UUID) Option

WithDefaults configures the default account and workspace ID.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint configures the client to communicate with a self-hosted Prefect server or Prefect Cloud.

type ServiceAccountsClient

type ServiceAccountsClient struct {
	// contains filtered or unexported fields
}

func (*ServiceAccountsClient) Create

func (*ServiceAccountsClient) Delete

func (sa *ServiceAccountsClient) Delete(ctx context.Context, botID string) error

func (*ServiceAccountsClient) Get

func (*ServiceAccountsClient) List

func (sa *ServiceAccountsClient) List(ctx context.Context, names []string) ([]*api.ServiceAccount, error)

func (*ServiceAccountsClient) RotateKey

func (sa *ServiceAccountsClient) RotateKey(ctx context.Context, serviceAccountID string, data api.ServiceAccountRotateKeyRequest) (*api.ServiceAccount, error)

func (*ServiceAccountsClient) Update

type TeamsClient

type TeamsClient struct {
	// contains filtered or unexported fields
}

func (*TeamsClient) List

func (c *TeamsClient) List(ctx context.Context, names []string) ([]*api.Team, error)

List returns a list of teams, based on the provided filter.

type VariablesClient

type VariablesClient struct {
	// contains filtered or unexported fields
}

VariablesClient is a client for working with variables.

func (*VariablesClient) Create

Create returns details for a new variable.

func (*VariablesClient) Delete

func (c *VariablesClient) Delete(ctx context.Context, variableID uuid.UUID) error

Delete removes a variable by ID.

func (*VariablesClient) Get

func (c *VariablesClient) Get(ctx context.Context, variableID uuid.UUID) (*api.Variable, error)

Get returns details for a variable by ID.

func (*VariablesClient) GetByName

func (c *VariablesClient) GetByName(ctx context.Context, name string) (*api.Variable, error)

GetByName returns details for a variable by name.

func (*VariablesClient) List

func (c *VariablesClient) List(ctx context.Context, filter api.VariableFilter) ([]api.Variable, error)

List returns a list of variables matching filter criteria.

func (*VariablesClient) Update

func (c *VariablesClient) Update(ctx context.Context, variableID uuid.UUID, data api.VariableUpdate) error

Update modifies an existing variable by ID.

type WorkPoolsClient

type WorkPoolsClient struct {
	// contains filtered or unexported fields
}

WorkPoolsClient is a client for working with work pools.

func (*WorkPoolsClient) Create

Create returns details for a new work pool.

func (*WorkPoolsClient) Delete

func (c *WorkPoolsClient) Delete(ctx context.Context, name string) error

Delete removes a work pool by name.

func (*WorkPoolsClient) Get

func (c *WorkPoolsClient) Get(ctx context.Context, name string) (*api.WorkPool, error)

Get returns details for a work pool by name.

func (*WorkPoolsClient) List

func (c *WorkPoolsClient) List(ctx context.Context, filter api.WorkPoolFilter) ([]*api.WorkPool, error)

List returns a list of work pools matching filter criteria.

func (*WorkPoolsClient) Update

func (c *WorkPoolsClient) Update(ctx context.Context, name string, data api.WorkPoolUpdate) error

Update modifies an existing work pool by name.

type WorkspaceAccessClient

type WorkspaceAccessClient struct {
	// contains filtered or unexported fields
}

func (*WorkspaceAccessClient) Delete

func (c *WorkspaceAccessClient) Delete(ctx context.Context, accessorType string, accessID uuid.UUID, accessorID uuid.UUID) error

DeleteUserAccess deletes a service account's workspace access via accessID.

func (*WorkspaceAccessClient) Get

func (c *WorkspaceAccessClient) Get(ctx context.Context, accessorType string, accessID uuid.UUID) (*api.WorkspaceAccess, error)

Get fetches workspace access for various accessor types via accessID.

func (*WorkspaceAccessClient) Upsert

func (c *WorkspaceAccessClient) Upsert(ctx context.Context, accessorType string, accessorID uuid.UUID, roleID uuid.UUID) (*api.WorkspaceAccess, error)

Upsert creates or updates access to a workspace for various accessor types.

type WorkspaceRolesClient

type WorkspaceRolesClient struct {
	// contains filtered or unexported fields
}

func (*WorkspaceRolesClient) Create

Create creates a new workspace role.

func (*WorkspaceRolesClient) Delete

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

Delete removes a workspace role by ID.

func (*WorkspaceRolesClient) Get

Get returns a workspace role by ID.

func (*WorkspaceRolesClient) List

func (c *WorkspaceRolesClient) List(ctx context.Context, roleNames []string) ([]*api.WorkspaceRole, error)

List returns a list of workspace roles, based on the provided filter.

func (*WorkspaceRolesClient) Update

func (c *WorkspaceRolesClient) Update(ctx context.Context, workspaceRoleID uuid.UUID, data api.WorkspaceRoleUpsert) error

Update modifies an existing workspace role by ID.

type WorkspacesClient

type WorkspacesClient struct {
	// contains filtered or unexported fields
}

WorkspacesClient is a client for working with Workspaces.

func (*WorkspacesClient) Create

Create returns details for a new Workspace.

func (*WorkspacesClient) Delete

func (c *WorkspacesClient) Delete(ctx context.Context, workspaceID uuid.UUID) error

Delete removes a Workspace by ID.

func (*WorkspacesClient) Get

func (c *WorkspacesClient) Get(ctx context.Context, workspaceID uuid.UUID) (*api.Workspace, error)

Get returns details for a Workspace by ID.

func (*WorkspacesClient) List

func (c *WorkspacesClient) List(ctx context.Context, handleNames []string) ([]*api.Workspace, error)

List returns a list of Workspaces, based on the provided list of handle names.

func (*WorkspacesClient) Update

func (c *WorkspacesClient) Update(ctx context.Context, workspaceID uuid.UUID, data api.WorkspaceUpdate) error

Update modifies an existing Workspace by ID.

Jump to

Keyboard shortcuts

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