jamfpro

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 5 Imported by: 553

Documentation

Overview

http_logging.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountDataSubsetGroup

type AccountDataSubsetGroup struct {
	ID         int                         `json:"id,omitempty" xml:"id,omitempty"`
	Name       string                      `json:"name" xml:"name"`
	Site       AccountDataSubsetSite       `json:"site,omitempty" xml:"site,omitempty"`
	Privileges AccountDataSubsetPrivileges `json:"privileges,omitempty" xml:"privileges,omitempty"`
}

type AccountDataSubsetLdapServer

type AccountDataSubsetLdapServer struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

type AccountDataSubsetPrivileges

type AccountDataSubsetPrivileges struct {
	JSSObjects    []string `json:"jss_objects,omitempty" xml:"jss_objects>privilege"`
	JSSSettings   []string `json:"jss_settings,omitempty" xml:"jss_settings>privilege"`
	JSSActions    []string `json:"jss_actions,omitempty" xml:"jss_actions>privilege"`
	Recon         []string `json:"recon,omitempty" xml:"recon>privilege"`
	CasperAdmin   []string `json:"casper_admin,omitempty" xml:"casper_admin>privilege"`
	CasperRemote  []string `json:"casper_remote,omitempty" xml:"casper_remote>privilege"`
	CasperImaging []string `json:"casper_imaging,omitempty" xml:"casper_imaging>privilege"`
}

type AccountDataSubsetSite

type AccountDataSubsetSite struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

type AccountDataSubsetUser

type AccountDataSubsetUser struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name,omitempty" xml:"name,omitempty"`
}

type AccountDetail

type AccountDetail struct {
	ID                  int                         `json:"id,omitempty" xml:"id,omitempty"`
	Name                string                      `json:"name" xml:"name"`
	DirectoryUser       bool                        `json:"directory_user,omitempty" xml:"directory_user,omitempty"`
	FullName            string                      `json:"full_name,omitempty" xml:"full_name,omitempty"`
	Email               string                      `json:"email,omitempty" xml:"email,omitempty"`
	EmailAddress        string                      `json:"email_address,omitempty" xml:"email_address,omitempty"`
	Enabled             string                      `json:"enabled,omitempty" xml:"enabled,omitempty"`
	LdapServer          AccountDataSubsetLdapServer `json:"ldap_server,omitempty" xml:"ldap_server,omitempty"`
	ForcePasswordChange bool                        `json:"force_password_change,omitempty" xml:"force_password_change,omitempty"`
	AccessLevel         string                      `json:"access_level,omitempty" xml:"access_level,omitempty"`
	Password            string                      `json:"password" xml:"password"`
	PrivilegeSet        string                      `json:"privilege_set,omitempty" xml:"privilege_set,omitempty"`
	Site                AccountDataSubsetSite       `json:"site,omitempty" xml:"site,omitempty"`
	Privileges          AccountDataSubsetPrivileges `json:"privileges,omitempty" xml:"privileges,omitempty"`
}

type AccountUser

type AccountUser struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

type BuildingDetail added in v0.0.8

type BuildingDetail struct {
	ID   int    `json:"id,omitempty" xml:"id,omitempty"`
	Name string `json:"name" xml:"name"`
}

type Client

type Client struct {
	HTTP *http_client.Client
}

func NewClient

func NewClient(baseURL string, config http_client.Config) *Client

NewClient creates a new Jamf Pro client

func (*Client) CreateAccountByID

func (c *Client) CreateAccountByID(accountDetail *AccountDetail) (*ResponseAccount, error)

CreateAccountByID creates an Account using its ID

func (*Client) DeleteAccountByID

func (c *Client) DeleteAccountByID(id int) (*http.Response, error)

DeleteAccountByID deletes an Account using its ID and returns a response.

func (*Client) GetAccountByID

func (c *Client) GetAccountByID(id int) (*ResponseAccount, error)

GetAccountByID retrieves the Account by its ID

func (*Client) GetAccountByName

func (c *Client) GetAccountByName(name string) (*ResponseAccount, error)

GetAccountByName retrieves the Account by its name

func (*Client) GetBuildingByID added in v0.0.8

func (c *Client) GetBuildingByID(id int) (*ResponseBuilding, error)

GetBuildingByID retrieves the Building by its ID

func (*Client) GetBuildingsByName added in v0.0.8

func (c *Client) GetBuildingsByName(name string) (*ResponseBuilding, error)

GetBuildingsByName retrieves the Building by its Name

func (*Client) GetGroupByID added in v0.0.8

func (c *Client) GetGroupByID(id int) (*ResponseAccountGroup, error)

GetGroupByID gets an account group using its ID and returns a response.

func (*Client) GetSSOFailoverSettings

func (c *Client) GetSSOFailoverSettings() (*SSOFailoverResponse, error)

GetSSOFailoverSettings fetches SSO failover settings from Jamf Pro

func (*Client) UpdateAccountByID

func (c *Client) UpdateAccountByID(id int, accountDetail *AccountDetail) (*ResponseAccount, error)

UpdateAccountByID updates an Account using its ID

func (*Client) UpdateAccountByName

func (c *Client) UpdateAccountByName(name string, accountDetail *AccountDetail) (*ResponseAccount, error)

UpdateAccountByName updates an Account using its name.

func (*Client) UpdateFailoverUrl

func (c *Client) UpdateFailoverUrl() (*SSOFailoverResponse, error)

UpdateFailoverUrl regenerates the failover URL by changing the failover key to a new one and returns the new failover settings.

type GroupDetail added in v0.0.8

type GroupDetail struct {
	ID           int                         `json:"id,omitempty" xml:"id"`
	Name         string                      `json:"name" xml:"name"`
	AccessLevel  string                      `json:"access_level" xml:"access_level"`
	PrivilegeSet string                      `json:"privilege_set" xml:"privilege_set"`
	Site         AccountDataSubsetSite       `json:"site" xml:"site"`
	Privileges   AccountDataSubsetPrivileges `json:"privileges" xml:"privileges"`
	Members      []AccountDataSubsetUser     `json:"members" xml:"members>user"`
}

type Groups

type Groups struct {
	Group []ResponseAccountGroup `json:"group,omitempty" xml:"group,omitempty"`
}

type Logger

type Logger interface {
	Trace(msg string, keysAndValues ...interface{}) // For very detailed logs
	Debug(msg string, keysAndValues ...interface{}) // For development and troubleshooting
	Info(msg string, keysAndValues ...interface{})  // Informational messages
	Warn(msg string, keysAndValues ...interface{})  // For potentially problematic situations
	Error(msg string, keysAndValues ...interface{}) // For errors that might still allow the app to continue running
	Fatal(msg string, keysAndValues ...interface{}) // For errors that might prevent the app from continuing
}

Logger is an interface for logging within the SDK.

func NewDefaultLogger

func NewDefaultLogger() Logger

NewDefaultLogger returns a new instance of the default logger.

type Privilege

type Privilege struct {
	Privilege string `json:"privilege,omitempty" xml:"privilege,omitempty"`
}

type ResponseAccount

type ResponseAccount struct {
	Account AccountDetail `json:"account"`
}

type ResponseAccountGroup

type ResponseAccountGroup struct {
	Groups []GroupDetail `json:"group"`
}

type ResponseAccountsList

type ResponseAccountsList struct {
	Users  Users  `json:"users,omitempty" xml:"users,omitempty"`
	Groups Groups `json:"groups,omitempty" xml:"groups,omitempty"`
}

type ResponseBuilding added in v0.0.8

type ResponseBuilding struct {
	Building BuildingDetail `json:"building"`
}

type SSOFailoverResponse

type SSOFailoverResponse struct {
	FailoverURL    string `json:"failoverUrl"`
	GenerationTime int64  `json:"generationTime"`
}

type Users

type Users struct {
	User []AccountUser `json:"user,omitempty" xml:"user,omitempty"`
}

Jump to

Keyboard shortcuts

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