aap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = errors.New("resource not found")
	ErrForbidden = errors.New("resource forbidden")
)

Functions

This section is empty.

Types

type AAPContentObject added in v1.0.0

type AAPContentObject struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

ContentObject represents the organization in role assignments

type AAPGatewayClient

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

func NewAAPGatewayClient

func NewAAPGatewayClient(options AAPGatewayClientOptions) (*AAPGatewayClient, error)

func (*AAPGatewayClient) GetMe

func (a *AAPGatewayClient) GetMe(ctx context.Context, token string) (*AAPUser, error)

GET /api/gateway/v1/me/

func (*AAPGatewayClient) GetOrganization

func (a *AAPGatewayClient) GetOrganization(ctx context.Context, token string, organizationID string) (*AAPOrganization, error)

GET /api/gateway/v1/organizations/{organization_id}

func (*AAPGatewayClient) ListOrganizations

func (a *AAPGatewayClient) ListOrganizations(ctx context.Context, token string) ([]*AAPOrganization, error)

GET /api/gateway/v1/organizations

func (*AAPGatewayClient) ListUserOrganizations

func (a *AAPGatewayClient) ListUserOrganizations(ctx context.Context, token string, userID string) ([]*AAPOrganization, error)

GET /api/gateway/v1/users/{user_id}/organizations

func (*AAPGatewayClient) ListUserRoleAssignments added in v1.0.0

func (a *AAPGatewayClient) ListUserRoleAssignments(ctx context.Context, token string, userID string) ([]*AAPRoleUserAssignment, error)

GET /api/controller/v2/role_user_assignments/?user__id={user_id}

func (*AAPGatewayClient) ListUserTeams

func (a *AAPGatewayClient) ListUserTeams(ctx context.Context, token string, userID string) ([]*AAPTeam, error)

GET /api/gateway/v1/users/{user_id}/teams

type AAPGatewayClientOptions

type AAPGatewayClientOptions struct {
	GatewayUrl      string
	TLSClientConfig *tls.Config
	MaxPageSize     *int
}

type AAPOrganization

type AAPOrganization struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type AAPOrganizationsResponse

type AAPOrganizationsResponse = AAPPaginatedResponse[AAPOrganization]

type AAPPaginatedResponse

type AAPPaginatedResponse[T any] struct {
	Count    int     `json:"count"`
	Next     *string `json:"next"`
	Previous *string `json:"previous"`
	Results  []*T    `json:"results"`
}

AAP Gateway API response types

type AAPRoleDefinition added in v1.0.0

type AAPRoleDefinition struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Managed     bool   `json:"managed"`
}

RoleDefinition represents an AAP role definition

type AAPRoleUser added in v1.0.0

type AAPRoleUser struct {
	ID        int    `json:"id"`
	Username  string `json:"username"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
}

User represents an AAP user in role assignments

type AAPRoleUserAssignment added in v1.0.0

type AAPRoleUserAssignment struct {
	ID             int                                `json:"id"`
	SummaryFields  AAPRoleUserAssignmentSummaryFields `json:"summary_fields"`
	ContentType    string                             `json:"content_type"`
	ObjectID       string                             `json:"object_id"`
	RoleDefinition int                                `json:"role_definition"`
	User           int                                `json:"user"`
}

RoleUserAssignment represents a user's role assignment to an organization

type AAPRoleUserAssignmentSummaryFields added in v1.0.0

type AAPRoleUserAssignmentSummaryFields struct {
	RoleDefinition AAPRoleDefinition `json:"role_definition"`
	User           AAPRoleUser       `json:"user"`
	ContentObject  AAPContentObject  `json:"content_object"`
}

RoleUserAssignmentSummaryFields contains nested summary information

type AAPRoleUserAssignmentsResponse added in v1.0.0

type AAPRoleUserAssignmentsResponse = AAPPaginatedResponse[AAPRoleUserAssignment]

type AAPTeam

type AAPTeam struct {
	ID            int                  `json:"id"`
	SummaryFields AAPTeamSummaryFields `json:"summary_fields"`
}

type AAPTeamSummaryFields

type AAPTeamSummaryFields struct {
	Organization AAPOrganization `json:"organization"`
}

type AAPTeamsResponse

type AAPTeamsResponse = AAPPaginatedResponse[AAPTeam]

type AAPUser

type AAPUser struct {
	ID                int    `json:"id,omitempty"`
	Username          string `json:"username,omitempty"`
	IsSuperuser       bool   `json:"is_superuser,omitempty"`
	IsPlatformAuditor bool   `json:"is_platform_auditor,omitempty"`
}

type AAPUsersResponse

type AAPUsersResponse = AAPPaginatedResponse[AAPUser]

Jump to

Keyboard shortcuts

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