exceptions

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateExceptionBehaviorInputFromResourceData

func CreateExceptionBehaviorInputFromResourceData(d *schema.ResourceData) (models.CreateExceptionBehaviorInput, error)

func DeleteExceptionBehavior

func DeleteExceptionBehavior(c *api.Client, id string) (bool, error)

func ExceptionsDiff

func ExceptionsDiff(old, new []SchemaExceptionBehavior) (added, removed []string)

ExceptionsDiff returns the diff of old and new

func ExceptionsUpdate

func ExceptionsUpdate(oldIDs, newValues []string) (added, removed []string)

ExceptionsUpdate returns the exceptions update input for update operation, it deletes all the old exceptions and adds the new ones

func GetExceptionBehavior

func GetExceptionBehavior(c *api.Client, id string) (models.ExceptionBehavior, error)

func ParseSchemaMatchToInput

func ParseSchemaMatchToInput(matchFromSchema models.SchemaMatchExpression) models.Match

func ReadExceptionBehaviorToResourceData

func ReadExceptionBehaviorToResourceData(behavior models.ExceptionBehavior, d *schema.ResourceData) error

func UpdateExceptionBehavior

func UpdateExceptionBehavior(c *api.Client, id string, input models.UpdateExceptionBehaviorInput) (bool, error)

func UpdateExceptionBehaviorInputFromResourceData

func UpdateExceptionBehaviorInputFromResourceData(d *schema.ResourceData) (models.UpdateExceptionBehaviorInput, error)

Types

type Action

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

func NewAction

func NewAction(action string) Action

type CreateExceptionBehaviorInput

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

type CreateExceptionBehaviorResponse

type CreateExceptionBehaviorResponse struct {
	ID string `json:"id"`
}

type ExceptionBehavior

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

type ExceptionBehaviorUpdateInput

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

type ExceptionObject

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

type ExceptionObjectAction

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

type ExceptionObjectInput

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

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"`
}

func AndMatchFromMap

func AndMatchFromMap(m map[string]string) Match

func (Match) String

func (m Match) String() string

func (Match) ToSchemaMap

func (m Match) ToSchemaMap() map[string]interface{}

type SchemaExceptionBehavior

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

type SchemaExceptionObject

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

type UpdateExceptionBehaviorInput

type UpdateExceptionBehaviorInput struct {
	ID            string                       `json:"id"`
	BehaviorInput ExceptionBehaviorUpdateInput `json:"behaviorInput"`
}

Jump to

Keyboard shortcuts

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