flashduty

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

go-flashduty

The official Go client for the Flashduty Open API — a thin, typed SDK covering every Flashduty REST endpoint.

📖 API reference: https://docs.flashcat.cloud/en/openapi/introduction

Status: All 224 Open API endpoints across 21 services are generated from the Flashduty OpenAPI specification, covered by unit tests, and validated end-to-end against the live API.

Install

go get github.com/flashcatcloud/go-flashduty

Requires Go 1.24+.

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	flashduty "github.com/flashcatcloud/go-flashduty"
)

func main() {
	client, err := flashduty.NewClient("YOUR_APP_KEY")
	if err != nil {
		log.Fatal(err)
	}

	list, resp, err := client.Incidents.List(context.Background(), &flashduty.ListIncidentsRequest{
		Progress:    "Triggered",
		ListOptions: flashduty.ListOptions{Limit: 20},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("request_id=%s total=%d has_next=%t\n", resp.RequestID, resp.Total, resp.HasNextPage)
	for _, inc := range list.Items {
		fmt.Printf("[%s] %s\n", inc.IncidentSeverity, inc.Title)
	}
}

Design

  • Thin and typed. Every method maps to exactly one HTTP call and returns (*T, *Response, error). No hidden cross-endpoint enrichment.
  • Service-grouped. Endpoints are organized into services on the client (client.Incidents, client.Alerts, …), generated from the OpenAPI specification.
  • Composable transport. Cross-cutting concerns (retry, caching, tracing, rate-limit handling) compose as http.RoundTripper middleware via WithTransport.
Options
client, err := flashduty.NewClient("YOUR_APP_KEY",
	flashduty.WithBaseURL("https://api.flashcat.cloud"),
	flashduty.WithTimeout(10*time.Second),
	flashduty.WithUserAgent("my-app/1.0"),
	flashduty.WithHTTPClient(customHTTPClient),
	flashduty.WithTransport(customRoundTripper),
	flashduty.WithLogger(myLogger),
	flashduty.WithRequestHeaders(staticHeaders),
	flashduty.WithRequestHook(func(req *http.Request) { /* e.g. inject traceparent */ }),
)
Errors and rate limits
_, _, err := client.Incidents.Info(ctx, &flashduty.IncidentInfoRequest{IncidentID: "does-not-exist"})

var apiErr *flashduty.ErrorResponse
if errors.As(err, &apiErr) {
	fmt.Println(apiErr.Code, apiErr.RequestID)
}

var rl *flashduty.RateLimitError
if errors.As(err, &rl) {
	time.Sleep(rl.RetryAfter)
}

Typed predicates save you the string comparison and see through wrapped errors (errors.As under the hood):

if flashduty.IsNotFound(err) { /* ... */ }
if flashduty.IsRateLimited(err) { /* ... */ }
switch flashduty.ErrorCodeOf(err) {
case flashduty.ErrorCodeAccessDenied, flashduty.ErrorCodeUnauthorized:
	// handle auth failures
}
Retries

Automatic retries are not built into the core. Compose them at the transport layer with the optional retry subpackage — a safe-by-default retrying http.RoundTripper (retries 429 and 5xx, honors Retry-After, deterministic exponential backoff, and only replays requests whose body is replayable, which all SDK requests are):

import "github.com/flashcatcloud/go-flashduty/retry"

client, err := flashduty.NewClient("YOUR_APP_KEY",
	flashduty.WithTransport(retry.New(
		retry.WithMaxRetries(3),
	)),
)

License

Apache-2.0

Documentation

Overview

Package flashduty is the official Go client for the Flashduty Open API (https://flashcat.cloud). It is a thin, typed wrapper: every method maps to exactly one HTTP call, returns (*T, *Response, error), and performs no hidden cross-endpoint enrichment.

Create a client with an app key:

client, err := flashduty.NewClient("APP_KEY")
if err != nil {
	// handle error
}

Endpoints are grouped into services on the client, e.g. client.Incidents.List(ctx, &flashduty.IncidentListRequest{...}). Most are POST actions; a few read endpoints are GET with query parameters. Services are added by the code generator; see internal/cmd/gen.

Cross-cutting transport concerns (retry, caching, tracing, rate-limit handling) compose as http.RoundTripper middleware via WithTransport. The optional retry subpackage provides a safe-by-default retrying transport.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAccessDenied

func IsAccessDenied(err error) bool

IsAccessDenied reports whether err carries the AccessDenied API error code.

func IsInvalidParameter

func IsInvalidParameter(err error) bool

IsInvalidParameter reports whether err carries the InvalidParameter API error code.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err carries the ResourceNotFound API error code.

func IsRateLimited

func IsRateLimited(err error) bool

IsRateLimited reports whether err represents a rate-limit condition.

It returns true when the error chain contains a *RateLimitError (regardless of the code it carries) or when the resolved code is RequestTooFrequently.

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized reports whether err carries the Unauthorized API error code.

Types

type AckIncidentRequest

type AckIncidentRequest struct {
	// Incident IDs to acknowledge. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

AckIncidentRequest is generated from the Flashduty OpenAPI schema.

type AddIncidentResponderRequest

type AddIncidentResponderRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Optional notification override. Defaults to following each person's personal preference.
	Notify AddIncidentResponderRequestNotify `json:"notify,omitempty"`
	// Member IDs to add as responders.
	PersonIDs []int64 `json:"person_ids,omitempty"`
}

AddIncidentResponderRequest is generated from the Flashduty OpenAPI schema.

type AddIncidentResponderRequestNotify

type AddIncidentResponderRequestNotify struct {
	// When true, fall back to each responder's personal preference.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Channels to use (e.g. `voice`, `sms`, `email`).
	PersonalChannels []string `json:"personal_channels,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
}

AddIncidentResponderRequestNotify is generated from the Flashduty OpenAPI schema.

type AffectedStatusPageComponentItem

type AffectedStatusPageComponentItem struct {
	// Timestamp when the component was first available, in unix seconds.
	AvailableSinceSeconds int64 `json:"available_since_seconds,omitempty"`
	// Component ID.
	ComponentID string `json:"component_id,omitempty"`
	// Component description.
	Description string `json:"description,omitempty"`
	// When true, the component is hidden entirely from summary endpoints.
	HideAll bool `json:"hide_all,omitempty"`
	// When true, uptime data is hidden from summary responses.
	HideUptime bool `json:"hide_uptime,omitempty"`
	// Component display name.
	Name string `json:"name,omitempty"`
	// Display order within its section.
	OrderID int64 `json:"order_id,omitempty"`
	// Parent section ID.
	SectionID string `json:"section_id,omitempty"`
	// Current component status resulting from the event.
	Status string `json:"status,omitempty"`
}

AffectedStatusPageComponentItem is generated from the Flashduty OpenAPI schema.

type AlertEnrichmentService

type AlertEnrichmentService service

AlertEnrichmentService handles the "On-call/Alert enrichment" API resource.

func (*AlertEnrichmentService) EnrichmentReadInfo

Get enrichment rules.

Return the enrichment rule set configured for a specific integration.

API: POST /enrichment/info (enrichment-read-info).

func (*AlertEnrichmentService) EnrichmentReadList

List enrichment rules.

Return the enrichment rule sets for a list of integration IDs.

API: POST /enrichment/list (enrichment-read-list).

func (*AlertEnrichmentService) EnrichmentWriteUpsert

func (s *AlertEnrichmentService) EnrichmentWriteUpsert(ctx context.Context, req *EnrichmentUpsertRequest) (*Response, error)

Upsert enrichment rules.

Create or fully replace the enrichment rule set for an integration. The entire `rules` array is replaced atomically.

API: POST /enrichment/upsert (enrichment-write-upsert).

func (*AlertEnrichmentService) FieldReadInfo

Get field detail.

Return the configuration of a single incident custom field by ID.

API: POST /field/info (field-read-info).

func (*AlertEnrichmentService) FieldReadList

List fields.

Return all incident custom fields configured for the account.

API: POST /field/list (field-read-list).

func (*AlertEnrichmentService) FieldWriteCreate

Create field.

Create a new incident custom field on the account.

API: POST /field/create (field-write-create).

func (*AlertEnrichmentService) FieldWriteDelete

func (s *AlertEnrichmentService) FieldWriteDelete(ctx context.Context, req *DeleteFieldRequest) (*Response, error)

Delete field.

Delete an incident custom field and asynchronously strip it from existing incidents.

API: POST /field/delete (field-write-delete).

func (*AlertEnrichmentService) FieldWriteUpdate

func (s *AlertEnrichmentService) FieldWriteUpdate(ctx context.Context, req *UpdateFieldRequest) (*Response, error)

Update field.

Update mutable attributes of an existing incident custom field.

API: POST /field/update (field-write-update).

func (*AlertEnrichmentService) MappingAPIReadInfo

Get mapping API detail.

Return detail of a single mapping API by its ID.

API: POST /enrichment/mapping/api/info (mapping-api-read-info).

func (*AlertEnrichmentService) MappingAPIReadList

List mapping APIs.

Return all mapping APIs configured for the account.

API: POST /enrichment/mapping/api/list (mapping-api-read-list).

func (*AlertEnrichmentService) MappingAPIWriteCreate

Create mapping API.

Create a new external HTTP API endpoint used to enrich alerts via HTTP lookup.

API: POST /enrichment/mapping/api/create (mapping-api-write-create).

func (*AlertEnrichmentService) MappingAPIWriteDelete

func (s *AlertEnrichmentService) MappingAPIWriteDelete(ctx context.Context, req *MappingApiidRequest) (*Response, error)

Delete mapping API.

Delete a mapping API. Deletion is blocked if the API is referenced by any enrichment rule.

API: POST /enrichment/mapping/api/delete (mapping-api-write-delete).

func (*AlertEnrichmentService) MappingAPIWriteUpdate

func (s *AlertEnrichmentService) MappingAPIWriteUpdate(ctx context.Context, req *MappingAPIUpdateRequest) (*Response, error)

Update mapping API.

Update configuration of an existing mapping API.

API: POST /enrichment/mapping/api/update (mapping-api-write-update).

func (*AlertEnrichmentService) MappingDataReadDownload

func (s *AlertEnrichmentService) MappingDataReadDownload(ctx context.Context, req *MappingSchemaIDRequest) (*CSVFileResponse, *Response, error)

Download mapping data as CSV.

Export all data rows of a mapping schema as a CSV file download.

API: POST /enrichment/mapping/data/download (mapping-data-read-download).

func (*AlertEnrichmentService) MappingDataReadList

List mapping data.

Return paginated mapping data rows for a schema, with optional exact-match filtering on source label values.

API: POST /enrichment/mapping/data/list (mapping-data-read-list).

func (*AlertEnrichmentService) MappingDataWriteDelete

func (s *AlertEnrichmentService) MappingDataWriteDelete(ctx context.Context, req *MappingDataDeleteRequest) (*Response, error)

Delete mapping data rows.

Delete up to 100 mapping data rows by their keys.

API: POST /enrichment/mapping/data/delete (mapping-data-write-delete).

func (*AlertEnrichmentService) MappingDataWriteTruncate

func (s *AlertEnrichmentService) MappingDataWriteTruncate(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)

Truncate mapping data.

Delete all data rows in a mapping schema.

API: POST /enrichment/mapping/data/truncate (mapping-data-write-truncate).

func (*AlertEnrichmentService) MappingDataWriteUpload

func (s *AlertEnrichmentService) MappingDataWriteUpload(ctx context.Context, req *MappingDataUploadRequest) (*Response, error)

Upload mapping data via CSV.

Upload a CSV file to bulk-load mapping data. By default the existing data is truncated before loading the new rows.

API: POST /enrichment/mapping/data/upload (mapping-data-write-upload).

func (*AlertEnrichmentService) MappingDataWriteUpsert

Upsert mapping data rows.

Insert or update up to 1000 data rows in a mapping schema. Each row must contain all source and result labels.

API: POST /enrichment/mapping/data/upsert (mapping-data-write-upsert).

func (*AlertEnrichmentService) MappingSchemaReadInfo

Get mapping schema detail.

Return detail of a single mapping schema by its ID.

API: POST /enrichment/mapping/schema/info (mapping-schema-read-info).

func (*AlertEnrichmentService) MappingSchemaReadList

func (s *AlertEnrichmentService) MappingSchemaReadList(ctx context.Context) (*MappingSchemaListResponse, *Response, error)

List mapping schemas.

Return all mapping schemas for the account, sorted by creation time ascending.

API: POST /enrichment/mapping/schema/list (mapping-schema-read-list).

func (*AlertEnrichmentService) MappingSchemaWriteCreate

Create mapping schema.

Create a new mapping schema defining source lookup labels and the result labels to populate. Requires a Pro plan.

API: POST /enrichment/mapping/schema/create (mapping-schema-write-create).

func (*AlertEnrichmentService) MappingSchemaWriteDelete

func (s *AlertEnrichmentService) MappingSchemaWriteDelete(ctx context.Context, req *MappingSchemaIDRequest) (*Response, error)

Delete mapping schema.

Delete a mapping schema and all its associated data. Deletion is blocked if the schema is referenced by any enrichment rule or webhook.

API: POST /enrichment/mapping/schema/delete (mapping-schema-write-delete).

func (*AlertEnrichmentService) MappingSchemaWriteUpdate

func (s *AlertEnrichmentService) MappingSchemaWriteUpdate(ctx context.Context, req *MappingSchemaUpdateRequest) (*Response, error)

Update mapping schema.

Update the name, description, or owning team of a mapping schema. Source and result labels cannot be changed after creation.

API: POST /enrichment/mapping/schema/update (mapping-schema-write-update).

type AlertEventGlobalListRequest

type AlertEventGlobalListRequest struct {
	ListOptions
	// Sort ascending when `true`.
	Asc bool `json:"asc,omitempty"`
	// Filter by channel IDs. Max 100.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// End of search window, Unix epoch seconds.
	EndTime int64 `json:"end_time,omitempty"`
	// Filter by integration IDs.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
	// Filter by integration types (plugin keys).
	IntegrationTypes []string `json:"integration_types,omitempty"`
	// Sort field (ES field name).
	Orderby string `json:"orderby,omitempty"`
	// Comma-separated severity filter, e.g. `Critical,Warning`.
	Severities string `json:"severities,omitempty"`
	// Start of search window, Unix epoch seconds.
	StartTime int64 `json:"start_time,omitempty"`
}

AlertEventGlobalListRequest is generated from the Flashduty OpenAPI schema.

type AlertEventGlobalListResponse

type AlertEventGlobalListResponse struct {
	HasNextPage    bool             `json:"has_next_page,omitempty"`
	Items          []AlertEventItem `json:"items,omitempty"`
	SearchAfterCtx string           `json:"search_after_ctx,omitempty"`
	Total          int64            `json:"total,omitempty"`
}

AlertEventGlobalListResponse is generated from the Flashduty OpenAPI schema.

type AlertEventItem

type AlertEventItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Parent alert ID (MongoDB ObjectID).
	AlertID string `json:"alert_id,omitempty"`
	// Deduplication key used to merge events into an alert.
	AlertKey string `json:"alert_key,omitempty"`
	// Channel ID the event is routed to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Record creation time, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Deprecated. Use `integration_id` instead.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Soft-delete timestamp (seconds). Zero if not deleted.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Event description.
	Description string `json:"description,omitempty"`
	// Event ID (MongoDB ObjectID).
	EventID string `json:"event_id,omitempty"`
	// Severity of this event.
	EventSeverity string `json:"event_severity,omitempty"`
	// Status of this event.
	EventStatus string `json:"event_status,omitempty"`
	// Event timestamp, Unix epoch seconds.
	EventTime int64 `json:"event_time,omitempty"`
	// Images attached to the event.
	Images []AlertImage `json:"images,omitempty"`
	// Integration that produced this event.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Type/plugin key of the integration that produced this event.
	IntegrationType string `json:"integration_type,omitempty"`
	// Label key-value pairs.
	Labels map[string]string `json:"labels,omitempty"`
	// Event title.
	Title string `json:"title,omitempty"`
	// Title template used to derive `title` from labels.
	TitleRule string `json:"title_rule,omitempty"`
	// Record update time, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

AlertEventItem is generated from the Flashduty OpenAPI schema.

type AlertEventListRequest

type AlertEventListRequest struct {
	// Alert ID (ObjectID hex string).
	AlertID string `json:"alert_id,omitempty"`
}

AlertEventListRequest is generated from the Flashduty OpenAPI schema.

type AlertEventListResponse

type AlertEventListResponse struct {
	Items []AlertEventItem `json:"items,omitempty"`
}

AlertEventListResponse is generated from the Flashduty OpenAPI schema.

type AlertFeedRequest

type AlertFeedRequest struct {
	ListOptions
	// Alert ID.
	AlertID string `json:"alert_id,omitempty"`
	// Sort ascending.
	Asc bool `json:"asc,omitempty"`
	// Filter by feed types.
	Types []string `json:"types,omitempty"`
}

AlertFeedRequest is generated from the Flashduty OpenAPI schema.

type AlertFeedResponse

type AlertFeedResponse struct {
	HasNextPage bool       `json:"has_next_page,omitempty"`
	Items       []FeedItem `json:"items,omitempty"`
}

AlertFeedResponse is generated from the Flashduty OpenAPI schema.

type AlertFeedType

type AlertFeedType string

AlertFeedType Alert activity feed entry type. Each value identifies one alert lifecycle event; the matching `detail` payload shape is determined by this field.

const (
	AlertFeedTypeANew   AlertFeedType = "a_new"
	AlertFeedTypeAComm  AlertFeedType = "a_comm"
	AlertFeedTypeAClose AlertFeedType = "a_close"
)

type AlertImage

type AlertImage struct {
	// Alt text.
	Alt string `json:"alt,omitempty"`
	// Optional link URL when the image is clicked.
	Href string `json:"href,omitempty"`
	// Image source URL or internal image reference (starts with `img_` or `http`).
	Src string `json:"src,omitempty"`
}

AlertImage is generated from the Flashduty OpenAPI schema.

type AlertInfo

type AlertInfo struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Alert ID (MongoDB ObjectID).
	AlertID string `json:"alert_id,omitempty"`
	// Deduplication key used to merge events into the alert.
	AlertKey string `json:"alert_key,omitempty"`
	// Current severity.
	AlertSeverity string `json:"alert_severity,omitempty"`
	// Current status.
	AlertStatus string `json:"alert_status,omitempty"`
	// Channel ID.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel display name.
	ChannelName string `json:"channel_name,omitempty"`
	// Channel status.
	ChannelStatus string `json:"channel_status,omitempty"`
	// Creation timestamp (seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Deprecated. Use `integration_id` instead.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Deprecated. Use `integration_name`.
	DataSourceName string `json:"data_source_name,omitempty"`
	// Deprecated. Use `integration_ref_id`.
	DataSourceRefID string `json:"data_source_ref_id,omitempty"`
	// Deprecated. Use `integration_type`.
	DataSourceType string `json:"data_source_type,omitempty"`
	// Soft-delete timestamp (seconds). Zero if not deleted.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Alert description.
	Description string `json:"description,omitempty"`
	// Unix timestamp (seconds) when the alert recovered. 0 if still active.
	EndTime int64 `json:"end_time,omitempty"`
	// Total number of raw events merged into this alert.
	EventCnt int64 `json:"event_cnt,omitempty"`
	// Raw alert events, populated when the caller opts in.
	Events []AlertEventItem `json:"events,omitempty"`
	// Whether this alert has ever been silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Attached images.
	Images []Image `json:"images,omitempty"`
	// Parent incident reference, if the alert has been merged into one.
	Incident IncidentShort `json:"incident,omitempty"`
	// Integration ID that produced the alert.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Integration display name.
	IntegrationName string `json:"integration_name,omitempty"`
	// Integration reference ID.
	IntegrationRefID string `json:"integration_ref_id,omitempty"`
	// Integration type string.
	IntegrationType string `json:"integration_type,omitempty"`
	// Alert labels.
	Labels map[string]string `json:"labels,omitempty"`
	// Unix timestamp (seconds) of the most recent event.
	LastTime int64 `json:"last_time,omitempty"`
	// Primary responder email, if any.
	ResponderEmail string `json:"responder_email,omitempty"`
	// Primary responder name, if any.
	ResponderName string `json:"responder_name,omitempty"`
	// Unix timestamp (seconds) when the alert first fired.
	StartTime int64 `json:"start_time,omitempty"`
	// Alert title.
	Title string `json:"title,omitempty"`
	// Title rendering rule.
	TitleRule string `json:"title_rule,omitempty"`
	// Last update timestamp (seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

AlertInfo is generated from the Flashduty OpenAPI schema.

type AlertInfoRequest

type AlertInfoRequest struct {
	// Alert ID (ObjectID hex string).
	AlertID string `json:"alert_id,omitempty"`
}

AlertInfoRequest is generated from the Flashduty OpenAPI schema.

type AlertItem

type AlertItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Unique alert ID (ObjectID hex string).
	AlertID string `json:"alert_id,omitempty"`
	// Deduplication key.
	AlertKey string `json:"alert_key,omitempty"`
	// Current severity.
	AlertSeverity string `json:"alert_severity,omitempty"`
	// Current status.
	AlertStatus string `json:"alert_status,omitempty"`
	// ID of the channel the alert belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Display name of the channel.
	ChannelName string `json:"channel_name,omitempty"`
	// Status of the channel (e.g. `enabled`, `disabled`).
	ChannelStatus string `json:"channel_status,omitempty"`
	// Creation timestamp, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Deprecated. Use `integration_id` instead. Deprecated: use `integration_id` instead.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Deprecated. Use `integration_name` instead.
	DataSourceName string `json:"data_source_name,omitempty"`
	// Deprecated. Use `integration_ref_id` instead.
	DataSourceRefID string `json:"data_source_ref_id,omitempty"`
	// Deprecated. Use `integration_type` instead.
	DataSourceType string `json:"data_source_type,omitempty"`
	// Alert description.
	Description string `json:"description,omitempty"`
	// Resolution time, Unix epoch seconds. 0 if still active.
	EndTime int64 `json:"end_time,omitempty"`
	// Total number of raw events received by this alert.
	EventCnt int64 `json:"event_cnt,omitempty"`
	// Recent raw events attached to this alert. Populated only by some endpoints.
	Events []AlertEventItem `json:"events,omitempty"`
	// True if this alert has ever been silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Images attached to the alert.
	Images []AlertImage `json:"images,omitempty"`
	// Associated incident, if any.
	Incident IncidentShort `json:"incident,omitempty"`
	// ID of the integration that produced this alert.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Display name of the integration.
	IntegrationName string `json:"integration_name,omitempty"`
	// External reference ID of the integration.
	IntegrationRefID string `json:"integration_ref_id,omitempty"`
	// Type/plugin key of the integration.
	IntegrationType string `json:"integration_type,omitempty"`
	// Label key-value pairs.
	Labels map[string]string `json:"labels,omitempty"`
	// Last-event time, Unix epoch seconds.
	LastTime int64 `json:"last_time,omitempty"`
	// Email of the current responder (from the associated incident).
	ResponderEmail string `json:"responder_email,omitempty"`
	// Display name of the current responder (from the associated incident).
	ResponderName string `json:"responder_name,omitempty"`
	// First-seen time, Unix epoch seconds.
	StartTime int64 `json:"start_time,omitempty"`
	// Alert title.
	Title string `json:"title,omitempty"`
	// Title template used to derive `title` from the event labels (e.g. `$service::$cluster`).
	TitleRule string `json:"title_rule,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

AlertItem is generated from the Flashduty OpenAPI schema.

type AlertListByIDsRequest

type AlertListByIDsRequest struct {
	// List of alert IDs (ObjectID hex strings).
	AlertIDs []string `json:"alert_ids,omitempty"`
}

AlertListByIDsRequest is generated from the Flashduty OpenAPI schema.

type AlertListRequest

type AlertListRequest struct {
	ListOptions
	// Filter to specific alert IDs (ObjectID hex strings).
	AlertIDs []string `json:"alert_ids,omitempty"`
	// Filter by alert deduplication keys.
	AlertKeys []string `json:"alert_keys,omitempty"`
	// Comma-separated severity filter, e.g. `Critical,Warning`. Allowed values: `Critical`, `Warning`, `Info`, `Ok`.
	AlertSeverity string `json:"alert_severity,omitempty"`
	// Sort ascending when `true`. Default descending.
	Asc bool `json:"asc,omitempty"`
	// When `true`, the time range filter is applied on `updated_at` rather than `start_time`.
	ByUpdatedAt bool `json:"by_updated_at,omitempty"`
	// Filter by channel IDs.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// End of the search window, Unix epoch seconds. Max span 31 days.
	EndTime int64 `json:"end_time,omitempty"`
	// Filter by whether the alert has ever been silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Filter by integration IDs.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
	// Filter by active (`true`) or resolved (`false`) status.
	IsActive bool `json:"is_active,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Start of the search window, Unix epoch seconds.
	StartTime int64 `json:"start_time,omitempty"`
}

AlertListRequest is generated from the Flashduty OpenAPI schema.

type AlertListResponse

type AlertListResponse struct {
	// True if more pages are available.
	HasNextPage bool        `json:"has_next_page,omitempty"`
	Items       []AlertItem `json:"items,omitempty"`
	// Cursor for the next page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total matching alerts.
	Total int64 `json:"total,omitempty"`
}

AlertListResponse is generated from the Flashduty OpenAPI schema.

type AlertMergeRequest

type AlertMergeRequest struct {
	// Alert IDs to merge.
	AlertIDs []string `json:"alert_ids,omitempty"`
	// Optional comment on the merge action.
	Comment string `json:"comment,omitempty"`
	// Target incident ID.
	IncidentID string `json:"incident_id,omitempty"`
	// Optional new owner for the target incident.
	OwnerID int64 `json:"owner_id,omitempty"`
	// Optional new title for the target incident.
	Title string `json:"title,omitempty"`
}

AlertMergeRequest is generated from the Flashduty OpenAPI schema.

type AlertPipeline

type AlertPipeline struct {
	// Optional OR-of-AND filter. When omitted, the rule applies to all alerts.
	If OrFilterGroup `json:"if,omitempty"`
	// Rule type.
	Kind string `json:"kind,omitempty"`
	// Kind-specific settings. Shape depends on `kind`:
	// - `title_reset`: `{ "title": "<string>" }`
	// - `description_reset`: `{ "description": "<string>" }`
	// - `severity_reset`: `{ "severity": "Critical"|"Warning"|"Info" }`
	// - `alert_drop`: `{}` (empty object)
	// - `alert_inhibit`: `{ "equals": ["<label_key>", ...], "source_filters": <OrFilterGroup> }`
	Settings any `json:"settings,omitempty"`
}

AlertPipeline is generated from the Flashduty OpenAPI schema.

type AlertPipelineInfoRequest

type AlertPipelineInfoRequest struct {
	// Integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

AlertPipelineInfoRequest is generated from the Flashduty OpenAPI schema.

type AlertPipelineItem

type AlertPipelineItem struct {
	// Creation timestamp, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID who created the pipeline.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Integration ID this pipeline applies to.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Ordered list of processing rules.
	Rules []AlertPipeline `json:"rules,omitempty"`
	// Pipeline status. Possible values: `enabled`, `disabled`.
	Status string `json:"status,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Member ID who last updated the pipeline.
	UpdatedBy int64 `json:"updated_by,omitempty"`
}

AlertPipelineItem is generated from the Flashduty OpenAPI schema.

type AlertPipelineListRequest

type AlertPipelineListRequest struct {
	// Integration IDs.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
}

AlertPipelineListRequest is generated from the Flashduty OpenAPI schema.

type AlertPipelineListResponse

type AlertPipelineListResponse struct {
	Items []AlertPipelineItem `json:"items,omitempty"`
}

AlertPipelineListResponse is generated from the Flashduty OpenAPI schema.

type AlertPipelineUpsertRequest

type AlertPipelineUpsertRequest struct {
	// Integration ID to configure.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Rules to apply. Max 50.
	Rules []AlertPipeline `json:"rules,omitempty"`
}

AlertPipelineUpsertRequest is generated from the Flashduty OpenAPI schema.

type AlertRule

type AlertRule struct {
	AccountID   uint64            `json:"account_id,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
	// Channel IDs to send alerts to.
	ChannelIDs  []uint64 `json:"channel_ids,omitempty"`
	CreatedAt   int64    `json:"created_at,omitempty"`
	CreatorID   uint64   `json:"creator_id,omitempty"`
	CreatorName string   `json:"creator_name,omitempty"`
	// 5-field cron schedule.
	CronPattern     string `json:"cron_pattern,omitempty"`
	DebugLogEnabled bool   `json:"debug_log_enabled,omitempty"`
	DelaySeconds    int64  `json:"delay_seconds,omitempty"`
	Description     string `json:"description,omitempty"`
	DescriptionType string `json:"description_type,omitempty"`
	// Specific data source IDs.
	DsIDs []uint64 `json:"ds_ids,omitempty"`
	// Data source name patterns (supports wildcards).
	DsList []string `json:"ds_list,omitempty"`
	// Data source type.
	DsType  string `json:"ds_type,omitempty"`
	Enabled bool   `json:"enabled,omitempty"`
	// Time windows when the rule is active.
	EnabledTimes []AlertRuleEnabledTimesItem `json:"enabled_times,omitempty"`
	// Folder the rule belongs to.
	FolderID uint64 `json:"folder_id,omitempty"`
	ID       uint64 `json:"id,omitempty"`
	// Custom labels.
	Labels map[string]string `json:"labels,omitempty"`
	// Rule name.
	Name string `json:"name,omitempty"`
	// Notification repeat interval in seconds.
	RepeatInterval int64 `json:"repeat_interval,omitempty"`
	// Max number of repeat notifications.
	RepeatTotal int64       `json:"repeat_total,omitempty"`
	RuleConfigs RuleConfigs `json:"rule_configs,omitempty"`
	UpdatedAt   int64       `json:"updated_at,omitempty"`
	UpdaterID   uint64      `json:"updater_id,omitempty"`
	UpdaterName string      `json:"updater_name,omitempty"`
}

AlertRule is generated from the Flashduty OpenAPI schema.

type AlertRuleAudit

type AlertRuleAudit struct {
	AccountID uint64 `json:"account_id,omitempty"`
	// Action performed, e.g. `create`, `update`.
	Action string `json:"action,omitempty"`
	// ID of the alert rule this record belongs to.
	AlertRuleID uint64 `json:"alert_rule_id,omitempty"`
	// JSON string of the full rule snapshot at audit time. Populated on `/monit/rule/audit/detail`, omitted on list responses.
	Content     string `json:"content,omitempty"`
	CreatedAt   int64  `json:"created_at,omitempty"`
	CreatorID   uint64 `json:"creator_id,omitempty"`
	CreatorName string `json:"creator_name,omitempty"`
	// Audit record ID.
	ID uint64 `json:"id,omitempty"`
}

AlertRuleAudit is generated from the Flashduty OpenAPI schema.

type AlertRuleBasic

type AlertRuleBasic struct {
	// Account ID.
	AccountID   uint64 `json:"account_id,omitempty"`
	CreatedAt   int64  `json:"created_at,omitempty"`
	CreatorID   uint64 `json:"creator_id,omitempty"`
	CreatorName string `json:"creator_name,omitempty"`
	// 5-field cron schedule, e.g. `* * * * *`.
	CronPattern string `json:"cron_pattern,omitempty"`
	// Whether debug logging is enabled.
	DebugLogEnabled bool `json:"debug_log_enabled,omitempty"`
	// Evaluation delay in seconds.
	DelaySeconds int64 `json:"delay_seconds,omitempty"`
	// Data source type, e.g. `prometheus`.
	DsType string `json:"ds_type,omitempty"`
	// Whether the rule is enabled.
	Enabled bool `json:"enabled,omitempty"`
	// Folder ID.
	FolderID uint64 `json:"folder_id,omitempty"`
	// Unique rule ID.
	ID uint64 `json:"id,omitempty"`
	// Custom labels.
	Labels map[string]string `json:"labels,omitempty"`
	// Rule name.
	Name string `json:"name,omitempty"`
	// True if the rule currently has active alerts.
	Triggered   bool   `json:"triggered,omitempty"`
	UpdatedAt   int64  `json:"updated_at,omitempty"`
	UpdaterID   uint64 `json:"updater_id,omitempty"`
	UpdaterName string `json:"updater_name,omitempty"`
}

AlertRuleBasic is generated from the Flashduty OpenAPI schema.

type AlertRuleCounter

type AlertRuleCounter struct {
	AccountID uint64 `json:"account_id,omitempty"`
	// Sample timestamp, Unix epoch seconds.
	Clock int64  `json:"clock,omitempty"`
	ID    uint64 `json:"id,omitempty"`
	// Rule count at the sample time.
	Num int64 `json:"num,omitempty"`
}

AlertRuleCounter is generated from the Flashduty OpenAPI schema.

type AlertRuleEnabledTimesItem

type AlertRuleEnabledTimesItem struct {
	// Days of week (0=Sunday).
	Days []int64 `json:"days,omitempty"`
	// End time, e.g. `18:00`.
	Etime string `json:"etime,omitempty"`
	// Start time, e.g. `09:00`.
	Stime string `json:"stime,omitempty"`
}

AlertRuleEnabledTimesItem is generated from the Flashduty OpenAPI schema.

type AlertRuleExport

type AlertRuleExport struct {
	Annotations     map[string]string `json:"annotations,omitempty"`
	CronPattern     string            `json:"cron_pattern,omitempty"`
	DebugLogEnabled bool              `json:"debug_log_enabled,omitempty"`
	DelaySeconds    int64             `json:"delay_seconds,omitempty"`
	Description     string            `json:"description,omitempty"`
	DescriptionType string            `json:"description_type,omitempty"`
	DsIDs           []uint64          `json:"ds_ids,omitempty"`
	DsList          []string          `json:"ds_list,omitempty"`
	DsType          string            `json:"ds_type,omitempty"`
	Enabled         bool              `json:"enabled,omitempty"`
	EnabledTimes    []EnabledTime     `json:"enabled_times,omitempty"`
	Labels          map[string]string `json:"labels,omitempty"`
	Name            string            `json:"name,omitempty"`
	RepeatInterval  int64             `json:"repeat_interval,omitempty"`
	RepeatTotal     int64             `json:"repeat_total,omitempty"`
	RuleConfigs     RuleConfigs       `json:"rule_configs,omitempty"`
}

AlertRuleExport is generated from the Flashduty OpenAPI schema.

type AlertRuleExportListResponse

type AlertRuleExportListResponse []AlertRuleExport

AlertRuleExportListResponse is a list response payload.

type AlertRuleInfoResponse

type AlertRuleInfoResponse struct {
	AccountID   uint64            `json:"account_id,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
	// Channel IDs to send alerts to.
	ChannelIDs  []uint64 `json:"channel_ids,omitempty"`
	CreatedAt   int64    `json:"created_at,omitempty"`
	CreatorID   uint64   `json:"creator_id,omitempty"`
	CreatorName string   `json:"creator_name,omitempty"`
	// 5-field cron schedule.
	CronPattern     string `json:"cron_pattern,omitempty"`
	DebugLogEnabled bool   `json:"debug_log_enabled,omitempty"`
	DelaySeconds    int64  `json:"delay_seconds,omitempty"`
	Description     string `json:"description,omitempty"`
	DescriptionType string `json:"description_type,omitempty"`
	// Specific data source IDs.
	DsIDs []uint64 `json:"ds_ids,omitempty"`
	// Data source name patterns (supports wildcards).
	DsList []string `json:"ds_list,omitempty"`
	// Data source type.
	DsType  string `json:"ds_type,omitempty"`
	Enabled bool   `json:"enabled,omitempty"`
	// Time windows when the rule is active.
	EnabledTimes []AlertRuleInfoResponseEnabledTimesItem `json:"enabled_times,omitempty"`
	// Folder the rule belongs to.
	FolderID uint64 `json:"folder_id,omitempty"`
	ID       uint64 `json:"id,omitempty"`
	// Custom labels.
	Labels map[string]string `json:"labels,omitempty"`
	// Rule name.
	Name string `json:"name,omitempty"`
	// Notification repeat interval in seconds.
	RepeatInterval int64 `json:"repeat_interval,omitempty"`
	// Max number of repeat notifications.
	RepeatTotal int64       `json:"repeat_total,omitempty"`
	RuleConfigs RuleConfigs `json:"rule_configs,omitempty"`
	UpdatedAt   int64       `json:"updated_at,omitempty"`
	UpdaterID   uint64      `json:"updater_id,omitempty"`
	UpdaterName string      `json:"updater_name,omitempty"`
}

AlertRuleInfoResponse is generated from the Flashduty OpenAPI schema.

type AlertRuleInfoResponseEnabledTimesItem

type AlertRuleInfoResponseEnabledTimesItem struct {
	// Days of week (0=Sunday).
	Days []int64 `json:"days,omitempty"`
	// End time, e.g. `18:00`.
	Etime string `json:"etime,omitempty"`
	// Start time, e.g. `09:00`.
	Stime string `json:"stime,omitempty"`
}

AlertRuleInfoResponseEnabledTimesItem is generated from the Flashduty OpenAPI schema.

type AlertRuleStatus

type AlertRuleStatus struct {
	FolderID   uint64 `json:"folder_id,omitempty"`
	FolderName string `json:"folder_name,omitempty"`
	// Total rules in the folder family.
	RuleTotal int64 `json:"rule_total,omitempty"`
	// Rules with active alerts.
	TriggeredRuleCount int64 `json:"triggered_rule_count,omitempty"`
}

AlertRuleStatus is generated from the Flashduty OpenAPI schema.

type AlertRulesService

type AlertRulesService service

AlertRulesService handles the "Monitors/Alert rules" API resource.

func (*AlertRulesService) ReadAuditDetail

func (s *AlertRulesService) ReadAuditDetail(ctx context.Context, req *RuleIDRequest) (*AlertRuleAudit, *Response, error)

Get rule audit snapshot.

Return the audit record (including the `content` field, a JSON string of the rule snapshot at that point in time).

API: POST /monit/rule/audit/detail (monit-rule-read-audit-detail).

func (*AlertRulesService) ReadAudits

List rule change history.

Return the change history (audit records) for an alert rule.

API: POST /monit/rule/audits (monit-rule-read-audits).

func (*AlertRulesService) ReadCounterChannel

func (s *AlertRulesService) ReadCounterChannel(ctx context.Context) (*RuleCounterChannelResponse, *Response, error)

Get rule counts by channel.

Return an object mapping channel name to the number of rules routing alerts to that channel. If a channel name cannot be resolved, the channel ID (as a string) is used as the key.

API: POST /monit/rule/counter/channel (monit-rule-read-counter-channel).

func (*AlertRulesService) ReadCounterNode

Get rule counts by folder node.

Return an object mapping top-level folder name to the total number of rules under that folder and all its descendants.

API: POST /monit/rule/counter/node (monit-rule-read-counter-node).

func (*AlertRulesService) ReadCounterStatus

func (s *AlertRulesService) ReadCounterStatus(ctx context.Context) (*RuleStatusResponse, *Response, error)

Get rule status counters for top-level folders.

Return trigger status summary for all top-level folder nodes — used for the overview dashboard.

API: POST /monit/rule/counter/status (monit-rule-read-counter-status).

func (*AlertRulesService) ReadCounterTotal

Get rule counter time series.

Return the stored time series of the total rule count across the account — one sample per `clock` timestamp.

API: POST /monit/rule/counter/total (monit-rule-read-counter-total).

func (*AlertRulesService) ReadDstypes

List available datasource types.

Return the list of datasource types (`DSType` records) that the current account can use when authoring alert rules — combines global types and account-scoped types.

API: POST /monit/rule/dstypes (monit-rule-read-dstypes).

func (*AlertRulesService) ReadExport

Export alert rules.

Export the configuration of selected alert rules as a portable JSON array, compatible with `POST /monit/rule/import`.

API: POST /monit/rule/export (monit-rule-read-export).

func (*AlertRulesService) ReadInfo

Get alert rule detail.

Return the full configuration of an alert rule by its ID, including rule queries, thresholds, and notification settings.

API: POST /monit/rule/info (monit-rule-read-info).

func (*AlertRulesService) ReadList

List alert rules.

Return the basic information of all alert rules in a folder. For full rule details, call `POST /monit/rule/info`.

API: POST /monit/rule/list/basic (monit-rule-read-list).

func (*AlertRulesService) WriteCreate

func (s *AlertRulesService) WriteCreate(ctx context.Context, req *AlertRule) (*AlertRule, *Response, error)

Create alert rule.

Create a new alert rule. Returns the created rule with its assigned ID.

API: POST /monit/rule/create (monit-rule-write-create).

func (*AlertRulesService) WriteDelete

func (s *AlertRulesService) WriteDelete(ctx context.Context, req *RuleIDRequest) (*Response, error)

Delete alert rule.

Delete a single alert rule by its ID.

API: POST /monit/rule/delete (monit-rule-write-delete).

func (*AlertRulesService) WriteDeleteBatch

func (s *AlertRulesService) WriteDeleteBatch(ctx context.Context, req *RuleIDsRequest) (*Response, error)

Batch delete alert rules.

Delete multiple alert rules in a single request.

API: POST /monit/rule/delete/batch (monit-rule-write-delete-batch).

func (*AlertRulesService) WriteFieldsUpdate

Batch update rule fields.

Update specific fields across multiple alert rules at once. Only the fields listed in `fields` are applied.

API: POST /monit/rule/update/fields (monit-rule-write-fields-update).

func (*AlertRulesService) WriteImport

Import alert rules.

Import one or more alert rules from a JSON array. Returns the result for each rule, indicating success or failure.

API: POST /monit/rule/import (monit-rule-write-import).

func (*AlertRulesService) WriteMove

Move alert rules to folder.

Move one or more alert rules to a different folder.

API: POST /monit/rule/move (monit-rule-write-move).

func (*AlertRulesService) WriteStatus

Get rule trigger status under folder.

Return the rule trigger summary for all rules under a folder node and its descendants.

API: POST /monit/rule/status (monit-rule-write-status).

func (*AlertRulesService) WriteUpdate

func (s *AlertRulesService) WriteUpdate(ctx context.Context, req *AlertRule) (*AlertRule, *Response, error)

Update alert rule.

Replace the full configuration of an existing alert rule. All fields are overwritten.

API: POST /monit/rule/update (monit-rule-write-update).

type AlertsService

type AlertsService service

AlertsService handles the "On-call/Alerts" API resource.

func (*AlertsService) EventReadList

List raw alert events.

Return a cursor-paginated list of raw alert events across all alerts, with filtering by integration, channel, time range, and severity.

API: POST /alert-event/list (alert-event-read-list).

func (*AlertsService) ReadEventList

List events for an alert.

Return all raw events that have been ingested into a specific alert, in chronological order.

API: POST /alert/event/list (alert-read-event-list).

func (*AlertsService) ReadFeed

List alert activity feed.

Return the activity feed (comments, state changes, merges, silence events) for a single alert, with page-based pagination.

API: POST /alert/feed (alert-read-feed).

func (*AlertsService) ReadInfo

func (s *AlertsService) ReadInfo(ctx context.Context, req *AlertInfoRequest) (*AlertItem, *Response, error)

Get alert detail.

Return the full details of a single alert by its ID, including its associated incident and event count.

API: POST /alert/info (alert-read-info).

func (*AlertsService) ReadList

List alerts.

Return a cursor-paginated list of alerts matching the given filters.

API: POST /alert/list (alert-read-list).

func (*AlertsService) ReadListByIDs

List alerts by IDs.

Return the details of multiple alerts by their IDs in a single request.

API: POST /alert/list-by-ids (alert-read-list-by-ids).

func (*AlertsService) ReadPipelineInfo

Get alert pipeline.

Return the alert processing pipeline configured for a specific integration.

API: POST /alert/pipeline/info (alert-read-pipeline-info).

func (*AlertsService) ReadPipelineList

List alert pipelines.

Return the alert processing pipelines configured for multiple integrations.

API: POST /alert/pipeline/list (alert-read-pipeline-list).

func (*AlertsService) WriteMerge

func (s *AlertsService) WriteMerge(ctx context.Context, req *AlertMergeRequest) (*Response, error)

Merge alerts into an incident.

Associate one or more alerts with an existing incident. If a source alert previously belonged to a different incident and that incident becomes empty after the merge, it will be automatically closed.

API: POST /alert/merge (alert-write-merge).

func (*AlertsService) WritePipelineUpsert

func (s *AlertsService) WritePipelineUpsert(ctx context.Context, req *AlertPipelineUpsertRequest) (*Response, error)

Create or update alert pipeline.

Set the alert processing pipeline for an integration. Replaces the existing configuration entirely.

API: POST /alert/pipeline/upsert (alert-write-pipeline-upsert).

type AnalyticsService

type AnalyticsService service

AnalyticsService handles the "On-call/Analytics" API resource.

func (*AnalyticsService) ByAccount

Get account-level insight.

Return aggregated incident insight metrics for the entire account.

API: POST /insight/account (insightByAccount).

func (*AnalyticsService) ByChannel

Get channel insight.

Return insight metrics aggregated by channel.

API: POST /insight/channel (insightByChannel).

func (*AnalyticsService) ByResponder

Get responder insight.

Return insight metrics aggregated by responder.

API: POST /insight/responder (insightByResponder).

func (*AnalyticsService) ByTeam

Get team insight.

Return insight metrics aggregated by team.

API: POST /insight/team (insightByTeam).

func (*AnalyticsService) ChannelExport

func (s *AnalyticsService) ChannelExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)

Export channel insight.

Export channel insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.

API: POST /insight/channel/export (insightChannelExport).

func (*AnalyticsService) IncidentExport

Export insight incidents.

Export the filtered incident analytics list as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.

API: POST /insight/incident/export (insightIncidentExport).

func (*AnalyticsService) IncidentList

List insight incidents.

Return a paged list of incidents with per-incident handling metrics used by the analytics dashboard.

API: POST /insight/incident/list (insightIncidentList).

func (*AnalyticsService) ResponderExport

func (s *AnalyticsService) ResponderExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)

Export responder insight.

Export responder insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.

API: POST /insight/responder/export (insightResponderExport).

func (*AnalyticsService) TeamExport

func (s *AnalyticsService) TeamExport(ctx context.Context, req *InsightQueryRequest) (*Response, error)

Export team insight.

Export team insight metrics as a CSV file. The response is a CSV stream delivered with `Content-Disposition: attachment` — it is not a JSON envelope.

API: POST /insight/team/export (insightTeamExport).

func (*AnalyticsService) TopkAlertsByLabel

Get top-K alerts grouped by check or resource.

Return the top-K alert groups aggregated either by `check` or by `resource` label over the specified time range.

API: POST /insight/alert/topk-by-label (insightTopkAlertsByLabel).

type ApAlertDrop

type ApAlertDrop struct{}

ApAlertDrop is generated from the Flashduty OpenAPI schema.

type ApAlertInhibit

type ApAlertInhibit struct {
	// Label keys whose values must be equal between the source and current alert for inhibition to apply.
	Equals []string `json:"equals,omitempty"`
	// Filter that identifies the source alerts to inhibit.
	SourceFilters OrFilterGroup `json:"source_filters,omitempty"`
}

ApAlertInhibit is generated from the Flashduty OpenAPI schema.

type ApDescriptionReset

type ApDescriptionReset struct {
	// New description template.
	Description string `json:"description,omitempty"`
}

ApDescriptionReset is generated from the Flashduty OpenAPI schema.

type ApSeverityReset

type ApSeverityReset struct {
	// Target severity level.
	Severity string `json:"severity,omitempty"`
}

ApSeverityReset is generated from the Flashduty OpenAPI schema.

type ApTitleReset

type ApTitleReset struct {
	// New title template. Supports Golang template syntax referencing alert fields.
	Title string `json:"title,omitempty"`
}

ApTitleReset is generated from the Flashduty OpenAPI schema.

type ApplicationsService

type ApplicationsService service

ApplicationsService handles the "RUM/Applications" API resource.

func (*ApplicationsService) ReadInfo

Get application detail.

Retrieve full details of a single RUM application by `application_id`.

API: POST /rum/application/info (rum-application-read-info).

func (*ApplicationsService) ReadInfos

Batch get applications.

Retrieve details for multiple RUM applications by their IDs in one request.

API: POST /rum/application/infos (rum-application-read-infos).

func (*ApplicationsService) ReadList

List applications.

Return a paginated list of RUM applications accessible to the current user.

API: POST /rum/application/list (rum-application-read-list).

func (*ApplicationsService) WriteCreate

Create application.

Create a new RUM application. Returns the generated `application_id` and `client_token`.

API: POST /rum/application/create (rum-application-write-create).

func (*ApplicationsService) WriteDelete

Delete application.

Delete a RUM application by `application_id`.

API: POST /rum/application/delete (rum-application-write-delete).

func (*ApplicationsService) WriteUpdate

Update application.

Update an existing RUM application. All fields except `application_id` are optional — only provided fields are updated.

API: POST /rum/application/update (rum-application-write-update).

type AssignIncidentRequest

type AssignIncidentRequest struct {
	AssignedTo AssignedTo `json:"assigned_to,omitempty"`
	// Single incident ID. Ignored when `incident_ids` is also provided.
	IncidentID string `json:"incident_id,omitempty"`
	// Batch incident IDs.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

AssignIncidentRequest is generated from the Flashduty OpenAPI schema.

type AssignedTo

type AssignedTo struct {
	// Unix timestamp (seconds) when the assignment was made.
	AssignedAt int64 `json:"assigned_at,omitempty"`
	// Email recipients, used by integrations such as ServiceNow.
	Emails []string `json:"emails,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) to drive assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty"`
	// Escalation rule display name, filled by the server.
	EscalateRuleName string `json:"escalate_rule_name,omitempty"`
	// Opaque assignment ID generated by the server.
	ID string `json:"id,omitempty"`
	// Current level index within the escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty"`
	// Member IDs to assign directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Assignment type: `assign` direct assignment, `reassign` reassignment, `escalate` escalation-rule driven, `reopen` automatic reassignment on reopen.
	Type string `json:"type,omitempty"`
}

AssignedTo is generated from the Flashduty OpenAPI schema.

type AuditLog

type AuditLog struct {
	// ID of the account.
	AccountID uint64 `json:"account_id,omitempty"`
	// JSON-encoded request body (may be truncated at 10 KB).
	Body string `json:"body,omitempty"`
	// Timestamp of the operation in Unix epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Client IP address of the caller.
	IP string `json:"ip,omitempty"`
	// True if this is flagged as a high-risk operation.
	IsDangerous bool `json:"is_dangerous,omitempty"`
	// True for mutating operations; false for read-only ones.
	IsWrite bool `json:"is_write,omitempty"`
	// ID of the member who performed the action.
	MemberID uint64 `json:"member_id,omitempty"`
	// Display name of the member.
	MemberName string `json:"member_name,omitempty"`
	// Stable machine-readable operation name, e.g. `template:write:create`.
	Operation string `json:"operation,omitempty"`
	// Human-readable operation label in the account's locale.
	OperationName string `json:"operation_name,omitempty"`
	// URL path parameters as an array of key-value pairs, or an empty array when none.
	Params []AuditLogParamsItem `json:"params,omitempty"`
	// Unique request ID for correlation.
	RequestID string `json:"request_id,omitempty"`
}

AuditLog is generated from the Flashduty OpenAPI schema.

type AuditLogParamsItem

type AuditLogParamsItem struct {
	Key   string `json:"Key,omitempty"`
	Value string `json:"Value,omitempty"`
}

AuditLogParamsItem is generated from the Flashduty OpenAPI schema.

type AuditLogsService

type AuditLogsService service

AuditLogsService handles the "Platform/Audit logs" API resource.

func (*AuditLogsService) OperationList

List auditable operation types.

Return all operation names that are recorded in the audit log, for use as `operations` filter values.

API: POST /audit/operation/list (audit-read-operation-list).

func (*AuditLogsService) Search

Search audit logs.

Return a cursor-paginated list of audit log entries within a time range.

API: POST /audit/search (audit-read-search).

type AuditOperationListRequest

type AuditOperationListRequest struct{}

AuditOperationListRequest is generated from the Flashduty OpenAPI schema.

type AuditOperationListResponse

type AuditOperationListResponse struct {
	Items []AuditOperationTypeItem `json:"items,omitempty"`
}

AuditOperationListResponse is generated from the Flashduty OpenAPI schema.

type AuditOperationTypeItem

type AuditOperationTypeItem struct {
	// Stable machine-readable operation name for use as a filter.
	Name string `json:"name,omitempty"`
	// Human-readable Chinese label shown in the console.
	NameCn string `json:"name_cn,omitempty"`
}

AuditOperationTypeItem is generated from the Flashduty OpenAPI schema.

type AuditSearchRequest

type AuditSearchRequest struct {
	// End of the search window, Unix epoch seconds. Must be after `start_time`. Maximum span 90 days.
	EndTime int64 `json:"end_time,omitempty"`
	// When true, return only high-risk (dangerous) operations.
	IsDangerous bool `json:"is_dangerous,omitempty"`
	// When true, return only write operations; when false, return only read operations.
	IsWrite bool `json:"is_write,omitempty"`
	// Page size. Minimum 0, maximum 99.
	Limit int64 `json:"limit,omitempty"`
	// Filter to specific operation names. Use `POST /audit/operation/list` to get the valid set.
	Operations []string `json:"operations,omitempty"`
	// Filter by the member who performed the action.
	PersonID uint64 `json:"person_id,omitempty"`
	// Filter to a single request by its unique request ID.
	RequestID string `json:"request_id,omitempty"`
	// Opaque pagination cursor returned by the previous response. Leave empty for the first page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Start of the search window, Unix epoch seconds.
	StartTime int64 `json:"start_time,omitempty"`
}

AuditSearchRequest is generated from the Flashduty OpenAPI schema.

type AuditSearchResponse

type AuditSearchResponse struct {
	// Audit log entries for this page.
	Docs []AuditLog `json:"docs,omitempty"`
	// Opaque cursor for the next page. Empty string when there are no more results.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total matching entries in the search window.
	Total int64 `json:"total,omitempty"`
}

AuditSearchResponse is generated from the Flashduty OpenAPI schema.

type CSVFileResponse

type CSVFileResponse string

type CalEventIDRequest

type CalEventIDRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// Event ID.
	EventID string `json:"event_id,omitempty"`
}

CalEventIDRequest is generated from the Flashduty OpenAPI schema.

type CalEventItem

type CalEventItem struct {
	// Account ID. Only present for private events.
	AccountID uint64 `json:"account_id,omitempty"`
	// Calendar ID. For public events this is a locale key such as zh-cn.china.official.
	CalID string `json:"cal_id,omitempty"`
	// Creation timestamp (Unix seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator person ID. Only present for private events.
	CreatorID uint64 `json:"creator_id,omitempty"`
	// Event description.
	Description string `json:"description,omitempty"`
	// Event end date (YYYY-MM-DD, exclusive).
	EndAt string `json:"end_at,omitempty"`
	// Event ID.
	EventID string `json:"event_id,omitempty"`
	// Whether the event marks a non-working day.
	IsOff bool `json:"is_off,omitempty"`
	// Event start date (YYYY-MM-DD).
	StartAt string `json:"start_at,omitempty"`
	// Event summary.
	Summary string `json:"summary,omitempty"`
	// Last update timestamp (Unix seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

CalEventItem is generated from the Flashduty OpenAPI schema.

type CalEventListRequest

type CalEventListRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// Day (1-31). 0 means no day filter.
	Day int64 `json:"day,omitempty"`
	// Month (1-12). 0 means no month filter.
	Month int64 `json:"month,omitempty"`
	// Year. Defaults to the current year when omitted.
	Year int64 `json:"year,omitempty"`
}

CalEventListRequest is generated from the Flashduty OpenAPI schema.

type CalEventListResponse

type CalEventListResponse struct {
	// Calendar events sorted by start_at.
	Items []CalEventItem `json:"items,omitempty"`
	// Total number of events returned.
	Total int64 `json:"total,omitempty"`
}

CalEventListResponse is generated from the Flashduty OpenAPI schema.

type CalEventUpsertRequest

type CalEventUpsertRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// Event description.
	Description string `json:"description,omitempty"`
	// Event end date in YYYY-MM-DD (exclusive).
	EndAt string `json:"end_at,omitempty"`
	// Event ID. Omit when creating.
	EventID string `json:"event_id,omitempty"`
	// Whether the event marks a non-working day. true = day off, false = working day override.
	IsOff bool `json:"is_off,omitempty"`
	// Event start date in YYYY-MM-DD.
	StartAt string `json:"start_at,omitempty"`
	// Event summary.
	Summary string `json:"summary,omitempty"`
}

CalEventUpsertRequest is generated from the Flashduty OpenAPI schema.

type CalEventUpsertResponse

type CalEventUpsertResponse struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// Event ID (existing or newly generated).
	EventID string `json:"event_id,omitempty"`
	// Event summary.
	Summary string `json:"summary,omitempty"`
}

CalEventUpsertResponse is generated from the Flashduty OpenAPI schema.

type CalendarCreateRequest

type CalendarCreateRequest struct {
	// Calendar display name.
	CalName string `json:"cal_name,omitempty"`
	// Calendar description.
	Description string `json:"description,omitempty"`
	// Additional public-holiday calendar IDs to inherit events from (for example zh-cn.china.official).
	ExtraCalIDs []string `json:"extra_cal_ids,omitempty"`
	// Owning team ID. 0 means no team.
	TeamID int64 `json:"team_id,omitempty"`
	// IANA timezone. Defaults to Asia/Shanghai when empty.
	Timezone string `json:"timezone,omitempty"`
	// Workday numbers (0 = Sunday, 6 = Saturday).
	Workdays []int64 `json:"workdays,omitempty"`
}

CalendarCreateRequest is generated from the Flashduty OpenAPI schema.

type CalendarCreateResponse

type CalendarCreateResponse struct {
	// ID of the newly created calendar (format cal.<uuid>).
	CalID string `json:"cal_id,omitempty"`
	// Calendar display name.
	CalName string `json:"cal_name,omitempty"`
}

CalendarCreateResponse is generated from the Flashduty OpenAPI schema.

type CalendarEmptyObject

type CalendarEmptyObject struct{}

CalendarEmptyObject is generated from the Flashduty OpenAPI schema.

type CalendarIDRequest

type CalendarIDRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
}

CalendarIDRequest is generated from the Flashduty OpenAPI schema.

type CalendarItem

type CalendarItem struct {
	// Account ID.
	AccountID uint64 `json:"account_id,omitempty"`
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// Calendar display name.
	CalName string `json:"cal_name,omitempty"`
	// Creation timestamp (Unix seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator person ID.
	CreatorID uint64 `json:"creator_id,omitempty"`
	// Calendar description.
	Description string `json:"description,omitempty"`
	// Inherited public-holiday calendar IDs.
	ExtraCalIDs []string `json:"extra_cal_ids,omitempty"`
	// Calendar kind.
	Kind string `json:"kind,omitempty"`
	// Calendar status.
	Status string `json:"status,omitempty"`
	// Owning team ID (0 when not assigned).
	TeamID uint64 `json:"team_id,omitempty"`
	// IANA timezone.
	Timezone string `json:"timezone,omitempty"`
	// Last update timestamp (Unix seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater person ID.
	UpdatedBy uint64 `json:"updated_by,omitempty"`
	// Workday numbers (0 = Sunday, 6 = Saturday).
	Workdays []int64 `json:"workdays,omitempty"`
}

CalendarItem is generated from the Flashduty OpenAPI schema.

type CalendarListRequest

type CalendarListRequest struct {
	// Calendar kind filter. Defaults to personal when empty.
	Kind string `json:"kind,omitempty"`
	// Disable locale filtering when listing public-holiday calendars.
	NoLocale bool `json:"no_locale,omitempty"`
}

CalendarListRequest is generated from the Flashduty OpenAPI schema.

type CalendarListResponse

type CalendarListResponse struct {
	// Calendar items.
	Items []CalendarItem `json:"items,omitempty"`
	// Total number of calendars returned.
	Total int64 `json:"total,omitempty"`
}

CalendarListResponse is generated from the Flashduty OpenAPI schema.

type CalendarUpdateRequest

type CalendarUpdateRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id,omitempty"`
	// New calendar name.
	CalName string `json:"cal_name,omitempty"`
	// New description.
	Description string `json:"description,omitempty"`
	// Additional public-holiday calendar IDs to inherit events from.
	ExtraCalIDs []string `json:"extra_cal_ids,omitempty"`
	// New owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// New IANA timezone.
	Timezone string `json:"timezone,omitempty"`
	// Workday numbers (0 = Sunday, 6 = Saturday).
	Workdays []int64 `json:"workdays,omitempty"`
}

CalendarUpdateRequest is generated from the Flashduty OpenAPI schema.

type CalendarsService

type CalendarsService service

CalendarsService handles the "On-call/Calendars" API resource.

func (*CalendarsService) CalEventDelete

func (s *CalendarsService) CalEventDelete(ctx context.Context, req *CalEventIDRequest) (*Response, error)

Delete calendar event.

Delete a calendar event by calendar ID and event ID.

API: POST /calendar/event/delete (calEventDelete).

func (*CalendarsService) CalEventList

List calendar events.

Return events for a personal calendar within a year/month/day scope. When month and day are both omitted the whole year is returned.

API: POST /calendar/event/list (calEventList).

func (*CalendarsService) CalEventUpsert

Upsert calendar event.

Create or update a calendar event (holiday or workday override). Omit event_id to create a new event.

API: POST /calendar/event/upsert (calEventUpsert).

func (*CalendarsService) CalendarCreate

Create calendar.

Create a personal service calendar. Each account is limited to 5 calendars unless the Flashcat-Break-Cal-Limit header is set.

API: POST /calendar/create (calendarCreate).

func (*CalendarsService) CalendarDelete

func (s *CalendarsService) CalendarDelete(ctx context.Context, req *CalendarIDRequest) (*Response, error)

Delete calendar.

Delete a personal service calendar. The call fails when referenced by escalation or silence rules.

API: POST /calendar/delete (calendarDelete).

func (*CalendarsService) CalendarInfo

func (s *CalendarsService) CalendarInfo(ctx context.Context, req *CalendarIDRequest) (*CalendarItem, *Response, error)

Get calendar info.

Return details of a service calendar.

API: POST /calendar/info (calendarInfo).

func (*CalendarsService) CalendarList

List calendars.

Return the list of service calendars visible to the current account.

API: POST /calendar/list (calendarList).

func (*CalendarsService) CalendarUpdate

func (s *CalendarsService) CalendarUpdate(ctx context.Context, req *CalendarUpdateRequest) (*Response, error)

Update calendar.

Update a personal service calendar. Only non-null fields are updated.

API: POST /calendar/update (calendarUpdate).

type CancelStatusPageMigrationRequest

type CancelStatusPageMigrationRequest struct {
	// Migration job ID.
	JobID string `json:"job_id,omitempty"`
}

CancelStatusPageMigrationRequest is generated from the Flashduty OpenAPI schema.

type ChannelCreateResponse

type ChannelCreateResponse struct {
	// Newly created channel ID.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel name echoed back from the request.
	ChannelName string `json:"channel_name,omitempty"`
	// External report token. Emitted only when external reporting is enabled.
	ExternalReportToken string `json:"external_report_token,omitempty"`
}

ChannelCreateResponse is generated from the Flashduty OpenAPI schema.

type ChannelIDRequest

type ChannelIDRequest struct {
	// Channel ID.
	ChannelID int64 `json:"channel_id,omitempty"`
}

ChannelIDRequest is generated from the Flashduty OpenAPI schema.

type ChannelInfoRequest

type ChannelInfoRequest struct {
	// Channel ID to fetch.
	ChannelID int64 `json:"channel_id,omitempty"`
}

ChannelInfoRequest is generated from the Flashduty OpenAPI schema.

type ChannelInfosRequest

type ChannelInfosRequest struct {
	// Channel IDs to look up. Up to 1000.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
}

ChannelInfosRequest is generated from the Flashduty OpenAPI schema.

type ChannelInfosResponse

type ChannelInfosResponse struct {
	Items []ChannelShort `json:"items,omitempty"`
}

ChannelInfosResponse is generated from the Flashduty OpenAPI schema.

type ChannelItem

type ChannelItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Highest severity among active incidents in the channel.
	ActiveIncidentHighestSeverity string `json:"active_incident_highest_severity,omitempty"`
	// Auto-resolve timer reset mode.
	AutoResolveMode string `json:"auto_resolve_mode,omitempty"`
	// Auto-resolve timeout in seconds. 0 disables auto-resolve.
	AutoResolveTimeout int64 `json:"auto_resolve_timeout,omitempty"`
	// Channel ID.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel name.
	ChannelName string `json:"channel_name,omitempty"`
	// Creation timestamp (unix seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID who created the channel.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Deletion timestamp (unix seconds). Non-zero only for soft-deleted channels.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Free-form description.
	Description string `json:"description,omitempty"`
	// When true, automatic incident closing is disabled.
	DisableAutoClose bool `json:"disable_auto_close,omitempty"`
	// When true, outlier incident detection is disabled.
	DisableOutlierDetection bool `json:"disable_outlier_detection,omitempty"`
	// Token granted to external reporters when external reporting is enabled.
	ExternalReportToken string   `json:"external_report_token,omitempty"`
	Flapping            Flapping `json:"flapping,omitempty"`
	Group               Group    `json:"group,omitempty"`
	// Whether external reporters can file incidents into this channel.
	IsExternalReportEnabled bool `json:"is_external_report_enabled,omitempty"`
	// When true, the channel is visible only to its managing teams.
	IsPrivate bool `json:"is_private,omitempty"`
	// Whether the current user has starred this channel.
	IsStarred bool `json:"is_starred,omitempty"`
	// Timestamp of the most recent incident (unix seconds).
	LastIncidentAt int64 `json:"last_incident_at,omitempty"`
	// Additional teams that can manage the channel.
	ManagingTeamIDs        []int64         `json:"managing_team_ids,omitempty"`
	ProgressToIncidentCnts IncProgressCnts `json:"progress_to_incident_cnts,omitempty"`
	// Channel status.
	Status string `json:"status,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// Last update timestamp (unix seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

ChannelItem is generated from the Flashduty OpenAPI schema.

type ChannelRuleIDRequest

type ChannelRuleIDRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
}

ChannelRuleIDRequest is generated from the Flashduty OpenAPI schema.

type ChannelScopedListRequest

type ChannelScopedListRequest struct {
	// Channel to list rules for.
	ChannelID int64 `json:"channel_id,omitempty"`
}

ChannelScopedListRequest is generated from the Flashduty OpenAPI schema.

type ChannelShort

type ChannelShort struct {
	// Channel ID.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel name.
	ChannelName string `json:"channel_name,omitempty"`
	// Channel status.
	Status string `json:"status,omitempty"`
}

ChannelShort is generated from the Flashduty OpenAPI schema.

type ChannelsService

type ChannelsService service

ChannelsService handles the "On-call/Channels" API resource.

func (*ChannelsService) ChannelCreate

Create channel.

Create a new channel for incident management.

API: POST /channel/create (channelCreate).

func (*ChannelsService) ChannelDelete

func (s *ChannelsService) ChannelDelete(ctx context.Context, req *ChannelIDRequest) (*Response, error)

Delete channel.

Delete a channel and all associated configuration.

API: POST /channel/delete (channelDelete).

func (*ChannelsService) ChannelDisable

func (s *ChannelsService) ChannelDisable(ctx context.Context, req *ChannelIDRequest) (*Response, error)

Disable channel.

Disable a channel to stop incident routing without deleting it.

API: POST /channel/disable (channelDisable).

func (*ChannelsService) ChannelEnable

func (s *ChannelsService) ChannelEnable(ctx context.Context, req *ChannelIDRequest) (*Response, error)

Enable channel.

Enable a disabled channel to resume incident routing.

API: POST /channel/enable (channelEnable).

func (*ChannelsService) ChannelEscalateRuleCreate

func (s *ChannelsService) ChannelEscalateRuleCreate(ctx context.Context, req *CreateEscalationRuleRequest) (*RuleCreateResponse, *Response, error)

Create escalation rule.

Create an escalation rule defining who gets notified and when during an incident.

API: POST /channel/escalate/rule/create (channelEscalateRuleCreate).

func (*ChannelsService) ChannelEscalateRuleDelete

func (s *ChannelsService) ChannelEscalateRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Delete escalation rule.

Delete an escalation rule.

API: POST /channel/escalate/rule/delete (channelEscalateRuleDelete).

func (*ChannelsService) ChannelEscalateRuleDisable

func (s *ChannelsService) ChannelEscalateRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Disable escalation rule.

Disable an escalation rule without deleting it.

API: POST /channel/escalate/rule/disable (channelEscalateRuleDisable).

func (*ChannelsService) ChannelEscalateRuleEnable

func (s *ChannelsService) ChannelEscalateRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Enable escalation rule.

Enable a disabled escalation rule.

API: POST /channel/escalate/rule/enable (channelEscalateRuleEnable).

func (*ChannelsService) ChannelEscalateRuleInfo

func (s *ChannelsService) ChannelEscalateRuleInfo(ctx context.Context, req *ChannelRuleIDRequest) (*EscalateRuleItem, *Response, error)

Get escalation rule detail.

Retrieve detailed information for a specific escalation rule.

API: POST /channel/escalate/rule/info (channelEscalateRuleInfo).

func (*ChannelsService) ChannelEscalateRuleList

List escalation rules.

List all escalation rules for a channel.

API: POST /channel/escalate/rule/list (channelEscalateRuleList).

func (*ChannelsService) ChannelEscalateRuleUpdate

func (s *ChannelsService) ChannelEscalateRuleUpdate(ctx context.Context, req *UpdateEscalationRuleRequest) (*Response, error)

Update escalation rule.

Update an existing escalation rule configuration.

API: POST /channel/escalate/rule/update (channelEscalateRuleUpdate).

func (*ChannelsService) ChannelInfo

Get channel detail.

Retrieve detailed information for a specific channel.

API: POST /channel/info (channelInfo).

func (*ChannelsService) ChannelInfos

Batch get channels.

Retrieve multiple channels by their IDs.

API: POST /channel/infos (channelInfos).

func (*ChannelsService) ChannelInhibitRuleCreate

func (s *ChannelsService) ChannelInhibitRuleCreate(ctx context.Context, req *CreateInhibitRuleRequest) (*RuleCreateResponse, *Response, error)

Create inhibit rule.

Create an inhibit rule to suppress lower-priority alerts when higher-priority ones are firing.

API: POST /channel/inhibit/rule/create (channelInhibitRuleCreate).

func (*ChannelsService) ChannelInhibitRuleDelete

func (s *ChannelsService) ChannelInhibitRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Delete inhibit rule.

Delete an inhibit rule.

API: POST /channel/inhibit/rule/delete (channelInhibitRuleDelete).

func (*ChannelsService) ChannelInhibitRuleDisable

func (s *ChannelsService) ChannelInhibitRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Disable inhibit rule.

Disable an inhibit rule without deleting it.

API: POST /channel/inhibit/rule/disable (channelInhibitRuleDisable).

func (*ChannelsService) ChannelInhibitRuleEnable

func (s *ChannelsService) ChannelInhibitRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Enable inhibit rule.

Enable a disabled inhibit rule.

API: POST /channel/inhibit/rule/enable (channelInhibitRuleEnable).

func (*ChannelsService) ChannelInhibitRuleList

List inhibit rules.

List all inhibit rules configured for a channel.

API: POST /channel/inhibit/rule/list (channelInhibitRuleList).

func (*ChannelsService) ChannelInhibitRuleUpdate

func (s *ChannelsService) ChannelInhibitRuleUpdate(ctx context.Context, req *UpdateInhibitRuleRequest) (*Response, error)

Update inhibit rule.

Update an existing inhibit rule configuration.

API: POST /channel/inhibit/rule/update (channelInhibitRuleUpdate).

func (*ChannelsService) ChannelList

List channels.

List channels accessible to the current user with optional filters.

API: POST /channel/list (channelList).

func (*ChannelsService) ChannelNotifyRuleCreate

func (s *ChannelsService) ChannelNotifyRuleCreate(ctx context.Context) (*Response, error)

Create channel notification rule.

Create a notification rule for a channel.

API: POST /channel/notify/rule/create (channelNotifyRuleCreate).

func (*ChannelsService) ChannelNotifyRuleDelete

func (s *ChannelsService) ChannelNotifyRuleDelete(ctx context.Context) (*Response, error)

Delete channel notification rule.

Delete a channel notification rule.

API: POST /channel/notify/rule/delete (channelNotifyRuleDelete).

func (*ChannelsService) ChannelNotifyRuleDisable

func (s *ChannelsService) ChannelNotifyRuleDisable(ctx context.Context) (*Response, error)

Disable channel notification rule.

Disable a channel notification rule without deleting it.

API: POST /channel/notify/rule/disable (channelNotifyRuleDisable).

func (*ChannelsService) ChannelNotifyRuleEnable

func (s *ChannelsService) ChannelNotifyRuleEnable(ctx context.Context) (*Response, error)

Enable channel notification rule.

Enable a disabled channel notification rule.

API: POST /channel/notify/rule/enable (channelNotifyRuleEnable).

func (*ChannelsService) ChannelNotifyRuleList

func (s *ChannelsService) ChannelNotifyRuleList(ctx context.Context) (*Response, error)

List channel notification rules.

List all notification rules configured for a channel.

API: POST /channel/notify/rule/list (channelNotifyRuleList).

func (*ChannelsService) ChannelNotifyRuleUpdate

func (s *ChannelsService) ChannelNotifyRuleUpdate(ctx context.Context) (*Response, error)

Update channel notification rule.

Update an existing channel notification rule.

API: POST /channel/notify/rule/update (channelNotifyRuleUpdate).

func (*ChannelsService) ChannelSilenceRuleCreate

func (s *ChannelsService) ChannelSilenceRuleCreate(ctx context.Context, req *CreateSilenceRuleRequest) (*RuleCreateResponse, *Response, error)

Create silence rule.

Create a silence rule to suppress notifications matching specified conditions.

API: POST /channel/silence/rule/create (channelSilenceRuleCreate).

func (*ChannelsService) ChannelSilenceRuleDelete

func (s *ChannelsService) ChannelSilenceRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Delete silence rule.

Delete a silence rule.

API: POST /channel/silence/rule/delete (channelSilenceRuleDelete).

func (*ChannelsService) ChannelSilenceRuleDisable

func (s *ChannelsService) ChannelSilenceRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Disable silence rule.

Disable a silence rule without deleting it.

API: POST /channel/silence/rule/disable (channelSilenceRuleDisable).

func (*ChannelsService) ChannelSilenceRuleEnable

func (s *ChannelsService) ChannelSilenceRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Enable silence rule.

Enable a disabled silence rule.

API: POST /channel/silence/rule/enable (channelSilenceRuleEnable).

func (*ChannelsService) ChannelSilenceRuleList

List silence rules.

List all silence rules configured for a channel.

API: POST /channel/silence/rule/list (channelSilenceRuleList).

func (*ChannelsService) ChannelSilenceRuleUpdate

func (s *ChannelsService) ChannelSilenceRuleUpdate(ctx context.Context, req *UpdateSilenceRuleRequest) (*Response, error)

Update silence rule.

Update an existing silence rule configuration.

API: POST /channel/silence/rule/update (channelSilenceRuleUpdate).

func (*ChannelsService) ChannelUnsubscribeRuleCreate

func (s *ChannelsService) ChannelUnsubscribeRuleCreate(ctx context.Context, req *CreateDropRuleRequest) (*RuleCreateResponse, *Response, error)

Create drop rule.

Create a drop rule to filter out unwanted alerts before they become incidents.

API: POST /channel/unsubscribe/rule/create (channelUnsubscribeRuleCreate).

func (*ChannelsService) ChannelUnsubscribeRuleDelete

func (s *ChannelsService) ChannelUnsubscribeRuleDelete(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Delete drop rule.

Delete a drop rule.

API: POST /channel/unsubscribe/rule/delete (channelUnsubscribeRuleDelete).

func (*ChannelsService) ChannelUnsubscribeRuleDisable

func (s *ChannelsService) ChannelUnsubscribeRuleDisable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Disable drop rule.

Disable a drop rule without deleting it.

API: POST /channel/unsubscribe/rule/disable (channelUnsubscribeRuleDisable).

func (*ChannelsService) ChannelUnsubscribeRuleEnable

func (s *ChannelsService) ChannelUnsubscribeRuleEnable(ctx context.Context, req *ChannelRuleIDRequest) (*Response, error)

Enable drop rule.

Enable a disabled drop rule.

API: POST /channel/unsubscribe/rule/enable (channelUnsubscribeRuleEnable).

func (*ChannelsService) ChannelUnsubscribeRuleList

func (s *ChannelsService) ChannelUnsubscribeRuleList(ctx context.Context, req *ChannelScopedListRequest) (*ListDropRulesResponse, *Response, error)

List drop rules.

List drop rules for a channel.

API: POST /channel/unsubscribe/rule/list (channelUnsubscribeRuleList).

func (*ChannelsService) ChannelUnsubscribeRuleUpdate

func (s *ChannelsService) ChannelUnsubscribeRuleUpdate(ctx context.Context, req *UpdateDropRuleRequest) (*Response, error)

Update drop rule.

Update an existing drop rule configuration.

API: POST /channel/unsubscribe/rule/update (channelUnsubscribeRuleUpdate).

func (*ChannelsService) ChannelUpdate

Update channel.

Update an existing channel's configuration and settings.

API: POST /channel/update (channelUpdate).

func (*ChannelsService) RouteInfo

func (s *ChannelsService) RouteInfo(ctx context.Context, req *RouteInfoRequest) (*RouteItem, *Response, error)

Get routing rule detail.

Retrieve the routing rule configuration for a specific integration. Returns null when the integration has no routing rule configured.

API: POST /route/info (routeInfo).

func (*ChannelsService) RouteList

List routing rules.

Return routing rules for the specified integrations. Integrations without a configured rule are omitted from the response.

API: POST /route/list (routeList).

func (*ChannelsService) RouteUpsert

func (s *ChannelsService) RouteUpsert(ctx context.Context, req *UpsertRouteRequest) (*Response, error)

Upsert routing rule.

Create or update routing rules for an integration to direct alerts to specific channels. At least one of `cases` or `default` must be provided.

API: POST /route/upsert (routeUpsert).

type Client

type Client struct {
	BaseURL   *url.URL
	UserAgent string
	// contains filtered or unexported fields
}

Client is a Flashduty Open API client. Construct it with NewClient and use the service fields (added by the generator) to call endpoints.

Example (ErrorHandling)

ExampleClient_errorHandling distinguishes API errors from rate-limit errors.

package main

import (
	"context"
	"errors"
	"fmt"
	"log"
	"time"

	flashduty "github.com/flashcatcloud/go-flashduty"
)

func main() {
	ctx := context.Background()

	client, err := flashduty.NewClient("YOUR_APP_KEY")
	if err != nil {
		log.Fatal(err)
	}

	_, _, err = client.Incidents.Info(ctx, &flashduty.IncidentInfoRequest{
		IncidentID: "does-not-exist",
	})

	var rl *flashduty.RateLimitError
	if errors.As(err, &rl) {
		// Back off for the duration the server asked for, then retry.
		time.Sleep(rl.RetryAfter)
		return
	}

	var apiErr *flashduty.ErrorResponse
	if errors.As(err, &apiErr) {
		fmt.Printf("api error code=%s request_id=%s\n", apiErr.Code, apiErr.RequestID)
		return
	}

	if err != nil {
		log.Fatal(err)
	}
}

func NewClient

func NewClient(appKey string, opts ...Option) (*Client, error)

NewClient returns a Flashduty client authenticated with the given app key.

Example

ExampleNewClient shows how to construct a client with a couple of options.

package main

import (
	"fmt"
	"log"
	"time"

	flashduty "github.com/flashcatcloud/go-flashduty"
)

func main() {
	client, err := flashduty.NewClient(
		"YOUR_APP_KEY",
		flashduty.WithTimeout(30*time.Second),
		flashduty.WithUserAgent("my-app/1.0"),
	)
	if err != nil {
		log.Fatal(err)
	}
	_ = client

	fmt.Println("client ready")
}

type CommentIncidentRequest

type CommentIncidentRequest struct {
	// Comment body.
	Comment string `json:"comment,omitempty"`
	// Incident IDs to comment on. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// When true, do not trigger webhook reply actions for this comment.
	MuteReply bool `json:"mute_reply,omitempty"`
}

CommentIncidentRequest is generated from the Flashduty OpenAPI schema.

type CreateChannelRequest

type CreateChannelRequest struct {
	// Auto-resolve timer reset mode.
	AutoResolveMode string `json:"auto_resolve_mode,omitempty"`
	// Auto-resolve timeout in seconds. 0 disables auto-resolve. Max 30 days.
	AutoResolveTimeout int64 `json:"auto_resolve_timeout,omitempty"`
	// Channel name. 1 to 59 characters.
	ChannelName string `json:"channel_name,omitempty"`
	// Free-form description. Up to 500 characters.
	Description string `json:"description,omitempty"`
	// Disable automatic incident closing.
	DisableAutoClose bool `json:"disable_auto_close,omitempty"`
	// Disable outlier incident detection.
	DisableOutlierDetection bool `json:"disable_outlier_detection,omitempty"`
	// Default escalation rule applied to the channel. Omit to skip default escalation.
	EscalateRule CreateChannelRequestEscalateRule `json:"escalate_rule,omitempty"`
	// Flapping detection configuration.
	Flapping CreateChannelRequestFlapping `json:"flapping,omitempty"`
	// Alert grouping configuration.
	Group CreateChannelRequestGroup `json:"group,omitempty"`
	// Allow external reporters to file incidents into this channel.
	IsExternalReportEnabled bool `json:"is_external_report_enabled,omitempty"`
	// When true, the channel is visible only to its managing teams.
	IsPrivate bool `json:"is_private,omitempty"`
	// Additional teams that can manage the channel. Up to 3 entries.
	ManagingTeamIDs []int64 `json:"managing_team_ids,omitempty"`
	// IDs of plugins (integrations) subscribed to this channel.
	PluginIDs []int64 `json:"plugin_ids,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
}

CreateChannelRequest is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestEscalateRule

type CreateChannelRequestEscalateRule struct {
	// Aggregation window in seconds. 0 disables aggregation.
	AggrWindow int64 `json:"aggr_window,omitempty"`
	// Notification target. At least one of `person_ids`, `team_ids`, `schedule_to_role_ids`, or `emails` must be set, together with either `by` or `webhooks`.
	Target CreateChannelRequestEscalateRuleTarget `json:"target,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
}

CreateChannelRequestEscalateRule is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestEscalateRuleTarget

type CreateChannelRequestEscalateRuleTarget struct {
	// Per-severity personal notification channels. Required unless `webhooks` is provided.
	By CreateChannelRequestEscalateRuleTargetBy `json:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Map of schedule ID to the role IDs on that schedule to notify.
	ScheduleToRoleIDs map[string][]int64 `json:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []CreateChannelRequestEscalateRuleTargetWebhooksItem `json:"webhooks,omitempty"`
}

CreateChannelRequestEscalateRuleTarget is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestEscalateRuleTargetBy

type CreateChannelRequestEscalateRuleTargetBy struct {
	// Channels for Critical events (e.g. `voice`, `sms`, `email`, `feishu`).
	Critical []string `json:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty"`
}

CreateChannelRequestEscalateRuleTargetBy is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestEscalateRuleTargetWebhooksItem

type CreateChannelRequestEscalateRuleTargetWebhooksItem struct {
	// Type-specific settings (chat IDs, URLs, etc.).
	Settings map[string]any `json:"settings,omitempty"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type,omitempty"`
}

CreateChannelRequestEscalateRuleTargetWebhooksItem is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestFlapping

type CreateChannelRequestFlapping struct {
	// Observation window in minutes.
	InMins int64 `json:"in_mins,omitempty"`
	// Disable flapping detection.
	IsDisabled bool `json:"is_disabled,omitempty"`
	// Max state changes allowed within `in_mins`.
	MaxChanges int64 `json:"max_changes,omitempty"`
	// Mute duration in minutes after flapping is detected.
	MuteMins int64 `json:"mute_mins,omitempty"`
}

CreateChannelRequestFlapping is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestGroup

type CreateChannelRequestGroup struct {
	// When true, all listed keys must be present for grouping.
	AllEqualsRequired bool `json:"all_equals_required,omitempty"`
	// Per-filter grouping overrides.
	Cases []map[string]any `json:"cases,omitempty"`
	// Groups of label keys whose equality defines a bucket.
	Equals [][]string `json:"equals,omitempty"`
	// Label keys used for intelligent grouping embeddings.
	IKeys []string `json:"i_keys,omitempty"`
	// Intelligent grouping similarity threshold.
	IScoreThreshold float64 `json:"i_score_threshold,omitempty"`
	// Grouping method: `i` intelligent, `p` pattern, `n` none.
	Method string `json:"method,omitempty"`
	// Alert storm threshold.
	StormThreshold int64 `json:"storm_threshold,omitempty"`
	// Multi-level storm thresholds.
	StormThresholds []int64 `json:"storm_thresholds,omitempty"`
	// Grouping time window in seconds.
	TimeWindow int64 `json:"time_window,omitempty"`
	// Window type. Defaults to `tumbling`.
	WindowType string `json:"window_type,omitempty"`
}

CreateChannelRequestGroup is generated from the Flashduty OpenAPI schema.

type CreateDropRuleRequest

type CreateDropRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty"`
	// Or-of-and filter tree. Each outer element is an AND group; within each group, all conditions must match.
	Filters [][]CreateDropRuleRequestFiltersItemItem `json:"filters,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
}

CreateDropRuleRequest is generated from the Flashduty OpenAPI schema.

type CreateDropRuleRequestFiltersItemItem

type CreateDropRuleRequestFiltersItemItem struct {
	// Field key (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Filter operator.
	Oper string `json:"oper,omitempty"`
	// Values to match.
	Vals []string `json:"vals,omitempty"`
}

CreateDropRuleRequestFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequest

type CreateEscalationRuleRequest struct {
	// Aggregation window in seconds. 0 disables aggregation.
	AggrWindow int64 `json:"aggr_window,omitempty"`
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty"`
	// Or-of-and filter tree. Each outer element is an AND group; within each group, all conditions must match.
	Filters [][]CreateEscalationRuleRequestFiltersItemItem `json:"filters,omitempty"`
	// Escalation levels in order. At least one level is required.
	Layers []CreateEscalationRuleRequestLayersItem `json:"layers,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
	// Optional recurring time windows during which the rule applies.
	TimeFilters []CreateEscalationRuleRequestTimeFiltersItem `json:"time_filters,omitempty"`
}

CreateEscalationRuleRequest is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestFiltersItemItem

type CreateEscalationRuleRequestFiltersItemItem struct {
	// Field key (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Filter operator.
	Oper string `json:"oper,omitempty"`
	// Values to match.
	Vals []string `json:"vals,omitempty"`
}

CreateEscalationRuleRequestFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestLayersItem

type CreateEscalationRuleRequestLayersItem struct {
	// Wait before moving to the next level, in minutes.
	EscalateWindow int64 `json:"escalate_window,omitempty"`
	// When true, always escalate regardless of acknowledgement.
	ForceEscalate bool `json:"force_escalate,omitempty"`
	// Max repeat notifications within the level.
	MaxTimes int64 `json:"max_times,omitempty"`
	// Repeat interval in minutes.
	NotifyStep float64 `json:"notify_step,omitempty"`
	// Notification target. At least one of `person_ids`, `team_ids`, `schedule_to_role_ids`, or `emails` must be set, together with either `by` or `webhooks`.
	Target CreateEscalationRuleRequestLayersItemTarget `json:"target,omitempty"`
}

CreateEscalationRuleRequestLayersItem is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestLayersItemTarget

type CreateEscalationRuleRequestLayersItemTarget struct {
	// Per-severity personal notification channels. Required unless `webhooks` is provided.
	By CreateEscalationRuleRequestLayersItemTargetBy `json:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Map of schedule ID to the role IDs on that schedule to notify.
	ScheduleToRoleIDs map[string][]int64 `json:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []CreateEscalationRuleRequestLayersItemTargetWebhooksItem `json:"webhooks,omitempty"`
}

CreateEscalationRuleRequestLayersItemTarget is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestLayersItemTargetBy

type CreateEscalationRuleRequestLayersItemTargetBy struct {
	// Channels for Critical events (e.g. `voice`, `sms`, `email`, `feishu`).
	Critical []string `json:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty"`
}

CreateEscalationRuleRequestLayersItemTargetBy is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestLayersItemTargetWebhooksItem

type CreateEscalationRuleRequestLayersItemTargetWebhooksItem struct {
	// Type-specific settings (chat IDs, URLs, etc.).
	Settings map[string]any `json:"settings,omitempty"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type,omitempty"`
}

CreateEscalationRuleRequestLayersItemTargetWebhooksItem is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequestTimeFiltersItem

type CreateEscalationRuleRequestTimeFiltersItem struct {
	// Optional calendar ID; restricts the window to days matching the calendar.
	CalID string `json:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty"`
}

CreateEscalationRuleRequestTimeFiltersItem is generated from the Flashduty OpenAPI schema.

type CreateFieldRequest

type CreateFieldRequest struct {
	// Optional default value. Type must match `field_type`: `bool` for checkbox; one of `options` for single_select; subset of `options` for multi_select; string ≤3000 chars for text.
	DefaultValue any `json:"default_value,omitempty"`
	// Optional free-text description.
	Description string `json:"description,omitempty"`
	// Human-readable name. Must be unique within the account.
	DisplayName string `json:"display_name,omitempty"`
	// Machine name. Must start with a letter or underscore; 1–40 chars of `[a-zA-Z0-9_]`. Immutable after creation.
	FieldName string `json:"field_name,omitempty"`
	// Field input type. Immutable after creation.
	FieldType string `json:"field_type,omitempty"`
	// Required and non-empty for `single_select`/`multi_select` (unique strings, each 1–200 chars). Must be omitted or empty for `checkbox`/`text`.
	Options []string `json:"options,omitempty"`
	// Stored value type. `checkbox` requires `bool`; `single_select`/`multi_select`/`text` require `string`. Immutable after creation.
	ValueType string `json:"value_type,omitempty"`
}

CreateFieldRequest is generated from the Flashduty OpenAPI schema.

type CreateFieldResponse

type CreateFieldResponse struct {
	// Newly assigned field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id,omitempty"`
	// Echo of the submitted `field_name`.
	FieldName string `json:"field_name,omitempty"`
}

CreateFieldResponse is generated from the Flashduty OpenAPI schema.

type CreateIncidentRequest

type CreateIncidentRequest struct {
	// Incident assignment target. Either `person_ids` or `escalate_rule_id` must be provided.
	AssignedTo CreateIncidentRequestAssignedTo `json:"assigned_to,omitempty"`
	// Channel to file the incident into. Optional; leave unset for a standalone incident.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Incident description, up to 1024 characters.
	Description string `json:"description,omitempty"`
	// Incident severity.
	IncidentSeverity string `json:"incident_severity,omitempty"`
	// Incident title, up to 512 characters.
	Title string `json:"title,omitempty"`
}

CreateIncidentRequest is generated from the Flashduty OpenAPI schema.

type CreateIncidentRequestAssignedTo

type CreateIncidentRequestAssignedTo struct {
	// Email recipients, used for ServiceNow-style integrations.
	Emails []string `json:"emails,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) to drive assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty"`
	// Starting layer index when using an escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty"`
	// Override the notification channels used for this assignment.
	Notify CreateIncidentRequestAssignedToNotify `json:"notify,omitempty"`
	// Member IDs to assign directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Assignment type.
	Type string `json:"type,omitempty"`
}

CreateIncidentRequestAssignedTo is generated from the Flashduty OpenAPI schema.

type CreateIncidentRequestAssignedToNotify

type CreateIncidentRequestAssignedToNotify struct {
	// When true, fall back to each responder's personal preference.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Channels to use (e.g. `voice`, `sms`, `email`).
	PersonalChannels []string `json:"personal_channels,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
}

CreateIncidentRequestAssignedToNotify is generated from the Flashduty OpenAPI schema.

type CreateIncidentResponse

type CreateIncidentResponse struct {
	// Newly created incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Echoes the incident title from the request.
	Title string `json:"title,omitempty"`
}

CreateIncidentResponse is generated from the Flashduty OpenAPI schema.

type CreateInhibitRuleRequest

type CreateInhibitRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty"`
	// Label keys used to pair source and target alerts.
	Equals []string `json:"equals,omitempty"`
	// When true, suppressed target alerts are dropped instead of merged.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
	// Or-of-and filter tree. Each outer element is an AND group; within each group, all conditions must match.
	SourceFilters [][]CreateInhibitRuleRequestSourceFiltersItemItem `json:"source_filters,omitempty"`
	// Or-of-and filter tree. Each outer element is an AND group; within each group, all conditions must match.
	TargetFilters [][]CreateInhibitRuleRequestTargetFiltersItemItem `json:"target_filters,omitempty"`
}

CreateInhibitRuleRequest is generated from the Flashduty OpenAPI schema.

type CreateInhibitRuleRequestSourceFiltersItemItem

type CreateInhibitRuleRequestSourceFiltersItemItem struct {
	// Field key (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Filter operator.
	Oper string `json:"oper,omitempty"`
	// Values to match.
	Vals []string `json:"vals,omitempty"`
}

CreateInhibitRuleRequestSourceFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateInhibitRuleRequestTargetFiltersItemItem

type CreateInhibitRuleRequestTargetFiltersItemItem struct {
	// Field key (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Filter operator.
	Oper string `json:"oper,omitempty"`
	// Values to match.
	Vals []string `json:"vals,omitempty"`
}

CreateInhibitRuleRequestTargetFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequest

type CreateSilenceRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty"`
	// Or-of-and filter tree. Each outer element is an AND group; within each group, all conditions must match.
	Filters [][]CreateSilenceRuleRequestFiltersItemItem `json:"filters,omitempty"`
	// Source incident ID when the silence was created from an incident.
	FromIncidentID string `json:"from_incident_id,omitempty"`
	// When true, the silence rule is automatically deleted after its time window expires. Defaults to false.
	IsAutoDelete bool `json:"is_auto_delete,omitempty"`
	// When true, silenced alerts are dropped instead of suppressed into incidents.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
	// One-off time window defined by unix seconds.
	TimeFilter CreateSilenceRuleRequestTimeFilter `json:"time_filter,omitempty"`
	// Recurring time windows during which silencing applies. Mutually exclusive with `time_filter`.
	TimeFilters []CreateSilenceRuleRequestTimeFiltersItem `json:"time_filters,omitempty"`
}

CreateSilenceRuleRequest is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequestFiltersItemItem

type CreateSilenceRuleRequestFiltersItemItem struct {
	// Field key (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Filter operator.
	Oper string `json:"oper,omitempty"`
	// Values to match.
	Vals []string `json:"vals,omitempty"`
}

CreateSilenceRuleRequestFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequestTimeFilter

type CreateSilenceRuleRequestTimeFilter struct {
	// Window end (unix seconds).
	EndTime int64 `json:"end_time,omitempty"`
	// Window start (unix seconds). Must be less than `end_time`.
	StartTime int64 `json:"start_time,omitempty"`
}

CreateSilenceRuleRequestTimeFilter is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequestTimeFiltersItem

type CreateSilenceRuleRequestTimeFiltersItem struct {
	// Optional calendar ID; restricts the window to days matching the calendar.
	CalID string `json:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty"`
}

CreateSilenceRuleRequestTimeFiltersItem is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeRequest

type CreateStatusPageChangeRequest struct {
	// Maintenance only: automatically advance the status based on the scheduled window.
	AutoUpdateBySchedule bool `json:"auto_update_by_schedule,omitempty"`
	// Scheduled close time for retrospective events. Must be greater than `start_at_seconds`.
	CloseAtSeconds int64 `json:"close_at_seconds,omitempty"`
	// Event description (Markdown). Required by the validator.
	Description string `json:"description,omitempty"`
	// Mark this event as a retrospective (historical) one.
	IsRetrospective bool `json:"is_retrospective,omitempty"`
	// Linked change IDs (related incidents, deployments, etc.).
	LinkedChanges []string `json:"linked_changes,omitempty"`
	// Notify subscribers about this event and all its updates.
	NotifySubscribers bool `json:"notify_subscribers,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Member IDs responsible for this event.
	Responders []int64 `json:"responders,omitempty"`
	// Event start time in unix seconds. Defaults to now when omitted.
	StartAtSeconds int64 `json:"start_at_seconds,omitempty"`
	// Initial event status. `investigating`/`identified`/`monitoring`/`resolved` apply to incidents; `scheduled`/`ongoing`/`completed` apply to maintenances.
	Status string `json:"status,omitempty"`
	// Event title, up to 255 characters.
	Title string `json:"title,omitempty"`
	// Event type.
	Type string `json:"type,omitempty"`
	// Timeline updates. Immediate events normally pass one update; retrospective events must pass all historical updates.
	Updates []CreateStatusPageChangeRequestUpdatesItem `json:"updates,omitempty"`
}

CreateStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeRequestUpdatesItem

type CreateStatusPageChangeRequestUpdatesItem struct {
	// Update timestamp in unix seconds.
	AtSeconds int64 `json:"at_seconds,omitempty"`
	// Component status transitions applied by this update.
	ComponentChanges []CreateStatusPageChangeRequestUpdatesItemComponentChangesItem `json:"component_changes,omitempty"`
	// Update description (Markdown).
	Description string `json:"description,omitempty"`
	// Change status after this update. Omit if the overall status does not change.
	Status string `json:"status,omitempty"`
	// Update ID. Server-assigned on create; supply when replaying historical updates.
	UpdateID string `json:"update_id,omitempty"`
}

CreateStatusPageChangeRequestUpdatesItem is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem

type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem struct {
	// Component ID.
	ComponentID string `json:"component_id,omitempty"`
	// New component status. `operational`/`degraded`/`partial_outage`/`full_outage` apply to incidents; `operational`/`under_maintenance` apply to maintenances.
	Status string `json:"status,omitempty"`
}

CreateStatusPageChangeRequestUpdatesItemComponentChangesItem is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeTimelineRequest

type CreateStatusPageChangeTimelineRequest struct {
	// Update timestamp in unix seconds. Defaults to now when omitted.
	AtSeconds int64 `json:"at_seconds,omitempty"`
	// Target event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Component status transitions applied by this update. Component IDs must be unique.
	ComponentChanges []CreateStatusPageChangeTimelineRequestComponentChangesItem `json:"component_changes,omitempty"`
	// Update description (Markdown). Required.
	Description string `json:"description,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// New event status. Must match the event type. When the status transitions to `resolved` or `completed`, all referenced components must become `operational`.
	Status string `json:"status,omitempty"`
}

CreateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeTimelineRequestComponentChangesItem

type CreateStatusPageChangeTimelineRequestComponentChangesItem struct {
	// Component ID.
	ComponentID string `json:"component_id,omitempty"`
	// New component status. `operational`/`degraded`/`partial_outage`/`full_outage` apply to incidents; `operational`/`under_maintenance` apply to maintenances.
	Status string `json:"status,omitempty"`
}

CreateStatusPageChangeTimelineRequestComponentChangesItem is generated from the Flashduty OpenAPI schema.

type CreateWarRoomRequest

type CreateWarRoomRequest struct {
	// When true, also add historical responders of the incident as observers.
	AddObservers bool `json:"add_observers,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// IM integration ID. Must have war room enabled; Feishu, DingTalk, WeCom (self-built), Slack and Teams are supported.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Additional member IDs to add to the war room.
	MemberIDs []int64 `json:"member_ids,omitempty"`
}

CreateWarRoomRequest is generated from the Flashduty OpenAPI schema.

type DataSourceItem

type DataSourceItem struct {
	// Account ID.
	AccountID uint64 `json:"account_id,omitempty"`
	// Connection address. For Prometheus/Loki/VictoriaLogs: HTTP URL. For MySQL/Oracle/Postgres/ClickHouse: `host:port`. For SLS: endpoint without http/https prefix.
	Address string `json:"address,omitempty"`
	// Monitors edge cluster name responsible for evaluating rules using this datasource.
	EdgeClusterName string `json:"edge_cluster_name,omitempty"`
	// Whether the datasource is active.
	Enabled bool `json:"enabled,omitempty"`
	// Unique datasource ID.
	ID uint64 `json:"id,omitempty"`
	// Datasource display name.
	Name string `json:"name,omitempty"`
	// Optional description.
	Note    string    `json:"note,omitempty"`
	Payload DsPayload `json:"payload,omitempty"`
	// Datasource type identifier. Allowed: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.
	TypeIdent string `json:"type_ident,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

DataSourceItem is generated from the Flashduty OpenAPI schema.

type DataSourceListRequest

type DataSourceListRequest struct {
	// Filter by datasource type identifier. Omit to return all types. Allowed values: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.
	Type string `json:"type,omitempty"`
}

DataSourceListRequest is generated from the Flashduty OpenAPI schema.

type DataSourceListResponse

type DataSourceListResponse []DataSourceItem

DataSourceListResponse is a list response payload.

type DataSourceUpsertRequest

type DataSourceUpsertRequest struct {
	// Connection address. For Prometheus/Loki/VictoriaLogs: HTTP URL. For MySQL/Oracle/Postgres/ClickHouse: `host:port`. For SLS: endpoint without http/https prefix. Not required for Elasticsearch cloud deployment.
	Address string `json:"address,omitempty"`
	// Monitors edge cluster name responsible for evaluating rules using this datasource.
	EdgeClusterName string `json:"edge_cluster_name,omitempty"`
	// Datasource ID. Required for update; omit for create.
	ID uint64 `json:"id,omitempty"`
	// Datasource display name.
	Name string `json:"name,omitempty"`
	// Optional description.
	Note string `json:"note,omitempty"`
	// Type-specific configuration block. Must include the key matching `type_ident`.
	Payload DsPayload `json:"payload,omitempty"`
	// Datasource type identifier. Allowed: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.
	TypeIdent string `json:"type_ident,omitempty"`
}

DataSourceUpsertRequest is generated from the Flashduty OpenAPI schema.

type DataSourcesService

type DataSourcesService service

DataSourcesService handles the "Monitors/Data sources" API resource.

func (*DataSourcesService) ReadInfo

Get datasource detail.

Retrieve full details of a single data source by its ID, including the `payload` configuration.

API: POST /monit/datasource/info (monit-datasource-read-info).

func (*DataSourcesService) ReadList

List datasources.

Return all data sources for the current account. Optionally filter by `type_ident`.

API: POST /monit/datasource/list (monit-datasource-read-list).

func (*DataSourcesService) ReadSLSLogstores

List SLS logstores.

List logstores within an SLS project for the specified SLS datasource.

API: POST /monit/datasource/sls/logstores (monit-datasource-read-sls-logstores).

func (*DataSourcesService) ReadSLSProjects

List SLS projects.

List Alibaba Cloud SLS (Simple Log Service) projects available in the specified SLS datasource.

API: POST /monit/datasource/sls/projects (monit-datasource-read-sls-projects).

func (*DataSourcesService) WriteCreate

Create datasource.

Create a new monitoring data source. The `payload` must include the type-specific configuration block.

API: POST /monit/datasource/create (monit-datasource-write-create).

func (*DataSourcesService) WriteDelete

func (s *DataSourcesService) WriteDelete(ctx context.Context, req *IDRequest) (*Response, error)

Delete datasource.

Delete a data source by ID. Alert rules referencing this datasource must be updated or deleted first.

API: POST /monit/datasource/delete (monit-datasource-write-delete).

func (*DataSourcesService) WriteUpdate

Update datasource.

Update an existing data source. Supply `id` plus the fields to change.

API: POST /monit/datasource/update (monit-datasource-write-update).

type DeleteFieldRequest

type DeleteFieldRequest struct {
	// Field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id,omitempty"`
}

DeleteFieldRequest is generated from the Flashduty OpenAPI schema.

type DeletePostMortemRequest

type DeletePostMortemRequest struct {
	// Post-mortem ID.
	PostMortemID string `json:"post_mortem_id,omitempty"`
}

DeletePostMortemRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageChangeRequest

type DeleteStatusPageChangeRequest struct {
	// Target event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
}

DeleteStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageChangeTimelineRequest

type DeleteStatusPageChangeTimelineRequest struct {
	// Parent event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Timeline update ID to delete.
	UpdateID string `json:"update_id,omitempty"`
}

DeleteStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type DeleteWarRoomRequest

type DeleteWarRoomRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// IM integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

DeleteWarRoomRequest is generated from the Flashduty OpenAPI schema.

type DiagnoseRequest

type DiagnoseRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied.
	AccountID int64 `json:"account_id,omitempty"`
	// Data source name configured under the tenant.
	DsName string `json:"ds_name,omitempty"`
	// Data source type. `log_patterns` supports `loki` and `victorialogs`; `metric_trends` supports `prometheus`.
	DsType string               `json:"ds_type,omitempty"`
	Input  DiagnoseRequestInput `json:"input,omitempty"`
	// Diagnostic methods to run. When omitted, `log_patterns` defaults to `pattern_snapshot + pattern_compare(previous_window)` and `metric_trends` defaults to `single_window_shape + window_compare(previous_window)`.
	Methods []DiagnoseRequestMethodsItem `json:"methods,omitempty"`
	// Diagnostic operation. When omitted, inferred from `ds_type` (loki / victorialogs → `log_patterns`, prometheus → `metric_trends`). Other sources must specify explicitly.
	Operation string `json:"operation,omitempty"`
	// Execution options, all upper-bounded by monit-edge.
	Options DiagnoseRequestOptions `json:"options,omitempty"`
	// Diagnostic window in Unix seconds. Defaults to the last 15 minutes when missing or invalid; windows wider than 6 hours are rejected.
	TimeRange DiagnoseRequestTimeRange `json:"time_range,omitempty"`
}

DiagnoseRequest is generated from the Flashduty OpenAPI schema.

type DiagnoseRequestInput

type DiagnoseRequestInput struct {
	// Query expression. LogQL / VictoriaLogs query syntax for `log_patterns`; PromQL for `metric_trends`.
	Query string `json:"query,omitempty"`
}

DiagnoseRequestInput is generated from the Flashduty OpenAPI schema.

type DiagnoseRequestMethodsItem

type DiagnoseRequestMethodsItem struct {
	// Only meaningful for compare-style methods. Defaults to `previous_window`.
	Baseline string `json:"baseline,omitempty"`
	// `log_patterns` supports `pattern_snapshot`, `pattern_compare`. `metric_trends` supports `single_window_shape`, `window_compare`.
	Name string `json:"name,omitempty"`
}

DiagnoseRequestMethodsItem is generated from the Flashduty OpenAPI schema.

type DiagnoseRequestOptions

type DiagnoseRequestOptions struct {
	// Max redacted examples per pattern. Default 2, hard max 3.
	ExamplesPerPattern int64 `json:"examples_per_pattern,omitempty"`
	// Per-window log scan cap. Default 10 000, hard max 50 000.
	MaxLogsScanned int64 `json:"max_logs_scanned,omitempty"`
	// Max patterns returned. Default 20, hard max 50.
	MaxPatterns int64 `json:"max_patterns,omitempty"`
	// `metric_trends` max series considered. Default 50, hard max 200.
	MaxSeries int64 `json:"max_series,omitempty"`
	// `metric_trends` query_range step. Default 60, range [15, 300].
	StepSeconds int64 `json:"step_seconds,omitempty"`
	// Edge-side diagnostic timeout in seconds. Default 25, hard max 30.
	TimeoutSeconds int64 `json:"timeout_seconds,omitempty"`
	// `metric_trends` max notable series returned. Default 10, hard max 50.
	Topk int64 `json:"topk,omitempty"`
}

DiagnoseRequestOptions is generated from the Flashduty OpenAPI schema.

type DiagnoseRequestTimeRange

type DiagnoseRequestTimeRange struct {
	// Window end, Unix seconds.
	End int64 `json:"end,omitempty"`
	// Window start, Unix seconds.
	Start int64 `json:"start,omitempty"`
}

DiagnoseRequestTimeRange is generated from the Flashduty OpenAPI schema.

type DiagnoseResponse

type DiagnoseResponse struct {
	DsName    string `json:"ds_name,omitempty"`
	DsType    string `json:"ds_type,omitempty"`
	Operation string `json:"operation,omitempty"`
	// Query string echoed back from the request.
	Query string `json:"query,omitempty"`
	// One entry per `methods[]` in the request, in the same order.
	Results []DiagnoseResponseResultsItem `json:"results,omitempty"`
	Window  DiagnoseResponseWindow        `json:"window,omitempty"`
}

DiagnoseResponse is generated from the Flashduty OpenAPI schema.

type DiagnoseResponseResultsItem

type DiagnoseResponseResultsItem struct {
	// Only present for compare-style methods.
	Baseline string `json:"baseline,omitempty"`
	// Only present for compare-style methods.
	BaselineWindow DiagnoseResponseResultsItemBaselineWindow `json:"baseline_window,omitempty"`
	// `pattern_snapshot` / `pattern_compare` for `log_patterns`; `single_window_shape` / `window_compare` for `metric_trends`.
	Method string `json:"method,omitempty"`
	// `log_patterns` only. Sorted RCA-first; each item carries pattern_hash, template, count, severity, sources, examples, and (for compare) baseline_count / change_ratio / is_new / is_gone.
	Patterns []map[string]any `json:"patterns,omitempty"`
	// `metric_trends` only. Notable series with current / baseline / change / notable_period.
	Series []map[string]any `json:"series,omitempty"`
	// Aggregate summary for this method. Shape differs between `log_patterns` (logs_scanned, patterns_total, surging_threshold, …) and `metric_trends` (series_total, data_quality, observations, …).
	Summary map[string]any `json:"summary,omitempty"`
	// Per-method advisory messages (e.g. `examples redacted`, sampling notices).
	Warnings []string                          `json:"warnings,omitempty"`
	Window   DiagnoseResponseResultsItemWindow `json:"window,omitempty"`
}

DiagnoseResponseResultsItem is generated from the Flashduty OpenAPI schema.

type DiagnoseResponseResultsItemBaselineWindow

type DiagnoseResponseResultsItemBaselineWindow struct {
	End   int64 `json:"end,omitempty"`
	Start int64 `json:"start,omitempty"`
}

DiagnoseResponseResultsItemBaselineWindow is generated from the Flashduty OpenAPI schema.

type DiagnoseResponseResultsItemWindow

type DiagnoseResponseResultsItemWindow struct {
	End   int64 `json:"end,omitempty"`
	Start int64 `json:"start,omitempty"`
}

DiagnoseResponseResultsItemWindow is generated from the Flashduty OpenAPI schema.

type DiagnoseResponseWindow

type DiagnoseResponseWindow struct {
	End   int64 `json:"end,omitempty"`
	Start int64 `json:"start,omitempty"`
}

DiagnoseResponseWindow is generated from the Flashduty OpenAPI schema.

type DiagnosticsService

type DiagnosticsService service

DiagnosticsService handles the "Monitors/Diagnostics" API resource.

func (*DiagnosticsService) QueryDiagnose

Diagnose data source.

Run a synchronous diagnostic query (`log_patterns` for Loki/VictoriaLogs, `metric_trends` for Prometheus). Used by Flashduty AI SRE for log-pattern clustering and time-series trend analysis. Long-running — up to 35 s.

API: POST /monit/query/diagnose (monit-read-query-diagnose).

func (*DiagnosticsService) QueryRows

Query data source rows.

Run a synchronous ad-hoc query against a configured data source and get back its raw rows. Used by Flashduty AI SRE and by UI preview. The request is forwarded over WebSocket to monit-edge, which executes the query against the underlying source (Prometheus / Loki / VictoriaLogs / SLS / MySQL / Postgres / Oracle / ClickHouse / Elasticsearch).

API: POST /monit/query/rows (monit-read-query-rows).

func (*DiagnosticsService) TargetsList

List monitored targets.

List the targets observed under the current tenant by the monit-agent route projection. Supports `target_locator` prefix search and cursor pagination. Use this to drive `target_locator` selection for `/monit/tools/catalog` and `/monit/tools/invoke`.

API: POST /monit/targets (monit-read-targets-list).

func (*DiagnosticsService) ToolsCatalog

List target tool catalog.

Look up the tools that the per-target monit-agent currently exposes for a given `target_locator` (host, mysql, …). Returns each tool's name, description, and JSON-Schema `input_schema`. Pair with `/monit/tools/invoke` to drive AI-SRE tool calls.

API: POST /monit/tools/catalog (monit-read-tools-catalog).

func (*DiagnosticsService) ToolsInvoke

Invoke target tools.

Invoke up to 8 monit-agent tools concurrently on a single target. Results come back in the order of the input `tools` array. Long-running — individual tools have per-tool timeouts on the agent and the whole request may take tens of seconds.

API: POST /monit/tools/invoke (monit-read-tools-invoke).

type DimensionInsightItem

type DimensionInsightItem struct {
	AccountID          int64   `json:"account_id,omitempty"`
	AcknowledgementPct float64 `json:"acknowledgement_pct,omitempty"`
	ChannelID          int64   `json:"channel_id,omitempty"`
	ChannelName        string  `json:"channel_name,omitempty"`
	// Hour bucket when `split_hours` is enabled.
	Hours                           string  `json:"hours,omitempty"`
	MeanSecondsToAck                float64 `json:"mean_seconds_to_ack,omitempty"`
	MeanSecondsToClose              float64 `json:"mean_seconds_to_close,omitempty"`
	NoiseReductionPct               float64 `json:"noise_reduction_pct,omitempty"`
	ResponderID                     int64   `json:"responder_id,omitempty"`
	ResponderName                   string  `json:"responder_name,omitempty"`
	TeamID                          int64   `json:"team_id,omitempty"`
	TeamName                        string  `json:"team_name,omitempty"`
	TotalAlertCnt                   int64   `json:"total_alert_cnt,omitempty"`
	TotalAlertEventCnt              int64   `json:"total_alert_event_cnt,omitempty"`
	TotalEngagedSeconds             int64   `json:"total_engaged_seconds,omitempty"`
	TotalIncidentCnt                int64   `json:"total_incident_cnt,omitempty"`
	TotalIncidentsAcknowledged      int64   `json:"total_incidents_acknowledged,omitempty"`
	TotalIncidentsAutoClosed        int64   `json:"total_incidents_auto_closed,omitempty"`
	TotalIncidentsClosed            int64   `json:"total_incidents_closed,omitempty"`
	TotalIncidentsEscalated         int64   `json:"total_incidents_escalated,omitempty"`
	TotalIncidentsManuallyClosed    int64   `json:"total_incidents_manually_closed,omitempty"`
	TotalIncidentsManuallyEscalated int64   `json:"total_incidents_manually_escalated,omitempty"`
	TotalIncidentsReassigned        int64   `json:"total_incidents_reassigned,omitempty"`
	TotalIncidentsTimeoutClosed     int64   `json:"total_incidents_timeout_closed,omitempty"`
	TotalIncidentsTimeoutEscalated  int64   `json:"total_incidents_timeout_escalated,omitempty"`
	TotalInterruptions              int64   `json:"total_interruptions,omitempty"`
	TotalNotifications              int64   `json:"total_notifications,omitempty"`
	TotalSecondsToAck               int64   `json:"total_seconds_to_ack,omitempty"`
	TotalSecondsToClose             int64   `json:"total_seconds_to_close,omitempty"`
	// Aggregation bucket start time, Unix seconds. Present when `aggregate_unit` is used.
	TS int64 `json:"ts,omitempty"`
}

DimensionInsightItem is generated from the Flashduty OpenAPI schema.

type DimensionInsightResponse

type DimensionInsightResponse struct {
	Items []DimensionInsightItem `json:"items,omitempty"`
}

DimensionInsightResponse is generated from the Flashduty OpenAPI schema.

type DisableIncidentMergeRequest

type DisableIncidentMergeRequest struct {
	// Incident IDs whose automatic merge should be disabled.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

DisableIncidentMergeRequest is generated from the Flashduty OpenAPI schema.

type DoIncidentCustomActionRequest

type DoIncidentCustomActionRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Custom action integration ID. Must be enabled and associated with the incident's channel.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

DoIncidentCustomActionRequest is generated from the Flashduty OpenAPI schema.

type DoIncidentCustomActionResponse

type DoIncidentCustomActionResponse struct {
	// Error message if the action's HTTP call failed; omitted on success.
	Message string `json:"message,omitempty"`
}

DoIncidentCustomActionResponse is generated from the Flashduty OpenAPI schema.

type DsClickHouseConfig

type DsClickHouseConfig struct {
	// Default database for authentication.
	Database string `json:"database,omitempty"`
	// Dial timeout in milliseconds.
	DialTimeoutMills int64 `json:"dial_timeout_mills,omitempty"`
	IdleConns        int64 `json:"idle_conns,omitempty"`
	LifetimeSeconds  int64 `json:"lifetime_seconds,omitempty"`
	// Max query execution time in seconds.
	MaxExecutionSeconds int64  `json:"max_execution_seconds,omitempty"`
	OpenConns           int64  `json:"open_conns,omitempty"`
	Password            string `json:"password,omitempty"`
	TimeoutMills        int64  `json:"timeout_mills,omitempty"`
	TlsCa               string `json:"tls_ca,omitempty"`
	TlsCert             string `json:"tls_cert,omitempty"`
	TlsEnabled          bool   `json:"tls_enabled,omitempty"`
	TlsKey              string `json:"tls_key,omitempty"`
	TlsKeyPwd           string `json:"tls_key_pwd,omitempty"`
	TlsMaxVersion       string `json:"tls_max_version,omitempty"`
	TlsMinVersion       string `json:"tls_min_version,omitempty"`
	TlsServerName       string `json:"tls_server_name,omitempty"`
	TlsSkipVerify       bool   `json:"tls_skip_verify,omitempty"`
	Username            string `json:"username,omitempty"`
}

DsClickHouseConfig is generated from the Flashduty OpenAPI schema.

type DsElasticSearchConfig

type DsElasticSearchConfig struct {
	// Elastic Cloud API key. Only for `cloud` deployment.
	APIKey                 string `json:"api_key,omitempty"`
	CertificateFingerprint string `json:"certificate_fingerprint,omitempty"`
	// Elastic Cloud deployment ID. Only for `cloud` deployment.
	CloudID string `json:"cloud_id,omitempty"`
	// Deployment type. `cloud` uses Elastic Cloud; `self-managed` uses a self-hosted cluster.
	Deployment string   `json:"deployment,omitempty"`
	Headers    []string `json:"headers,omitempty"`
	Password   string   `json:"password,omitempty"`
	// Service token; overrides username/password if set.
	ServiceToken string `json:"service_token,omitempty"`
	TimeoutMills int64  `json:"timeout_mills,omitempty"`
	TlsCa        string `json:"tls_ca,omitempty"`
	// Username for `self-managed` deployment.
	Username string `json:"username,omitempty"`
}

DsElasticSearchConfig is generated from the Flashduty OpenAPI schema.

type DsLokiConfig

type DsLokiConfig struct {
	BasicAuthEnabled  bool     `json:"basic_auth_enabled,omitempty"`
	BasicAuthPassword string   `json:"basic_auth_password,omitempty"`
	BasicAuthUsername string   `json:"basic_auth_username,omitempty"`
	Headers           []string `json:"headers,omitempty"`
	Params            []string `json:"params,omitempty"`
	TlsCa             string   `json:"tls_ca,omitempty"`
	TlsCert           string   `json:"tls_cert,omitempty"`
	TlsKey            string   `json:"tls_key,omitempty"`
	TlsKeyPwd         string   `json:"tls_key_pwd,omitempty"`
	TlsMaxVersion     string   `json:"tls_max_version,omitempty"`
	TlsMinVersion     string   `json:"tls_min_version,omitempty"`
	TlsServerName     string   `json:"tls_server_name,omitempty"`
	TlsSkipVerify     bool     `json:"tls_skip_verify,omitempty"`
}

DsLokiConfig is generated from the Flashduty OpenAPI schema.

type DsMySqlConfig

type DsMySqlConfig struct {
	// Maximum idle connections.
	IdleConns int64 `json:"idle_conns,omitempty"`
	// Connection maximum lifetime in seconds.
	LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"`
	// Maximum open connections.
	OpenConns int64  `json:"open_conns,omitempty"`
	Password  string `json:"password,omitempty"`
	// Query timeout in milliseconds.
	TimeoutMills  int64  `json:"timeout_mills,omitempty"`
	TlsCa         string `json:"tls_ca,omitempty"`
	TlsCert       string `json:"tls_cert,omitempty"`
	TlsKey        string `json:"tls_key,omitempty"`
	TlsKeyPwd     string `json:"tls_key_pwd,omitempty"`
	TlsMaxVersion string `json:"tls_max_version,omitempty"`
	TlsMinVersion string `json:"tls_min_version,omitempty"`
	TlsServerName string `json:"tls_server_name,omitempty"`
	TlsSkipVerify bool   `json:"tls_skip_verify,omitempty"`
	Username      string `json:"username,omitempty"`
}

DsMySqlConfig is generated from the Flashduty OpenAPI schema.

type DsOracleConfig

type DsOracleConfig struct {
	IdleConns       int64 `json:"idle_conns,omitempty"`
	LifetimeSeconds int64 `json:"lifetime_seconds,omitempty"`
	OpenConns       int64 `json:"open_conns,omitempty"`
	// Extra connection options as key-value pairs.
	Options      map[string]string `json:"options,omitempty"`
	Password     string            `json:"password,omitempty"`
	TimeoutMills int64             `json:"timeout_mills,omitempty"`
	Username     string            `json:"username,omitempty"`
}

DsOracleConfig is generated from the Flashduty OpenAPI schema.

type DsPayload

type DsPayload struct {
	Clickhouse    DsClickHouseConfig    `json:"clickhouse,omitempty"`
	Elasticsearch DsElasticSearchConfig `json:"elasticsearch,omitempty"`
	Loki          DsLokiConfig          `json:"loki,omitempty"`
	Mysql         DsMySqlConfig         `json:"mysql,omitempty"`
	Oracle        DsOracleConfig        `json:"oracle,omitempty"`
	Postgres      DsPostgresConfig      `json:"postgres,omitempty"`
	Prometheus    DsPrometheusConfig    `json:"prometheus,omitempty"`
	SLS           DsslsConfig           `json:"sls,omitempty"`
	Victorialogs  DsVictoriaLogsConfig  `json:"victorialogs,omitempty"`
}

DsPayload is generated from the Flashduty OpenAPI schema.

type DsPostgresConfig

type DsPostgresConfig struct {
	IdleConns       int64  `json:"idle_conns,omitempty"`
	LifetimeSeconds int64  `json:"lifetime_seconds,omitempty"`
	OpenConns       int64  `json:"open_conns,omitempty"`
	Password        string `json:"password,omitempty"`
	TimeoutMills    int64  `json:"timeout_mills,omitempty"`
	TlsCa           string `json:"tls_ca,omitempty"`
	TlsCert         string `json:"tls_cert,omitempty"`
	TlsKey          string `json:"tls_key,omitempty"`
	Username        string `json:"username,omitempty"`
}

DsPostgresConfig is generated from the Flashduty OpenAPI schema.

type DsPrometheusConfig

type DsPrometheusConfig struct {
	// Enable HTTP Basic Auth.
	BasicAuthEnabled bool `json:"basic_auth_enabled,omitempty"`
	// Basic auth password.
	BasicAuthPassword string `json:"basic_auth_password,omitempty"`
	// Basic auth username.
	BasicAuthUsername string `json:"basic_auth_username,omitempty"`
	// Custom HTTP headers in `Key: Value` format.
	Headers []string `json:"headers,omitempty"`
	// Custom query parameters in `key=value` format.
	Params        []string `json:"params,omitempty"`
	TlsCa         string   `json:"tls_ca,omitempty"`
	TlsCert       string   `json:"tls_cert,omitempty"`
	TlsKey        string   `json:"tls_key,omitempty"`
	TlsKeyPwd     string   `json:"tls_key_pwd,omitempty"`
	TlsMaxVersion string   `json:"tls_max_version,omitempty"`
	TlsMinVersion string   `json:"tls_min_version,omitempty"`
	TlsServerName string   `json:"tls_server_name,omitempty"`
	TlsSkipVerify bool     `json:"tls_skip_verify,omitempty"`
}

DsPrometheusConfig is generated from the Flashduty OpenAPI schema.

type DsType

type DsType struct {
	// Owning account ID. `0` for global types.
	AccountID uint64 `json:"account_id,omitempty"`
	ID        uint64 `json:"id,omitempty"`
	// Identifier used as the `ds_type` of rules, e.g. `prometheus`.
	Ident string `json:"ident,omitempty"`
	// Display name, e.g. `Prometheus`.
	Name string `json:"name,omitempty"`
	// Display order weight; higher appears first.
	Weight int64 `json:"weight,omitempty"`
}

DsType is generated from the Flashduty OpenAPI schema.

type DsVictoriaLogsConfig

type DsVictoriaLogsConfig struct {
	BasicAuthEnabled  bool     `json:"basic_auth_enabled,omitempty"`
	BasicAuthPassword string   `json:"basic_auth_password,omitempty"`
	BasicAuthUsername string   `json:"basic_auth_username,omitempty"`
	Headers           []string `json:"headers,omitempty"`
	Params            []string `json:"params,omitempty"`
	TlsCa             string   `json:"tls_ca,omitempty"`
	TlsCert           string   `json:"tls_cert,omitempty"`
	TlsKey            string   `json:"tls_key,omitempty"`
	TlsKeyPwd         string   `json:"tls_key_pwd,omitempty"`
	TlsMaxVersion     string   `json:"tls_max_version,omitempty"`
	TlsMinVersion     string   `json:"tls_min_version,omitempty"`
	TlsServerName     string   `json:"tls_server_name,omitempty"`
	TlsSkipVerify     bool     `json:"tls_skip_verify,omitempty"`
}

DsVictoriaLogsConfig is generated from the Flashduty OpenAPI schema.

type DsslsConfig

type DsslsConfig struct {
	// Alibaba Cloud Access Key ID.
	AccessKeyID string `json:"access_key_id,omitempty"`
	// Alibaba Cloud Access Key Secret.
	AccessKeySecret string `json:"access_key_secret,omitempty"`
	// Custom HTTP headers.
	Headers []string `json:"headers,omitempty"`
}

DsslsConfig is generated from the Flashduty OpenAPI schema.

type DutyError

type DutyError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

DutyError is the Flashduty API error object carried inside the response envelope's "error" field.

func (*DutyError) Error

func (e *DutyError) Error() string

type EmptyObject

type EmptyObject struct{}

EmptyObject is generated from the Flashduty OpenAPI schema.

type EmptyRequest

type EmptyRequest struct{}

EmptyRequest is generated from the Flashduty OpenAPI schema.

type EmptyResponse

type EmptyResponse struct{}

EmptyResponse is generated from the Flashduty OpenAPI schema.

type EnabledTime

type EnabledTime struct {
	// Days of week, 0 = Sunday.
	Days []int64 `json:"days,omitempty"`
	// End time, e.g. `18:00`.
	Etime string `json:"etime,omitempty"`
	// Start time, e.g. `09:00`.
	Stime string `json:"stime,omitempty"`
}

EnabledTime is generated from the Flashduty OpenAPI schema.

type EnrichFilter

type EnrichFilter struct {
	// Alert label key.
	Key string `json:"key,omitempty"`
	// Match operator. `IN` matches when any value matches; `NOTIN` matches when none of the values match.
	Oper string `json:"oper,omitempty"`
	// Values to match against.
	Vals []string `json:"vals,omitempty"`
}

EnrichFilter is generated from the Flashduty OpenAPI schema.

type EnrichRule

type EnrichRule struct {
	// Optional AND-filter list. The rule is skipped if the condition does not match.
	If []EnrichFilter `json:"if,omitempty"`
	// Rule type. `extraction` extracts a label via regex or GJson. `composition` builds a label from a template. `mapping` looks up values from a schema or API. `drop` removes labels.
	Kind string `json:"kind,omitempty"`
	// Rule-kind–specific settings. The shape depends on `kind`.
	Settings any `json:"settings,omitempty"`
}

EnrichRule is generated from the Flashduty OpenAPI schema.

type EnrichmentInfoRequest

type EnrichmentInfoRequest struct {
	// Integration ID to query enrichment rules for. Must be greater than 0.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

EnrichmentInfoRequest is generated from the Flashduty OpenAPI schema.

type EnrichmentItem

type EnrichmentItem struct {
	// Creation timestamp, Unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member ID.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Ordered enrichment rules.
	Rules []EnrichRule `json:"rules,omitempty"`
	// Rule set status.
	Status string `json:"status,omitempty"`
	// Last update timestamp, Unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater member ID.
	UpdatedBy int64 `json:"updated_by,omitempty"`
}

EnrichmentItem is generated from the Flashduty OpenAPI schema.

type EnrichmentListRequest

type EnrichmentListRequest struct {
	// List of integration IDs to query.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
}

EnrichmentListRequest is generated from the Flashduty OpenAPI schema.

type EnrichmentListResponse

type EnrichmentListResponse struct {
	// Enrichment rule sets.
	Items []EnrichmentItem `json:"items,omitempty"`
}

EnrichmentListResponse is generated from the Flashduty OpenAPI schema.

type EnrichmentUpsertRequest

type EnrichmentUpsertRequest struct {
	// Integration ID to configure enrichment rules for.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Ordered list of enrichment rules. Replaces all existing rules.
	Rules []EnrichRule `json:"rules,omitempty"`
}

EnrichmentUpsertRequest is generated from the Flashduty OpenAPI schema.

type ErrorCode

type ErrorCode string

ErrorCode Flashduty error code enum. Every failed API response sets `error.code` to one of these stable wire strings. HTTP status is informational — the authoritative signal is the enum value.

const (
	ErrorCodeOK                    ErrorCode = "OK"
	ErrorCodeInvalidParameter      ErrorCode = "InvalidParameter"
	ErrorCodeBadRequest            ErrorCode = "BadRequest"
	ErrorCodeInvalidContentType    ErrorCode = "InvalidContentType"
	ErrorCodeResourceNotFound      ErrorCode = "ResourceNotFound"
	ErrorCodeNoLicense             ErrorCode = "NoLicense"
	ErrorCodeReferenceExist        ErrorCode = "ReferenceExist"
	ErrorCodeUnauthorized          ErrorCode = "Unauthorized"
	ErrorCodeBalanceNotEnough      ErrorCode = "BalanceNotEnough"
	ErrorCodeAccessDenied          ErrorCode = "AccessDenied"
	ErrorCodeRouteNotFound         ErrorCode = "RouteNotFound"
	ErrorCodeMethodNotAllowed      ErrorCode = "MethodNotAllowed"
	ErrorCodeUndonedOrderExist     ErrorCode = "UndonedOrderExist"
	ErrorCodeRequestLocked         ErrorCode = "RequestLocked"
	ErrorCodeEntityTooLarge        ErrorCode = "EntityTooLarge"
	ErrorCodeRequestTooFrequently  ErrorCode = "RequestTooFrequently"
	ErrorCodeRequestVerifyRequired ErrorCode = "RequestVerifyRequired"
	ErrorCodeDangerousOperation    ErrorCode = "DangerousOperation"
	ErrorCodeInternalError         ErrorCode = "InternalError"
	ErrorCodeServiceUnavailable    ErrorCode = "ServiceUnavailable"
)

func ErrorCodeOf

func ErrorCodeOf(err error) ErrorCode

ErrorCodeOf extracts the API ErrorCode carried by err, if any.

It searches the error chain with errors.As for an *ErrorResponse and returns ErrorCode(apiErr.Code). Because *RateLimitError unwraps to *ErrorResponse, this also resolves the code for rate-limit errors. If no *ErrorResponse is present in the chain, it returns the empty ErrorCode ("").

type ErrorResponse

type ErrorResponse struct {
	Response  *http.Response `json:"-"`
	Code      string         `json:"code"`
	Message   string         `json:"message"`
	RequestID string         `json:"request_id"`
}

ErrorResponse is returned by any Flashduty API call that does not succeed — either the envelope carried an error or the HTTP status was non-2xx. Recover it with errors.As to inspect Code (see the generated ErrorCode constants) and RequestID.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ErsComposition

type ErsComposition struct {
	// When `true`, overwrite the label if it already exists. Defaults to `false`.
	Override bool `json:"override,omitempty"`
	// Destination label key to write the composed value into. Must match `^[a-z][a-z0-9_]{0,62}$`.
	ResultLabel string `json:"result_label,omitempty"`
	// Go `text/template` string. Alert fields are available as `{{.title}}`, `{{.description}}`, and `{{.labels.key}}`. Example: `{{.labels.region}}-{{.labels.env}}`.
	Template string `json:"template,omitempty"`
}

ErsComposition is generated from the Flashduty OpenAPI schema.

type ErsDrop

type ErsDrop struct {
	// List of label keys to remove from the alert.
	DropLabels []string `json:"drop_labels,omitempty"`
}

ErsDrop is generated from the Flashduty OpenAPI schema.

type ErsExtraction

type ErsExtraction struct {
	// GJson path expression used to extract a value from a JSON-encoded field. Mutually exclusive with `pattern`.
	GJSON string `json:"g_json,omitempty"`
	// When `true`, overwrite the label if it already exists. Defaults to `false`.
	Override bool `json:"override,omitempty"`
	// RE2 regular expression. Use a named capture group `(?P<result>...)` to extract a sub-match; without a named group the full match is used. Mutually exclusive with `g_json`.
	Pattern string `json:"pattern,omitempty"`
	// Destination label key to write the extracted value into. Must match `^[a-z][a-z0-9_]{0,62}$`.
	ResultLabel string `json:"result_label,omitempty"`
	// Source field to extract from. Must be `title`, `description`, or a label key prefixed with `labels.` (e.g. `labels.env`).
	SourceField string `json:"source_field,omitempty"`
}

ErsExtraction is generated from the Flashduty OpenAPI schema.

type ErsMapping

type ErsMapping struct {
	// Mapping API ID (MongoDB ObjectID hex). Required when `mapping_type` is `api`.
	APIID string `json:"api_id,omitempty"`
	// Mapping source type. `schema` uses a mapping schema table; `api` calls an external HTTP API.
	MappingType string `json:"mapping_type,omitempty"`
	// When `true`, overwrite labels that already exist. Defaults to `false`.
	Override bool `json:"override,omitempty"`
	// Label keys to populate from the mapping lookup result.
	ResultLabels []string `json:"result_labels,omitempty"`
	// Mapping schema ID (MongoDB ObjectID hex). Required when `mapping_type` is `schema`.
	SchemaID string `json:"schema_id,omitempty"`
}

ErsMapping is generated from the Flashduty OpenAPI schema.

type EscalateLayer

type EscalateLayer struct {
	// Wait before moving to the next level, in minutes.
	EscalateWindow int64 `json:"escalate_window,omitempty"`
	// When true, always escalate regardless of acknowledgement.
	ForceEscalate bool `json:"force_escalate,omitempty"`
	// Max repeat notifications within the level.
	MaxTimes int64 `json:"max_times,omitempty"`
	// Repeat interval in minutes.
	NotifyStep float64        `json:"notify_step,omitempty"`
	Target     EscalateTarget `json:"target,omitempty"`
}

EscalateLayer is generated from the Flashduty OpenAPI schema.

type EscalateRuleItem

type EscalateRuleItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Aggregation window in seconds.
	AggrWindow int64 `json:"aggr_window,omitempty"`
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel name, populated for cross-channel listing responses.
	ChannelName string `json:"channel_name,omitempty"`
	// Creation timestamp (unix seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Deletion timestamp (unix seconds). Emitted only for soft-deleted rules.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Rule description.
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	// Escalation levels in order.
	Layers []EscalateLayer `json:"layers,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Escalation rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name.
	RuleName string `json:"rule_name,omitempty"`
	// Rule status.
	Status string `json:"status,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
	// Recurring time windows during which the rule applies.
	TimeFilters []TimeFilter `json:"time_filters,omitempty"`
	// Last update timestamp (unix seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Member ID that last updated the rule.
	UpdatedBy int64 `json:"updated_by,omitempty"`
}

EscalateRuleItem is generated from the Flashduty OpenAPI schema.

type EscalateTarget

type EscalateTarget struct {
	// Per-severity personal notification channels. Required unless `webhooks` is provided.
	By EscalateTargetBy `json:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Map of schedule ID to the role IDs on that schedule to notify.
	ScheduleToRoleIDs map[string][]int64 `json:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []EscalateTargetWebhooksItem `json:"webhooks,omitempty"`
}

EscalateTarget is generated from the Flashduty OpenAPI schema.

type EscalateTargetBy

type EscalateTargetBy struct {
	// Channels for Critical events (e.g. `voice`, `sms`, `email`, `feishu`).
	Critical []string `json:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty"`
}

EscalateTargetBy is generated from the Flashduty OpenAPI schema.

type EscalateTargetWebhooksItem

type EscalateTargetWebhooksItem struct {
	// Type-specific settings (chat IDs, URLs, etc.).
	Settings map[string]any `json:"settings,omitempty"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type,omitempty"`
}

EscalateTargetWebhooksItem is generated from the Flashduty OpenAPI schema.

type ExportStatusPageSubscribersRequest

type ExportStatusPageSubscribersRequest struct {
	// Optional component IDs to filter subscribers by.
	ComponentIDs []string `json:"component_ids,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
}

ExportStatusPageSubscribersRequest is generated from the Flashduty OpenAPI schema.

type ExportedStatusPageSubscriberItem

type ExportedStatusPageSubscriberItem struct {
	// Whether the subscriber is subscribed to all components.
	All bool `json:"all,omitempty"`
	// Components this subscriber has subscribed to.
	Components []StatusPageComponentItem `json:"components,omitempty"`
	// Preferred locale for notifications.
	Locale string `json:"locale,omitempty"`
	// Subscription delivery method.
	Method string `json:"method,omitempty"`
	// Subscriber recipient: email address for public pages, user ID for internal pages.
	Recipient string `json:"recipient,omitempty"`
}

ExportedStatusPageSubscriberItem is generated from the Flashduty OpenAPI schema.

type FeedDetailAlertClose

type FeedDetailAlertClose struct{}

FeedDetailAlertClose is generated from the Flashduty OpenAPI schema.

type FeedDetailAlertComment

type FeedDetailAlertComment struct {
	// Comment body.
	Comment string `json:"comment,omitempty"`
}

FeedDetailAlertComment is generated from the Flashduty OpenAPI schema.

type FeedDetailAlertTrigger

type FeedDetailAlertTrigger struct {
	Severity FeedSeverity `json:"severity,omitempty"`
	Status   FeedSeverity `json:"status,omitempty"`
}

FeedDetailAlertTrigger is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAck

type FeedDetailIncidentAck struct {
	// Progress note entered at acknowledgement.
	Progress string `json:"progress,omitempty"`
}

FeedDetailIncidentAck is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAddRspd

type FeedDetailIncidentAddRspd struct {
	// Member IDs added as responders.
	To []int64 `json:"to,omitempty"`
}

FeedDetailIncidentAddRspd is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAssign

type FeedDetailIncidentAssign struct {
	// Unix timestamp (seconds) when the assignment was made.
	AssignedAt int64 `json:"assigned_at,omitempty"`
	// Email recipients, used by integrations such as ServiceNow.
	Emails []string `json:"emails,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) to drive assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty"`
	// Escalation rule display name, filled by the server.
	EscalateRuleName string `json:"escalate_rule_name,omitempty"`
	// Opaque assignment ID generated by the server.
	ID string `json:"id,omitempty"`
	// Current level index within the escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty"`
	// Member IDs to assign directly.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Member IDs that received the assignment.
	To []int64 `json:"to,omitempty"`
	// Assignment type: `assign` direct assignment, `reassign` reassignment, `escalate` escalation-rule driven, `reopen` automatic reassignment on reopen.
	Type string `json:"type,omitempty"`
}

FeedDetailIncidentAssign is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAutoRefreshCard

type FeedDetailIncidentAutoRefreshCard struct{}

FeedDetailIncidentAutoRefreshCard is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentComment

type FeedDetailIncidentComment struct {
	// Comment body.
	Comment string `json:"comment,omitempty"`
	// Whether replies to this comment are muted.
	MuteReply bool `json:"mute_reply,omitempty"`
}

FeedDetailIncidentComment is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentCustomAction

type FeedDetailIncidentCustomAction struct {
	// Integration ID that executed the action.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Integration display name.
	IntegrationName string `json:"integration_name,omitempty"`
}

FeedDetailIncidentCustomAction is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentMerge

type FeedDetailIncidentMerge struct {
	// Merge comment.
	Comment string `json:"comment,omitempty"`
	// Member ID that performed the merge.
	OwnerID int64 `json:"owner_id,omitempty"`
	// True if the source incidents were removed after merging.
	RemoveSourceIncidents bool `json:"remove_source_incidents,omitempty"`
	// Source incidents that were merged.
	SourceIncidents []IncidentShort `json:"source_incidents,omitempty"`
	// Responder member IDs carried over from the source incidents.
	SourceResponders []int64       `json:"source_responders,omitempty"`
	TargetIncident   IncidentShort `json:"target_incident,omitempty"`
	// Resulting incident title.
	Title string `json:"title,omitempty"`
}

FeedDetailIncidentMerge is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentMuteByFlapping

type FeedDetailIncidentMuteByFlapping struct {
	// Window length in minutes.
	InMins int64 `json:"in_mins,omitempty"`
	// Maximum state changes allowed within the window.
	MaxChanges int64 `json:"max_changes,omitempty"`
	// Mute duration in minutes once flapping is detected.
	MuteMins int64 `json:"mute_mins,omitempty"`
}

FeedDetailIncidentMuteByFlapping is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentMuteReply

type FeedDetailIncidentMuteReply struct{}

FeedDetailIncidentMuteReply is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentNew

type FeedDetailIncidentNew struct {
	// Email of the reporter when the incident was created externally.
	ReporterEmail string       `json:"reporter_email,omitempty"`
	Severity      FeedSeverity `json:"severity,omitempty"`
	// Initial incident title.
	Title string `json:"title,omitempty"`
}

FeedDetailIncidentNew is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentNotify

type FeedDetailIncidentNotify struct {
	// Delivery channel or method label.
	By string `json:"by,omitempty"`
	// Per-chat delivery records.
	Chats []NotifyChat `json:"chats,omitempty"`
	// Escalation rule ID (MongoDB ObjectID).
	EscalateRuleID string `json:"escalate_rule_id,omitempty"`
	// Escalation rule display name.
	EscalateRuleName string `json:"escalate_rule_name,omitempty"`
	// Whether this is the first fire or a refire.
	FireType string `json:"fire_type,omitempty"`
	// Escalation level index used for this notification.
	LayerIdx int64 `json:"layer_idx,omitempty"`
	// Upstream message ID returned by the delivery channel.
	MsgID string `json:"msg_id,omitempty"`
	// Per-person delivery records.
	Persons []NotifyPerson `json:"persons,omitempty"`
	// Notification record ID.
	Rid string `json:"rid,omitempty"`
	// Per-robot delivery records.
	Robots []NotifyRobot `json:"robots,omitempty"`
}

FeedDetailIncidentNotify is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentReopen

type FeedDetailIncidentReopen struct {
	// Reason why the incident was reopened.
	Reason string `json:"reason,omitempty"`
}

FeedDetailIncidentReopen is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetDescription

type FeedDetailIncidentResetDescription struct{}

FeedDetailIncidentResetDescription is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetField

type FeedDetailIncidentResetField struct {
	// Name of the custom field that was updated.
	FieldName string `json:"field_name,omitempty"`
	// New value of the custom field. Type depends on the field definition.
	To map[string]any `json:"to,omitempty"`
}

FeedDetailIncidentResetField is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetImpact

type FeedDetailIncidentResetImpact struct{}

FeedDetailIncidentResetImpact is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetResolution

type FeedDetailIncidentResetResolution struct{}

FeedDetailIncidentResetResolution is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetRootCause

type FeedDetailIncidentResetRootCause struct{}

FeedDetailIncidentResetRootCause is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetSeverity

type FeedDetailIncidentResetSeverity struct {
	From FeedSeverity `json:"from,omitempty"`
	To   FeedSeverity `json:"to,omitempty"`
}

FeedDetailIncidentResetSeverity is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetTitle

type FeedDetailIncidentResetTitle struct {
	// Previous title.
	From string `json:"from,omitempty"`
	// New title.
	To string `json:"to,omitempty"`
}

FeedDetailIncidentResetTitle is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResolve

type FeedDetailIncidentResolve struct {
	// Source that triggered the resolve action.
	From string `json:"from,omitempty"`
}

FeedDetailIncidentResolve is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentSnooze

type FeedDetailIncidentSnooze struct {
	// Snooze duration in minutes.
	Minutes int64 `json:"minutes,omitempty"`
}

FeedDetailIncidentSnooze is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentStorm

type FeedDetailIncidentStorm struct {
	// Storm threshold that was reached.
	Threshold int64 `json:"threshold,omitempty"`
}

FeedDetailIncidentStorm is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentUnack

type FeedDetailIncidentUnack struct {
	// Progress note entered when acknowledgement was removed.
	Progress string `json:"progress,omitempty"`
}

FeedDetailIncidentUnack is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentWake

type FeedDetailIncidentWake struct {
	// Unix timestamp at which the prior snooze was scheduled to end.
	SnoozedBefore int64 `json:"snoozedBefore,omitempty"`
}

FeedDetailIncidentWake is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentWarRoomCreate

type FeedDetailIncidentWarRoomCreate struct {
	// Chat group identifier.
	ChatID string `json:"chat_id,omitempty"`
	// Chat group display name.
	ChatName string `json:"chat_name,omitempty"`
	// Integration ID that hosts the war room chat group.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Integration display name.
	IntegrationName string `json:"integration_name,omitempty"`
	// Chat integration plugin type.
	PluginType string `json:"plugin_type,omitempty"`
	// Shareable join link for the war room.
	ShareLink string `json:"share_link,omitempty"`
}

FeedDetailIncidentWarRoomCreate is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentWarRoomDelete

type FeedDetailIncidentWarRoomDelete struct {
	// Chat group identifier.
	ChatID string `json:"chat_id,omitempty"`
	// Chat group display name.
	ChatName string `json:"chat_name,omitempty"`
	// Integration ID that hosted the war room chat group.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Integration display name.
	IntegrationName string `json:"integration_name,omitempty"`
	// Chat integration plugin type.
	PluginType string `json:"plugin_type,omitempty"`
}

FeedDetailIncidentWarRoomDelete is generated from the Flashduty OpenAPI schema.

type FeedItem

type FeedItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Creation timestamp in Unix epoch milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID of the creator. 0 for system-generated entries.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Type-specific payload. The concrete shape is determined by `type`.
	Detail any `json:"detail,omitempty"`
	// ObjectID of the alert this entry references.
	RefID string        `json:"ref_id,omitempty"`
	Type  AlertFeedType `json:"type,omitempty"`
	// Last update timestamp in Unix epoch milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

FeedItem is generated from the Flashduty OpenAPI schema.

type FeedSeverity

type FeedSeverity string

FeedSeverity Severity level.

const (
	FeedSeverityOK       FeedSeverity = "Ok"
	FeedSeverityCritical FeedSeverity = "Critical"
	FeedSeverityWarning  FeedSeverity = "Warning"
	FeedSeverityInfo     FeedSeverity = "Info"
)

type FieldInfoRequest

type FieldInfoRequest struct {
	// Field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id,omitempty"`
}

FieldInfoRequest is generated from the Flashduty OpenAPI schema.

type FieldItem

type FieldItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Creation timestamp, Unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member ID.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Default value. Type depends on `field_type`: `bool` for checkbox; `string` for single_select/text; `string[]` for multi_select; may be `null` if no default.
	DefaultValue any `json:"default_value,omitempty"`
	// Deletion timestamp, Unix seconds. Only present for soft-deleted fields.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Optional free-text description.
	Description string `json:"description,omitempty"`
	// Human-readable name shown in the UI.
	DisplayName string `json:"display_name,omitempty"`
	// Field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id,omitempty"`
	// Machine name used in incident payloads under `fields.<field_name>`. Immutable.
	FieldName string `json:"field_name,omitempty"`
	// Field input type.
	FieldType string `json:"field_type,omitempty"`
	// Allowed choices for `single_select`/`multi_select` (non-empty unique string array). `null` or empty for `checkbox`/`text`.
	Options []string `json:"options,omitempty"`
	// Field status (e.g. `enabled`, `deleted`).
	Status string `json:"status,omitempty"`
	// Last update timestamp, Unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater member ID.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// Stored value type. `checkbox` is always `bool`; `single_select`/`multi_select`/`text` are always `string`.
	ValueType string `json:"value_type,omitempty"`
}

FieldItem is generated from the Flashduty OpenAPI schema.

type FieldListRequest

type FieldListRequest struct {
	// Sort ascending when `true`; descending otherwise.
	Asc bool `json:"asc,omitempty"`
	// Filter by creator member ID. Omit or send `null` to skip.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Sort key. Defaults to backend ordering when omitted.
	Orderby string `json:"orderby,omitempty"`
	// Regex filter against `field_name` and `display_name`. Invalid regex is auto-escaped to literal substring match.
	Query string `json:"query,omitempty"`
}

FieldListRequest is generated from the Flashduty OpenAPI schema.

type FieldListResponse

type FieldListResponse struct {
	// All non-deleted custom fields for the account. No pagination.
	Items []FieldItem `json:"items,omitempty"`
}

FieldListResponse is generated from the Flashduty OpenAPI schema.

type FilterCondition

type FilterCondition struct {
	// Field name to filter on. Use plain names for built-in alert fields (e.g. `alert_severity`, `alert_key`, `check`, `resource`, `service`, `cluster`) or the `labels.<name>` prefix for custom alert labels (e.g. `labels.env`, `labels.region`).
	Key string `json:"key,omitempty"`
	// Filter operator. `IN` — value must match one of `vals`; `NOTIN` — value must not match any of `vals`. Supports regex patterns wrapped in `/pattern/`.
	Oper string `json:"oper,omitempty"`
	// List of values to match against. Each entry is a plain string or a `/regex/` pattern.
	Vals []string `json:"vals,omitempty"`
}

FilterCondition is generated from the Flashduty OpenAPI schema.

type FilterGroup

type FilterGroup = OrFilterGroup

FilterGroup is an alias for OrFilterGroup.

type Flapping

type Flapping struct {
	// Observation window in minutes.
	InMins int64 `json:"in_mins,omitempty"`
	// Disable flapping detection.
	IsDisabled bool `json:"is_disabled,omitempty"`
	// Max state changes allowed within `in_mins`.
	MaxChanges int64 `json:"max_changes,omitempty"`
	// Mute duration in minutes after flapping is detected.
	MuteMins int64 `json:"mute_mins,omitempty"`
}

Flapping is generated from the Flashduty OpenAPI schema.

type GetWarRoomDetailRequest

type GetWarRoomDetailRequest struct {
	// Chat/group ID on the IM side.
	ChatID string `json:"chat_id,omitempty"`
	// IM integration ID that hosts the war room.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

GetWarRoomDetailRequest is generated from the Flashduty OpenAPI schema.

type GetWebhookHistoryDetailRequest

type GetWebhookHistoryDetailRequest struct {
	// Event ID returned by `ListWebhookHistory`.
	EventID string `json:"event_id,omitempty"`
	// Integration ID the event belongs to.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

GetWebhookHistoryDetailRequest is generated from the Flashduty OpenAPI schema.

type Group

type Group struct {
	// When true, all listed keys must be present for grouping.
	AllEqualsRequired bool `json:"all_equals_required,omitempty"`
	// Per-filter grouping overrides.
	Cases []map[string]any `json:"cases,omitempty"`
	// Groups of label keys whose equality defines a bucket.
	Equals [][]string `json:"equals,omitempty"`
	// Label keys used for intelligent grouping embeddings.
	IKeys []string `json:"i_keys,omitempty"`
	// Intelligent grouping similarity threshold.
	IScoreThreshold float64 `json:"i_score_threshold,omitempty"`
	// Grouping method: `i` intelligent, `p` pattern, `n` none.
	Method string `json:"method,omitempty"`
	// Alert storm threshold.
	StormThreshold int64 `json:"storm_threshold,omitempty"`
	// Multi-level storm thresholds.
	StormThresholds []int64 `json:"storm_thresholds,omitempty"`
	// Grouping time window in minutes. Default max is 1440 minutes (24 h); extended accounts may allow up to 43200 minutes (30 days).
	TimeWindow int64 `json:"time_window,omitempty"`
	// Window type. Defaults to `tumbling`.
	WindowType string `json:"window_type,omitempty"`
}

Group is generated from the Flashduty OpenAPI schema.

type IDRequest

type IDRequest struct {
	// Resource ID.
	ID uint64 `json:"id,omitempty"`
}

IDRequest is generated from the Flashduty OpenAPI schema.

type Image

type Image struct {
	// Alt text.
	Alt string `json:"alt,omitempty"`
	// Optional link the image points to.
	Href string `json:"href,omitempty"`
	// Image source. Either an `img_` upload token or an `http(s)` URL.
	Src string `json:"src,omitempty"`
}

Image is generated from the Flashduty OpenAPI schema.

type ImportStatusPageSubscriberItem

type ImportStatusPageSubscriberItem struct {
	// When true, the subscriber receives notifications for all components. Must be true when `component_ids` and `change_ids` are both empty.
	All bool `json:"all,omitempty"`
	// Specific event IDs the subscriber should receive notifications for.
	ChangeIDs []int64 `json:"change_ids,omitempty"`
	// Component IDs the subscriber should receive notifications for.
	ComponentIDs []string `json:"component_ids,omitempty"`
	// Preferred locale for notifications. Defaults to the request locale when omitted.
	Locale string `json:"locale,omitempty"`
	// Email address (for public pages) or user ID (for internal pages).
	Recipient string `json:"recipient,omitempty"`
}

ImportStatusPageSubscriberItem is generated from the Flashduty OpenAPI schema.

type ImportStatusPageSubscribersRequest

type ImportStatusPageSubscribersRequest struct {
	// Subscription method. `email` is only valid for public pages; `im` is only valid for internal pages.
	Method string `json:"method,omitempty"`
	// Target status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Subscribers to import.
	Subscribers []ImportStatusPageSubscriberItem `json:"subscribers,omitempty"`
}

ImportStatusPageSubscribersRequest is generated from the Flashduty OpenAPI schema.

type IncProgressCnts

type IncProgressCnts struct {
	// Count of processing incidents in the last 30 days.
	Processing int64 `json:"Processing,omitempty"`
	// Count of triggered incidents in the last 30 days.
	Triggered int64 `json:"Triggered,omitempty"`
}

IncProgressCnts is generated from the Flashduty OpenAPI schema.

type IncidentFeedItem

type IncidentFeedItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Creation timestamp in milliseconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// User ID of the actor. `0` means system-generated.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Soft-delete timestamp (ms). Zero if not deleted.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Type-specific payload. The concrete shape is determined by `type`.
	Detail any `json:"detail,omitempty"`
	// ObjectID of the source alert or incident this entry references.
	RefID string           `json:"ref_id,omitempty"`
	Type  IncidentFeedType `json:"type,omitempty"`
	// Last update timestamp in milliseconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

IncidentFeedItem is generated from the Flashduty OpenAPI schema.

type IncidentFeedType

type IncidentFeedType string

IncidentFeedType Incident timeline entry type. Each value identifies one lifecycle event; the matching `detail` payload shape is determined by this field. Incident types are prefixed with `i_`.

const (
	IncidentFeedTypeINew         IncidentFeedType = "i_new"
	IncidentFeedTypeIAssign      IncidentFeedType = "i_assign"
	IncidentFeedTypeIARspd       IncidentFeedType = "i_a_rspd"
	IncidentFeedTypeINotify      IncidentFeedType = "i_notify"
	IncidentFeedTypeIStorm       IncidentFeedType = "i_storm"
	IncidentFeedTypeISnooze      IncidentFeedType = "i_snooze"
	IncidentFeedTypeIWake        IncidentFeedType = "i_wake"
	IncidentFeedTypeIAck         IncidentFeedType = "i_ack"
	IncidentFeedTypeIUnack       IncidentFeedType = "i_unack"
	IncidentFeedTypeIComm        IncidentFeedType = "i_comm"
	IncidentFeedTypeIRslv        IncidentFeedType = "i_rslv"
	IncidentFeedTypeIReopen      IncidentFeedType = "i_reopen"
	IncidentFeedTypeIMerge       IncidentFeedType = "i_merge"
	IncidentFeedTypeIRTitle      IncidentFeedType = "i_r_title"
	IncidentFeedTypeIRDesc       IncidentFeedType = "i_r_desc"
	IncidentFeedTypeIRImpact     IncidentFeedType = "i_r_impact"
	IncidentFeedTypeIRRc         IncidentFeedType = "i_r_rc"
	IncidentFeedTypeIRRsltn      IncidentFeedType = "i_r_rsltn"
	IncidentFeedTypeIRSeverity   IncidentFeedType = "i_r_severity"
	IncidentFeedTypeIRField      IncidentFeedType = "i_r_field"
	IncidentFeedTypeIMFlapping   IncidentFeedType = "i_m_flapping"
	IncidentFeedTypeIMReply      IncidentFeedType = "i_m_reply"
	IncidentFeedTypeICustom      IncidentFeedType = "i_custom"
	IncidentFeedTypeIWrCreate    IncidentFeedType = "i_wr_create"
	IncidentFeedTypeIWrDelete    IncidentFeedType = "i_wr_delete"
	IncidentFeedTypeIAutoRefresh IncidentFeedType = "i_auto_refresh"
	IncidentFeedTypeAMerge       IncidentFeedType = "a_merge"
)

type IncidentInfo

type IncidentInfo struct {
	// Account ID that owns the incident.
	AccountID int64 `json:"account_id,omitempty"`
	// Account locale.
	AccountLocale string `json:"account_locale,omitempty"`
	// Account name.
	AccountName string `json:"account_name,omitempty"`
	// Account time zone.
	AccountTimeZone string `json:"account_time_zone,omitempty"`
	// Unix timestamp (seconds) when the incident was first acknowledged. 0 if unacknowledged.
	AckTime int64 `json:"ack_time,omitempty"`
	// Count of alerts currently in Critical/Warning/Info state.
	ActiveAlertCnt int64 `json:"active_alert_cnt,omitempty"`
	// AI-generated summary of the incident.
	AISummary string `json:"ai_summary,omitempty"`
	// Total count of alerts merged into this incident.
	AlertCnt int64 `json:"alert_cnt,omitempty"`
	// Total raw alert event count across all merged alerts.
	AlertEventCnt int64 `json:"alert_event_cnt,omitempty"`
	// Embedded alerts, only populated for notification templates and custom actions.
	Alerts []AlertInfo `json:"alerts,omitempty"`
	// Current assignment target for the incident.
	AssignedTo AssignedTo `json:"assigned_to,omitempty"`
	// Channel ID. 0 for standalone incidents.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel display name.
	ChannelName string `json:"channel_name,omitempty"`
	// Channel status.
	ChannelStatus string `json:"channel_status,omitempty"`
	// Unix timestamp (seconds) when the incident was closed. 0 if still open.
	CloseTime int64 `json:"close_time,omitempty"`
	// Closer member info.
	Closer PersonShort `json:"closer,omitempty"`
	// Member ID that closed the incident. 0 if auto-closed.
	CloserID int64 `json:"closer_id,omitempty"`
	// Creation timestamp (seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member info.
	Creator PersonShort `json:"creator,omitempty"`
	// Member ID that created the incident. 0 if auto-created by the system.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Deprecated. Use `integration_id` instead.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Deprecated. Use `integration_ids` instead.
	DataSourceIDs []int64 `json:"data_source_ids,omitempty"`
	// Deprecated. Use `integration_type` instead.
	DataSourceType string `json:"data_source_type,omitempty"`
	// Deprecated. Use `integration_types` instead.
	DataSourceTypes []string `json:"data_source_types,omitempty"`
	// Deduplication key used to coalesce alerts.
	DedupKey string `json:"dedup_key,omitempty"`
	// Soft-delete timestamp (seconds). Zero if not deleted.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Incident description.
	Description string `json:"description,omitempty"`
	// Web console URL for the incident.
	DetailURL string `json:"detail_url,omitempty"`
	// Unix timestamp (seconds) when the incident ended. 0 if still active.
	EndTime int64 `json:"end_time,omitempty"`
	// MD5 hash used for content-equality checks.
	EqualsMD5 string `json:"equals_md5,omitempty"`
	// Whether the incident has ever been silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Custom field values keyed by field name.
	Fields map[string]any `json:"fields,omitempty"`
	// Frequency bucket for recurrence analysis: `frequent` or `rare`.
	Frequency string `json:"frequency,omitempty"`
	// Alert grouping method: `i` intelligent, `p` pattern, `n` none.
	GroupMethod string `json:"group_method,omitempty"`
	// Attached images.
	Images []Image `json:"images,omitempty"`
	// Impact description.
	Impact string `json:"impact,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Configured incident severity.
	IncidentSeverity string `json:"incident_severity,omitempty"`
	// Current incident status, derived from alert statuses.
	IncidentStatus string `json:"incident_status,omitempty"`
	// First integration associated with the incident.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// All integration IDs contributing alerts to this incident.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
	// First alert's integration type string, used by the detail page for label mappings.
	IntegrationType string `json:"integration_type,omitempty"`
	// Integration type strings for all contributing integrations.
	IntegrationTypes []string `json:"integration_types,omitempty"`
	// Labels propagated from alerts.
	Labels map[string]string `json:"labels,omitempty"`
	// Unix timestamp (seconds) of the most recent update.
	LastTime int64 `json:"last_time,omitempty"`
	// Channel-level link integrations rendered for this incident.
	Links []LinkItem `json:"links,omitempty"`
	// Fields that were manually overridden after auto-population.
	ManualOverrides []string `json:"manual_overrides,omitempty"`
	// Short display identifier; not guaranteed unique.
	Num string `json:"num,omitempty"`
	// Owner member info. May be deprecated.
	Owner PersonShort `json:"owner,omitempty"`
	// Primary owner member ID. 0 if none.
	OwnerID int64 `json:"owner_id,omitempty"`
	// Associated post-mortem ID, if any. One incident can only link to a single post-mortem.
	PostMortemID string `json:"post_mortem_id,omitempty"`
	// Incident progress state.
	Progress string `json:"progress,omitempty"`
	// Reporter email for manually created incidents.
	ReporterEmail string `json:"reporter_email,omitempty"`
	// Resolution notes.
	Resolution string `json:"resolution,omitempty"`
	// Current responders with assignment/acknowledgement state.
	Responders []Responder `json:"responders,omitempty"`
	// Root cause analysis.
	RootCause string `json:"root_cause,omitempty"`
	// Quick-silence URL for this incident.
	SilenceURL string `json:"silence_url,omitempty"`
	// Unix timestamp (seconds) until which notifications are snoozed. 0 if not snoozed.
	SnoozedBefore int64 `json:"snoozed_before,omitempty"`
	// Unix timestamp (seconds) when the incident started.
	StartTime int64 `json:"start_time,omitempty"`
	// Incident title.
	Title string `json:"title,omitempty"`
	// Last update timestamp (seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

IncidentInfo is generated from the Flashduty OpenAPI schema.

type IncidentInfoRequest

type IncidentInfoRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
}

IncidentInfoRequest is generated from the Flashduty OpenAPI schema.

type IncidentListResponse

type IncidentListResponse struct {
	// True when more results are available beyond this page.
	HasNextPage bool `json:"has_next_page,omitempty"`
	// Incident list for the current page.
	Items []IncidentInfo `json:"items,omitempty"`
	// Opaque cursor to pass as `search_after_ctx` on the next request.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total number of matching incidents.
	Total int64 `json:"total,omitempty"`
}

IncidentListResponse is generated from the Flashduty OpenAPI schema.

type IncidentRawItem

type IncidentRawItem struct {
	Acknowledgements int64 `json:"acknowledgements,omitempty"`
	// Current assignment target for the incident.
	AssignedTo        IncidentRawItemAssignedTo `json:"assigned_to,omitempty"`
	Assignments       int64                     `json:"assignments,omitempty"`
	ChannelID         int64                     `json:"channel_id,omitempty"`
	ChannelName       string                    `json:"channel_name,omitempty"`
	ClosedBy          string                    `json:"closed_by,omitempty"`
	CreatedAt         int64                     `json:"created_at,omitempty"`
	CreatorID         int64                     `json:"creator_id,omitempty"`
	CreatorName       string                    `json:"creator_name,omitempty"`
	Description       string                    `json:"description,omitempty"`
	EngagedSeconds    int64                     `json:"engaged_seconds,omitempty"`
	Escalations       int64                     `json:"escalations,omitempty"`
	Fields            map[string]any            `json:"fields,omitempty"`
	Hours             string                    `json:"hours,omitempty"`
	IncidentID        string                    `json:"incident_id,omitempty"`
	Interruptions     int64                     `json:"interruptions,omitempty"`
	Labels            map[string]string         `json:"labels,omitempty"`
	ManualEscalations int64                     `json:"manual_escalations,omitempty"`
	Notifications     int64                     `json:"notifications,omitempty"`
	// Incident progress state (e.g. `Triggered`, `Acknowledged`, `Closed`).
	Progress           string           `json:"progress,omitempty"`
	Reassignments      int64            `json:"reassignments,omitempty"`
	Responders         []map[string]any `json:"responders,omitempty"`
	SecondsToAck       int64            `json:"seconds_to_ack,omitempty"`
	SecondsToClose     int64            `json:"seconds_to_close,omitempty"`
	Severity           string           `json:"severity,omitempty"`
	TeamID             int64            `json:"team_id,omitempty"`
	TeamName           string           `json:"team_name,omitempty"`
	TimeoutEscalations int64            `json:"timeout_escalations,omitempty"`
	Title              string           `json:"title,omitempty"`
}

IncidentRawItem is generated from the Flashduty OpenAPI schema.

type IncidentRawItemAssignedTo

type IncidentRawItemAssignedTo struct {
	// Unix timestamp (seconds) when this assignment was made.
	AssignedAt int64 `json:"assigned_at,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) driving the assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty"`
	// Display name of the escalation rule.
	EscalateRuleName string `json:"escalate_rule_name,omitempty"`
	// Internal assignment record ID.
	ID string `json:"id,omitempty"`
	// Current level index within the escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty"`
	// Member IDs assigned directly to this incident.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Assignment type.
	Type string `json:"type,omitempty"`
}

IncidentRawItemAssignedTo is generated from the Flashduty OpenAPI schema.

type IncidentShort

type IncidentShort struct {
	// Incident ID (ObjectID hex string).
	IncidentID string `json:"incident_id,omitempty"`
	// Incident progress (e.g. `Processing`, `Resolved`).
	Progress string `json:"progress,omitempty"`
	// Incident title.
	Title string `json:"title,omitempty"`
}

IncidentShort is generated from the Flashduty OpenAPI schema.

type IncidentsPostMortemInfoRequest

type IncidentsPostMortemInfoRequest struct {
	// Post-mortem ID. Deterministic hash derived from account ID and the set of linked incident IDs.
	PostMortemID string `url:"post_mortem_id"`
}

IncidentsPostMortemInfoRequest holds the query parameters for Get post-mortem.

type IncidentsService

type IncidentsService service

IncidentsService handles the "On-call/Incidents" API resource.

func (*IncidentsService) Ack

Acknowledge incident.

Acknowledge an incident to indicate you are actively working on it.

API: POST /incident/ack (incidentAck).

func (*IncidentsService) AlertList

List alerts of incident.

List all alerts merged into a specific incident.

API: POST /incident/alert/list (incidentAlertList).

func (*IncidentsService) Assign

Assign incident.

Dispatch an incident to a specific escalation level or responder.

API: POST /incident/assign (incidentAssign).

func (*IncidentsService) Comment

Add comment to incident.

Add a text comment to the incident timeline.

API: POST /incident/comment (incidentComment).

func (*IncidentsService) Create

Create incident.

Manually create a new incident and assign responders.

API: POST /incident/create (incidentCreate).

func (*IncidentsService) CustomActionDo

Execute custom action.

Execute a custom action configured for an incident.

API: POST /incident/custom-action/do (incidentCustomActionDo).

func (*IncidentsService) DisableMerge

Disable incident merge.

Disable automatic merging for a specific incident.

API: POST /incident/disable-merge (incidentDisableMerge).

func (*IncidentsService) Feed

Get incident timeline.

Retrieve the timeline feed for a specific incident, including state changes, comments and system events.

API: POST /incident/feed (incidentFeed).

func (*IncidentsService) FieldReset

Update incident custom field.

Update a custom field value on an incident.

API: POST /incident/field/reset (incidentFieldReset).

func (*IncidentsService) Info

Get incident detail.

Retrieve detailed information for a single incident including timeline, alerts, responders and custom fields.

API: POST /incident/info (incidentInfo).

func (*IncidentsService) List

List incidents.

Query a paginated list of incidents with filters by channel, severity, status, responder, and time range.

API: POST /incident/list (incidentList).

func (*IncidentsService) ListByIDs

List incidents by IDs.

Retrieve multiple incidents by their IDs in a single request.

API: POST /incident/list-by-ids (incidentListByIds).

func (*IncidentsService) Merge

Merge incidents.

Merge one or more incidents into a target incident.

API: POST /incident/merge (incidentMerge).

func (*IncidentsService) PastList

List past incidents.

List historical incidents related to the current incident for reference during triage.

API: POST /incident/past/list (incidentPastList).

func (*IncidentsService) PostMortemDelete

func (s *IncidentsService) PostMortemDelete(ctx context.Context, req *DeletePostMortemRequest) (*Response, error)

Delete post-mortem.

Delete a post-mortem report.

API: POST /incident/post-mortem/delete (incidentPostMortemDelete).

func (*IncidentsService) PostMortemInfo

Get post-mortem.

Retrieve the post-mortem report for a specific incident.

API: GET /incident/post-mortem/info (incidentPostMortemInfo).

func (*IncidentsService) PostMortemList

List post-mortems.

List post-mortem reports with optional filters.

API: POST /incident/post-mortem/list (incidentPostMortemList).

func (*IncidentsService) Remove

Delete an incident.

Permanently delete an incident and all associated data.

API: POST /incident/remove (incidentRemove).

func (*IncidentsService) Reopen

Reopen incident.

Reopen a previously resolved incident.

API: POST /incident/reopen (incidentReopen).

func (*IncidentsService) Reset

Update incident fields.

Update one or more editable fields of an incident in a single call, including title, description, impact, root cause, resolution, and severity. At least one field must be provided.

API: POST /incident/reset (incidentReset).

func (*IncidentsService) Resolve

Resolve incident.

Mark an incident as resolved.

API: POST /incident/resolve (incidentResolve).

func (*IncidentsService) ResponderAdd

Add incident responder.

Add a responder to an existing incident.

API: POST /incident/responder/add (incidentResponderAdd).

func (*IncidentsService) Snooze

Snooze incident.

Temporarily snooze notifications for an incident until a specified time.

API: POST /incident/snooze (incidentSnooze).

func (*IncidentsService) Unack

Unacknowledge incident.

Remove the acknowledge status from an incident.

API: POST /incident/unack (incidentUnack).

func (*IncidentsService) Wake

Wake incident.

Cancel the snooze on an incident and resume notifications.

API: POST /incident/wake (incidentWake).

func (*IncidentsService) WarRoomCreate

func (s *IncidentsService) WarRoomCreate(ctx context.Context, req *CreateWarRoomRequest) (*WarRoom, *Response, error)

Create war room.

Create a war room channel for collaborative incident response.

API: POST /incident/war-room/create (incidentWarRoomCreate).

func (*IncidentsService) WarRoomDelete

func (s *IncidentsService) WarRoomDelete(ctx context.Context, req *DeleteWarRoomRequest) (*Response, error)

Delete war room.

Delete an incident war room.

API: POST /incident/war-room/delete (incidentWarRoomDelete).

func (*IncidentsService) WarRoomDetail

func (s *IncidentsService) WarRoomDetail(ctx context.Context, req *GetWarRoomDetailRequest) (*WarRoom, *Response, error)

Get war room detail.

Retrieve the war room configuration and members for an incident.

API: POST /incident/war-room/detail (incidentWarRoomDetail).

func (*IncidentsService) WarRoomList

List war rooms.

List all war rooms associated with an incident.

API: POST /incident/war-room/list (incidentWarRoomList).

type InhibitRuleItem

type InhibitRuleItem struct {
	AccountID   int64  `json:"account_id,omitempty"`
	ChannelID   int64  `json:"channel_id,omitempty"`
	CreatedAt   int64  `json:"created_at,omitempty"`
	DeletedAt   int64  `json:"deleted_at,omitempty"`
	Description string `json:"description,omitempty"`
	// Label keys used to pair source and target alerts.
	Equals            []string    `json:"equals,omitempty"`
	IsDirectlyDiscard bool        `json:"is_directly_discard,omitempty"`
	Priority          int64       `json:"priority,omitempty"`
	RuleID            string      `json:"rule_id,omitempty"`
	RuleName          string      `json:"rule_name,omitempty"`
	SourceFilters     FilterGroup `json:"source_filters,omitempty"`
	Status            string      `json:"status,omitempty"`
	TargetFilters     FilterGroup `json:"target_filters,omitempty"`
	UpdatedAt         int64       `json:"updated_at,omitempty"`
	UpdatedBy         int64       `json:"updated_by,omitempty"`
}

InhibitRuleItem is generated from the Flashduty OpenAPI schema.

type InsightAlertByLabelItem

type InsightAlertByLabelItem struct {
	// Hour bucket when `split_hours` is enabled.
	Hours string `json:"hours,omitempty"`
	// Aggregation key value (check name or resource identifier).
	Label              string `json:"label,omitempty"`
	TotalAlertCnt      int64  `json:"total_alert_cnt,omitempty"`
	TotalAlertEventCnt int64  `json:"total_alert_event_cnt,omitempty"`
}

InsightAlertByLabelItem is generated from the Flashduty OpenAPI schema.

type InsightAlertByLabelResponse

type InsightAlertByLabelResponse struct {
	Items []InsightAlertByLabelItem `json:"items,omitempty"`
}

InsightAlertByLabelResponse is generated from the Flashduty OpenAPI schema.

type InsightFilter

type InsightFilter struct {
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time,omitempty"`
	// Subset of CSV column keys to include in the export. At most 50 entries. Only used by the export endpoints.
	ExportFields []string `json:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Restrict results to teams the caller belongs to. When true and the caller has no teams, the result set is empty.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty"`
	// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set.
	SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty"`
	// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set.
	SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// IANA time zone name used to interpret the time range (e.g. `Asia/Shanghai`). Defaults to the account time zone.
	TimeZone string `json:"time_zone,omitempty"`
}

InsightFilter is generated from the Flashduty OpenAPI schema.

type InsightIncidentExportRequest

type InsightIncidentExportRequest = InsightFilter

InsightIncidentExportRequest is an alias for InsightFilter.

type InsightIncidentListRequest

type InsightIncidentListRequest struct {
	ListOptions
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time,omitempty"`
	// Subset of CSV column keys to include in the export. At most 50 entries. Only used by the export endpoints.
	ExportFields []string `json:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Restrict results to teams the caller belongs to. When true and the caller has no teams, the result set is empty.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty"`
	// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set.
	SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty"`
	// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set.
	SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// IANA time zone name used to interpret the time range (e.g. `Asia/Shanghai`). Defaults to the account time zone.
	TimeZone string `json:"time_zone,omitempty"`
}

InsightIncidentListRequest is generated from the Flashduty OpenAPI schema.

type InsightIncidentListResponse

type InsightIncidentListResponse struct {
	HasNextPage bool              `json:"has_next_page,omitempty"`
	Items       []IncidentRawItem `json:"items,omitempty"`
	// Cursor token to fetch the next page. Pass it back in the next request's `search_after_ctx`.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total matching incidents.
	Total int64 `json:"total,omitempty"`
}

InsightIncidentListResponse is generated from the Flashduty OpenAPI schema.

type InsightQueryRequest

type InsightQueryRequest struct {
	// Aggregate metrics into time buckets. When set, the time range must cover at least 24 hours; `day` additionally caps the range at 31 days.
	AggregateUnit string `json:"aggregate_unit,omitempty"`
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time,omitempty"`
	// Subset of CSV column keys to include in the export. At most 50 entries. Only used by the export endpoints.
	ExportFields []string `json:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Restrict results to teams the caller belongs to. When true and the caller has no teams, the result set is empty.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty"`
	// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set.
	SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty"`
	// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set.
	SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty"`
	// When true, metrics are split into `work`/`sleep`/`off` hour buckets.
	SplitHours bool `json:"split_hours,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// IANA time zone name used to interpret the time range (e.g. `Asia/Shanghai`). Defaults to the account time zone.
	TimeZone string `json:"time_zone,omitempty"`
}

InsightQueryRequest is generated from the Flashduty OpenAPI schema.

type InsightTopkAlertByLabelRequest

type InsightTopkAlertByLabelRequest struct {
	// Aggregate metrics into time buckets. When set, the time range must cover at least 24 hours; `day` additionally caps the range at 31 days.
	AggregateUnit string `json:"aggregate_unit,omitempty"`
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time,omitempty"`
	// Subset of CSV column keys to include in the export. At most 50 entries. Only used by the export endpoints.
	ExportFields []string `json:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Restrict results to teams the caller belongs to. When true and the caller has no teams, the result set is empty.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Number of top entries to return, between 1 and 100.
	K int64 `json:"k,omitempty"`
	// Dimension to aggregate by.
	Label string `json:"label,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty"`
	// Field to sort results by.
	Orderby string `json:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty"`
	// Upper bound (exclusive) on time-to-acknowledge, in seconds. Must be greater than `seconds_to_ack_from` when both are set.
	SecondsToAckTo int64 `json:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty"`
	// Upper bound (exclusive) on time-to-close, in seconds. Must be greater than `seconds_to_close_from` when both are set.
	SecondsToCloseTo int64 `json:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty"`
	// When true, metrics are split into `work`/`sleep`/`off` hour buckets.
	SplitHours bool `json:"split_hours,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty"`
	// IANA time zone name used to interpret the time range (e.g. `Asia/Shanghai`). Defaults to the account time zone.
	TimeZone string `json:"time_zone,omitempty"`
}

InsightTopkAlertByLabelRequest is generated from the Flashduty OpenAPI schema.

type IntegrationsService

type IntegrationsService service

IntegrationsService handles the "On-call/Integrations" API resource.

func (*IntegrationsService) Detail

Get webhook delivery detail.

Retrieve the detailed payload and response for a specific webhook delivery attempt.

API: POST /webhook/history/detail (webhookHistoryDetail).

func (*IntegrationsService) List

List webhook delivery history.

List the delivery history for outbound webhook notifications.

API: POST /webhook/history/list (webhookHistoryList).

type InviteMemberItem

type InviteMemberItem struct {
	// Country code
	CountryCode string `json:"country_code,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Locale
	Locale string `json:"locale,omitempty"`
	// Display name
	MemberName string `json:"member_name,omitempty"`
	// Phone number
	Phone string `json:"phone,omitempty"`
	// External reference ID
	RefID string `json:"ref_id,omitempty"`
	// Role IDs to assign
	RoleIDs []int64 `json:"role_ids,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty"`
}

InviteMemberItem is generated from the Flashduty OpenAPI schema.

type IssuesService

type IssuesService service

IssuesService handles the "RUM/Issues" API resource.

func (*IssuesService) ReadInfo

Get issue detail.

Retrieve full details of a single issue by `issue_id`.

API: POST /rum/issue/info (rum-issue-read-info).

func (*IssuesService) ReadList

List issues.

Return a paginated list of RUM error tracking issues matching the given filters.

API: POST /rum/issue/list (rum-issue-read-list).

func (*IssuesService) WriteUpdate

func (s *IssuesService) WriteUpdate(ctx context.Context, req *RUMIssueUpdateRequest) (*Response, error)

Update issue.

Update the status or suspected cause of an issue.

API: POST /rum/issue/update (rum-issue-write-update).

type LinkItem

type LinkItem struct {
	// Rendered URL for the link.
	Endpoint string `json:"endpoint,omitempty"`
	// Display name of the link.
	Name string `json:"name,omitempty"`
	// How the link should be opened.
	OpenType string `json:"open_type,omitempty"`
}

LinkItem is generated from the Flashduty OpenAPI schema.

type ListChannelsRequest

type ListChannelsRequest struct {
	ListOptions
	// When true, sort ascending.
	Asc bool `json:"asc,omitempty"`
	// Filter by explicit channel IDs.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Exact-match filter on channel name. Takes priority over `query` for name filtering.
	ChannelName string `json:"channel_name,omitempty"`
	// When true, return only brief fields (`channel_id`, `channel_name`, `description`, `status`).
	IsBrief bool `json:"is_brief,omitempty"`
	// When true, return only channels the caller manages.
	IsMyManaged bool `json:"is_my_managed,omitempty"`
	// When true, return only channels the caller has starred. Mutually exclusive with `is_my_team`.
	IsMyStarred bool `json:"is_my_starred,omitempty"`
	// When true, return channels owned by the caller's teams. Mutually exclusive with `is_my_starred`.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Field used to order results.
	Orderby string `json:"orderby,omitempty"`
	// Free-text query against channel name/description.
	Query string `json:"query,omitempty"`
	// Filter by team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

ListChannelsRequest is generated from the Flashduty OpenAPI schema.

type ListChannelsResponse

type ListChannelsResponse struct {
	// Whether more pages are available.
	HasNextPage bool          `json:"has_next_page,omitempty"`
	Items       []ChannelItem `json:"items,omitempty"`
	// Total matching channels.
	Total int64 `json:"total,omitempty"`
}

ListChannelsResponse is generated from the Flashduty OpenAPI schema.

type ListDropRulesResponse

type ListDropRulesResponse struct {
	Items []UnsubscribeRuleItem `json:"items,omitempty"`
}

ListDropRulesResponse is generated from the Flashduty OpenAPI schema.

type ListEscalationRulesResponse

type ListEscalationRulesResponse struct {
	Items []EscalateRuleItem `json:"items,omitempty"`
}

ListEscalationRulesResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentAlertsRequest

type ListIncidentAlertsRequest struct {
	ListOptions
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// When true, include raw alert events in each alert item.
	IncludeEvents bool `json:"include_events,omitempty"`
	// When true return only active alerts (Critical/Warning/Info); when false return only recovered alerts (Ok). Omit to include all.
	IsActive bool `json:"is_active,omitempty"`
}

ListIncidentAlertsRequest is generated from the Flashduty OpenAPI schema.

type ListIncidentAlertsResponse

type ListIncidentAlertsResponse struct {
	// Alert list.
	Items []AlertInfo `json:"items,omitempty"`
	// Total matching alerts.
	Total int64 `json:"total,omitempty"`
}

ListIncidentAlertsResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentFeedRequest

type ListIncidentFeedRequest struct {
	ListOptions
	// Ascending chronological order when true.
	Asc bool `json:"asc,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Optional filter restricting the returned entries to specific types.
	Types []IncidentFeedType `json:"types,omitempty"`
}

ListIncidentFeedRequest is generated from the Flashduty OpenAPI schema.

type ListIncidentFeedResponse

type ListIncidentFeedResponse struct {
	// True when more entries are available.
	HasNextPage bool `json:"has_next_page,omitempty"`
	// Timeline entries for the current page.
	Items []IncidentFeedItem `json:"items,omitempty"`
}

ListIncidentFeedResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentsByIDsRequest

type ListIncidentsByIDsRequest struct {
	// Incident IDs to fetch.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

ListIncidentsByIDsRequest is generated from the Flashduty OpenAPI schema.

type ListIncidentsRequest

type ListIncidentsRequest struct {
	ListOptions
	// Acknowledger member IDs.
	AckerIDs []int64 `json:"acker_ids,omitempty"`
	// Ascending order when true.
	Asc bool `json:"asc,omitempty"`
	// Channel IDs to filter by. Use 0 for standalone (global) incidents.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Closer member IDs. Use 0 for automatically closed incidents.
	CloserIDs []int64 `json:"closer_ids,omitempty"`
	// Creator member IDs. Use 0 for automatically created incidents.
	CreatorIDs []int64 `json:"creator_ids,omitempty"`
	// Window end, Unix seconds. Must be greater than `start_time` and within 31 days.
	EndTime int64 `json:"end_time,omitempty"`
	// When true, include only incidents that were ever silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Restrict to the given incident IDs.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Comma-separated list of severities (`Critical,Warning,Info`).
	IncidentSeverity string `json:"incident_severity,omitempty"`
	// When true, restrict to incidents in channels the user personally owns.
	IsMyChannel bool `json:"is_my_channel,omitempty"`
	// When true, restrict to incidents in channels owned by the user's teams.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// When true, include only outlier (rare) incidents.
	IsRare bool `json:"is_rare,omitempty"`
	// When true, include only snoozed incidents.
	IsSnoozed bool `json:"is_snoozed,omitempty"`
	// Restrict to the given short display identifiers.
	Nums []string `json:"nums,omitempty"`
	// Comma-separated list of progress states to match (e.g. `Triggered,Processing`).
	Progress string `json:"progress,omitempty"`
	// Full-text search query.
	Query string `json:"query,omitempty"`
	// Responder member IDs.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Window start, Unix seconds.
	StartTime int64 `json:"start_time,omitempty"`
	// Team IDs; resolved to channels via channel ownership.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

ListIncidentsRequest is generated from the Flashduty OpenAPI schema.

type ListInhibitRulesResponse

type ListInhibitRulesResponse struct {
	Items []InhibitRuleItem `json:"items,omitempty"`
}

ListInhibitRulesResponse is generated from the Flashduty OpenAPI schema.

type ListOptions

type ListOptions struct {
	// Page is the 1-based page number (wire field "p").
	Page int `json:"p,omitempty"`
	// Limit caps the number of items returned per page.
	Limit int `json:"limit,omitempty"`
	// SearchAfterCtx is the opaque cursor echoed by the previous page for deep
	// pagination; pass it back to fetch the next page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
}

ListOptions holds the pagination inputs shared by every list endpoint. Embed it in a service's request struct; zero values are omitted so they never override the server's defaults (the backend uses p=1, limit=20).

type ListPastIncidentsRequest

type ListPastIncidentsRequest struct {
	// Reference incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Maximum number of similar incidents to return.
	Limit int64 `json:"limit,omitempty"`
}

ListPastIncidentsRequest is generated from the Flashduty OpenAPI schema.

type ListPastIncidentsResponse

type ListPastIncidentsResponse struct {
	// Similar past incidents with similarity scores.
	Items []PastIncidentItem `json:"items,omitempty"`
}

ListPastIncidentsResponse is generated from the Flashduty OpenAPI schema.

type ListPostMortemsRequest

type ListPostMortemsRequest struct {
	ListOptions
	// Ascending order when true.
	Asc bool `json:"asc,omitempty"`
	// Channel IDs to restrict the query to.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Filter by creation time: upper bound in seconds.
	CreatedAtEndSeconds int64 `json:"created_at_end_seconds,omitempty"`
	// Filter by creation time: lower bound in seconds.
	CreatedAtStartSeconds int64 `json:"created_at_start_seconds,omitempty"`
	// Field used to order results.
	OrderBy string `json:"order_by,omitempty"`
	// Report status. Defaults to `published` on the server when omitted.
	Status string `json:"status,omitempty"`
	// Team IDs to restrict the query to.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

ListPostMortemsRequest is generated from the Flashduty OpenAPI schema.

type ListPostMortemsResponse

type ListPostMortemsResponse struct {
	// True when more results are available beyond this page.
	HasNextPage bool `json:"has_next_page,omitempty"`
	// Post-mortem metadata for the current page.
	Items []PostMortemMeta `json:"items,omitempty"`
	// Cursor for forward pagination.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total matching reports.
	Total int64 `json:"total,omitempty"`
}

ListPostMortemsResponse is generated from the Flashduty OpenAPI schema.

type ListRoutesRequest

type ListRoutesRequest struct {
	// Integration IDs to fetch routing rules for.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
}

ListRoutesRequest is generated from the Flashduty OpenAPI schema.

type ListRoutesResponse

type ListRoutesResponse struct {
	// Routing rules of the requested integrations. Integrations without a configured rule are omitted.
	Items []RouteItem `json:"items,omitempty"`
}

ListRoutesResponse is generated from the Flashduty OpenAPI schema.

type ListSilenceRulesResponse

type ListSilenceRulesResponse struct {
	Items []SilenceRuleItem `json:"items,omitempty"`
}

ListSilenceRulesResponse is generated from the Flashduty OpenAPI schema.

type ListWarRoomsRequest

type ListWarRoomsRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Optional filter: only return war rooms for this IM integration.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

ListWarRoomsRequest is generated from the Flashduty OpenAPI schema.

type ListWarRoomsResponse

type ListWarRoomsResponse struct {
	// War room records.
	Items []WarRoomItem `json:"items,omitempty"`
}

ListWarRoomsResponse is generated from the Flashduty OpenAPI schema.

type ListWebhookHistoryRequest

type ListWebhookHistoryRequest struct {
	// Ascending order by `event_time` when true; otherwise descending.
	Asc bool `json:"asc,omitempty"`
	// Window end time in Unix milliseconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time,omitempty"`
	// Filter by event type values.
	EventTypes []string `json:"event_types,omitempty"`
	// Filter by integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Page size.
	Limit int64 `json:"limit,omitempty"`
	// Sort field. Currently only `event_time` is supported.
	Orderby string `json:"orderby,omitempty"`
	// Reference ID filter (incident or alert ID).
	RefID string `json:"ref_id,omitempty"`
	// Opaque cursor returned by a previous call for fetching the next page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Window start time in Unix milliseconds.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by delivery status.
	Status string `json:"status,omitempty"`
}

ListWebhookHistoryRequest is generated from the Flashduty OpenAPI schema.

type ListWebhookHistoryResponse

type ListWebhookHistoryResponse struct {
	Items []WebhookHistoryItem `json:"items,omitempty"`
	// Cursor to pass as `search_after_ctx` to fetch the next page. Empty when no further pages are available.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total number of matching records.
	Total int64 `json:"total,omitempty"`
}

ListWebhookHistoryResponse is generated from the Flashduty OpenAPI schema.

type Logger

type Logger interface {
	Debug(msg string, keysAndValues ...any)
	Info(msg string, keysAndValues ...any)
	Warn(msg string, keysAndValues ...any)
	Error(msg string, keysAndValues ...any)
}

Logger defines the logging interface for the SDK. Consumers can implement this to integrate with any logging backend.

The keysAndValues parameter uses alternating key-value pairs (slog-style):

logger.Info("request complete", "status", 200, "duration_ms", 42)

To adapt logrus, implement a thin wrapper that converts keysAndValues to logrus.Fields:

type logrusAdapter struct{ *logrus.Logger }
func (a *logrusAdapter) Info(msg string, kv ...any)  { a.WithFields(kvToFields(kv)).Info(msg) }
func (a *logrusAdapter) Warn(msg string, kv ...any)  { a.WithFields(kvToFields(kv)).Warn(msg) }
func (a *logrusAdapter) Error(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Error(msg) }
func (a *logrusAdapter) Debug(msg string, kv ...any) { a.WithFields(kvToFields(kv)).Debug(msg) }
func kvToFields(kv []any) logrus.Fields {
    fields := make(logrus.Fields, len(kv)/2)
    for i := 0; i+1 < len(kv); i += 2 {
        if key, ok := kv[i].(string); ok {
            fields[key] = kv[i+1]
        }
    }
    return fields
}

type MappingAPICreateRequest

type MappingAPICreateRequest struct {
	// Unique API name (max 199 chars).
	APIName string `json:"api_name,omitempty"`
	// Optional description.
	Description string `json:"description,omitempty"`
	// Custom HTTP request headers.
	Headers map[string]string `json:"headers,omitempty"`
	// Skip TLS certificate verification. Default `false`.
	InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
	// Number of retries on failure (0–1). Default 0.
	RetryCount int64 `json:"retry_count,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// Request timeout in seconds (1–3). Default 2.
	Timeout int64 `json:"timeout,omitempty"`
	// HTTP/HTTPS endpoint URL (max 500 chars).
	URL string `json:"url,omitempty"`
}

MappingAPICreateRequest is generated from the Flashduty OpenAPI schema.

type MappingAPICreateResponse

type MappingAPICreateResponse struct {
	// Created API ID (MongoDB ObjectID hex).
	APIID string `json:"api_id,omitempty"`
	// API name.
	APIName string `json:"api_name,omitempty"`
}

MappingAPICreateResponse is generated from the Flashduty OpenAPI schema.

type MappingAPIItem

type MappingAPIItem struct {
	// API ID (MongoDB ObjectID hex).
	APIID string `json:"api_id,omitempty"`
	// API name.
	APIName string `json:"api_name,omitempty"`
	// Creation timestamp, Unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member ID.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Description.
	Description string `json:"description,omitempty"`
	// Custom request headers.
	Headers map[string]string `json:"headers,omitempty"`
	// Whether TLS verification is skipped.
	InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
	// Retry count.
	RetryCount int64 `json:"retry_count,omitempty"`
	// API status.
	Status string `json:"status,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// Request timeout in seconds.
	Timeout int64 `json:"timeout,omitempty"`
	// Last update timestamp, Unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater member ID.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// Endpoint URL.
	URL string `json:"url,omitempty"`
}

MappingAPIItem is generated from the Flashduty OpenAPI schema.

type MappingAPIListResponse

type MappingAPIListResponse struct {
	// Mapping APIs.
	Items []MappingAPIItem `json:"items,omitempty"`
	// Total API count.
	Total int64 `json:"total,omitempty"`
}

MappingAPIListResponse is generated from the Flashduty OpenAPI schema.

type MappingAPIUpdateRequest

type MappingAPIUpdateRequest struct {
	// Mapping API ID (MongoDB ObjectID hex).
	APIID string `json:"api_id,omitempty"`
	// New API name (max 199 chars).
	APIName string `json:"api_name,omitempty"`
	// New description.
	Description string `json:"description,omitempty"`
	// New headers map (replaces existing).
	Headers map[string]string `json:"headers,omitempty"`
	// New TLS skip-verify setting.
	InsecureSkipVerify bool `json:"insecure_skip_verify,omitempty"`
	// New retry count.
	RetryCount int64 `json:"retry_count,omitempty"`
	// New owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// New timeout in seconds.
	Timeout int64 `json:"timeout,omitempty"`
	// New endpoint URL (max 500 chars).
	URL string `json:"url,omitempty"`
}

MappingAPIUpdateRequest is generated from the Flashduty OpenAPI schema.

type MappingApiidRequest

type MappingApiidRequest struct {
	// Mapping API ID (MongoDB ObjectID hex).
	APIID string `json:"api_id,omitempty"`
}

MappingApiidRequest is generated from the Flashduty OpenAPI schema.

type MappingDataDeleteRequest

type MappingDataDeleteRequest struct {
	// Keys of rows to delete.
	Keys []string `json:"keys,omitempty"`
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
}

MappingDataDeleteRequest is generated from the Flashduty OpenAPI schema.

type MappingDataItem

type MappingDataItem struct {
	// Creation timestamp, Unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// All label key-value pairs for this row.
	Fields map[string]string `json:"fields,omitempty"`
	// Composite key derived from source label values.
	Key string `json:"key,omitempty"`
	// Last update timestamp, Unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

MappingDataItem is generated from the Flashduty OpenAPI schema.

type MappingDataListRequest

type MappingDataListRequest struct {
	ListOptions
	// Sort ascending when `true`.
	Asc bool `json:"asc,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Exact-match filter on source label values. All source labels must be provided if any are specified.
	Query map[string]string `json:"query,omitempty"`
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
}

MappingDataListRequest is generated from the Flashduty OpenAPI schema.

type MappingDataListResponse

type MappingDataListResponse struct {
	// Whether more pages exist.
	HasNextPage bool `json:"has_next_page,omitempty"`
	// Data rows.
	Items []MappingDataItem `json:"items,omitempty"`
	// Cursor token for the next page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty"`
	// Total matching rows.
	Total int64 `json:"total,omitempty"`
}

MappingDataListResponse is generated from the Flashduty OpenAPI schema.

type MappingDataUploadRequest

type MappingDataUploadRequest struct {
	// CSV file to upload.
	File string `json:"file,omitempty"`
	// Mapping schema ID (query parameter).
	SchemaID string `json:"schema_id,omitempty"`
}

MappingDataUploadRequest is generated from the Flashduty OpenAPI schema.

type MappingDataUpsertRequest

type MappingDataUpsertRequest struct {
	// Rows to insert or update. Each row must include all source and result labels.
	Docs []map[string]string `json:"docs,omitempty"`
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
}

MappingDataUpsertRequest is generated from the Flashduty OpenAPI schema.

type MappingDataUpsertResponse

type MappingDataUpsertResponse struct {
	// Composite keys of upserted rows.
	Keys []string `json:"keys,omitempty"`
}

MappingDataUpsertResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaCreateRequest

type MappingSchemaCreateRequest struct {
	// Optional description (max 500 chars).
	Description string `json:"description,omitempty"`
	// Output label names (1–10). Must not overlap with `source_labels`.
	ResultLabels []string `json:"result_labels,omitempty"`
	// Unique schema name (max 39 chars).
	SchemaName string `json:"schema_name,omitempty"`
	// Lookup key label names (1–3). Must not overlap with `result_labels`.
	SourceLabels []string `json:"source_labels,omitempty"`
	// Owning team ID. `0` means no team.
	TeamID int64 `json:"team_id,omitempty"`
}

MappingSchemaCreateRequest is generated from the Flashduty OpenAPI schema.

type MappingSchemaCreateResponse

type MappingSchemaCreateResponse struct {
	// Created schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
	// Schema name.
	SchemaName string `json:"schema_name,omitempty"`
}

MappingSchemaCreateResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaIDRequest

type MappingSchemaIDRequest struct {
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
}

MappingSchemaIDRequest is generated from the Flashduty OpenAPI schema.

type MappingSchemaItem

type MappingSchemaItem struct {
	// Creation timestamp, Unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member ID.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Schema description.
	Description string `json:"description,omitempty"`
	// Output label names.
	ResultLabels []string `json:"result_labels,omitempty"`
	// Schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
	// Schema name.
	SchemaName string `json:"schema_name,omitempty"`
	// Lookup key label names.
	SourceLabels []string `json:"source_labels,omitempty"`
	// Schema status.
	Status string `json:"status,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
	// Last update timestamp, Unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater member ID.
	UpdatedBy int64 `json:"updated_by,omitempty"`
}

MappingSchemaItem is generated from the Flashduty OpenAPI schema.

type MappingSchemaListResponse

type MappingSchemaListResponse struct {
	// Mapping schemas.
	Items []MappingSchemaItem `json:"items,omitempty"`
	// Total schema count.
	Total int64 `json:"total,omitempty"`
}

MappingSchemaListResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaUpdateRequest

type MappingSchemaUpdateRequest struct {
	// New description (max 500 chars).
	Description string `json:"description,omitempty"`
	// Schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id,omitempty"`
	// New schema name (max 39 chars).
	SchemaName string `json:"schema_name,omitempty"`
	// New owning team ID. `0` removes the team association.
	TeamID int64 `json:"team_id,omitempty"`
}

MappingSchemaUpdateRequest is generated from the Flashduty OpenAPI schema.

type MemberDeleteRequest

type MemberDeleteRequest struct {
	// Phone country code, used with phone
	CountryCode string `json:"country_code,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Force delete. Defaults to false, which checks for references from escalation rules, schedules, etc. Set to true to skip the reference check and delete immediately
	IsForce bool `json:"is_force,omitempty"`
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Member name
	MemberName string `json:"member_name,omitempty"`
	// Phone number
	Phone string `json:"phone,omitempty"`
	// External reference ID
	RefID string `json:"ref_id,omitempty"`
}

MemberDeleteRequest is generated from the Flashduty OpenAPI schema.

type MemberEmptyObject

type MemberEmptyObject struct{}

MemberEmptyObject is generated from the Flashduty OpenAPI schema.

type MemberInfoRequest

type MemberInfoRequest struct{}

MemberInfoRequest is generated from the Flashduty OpenAPI schema.

type MemberInfoResponse

type MemberInfoResponse struct {
	// Account avatar URL
	AccountAvatar string `json:"account_avatar,omitempty"`
	// Account email
	AccountEmail string `json:"account_email,omitempty"`
	// Account ID
	AccountID uint64 `json:"account_id,omitempty"`
	// Account-level locale preference (e.g. zh-CN or en-US)
	AccountLocale string `json:"account_locale,omitempty"`
	// Account name
	AccountName string `json:"account_name,omitempty"`
	// Assigned role IDs
	AccountRoleIDs []uint64 `json:"account_role_ids,omitempty"`
	// Account-level time zone (e.g. Asia/Shanghai)
	AccountTimeZone string `json:"account_time_zone,omitempty"`
	// Member avatar URL
	Avatar string `json:"avatar,omitempty"`
	// Phone country code
	CountryCode string `json:"country_code,omitempty"`
	// Account domain
	Domain string `json:"domain,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Whether email is verified
	EmailVerified bool `json:"email_verified,omitempty"`
	// Whether provisioned via SSO
	IsExternal bool `json:"is_external,omitempty"`
	// Locale preference
	Locale string `json:"locale,omitempty"`
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Member display name
	MemberName string `json:"member_name,omitempty"`
	// Masked phone number
	Phone string `json:"phone,omitempty"`
	// Whether phone is verified
	PhoneVerified bool `json:"phone_verified,omitempty"`
	// Member status. `enabled` — active member; `pending` — invited but not yet accepted; `deleted` — removed from the organization.
	Status string `json:"status,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty"`
}

MemberInfoResponse is generated from the Flashduty OpenAPI schema.

type MemberInviteRequest

type MemberInviteRequest struct {
	// Invite source context
	From string `json:"from,omitempty"`
	// Members to invite (max 20)
	Members []InviteMemberItem `json:"members,omitempty"`
}

MemberInviteRequest is generated from the Flashduty OpenAPI schema.

type MemberInviteResponse

type MemberInviteResponse struct {
	// Newly created members
	Items []NewMemberItem `json:"items,omitempty"`
}

MemberInviteResponse is generated from the Flashduty OpenAPI schema.

type MemberItem

type MemberItem struct {
	// Account ID
	AccountID uint64 `json:"account_id,omitempty"`
	// Role IDs
	AccountRoleIDs []uint64 `json:"account_role_ids,omitempty"`
	// Avatar URL
	Avatar string `json:"avatar,omitempty"`
	// Phone country code
	CountryCode string `json:"country_code,omitempty"`
	// Creation timestamp (Unix seconds)
	CreatedAt int64 `json:"created_at,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Email verified
	EmailVerified bool `json:"email_verified,omitempty"`
	// Provisioned via SSO
	IsExternal bool `json:"is_external,omitempty"`
	// Locale
	Locale string `json:"locale,omitempty"`
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Display name
	MemberName string `json:"member_name,omitempty"`
	// Masked phone number
	Phone string `json:"phone,omitempty"`
	// Phone verified
	PhoneVerified bool `json:"phone_verified,omitempty"`
	// External reference ID
	RefID string `json:"ref_id,omitempty"`
	// Member status. `enabled` — active member; `pending` — invited but not yet accepted; `deleted` — removed from the organization.
	Status string `json:"status,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty"`
	// Update timestamp (Unix seconds)
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

MemberItem is generated from the Flashduty OpenAPI schema.

type MemberListRequest

type MemberListRequest struct {
	ListOptions
	// Ascending order
	Asc bool `json:"asc,omitempty"`
	// Sort field
	Orderby string `json:"orderby,omitempty"`
	// Search keyword
	Query string `json:"query,omitempty"`
	// Filter by role ID
	RoleID uint64 `json:"role_id,omitempty"`
}

MemberListRequest is generated from the Flashduty OpenAPI schema.

type MemberListResponse

type MemberListResponse struct {
	ListOptions
	// Member items
	Items []MemberItem `json:"items,omitempty"`
	// Total count
	Total int64 `json:"total,omitempty"`
}

MemberListResponse is generated from the Flashduty OpenAPI schema.

type MemberResetInfoRequest

type MemberResetInfoRequest struct {
	// Avatar URL
	Avatar string `json:"avatar,omitempty"`
	// Country code
	CountryCode string `json:"country_code,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Locale
	Locale string `json:"locale,omitempty"`
	// Member ID of the member to update
	MemberID uint64 `json:"member_id,omitempty"`
	// Display name
	MemberName string `json:"member_name,omitempty"`
	// Phone number
	Phone string `json:"phone,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty"`
}

MemberResetInfoRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleGrantRequest

type MemberRoleGrantRequest struct {
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Role IDs to grant; appended to the member's current roles (duplicates are deduplicated).
	RoleIDs []uint64 `json:"role_ids,omitempty"`
}

MemberRoleGrantRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleRevokeRequest

type MemberRoleRevokeRequest struct {
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Role IDs to remove from the member.
	RoleIDs []uint64 `json:"role_ids,omitempty"`
}

MemberRoleRevokeRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleUpdateRequest

type MemberRoleUpdateRequest struct {
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// New set of role IDs
	RoleIDs []uint64 `json:"role_ids,omitempty"`
}

MemberRoleUpdateRequest is generated from the Flashduty OpenAPI schema.

type MembersService

type MembersService service

MembersService handles the "Platform/Members" API resource.

func (*MembersService) MemberDelete

func (s *MembersService) MemberDelete(ctx context.Context, req *MemberDeleteRequest) (*Response, error)

Delete member.

Remove a member from the organization by ID, email, phone, or name.

API: POST /member/delete (memberDelete).

func (*MembersService) MemberGrantRole

func (s *MembersService) MemberGrantRole(ctx context.Context, req *MemberRoleGrantRequest) (*Response, error)

Grant role to member.

Add a role assignment to a member.

API: POST /member/role/grant (memberGrantRole).

func (*MembersService) MemberInfo

Get current member info.

Return the current session member's full profile.

API: POST /member/info (memberInfo).

func (*MembersService) MemberInvite

Invite members.

Batch invite new members to the organization by email or phone.

API: POST /member/invite (memberInvite).

func (*MembersService) MemberList

List members.

Return a paginated list of organization members.

API: POST /member/list (memberList).

func (*MembersService) MemberResetInfo

func (s *MembersService) MemberResetInfo(ctx context.Context, req *MemberResetInfoRequest) (*Response, error)

Reset member info.

Batch-update multiple profile fields of the current member.

API: POST /member/info/reset (memberResetInfo).

func (*MembersService) MemberRevokeRole

func (s *MembersService) MemberRevokeRole(ctx context.Context, req *MemberRoleRevokeRequest) (*Response, error)

Revoke role from member.

Remove a role assignment from a member.

API: POST /member/role/revoke (memberRevokeRole).

func (*MembersService) MemberUpdateRole

func (s *MembersService) MemberUpdateRole(ctx context.Context, req *MemberRoleUpdateRequest) (*Response, error)

Update member roles.

Replace all role assignments for a member at once.

API: POST /member/role/update (memberUpdateRole).

func (*MembersService) PersonInfos

Batch get persons.

Return profile information for a batch of person IDs (members or accounts).

API: POST /person/infos (personInfos).

type MergeIncidentsRequest

type MergeIncidentsRequest struct {
	// Optional comment recorded on the merge timeline entry.
	Comment string `json:"comment,omitempty"`
	// Optional new owner member ID for the target incident.
	OwnerID int64 `json:"owner_id,omitempty"`
	// When true, soft-delete the source incidents after merging instead of closing them.
	RemoveSourceIncidents bool `json:"remove_source_incidents,omitempty"`
	// Source incident IDs. The target incident is removed from this set automatically.
	SourceIncidentIDs []string `json:"source_incident_ids,omitempty"`
	// Target incident ID that source incidents will be merged into.
	TargetIncidentID string `json:"target_incident_id,omitempty"`
	// Optional new title for the target incident.
	Title string `json:"title,omitempty"`
}

MergeIncidentsRequest is generated from the Flashduty OpenAPI schema.

type MetricsBase

type MetricsBase struct {
	AccountID   int64  `json:"account_id,omitempty"`
	ChannelID   int64  `json:"channel_id,omitempty"`
	ChannelName string `json:"channel_name,omitempty"`
	// Hour bucket when `split_hours` is enabled.
	Hours         string `json:"hours,omitempty"`
	ResponderID   int64  `json:"responder_id,omitempty"`
	ResponderName string `json:"responder_name,omitempty"`
	TeamID        int64  `json:"team_id,omitempty"`
	TeamName      string `json:"team_name,omitempty"`
	// Aggregation bucket start time, Unix seconds. Present when `aggregate_unit` is used.
	TS int64 `json:"ts,omitempty"`
}

MetricsBase is generated from the Flashduty OpenAPI schema.

type MigrateStatusPageEmailSubscribersRequest

type MigrateStatusPageEmailSubscribersRequest struct {
	// Atlassian Statuspage API key with access to the source page.
	APIKey string `json:"api_key,omitempty"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id,omitempty"`
	// Flashduty target status page ID that will receive the imported subscribers.
	TargetPageID int64 `json:"target_page_id,omitempty"`
}

MigrateStatusPageEmailSubscribersRequest is generated from the Flashduty OpenAPI schema.

type MigrateStatusPageStructureRequest

type MigrateStatusPageStructureRequest struct {
	// Atlassian Statuspage API key with access to the source page.
	APIKey string `json:"api_key,omitempty"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id,omitempty"`
}

MigrateStatusPageStructureRequest is generated from the Flashduty OpenAPI schema.

type NameMessage

type NameMessage struct {
	// Empty on success, error message on failure.
	Message string `json:"message,omitempty"`
	// Rule name.
	Name string `json:"name,omitempty"`
}

NameMessage is generated from the Flashduty OpenAPI schema.

type NewMemberItem

type NewMemberItem struct {
	// Member ID
	MemberID uint64 `json:"member_id,omitempty"`
	// Member display name
	MemberName string `json:"member_name,omitempty"`
}

NewMemberItem is generated from the Flashduty OpenAPI schema.

type NotificationTemplatesService

type NotificationTemplatesService service

NotificationTemplatesService handles the "On-call/Notification templates" API resource.

func (*NotificationTemplatesService) ReadInfo

Get template detail.

Return a single notification template by ID.

API: POST /template/info (template-read-info).

func (*NotificationTemplatesService) ReadList

List templates.

Return a paginated list of notification templates.

API: POST /template/list (template-read-list).

func (*NotificationTemplatesService) WriteCreate

Create a template.

Create a new notification template.

API: POST /template/create (template-write-create).

func (*NotificationTemplatesService) WriteDelete

Delete a template.

Soft-delete a template by ID.

API: POST /template/delete (template-write-delete).

func (*NotificationTemplatesService) WriteUpdate

Update a template.

Replace the content of every channel on an existing template.

API: POST /template/update (template-write-update).

type NotifyChat

type NotifyChat struct {
	// Chat group identifier.
	ChatID string `json:"chat_id,omitempty"`
	// Chat group display name.
	ChatName string `json:"chat_name,omitempty"`
	// Integration data source ID used to send the notification.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Failure reason if delivery did not succeed.
	FailedReason string `json:"failed_reason,omitempty"`
}

NotifyChat is generated from the Flashduty OpenAPI schema.

type NotifyPerson

type NotifyPerson struct {
	// Failure reason if delivery did not succeed.
	FailedReason string `json:"failed_reason,omitempty"`
	// Recipient member ID.
	PersonID int64 `json:"person_id,omitempty"`
}

NotifyPerson is generated from the Flashduty OpenAPI schema.

type NotifyRobot

type NotifyRobot struct {
	// Robot alias.
	Alias string `json:"alias,omitempty"`
	// Failure reason if delivery did not succeed.
	FailedReason string `json:"failed_reason,omitempty"`
	// Robot token or identifier.
	Token string `json:"token,omitempty"`
}

NotifyRobot is generated from the Flashduty OpenAPI schema.

type OnceTimeFilter

type OnceTimeFilter struct {
	// Window end (unix seconds). Must be > 0.
	EndTime int64 `json:"end_time,omitempty"`
	// Window start (unix seconds). Must be > 0 and less than `end_time`.
	StartTime int64 `json:"start_time,omitempty"`
}

OnceTimeFilter is generated from the Flashduty OpenAPI schema.

type Option

type Option func(*Client)

Option configures a Client during NewClient.

func WithBaseURL

func WithBaseURL(raw string) Option

WithBaseURL overrides the API base URL (default https://api.flashcat.cloud).

func WithHTTPClient

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient supplies a custom *http.Client. Nil is ignored.

func WithLogger

func WithLogger(l Logger) Option

WithLogger sets a custom Logger. Nil is ignored.

func WithRequestHeaders

func WithRequestHeaders(h http.Header) Option

WithRequestHeaders sets static headers added to every request, applied after the SDK's own headers (Content-Type, Accept, User-Agent).

func WithRequestHook

func WithRequestHook(hook func(*http.Request)) Option

WithRequestHook registers a callback invoked on every outgoing request before it is sent — use it to inject per-request headers (e.g. W3C traceparent).

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout sets the HTTP client timeout.

func WithTransport

func WithTransport(rt http.RoundTripper) Option

WithTransport sets a custom http.RoundTripper on the underlying client — the idiomatic seam for retry, caching, tracing, or rate-limit middleware (see the retry subpackage). Nil is ignored.

Example (Retry)

ExampleWithTransport_retry composes the retry helper as the client transport.

package main

import (
	"fmt"
	"log"
	"net/http"

	flashduty "github.com/flashcatcloud/go-flashduty"
	"github.com/flashcatcloud/go-flashduty/retry"
)

func main() {
	// retry.New returns an http.RoundTripper that transparently
	// retries safe requests on 429 and 5xx responses with backoff.
	var rt http.RoundTripper = retry.New()

	client, err := flashduty.NewClient(
		"YOUR_APP_KEY",
		flashduty.WithTransport(rt),
	)
	if err != nil {
		log.Fatal(err)
	}
	_ = client

	fmt.Println("client with retry transport ready")
}

func WithUserAgent

func WithUserAgent(ua string) Option

WithUserAgent sets the User-Agent header sent on every request.

type OrFilterGroup

type OrFilterGroup [][]FilterCondition

OrFilterGroup is a list response payload.

type PastIncidentItem

type PastIncidentItem struct {
	// Account ID that owns the incident.
	AccountID int64 `json:"account_id,omitempty"`
	// Account locale.
	AccountLocale string `json:"account_locale,omitempty"`
	// Account name.
	AccountName string `json:"account_name,omitempty"`
	// Account time zone.
	AccountTimeZone string `json:"account_time_zone,omitempty"`
	// Unix timestamp (seconds) when the incident was first acknowledged. 0 if unacknowledged.
	AckTime int64 `json:"ack_time,omitempty"`
	// Count of alerts currently in Critical/Warning/Info state.
	ActiveAlertCnt int64 `json:"active_alert_cnt,omitempty"`
	// AI-generated summary of the incident.
	AISummary string `json:"ai_summary,omitempty"`
	// Total count of alerts merged into this incident.
	AlertCnt int64 `json:"alert_cnt,omitempty"`
	// Total raw alert event count across all merged alerts.
	AlertEventCnt int64 `json:"alert_event_cnt,omitempty"`
	// Embedded alerts, only populated for notification templates and custom actions.
	Alerts []AlertInfo `json:"alerts,omitempty"`
	// Current assignment target for the incident.
	AssignedTo AssignedTo `json:"assigned_to,omitempty"`
	// Channel ID. 0 for standalone incidents.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel display name.
	ChannelName string `json:"channel_name,omitempty"`
	// Channel status.
	ChannelStatus string `json:"channel_status,omitempty"`
	// Unix timestamp (seconds) when the incident was closed. 0 if still open.
	CloseTime int64 `json:"close_time,omitempty"`
	// Closer member info.
	Closer PersonShort `json:"closer,omitempty"`
	// Member ID that closed the incident. 0 if auto-closed.
	CloserID int64 `json:"closer_id,omitempty"`
	// Creation timestamp (seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member info.
	Creator PersonShort `json:"creator,omitempty"`
	// Member ID that created the incident. 0 if auto-created by the system.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Deprecated. Use `integration_id` instead.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Deprecated. Use `integration_ids` instead.
	DataSourceIDs []int64 `json:"data_source_ids,omitempty"`
	// Deprecated. Use `integration_type` instead.
	DataSourceType string `json:"data_source_type,omitempty"`
	// Deprecated. Use `integration_types` instead.
	DataSourceTypes []string `json:"data_source_types,omitempty"`
	// Deduplication key used to coalesce alerts.
	DedupKey string `json:"dedup_key,omitempty"`
	// Soft-delete timestamp (seconds). Zero if not deleted.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Incident description.
	Description string `json:"description,omitempty"`
	// Web console URL for the incident.
	DetailURL string `json:"detail_url,omitempty"`
	// Unix timestamp (seconds) when the incident ended. 0 if still active.
	EndTime int64 `json:"end_time,omitempty"`
	// MD5 hash used for content-equality checks.
	EqualsMD5 string `json:"equals_md5,omitempty"`
	// Whether the incident has ever been silenced.
	EverMuted bool `json:"ever_muted,omitempty"`
	// Custom field values keyed by field name.
	Fields map[string]any `json:"fields,omitempty"`
	// Frequency bucket for recurrence analysis: `frequent` or `rare`.
	Frequency string `json:"frequency,omitempty"`
	// Alert grouping method: `i` intelligent, `p` pattern, `n` none.
	GroupMethod string `json:"group_method,omitempty"`
	// Attached images.
	Images []Image `json:"images,omitempty"`
	// Impact description.
	Impact string `json:"impact,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// Configured incident severity.
	IncidentSeverity string `json:"incident_severity,omitempty"`
	// Current incident status, derived from alert statuses.
	IncidentStatus string `json:"incident_status,omitempty"`
	// First integration associated with the incident.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// All integration IDs contributing alerts to this incident.
	IntegrationIDs []int64 `json:"integration_ids,omitempty"`
	// First alert's integration type string, used by the detail page for label mappings.
	IntegrationType string `json:"integration_type,omitempty"`
	// Integration type strings for all contributing integrations.
	IntegrationTypes []string `json:"integration_types,omitempty"`
	// Labels propagated from alerts.
	Labels map[string]string `json:"labels,omitempty"`
	// Unix timestamp (seconds) of the most recent update.
	LastTime int64 `json:"last_time,omitempty"`
	// Channel-level link integrations rendered for this incident.
	Links []LinkItem `json:"links,omitempty"`
	// Fields that were manually overridden after auto-population.
	ManualOverrides []string `json:"manual_overrides,omitempty"`
	// Short display identifier; not guaranteed unique.
	Num string `json:"num,omitempty"`
	// Owner member info. May be deprecated.
	Owner PersonShort `json:"owner,omitempty"`
	// Primary owner member ID. 0 if none.
	OwnerID int64 `json:"owner_id,omitempty"`
	// Associated post-mortem ID, if any. One incident can only link to a single post-mortem.
	PostMortemID string `json:"post_mortem_id,omitempty"`
	// Incident progress state.
	Progress string `json:"progress,omitempty"`
	// Reporter email for manually created incidents.
	ReporterEmail string `json:"reporter_email,omitempty"`
	// Resolution notes.
	Resolution string `json:"resolution,omitempty"`
	// Current responders with assignment/acknowledgement state.
	Responders []Responder `json:"responders,omitempty"`
	// Root cause analysis.
	RootCause string `json:"root_cause,omitempty"`
	// Similarity score from the vector search.
	Score float64 `json:"score,omitempty"`
	// Quick-silence URL for this incident.
	SilenceURL string `json:"silence_url,omitempty"`
	// Unix timestamp (seconds) until which notifications are snoozed. 0 if not snoozed.
	SnoozedBefore int64 `json:"snoozed_before,omitempty"`
	// Unix timestamp (seconds) when the incident started.
	StartTime int64 `json:"start_time,omitempty"`
	// Incident title.
	Title string `json:"title,omitempty"`
	// Last update timestamp (seconds).
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

PastIncidentItem is generated from the Flashduty OpenAPI schema.

type PermissionFactorItem

type PermissionFactorItem struct {
	// Factor identifier (e.g., 'template:read:info').
	FactorName string `json:"factor_name,omitempty"`
	// Factor type.
	FactorType string `json:"factor_type,omitempty"`
}

PermissionFactorItem is generated from the Flashduty OpenAPI schema.

type PermissionFactorListRequest

type PermissionFactorListRequest struct {
	// Filter by factor type.
	FactorTypes []string `json:"factor_types,omitempty"`
}

PermissionFactorListRequest is generated from the Flashduty OpenAPI schema.

type PermissionFactorListResponse

type PermissionFactorListResponse []PermissionFactorItem

PermissionFactorListResponse is a list response payload.

type PermissionItem

type PermissionItem struct {
	// Permission class (e.g., 'On-call', 'Organization').
	Class string `json:"class,omitempty"`
	// Human-readable permission description.
	Description string `json:"description,omitempty"`
	// Unique permission ID.
	ID uint64 `json:"id,omitempty"`
	// Present when with_all is true. Indicates whether this permission is granted to the requested roles.
	IsGranted bool `json:"is_granted,omitempty"`
	// Permission display name.
	PermissionName string `json:"permission_name,omitempty"`
	// Whether this is a read or manage permission.
	PermissionType string `json:"permission_type,omitempty"`
	// Permission scope (e.g., 'on-call', 'organization').
	Scope string `json:"scope,omitempty"`
	// Permission status.
	Status string `json:"status,omitempty"`
}

PermissionItem is generated from the Flashduty OpenAPI schema.

type PersonInfosRequest

type PersonInfosRequest struct {
	// List of person IDs
	PersonIDs []uint64 `json:"person_ids,omitempty"`
}

PersonInfosRequest is generated from the Flashduty OpenAPI schema.

type PersonInfosResponse

type PersonInfosResponse struct {
	// Person profiles
	Items []PersonItem `json:"items,omitempty"`
}

PersonInfosResponse is generated from the Flashduty OpenAPI schema.

type PersonItem

type PersonItem struct {
	// Account ID
	AccountID uint64 `json:"account_id,omitempty"`
	// Login role (account/member)
	As string `json:"as,omitempty"`
	// Avatar URL
	Avatar string `json:"avatar,omitempty"`
	// Email address
	Email string `json:"email,omitempty"`
	// Email verified
	EmailVerified bool `json:"email_verified,omitempty"`
	// Locale
	Locale string `json:"locale,omitempty"`
	// Person ID
	PersonID uint64 `json:"person_id,omitempty"`
	// Display name
	PersonName string `json:"person_name,omitempty"`
	// Phone number
	Phone string `json:"phone,omitempty"`
	// Phone verified
	PhoneVerified bool `json:"phone_verified,omitempty"`
	// Person status. `enabled` — active; `pending` — invited but not yet accepted; `deleted` — removed.
	Status string `json:"status,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty"`
}

PersonItem is generated from the Flashduty OpenAPI schema.

type PersonShort

type PersonShort struct {
	// Role label for this member in the context of the current object.
	As string `json:"as,omitempty"`
	// Member email address.
	Email string `json:"email,omitempty"`
	// Member ID.
	PersonID int64 `json:"person_id,omitempty"`
	// Member display name.
	PersonName string `json:"person_name,omitempty"`
}

PersonShort is generated from the Flashduty OpenAPI schema.

type PlatformEmptyObject

type PlatformEmptyObject struct{}

PlatformEmptyObject is generated from the Flashduty OpenAPI schema.

type PostMortemItem

type PostMortemItem struct {
	Basics  PostMortemItemBasics  `json:"basics,omitempty"`
	Content PostMortemItemContent `json:"content,omitempty"`
	// Follow-up action items rendered as a single string.
	FollowUps string         `json:"follow_ups,omitempty"`
	Meta      PostMortemMeta `json:"meta,omitempty"`
}

PostMortemItem is generated from the Flashduty OpenAPI schema.

type PostMortemItemBasics

type PostMortemItemBasics struct {
	// Earliest start time among linked incidents (seconds).
	IncidentsEarliestStartSeconds int64 `json:"incidents_earliest_start_seconds,omitempty"`
	// Highest severity among linked incidents.
	IncidentsHighestSeverity string `json:"incidents_highest_severity,omitempty"`
	// Latest close time among linked incidents (seconds).
	IncidentsLatestCloseSeconds int64 `json:"incidents_latest_close_seconds,omitempty"`
	// Cumulative duration in seconds.
	IncidentsTotalDurationSeconds int64 `json:"incidents_total_duration_seconds,omitempty"`
	// Responders involved in the incident(s).
	Responders []Responder `json:"responders,omitempty"`
}

PostMortemItemBasics is generated from the Flashduty OpenAPI schema.

type PostMortemItemContent

type PostMortemItemContent struct {
	// Report body content (BlockNote JSON).
	Content string `json:"content,omitempty"`
}

PostMortemItemContent is generated from the Flashduty OpenAPI schema.

type PostMortemMeta

type PostMortemMeta struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Member IDs that contributed to the report.
	AuthorIDs []int64 `json:"author_ids,omitempty"`
	// Owning channel ID. 0 if none.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Channel name, filled by the server.
	ChannelName string `json:"channel_name,omitempty"`
	// Creation timestamp (seconds).
	CreatedAtSeconds int64 `json:"created_at_seconds,omitempty"`
	// Linked incident IDs.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// When true, only team members and admins can view.
	IsPrivate bool `json:"is_private,omitempty"`
	// Number of uploaded media files.
	MediaCount int64 `json:"media_count,omitempty"`
	// Deterministic post-mortem ID derived from account and incident IDs.
	PostMortemID string `json:"post_mortem_id,omitempty"`
	// Report status.
	Status string `json:"status,omitempty"`
	// Owning team ID. 0 if none.
	TeamID int64 `json:"team_id,omitempty"`
	// Template used to initialize the report.
	TemplateID string `json:"template_id,omitempty"`
	// Report title.
	Title string `json:"title,omitempty"`
	// Last update timestamp (seconds).
	UpdatedAtSeconds int64 `json:"updated_at_seconds,omitempty"`
}

PostMortemMeta is generated from the Flashduty OpenAPI schema.

type QueryRow

type QueryRow struct {
	// String-valued fields (labels, log fields, SQL columns).
	Fields map[string]string `json:"fields,omitempty"`
	// Numeric fields. For metric queries the canonical key is `__value__`. May be `null` for detail-oriented sources.
	Values map[string]float64 `json:"values,omitempty"`
}

QueryRow is generated from the Flashduty OpenAPI schema.

type QueryRowsRequest

type QueryRowsRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied; mismatched values are rejected. Business execution always uses the authenticated account.
	AccountID int64 `json:"account_id,omitempty"`
	// Polymorphic key/value extension parameters forwarded verbatim to monit-edge. All values must be strings. Semantics depend on `ds_type`: SLS requires `sls.project` + `sls.logstore`; Loki / VictoriaLogs raw mode requires a time range via `<source>.start`/`<source>.end` or `<source>.timespan.value` + `<source>.timespan.unit`; Prometheus and SQL sources ignore it. Always namespace keys by source (e.g. `sls.project`, `loki.type`).
	Args map[string]string `json:"args,omitempty"`
	// Look-back offset in seconds applied to point-in-time queries (Prometheus, Loki stats, VictoriaLogs stats). Ignored for raw / detail queries.
	DelaySeconds int64 `json:"delay_seconds,omitempty"`
	// Data source name; must match a configured data source under the tenant.
	DsName string `json:"ds_name,omitempty"`
	// Data source type; must match a configured data source under the tenant. Examples: `prometheus`, `loki`, `victorialogs`, `sls`, `elasticsearch`, `mysql`, `postgres`, `oracle`, `clickhouse`.
	DsType string `json:"ds_type,omitempty"`
	// Query expression. Syntax depends on `ds_type` and is interpreted by the corresponding monit-edge client (PromQL for Prometheus, LogQL for Loki, SQL for SQL sources, etc.).
	Expr string `json:"expr,omitempty"`
}

QueryRowsRequest is generated from the Flashduty OpenAPI schema.

type QueryRowsResponse

type QueryRowsResponse []QueryRow

QueryRowsResponse is a list response payload.

type RUMApplicationAlerting

type RUMApplicationAlerting struct {
	// Channel IDs to send alerts to.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// Whether alerting is enabled.
	Enabled bool `json:"enabled,omitempty"`
	// Associated on-call integration ID (read-only, auto-assigned).
	IntegrationID int64 `json:"integration_id,omitempty"`
}

RUMApplicationAlerting is generated from the Flashduty OpenAPI schema.

type RUMApplicationCreateRequest

type RUMApplicationCreateRequest struct {
	Alerting RUMApplicationAlerting `json:"alerting,omitempty"`
	// Application name. 1–40 characters.
	ApplicationName string `json:"application_name,omitempty"`
	// Restrict access to team members only.
	IsPrivate bool `json:"is_private,omitempty"`
	// Do not infer geographic location.
	NoGeo bool `json:"no_geo,omitempty"`
	// Do not collect IP addresses.
	NoIP bool `json:"no_ip,omitempty"`
	// Owning team ID.
	TeamID  int64                 `json:"team_id,omitempty"`
	Tracing RUMApplicationTracing `json:"tracing,omitempty"`
	// Application type.
	Type string `json:"type,omitempty"`
}

RUMApplicationCreateRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationCreateResponse

type RUMApplicationCreateResponse struct {
	// Auto-generated unique application ID.
	ApplicationID string `json:"application_id,omitempty"`
	// Application display name.
	ApplicationName string `json:"application_name,omitempty"`
	// Token for RUM SDK initialization.
	ClientToken string `json:"client_token,omitempty"`
}

RUMApplicationCreateResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationIDRequest

type RUMApplicationIDRequest struct {
	// RUM application ID.
	ApplicationID string `json:"application_id,omitempty"`
}

RUMApplicationIDRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationInfosRequest

type RUMApplicationInfosRequest struct {
	// Up to 200 application IDs.
	ApplicationIDs []string `json:"application_ids,omitempty"`
}

RUMApplicationInfosRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationInfosResponse

type RUMApplicationInfosResponse struct {
	Items []RUMApplicationItem `json:"items,omitempty"`
}

RUMApplicationInfosResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationItem

type RUMApplicationItem struct {
	// Account ID.
	AccountID int64                  `json:"account_id,omitempty"`
	Alerting  RUMApplicationAlerting `json:"alerting,omitempty"`
	// Unique application ID.
	ApplicationID string `json:"application_id,omitempty"`
	// Application display name.
	ApplicationName string `json:"application_name,omitempty"`
	// Token used to initialize the RUM SDK.
	ClientToken string `json:"client_token,omitempty"`
	// Creation timestamp, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Creator member ID.
	CreatedBy int64 `json:"created_by,omitempty"`
	// If `true`, the application is only accessible to team members.
	IsPrivate bool `json:"is_private,omitempty"`
	// If `true`, geographic location is not inferred from IP.
	NoGeo bool `json:"no_geo,omitempty"`
	// If `true`, IP addresses are not collected.
	NoIP bool `json:"no_ip,omitempty"`
	// Application status.
	Status string `json:"status,omitempty"`
	// Owning team ID.
	TeamID  int64                 `json:"team_id,omitempty"`
	Tracing RUMApplicationTracing `json:"tracing,omitempty"`
	// Application type.
	Type string `json:"type,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Last updater member ID.
	UpdatedBy int64 `json:"updated_by,omitempty"`
}

RUMApplicationItem is generated from the Flashduty OpenAPI schema.

type RUMApplicationListRequest

type RUMApplicationListRequest struct {
	ListOptions
	// Sort ascending if `true`.
	Asc bool `json:"asc,omitempty"`
	// If `true`, return only applications belonging to the current user's teams.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Search query to filter by application name.
	Query string `json:"query,omitempty"`
	// Filter by team ID.
	TeamID int64 `json:"team_id,omitempty"`
}

RUMApplicationListRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationListResponse

type RUMApplicationListResponse struct {
	HasNextPage bool                 `json:"has_next_page,omitempty"`
	Items       []RUMApplicationItem `json:"items,omitempty"`
	Total       int64                `json:"total,omitempty"`
}

RUMApplicationListResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationTracing

type RUMApplicationTracing struct {
	// Whether tracing integration is enabled.
	Enabled bool `json:"enabled,omitempty"`
	// Trace endpoint URL (http or https).
	Endpoint string `json:"endpoint,omitempty"`
	// How to open the trace link.
	OpenType string `json:"open_type,omitempty"`
}

RUMApplicationTracing is generated from the Flashduty OpenAPI schema.

type RUMApplicationUpdateRequest

type RUMApplicationUpdateRequest struct {
	Alerting RUMApplicationAlerting `json:"alerting,omitempty"`
	// Application ID to update.
	ApplicationID string `json:"application_id,omitempty"`
	// New application name.
	ApplicationName string                `json:"application_name,omitempty"`
	IsPrivate       bool                  `json:"is_private,omitempty"`
	NoGeo           bool                  `json:"no_geo,omitempty"`
	NoIP            bool                  `json:"no_ip,omitempty"`
	TeamID          int64                 `json:"team_id,omitempty"`
	Tracing         RUMApplicationTracing `json:"tracing,omitempty"`
	Type            string                `json:"type,omitempty"`
}

RUMApplicationUpdateRequest is generated from the Flashduty OpenAPI schema.

type RUMIssueIDRequest

type RUMIssueIDRequest struct {
	// Issue ID.
	IssueID string `json:"issue_id,omitempty"`
}

RUMIssueIDRequest is generated from the Flashduty OpenAPI schema.

type RUMIssueItem

type RUMIssueItem struct {
	Age             int64             `json:"age,omitempty"`
	ApplicationID   string            `json:"application_id,omitempty"`
	ApplicationName string            `json:"application_name,omitempty"`
	CreatedAt       int64             `json:"created_at,omitempty"`
	Error           RUMIssueItemError `json:"error,omitempty"`
	// Total error occurrences.
	ErrorCount int64                 `json:"error_count,omitempty"`
	FirstSeen  RUMIssueItemFirstSeen `json:"first_seen,omitempty"`
	// Whether the error caused an app crash.
	IsCrash bool `json:"is_crash,omitempty"`
	// Unique issue ID.
	IssueID  string               `json:"issue_id,omitempty"`
	LastSeen RUMIssueItemLastSeen `json:"last_seen,omitempty"`
	// Regression metadata. Present only when a previously resolved issue re-occurred.
	Regression RUMIssueItemRegression `json:"regression,omitempty"`
	ResolvedAt int64                  `json:"resolved_at,omitempty"`
	ResolvedBy int64                  `json:"resolved_by,omitempty"`
	Service    string                 `json:"service,omitempty"`
	// Affected user sessions.
	SessionCount int64 `json:"session_count,omitempty"`
	// Issue severity level.
	Severity       string                     `json:"severity,omitempty"`
	Status         string                     `json:"status,omitempty"`
	SuspectedCause RUMIssueItemSuspectedCause `json:"suspected_cause,omitempty"`
	TeamID         int64                      `json:"team_id,omitempty"`
	UpdatedAt      int64                      `json:"updated_at,omitempty"`
	Versions       []string                   `json:"versions,omitempty"`
}

RUMIssueItem is generated from the Flashduty OpenAPI schema.

type RUMIssueItemError

type RUMIssueItemError struct {
	Message string `json:"message,omitempty"`
	Type    string `json:"type,omitempty"`
}

RUMIssueItemError is generated from the Flashduty OpenAPI schema.

type RUMIssueItemFirstSeen

type RUMIssueItemFirstSeen struct {
	Timestamp int64  `json:"timestamp,omitempty"`
	Version   string `json:"version,omitempty"`
}

RUMIssueItemFirstSeen is generated from the Flashduty OpenAPI schema.

type RUMIssueItemLastSeen

type RUMIssueItemLastSeen struct {
	Timestamp int64  `json:"timestamp,omitempty"`
	Version   string `json:"version,omitempty"`
}

RUMIssueItemLastSeen is generated from the Flashduty OpenAPI schema.

type RUMIssueItemRegression

type RUMIssueItemRegression struct {
	// Timestamp when the regression was detected.
	RegressedAt int64 `json:"regressed_at,omitempty"`
	// Application version in which the regression was observed.
	RegressedAtVersion string `json:"regressed_at_version,omitempty"`
	// Timestamp of the previous resolution before the regression.
	ResolvedAt int64 `json:"resolved_at,omitempty"`
}

RUMIssueItemRegression is generated from the Flashduty OpenAPI schema.

type RUMIssueItemSuspectedCause

type RUMIssueItemSuspectedCause struct {
	PersonID int64  `json:"person_id,omitempty"`
	Reason   string `json:"reason,omitempty"`
	Source   string `json:"source,omitempty"`
	Value    string `json:"value,omitempty"`
}

RUMIssueItemSuspectedCause is generated from the Flashduty OpenAPI schema.

type RUMIssueListRequest

type RUMIssueListRequest struct {
	ListOptions
	// Filter by application IDs.
	ApplicationIDs []string `json:"application_ids,omitempty"`
	Asc            bool     `json:"asc,omitempty"`
	ByIntersection bool     `json:"by_intersection,omitempty"`
	// DQL query for advanced filtering. Cannot be used with `sql`.
	Dql string `json:"dql,omitempty"`
	// End of time range, millisecond timestamp. Maximum range: 183 days.
	EndTime int64 `json:"end_time,omitempty"`
	// If `true`, only return issues with at least one associated error event.
	ErrorRequired bool   `json:"error_required,omitempty"`
	Orderby       string `json:"orderby,omitempty"`
	// SQL-style query for advanced filtering. Cannot be used with `dql`.
	Sql string `json:"sql,omitempty"`
	// Start of time range, millisecond timestamp.
	StartTime int64 `json:"start_time,omitempty"`
	// Filter by statuses.
	Statuses []string `json:"statuses,omitempty"`
	// Filter by suspected causes.
	SuspectedCauses []string `json:"suspected_causes,omitempty"`
	// Filter by team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

RUMIssueListRequest is generated from the Flashduty OpenAPI schema.

type RUMIssueListResponse

type RUMIssueListResponse struct {
	HasNextPage bool           `json:"has_next_page,omitempty"`
	Items       []RUMIssueItem `json:"items,omitempty"`
	Total       int64          `json:"total,omitempty"`
}

RUMIssueListResponse is generated from the Flashduty OpenAPI schema.

type RUMIssueUpdateRequest

type RUMIssueUpdateRequest struct {
	// Issue ID to update.
	IssueID string `json:"issue_id,omitempty"`
	// New status.
	Status string `json:"status,omitempty"`
	// Suspected cause.
	SuspectedCause string `json:"suspected_cause,omitempty"`
}

RUMIssueUpdateRequest is generated from the Flashduty OpenAPI schema.

type RateLimit

type RateLimit struct {
	Limit      int           // X-RateLimit-Limit, if present
	Remaining  int           // X-RateLimit-Remaining, if present
	Reset      time.Time     // X-RateLimit-Reset (unix seconds), if present
	RetryAfter time.Duration // Retry-After (delta-seconds), if present
}

RateLimit captures rate-limit signals parsed from a response, best-effort. Each field is zero when the server did not send the corresponding header.

type RateLimitError

type RateLimitError struct {
	*ErrorResponse
	RetryAfter time.Duration
}

RateLimitError is returned when the API responds 429. It embeds the standard *ErrorResponse (so errors.As(err, &target) for a *ErrorResponse still works) and adds the Retry-After hint. Inspect it with errors.As(err, &target) for a *RateLimitError.

func (*RateLimitError) Error

func (e *RateLimitError) Error() string

func (*RateLimitError) Unwrap

func (e *RateLimitError) Unwrap() error

Unwrap lets errors.As reach the embedded *ErrorResponse.

type RemoveIncidentRequest

type RemoveIncidentRequest struct {
	// Incident IDs to remove. At most 100 per call. The caller must have access to every channel the incidents belong to.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

RemoveIncidentRequest is generated from the Flashduty OpenAPI schema.

type ReopenIncidentRequest

type ReopenIncidentRequest struct {
	// Incident IDs to reopen. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Optional reason recorded on the timeline.
	Reason string `json:"reason,omitempty"`
}

ReopenIncidentRequest is generated from the Flashduty OpenAPI schema.

type ResetIncidentFieldRequest

type ResetIncidentFieldRequest struct {
	// Custom field name; must match a field defined on the account.
	FieldName string `json:"field_name,omitempty"`
	// New field value. Type must match the field definition.
	FieldValue map[string]any `json:"field_value,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
}

ResetIncidentFieldRequest is generated from the Flashduty OpenAPI schema.

type ResolveIncidentRequest

type ResolveIncidentRequest struct {
	// Incident IDs to resolve. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Optional resolution note applied to every resolved incident.
	Resolution string `json:"resolution,omitempty"`
	// Optional root cause note applied to every resolved incident.
	RootCause string `json:"root_cause,omitempty"`
}

ResolveIncidentRequest is generated from the Flashduty OpenAPI schema.

type Responder

type Responder struct {
	// Unix timestamp (seconds) when the member acknowledged. 0 if not yet acknowledged.
	AcknowledgedAt int64 `json:"acknowledged_at,omitempty"`
	// Role label of this responder.
	As string `json:"as,omitempty"`
	// Unix timestamp (seconds) when the member was assigned.
	AssignedAt int64 `json:"assigned_at,omitempty"`
	// Member email, filled by the server.
	Email string `json:"email,omitempty"`
	// Responder member ID.
	PersonID int64 `json:"person_id,omitempty"`
	// Member display name, filled by the server.
	PersonName string `json:"person_name,omitempty"`
}

Responder is generated from the Flashduty OpenAPI schema.

type ResponderInsightItem

type ResponderInsightItem struct {
	AccountID          int64   `json:"account_id,omitempty"`
	AcknowledgementPct float64 `json:"acknowledgement_pct,omitempty"`
	ChannelID          int64   `json:"channel_id,omitempty"`
	ChannelName        string  `json:"channel_name,omitempty"`
	// Hour bucket when `split_hours` is enabled.
	Hours                           string  `json:"hours,omitempty"`
	MeanSecondsToAck                float64 `json:"mean_seconds_to_ack,omitempty"`
	ResponderID                     int64   `json:"responder_id,omitempty"`
	ResponderName                   string  `json:"responder_name,omitempty"`
	TeamID                          int64   `json:"team_id,omitempty"`
	TeamName                        string  `json:"team_name,omitempty"`
	TotalEngagedSeconds             int64   `json:"total_engaged_seconds,omitempty"`
	TotalIncidentCnt                int64   `json:"total_incident_cnt,omitempty"`
	TotalIncidentsAcknowledged      int64   `json:"total_incidents_acknowledged,omitempty"`
	TotalIncidentsEscalated         int64   `json:"total_incidents_escalated,omitempty"`
	TotalIncidentsManuallyEscalated int64   `json:"total_incidents_manually_escalated,omitempty"`
	TotalIncidentsReassigned        int64   `json:"total_incidents_reassigned,omitempty"`
	TotalIncidentsTimeoutEscalated  int64   `json:"total_incidents_timeout_escalated,omitempty"`
	TotalInterruptions              int64   `json:"total_interruptions,omitempty"`
	TotalNotifications              int64   `json:"total_notifications,omitempty"`
	TotalSecondsToAck               int64   `json:"total_seconds_to_ack,omitempty"`
	// Aggregation bucket start time, Unix seconds. Present when `aggregate_unit` is used.
	TS int64 `json:"ts,omitempty"`
}

ResponderInsightItem is generated from the Flashduty OpenAPI schema.

type ResponderInsightResponse

type ResponderInsightResponse struct {
	Items []ResponderInsightItem `json:"items,omitempty"`
}

ResponderInsightResponse is generated from the Flashduty OpenAPI schema.

type Response

type Response struct {
	*http.Response

	RequestID      string
	Total          int
	HasNextPage    bool
	SearchAfterCtx string
	RateLimit      RateLimit

	// Raw holds the response body for endpoints that return a non-JSON payload
	// on success (e.g. CSV/file downloads from the *export endpoints). It is nil
	// for normal JSON responses; the typed return value is then the zero value.
	Raw []byte
}

Response wraps http.Response and surfaces Flashduty envelope metadata: the request id (for support), pagination fields when the endpoint returns them, and best-effort rate-limit signals.

type RoleGrantRequest

type RoleGrantRequest struct {
	// Member IDs to grant/revoke the role. Max 100.
	MemberIDs []uint64 `json:"member_ids,omitempty"`
	// Role ID to grant or revoke.
	RoleID uint64 `json:"role_id,omitempty"`
}

RoleGrantRequest is generated from the Flashduty OpenAPI schema.

type RoleIDRequest

type RoleIDRequest struct {
	// Role ID.
	RoleID uint64 `json:"role_id,omitempty"`
}

RoleIDRequest is generated from the Flashduty OpenAPI schema.

type RoleInfoRequest

type RoleInfoRequest struct {
	// Role ID.
	RoleID uint64 `json:"role_id,omitempty"`
}

RoleInfoRequest is generated from the Flashduty OpenAPI schema.

type RoleItem

type RoleItem struct {
	// Unix epoch seconds the role was created.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Role description.
	Description string `json:"description,omitempty"`
	// False for built-in roles which cannot be modified.
	Editable bool `json:"editable,omitempty"`
	// IDs of permissions granted by this role.
	PermissionIDs []uint64 `json:"permission_ids,omitempty"`
	// Unique role ID.
	RoleID uint64 `json:"role_id,omitempty"`
	// Role display name.
	RoleName string `json:"role_name,omitempty"`
	// Role status.
	Status string `json:"status,omitempty"`
	// Unix epoch seconds the role was last updated.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

RoleItem is generated from the Flashduty OpenAPI schema.

type RoleListRequest

type RoleListRequest struct {
	// Ascending sort order.
	Asc bool `json:"asc,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
}

RoleListRequest is generated from the Flashduty OpenAPI schema.

type RoleListResponse

type RoleListResponse struct {
	Items []RoleItem `json:"items,omitempty"`
	// Total role count.
	Total int64 `json:"total,omitempty"`
}

RoleListResponse is generated from the Flashduty OpenAPI schema.

type RolePermissionListRequest

type RolePermissionListRequest struct {
	// Filter to permissions granted to these roles.
	RoleIDs []uint64 `json:"role_ids,omitempty"`
	// If true, return all permissions with is_granted set to indicate which are granted.
	WithAll bool `json:"with_all,omitempty"`
}

RolePermissionListRequest is generated from the Flashduty OpenAPI schema.

type RolePermissionListResponse

type RolePermissionListResponse struct {
	Items []PermissionItem `json:"items,omitempty"`
}

RolePermissionListResponse is generated from the Flashduty OpenAPI schema.

type RoleUpsertRequest

type RoleUpsertRequest struct {
	// Role description.
	Description string `json:"description,omitempty"`
	// Permission IDs to grant. Replaces the existing set.
	PermissionIDs []uint64 `json:"permission_ids,omitempty"`
	// Role ID. Omit or set to 0 to create.
	RoleID uint64 `json:"role_id,omitempty"`
	// Role display name. 1–39 characters.
	RoleName string `json:"role_name,omitempty"`
}

RoleUpsertRequest is generated from the Flashduty OpenAPI schema.

type RoleUpsertResponse

type RoleUpsertResponse struct {
	// Created or updated role ID.
	RoleID uint64 `json:"role_id,omitempty"`
	// Role name echoed from the request.
	RoleName string `json:"role_name,omitempty"`
}

RoleUpsertResponse is generated from the Flashduty OpenAPI schema.

type RolesPermissionsService

type RolesPermissionsService service

RolesPermissionsService handles the "Platform/Roles & permissions" API resource.

func (*RolesPermissionsService) ReadInfo

Get role detail.

Return the detail of a single role by its ID.

API: POST /role/info (role-read-info).

func (*RolesPermissionsService) ReadList

List roles.

Return all custom and built-in roles for the current account.

API: POST /role/list (role-read-list).

func (*RolesPermissionsService) ReadListPermission

List permissions.

Return all available permissions, optionally filtered to those granted to specific roles.

API: POST /role/permission/list (role-read-list-permission).

func (*RolesPermissionsService) ReadListPermissionFactor

List permission factors.

Return all permission factors (API, button, menu, URL, visit) optionally filtered by type.

API: POST /role/permission/factor/list (role-read-list-permission-factor).

func (*RolesPermissionsService) WriteDelete

func (s *RolesPermissionsService) WriteDelete(ctx context.Context, req *RoleIDRequest) (*Response, error)

Delete a role.

Permanently delete a custom role and revoke it from all members.

API: POST /role/delete (role-write-delete).

func (*RolesPermissionsService) WriteDisable

func (s *RolesPermissionsService) WriteDisable(ctx context.Context, req *RoleIDRequest) (*Response, error)

Disable a role.

Disable a custom role to prevent it from granting permissions.

API: POST /role/disable (role-write-disable).

func (*RolesPermissionsService) WriteEnable

func (s *RolesPermissionsService) WriteEnable(ctx context.Context, req *RoleIDRequest) (*Response, error)

Enable a role.

Re-enable a previously disabled custom role.

API: POST /role/enable (role-write-enable).

func (*RolesPermissionsService) WriteGrantRole

func (s *RolesPermissionsService) WriteGrantRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)

Grant role to members.

Assign a role to one or more members, giving them its permissions.

API: POST /role/member/grant (role-write-grant-role).

func (*RolesPermissionsService) WriteRevokeRole

func (s *RolesPermissionsService) WriteRevokeRole(ctx context.Context, req *RoleGrantRequest) (*Response, error)

Revoke role from members.

Remove a role from one or more members, revoking the permissions it granted.

API: POST /role/member/revoke (role-write-revoke-role).

func (*RolesPermissionsService) WriteUpsert

Create or update a role.

Create a new custom role or update an existing one. Pass `role_id` to update.

API: POST /role/upsert (role-write-upsert).

type RouteCase

type RouteCase struct {
	// Target channel IDs. Required when `routing_mode` is `standard` (or empty).
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
	// If `true`, evaluation continues to the next case after this one matches; otherwise matching stops at the first hit.
	Fallthrough bool `json:"fallthrough,omitempty"`
	// List of match conditions that are AND-ed together.
	If []RouteMatchCondition `json:"if,omitempty"`
	// Label key whose value is used as the target channel name. Required when `routing_mode` is `name_mapping`.
	NameMappingLabel string `json:"name_mapping_label,omitempty"`
	// Routing mode. `standard` (default, also used when left empty) routes to the fixed channel IDs; `name_mapping` resolves channels by reading a label value from the alert event.
	RoutingMode string `json:"routing_mode,omitempty"`
}

RouteCase is generated from the Flashduty OpenAPI schema.

type RouteDefault

type RouteDefault struct {
	// Channel IDs to fall back to.
	ChannelIDs []int64 `json:"channel_ids,omitempty"`
}

RouteDefault is generated from the Flashduty OpenAPI schema.

type RouteInfoRequest

type RouteInfoRequest struct {
	// Integration ID. Must be greater than 0.
	IntegrationID int64 `json:"integration_id,omitempty"`
}

RouteInfoRequest is generated from the Flashduty OpenAPI schema.

type RouteItem

type RouteItem struct {
	// Ordered list of case branches.
	Cases []RouteCase `json:"cases,omitempty"`
	// Creation time, Unix timestamp in seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// ID of the person who created the rule.
	CreatorID int64        `json:"creator_id,omitempty"`
	Default   RouteDefault `json:"default,omitempty"`
	// Soft-delete timestamp, Unix seconds. Omitted when the rule is active.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Integration the rule belongs to.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Optional sections that visually group cases.
	Sections []RouteSection `json:"sections,omitempty"`
	// Rule status.
	Status string `json:"status,omitempty"`
	// Last update time, Unix timestamp in seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// ID of the person who performed the last update.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// Monotonic version number, incremented on each update. Use it for optimistic concurrency control.
	Version int64 `json:"version,omitempty"`
}

RouteItem is generated from the Flashduty OpenAPI schema.

type RouteMatchCondition

type RouteMatchCondition struct {
	// Field key to match against the alert event (e.g. `alert_severity`, `labels.service`).
	Key string `json:"key,omitempty"`
	// Match operator. `IN` matches when the field value is one of `vals`; `NOTIN` matches when it is not.
	Oper string `json:"oper,omitempty"`
	// Values to compare against. Each value may be a literal string, a wildcard (`*`, `?`), a regular expression wrapped in slashes (`/pattern/`), a CIDR (`cidr:10.0.0.0/8`), or a numeric comparison (`num:lt:100`).
	Vals []string `json:"vals,omitempty"`
}

RouteMatchCondition is generated from the Flashduty OpenAPI schema.

type RouteSection

type RouteSection struct {
	// Section name. Must be unique within the rule.
	Name string `json:"name,omitempty"`
	// Index in `cases` where this section starts. Must be between 0 and the length of `cases`.
	Position int64 `json:"position,omitempty"`
}

RouteSection is generated from the Flashduty OpenAPI schema.

type RuleAuditListResponse

type RuleAuditListResponse []AlertRuleAudit

RuleAuditListResponse is a list response payload.

type RuleBasicListResponse

type RuleBasicListResponse []AlertRuleBasic

RuleBasicListResponse is a list response payload.

type RuleConfigs

type RuleConfigs struct {
	// Any-data check configuration. Fires when the query returns any data rows.
	CheckAnydata RuleConfigsCheckAnydata `json:"check_anydata,omitempty"`
	// No-data check configuration.
	CheckNodata RuleConfigsCheckNodata `json:"check_nodata,omitempty"`
	// Threshold check configuration.
	CheckThreshold RuleConfigsCheckThreshold `json:"check_threshold,omitempty"`
	Queries        []RuleConfigsQueriesItem  `json:"queries,omitempty"`
	// Optional auxiliary queries whose results are attached to alert events as context. Each entry must have a unique `name` (not duplicating any query name) and a non-empty `expr`.
	RelateQueries []RuleConfigsRelateQueriesItem `json:"relate_queries,omitempty"`
}

RuleConfigs is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckAnydata

type RuleConfigsCheckAnydata struct {
	AlertingCheckTimes int64 `json:"alerting_check_times,omitempty"`
	Enabled            bool  `json:"enabled,omitempty"`
	PushRecoveryEvent  bool  `json:"push_recovery_event,omitempty"`
	// Recovery condition for any-data check. If omitted or `mode` is empty, treated as `nodata`.
	Recovery           RuleConfigsCheckAnydataRecovery `json:"recovery,omitempty"`
	RecoveryCheckTimes int64                           `json:"recovery_check_times,omitempty"`
	Severity           string                          `json:"severity,omitempty"`
}

RuleConfigsCheckAnydata is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckAnydataRecovery

type RuleConfigsCheckAnydataRecovery struct {
	Args map[string]string `json:"args,omitempty"`
	// Recovery expression. Required when `mode` is `ql`.
	Condition string `json:"condition,omitempty"`
	// `nodata` = recover when the query returns no data; `ql` = recover when the `condition` expression evaluates to true. When `mode` is `ql`, only a single query (`name=A`) is permitted.
	Mode string `json:"mode,omitempty"`
}

RuleConfigsCheckAnydataRecovery is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckNodata

type RuleConfigsCheckNodata struct {
	AlertingCheckTimes int64 `json:"alerting_check_times,omitempty"`
	Enabled            bool  `json:"enabled,omitempty"`
	PushRecoveryEvent  bool  `json:"push_recovery_event,omitempty"`
	RecoveryCheckTimes int64 `json:"recovery_check_times,omitempty"`
	// Auto-resolve after N seconds.
	ResolveTimeout int64  `json:"resolve_timeout,omitempty"`
	Severity       string `json:"severity,omitempty"`
}

RuleConfigsCheckNodata is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckThreshold

type RuleConfigsCheckThreshold struct {
	AlertingCheckTimes int64                             `json:"alerting_check_times,omitempty"`
	Critical           string                            `json:"critical,omitempty"`
	Enabled            bool                              `json:"enabled,omitempty"`
	Info               string                            `json:"info,omitempty"`
	PushRecoveryEvent  bool                              `json:"push_recovery_event,omitempty"`
	Recovery           RuleConfigsCheckThresholdRecovery `json:"recovery,omitempty"`
	RecoveryCheckTimes int64                             `json:"recovery_check_times,omitempty"`
	Warning            string                            `json:"warning,omitempty"`
}

RuleConfigsCheckThreshold is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckThresholdRecovery

type RuleConfigsCheckThresholdRecovery struct {
	Condition string `json:"condition,omitempty"`
	Mode      string `json:"mode,omitempty"`
}

RuleConfigsCheckThresholdRecovery is generated from the Flashduty OpenAPI schema.

type RuleConfigsQueriesItem

type RuleConfigsQueriesItem struct {
	Args map[string]string `json:"args,omitempty"`
	// Query expression.
	Expr        string   `json:"expr,omitempty"`
	LabelFields []string `json:"label_fields,omitempty"`
	// Query identifier (letter, e.g. `A`). The name `R` is reserved and must not be used.
	Name        string   `json:"name,omitempty"`
	ValueFields []string `json:"value_fields,omitempty"`
}

RuleConfigsQueriesItem is generated from the Flashduty OpenAPI schema.

type RuleConfigsRelateQueriesItem

type RuleConfigsRelateQueriesItem struct {
	Args map[string]string `json:"args,omitempty"`
	// Query expression.
	Expr string `json:"expr,omitempty"`
	// Relate-query identifier.
	Name string `json:"name,omitempty"`
}

RuleConfigsRelateQueriesItem is generated from the Flashduty OpenAPI schema.

type RuleCounterChannelResponse

type RuleCounterChannelResponse map[string]int64

RuleCounterChannelResponse is a map response payload.

type RuleCounterNodeResponse

type RuleCounterNodeResponse map[string]int64

RuleCounterNodeResponse is a map response payload.

type RuleCounterTotalResponse

type RuleCounterTotalResponse []AlertRuleCounter

RuleCounterTotalResponse is a list response payload.

type RuleCreateResponse

type RuleCreateResponse struct {
	// Newly created rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name echoed back from the request.
	RuleName string `json:"rule_name,omitempty"`
}

RuleCreateResponse is generated from the Flashduty OpenAPI schema.

type RuleDsTypesResponse

type RuleDsTypesResponse []DsType

RuleDsTypesResponse is a list response payload.

type RuleEmptyRequest

type RuleEmptyRequest struct{}

RuleEmptyRequest is generated from the Flashduty OpenAPI schema.

type RuleEmptyResponse

type RuleEmptyResponse struct{}

RuleEmptyResponse is generated from the Flashduty OpenAPI schema.

type RuleFieldsUpdateRequest

type RuleFieldsUpdateRequest struct {
	Annotations     map[string]string `json:"annotations,omitempty"`
	ChannelIDs      []uint64          `json:"channel_ids,omitempty"`
	CronPattern     string            `json:"cron_pattern,omitempty"`
	DebugLogEnabled bool              `json:"debug_log_enabled,omitempty"`
	DelaySeconds    int64             `json:"delay_seconds,omitempty"`
	Description     string            `json:"description,omitempty"`
	DsIDs           []uint64          `json:"ds_ids,omitempty"`
	DsList          []string          `json:"ds_list,omitempty"`
	DsType          string            `json:"ds_type,omitempty"`
	Enabled         bool              `json:"enabled,omitempty"`
	EnabledTimes    []EnabledTime     `json:"enabled_times,omitempty"`
	// Field names to update.
	Fields []string `json:"fields,omitempty"`
	// Rule IDs to update.
	IDs            []uint64          `json:"ids,omitempty"`
	Labels         map[string]string `json:"labels,omitempty"`
	RepeatInterval int64             `json:"repeat_interval,omitempty"`
	RepeatTotal    int64             `json:"repeat_total,omitempty"`
}

RuleFieldsUpdateRequest is generated from the Flashduty OpenAPI schema.

type RuleFolderIDRequest

type RuleFolderIDRequest struct {
	// Folder ID. 0 for all.
	FolderID uint64 `json:"folder_id,omitempty"`
}

RuleFolderIDRequest is generated from the Flashduty OpenAPI schema.

type RuleIDRequest

type RuleIDRequest struct {
	// Rule ID.
	ID uint64 `json:"id,omitempty"`
}

RuleIDRequest is generated from the Flashduty OpenAPI schema.

type RuleIDsRequest

type RuleIDsRequest struct {
	// Rule IDs.
	IDs []uint64 `json:"ids,omitempty"`
}

RuleIDsRequest is generated from the Flashduty OpenAPI schema.

type RuleImportRequest

type RuleImportRequest []AlertRule

RuleImportRequest is a list response payload.

type RuleImportResponse

type RuleImportResponse []NameMessage

RuleImportResponse is a list response payload.

type RuleListRequest

type RuleListRequest struct {
	// Folder ID. 0 to list all accessible rules.
	FolderID uint64 `json:"folder_id,omitempty"`
}

RuleListRequest is generated from the Flashduty OpenAPI schema.

type RuleMoveRequest

type RuleMoveRequest struct {
	// Destination folder ID.
	DestFolderID uint64 `json:"dest_folder_id,omitempty"`
	// Rule IDs to move.
	IDs []uint64 `json:"ids,omitempty"`
}

RuleMoveRequest is generated from the Flashduty OpenAPI schema.

type RuleNameMessageListResponse

type RuleNameMessageListResponse []NameMessage

RuleNameMessageListResponse is a list response payload.

type RuleSetsService

type RuleSetsService service

RuleSetsService handles the "Monitors/Rule sets" API resource.

func (*RuleSetsService) Create

Create ruleset.

Create a new ruleset in the rule repository.

API: POST /monit/store/ruleset/create (monit-store-ruleset-create).

func (*RuleSetsService) Delete

func (s *RuleSetsService) Delete(ctx context.Context, req *IDRequest) (*Response, error)

Delete ruleset.

Delete a ruleset from the rule repository by ID.

API: POST /monit/store/ruleset/delete (monit-store-ruleset-delete).

func (*RuleSetsService) Info

Get ruleset detail.

Retrieve the full details of a ruleset including its `payload` (the alert rule definitions as a JSON string).

API: POST /monit/store/ruleset/info (monit-store-ruleset-info).

func (*RuleSetsService) List

List rulesets.

Return all rulesets for a given datasource type that are accessible to the current user.

API: POST /monit/store/ruleset/list (monit-store-ruleset-list).

func (*RuleSetsService) Update

Update ruleset.

Update the note, sharing flag, and payload of an existing ruleset.

API: POST /monit/store/ruleset/update (monit-store-ruleset-update).

type RuleStatusResponse

type RuleStatusResponse []AlertRuleStatus

RuleStatusResponse is a list response payload.

type SLSLogstoresRequest

type SLSLogstoresRequest struct {
	// SLS datasource ID.
	ID uint64 `json:"id,omitempty"`
	// Pagination offset.
	Offset int64 `json:"offset,omitempty"`
	// SLS project name.
	Project string `json:"project,omitempty"`
	// Page size.
	Size int64 `json:"size,omitempty"`
}

SLSLogstoresRequest is generated from the Flashduty OpenAPI schema.

type SLSLogstoresResponse

type SLSLogstoresResponse []string

SLSLogstoresResponse is a list response payload.

type SLSProjectsRequest

type SLSProjectsRequest struct {
	// SLS datasource ID.
	ID uint64 `json:"id,omitempty"`
	// Pagination offset.
	Offset int64 `json:"offset,omitempty"`
	// Name prefix filter.
	Query string `json:"query,omitempty"`
	// Page size.
	Size int64 `json:"size,omitempty"`
}

SLSProjectsRequest is generated from the Flashduty OpenAPI schema.

type SLSProjectsResponse

type SLSProjectsResponse []string

SLSProjectsResponse is a list response payload.

type ScheduleCalculatedLayer

type ScheduleCalculatedLayer struct {
	// Layer display name.
	LayerName string `json:"layer_name,omitempty"`
	// Layer mode: 0 = common rotation, 1 = override.
	Mode int64 `json:"mode,omitempty"`
	// Layer internal name.
	Name string `json:"name,omitempty"`
	// Computed shifts.
	Schedules []ScheduleCalculatedSchedule `json:"schedules,omitempty"`
}

ScheduleCalculatedLayer is generated from the Flashduty OpenAPI schema.

type ScheduleCalculatedSchedule

type ScheduleCalculatedSchedule struct {
	// Shift end timestamp (Unix seconds).
	End   int64         `json:"end,omitempty"`
	Group ScheduleGroup `json:"group,omitempty"`
	// Index inside the rotation.
	Index int64 `json:"index,omitempty"`
	// Shift start timestamp (Unix seconds).
	Start int64 `json:"start,omitempty"`
}

ScheduleCalculatedSchedule is generated from the Flashduty OpenAPI schema.

type ScheduleDayMask

type ScheduleDayMask struct {
	// Weekday numbers (0 = Sunday) included in the rotation.
	Repeat []int64 `json:"repeat,omitempty"`
}

ScheduleDayMask is generated from the Flashduty OpenAPI schema.

type ScheduleEmptyObject

type ScheduleEmptyObject struct{}

ScheduleEmptyObject is generated from the Flashduty OpenAPI schema.

type ScheduleFixedTimeNotifyInfo

type ScheduleFixedTimeNotifyInfo struct {
	// Notification cycle.
	Cycle string `json:"cycle,omitempty"`
	// Notification start time within the cycle.
	Start string `json:"start,omitempty"`
}

ScheduleFixedTimeNotifyInfo is generated from the Flashduty OpenAPI schema.

type ScheduleGroup

type ScheduleGroup struct {
	// Group end timestamp (Unix seconds).
	End int64 `json:"end,omitempty"`
	// Group display name.
	GroupName string `json:"group_name,omitempty"`
	// Members of this group.
	Members []ScheduleMember `json:"members,omitempty"`
	// Legacy group name.
	Name string `json:"name,omitempty"`
	// Group start timestamp (Unix seconds).
	Start int64 `json:"start,omitempty"`
}

ScheduleGroup is generated from the Flashduty OpenAPI schema.

type ScheduleIDResponse

type ScheduleIDResponse struct {
	// ID of the newly created schedule.
	ScheduleID int64 `json:"schedule_id,omitempty"`
}

ScheduleIDResponse is generated from the Flashduty OpenAPI schema.

type ScheduleIDsBodyRequest

type ScheduleIDsBodyRequest struct {
	// Schedule IDs to operate on.
	ScheduleIDs []int64 `json:"schedule_ids,omitempty"`
}

ScheduleIDsBodyRequest is generated from the Flashduty OpenAPI schema.

type ScheduleIDsRequest

type ScheduleIDsRequest struct {
	// Schedule ID list.
	ScheduleIDs []int64 `json:"schedule_ids,omitempty"`
}

ScheduleIDsRequest is generated from the Flashduty OpenAPI schema.

type ScheduleImNotify

type ScheduleImNotify struct {
	Settings ScheduleImNotifySettings `json:"settings,omitempty"`
	// IM provider type (for example feishu_app, dingtalk_app, wecom_app, teams_app, slack_app).
	Type string `json:"type,omitempty"`
}

ScheduleImNotify is generated from the Flashduty OpenAPI schema.

type ScheduleImNotifySettings

type ScheduleImNotifySettings struct {
	// Channel alias.
	Alias string `json:"alias,omitempty"`
	// Chat IDs.
	ChatIDs []string `json:"chat_ids,omitempty"`
	// Data source ID.
	DataSourceID int64 `json:"data_source_id,omitempty"`
	// Signature secret.
	SignSecret string `json:"sign_secret,omitempty"`
	// Webhook token.
	Token string `json:"token,omitempty"`
	// Verification token.
	VerifyToken string `json:"verify_token,omitempty"`
}

ScheduleImNotifySettings is generated from the Flashduty OpenAPI schema.

type ScheduleInfoRequest

type ScheduleInfoRequest struct {
	// Preview end timestamp (Unix seconds, 10 digits).
	End int64 `json:"end,omitempty"`
	// Schedule ID.
	ScheduleID int64 `json:"schedule_id,omitempty"`
	// Preview start timestamp (Unix seconds, 10 digits).
	Start int64 `json:"start,omitempty"`
}

ScheduleInfoRequest is generated from the Flashduty OpenAPI schema.

type ScheduleItem

type ScheduleItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Creation timestamp (Unix seconds).
	CreateAt int64 `json:"create_at,omitempty"`
	// Creator person ID.
	CreateBy int64 `json:"create_by,omitempty"`
	// Current on-call group, or null when nobody is on-call.
	CurOncall ScheduleOncallGroup `json:"cur_oncall,omitempty"`
	// Schedule description. null when returned from /schedule/preview.
	Description string `json:"description,omitempty"`
	// Disabled flag (0 = enabled, 1 = disabled). Deprecated. null when returned from /schedule/preview.
	Disabled int64 `json:"disabled,omitempty"`
	// Window end (Unix seconds).
	End int64 `json:"end,omitempty"`
	// Field name used by the legacy update-field endpoint.
	Field string `json:"field,omitempty"`
	// Collapsed final schedule across all layers.
	FinalSchedule ScheduleCalculatedLayer `json:"final_schedule,omitempty"`
	// Legacy team/group ID. null when returned from /schedule/preview.
	GroupID int64 `json:"group_id,omitempty"`
	// Schedule ID. null when returned from /schedule/preview.
	ID int64 `json:"id,omitempty"`
	// Alias of schedule_layers returned for compatibility.
	LayerSchedules []ScheduleCalculatedLayer `json:"layer_schedules,omitempty"`
	// Rotation layers defined on the schedule.
	Layers []ScheduleLayer `json:"layers,omitempty"`
	// Schedule name (legacy field; mirrors schedule_name). null when returned from /schedule/preview.
	Name string `json:"name,omitempty"`
	// Next on-call group, or null when unknown.
	NextOncall ScheduleOncallGroup `json:"next_oncall,omitempty"`
	Notify     ScheduleNotify      `json:"notify,omitempty"`
	// Schedule ID.
	ScheduleID int64 `json:"schedule_id,omitempty"`
	// Computed layers for the requested window.
	ScheduleLayers []ScheduleCalculatedLayer `json:"schedule_layers,omitempty"`
	// Schedule display name. null when returned from /schedule/preview.
	ScheduleName string `json:"schedule_name,omitempty"`
	// Window start (Unix seconds).
	Start int64 `json:"start,omitempty"`
	// Legacy status flag. Deprecated. null when returned from /schedule/preview.
	Status int64 `json:"status,omitempty"`
	// Owning team ID. null when returned from /schedule/preview.
	TeamID int64 `json:"team_id,omitempty"`
	// Last update timestamp (Unix seconds).
	UpdateAt int64 `json:"update_at,omitempty"`
	// Last updater person ID.
	UpdateBy int64 `json:"update_by,omitempty"`
}

ScheduleItem is generated from the Flashduty OpenAPI schema.

type ScheduleLayer

type ScheduleLayer struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Creation timestamp (Unix seconds).
	CreateAt int64 `json:"create_at,omitempty"`
	// Creator person ID.
	CreateBy int64 `json:"create_by,omitempty"`
	// Day-of-week mask.
	DayMask ScheduleDayMask `json:"day_mask,omitempty"`
	// When the layer becomes effective (Unix seconds).
	EnableTime int64 `json:"enable_time,omitempty"`
	// When the layer expires (Unix seconds, 0 means never).
	ExpireTime int64 `json:"expire_time,omitempty"`
	// Whether fair rotation is enabled.
	FairRotation bool `json:"fair_rotation,omitempty"`
	// Oncall groups participating in the rotation.
	Groups []ScheduleGroup `json:"groups,omitempty"`
	// Handoff time inside the rotation cycle (seconds).
	HandoffTime int64 `json:"handoff_time,omitempty"`
	// Whether the layer is hidden in the UI (0 = no, 1 = yes).
	Hidden int64 `json:"hidden,omitempty"`
	// Layer end timestamp (Unix seconds). null means open-ended.
	LayerEnd int64 `json:"layer_end,omitempty"`
	// User-facing layer name.
	LayerName string `json:"layer_name,omitempty"`
	// Layer start timestamp (Unix seconds).
	LayerStart int64 `json:"layer_start,omitempty"`
	// Whether continuous masking is enabled.
	MaskContinuousEnabled bool `json:"mask_continuous_enabled,omitempty"`
	// Layer mode: 0 = common rotation, 1 = override.
	Mode int64 `json:"mode,omitempty"`
	// Layer internal name.
	Name string `json:"name,omitempty"`
	// Legacy end offset inside the restriction window (seconds).
	RestrictEnd int64 `json:"restrict_end,omitempty"`
	// Restriction mode: 0 = none, 1 = day, 2 = week.
	RestrictMode int64 `json:"restrict_mode,omitempty"`
	// Restriction windows inside each rotation cycle.
	RestrictPeriods []ScheduleRestrictPeriod `json:"restrict_periods,omitempty"`
	// Legacy start offset inside the restriction window (seconds).
	RestrictStart int64 `json:"restrict_start,omitempty"`
	// Rotation duration in seconds.
	RotationDuration int64 `json:"rotation_duration,omitempty"`
	// Rotation unit.
	RotationUnit string `json:"rotation_unit,omitempty"`
	// Rotation quantity (number of rotation_unit per cycle).
	RotationValue int64 `json:"rotation_value,omitempty"`
	// Parent schedule ID.
	ScheduleID int64 `json:"schedule_id,omitempty"`
	// Last update timestamp (Unix seconds).
	UpdateAt int64 `json:"update_at,omitempty"`
	// Last updater person ID.
	UpdateBy int64 `json:"update_by,omitempty"`
	// Layer weight for ordering.
	Weight int64 `json:"weight,omitempty"`
}

ScheduleLayer is generated from the Flashduty OpenAPI schema.

type ScheduleListRequest

type ScheduleListRequest struct {
	ListOptions
	// Window end timestamp (Unix seconds).
	End int64 `json:"end,omitempty"`
	// Only return schedules created by the current user within their teams.
	IsMyManage bool `json:"is_my_manage,omitempty"`
	// Only return schedules whose owning team the current user belongs to.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Search keyword matched against schedule names.
	Query string `json:"query,omitempty"`
	// When set together with end, computed layer schedules are returned. Span must be less than 45 days.
	Start int64 `json:"start,omitempty"`
	// Filter by team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

ScheduleListRequest is generated from the Flashduty OpenAPI schema.

type ScheduleListResponse

type ScheduleListResponse struct {
	// Schedules on this page.
	Items []ScheduleItem `json:"items,omitempty"`
	// Total number of schedules matching the filters.
	Total int64 `json:"total,omitempty"`
}

ScheduleListResponse is generated from the Flashduty OpenAPI schema.

type ScheduleMember

type ScheduleMember struct {
	// Person IDs in this slot.
	PersonIDs []int64 `json:"person_ids,omitempty"`
	// Oncall role ID.
	RoleID int64 `json:"role_id,omitempty"`
}

ScheduleMember is generated from the Flashduty OpenAPI schema.

type ScheduleNotify

type ScheduleNotify struct {
	// Advance notification lead time (seconds).
	AdvanceInTime int64                       `json:"advance_in_time,omitempty"`
	By            ScheduleNotifyBy            `json:"by,omitempty"`
	FixedTime     ScheduleFixedTimeNotifyInfo `json:"fixed_time,omitempty"`
	// Legacy IM-type to token map.
	Im map[string]string `json:"im,omitempty"`
	// IM webhook notification channels.
	Webhooks []ScheduleImNotify `json:"webhooks,omitempty"`
}

ScheduleNotify is generated from the Flashduty OpenAPI schema.

type ScheduleNotifyBy

type ScheduleNotifyBy struct {
	// Whether to follow each responder's personal notification preference.
	FollowPreference bool `json:"follow_preference,omitempty"`
	// Personal notification channel keys.
	PersonalChannels []string `json:"personal_channels,omitempty"`
}

ScheduleNotifyBy is generated from the Flashduty OpenAPI schema.

type ScheduleOncallGroup

type ScheduleOncallGroup struct {
	// Shift end timestamp (Unix seconds).
	End   int64         `json:"end,omitempty"`
	Group ScheduleGroup `json:"group,omitempty"`
	// Index inside the rotation.
	Index int64 `json:"index,omitempty"`
	// Shift start timestamp (Unix seconds).
	Start int64 `json:"start,omitempty"`
	// Update timestamp (Unix seconds).
	UpdateAt int64 `json:"update_at,omitempty"`
	// Layer weight the shift comes from.
	Weight int64 `json:"weight,omitempty"`
}

ScheduleOncallGroup is generated from the Flashduty OpenAPI schema.

type ScheduleRestrictPeriod

type ScheduleRestrictPeriod struct {
	// End offset inside the rotation cycle.
	RestrictEnd int64 `json:"restrict_end,omitempty"`
	// Start offset inside the rotation cycle.
	RestrictStart int64 `json:"restrict_start,omitempty"`
}

ScheduleRestrictPeriod is generated from the Flashduty OpenAPI schema.

type ScheduleSelfRequest

type ScheduleSelfRequest struct {
	// Window end (Unix seconds, 10 digits). Must be within 30 days of start.
	End int64 `json:"end,omitempty"`
	// Window start (Unix seconds, 10 digits).
	Start int64 `json:"start,omitempty"`
}

ScheduleSelfRequest is generated from the Flashduty OpenAPI schema.

type ScheduleSelfResponse

type ScheduleSelfResponse struct {
	// Schedules assigned to the current user (or matching the requested IDs).
	Items []ScheduleItem `json:"items,omitempty"`
}

ScheduleSelfResponse is generated from the Flashduty OpenAPI schema.

type ScheduleUpsertRequest

type ScheduleUpsertRequest struct {
	// Schedule description. Max 500 characters.
	Description string `json:"description,omitempty"`
	// Preview window end (Unix seconds, 10 digits). Required for /schedule/preview. Max 45 days after start.
	End int64 `json:"end,omitempty"`
	// Rotation layers.
	Layers []ScheduleLayer `json:"layers,omitempty"`
	// Legacy schedule name field. Used when schedule_name is empty.
	Name   string         `json:"name,omitempty"`
	Notify ScheduleNotify `json:"notify,omitempty"`
	// Schedule ID. Required on update.
	ScheduleID int64 `json:"schedule_id,omitempty"`
	// Schedule display name. Max 40 characters.
	ScheduleName string `json:"schedule_name,omitempty"`
	// Preview window start (Unix seconds, 10 digits). Required for /schedule/preview.
	Start int64 `json:"start,omitempty"`
	// Owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
}

ScheduleUpsertRequest is generated from the Flashduty OpenAPI schema.

type SchedulesService

type SchedulesService service

SchedulesService handles the "On-call/Schedules" API resource.

func (*SchedulesService) Create

Create schedule.

Create a new on-call schedule (escalation rule schedule).

API: POST /schedule/create (scheduleCreate).

func (*SchedulesService) Delete

Delete schedules.

Delete one or more on-call schedules by ID.

API: POST /schedule/delete (scheduleDelete).

func (*SchedulesService) Info

Get schedule info.

Return details of an on-call schedule including the computed schedule layers for the requested time window (max 45 days).

API: POST /schedule/info (scheduleInfo).

func (*SchedulesService) Infos

Batch get schedules.

Return details of multiple on-call schedules by their IDs.

API: POST /schedule/infos (scheduleInfos).

func (*SchedulesService) List

List schedules.

Return a paginated list of on-call schedules. When both start and end are provided (max 45 days apart), computed layer schedules are included.

API: POST /schedule/list (scheduleList).

func (*SchedulesService) Preview

Preview schedule.

Preview the coverage generated by a schedule configuration without persisting it. The request accepts the same body as create/update plus a required start/end window (max 45 days).

API: POST /schedule/preview (schedulePreview).

func (*SchedulesService) Self

List my schedules.

Return on-call schedules where the current user is assigned.

API: POST /schedule/self (scheduleSelf).

func (*SchedulesService) Update

Update schedule.

Update an existing on-call schedule. Provide schedule_id to identify the schedule.

API: POST /schedule/update (scheduleUpdate).

type SilenceRuleItem

type SilenceRuleItem struct {
	AccountID   int64       `json:"account_id,omitempty"`
	ChannelID   int64       `json:"channel_id,omitempty"`
	CreatedAt   int64       `json:"created_at,omitempty"`
	DeletedAt   int64       `json:"deleted_at,omitempty"`
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	// Source incident ID when the silence was created from an incident.
	FromIncidentID string `json:"from_incident_id,omitempty"`
	// When true, the silence rule is automatically deleted after its time window expires. Defaults to false.
	IsAutoDelete bool `json:"is_auto_delete,omitempty"`
	// When true, silenced alerts are dropped instead of suppressed into incidents.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty"`
	// Whether the rule is currently in effect.
	IsEffective bool `json:"is_effective,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority   int64          `json:"priority,omitempty"`
	RuleID     string         `json:"rule_id,omitempty"`
	RuleName   string         `json:"rule_name,omitempty"`
	Status     string         `json:"status,omitempty"`
	TimeFilter OnceTimeFilter `json:"time_filter,omitempty"`
	// Recurring time windows.
	TimeFilters []TimeFilter `json:"time_filters,omitempty"`
	UpdatedAt   int64        `json:"updated_at,omitempty"`
	UpdatedBy   int64        `json:"updated_by,omitempty"`
}

SilenceRuleItem is generated from the Flashduty OpenAPI schema.

type SnoozeIncidentRequest

type SnoozeIncidentRequest struct {
	// Incident IDs to snooze. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
	// Duration in minutes. Must be greater than 0 and at most 1440 (24h).
	Minutes int64 `json:"minutes,omitempty"`
}

SnoozeIncidentRequest is generated from the Flashduty OpenAPI schema.

type SourcemapItem

type SourcemapItem struct {
	// Upload timestamp, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Git commit SHA for this build.
	GitCommitSHA string `json:"git_commit_sha,omitempty"`
	// Git repository URL associated with this build.
	GitRepositoryURL string `json:"git_repository_url,omitempty"`
	// Storage key uniquely identifying this sourcemap file.
	Key string `json:"key,omitempty"`
	// Free-form key-value metadata attached to the sourcemap. Shape depends on the upload client; common keys include `git_repository_url` and `git_commit_sha` (though those are also promoted to top-level fields).
	Metadata map[string]any `json:"metadata,omitempty"`
	// Application or service name.
	Service string `json:"service,omitempty"`
	// File size in bytes.
	Size int64 `json:"size,omitempty"`
	// Platform type: `browser`, `android`, or `ios`.
	Type string `json:"type,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Application version string.
	Version string `json:"version,omitempty"`
}

SourcemapItem is generated from the Flashduty OpenAPI schema.

type SourcemapListRequest

type SourcemapListRequest struct {
	ListOptions
	// Sort ascending. Default false (descending).
	Asc bool `json:"asc,omitempty"`
	// Android only. Filter by Gradle plugin build identifier. Max 200 characters.
	BuildID string `json:"build_id,omitempty"`
	// End of upload time range, Unix epoch milliseconds. Maximum window: 365 days.
	EndTime int64 `json:"end_time,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Substring match on the minified URL (browser) or build ID (android). Max 200 characters.
	Query string `json:"query,omitempty"`
	// Filter by service names. Up to 100 values.
	Services []string `json:"services,omitempty"`
	// Start of upload time range, Unix epoch milliseconds. Must be > 0 and before `end_time`.
	StartTime int64 `json:"start_time,omitempty"`
	// Platform type. Defaults to `browser` when omitted.
	Type string `json:"type,omitempty"`
	// iOS only. Filter by dSYM bundle UUID. Max 200 characters.
	Uuid string `json:"uuid,omitempty"`
	// Filter by version strings. Up to 100 values.
	Versions []string `json:"versions,omitempty"`
}

SourcemapListRequest is generated from the Flashduty OpenAPI schema.

type SourcemapListResponse

type SourcemapListResponse struct {
	Items []SourcemapItem `json:"items,omitempty"`
	// Total number of matching records.
	Total int64 `json:"total,omitempty"`
}

SourcemapListResponse is generated from the Flashduty OpenAPI schema.

type SourcemapsService

type SourcemapsService service

SourcemapsService handles the "RUM/Sourcemaps" API resource.

func (*SourcemapsService) List

List sourcemaps.

Return a paginated list of uploaded sourcemap files filtered by platform type, service, and version.

API: POST /sourcemap/list (sourcemap-read-list).

type StatusPageChangeCreateResponse

type StatusPageChangeCreateResponse struct {
	// Newly created event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Event title (echoed from the request).
	ChangeName string `json:"change_name,omitempty"`
}

StatusPageChangeCreateResponse is generated from the Flashduty OpenAPI schema.

type StatusPageChangeItem

type StatusPageChangeItem struct {
	// Components currently affected by this event, with their resulting status.
	AffectedComponents []AffectedStatusPageComponentItem `json:"affected_components,omitempty"`
	// Maintenance only: whether the status advances automatically based on the scheduled window.
	AutoUpdateBySchedule bool `json:"auto_update_by_schedule,omitempty"`
	// Event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Scheduled close time in unix seconds. Set for retrospective and maintenance events.
	CloseAtSeconds int64 `json:"close_at_seconds,omitempty"`
	// Event description (Markdown).
	Description string `json:"description,omitempty"`
	// Whether this event is a retrospective (historical) one.
	IsRetrospective bool `json:"is_retrospective,omitempty"`
	// Linked event IDs (related incidents, deployments, etc.).
	LinkedChangeIDs []string `json:"linked_change_ids,omitempty"`
	// Whether subscribers were notified about this event.
	NotifySubscribers bool `json:"notify_subscribers,omitempty"`
	// Parent status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Member IDs responsible for this event.
	ResponderIDs []int64 `json:"responder_ids,omitempty"`
	// Event start time in unix seconds.
	StartAtSeconds int64 `json:"start_at_seconds,omitempty"`
	// Current event status. Incident statuses: `investigating`/`identified`/`monitoring`/`resolved`. Maintenance statuses: `scheduled`/`ongoing`/`completed`.
	Status string `json:"status,omitempty"`
	// Event title.
	Title string `json:"title,omitempty"`
	// Event type.
	Type string `json:"type,omitempty"`
	// Timeline updates attached to this event, ordered by time.
	Updates []StatusPageChangeUpdateItem `json:"updates,omitempty"`
}

StatusPageChangeItem is generated from the Flashduty OpenAPI schema.

type StatusPageChangeListResponse

type StatusPageChangeListResponse struct {
	Items []StatusPageChangeItem `json:"items,omitempty"`
}

StatusPageChangeListResponse is generated from the Flashduty OpenAPI schema.

type StatusPageChangeTimelineCreateResponse

type StatusPageChangeTimelineCreateResponse struct {
	// Newly created update ID.
	UpdateID string `json:"update_id,omitempty"`
}

StatusPageChangeTimelineCreateResponse is generated from the Flashduty OpenAPI schema.

type StatusPageChangeUpdateItem

type StatusPageChangeUpdateItem struct {
	// Update timestamp in unix seconds.
	AtSeconds int64 `json:"at_seconds,omitempty"`
	// Component status transitions applied by this update.
	ComponentChanges []StatusPageComponentChangeItem `json:"component_changes,omitempty"`
	// Update description (Markdown).
	Description string `json:"description,omitempty"`
	// Event status after this update. Omitted when the update does not change the overall status.
	Status string `json:"status,omitempty"`
	// Update ID.
	UpdateID string `json:"update_id,omitempty"`
}

StatusPageChangeUpdateItem is generated from the Flashduty OpenAPI schema.

type StatusPageComponentChangeItem

type StatusPageComponentChangeItem struct {
	// Component ID.
	ComponentID string `json:"component_id,omitempty"`
	// Component display name. Populated by the backend on read; ignored on write.
	ComponentName string `json:"component_name,omitempty"`
	// New component status. Incidents support `operational`/`degraded`/`partial_outage`/`full_outage`; maintenances support `operational`/`under_maintenance`.
	Status string `json:"status,omitempty"`
}

StatusPageComponentChangeItem is generated from the Flashduty OpenAPI schema.

type StatusPageComponentItem

type StatusPageComponentItem struct {
	// Timestamp when the component was first available, in unix seconds.
	AvailableSinceSeconds int64 `json:"available_since_seconds,omitempty"`
	// Component ID.
	ComponentID string `json:"component_id,omitempty"`
	// Component description.
	Description string `json:"description,omitempty"`
	// When true, the component is hidden entirely from summary endpoints.
	HideAll bool `json:"hide_all,omitempty"`
	// When true, uptime data is hidden from summary responses.
	HideUptime bool `json:"hide_uptime,omitempty"`
	// Component display name.
	Name string `json:"name,omitempty"`
	// Display order within its section.
	OrderID int64 `json:"order_id,omitempty"`
	// Parent section ID.
	SectionID string `json:"section_id,omitempty"`
}

StatusPageComponentItem is generated from the Flashduty OpenAPI schema.

type StatusPageMigrationJob

type StatusPageMigrationJob struct {
	// Owner account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Job creation time, unix seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Terminal error message when `status` is `failed`.
	Error string `json:"error,omitempty"`
	// Migration job ID.
	JobID string `json:"job_id,omitempty"`
	// Current migration phase.
	Phase string `json:"phase,omitempty"`
	// Per-entity progress counters.
	Progress StatusPageMigrationProgress `json:"progress,omitempty"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id,omitempty"`
	// Current job status.
	Status string `json:"status,omitempty"`
	// Flashduty target status page ID. Set once the job produces one, or supplied up front for subscriber migration.
	TargetPageID int64 `json:"target_page_id,omitempty"`
	// Last status update time, unix seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

StatusPageMigrationJob is generated from the Flashduty OpenAPI schema.

type StatusPageMigrationProgress

type StatusPageMigrationProgress struct {
	// Steps completed so far.
	CompletedSteps       int64 `json:"completed_steps,omitempty"`
	ComponentsImported   int64 `json:"components_imported,omitempty"`
	IncidentsImported    int64 `json:"incidents_imported,omitempty"`
	MaintenancesImported int64 `json:"maintenances_imported,omitempty"`
	SectionsImported     int64 `json:"sections_imported,omitempty"`
	SubscribersImported  int64 `json:"subscribers_imported,omitempty"`
	// Number of subscribers skipped (e.g. because they would create duplicates).
	SubscribersSkipped int64 `json:"subscribers_skipped,omitempty"`
	TemplatesImported  int64 `json:"templates_imported,omitempty"`
	// Total steps this job will perform.
	TotalSteps int64 `json:"total_steps,omitempty"`
	// Non-fatal warnings recorded during the job.
	Warnings []string `json:"warnings,omitempty"`
}

StatusPageMigrationProgress is generated from the Flashduty OpenAPI schema.

type StatusPageMigrationStartResponse

type StatusPageMigrationStartResponse struct {
	// Migration job ID. Use this to poll status or request cancellation.
	JobID string `json:"job_id,omitempty"`
}

StatusPageMigrationStartResponse is generated from the Flashduty OpenAPI schema.

type StatusPageSubscriberExportResponse

type StatusPageSubscriberExportResponse string

type StatusPageSubscriberListResponse

type StatusPageSubscriberListResponse struct {
	// Whether there is at least one more page after the current one.
	HasNextPage bool                               `json:"has_next_page,omitempty"`
	Items       []ExportedStatusPageSubscriberItem `json:"items,omitempty"`
	// Total matching subscribers.
	Total int64 `json:"total,omitempty"`
}

StatusPageSubscriberListResponse is generated from the Flashduty OpenAPI schema.

type StatusPagesChangeInfoRequest

type StatusPagesChangeInfoRequest struct {
	// Status page ID.
	PageID int64 `url:"page_id"`
	// Event (change) ID.
	ChangeID int64 `url:"change_id"`
}

StatusPagesChangeInfoRequest holds the query parameters for Get status page event detail.

type StatusPagesChangeListRequest

type StatusPagesChangeListRequest struct {
	// Status page ID.
	PageID int64 `url:"page_id"`
	// Filter events started at or after this unix timestamp (seconds).
	StartAtSeconds int64 `url:"start_at_seconds,omitempty"`
	// Filter events started at or before this unix timestamp (seconds).
	EndAtSeconds int64 `url:"end_at_seconds,omitempty"`
	// Event type filter. Required.
	Type string `url:"type"`
	// Event status filter. Required. Must be a status valid for the given `type` (e.g. `investigating`/`identified`/`monitoring`/`resolved` for incidents; `scheduled`/`ongoing`/`completed` for maintenances).
	Status string `url:"status"`
}

StatusPagesChangeListRequest holds the query parameters for List status page events.

type StatusPagesMigrationStatusRequest

type StatusPagesMigrationStatusRequest struct {
	// Migration job ID returned by `migrate-structure` or `migrate-email-subscribers`.
	JobID string `url:"job_id"`
}

StatusPagesMigrationStatusRequest holds the query parameters for Get migration status.

type StatusPagesService

type StatusPagesService service

StatusPagesService handles the "On-call/Status pages" API resource.

func (*StatusPagesService) ChangeCreate

Create status page event.

Create a new incident or maintenance event on a status page.

API: POST /status-page/change/create (statusPageChangeCreate).

func (*StatusPagesService) ChangeDelete

Delete status page event.

Delete a status page event.

API: POST /status-page/change/delete (statusPageChangeDelete).

func (*StatusPagesService) ChangeInfo

Get status page event detail.

Retrieve details of a specific status page event (incident or maintenance).

API: GET /status-page/change/info (statusPageChangeInfo).

func (*StatusPagesService) ChangeList

List status page events.

List events (incidents and maintenances) for a status page.

API: GET /status-page/change/list (statusPageChangeList).

func (*StatusPagesService) ChangeTimelineCreate

Create event timeline entry.

Add a timeline update to a status page event.

API: POST /status-page/change/timeline/create (statusPageChangeTimelineCreate).

func (*StatusPagesService) ChangeTimelineDelete

Delete event timeline entry.

Delete a timeline entry from a status page event.

API: POST /status-page/change/timeline/delete (statusPageChangeTimelineDelete).

func (*StatusPagesService) ChangeTimelineUpdate

Update event timeline entry.

Update a timeline entry for a status page event.

API: POST /status-page/change/timeline/update (statusPageChangeTimelineUpdate).

func (*StatusPagesService) ChangeUpdate

Update status page event.

Update an existing status page event.

API: POST /status-page/change/update (statusPageChangeUpdate).

func (*StatusPagesService) MigrateEmailSubscribers

Migrate email subscribers.

Start a migration job that imports email subscribers from an Atlassian Statuspage into an existing Flashduty status page.

API: POST /status-page/migrate-email-subscribers (statusPageMigrateEmailSubscribers).

func (*StatusPagesService) MigrateStructure

Migrate status page structure.

Start a migration job that imports the structure and historical events of an Atlassian Statuspage into a new Flashduty status page.

API: POST /status-page/migrate-structure (statusPageMigrateStructure).

func (*StatusPagesService) MigrationCancel

Cancel status page migration.

Cancel an in-progress status page migration job. Only jobs currently in the `running` state can be cancelled.

API: POST /status-page/migration/cancel (statusPageMigrationCancel).

func (*StatusPagesService) MigrationStatus

Get migration status.

Get the current status and progress of a status page migration job.

API: GET /status-page/migration/status (statusPageMigrationStatus).

func (*StatusPagesService) SubscriberExport

Export subscribers.

Export subscribers list for a status page as a CSV attachment. The response is a `text/csv` file with columns: Method, Recipient, Components, Subscribe All, Locale.

API: POST /status-page/subscriber/export (statusPageSubscriberExport).

func (*StatusPagesService) SubscriberImport

Import subscribers.

Bulk import subscribers for a status page.

API: POST /status-page/subscriber/import (statusPageSubscriberImport).

func (*StatusPagesService) SubscriberList

List status page subscribers.

List subscribers who have signed up for status page notifications.

API: GET /status-page/subscriber/list (statusPageSubscriberList).

type StatusPagesSubscriberListRequest

type StatusPagesSubscriberListRequest struct {
	// Status page ID.
	PageID int64 `url:"page_id"`
	// Comma-separated component IDs to filter subscribers by.
	ComponentIDs string `url:"component_ids,omitempty"`
	// Page number (1-based).
	P int64 `url:"p,omitempty"`
	// Page size (1-100).
	Limit int64 `url:"limit,omitempty"`
}

StatusPagesSubscriberListRequest holds the query parameters for List status page subscribers.

type StoreRulesetItem

type StoreRulesetItem struct {
	// Creation timestamp, Unix epoch seconds.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Account ID of the creator.
	CreatorAccountID uint64 `json:"creator_account_id,omitempty"`
	// Member ID of the creator.
	CreatorID uint64 `json:"creator_id,omitempty"`
	// Display name of the creator.
	CreatorName string `json:"creator_name,omitempty"`
	// Ruleset ID.
	ID uint64 `json:"id,omitempty"`
	// Description or title of the ruleset.
	Note string `json:"note,omitempty"`
	// Sharing scope. `0` = private (creator only), `1` = account-shared, `2` = public.
	OpenFlag int64 `json:"open_flag,omitempty"`
	// JSON string containing the alert rule definitions. Omitted in list responses.
	Payload string `json:"payload,omitempty"`
	// Datasource type identifier this ruleset applies to.
	TypeIdent string `json:"type_ident,omitempty"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

StoreRulesetItem is generated from the Flashduty OpenAPI schema.

type StoreRulesetListRequest

type StoreRulesetListRequest struct {
	// Datasource type identifier to filter by, e.g. `prometheus`.
	TypeIdent string `json:"type_ident,omitempty"`
}

StoreRulesetListRequest is generated from the Flashduty OpenAPI schema.

type StoreRulesetListResponse

type StoreRulesetListResponse []StoreRulesetItem

StoreRulesetListResponse is a list response payload.

type StoreRulesetUpdateRequest

type StoreRulesetUpdateRequest struct {
	// Ruleset ID to update.
	ID uint64 `json:"id,omitempty"`
	// New description.
	Note string `json:"note,omitempty"`
	// New sharing scope. `0` = private, `1` = account-shared, `2` = public.
	OpenFlag int64 `json:"open_flag,omitempty"`
	// New JSON string of alert rule definitions.
	Payload string `json:"payload,omitempty"`
}

StoreRulesetUpdateRequest is generated from the Flashduty OpenAPI schema.

type StoreRulesetUpsertRequest

type StoreRulesetUpsertRequest struct {
	// Description or title of the ruleset.
	Note string `json:"note,omitempty"`
	// Sharing scope. `0` = private (creator only), `1` = account-shared, `2` = public. Defaults to `0` if omitted.
	OpenFlag int64 `json:"open_flag,omitempty"`
	// JSON string containing the alert rule definitions.
	Payload string `json:"payload,omitempty"`
	// Datasource type identifier this ruleset applies to, e.g. `prometheus`.
	TypeIdent string `json:"type_ident,omitempty"`
}

StoreRulesetUpsertRequest is generated from the Flashduty OpenAPI schema.

type TargetsListRequest

type TargetsListRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied.
	AccountID int64 `json:"account_id,omitempty"`
	// Opaque pagination cursor from the previous response's `next_cursor`. Omit / pass empty string for the first page. Reset whenever `keyword`, `limit`, or tenant changes.
	Cursor string `json:"cursor,omitempty"`
	// Prefix match against `target_locator`. ASCII only, no whitespace, no `|`, max 256 bytes. Substring search is not supported.
	Keyword string `json:"keyword,omitempty"`
	// Page size. Default 50, max 200.
	Limit int64 `json:"limit,omitempty"`
}

TargetsListRequest is generated from the Flashduty OpenAPI schema.

type TargetsListResponse

type TargetsListResponse struct {
	Items []TargetsListResponseItemsItem `json:"items,omitempty"`
	// Opaque cursor for the next page. Absent / empty means this is the last page.
	NextCursor string `json:"next_cursor,omitempty"`
	// Total matches for the current `(account_id, keyword)` pair, independent of `cursor`.
	Total int64 `json:"total,omitempty"`
}

TargetsListResponse is generated from the Flashduty OpenAPI schema.

type TargetsListResponseItemsItem

type TargetsListResponseItemsItem struct {
	// Most recently observed Agent version.
	AgentVersion string `json:"agent_version,omitempty"`
	// Edge cluster name.
	ClusterName string `json:"cluster_name,omitempty"`
	// Edge instance address (`ip:port`), surfaced for diagnostics.
	EdgeIpport string `json:"edge_ipport,omitempty"`
	// Target kind, e.g. `host`, `mysql`. Filtering by kind is not supported in v1.
	TargetKind string `json:"target_kind,omitempty"`
	// Target identifier; the list is sorted by this field ascending.
	TargetLocator string `json:"target_locator,omitempty"`
	// Last route-projection upsert time, Unix seconds. Treat as 'most recently observed', not a live-online indicator.
	UpdatedAt int64 `json:"updated_at,omitempty"`
}

TargetsListResponseItemsItem is generated from the Flashduty OpenAPI schema.

type TeamBriefItem

type TeamBriefItem struct {
	PersonIDs []uint64 `json:"person_ids,omitempty"`
	TeamID    uint64   `json:"team_id,omitempty"`
	TeamName  string   `json:"team_name,omitempty"`
}

TeamBriefItem is generated from the Flashduty OpenAPI schema.

type TeamDeleteRequest

type TeamDeleteRequest struct {
	// External reference ID.
	RefID string `json:"ref_id,omitempty"`
	// Team ID.
	TeamID uint64 `json:"team_id,omitempty"`
	// Team name.
	TeamName string `json:"team_name,omitempty"`
}

TeamDeleteRequest is generated from the Flashduty OpenAPI schema.

type TeamInfoRequest

type TeamInfoRequest struct {
	// External reference ID.
	RefID string `json:"ref_id,omitempty"`
	// Team ID.
	TeamID uint64 `json:"team_id,omitempty"`
	// Team name.
	TeamName string `json:"team_name,omitempty"`
}

TeamInfoRequest is generated from the Flashduty OpenAPI schema.

type TeamInfosRequest

type TeamInfosRequest struct {
	// List of team IDs to look up. Max 100.
	TeamIDs []uint64 `json:"team_ids,omitempty"`
}

TeamInfosRequest is generated from the Flashduty OpenAPI schema.

type TeamInfosResponse

type TeamInfosResponse struct {
	Items []TeamBriefItem `json:"items,omitempty"`
}

TeamInfosResponse is generated from the Flashduty OpenAPI schema.

type TeamItem

type TeamItem struct {
	// Owning account ID.
	AccountID uint64 `json:"account_id,omitempty"`
	// Unix epoch seconds the team was created.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID of the creator.
	CreatorID uint64 `json:"creator_id,omitempty"`
	// Display name of the creator.
	CreatorName string `json:"creator_name,omitempty"`
	// Free-form description.
	Description string `json:"description,omitempty"`
	// Member IDs of team members.
	PersonIDs []uint64 `json:"person_ids,omitempty"`
	// External reference ID for third-party HR system integration.
	RefID string `json:"ref_id,omitempty"`
	// Team status.
	Status string `json:"status,omitempty"`
	// Unique team ID.
	TeamID uint64 `json:"team_id,omitempty"`
	// Team display name. 1–39 characters, unique per account.
	TeamName string `json:"team_name,omitempty"`
	// Unix epoch seconds the team was last updated.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Member ID of the last editor.
	UpdatedBy uint64 `json:"updated_by,omitempty"`
	// Display name of the last editor.
	UpdatedByName string `json:"updated_by_name,omitempty"`
}

TeamItem is generated from the Flashduty OpenAPI schema.

type TeamListRequest

type TeamListRequest struct {
	ListOptions
	// Ascending sort order.
	Asc bool `json:"asc,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Filter by member ID — return only teams this person belongs to.
	PersonID uint64 `json:"person_id,omitempty"`
	// Substring match on team name.
	Query string `json:"query,omitempty"`
}

TeamListRequest is generated from the Flashduty OpenAPI schema.

type TeamListResponse

type TeamListResponse struct {
	ListOptions
	Items []TeamItem `json:"items,omitempty"`
	// Total number of teams matching the filter.
	Total int64 `json:"total,omitempty"`
}

TeamListResponse is generated from the Flashduty OpenAPI schema.

type TeamUpsertRequest

type TeamUpsertRequest struct {
	// Default country code applied to any `phones` entries that are not in E.164 format.
	CountryCode string `json:"countryCode,omitempty"`
	// Free-form description.
	Description string `json:"description,omitempty"`
	// Email addresses to invite as members.
	Emails []string `json:"emails,omitempty"`
	// Member IDs to set as team members. Replaces the existing member list.
	PersonIDs []uint64 `json:"person_ids,omitempty"`
	// Phone numbers to invite as members.
	Phones []string `json:"phones,omitempty"`
	// External reference ID for HR system integration.
	RefID string `json:"ref_id,omitempty"`
	// If true and a team with the same name already exists, reset its membership to the provided person_ids.
	ResetIfNameExist bool `json:"reset_if_name_exist,omitempty"`
	// Team ID. Omit or set to 0 to create a new team.
	TeamID uint64 `json:"team_id,omitempty"`
	// Team display name. 1–39 characters.
	TeamName string `json:"team_name,omitempty"`
}

TeamUpsertRequest is generated from the Flashduty OpenAPI schema.

type TeamUpsertResponse

type TeamUpsertResponse struct {
	// Created or updated team ID.
	TeamID uint64 `json:"team_id,omitempty"`
	// Team name echoed from the request.
	TeamName string `json:"team_name,omitempty"`
}

TeamUpsertResponse is generated from the Flashduty OpenAPI schema.

type TeamsService

type TeamsService service

TeamsService handles the "Platform/Teams" API resource.

func (*TeamsService) ReadInfo

func (s *TeamsService) ReadInfo(ctx context.Context, req *TeamInfoRequest) (*TeamItem, *Response, error)

Get team detail.

Return a single team by ID, name, or external reference ID.

API: POST /team/info (team-read-info).

func (*TeamsService) ReadInfos

Batch get teams.

Return basic info for multiple teams by their IDs in a single request.

API: POST /team/infos (team-read-infos).

func (*TeamsService) ReadList

List teams.

Return a paginated list of teams in the current account.

API: POST /team/list (team-read-list).

func (*TeamsService) WriteDelete

func (s *TeamsService) WriteDelete(ctx context.Context, req *TeamDeleteRequest) (*Response, error)

Delete a team.

Permanently delete a team by ID, name, or external reference ID.

API: POST /team/delete (team-write-delete).

func (*TeamsService) WriteUpsert

Create or update a team.

Create a new team or update an existing one. Pass `team_id` to update.

API: POST /team/upsert (team-write-upsert).

type TemplateCreateRequest

type TemplateCreateRequest struct {
	// Free-form description. Up to 500 characters.
	Description string `json:"description,omitempty"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk,omitempty"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app,omitempty"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email,omitempty"`
	// Feishu robot message template source.
	Feishu string `json:"feishu,omitempty"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app,omitempty"`
	// Slack robot message template source.
	Slack string `json:"slack,omitempty"`
	// Slack app message template source.
	SlackApp string `json:"slack_app,omitempty"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms,omitempty"`
	// Team scope. 0 for account-wide.
	TeamID int64 `json:"team_id,omitempty"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app,omitempty"`
	// Telegram bot message template source.
	Telegram string `json:"telegram,omitempty"`
	// Template name, unique per account. 1–39 characters.
	TemplateName string `json:"template_name,omitempty"`
	// Voice call script template source.
	Voice string `json:"voice,omitempty"`
	// WeCom robot message template source.
	Wecom string `json:"wecom,omitempty"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app,omitempty"`
	// Zoom bot message template source.
	Zoom string `json:"zoom,omitempty"`
}

TemplateCreateRequest is generated from the Flashduty OpenAPI schema.

type TemplateCreateResponse

type TemplateCreateResponse struct {
	// Newly created template ID.
	TemplateID string `json:"template_id,omitempty"`
	// Template name echoed from the request.
	TemplateName string `json:"template_name,omitempty"`
}

TemplateCreateResponse is generated from the Flashduty OpenAPI schema.

type TemplateIDRequest

type TemplateIDRequest struct {
	// Target template ID. Pass `000000000000000000000001` to address the built-in preset.
	TemplateID string `json:"template_id,omitempty"`
}

TemplateIDRequest is generated from the Flashduty OpenAPI schema.

type TemplateItem

type TemplateItem struct {
	// ID of the owning account.
	AccountID int64 `json:"account_id,omitempty"`
	// Unix epoch seconds the template was created.
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID of the creator.
	CreatorID int64 `json:"creator_id,omitempty"`
	// Unix epoch seconds the template was soft-deleted. Absent (omitempty) when the template is live.
	DeletedAt int64 `json:"deleted_at,omitempty"`
	// Free-form description.
	Description string `json:"description,omitempty"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk,omitempty"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app,omitempty"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email,omitempty"`
	// Feishu robot message template source.
	Feishu string `json:"feishu,omitempty"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app,omitempty"`
	// Slack robot message template source.
	Slack string `json:"slack,omitempty"`
	// Slack app message template source.
	SlackApp string `json:"slack_app,omitempty"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms,omitempty"`
	// Template lifecycle status.
	Status string `json:"status,omitempty"`
	// ID of the team this template is scoped to, or 0 for account-wide.
	TeamID int64 `json:"team_id,omitempty"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app,omitempty"`
	// Telegram bot message template source.
	Telegram string `json:"telegram,omitempty"`
	// Template ID.
	TemplateID string `json:"template_id,omitempty"`
	// Unique template name within the account.
	TemplateName string `json:"template_name,omitempty"`
	// Unix epoch seconds the template was last updated.
	UpdatedAt int64 `json:"updated_at,omitempty"`
	// Member ID of the last editor.
	UpdatedBy int64 `json:"updated_by,omitempty"`
	// Voice call script template source.
	Voice string `json:"voice,omitempty"`
	// WeCom robot message template source.
	Wecom string `json:"wecom,omitempty"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app,omitempty"`
	// Zoom bot message template source.
	Zoom string `json:"zoom,omitempty"`
}

TemplateItem is generated from the Flashduty OpenAPI schema.

type TemplateListRequest

type TemplateListRequest struct {
	ListOptions
	// Ascending sort order.
	Asc bool `json:"asc,omitempty"`
	// Filter by creator member ID.
	CreatorID int64 `json:"creator_id,omitempty"`
	// When true, only return templates scoped to teams the caller belongs to.
	IsMyTeam bool `json:"is_my_team,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty"`
	// Regex or substring match on template_name.
	Query string `json:"query,omitempty"`
	// Filter by specific team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty"`
}

TemplateListRequest is generated from the Flashduty OpenAPI schema.

type TemplateListResponse

type TemplateListResponse struct {
	// True if another page exists after the returned one.
	HasNextPage bool           `json:"has_next_page,omitempty"`
	Items       []TemplateItem `json:"items,omitempty"`
	// Total number of templates matching the filter, across all pages.
	Total int64 `json:"total,omitempty"`
}

TemplateListResponse is generated from the Flashduty OpenAPI schema.

type TemplateUpdateRequest

type TemplateUpdateRequest struct {
	// Free-form description. Up to 500 characters.
	Description string `json:"description,omitempty"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk,omitempty"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app,omitempty"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email,omitempty"`
	// Feishu robot message template source.
	Feishu string `json:"feishu,omitempty"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app,omitempty"`
	// Slack robot message template source.
	Slack string `json:"slack,omitempty"`
	// Slack app message template source.
	SlackApp string `json:"slack_app,omitempty"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms,omitempty"`
	// Team scope. 0 for account-wide.
	TeamID int64 `json:"team_id,omitempty"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app,omitempty"`
	// Telegram bot message template source.
	Telegram string `json:"telegram,omitempty"`
	// Target template ID.
	TemplateID string `json:"template_id,omitempty"`
	// Template name. 1–39 characters.
	TemplateName string `json:"template_name,omitempty"`
	// Voice call script template source.
	Voice string `json:"voice,omitempty"`
	// WeCom robot message template source.
	Wecom string `json:"wecom,omitempty"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app,omitempty"`
	// Zoom bot message template source.
	Zoom string `json:"zoom,omitempty"`
}

TemplateUpdateRequest is generated from the Flashduty OpenAPI schema.

type TimeFilter

type TimeFilter struct {
	// Optional calendar ID; restricts the window to days matching the calendar.
	CalID string `json:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty"`
}

TimeFilter is generated from the Flashduty OpenAPI schema.

type ToolCatalogRequest

type ToolCatalogRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied.
	AccountID int64 `json:"account_id,omitempty"`
	// When true, each tool entry includes its `output_shape` JSON Schema. Defaults to false to keep responses small for LLM consumption.
	IncludeOutputShape bool `json:"include_output_shape,omitempty"`
	// Optional target kind. When omitted webapi auto-infers across currently known kinds. Built-in kinds: `host`, `mysql`. Required on retry when the previous call returned `ambiguous_target_kind`.
	TargetKind string `json:"target_kind,omitempty"`
	// Target identifier (host name, MySQL address, …). Max 256 bytes; no whitespace, control characters, or `|`.
	TargetLocator string `json:"target_locator,omitempty"`
}

ToolCatalogRequest is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponse

type ToolCatalogResponse struct {
	// Business error. `null` on success.
	Error ToolCatalogResponseError `json:"error,omitempty"`
	// Resolved target. `null` when locator could not be uniquely resolved.
	Target ToolCatalogResponseTarget `json:"target,omitempty"`
	// Tool catalog entries. Empty when `error` is non-null.
	Tools []ToolCatalogResponseToolsItem `json:"tools,omitempty"`
}

ToolCatalogResponse is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponseError

type ToolCatalogResponseError struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
	// Returned for `ambiguous_target_kind`; lists the candidate kinds.
	TargetKinds []string `json:"target_kinds,omitempty"`
}

ToolCatalogResponseError is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponseTarget

type ToolCatalogResponseTarget struct {
	Kind    string `json:"kind,omitempty"`
	Locator string `json:"locator,omitempty"`
}

ToolCatalogResponseTarget is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponseToolsItem

type ToolCatalogResponseToolsItem struct {
	// Tool capability description for UI / AI-SRE consumption.
	Description string `json:"description,omitempty"`
	// JSON Schema for `tools[].params`.
	InputSchema map[string]any `json:"input_schema,omitempty"`
	// Tool name; pass into `/monit/tools/invoke` as `tools[].tool`.
	Name string `json:"name,omitempty"`
	// Optional output JSON Schema; only returned when `include_output_shape=true`.
	OutputShape map[string]any `json:"output_shape,omitempty"`
	// Target kind this tool applies to.
	TargetKind string `json:"target_kind,omitempty"`
}

ToolCatalogResponseToolsItem is generated from the Flashduty OpenAPI schema.

type ToolInvokeRequest

type ToolInvokeRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied.
	AccountID int64 `json:"account_id,omitempty"`
	// Optional target kind; auto-inferred when omitted.
	TargetKind string `json:"target_kind,omitempty"`
	// Target identifier. Same validation rules as `/monit/tools/catalog`.
	TargetLocator string `json:"target_locator,omitempty"`
	// Up to 8 tool calls; webapi executes them concurrently and returns results in input order.
	Tools []ToolInvokeRequestToolsItem `json:"tools,omitempty"`
}

ToolInvokeRequest is generated from the Flashduty OpenAPI schema.

type ToolInvokeRequestToolsItem

type ToolInvokeRequestToolsItem struct {
	// Tool parameters matching the catalog `input_schema`. For no-arg tools pass `{}` explicitly.
	Params map[string]any `json:"params,omitempty"`
	// Tool name, typically from `/monit/tools/catalog`.
	Tool string `json:"tool,omitempty"`
}

ToolInvokeRequestToolsItem is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponse

type ToolInvokeResponse struct {
	// Request-level business error. `null` on success.
	Error ToolInvokeResponseError `json:"error,omitempty"`
	// Per-tool results aligned with the request `tools[]` order. Empty when `error` is non-null.
	Results []ToolInvokeResponseResultsItem `json:"results,omitempty"`
	// Resolved target.
	Target ToolInvokeResponseTarget `json:"target,omitempty"`
}

ToolInvokeResponse is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseError

type ToolInvokeResponseError struct {
	Code        string   `json:"code,omitempty"`
	Message     string   `json:"message,omitempty"`
	TargetKinds []string `json:"target_kinds,omitempty"`
}

ToolInvokeResponseError is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseResultsItem

type ToolInvokeResponseResultsItem struct {
	// Agent-self-reported tool execution time in milliseconds, excludes network. May be 0 when the failure occurred before the agent started executing.
	AgentElapsedMs int64 `json:"agent_elapsed_ms,omitempty"`
	// Successful tool payload — passthrough of monit-agent `ToolResultPayload.data` (typically `data` / `summary` / `truncated`). `null` when the per-tool `error` is set.
	Data map[string]any `json:"data,omitempty"`
	// Webapi-observed end-to-end time in milliseconds (webapi → ws → edge → agent → ws → webapi). A large gap vs `agent_elapsed_ms` indicates network / edge slowness.
	E2eElapsedMs int64 `json:"e2e_elapsed_ms,omitempty"`
	// Per-tool error. Mutually exclusive with `data`.
	Error ToolInvokeResponseResultsItemError `json:"error,omitempty"`
	Tool  string                             `json:"tool,omitempty"`
	// Agent-executed tool version. Empty when execution failed before the agent picked a version.
	ToolVersion string `json:"tool_version,omitempty"`
}

ToolInvokeResponseResultsItem is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseResultsItemError

type ToolInvokeResponseResultsItemError struct {
	// Common values: `timeout`, `target_unavailable`, `edge_unsupported`, `invalid_tool_result`, `internal`, `invalid_args`, `unknown_tool`, `unknown_tool_version`, `unknown_toolset_hash`, `target_not_owned`, `wrong_agent`, `overloaded`, `denied`, `permission_denied`, `credential_unavailable`, `target_unreachable`.
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

ToolInvokeResponseResultsItemError is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseTarget

type ToolInvokeResponseTarget struct {
	Kind    string `json:"kind,omitempty"`
	Locator string `json:"locator,omitempty"`
}

ToolInvokeResponseTarget is generated from the Flashduty OpenAPI schema.

type UnackIncidentRequest

type UnackIncidentRequest struct {
	// Incident IDs to unacknowledge. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

UnackIncidentRequest is generated from the Flashduty OpenAPI schema.

type UnsubscribeRuleItem

type UnsubscribeRuleItem struct {
	AccountID   int64       `json:"account_id,omitempty"`
	ChannelID   int64       `json:"channel_id,omitempty"`
	CreatedAt   int64       `json:"created_at,omitempty"`
	DeletedAt   int64       `json:"deleted_at,omitempty"`
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	Priority    int64       `json:"priority,omitempty"`
	RuleID      string      `json:"rule_id,omitempty"`
	RuleName    string      `json:"rule_name,omitempty"`
	Status      string      `json:"status,omitempty"`
	UpdatedAt   int64       `json:"updated_at,omitempty"`
	UpdatedBy   int64       `json:"updated_by,omitempty"`
}

UnsubscribeRuleItem is generated from the Flashduty OpenAPI schema.

type UpdateChannelRequest

type UpdateChannelRequest struct {
	// Auto-resolve timer reset mode.
	AutoResolveMode string `json:"auto_resolve_mode,omitempty"`
	// Auto-resolve timeout in seconds. 0 disables auto-resolve. Max 30 days.
	AutoResolveTimeout int64 `json:"auto_resolve_timeout,omitempty"`
	// Channel ID to update.
	ChannelID int64 `json:"channel_id,omitempty"`
	// New channel name. 1 to 59 characters.
	ChannelName string `json:"channel_name,omitempty"`
	// New description. Up to 500 characters.
	Description string `json:"description,omitempty"`
	// Disable automatic incident closing.
	DisableAutoClose bool `json:"disable_auto_close,omitempty"`
	// Disable outlier incident detection.
	DisableOutlierDetection bool     `json:"disable_outlier_detection,omitempty"`
	Flapping                Flapping `json:"flapping,omitempty"`
	Group                   Group    `json:"group,omitempty"`
	// Allow external reporters to file incidents into this channel.
	IsExternalReportEnabled bool `json:"is_external_report_enabled,omitempty"`
	// When true, the channel is visible only to its managing teams.
	IsPrivate bool `json:"is_private,omitempty"`
	// Additional teams that can manage the channel. Up to 3 entries.
	ManagingTeamIDs []int64 `json:"managing_team_ids,omitempty"`
	// New owning team ID.
	TeamID int64 `json:"team_id,omitempty"`
}

UpdateChannelRequest is generated from the Flashduty OpenAPI schema.

type UpdateChannelResponse

type UpdateChannelResponse struct {
	// Newly generated token for external reporters. Only returned when `is_external_report_enabled` is set to `true` in the request. Callers should store this value; it cannot be retrieved afterwards.
	ExternalReportToken string `json:"external_report_token,omitempty"`
}

UpdateChannelResponse is generated from the Flashduty OpenAPI schema.

type UpdateDropRuleRequest

type UpdateDropRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Drop rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
}

UpdateDropRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateEscalationRuleRequest

type UpdateEscalationRuleRequest struct {
	// Aggregation window in seconds. 0 disables aggregation.
	AggrWindow int64 `json:"aggr_window,omitempty"`
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	// Escalation levels in order. At least one level is required.
	Layers []EscalateLayer `json:"layers,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Escalation rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty"`
	// Optional recurring time windows during which the rule applies.
	TimeFilters []TimeFilter `json:"time_filters,omitempty"`
}

UpdateEscalationRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateFieldRequest

type UpdateFieldRequest struct {
	// Replacement default value. Type must match the field's existing `field_type`.
	DefaultValue any `json:"default_value,omitempty"`
	// New description.
	Description string `json:"description,omitempty"`
	// New display name. Must remain unique within the account.
	DisplayName string `json:"display_name,omitempty"`
	// Field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id,omitempty"`
	// Replacement options list. Must obey the same per-type rules as create.
	Options []string `json:"options,omitempty"`
}

UpdateFieldRequest is generated from the Flashduty OpenAPI schema.

type UpdateIncidentFieldsRequest

type UpdateIncidentFieldsRequest struct {
	// New description.
	Description string `json:"description,omitempty"`
	// New impact description.
	Impact string `json:"impact,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// New severity.
	IncidentSeverity string `json:"incident_severity,omitempty"`
	// New resolution notes.
	Resolution string `json:"resolution,omitempty"`
	// New root cause analysis.
	RootCause string `json:"root_cause,omitempty"`
	// New incident title.
	Title string `json:"title,omitempty"`
}

UpdateIncidentFieldsRequest is generated from the Flashduty OpenAPI schema.

type UpdateInhibitRuleRequest

type UpdateInhibitRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty"`
	// Label keys used to pair source and target alerts.
	Equals []string `json:"equals,omitempty"`
	// When true, suppressed target alerts are dropped instead of merged.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Inhibit rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName      string      `json:"rule_name,omitempty"`
	SourceFilters FilterGroup `json:"source_filters,omitempty"`
	TargetFilters FilterGroup `json:"target_filters,omitempty"`
}

UpdateInhibitRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateSilenceRuleRequest

type UpdateSilenceRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty"`
	// When true, the silence rule is automatically deleted after its time window expires. Defaults to false.
	IsAutoDelete bool `json:"is_auto_delete,omitempty"`
	// When true, silenced alerts are dropped instead of suppressed into incidents.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty"`
	// Silence rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName   string         `json:"rule_name,omitempty"`
	TimeFilter OnceTimeFilter `json:"time_filter,omitempty"`
	// Recurring time windows. Mutually exclusive with `time_filter`.
	TimeFilters []TimeFilter `json:"time_filters,omitempty"`
}

UpdateSilenceRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateStatusPageChangeRequest

type UpdateStatusPageChangeRequest struct {
	// Target event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// Linked event IDs. Pass the full replacement list.
	LinkedChanges []string `json:"linked_changes,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Member IDs responsible for this event. Pass the full replacement list.
	Responders []int64 `json:"responders,omitempty"`
	// New event title, up to 255 characters. Omit to keep the existing value.
	Title string `json:"title,omitempty"`
}

UpdateStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.

type UpdateStatusPageChangeTimelineRequest

type UpdateStatusPageChangeTimelineRequest struct {
	// New update timestamp in unix seconds.
	AtSeconds int64 `json:"at_seconds,omitempty"`
	// Parent event ID.
	ChangeID int64 `json:"change_id,omitempty"`
	// New update description (Markdown).
	Description string `json:"description,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id,omitempty"`
	// Target timeline update ID.
	UpdateID string `json:"update_id,omitempty"`
}

UpdateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type UpsertRouteRequest

type UpsertRouteRequest struct {
	// Ordered list of case branches. Cases are evaluated top to bottom.
	Cases   []RouteCase  `json:"cases,omitempty"`
	Default RouteDefault `json:"default,omitempty"`
	// Integration the rule belongs to.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Optional sections that group consecutive cases for display.
	Sections []RouteSection `json:"sections,omitempty"`
	// Expected current version for optimistic concurrency control. Pass the value returned by the latest read.
	Version int64 `json:"version,omitempty"`
}

UpsertRouteRequest is generated from the Flashduty OpenAPI schema.

type WakeIncidentRequest

type WakeIncidentRequest struct {
	// Incident IDs to wake. At most 100 per call.
	IncidentIDs []string `json:"incident_ids,omitempty"`
}

WakeIncidentRequest is generated from the Flashduty OpenAPI schema.

type WarRoom

type WarRoom struct {
	// Chat/group ID on the IM side.
	ChatID string `json:"chat_id,omitempty"`
	// Chat/group display name.
	ChatName string `json:"chat_name,omitempty"`
	// Join link for the war room, if provided by the IM.
	ShareLink string `json:"share_link,omitempty"`
}

WarRoom is generated from the Flashduty OpenAPI schema.

type WarRoomItem

type WarRoomItem struct {
	// Account ID.
	AccountID int64 `json:"account_id,omitempty"`
	// Chat/group ID on the IM side.
	ChatID string `json:"chat_id,omitempty"`
	// Creation timestamp (seconds).
	CreatedAt int64 `json:"created_at,omitempty"`
	// Member ID that created the war room.
	CreatedBy int64 `json:"created_by,omitempty"`
	// Associated incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty"`
	// IM integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// IM plugin type (e.g. `feishu`, `dingtalk`, `wecom`, `slack`).
	PluginType string `json:"plugin_type,omitempty"`
	// War room status.
	Status string `json:"status,omitempty"`
}

WarRoomItem is generated from the Flashduty OpenAPI schema.

type WebhookHistoryDetail

type WebhookHistoryDetail struct {
	// Attempt sequence number.
	Attempt int64 `json:"attempt,omitempty"`
	// Channel ID when applicable.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Name of the associated channel, resolved at query time.
	ChannelName string `json:"channel_name,omitempty"`
	// Total elapsed time of the attempt in milliseconds.
	Duration int64 `json:"duration,omitempty"`
	// Destination URL.
	Endpoint string `json:"endpoint,omitempty"`
	// Error message when delivery failed.
	ErrorMessage string `json:"error_message,omitempty"`
	// Event ID.
	EventID string `json:"event_id,omitempty"`
	// Event time as a formatted timestamp string.
	EventTime string `json:"event_time,omitempty"`
	// Event type.
	EventType string `json:"event_type,omitempty"`
	// Integration ID.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Source object ID.
	RefID string `json:"ref_id,omitempty"`
	// Title of the source incident or alert, resolved at query time.
	RefTitle string `json:"ref_title,omitempty"`
	// Outbound request body payload.
	RequestBody string `json:"request_body,omitempty"`
	// Serialized outbound request headers.
	RequestHeaders string `json:"request_headers,omitempty"`
	// Response body.
	ResponseBody string `json:"response_body,omitempty"`
	// Serialized response headers.
	ResponseHeaders string `json:"response_headers,omitempty"`
	// Delivery outcome.
	Status string `json:"status,omitempty"`
	// HTTP status code.
	StatusCode int64 `json:"status_code,omitempty"`
	// Source object kind. `incident` or `alert`.
	WebhookType string `json:"webhook_type,omitempty"`
}

WebhookHistoryDetail is generated from the Flashduty OpenAPI schema.

type WebhookHistoryItem

type WebhookHistoryItem struct {
	// Attempt sequence number.
	Attempt int64 `json:"attempt,omitempty"`
	// Channel ID associated with the event, when applicable.
	ChannelID int64 `json:"channel_id,omitempty"`
	// Total elapsed time of the attempt in milliseconds.
	Duration int64 `json:"duration,omitempty"`
	// Destination URL.
	Endpoint string `json:"endpoint,omitempty"`
	// Error message when delivery failed.
	ErrorMessage string `json:"error_message,omitempty"`
	// Unique event identifier for the delivery attempt.
	EventID string `json:"event_id,omitempty"`
	// Event time as a formatted timestamp string.
	EventTime string `json:"event_time,omitempty"`
	// Event type (e.g. `created`, `acknowledged`, `closed`).
	EventType string `json:"event_type,omitempty"`
	// Integration ID that triggered the webhook.
	IntegrationID int64 `json:"integration_id,omitempty"`
	// Source object ID (incident ID or alert ID).
	RefID string `json:"ref_id,omitempty"`
	// Outbound request body payload.
	RequestBody string `json:"request_body,omitempty"`
	// Serialized outbound request headers.
	RequestHeaders string `json:"request_headers,omitempty"`
	// Response body returned by the destination.
	ResponseBody string `json:"response_body,omitempty"`
	// Serialized response headers from the destination.
	ResponseHeaders string `json:"response_headers,omitempty"`
	// Delivery outcome.
	Status string `json:"status,omitempty"`
	// HTTP status code returned by the destination.
	StatusCode int64 `json:"status_code,omitempty"`
	// Source object kind. `incident` or `alert`.
	WebhookType string `json:"webhook_type,omitempty"`
}

WebhookHistoryItem is generated from the Flashduty OpenAPI schema.

Directories

Path Synopsis
Package e2e contains live end-to-end tests for the Flashduty SDK.
Package e2e contains live end-to-end tests for the Flashduty SDK.
internal
cmd/gen command
Command gen generates the typed Flashduty service layer and models from the vendored OpenAPI specification (openapi/openapi.en.json).
Command gen generates the typed Flashduty service layer and models from the vendored OpenAPI specification (openapi/openapi.en.json).
Package retry provides a safe-by-default retrying http.RoundTripper for the Flashduty SDK, usable as a composable transport middleware.
Package retry provides a safe-by-default retrying http.RoundTripper for the Flashduty SDK, usable as a composable transport middleware.

Jump to

Keyboard shortcuts

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