Documentation
¶
Index ¶
- Variables
- type AAPContentObject
- type AAPGatewayClient
- func (a *AAPGatewayClient) GetMe(ctx context.Context, token string) (*AAPUser, error)
- func (a *AAPGatewayClient) GetOrganization(ctx context.Context, token string, organizationID string) (*AAPOrganization, error)
- func (a *AAPGatewayClient) ListOrganizations(ctx context.Context, token string) ([]*AAPOrganization, error)
- func (a *AAPGatewayClient) ListUserOrganizations(ctx context.Context, token string, userID string) ([]*AAPOrganization, error)
- func (a *AAPGatewayClient) ListUserRoleAssignments(ctx context.Context, token string, userID string) ([]*AAPRoleUserAssignment, error)
- func (a *AAPGatewayClient) ListUserTeams(ctx context.Context, token string, userID string) ([]*AAPTeam, error)
- type AAPGatewayClientOptions
- type AAPOrganization
- type AAPOrganizationsResponse
- type AAPPaginatedResponse
- type AAPRoleDefinition
- type AAPRoleUser
- type AAPRoleUserAssignment
- type AAPRoleUserAssignmentSummaryFields
- type AAPRoleUserAssignmentsResponse
- type AAPTeam
- type AAPTeamSummaryFields
- type AAPTeamsResponse
- type AAPUser
- type AAPUsersResponse
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) 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 AAPOrganization ¶
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 AAPUsersResponse ¶
type AAPUsersResponse = AAPPaginatedResponse[AAPUser]
Click to show internal directories.
Click to hide internal directories.