instatus_go

package module
v0.0.0-...-73f4ad7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const BaseUrl = "https://api.instatus.com"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(key string) *Client

func (*Client) CreateComponent

func (c *Client) CreateComponent(params CreateComponentRequest) (Component, error)

func (*Client) GetComponent

func (c *Client) GetComponent(params GetComponentRequest) (Component, error)

func (*Client) GetComponents

func (c *Client) GetComponents(params GetComponentsRequest) ([]Component, error)

func (*Client) GetPages

func (c *Client) GetPages(params GetPagesRequest) ([]Page, error)

func (*Client) UpdateComponent

func (c *Client) UpdateComponent(params UpdateComponentRequest) (Component, error)

type Component

type Component struct {
	Id                       string  `json:"id"`
	Name                     string  `json:"name"`
	NameTranslationId        *string `json:"nameTranslationId"`
	Description              *string `json:"description"`
	DescriptionTranslationId *string `json:"descriptionTranslationId"`
	// TODO: Enum
	Status                       string       `json:"status"`
	InternalStatus               string       `json:"internalStatus"`
	Order                        int          `json:"order"`
	ShowUptime                   bool         `json:"showUptime"`
	CreatedAt                    time.Time    `json:"createdAt"`
	UpdatedAt                    time.Time    `json:"updatedAt"`
	ArchivedAt                   *time.Time   `json:"archivedAt"`
	SiteId                       string       `json:"siteId"`
	UniqueEmail                  string       `json:"uniqueEmail"`
	OldGroup                     any          `json:"oldGroup"`
	GroupId                      *string      `json:"groupId"`
	IsParent                     bool         `json:"isParent"`
	IsCollapsed                  bool         `json:"isCollapsed"`
	MonitorId                    *string      `json:"monitorId"`
	NameHtml                     *string      `json:"nameHtml"`
	NameHtmlTranslationId        *string      `json:"nameHtmlTranslationId"`
	DescriptionHtml              *string      `json:"descriptionHtml"`
	DescriptionHtmlTranslationId *string      `json:"descriptionHtmlTranslationId"`
	IsThirdParty                 bool         `json:"isThirdParty"`
	ThirdPartyStatus             *string      `json:"thirdPartyStatus"`
	ThirdPartyComponentId        *string      `json:"thirdPartyComponentId"`
	ThirdPartyComponentServiceId *string      `json:"thirdPartyComponentServiceId"`
	ImportedFromStatuspage       bool         `json:"importedFromStatuspage"`
	StartDate                    *time.Time   `json:"startDate"`
	Group                        *Component   `json:"group"`
	Translations                 Translations `json:"translations"`
}

type CreateComponentFields

type CreateComponentFields struct {
	Name       string     `json:"name"`
	ShowUptime *bool      `json:"showUptime,omitempty"`
	StartDate  *time.Time `json:"startDate,omitempty"`
}

type CreateComponentRequest

type CreateComponentRequest struct {
	PageId string

	Fields CreateComponentFields
}

type Error

type Error struct {
	Details struct {
		Code    string `json:"code"`
		Message string `json:"message"`
	} `json:"error"`
}

func (Error) Error

func (e Error) Error() string

type GetComponentRequest

type GetComponentRequest struct {
	PageId      string
	ComponentId string
}

type GetComponentsRequest

type GetComponentsRequest struct {
	PageDetails

	PageId string
}

type GetPagesRequest

type GetPagesRequest struct {
	PageDetails
}

type Page

type Page struct {
	Id                   string     `json:"id"`
	Subdomain            string     `json:"subdomain"`
	Name                 string     `json:"name"`
	WorkspaceId          string     `json:"workspaceId"`
	LogoUrl              *string    `json:"logoUrl"`
	FaviconUrl           *string    `json:"faviconUrl"`
	WebsiteUrl           *string    `json:"websiteUrl"`
	CustomDomain         *string    `json:"customDomain"`
	PublicEmail          *string    `json:"publicEmail"`
	Twitter              *string    `json:"twitter"`
	Status               string     `json:"status"`
	SubscribeBySms       bool       `json:"subscribeBySms"`
	SendSmsNotifications bool       `json:"sendSmsNotifications"`
	Language             string     `json:"language"`
	UseLargeHeader       bool       `json:"useLargeHeader"`
	BrandColor           string     `json:"brandColor"`
	OkColor              string     `json:"okColor"`
	DisruptedColor       string     `json:"disruptedColor"`
	DegradedColor        string     `json:"degradedColor"`
	DownColor            string     `json:"downColor"`
	NoticeColor          string     `json:"noticeColor"`
	UnknownColor         string     `json:"unknownColor"`
	GoogleAnalytics      *string    `json:"googleAnalytics"`
	SmsService           *string    `json:"smsService"`
	HtmlInMeta           *string    `json:"htmlInMeta"`
	HtmlAboveHeader      *string    `json:"htmlAboveHeader"`
	HtmlBelowHeader      *string    `json:"htmlBelowHeader"`
	HtmlAboveFooter      *string    `json:"htmlAboveFooter"`
	HtmlBelowFooter      *string    `json:"htmlBelowFooter"`
	HtmlBelowSummary     *string    `json:"htmlBelowSummary"`
	UptimeDaysDisplay    string     `json:"uptimeDaysDisplay"`
	UptimeOutageDisplay  string     `json:"uptimeOutageDisplay"`
	LaunchDate           *time.Time `json:"launchDate"`
	CssGlobal            *string    `json:"cssGlobal"`
	Onboarded            *bool      `json:"onboarded"`
	CreatedAt            time.Time  `json:"createdAt"`
	UpdatedAt            time.Time  `json:"updatedAt"`
}

type PageDetails

type PageDetails struct {
	Page    int
	PerPage int
}

type Translations

type Translations struct {
	Name        map[string]string `json:"name"`
	Description map[string]string `json:"description"`
}

type UpdateComponentFields

type UpdateComponentFields struct {
	Status *string `json:"status,omitempty"`
}

type UpdateComponentRequest

type UpdateComponentRequest struct {
	PageId      string
	ComponentId string

	UpdatedFields UpdateComponentFields
}

Jump to

Keyboard shortcuts

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