integration

package
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

View Source
const (
	User       ResponderType = "user"
	Team       ResponderType = "team"
	Escalation ResponderType = "escalation"
	Schedule   ResponderType = "schedule"

	Create      ActionType = "create"
	Close       ActionType = "close"
	Acknowledge ActionType = "acknowledge"
	AddNote     ActionType = "AddNote"
	Ignore      ActionType = "ignore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIBasedIntegrationRequest

type APIBasedIntegrationRequest struct {
	client.BaseRequest
	Name                        string        `json:"name"`
	Type                        string        `json:"type"`
	AllowWriteAccess            *bool         `json:"allowWriteAccess"`
	IgnoreRespondersFromPayload *bool         `json:"ignoreRespondersFromPayload"`
	SuppressNotifications       *bool         `json:"suppressNotifications"`
	OwnerTeam                   *og.OwnerTeam `json:"ownerTeam,omitempty"`
	Responders                  []Responder   `json:"responders,omitempty"`
}

func (*APIBasedIntegrationRequest) Method

func (r *APIBasedIntegrationRequest) Method() string

func (*APIBasedIntegrationRequest) ResourcePath

func (r *APIBasedIntegrationRequest) ResourcePath() string

func (*APIBasedIntegrationRequest) Validate

func (r *APIBasedIntegrationRequest) Validate() error

type APIBasedIntegrationResult

type APIBasedIntegrationResult struct {
	client.ResultMetadata
	GenericFields
	ApiKey string `json:"apiKey"`
}

type AcknowledgeAction

type AcknowledgeAction struct {
	GenericActionFields
	User  string `json:"user"`
	Note  string `json:"note"`
	Alias string `json:"alias"`
}

type ActionType

type ActionType string

type ActionsResult

type ActionsResult struct {
	client.ResultMetadata
	Parent      ParentIntegration   `json:"_parent"`
	Ignore      []IntegrationAction `json:"ignore"`
	Create      []IntegrationAction `json:"create"`
	Close       []IntegrationAction `json:"close"`
	Acknowledge []IntegrationAction `json:"acknowledge"`
	AddNote     []IntegrationAction `json:"addNote"`
}

type AddNoteAction

type AddNoteAction struct {
	GenericActionFields
	User  string `json:"user"`
	Note  string `json:"note"`
	Alias string `json:"alias"`
}

type AuthenticateIntegrationRequest

type AuthenticateIntegrationRequest struct {
	client.BaseRequest
	Type string `json:"type"`
}

func (*AuthenticateIntegrationRequest) Method

func (*AuthenticateIntegrationRequest) ResourcePath

func (r *AuthenticateIntegrationRequest) ResourcePath() string

func (*AuthenticateIntegrationRequest) Validate

func (r *AuthenticateIntegrationRequest) Validate() error

type AuthenticateResult

type AuthenticateResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type Client

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

func NewClient

func NewClient(config *client.Config) (*Client, error)

func (*Client) Authenticate

func (c *Client) Authenticate(context context.Context, request *AuthenticateIntegrationRequest) (*AuthenticateResult, error)

func (*Client) CreateActions

func (c *Client) CreateActions(context context.Context, request *CreateIntegrationActionsRequest) (*ActionsResult, error)

func (*Client) CreateApiBased

func (c *Client) CreateApiBased(context context.Context, request *APIBasedIntegrationRequest) (*APIBasedIntegrationResult, error)

func (*Client) CreateEmailBased

func (c *Client) CreateEmailBased(context context.Context, request *EmailBasedIntegrationRequest) (*EmailBasedIntegrationResult, error)

func (*Client) CreateWebhook added in v1.2.2

func (c *Client) CreateWebhook(context context.Context, request *WebhookIntegrationRequest) (*WebhookIntegrationResult, error)

func (*Client) Delete

func (c *Client) Delete(context context.Context, request *DeleteIntegrationRequest) (*DeleteResult, error)

func (*Client) Disable

func (c *Client) Disable(context context.Context, request *DisableIntegrationRequest) (*DisableResult, error)

func (*Client) Enable

func (c *Client) Enable(context context.Context, request *EnableIntegrationRequest) (*EnableResult, error)

func (*Client) ForceUpdateAllFields

func (c *Client) ForceUpdateAllFields(context context.Context, request *UpdateIntegrationRequest) (*UpdateResult, error)

func (*Client) Get

func (c *Client) Get(context context.Context, request *GetRequest) (*GetResult, error)

func (*Client) GetActions

func (c *Client) GetActions(context context.Context, request *GetIntegrationActionsRequest) (*ActionsResult, error)

func (*Client) List

func (c *Client) List(context context.Context) (*ListResult, error)

func (*Client) UpdateAllActions

func (c *Client) UpdateAllActions(context context.Context, request *UpdateAllIntegrationActionsRequest) (*ActionsResult, error)

type CloseAction

type CloseAction struct {
	GenericActionFields
	User  string `json:"user"`
	Note  string `json:"note"`
	Alias string `json:"alias"`
}

type ConditionResult added in v1.0.1

type ConditionResult struct {
	Field         og.ConditionFieldType `json:"field,omitempty"`
	IsNot         bool                  `json:"not,omitempty"`
	Operation     og.ConditionOperation `json:"operation,omitempty"`
	ExpectedValue string                `json:"expectedValue,omitempty"`
	Key           string                `json:"key,omitempty"`
	Order         *int                  `json:"order,omitempty"`
}

type CreateAction

type CreateAction struct {
	GenericActionFields
	User                             string            `json:"user"`
	Note                             string            `json:"note"`
	Alias                            string            `json:"alias"`
	Source                           string            `json:"source"`
	Message                          string            `json:"message"`
	Description                      string            `json:"description"`
	Entity                           string            `json:"entity"`
	AppendAttachments                bool              `json:"appendAttachments"`
	IgnoreAlertActionsFromPayload    bool              `json:"ignoreAlertActionsFromPayload"`
	IgnoreRespondersFromPayload      bool              `json:"ignoreRespondersFromPayload"`
	IgnoreTagsFromPayload            bool              `json:"ignoreTagsFromPayload"`
	IgnoreExtraPropertiesFromPayload bool              `json:"ignoreExtraPropertiesFromPayload"`
	AlertActions                     []string          `json:"alertActions"`
	Responders                       []Responder       `json:"responders"`
	Tags                             []string          `json:"tags"`
	ExtraProperties                  map[string]string `json:"extraProperties"`
}

type CreateIntegrationActionsRequest

type CreateIntegrationActionsRequest struct {
	client.BaseRequest
	Id                               string
	Type                             ActionType        `json:"type"`
	Name                             string            `json:"name"`
	Alias                            string            `json:"alias"`
	Order                            int               `json:"order,omitempty"`
	User                             string            `json:"user,omitempty"`
	Note                             string            `json:"note,omitempty"`
	Filter                           *Filter           `json:"filter,omitempty"`
	Source                           string            `json:"source,omitempty"`
	Message                          string            `json:"message,omitempty"`
	Description                      string            `json:"description,omitempty"`
	Entity                           string            `json:"entity,omitempty"`
	AppendAttachments                *bool             `json:"appendAttachments,omitempty"`
	AlertActions                     []string          `json:"alertActions,omitempty"`
	IgnoreAlertActionsFromPayload    *bool             `json:"ignoreAlertActionsFromPayload,omitempty"`
	IgnoreRespondersFromPayload      *bool             `json:"ignoreRespondersFromPayload,omitempty"`
	IgnoreTagsFromPayload            *bool             `json:"ignoreTagsFromPayload,omitempty"`
	IgnoreExtraPropertiesFromPayload *bool             `json:"ignoreExtraPropertiesFromPayload,omitempty"`
	Responders                       []Responder       `json:"responders,omitempty"`
	Tags                             []string          `json:"tags,omitempty"`
	ExtraProperties                  map[string]string `json:"extraProperties,omitempty"`
}

func (*CreateIntegrationActionsRequest) Method

func (*CreateIntegrationActionsRequest) ResourcePath

func (r *CreateIntegrationActionsRequest) ResourcePath() string

func (*CreateIntegrationActionsRequest) Validate

func (r *CreateIntegrationActionsRequest) Validate() error

type DeleteIntegrationRequest

type DeleteIntegrationRequest struct {
	client.BaseRequest
	Id string
}

func (*DeleteIntegrationRequest) Method

func (r *DeleteIntegrationRequest) Method() string

func (*DeleteIntegrationRequest) ResourcePath

func (r *DeleteIntegrationRequest) ResourcePath() string

func (*DeleteIntegrationRequest) Validate

func (r *DeleteIntegrationRequest) Validate() error

type DeleteResult

type DeleteResult struct {
	client.ResultMetadata
	Result string `json:"result"`
}

type DisableIntegrationRequest

type DisableIntegrationRequest struct {
	client.BaseRequest
	Id string
}

func (*DisableIntegrationRequest) Method

func (r *DisableIntegrationRequest) Method() string

func (*DisableIntegrationRequest) ResourcePath

func (r *DisableIntegrationRequest) ResourcePath() string

func (*DisableIntegrationRequest) Validate

func (r *DisableIntegrationRequest) Validate() error

type DisableResult

type DisableResult struct {
	client.ResultMetadata
	GenericFields
}

type EmailBasedIntegrationRequest

type EmailBasedIntegrationRequest struct {
	client.BaseRequest
	Name                        string        `json:"name"`
	Type                        string        `json:"type"`
	EmailUsername               string        `json:"emailUsername"`
	IgnoreRespondersFromPayload *bool         `json:"ignoreRespondersFromPayload,omitempty"`
	SuppressNotifications       *bool         `json:"suppressNotifications,omitempty"`
	OwnerTeam                   *og.OwnerTeam `json:"ownerTeam,omitempty"`
	Responders                  []Responder   `json:"responders,omitempty"`
}

func (*EmailBasedIntegrationRequest) Method

func (*EmailBasedIntegrationRequest) ResourcePath

func (r *EmailBasedIntegrationRequest) ResourcePath() string

func (*EmailBasedIntegrationRequest) Validate

func (r *EmailBasedIntegrationRequest) Validate() error

type EmailBasedIntegrationResult

type EmailBasedIntegrationResult struct {
	client.ResultMetadata
	GenericFields
	EmailAddress string `json:"emailAddress"`
}

type EnableIntegrationRequest

type EnableIntegrationRequest struct {
	client.BaseRequest
	Id string
}

func (*EnableIntegrationRequest) Method

func (r *EnableIntegrationRequest) Method() string

func (*EnableIntegrationRequest) ResourcePath

func (r *EnableIntegrationRequest) ResourcePath() string

func (*EnableIntegrationRequest) Validate

func (r *EnableIntegrationRequest) Validate() error

type EnableResult

type EnableResult struct {
	client.ResultMetadata
	GenericFields
}

type Filter added in v1.2.0

type Filter struct {
	ConditionMatchType og.ConditionMatchType `json:"conditionMatchType,omitempty"`
	Conditions         []og.Condition        `json:"conditions,omitempty"`
}

type FilterResult added in v1.0.1

type FilterResult struct {
	ConditionMatchType og.ConditionMatchType `json:"conditionMatchType,omitempty"`
	Conditions         []ConditionResult     `json:"conditions,omitempty"`
}

type GenericActionFields

type GenericActionFields struct {
	Type   string       `json:"type"`
	Name   string       `json:"name"`
	Order  int          `json:"order"`
	Filter FilterResult `json:"filter"`
}

type GenericFields

type GenericFields struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Type    string `json:"type"`
	TeamId  string `json:"teamId"`
}

type GetIntegrationActionsRequest

type GetIntegrationActionsRequest struct {
	client.BaseRequest
	Id string
}

func (*GetIntegrationActionsRequest) Method

func (*GetIntegrationActionsRequest) ResourcePath

func (r *GetIntegrationActionsRequest) ResourcePath() string

func (*GetIntegrationActionsRequest) Validate

func (r *GetIntegrationActionsRequest) Validate() error

type GetRequest

type GetRequest struct {
	client.BaseRequest
	Id string
}

func (*GetRequest) Method

func (r *GetRequest) Method() string

func (*GetRequest) ResourcePath

func (r *GetRequest) ResourcePath() string

func (*GetRequest) Validate

func (r *GetRequest) Validate() error

type GetResult

type GetResult struct {
	client.ResultMetadata
	Data map[string]interface{} `json:"data"`
}

type IgnoreAction

type IgnoreAction struct {
	GenericActionFields
}

type IntegrationAction

type IntegrationAction struct {
	Type                             ActionType        `json:"type"`
	Name                             string            `json:"name"`
	Alias                            string            `json:"alias"`
	Order                            int               `json:"order,omitempty"`
	User                             string            `json:"user,omitempty"`
	Note                             string            `json:"note,omitempty"`
	Filter                           *Filter           `json:"filter,omitempty"`
	Source                           string            `json:"source,omitempty"`
	Message                          string            `json:"message,omitempty"`
	Description                      string            `json:"description,omitempty"`
	Entity                           string            `json:"entity,omitempty"`
	Priority                         string            `json:"priority,omitempty"`
	CustomPriority                   string            `json:"customPriority,omitempty"`
	AppendAttachments                *bool             `json:"appendAttachments,omitempty"`
	AlertActions                     []string          `json:"alertActions,omitempty"`
	IgnoreAlertActionsFromPayload    *bool             `json:"ignoreAlertActionsFromPayload,omitempty"`
	IgnoreRespondersFromPayload      *bool             `json:"ignoreRespondersFromPayload,omitempty"`
	IgnoreTagsFromPayload            *bool             `json:"ignoreTagsFromPayload,omitempty"`
	IgnoreExtraPropertiesFromPayload *bool             `json:"ignoreExtraPropertiesFromPayload,omitempty"`
	Responders                       []Responder       `json:"responders,omitempty"`
	Tags                             []string          `json:"tags,omitempty"`
	ExtraProperties                  map[string]string `json:"extraProperties,omitempty"`
	Recipients                       []Responder       `json:"recipients,omitempty"`
}

type ListResult

type ListResult struct {
	client.ResultMetadata
	Integrations []GenericFields `json:"data"`
}

type OtherFields

type OtherFields map[string]interface{}

func (OtherFields) Metadata

func (r OtherFields) Metadata(apiRequest client.ApiRequest) map[string]interface{}

func (OtherFields) Method

func (r OtherFields) Method() string

func (OtherFields) RequestParams

func (r OtherFields) RequestParams() map[string]string

func (OtherFields) ResourcePath

func (r OtherFields) ResourcePath() string

func (OtherFields) Validate

func (r OtherFields) Validate() error

type ParentIntegration

type ParentIntegration struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Type    string `json:"type"`
}

type Responder

type Responder struct {
	Type     ResponderType `json:"type, omitempty"`
	Name     string        `json:"name,omitempty"`
	Id       string        `json:"id,omitempty"`
	Username string        `json:"username, omitempty"`
}

type ResponderType

type ResponderType string

type UpdateAllIntegrationActionsRequest

type UpdateAllIntegrationActionsRequest struct {
	client.BaseRequest
	Id          string
	Create      []IntegrationAction `json:"create"`
	Close       []IntegrationAction `json:"close"`
	Acknowledge []IntegrationAction `json:"acknowledge"`
	AddNote     []IntegrationAction `json:"addNote"`
	Ignore      []IntegrationAction `json:"ignore"`
}

func (*UpdateAllIntegrationActionsRequest) Method

func (*UpdateAllIntegrationActionsRequest) ResourcePath

func (r *UpdateAllIntegrationActionsRequest) ResourcePath() string

func (*UpdateAllIntegrationActionsRequest) Validate

type UpdateIntegrationRequest

type UpdateIntegrationRequest struct {
	client.BaseRequest
	Id                          string
	Name                        string
	Type                        string
	EmailUsername               string
	WebhookUrl                  string
	Enabled                     *bool
	IgnoreRespondersFromPayload *bool
	SuppressNotifications       *bool
	Responders                  []Responder
	AddAlertDescription         *bool
	AddAlertDetails             *bool
	OwnerTeam                   *og.OwnerTeam `json:"ownerTeam,omitempty"`
	Headers                     map[string]string
	OtherFields
}

type UpdateResult

type UpdateResult struct {
	client.ResultMetadata
	Data map[string]interface{} `json:"data"`
}

type WebhookIntegrationRequest added in v1.2.2

type WebhookIntegrationRequest struct {
	client.BaseRequest
	Name                  string            `json:"name"`
	Type                  string            `json:"type"`
	AllowWriteAccess      *bool             `json:"allowWriteAccess"`
	SuppressNotifications *bool             `json:"suppressNotifications"`
	OwnerTeam             *og.OwnerTeam     `json:"ownerTeam,omitempty"`
	Responders            []Responder       `json:"responders,omitempty"`
	WebhookUrl            string            `json:"url"`
	AddAlertDescription   *bool             `json:"addAlertDescription"`
	AddAlertDetails       *bool             `json:"addAlertDetails"`
	Headers               map[string]string `json:"headers,omitempty"`
}

func (*WebhookIntegrationRequest) Method added in v1.2.2

func (r *WebhookIntegrationRequest) Method() string

func (*WebhookIntegrationRequest) ResourcePath added in v1.2.2

func (r *WebhookIntegrationRequest) ResourcePath() string

func (*WebhookIntegrationRequest) Validate added in v1.2.2

func (r *WebhookIntegrationRequest) Validate() error

type WebhookIntegrationResult added in v1.2.2

type WebhookIntegrationResult struct {
	client.ResultMetadata
	GenericFields
	ApiKey string `json:"apiKey"`
}

Jump to

Keyboard shortcuts

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