jamf

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID             string `json:"id"`
	Username       string `json:"username"`
	RealName       string `json:"realName"`
	Email          string `json:"email"`
	MultiSiteAdmin bool   `json:"multiSiteAdmin"`
	AccessLevel    string `json:"accessLevel"`
	PrivilegeSet   string `json:"privilegeSet"`
	CurrentSiteID  string `json:"currentSiteId"`
}

type AccountsResponse added in v0.0.4

type AccountsResponse struct {
	Accounts BaseAccount `json:"accounts"`
}

type BaseAccount

type BaseAccount struct {
	Users  []User  `json:"users"`
	Groups []Group `json:"groups"`
}

type BaseType

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

type Client

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

func NewClient

func NewClient(
	wrapper *uhttp.BaseHttpClient,
	token string,
	instanceURL string,
) *Client

func (*Client) CreateBearerToken added in v0.0.4

func (c *Client) CreateBearerToken(
	ctx context.Context,
	username string,
	password string,
) (string, error)

CreateBearerToken creates bearer token needed to use the Jamf API.

func (*Client) GetAccounts

func (c *Client) GetAccounts(ctx context.Context) ([]*UserAccount, []*Group, error)

GetAccounts returns all Jamf accounts. TODO(marcos): The Jamf API doesn't have pagination, but this method could benefit from parallelization.

func (*Client) GetGroupDetails

func (c *Client) GetGroupDetails(ctx context.Context, groupId int) (*Group, error)

GetGroupDetails returns Jamf group details.

func (*Client) GetSites

func (c *Client) GetSites(ctx context.Context) (*[]Site, error)

GetSites returns all Jamf sites.

func (*Client) GetTokenDetails

func (c *Client) GetTokenDetails(ctx context.Context) (*TokenDetails, error)

GetTokenDetails gets authorization details associated with the current api token.

func (*Client) GetUserAccountDetails

func (c *Client) GetUserAccountDetails(ctx context.Context, userId int) (*UserAccount, error)

GetUserAccountDetails returns Jamf user account details.

func (*Client) GetUserGroupDetails

func (c *Client) GetUserGroupDetails(ctx context.Context, userGroupId int) (*UserGroup, error)

GetUserGroupDetails returns Jamf user group details.

func (*Client) GetUserGroups

func (c *Client) GetUserGroups(ctx context.Context) ([]*UserGroup, error)

GetUserGroups returns all Jamf user groups.

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context) ([]*User, error)

GetUsers returns all Jamf users.

func (*Client) SetBearerToken added in v0.0.4

func (c *Client) SetBearerToken(token string)

type Group

type Group struct {
	BaseType
	AccessLevel  string   `json:"access_level"`
	PrivilegeSet string   `json:"privilege_set"`
	Site         BaseType `json:"site"`
	Members      []struct {
		User BaseType `json:"user"`
	} `json:"members"`
}

type GroupResponse added in v0.0.4

type GroupResponse struct {
	Group Group `json:"group"`
}

type Site

type Site struct {
	BaseType
}

type SitesResponse added in v0.0.4

type SitesResponse struct {
	Sites []Site `json:"sites"`
}

type TokenDetails

type TokenDetails struct {
	Account Account `json:"account"`
	Sites   []struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"sites"`
	AuthenticationType string `json:"authenticationType"`
}

type TokenResponse added in v0.0.4

type TokenResponse struct {
	Token   string `json:"token"`
	Expires string `json:"expires"`
}

type User

type User struct {
	BaseType
	FullName     string `json:"full_name"`
	Email        string `json:"email"`
	EmailAddress string `json:"email_address"`
	Username     string `json:"username"`
	Sites        []struct {
		Site BaseType `json:"site"`
	} `json:"sites"`
}

User - end user in Jamf.

type UserAccount

type UserAccount struct {
	BaseType
	FullName     string   `json:"full_name"`
	Email        string   `json:"email"`
	EmailAddress string   `json:"email_address"`
	Enabled      string   `json:"enabled"`
	AccessLevel  string   `json:"access_level"`
	PrivilegeSet string   `json:"privilege_set"`
	Site         BaseType `json:"site"`
}

UserAccount - user that has access to their system and can be granted permissions.

type UserAccountResponse added in v0.0.4

type UserAccountResponse struct {
	UserAccount UserAccount `json:"account"`
}

type UserGroup

type UserGroup struct {
	BaseType
	IsSmart bool   `json:"is_smart"`
	Site    Site   `json:"site"`
	Users   []User `json:"users"`
}

type UserGroupResponse added in v0.0.4

type UserGroupResponse struct {
	UserGroup UserGroup `json:"user_group"`
}

type UserGroupsResponse added in v0.0.4

type UserGroupsResponse struct {
	UserGroups []UserGroup `json:"user_groups"`
}

type UserResponse added in v0.0.4

type UserResponse struct {
	User User `json:"user"`
}

type UsersResponse added in v0.0.4

type UsersResponse struct {
	Users []BaseType `json:"users"`
}

Jump to

Keyboard shortcuts

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