models

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type AddExceptionObjectInput

type AddExceptionObjectInput struct {
	Match   string   `json:"match"`
	Actions []string `json:"actions"`
	Comment string   `json:"comment,omitempty"`
}

type CreateExceptionBehaviorInput

type CreateExceptionBehaviorInput struct {
	Name       string                 `json:"name,omitempty"`
	Visibility string                 `json:"visibility,omitempty"`
	Exceptions []ExceptionObjectInput `json:"exceptions,omitempty"`
}

CreateExceptionBehaviorInput represents the api input for creating an Exception behavior object

type ExceptionBehavior

type ExceptionBehavior struct {
	ID         string            `json:"id"`
	Name       string            `json:"name"`
	Exceptions ExceptionsObjects `json:"exceptions"`
}

ExceptionBehavior represents an exception behavior object as it is returned from the API

type ExceptionObject

type ExceptionObject struct {
	ID      string                  `json:"id"`
	Match   string                  `json:"match"`
	Actions []ExceptionObjectAction `json:"actions"`
	Comment string                  `json:"comment,omitempty"`
}

func (ExceptionObject) ToSchema

func (exception ExceptionObject) ToSchema() SchemaExceptionObject

type ExceptionObjectAction

type ExceptionObjectAction struct {
	ID     string `json:"id"`
	Action string `json:"action"`
}

type ExceptionObjectInput

type ExceptionObjectInput struct {
	ID      string   `json:"id,omitempty"`
	Match   string   `json:"match"`
	Actions []string `json:"actions"`
	Comment string   `json:"comment,omitempty"`
}

type ExceptionsObjects

type ExceptionsObjects []ExceptionObject

func (ExceptionsObjects) ToSchema

func (exceptions ExceptionsObjects) ToSchema() []SchemaExceptionObject

type Match

type Match struct {
	Type     string   `json:"type"`
	Operator string   `json:"op"`
	Items    []Match  `json:"items,omitempty"`
	Key      string   `json:"key,omitempty"`
	Value    []string `json:"value,omitempty"`
}

type SchemaExceptionObject

type SchemaExceptionObject struct {
	ID       string                  `json:"id,omitempty"`
	Match    []SchemaMatchExpression `json:"match"`
	Action   string                  `json:"action"`
	ActionID string                  `json:"action_id,omitempty"`
	Comment  string                  `json:"comment,omitempty"`
}

type SchemaMatchExpression

type SchemaMatchExpression struct {
	Operator string                  `json:"operator,omitempty"`
	Operands []SchemaMatchExpression `json:"operand,omitempty"`
	Key      string                  `json:"key,omitempty"`
	Value    []string                `json:"value,omitempty"`
}

func MatchToSchema

func MatchToSchema(match Match) SchemaMatchExpression

type UpdateExceptionBehaviorInput

type UpdateExceptionBehaviorInput struct {
	Name             string                    `json:"name,omitempty"`
	AddExceptions    []AddExceptionObjectInput `json:"addExceptions,omitempty"`
	RemoveExceptions []string                  `json:"removeExceptions,omitempty"`
}

Jump to

Keyboard shortcuts

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