automation

package
v0.0.5-invalid-tag Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClientRequestLimiter

func WithClientRequestLimiter(limiter *concurrency.Limiter) func(client *Client)

WithClientRequestLimiter specifies that a specifies the limiter to be used for limiting parallel client requests

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, opts ...ClientOption) *Client

NewClient creates a new client to interact with the Automation API

func (Client) List

func (a Client) List(resourceType ResourceType) (result *ListResponse, err error)

List returns all automation objects

func (Client) Upsert

func (a Client) Upsert(resourceType ResourceType, id string, data []byte) (result *Response, err error)

Upsert creates or updates a given automation object

type ClientOption

type ClientOption func(*Client)

ClientOption are (optional) additional parameter passed to the creation of an automation client

type ListResponse

type ListResponse struct {
	Count   int        `json:"count"`
	Results []Response `json:"results"`
}

ListResponse Response is a "general" List of Response values holding the ID and the response payload each

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

UnarshalJSON 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

Jump to

Keyboard shortcuts

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