client

package
v0.4.3-final-apache Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int

func Int(i int) *int

func String

func String(s string) *string

Types

type AlertsData

type AlertsData struct {
	CurrentPage int   `json:"current_page"`
	LastPage    int   `json:"last_page"`
	NextPage    *int  `json:"next_page"`
	Total       int   `json:"total"`
	Alerts      []any `json:"alerts"`
}

type CasesData

type CasesData struct {
	CurrentPage int   `json:"current_page"`
	LastPage    int   `json:"last_page"`
	NextPage    *int  `json:"next_page"`
	Total       int   `json:"total"`
	Cases       []any `json:"cases"`
}

type Client

type Client interface {
	ListCases(ctx context.Context, req *ListCasesReq) (*ListCasesRes, error)
	ListAlerts(ctx context.Context, req *ListAlertsReq) (*ListAlertsRes, error)
}

func New

func New(url, apiKey string, insecure bool) Client

type Error

type Error struct {
	Status  string `json:"status"`
	Message string `json:"message"`
}

func (*Error) Error

func (err *Error) Error() string

type IntList

type IntList []int

func (IntList) EncodeValues

func (list IntList) EncodeValues(key string, v *url.Values) error

type ListAlertsReq

type ListAlertsReq struct {
	Page                  int        `url:"page"`
	PerPage               *int       `url:"per_page,omitempty"`
	Sort                  *string    `url:"sort,omitempty"`
	AlertIDs              IntList    `url:"alert_ids,omitempty"`
	AlertTags             StringList `url:"alert_tags,omitempty"`
	AlertSource           *string    `url:"alert_source,omitempty"`
	CaseID                *int       `url:"case_id,omitempty"`
	AlertOwnerID          *int       `url:"alert_owner_id,omitempty"`
	AlertStatusID         *int       `url:"alert_status_id,omitempty"`
	AlertSeverityID       *int       `url:"alert_severity_id,omitempty"`
	AlertClassificationID *int       `url:"alert_classification_id,omitempty"`
	AlertCustomerID       *int       `url:"alert_customer_id,omitempty"`
	AlertStartDate        *string    `url:"alert_start_date,omitempty"`
	AlertEndDate          *string    `url:"alert_end_date,omitempty"`
}

type ListAlertsRes

type ListAlertsRes struct {
	Status  string      `json:"status"`
	Message string      `json:"message"`
	Data    *AlertsData `json:"data"`
}

type ListCasesReq

type ListCasesReq struct {
	Page           int     `url:"page"`
	PerPage        *int    `url:"per_page,omitempty"`
	CaseIDs        IntList `url:"case_ids,omitempty"`
	CaseCustomerID *int    `url:"case_customer_id,omitempty"`
	CaseOwnerID    *int    `url:"case_owner_id,omitempty"`
	CaseSeverityID *int    `url:"case_severity_id,omitempty"`
	CaseStateID    *int    `url:"case_state_id,omitempty"`
	CaseSocID      *string `url:"case_soc_id,omitempty"`
	Sort           *string `url:"sort,omitempty"`
	StartOpenDate  *string `url:"start_open_date,omitempty"`
	EndOpenDate    *string `url:"end_open_date,omitempty"`
}

type ListCasesRes

type ListCasesRes struct {
	Status  string     `json:"status"`
	Message string     `json:"message"`
	Data    *CasesData `json:"data"`
}

type StringList

type StringList []string

func (StringList) EncodeValues

func (list StringList) EncodeValues(key string, v *url.Values) error

Jump to

Keyboard shortcuts

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