usergroups

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldOuId             = "ouId"
	FieldName             = "name"
	FieldType             = "type"
	FieldTotalMemberCount = "totalMemberCount"
	FieldCreatedDateTime  = "createdDateTime"
	FieldUpdatedDateTime  = "updatedDateTime"
	FieldStatus           = "status"
	FieldUsers            = "users"
)

Field constants for fields[userGroups] query parameter.

View Source
const (
	UserGroupStatusActive   = "ACTIVE"
	UserGroupStatusInactive = "INACTIVE"
)

UserGroupStatus constants for status field values.

View Source
const (
	UserGroupTypeStandard = "STANDARD"
)

UserGroupType constants for type field values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Links struct {
	Self  string `json:"self,omitempty"`
	First string `json:"first,omitempty"`
	Next  string `json:"next,omitempty"`
	Prev  string `json:"prev,omitempty"`
	Last  string `json:"last,omitempty"`
}

type Meta

type Meta struct {
	Paging *Paging `json:"paging,omitempty"`
}

type Paging

type Paging struct {
	Total      int    `json:"total,omitempty"`
	Limit      int    `json:"limit,omitempty"`
	NextCursor string `json:"nextCursor,omitempty"`
}

type RelationshipData

type RelationshipData struct {
	Links *ResourceLinks `json:"links,omitempty"`
}

RelationshipData holds the links for a relationship.

type RequestQueryOptions

type RequestQueryOptions struct {
	// Fields specifies which fields to return. Use Field* constants.
	Fields []string
	// Limit is the number of resources to return (max 1000).
	Limit int
}

RequestQueryOptions represents query parameters for user group endpoints.

type ResourceLinks struct {
	Self    string `json:"self,omitempty"`
	Related string `json:"related,omitempty"`
}

type UserGroup

type UserGroup struct {
	ID            string                  `json:"id"`
	Type          string                  `json:"type"`
	Attributes    *UserGroupAttributes    `json:"attributes,omitempty"`
	Relationships *UserGroupRelationships `json:"relationships,omitempty"`
	Links         *ResourceLinks          `json:"links,omitempty"`
}

UserGroup represents a user group resource.

type UserGroupAttributes

type UserGroupAttributes struct {
	OuId             string     `json:"ouId,omitempty"`
	Name             string     `json:"name,omitempty"`
	Type             string     `json:"type,omitempty"`
	TotalMemberCount int        `json:"totalMemberCount,omitempty"`
	CreatedDateTime  *time.Time `json:"createdDateTime,omitempty"`
	UpdatedDateTime  *time.Time `json:"updatedDateTime,omitempty"`
	Status           string     `json:"status,omitempty"`
}

UserGroupAttributes contains the attributes of a user group.

type UserGroupRelationships

type UserGroupRelationships struct {
	Users *RelationshipData `json:"users,omitempty"`
}

UserGroupRelationships contains relationship links for a user group.

type UserGroupResponse

type UserGroupResponse struct {
	Data  UserGroup `json:"data"`
	Links *Links    `json:"links,omitempty"`
}

UserGroupResponse is the response for a single user group.

type UserGroupUserLinkage

type UserGroupUserLinkage struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

UserGroupUserLinkage represents a user linkage (type + ID only).

type UserGroupUsersLinkagesResponse

type UserGroupUsersLinkagesResponse struct {
	Data  []UserGroupUserLinkage `json:"data"`
	Links *Links                 `json:"links,omitempty"`
	Meta  *Meta                  `json:"meta,omitempty"`
}

UserGroupUsersLinkagesResponse is the response for user ID linkages of a user group.

type UserGroups

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

UserGroups handles communication with the user groups related methods of the Apple Business Manager API.

Apple Business Manager API docs: https://developer.apple.com/documentation/applebusinessapi/get-user-groups

func NewService

func NewService(c client.Client) *UserGroups

NewService creates a new user groups service.

func (*UserGroups) GetByUserGroupIDV1

func (s *UserGroups) GetByUserGroupIDV1(ctx context.Context, groupID string, opts *RequestQueryOptions) (*UserGroupResponse, *resty.Response, error)

GetByUserGroupIDV1 retrieves information about a specific user group in an organization. URL: GET https://api-business.apple.com/v1/userGroups/{id} https://developer.apple.com/documentation/applebusinessapi/get-usergroup-information

func (*UserGroups) GetUserIDsByGroupIDV1

func (s *UserGroups) GetUserIDsByGroupIDV1(ctx context.Context, groupID string, opts *RequestQueryOptions) (*UserGroupUsersLinkagesResponse, *resty.Response, error)

GetUserIDsByGroupIDV1 retrieves a list of user IDs for a user group in an organization. URL: GET https://api-business.apple.com/v1/userGroups/{id}/relationships/users https://developer.apple.com/documentation/applebusinessapi/get-all-user-ids-for-a-user-group

type UserGroupsResponse

type UserGroupsResponse struct {
	Data  []UserGroup `json:"data"`
	Links *Links      `json:"links,omitempty"`
	Meta  *Meta       `json:"meta,omitempty"`
}

UserGroupsResponse is the response for a list of user groups.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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