automation

package
v1.57.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextPageURL

func NextPageURL(baseURL, path string, offset int) (string, error)

Types

type Client

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

Client can be used to interact with the Automation API

func NewClient

func NewClient(url string, client *http.Client) *Client

NewClient creates a new client to interact with the Automation API

func (Client) DELETE

func (a Client) DELETE(resourceType ResourceType, id string) (err error)

DELETE removes a given automation object by ID

func (Client) GET

func (a Client) GET(resourceType ResourceType, id string) (res *Response, err error)

GET returns one specific automation object

func (Client) INSERT

func (a Client) INSERT(resourceType ResourceType, data []byte) (id string, err error)

UPSERT creates a given automation object

func (Client) LIST

func (a Client) LIST(resourceType ResourceType) (res []Response, err error)

LIST returns all automation objects

func (Client) UPDATE

func (a Client) UPDATE(resourceType ResourceType, id string, data []byte) (err error)

UPDATE updates a given automation object

type Resource

type Resource struct {
	// Path is the API path to be used for this resource
	Path string
}

Resource specifies information about a specific resource

type ResourceType

type ResourceType int

ResourceType enumerates different kind of resources

const (
	Workflows ResourceType = iota
	BusinessCalendars
	SchedulingRules
)

type Response

type Response struct {
	// ID is the identifier that will be used when creating a new automation object
	ID string `json:"id"`
	// Data is the whole body of an automation object
	Data []byte `json:"-"`
}

Response is a "general" Response type holding the ID and the response payload

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(data []byte) error

UnmarshalJSON de-serializes JSON payload into Response type

type ResponseErr

type ResponseErr struct {
	StatusCode int
	Message    string
	Data       []byte
}

ResponseErr is used to return HTTP related information as an error

func (ResponseErr) Error

func (e ResponseErr) Error() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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