users

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldFirstName           = "firstName"
	FieldLastName            = "lastName"
	FieldMiddleName          = "middleName"
	FieldStatus              = "status"
	FieldManagedAppleAccount = "managedAppleAccount"
	FieldIsExternalUser      = "isExternalUser"
	FieldRoleOuList          = "roleOuList"
	FieldEmail               = "email"
	FieldEmployeeNumber      = "employeeNumber"
	FieldCostCenter          = "costCenter"
	FieldDivision            = "division"
	FieldDepartment          = "department"
	FieldJobTitle            = "jobTitle"
	FieldStartDateTime       = "startDateTime"
	FieldCreatedDateTime     = "createdDateTime"
	FieldUpdatedDateTime     = "updatedDateTime"
	FieldPhoneNumbers        = "phoneNumbers"
)

Field constants for fields[users] query parameter.

View Source
const (
	UserStatusActive   = "ACTIVE"
	UserStatusInactive = "INACTIVE"
)

UserStatus constants for status 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 PhoneNumber

type PhoneNumber struct {
	PhoneNumber string `json:"phoneNumber,omitempty"`
	Type        string `json:"type,omitempty"`
}

PhoneNumber represents a phone number with its type.

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 endpoints.

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

type RoleOu

type RoleOu struct {
	RoleName string `json:"roleName,omitempty"`
	OuId     string `json:"ouId,omitempty"`
}

RoleOu represents a role and organizational unit assignment.

type User

type User struct {
	ID         string          `json:"id"`
	Type       string          `json:"type"`
	Attributes *UserAttributes `json:"attributes,omitempty"`
	Links      *ResourceLinks  `json:"links,omitempty"`
}

User represents a user resource.

type UserAttributes

type UserAttributes struct {
	FirstName           string        `json:"firstName,omitempty"`
	LastName            string        `json:"lastName,omitempty"`
	MiddleName          string        `json:"middleName,omitempty"`
	Status              string        `json:"status,omitempty"`
	ManagedAppleAccount string        `json:"managedAppleAccount,omitempty"`
	IsExternalUser      bool          `json:"isExternalUser,omitempty"`
	RoleOuList          []RoleOu      `json:"roleOuList,omitempty"`
	Email               string        `json:"email,omitempty"`
	EmployeeNumber      string        `json:"employeeNumber,omitempty"`
	CostCenter          string        `json:"costCenter,omitempty"`
	Division            string        `json:"division,omitempty"`
	Department          string        `json:"department,omitempty"`
	JobTitle            string        `json:"jobTitle,omitempty"`
	StartDateTime       *time.Time    `json:"startDateTime,omitempty"`
	CreatedDateTime     *time.Time    `json:"createdDateTime,omitempty"`
	UpdatedDateTime     *time.Time    `json:"updatedDateTime,omitempty"`
	PhoneNumbers        []PhoneNumber `json:"phoneNumbers,omitempty"`
}

UserAttributes contains the attributes of a user.

type UserResponse

type UserResponse struct {
	Data  User   `json:"data"`
	Links *Links `json:"links,omitempty"`
}

UserResponse is the response for a single user.

type Users

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

Users handles communication with the users related methods of the Apple Business Manager API.

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

func NewService

func NewService(c client.Client) *Users

NewService creates a new users service.

func (*Users) GetByUserIDV1

func (s *Users) GetByUserIDV1(ctx context.Context, userID string, opts *RequestQueryOptions) (*UserResponse, *resty.Response, error)

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

func (*Users) GetV1

GetV1 retrieves a list of users in an organization. URL: GET https://api-business.apple.com/v1/users https://developer.apple.com/documentation/applebusinessapi/get-users

type UsersResponse

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

UsersResponse is the response for a list of users.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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