automation

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 11 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

func WithCustomUserAgentString

func WithCustomUserAgentString(userAgent string) func(client *Client)

WithCustomUserAgentString allows to configure a custom user-agent string that the Client will send with each HTTP request If none is set, the default Monaco CLI specific user-agent is sent.

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 *rest.Client, opts ...ClientOption) *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 added in v2.5.0

func (a Client) Get(ctx context.Context, resourceType ResourceType, id string) (result *Response, err error)

Get returns a single automation object matching the given resource type and id or an error if a resource with the given ID and resourceType wasn't found

func (Client) List

func (a Client) List(ctx context.Context, resourceType ResourceType) (result []Response, err error)

List returns all automation objects

func (Client) Upsert

func (a Client) Upsert(ctx context.Context, 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 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

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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