jamfpro

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// The Http Client that is used to make requests
	HttpClient       *http.Client
	HttpRetryTimeout time.Duration

	// Option to specify extra headers like User-Agent
	ExtraHeader map[string]string
	// contains filtered or unexported fields
}

Client struct stores an object to talk with Jamf API

func NewClient

func NewClient(username, password, url string) (*Client, error)

NewClient ... returns a new jamf.Client which can be used to access the API

func NewOauthClient

func NewOauthClient(clientID, clientSecret, url string) (*Client, error)

NewOauthClient ... returns a new jamf.Client which can be used to access the API with OAuth

func (*Client) DoBinaryRequest

func (c *Client) DoBinaryRequest(method, url string, body interface{}, headers map[string]string) ([]byte, error)

DoBinaryRequest sends an HTTP request and returns the raw binary response.

func (*Client) DoPackageUploadRequest

func (c *Client) DoPackageUploadRequest(api, pkgName, pkgPath string, objID int) error

DoPackageUploadRequest as part of jamfUploader

func (*Client) DoRawRequest

func (c *Client) DoRawRequest(api string, params *url.Values) (string, error)

DoRawRequest is a specialized function to handle raw string responses like extracting certificate public keys

func (*Client) DoRequest

func (c *Client) DoRequest(method, api string, reqbody interface{}, params *url.Values, out interface{}) error

doJsonRequest ... A method to send a request to the jamf api

func (*Client) DoRequestDebug

func (c *Client) DoRequestDebug(method, api string, reqbody interface{}, params *url.Values, out interface{}) error

----------------- Debug Request -----------------// Orchestrates the entire request-response cycle for a debug request.

type Error

type Error interface {
	Error() string
	StatusCode() int
	URI() string
	Body() string
}

Jump to

Keyboard shortcuts

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