pbclient

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pbclient is a minimal Portal Backend API client for CLI management commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationCollection

type ApplicationCollection struct {
	Items []application.ApplicationResponse `json:"items"`
	Count int                               `json:"count"`
}

ApplicationCollection is the GET /api/v1/applications response envelope.

type Client

type Client struct {
	BaseURL    string
	Token      string
	HTTPClient *http.Client
}

Client calls the Portal Backend management API using a bearer token.

func NewClient

func NewClient(baseURL, token string) *Client

NewClient creates a Portal Backend client for the given base URL and bearer token.

func (*Client) CreateApplication

CreateApplication calls POST /api/v1/applications.

func (*Client) CreateMember

func (c *Client) CreateMember(ctx context.Context, req *member.CreateMemberRequest) (*member.MemberResponse, error)

CreateMember calls POST /api/v1/members.

func (*Client) CreateSchema

func (c *Client) CreateSchema(ctx context.Context, req *schema.CreateSchemaRequest) (*schema.SchemaResponse, error)

CreateSchema calls POST /api/v1/schemas.

func (*Client) GetApplication

func (c *Client) GetApplication(ctx context.Context, applicationID string) (*application.ApplicationResponse, error)

GetApplication calls GET /api/v1/applications/{applicationId}.

func (*Client) GetMember added in v0.5.0

func (c *Client) GetMember(ctx context.Context, memberID string) (*member.MemberResponse, error)

GetMember calls GET /api/v1/members/{memberId}.

func (*Client) GetSchema added in v0.5.0

func (c *Client) GetSchema(ctx context.Context, schemaID string) (*schema.SchemaResponse, error)

GetSchema calls GET /api/v1/schemas/{schemaId}.

func (*Client) ListApplications

func (c *Client) ListApplications(ctx context.Context, memberID *string) (*ApplicationCollection, error)

ListApplications calls GET /api/v1/applications, optionally filtered to one member's applications.

func (*Client) ListMembers added in v0.5.0

func (c *Client) ListMembers(ctx context.Context, ouID *string) (*MemberCollection, error)

ListMembers calls GET /api/v1/members, optionally filtered to one organization unit's member.

func (*Client) ListSchemaPolicyMetadata added in v0.5.0

func (c *Client) ListSchemaPolicyMetadata(ctx context.Context, schemaID string) (*PolicyMetadataCollection, error)

ListSchemaPolicyMetadata calls GET /api/v1/schemas/{schemaId}/policy-metadata to list a schema's grantable fields.

func (*Client) ListSchemas added in v0.5.0

func (c *Client) ListSchemas(ctx context.Context, memberID *string) (*SchemaCollection, error)

ListSchemas calls GET /api/v1/schemas, optionally filtered to one member's schemas.

func (*Client) UpdateApplicationPolicy

func (c *Client) UpdateApplicationPolicy(ctx context.Context, applicationID string, req *application.UpdateApplicationPolicyRequest) (*application.ApplicationResponse, error)

UpdateApplicationPolicy calls PUT /api/v1/applications/{applicationId}/policy to replace an existing application's allow-list.

type MemberCollection added in v0.5.0

type MemberCollection struct {
	Items []member.MemberResponse `json:"items"`
	Count int                     `json:"count"`
}

MemberCollection is the GET /api/v1/members response envelope.

type PolicyMetadataCollection added in v0.5.0

type PolicyMetadataCollection struct {
	Items []policy.PolicyMetadataResponse `json:"items"`
	Count int                             `json:"count"`
}

PolicyMetadataCollection is the GET /api/v1/schemas/{schemaId}/policy-metadata response envelope.

type SchemaCollection added in v0.5.0

type SchemaCollection struct {
	Items []schema.SchemaResponse `json:"items"`
	Count int                     `json:"count"`
}

SchemaCollection is the GET /api/v1/schemas response envelope.

Jump to

Keyboard shortcuts

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