flashduty

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 14 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 288 Open API operations across 32 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.
  • Human-readable timestamps. Response time fields are typed Timestamp (Unix seconds) or TimestampMilli (milliseconds) instead of bare integers, so JSON, logs, and LLM-facing output read as RFC3339 — while the raw epoch is one call away. Request fields stay plain int64.
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
}
Timestamps

Time fields on responses are Timestamp (Unix seconds) or TimestampMilli (milliseconds). They marshal to an RFC3339 string in the local timezone and unmarshal from either a numeric epoch or an RFC3339 string, so a value round-trips cleanly. The zero value stays the numeric 0 sentinel (never a 1970 date) and is dropped by omitempty.

inc := list.Items[0]
fmt.Println(inc.StartTime)          // 2026-05-30T14:37:11+08:00  (String / fmt / TOON)
b, _ := json.Marshal(inc.StartTime) // "2026-05-30T14:37:11+08:00"
epoch := inc.StartTime.Unix()       // 1779514631  (raw wire value)
t := inc.StartTime.Time()           // time.Time

Request time fields stay plain int64 — the API expects a numeric epoch on the wire (note: most endpoints take seconds, but RUM and webhook-history endpoints take milliseconds).

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 Bool added in v0.5.0

func Bool(v bool) *bool

Bool returns a pointer to v.

func Float64 added in v0.5.0

func Float64(v float64) *float64

Float64 returns a pointer to v.

func Int added in v0.5.0

func Int(v int) *int

Int returns a pointer to v.

func Int64 added in v0.5.0

func Int64(v int64) *int64

Int64 returns a pointer to v.

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.

func NewExportScanner added in v0.5.4

func NewExportScanner(r io.Reader) *bufio.Scanner

NewExportScanner wraps an export stream in a bufio.Scanner configured to read one NDJSON line per Scan, with a buffer large enough for the wide event lines (tool output, llm calls) that the transcript can contain. Each token is one raw JSON line; decode it with DecodeExportLine or json.Unmarshal into ExportLine.

rc, _, err := client.Sessions.Export(ctx, req)
if err != nil { return err }
defer rc.Close()
sc := flashduty.NewExportScanner(rc)
for sc.Scan() {
    line, err := flashduty.DecodeExportLine(sc.Bytes())
    // ... handle line, or write sc.Bytes() straight to a file ...
}
return sc.Err()

func String added in v0.5.0

func String(v string) *string

String returns a pointer to v.

func Uint64 added in v0.5.0

func Uint64(v uint64) *uint64

Uint64 returns a pointer to v.

Types

type A2aAgentCreateRequest added in v0.4.0

type A2aAgentCreateRequest struct {
	// Agent display name.
	AgentName string `json:"agent_name" toon:"agent_name"`
	// Allow non-loopback HTTP OAuth discovery/metadata endpoints for this agent instead of requiring HTTPS. Defaults to false.
	AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
	// Skip TLS certificate verification when connecting to this agent's endpoint (self-signed/private certs). Defaults to false.
	AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
	// Authentication config key-values, e.g. the API key or bearer token. Values for sensitive keys (`api_key`, `token`, `client_secret`) are masked back in responses.
	AuthConfig map[string]string `json:"auth_config,omitempty" toon:"auth_config,omitempty"`
	// Authentication mode: `shared` (default) shares one credential across all users; `per_user_secret` requires `secret_schema.header_name`; `per_user_oauth` runs per-user OAuth.
	AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
	// Authentication type for reaching the remote agent: `none`, `api_key`, or `bearer`.
	AuthType string `json:"auth_type,omitempty" toon:"auth_type,omitempty"`
	// URL of the remote agent card. Must be an absolute `http` or `https` URL with a non-empty host; reachability is enforced by the execution environment, not at creation time.
	CardURL string `json:"card_url" toon:"card_url"`
	// BYOC runner ID. Required when `environment_kind=byoc`; the runner must belong to the account or a team the caller belongs to.
	EnvironmentID string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// Execution environment binding. Omit or send empty for automatic routing; `byoc` pins the agent to a specific runner given by `environment_id`. `cloud` is not accepted — configured A2A agents need a persistent runner, not a disposable cloud sandbox.
	EnvironmentKind string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// Natural-language instructions for the remote agent. Required — a deprecated `description` field is still accepted for legacy clients and, if both are sent, must exactly match `instructions`.
	Instructions string `json:"instructions" toon:"instructions"`
	// JSON-encoded OAuth metadata; populated by the OAuth discovery flow for `per_user_oauth` mode.
	OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
	// JSON-encoded secret schema, e.g. `{"header_name":"X-Api-Key"}`; required when `auth_mode=per_user_secret`.
	SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
	// Whether the remote agent supports streaming.
	Streaming bool `json:"streaming,omitempty" toon:"streaming,omitempty"`
	// Team scope: 0 = account-wide; >0 = team. Creating at account scope requires the owner/admin role; creating into a team requires actual membership in that team.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}

A2aAgentCreateRequest is generated from the Flashduty OpenAPI schema.

type A2aAgentCreateResponse added in v0.4.0

type A2aAgentCreateResponse struct {
	// ID of the newly created agent.
	AgentID string `json:"agent_id" toon:"agent_id"`
}

A2aAgentCreateResponse is generated from the Flashduty OpenAPI schema.

type A2aAgentIDRequest added in v0.4.0

type A2aAgentIDRequest struct {
	// Target agent ID.
	AgentID string `json:"agent_id" toon:"agent_id"`
}

A2aAgentIDRequest is generated from the Flashduty OpenAPI schema.

type A2aAgentItem added in v0.4.0

type A2aAgentItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Agent name resolved from the remote card.
	AgentCardName string `json:"agent_card_name" toon:"agent_card_name"`
	// Skills advertised by the remote card.
	AgentCardSkills []string `json:"agent_card_skills" toon:"agent_card_skills"`
	// Unique A2A agent ID (prefix `a2a_`).
	AgentID string `json:"agent_id" toon:"agent_id"`
	// Agent display name.
	AgentName string `json:"agent_name" toon:"agent_name"`
	// Allow non-loopback HTTP OAuth discovery/metadata endpoints for this agent instead of requiring HTTPS.
	AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http" toon:"allow_insecure_oauth_http"`
	// Skip TLS certificate verification when connecting to this agent's endpoint.
	AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify" toon:"allow_insecure_tls_skip_verify"`
	// Authentication config; sensitive values (`api_key`, `token`, `client_secret`) are masked.
	AuthConfig map[string]string `json:"auth_config" toon:"auth_config"`
	// Authentication mode.
	AuthMode string `json:"auth_mode" toon:"auth_mode"`
	// Authentication type for reaching the remote agent: `none`, `api_key`, or `bearer`.
	AuthType string `json:"auth_type" toon:"auth_type"`
	// Whether the caller may edit this agent.
	CanEdit bool `json:"can_edit" toon:"can_edit"`
	// Card-resolution timeout in seconds. Always 0 today — the API does not yet expose a way to set it.
	CardResolveTimeout int64 `json:"card_resolve_timeout" toon:"card_resolve_timeout"`
	// URL of the remote agent card.
	CardURL string `json:"card_url" toon:"card_url"`
	// Creation time. Unix timestamp in milliseconds.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Member ID that created the agent.
	CreatedBy int64 `json:"created_by" toon:"created_by"`
	// BYOC runner ID. Set only when `environment_kind=byoc`; empty otherwise.
	EnvironmentID string `json:"environment_id" toon:"environment_id"`
	// Execution environment binding. Empty selects automatic routing; `byoc` pins the agent to a specific runner named by `environment_id`.
	EnvironmentKind string `json:"environment_kind" toon:"environment_kind"`
	// Natural-language instructions for the remote agent (formerly named `description`).
	Instructions string `json:"instructions" toon:"instructions"`
	// JSON-encoded OAuth metadata (per_user_oauth mode).
	OauthMetadata string `json:"oauth_metadata" toon:"oauth_metadata"`
	// JSON-encoded secret schema (per_user_secret mode).
	SecretSchema string `json:"secret_schema" toon:"secret_schema"`
	// Agent status.
	Status string `json:"status" toon:"status"`
	// Whether the remote agent supports streaming responses.
	Streaming bool `json:"streaming" toon:"streaming"`
	// Single-task execution timeout in seconds. Always 0 today — the API does not yet expose a way to set it.
	TaskTimeout int64 `json:"task_timeout" toon:"task_timeout"`
	// Team scope: 0 = account-wide; >0 = the owning team.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Last update time. Unix timestamp in milliseconds.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}

A2aAgentItem is generated from the Flashduty OpenAPI schema.

type A2aAgentListRequest added in v0.4.0

type A2aAgentListRequest struct {
	// Include account-scoped (team_id=0) rows. Defaults to true.
	IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
	// Page size.
	Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
	// Row offset for pagination.
	Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
	// Case-insensitive substring search across agent name, instructions, card URL, agent ID, and the resolved card name.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Visibility scope: `all` (account-scope plus the caller's visible teams), `account` (account-scope only), or `team` (team-scoped rows across the caller's visible teams).
	Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
	// Filter to these team IDs; empty = the caller's visible set.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}

A2aAgentListRequest is generated from the Flashduty OpenAPI schema.

type A2aAgentListResponse added in v0.4.0

type A2aAgentListResponse struct {
	// A2A agents on this page.
	Items []A2aAgentItem `json:"items" toon:"items"`
	// Total number of matching agents.
	Total int64 `json:"total" toon:"total"`
}

A2aAgentListResponse is generated from the Flashduty OpenAPI schema.

type A2aAgentUpdateRequest added in v0.4.0

type A2aAgentUpdateRequest struct {
	// Target agent ID.
	AgentID string `json:"agent_id" toon:"agent_id"`
	// New display name. Omit to leave unchanged.
	AgentName *string `json:"agent_name,omitempty" toon:"agent_name,omitempty"`
	// Toggle non-loopback HTTP OAuth discovery for this agent. Omit to leave unchanged.
	AllowInsecureOauthHTTP *bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
	// Toggle TLS certificate verification skipping for this agent. Omit to leave unchanged.
	AllowInsecureTlsSkipVerify *bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
	// Replace the auth config. Omit to leave unchanged. Sending back the masked value (or an empty string) for a sensitive key keeps the stored secret instead of overwriting it.
	AuthConfig map[string]string `json:"auth_config,omitempty" toon:"auth_config,omitempty"`
	// New auth mode: shared, per_user_secret, or per_user_oauth. Changing it always rewrites secret_schema together with it.
	AuthMode *string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
	// New auth type. Omit to leave unchanged.
	AuthType *string `json:"auth_type,omitempty" toon:"auth_type,omitempty"`
	// New card URL. Omit to leave unchanged.
	CardURL *string `json:"card_url,omitempty" toon:"card_url,omitempty"`
	// New BYOC runner ID. Required alongside `environment_kind=byoc`. Omit to leave unchanged.
	EnvironmentID *string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// New execution environment binding: empty for automatic, `byoc` for a specific runner. `cloud` is rejected. Omit to leave unchanged.
	EnvironmentKind *string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// New instructions. Omit to leave unchanged. A deprecated `description` field is also accepted; if both are sent they must match.
	Instructions *string `json:"instructions,omitempty" toon:"instructions,omitempty"`
	// New JSON OAuth metadata. If omitted while auth_mode changes, it is cleared to empty.
	OauthMetadata *string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
	// New JSON secret schema.
	SecretSchema *string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
	// Toggle streaming support. Omit to leave unchanged.
	Streaming *bool `json:"streaming,omitempty" toon:"streaming,omitempty"`
	// Reassign team scope. Omit to leave unchanged. Reassigning requires rights on the destination team; if the team changes without also sending a new environment binding, the existing runner binding must remain selectable by the caller or the update is rejected.
	TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}

A2aAgentUpdateRequest is generated from the Flashduty OpenAPI schema.

type A2aAgentsService added in v0.4.0

type A2aAgentsService service

A2aAgentsService handles the "AI SRE/A2A agents" API resource.

func (*A2aAgentsService) ReadGet added in v0.4.0

Get A2A agent detail.

Get one A2A agent by ID.

API: POST /safari/a2a-agent/get (remote-agent-read-get).

func (*A2aAgentsService) ReadList added in v0.4.0

List A2A agents.

List A2A agents visible to the caller across account and team scopes, with pagination.

API: POST /safari/a2a-agent/list (remote-agent-read-list).

func (*A2aAgentsService) WriteCreate added in v0.4.0

Create A2A agent.

Register a new A2A remote agent from its agent-card URL.

API: POST /safari/a2a-agent/create (remote-agent-write-create).

func (*A2aAgentsService) WriteDelete added in v0.4.0

func (s *A2aAgentsService) WriteDelete(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)

Delete A2A agent.

Soft-delete an A2A agent by ID.

API: POST /safari/a2a-agent/delete (remote-agent-write-delete).

func (*A2aAgentsService) WriteDisable added in v0.4.0

func (s *A2aAgentsService) WriteDisable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)

Disable A2A agent.

Disable an enabled A2A agent.

API: POST /safari/a2a-agent/disable (remote-agent-write-disable).

func (*A2aAgentsService) WriteEnable added in v0.4.0

func (s *A2aAgentsService) WriteEnable(ctx context.Context, req *A2aAgentIDRequest) (*any, *Response, error)

Enable A2A agent.

Enable a disabled A2A agent.

API: POST /safari/a2a-agent/enable (remote-agent-write-enable).

func (*A2aAgentsService) WriteUpdate added in v0.4.0

func (s *A2aAgentsService) WriteUpdate(ctx context.Context, req *A2aAgentUpdateRequest) (*any, *Response, error)

Update A2A agent.

Apply a partial update to an A2A agent. Omit a field to leave it unchanged.

API: POST /safari/a2a-agent/update (remote-agent-write-update).

type AccountInfo added in v0.4.0

type AccountInfo struct {
	// Account identifier.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Account name.
	AccountName string `json:"account_name" toon:"account_name"`
	// Account avatar URL.
	Avatar string `json:"avatar" toon:"avatar"`
	// Calling country code for the contact phone.
	CountryCode string `json:"country_code" toon:"country_code"`
	// Account creation time, Unix timestamp in seconds.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Primary account domain (login subdomain).
	Domain string `json:"domain" toon:"domain"`
	// Account contact email.
	Email string `json:"email" toon:"email"`
	// Additional account domains.
	ExtraDomains []string `json:"extra_domains" toon:"extra_domains"`
	// Account language preference (e.g. zh-CN, en-US).
	Locale string `json:"locale" toon:"locale"`
	// Account identifier on the cloud marketplace platform (present only for marketplace accounts).
	MpAccountID string `json:"mp_account_id" toon:"mp_account_id"`
	// Cloud marketplace platform the account was provisioned from (present only for marketplace accounts).
	MpPlat string `json:"mp_plat" toon:"mp_plat"`
	// Account contact phone, masked for privacy.
	Phone string `json:"phone" toon:"phone"`
	// Account access restrictions (present only when configured).
	Restrictions AccountInfoRestrictions `json:"restrictions" toon:"restrictions"`
	// Account default timezone (IANA name, e.g. Asia/Shanghai).
	TimeZone string `json:"time_zone" toon:"time_zone"`
}

AccountInfo is generated from the Flashduty OpenAPI schema.

type AccountInfoRestrictions added in v0.4.0

type AccountInfoRestrictions struct {
	// Whether subdomains of the allowed email domains are also accepted.
	AllowSubdomain bool `json:"allow_subdomain" toon:"allow_subdomain"`
	// Allowed login email domains.
	EmailDomains []string `json:"email_domains" toon:"email_domains"`
	// Allowed source IP/CIDR whitelist.
	Ips []string `json:"ips" toon:"ips"`
}

AccountInfoRestrictions is generated from the Flashduty OpenAPI schema.

type AccountService added in v0.4.0

type AccountService service

AccountService handles the "Platform/Account" API resource.

func (*AccountService) Info added in v0.4.0

Get account detail.

Return the current account's profile and settings.

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

type AckIncidentRequest

type AckIncidentRequest struct {
	// Custom field values for the acknowledgement form. Allowed keys and values depend on the incident's visible form.
	CustomFields CustomFieldValues `json:"custom_fields,omitempty" toon:"custom_fields,omitempty"`
	// Images attached to the acknowledgement timeline entry.
	Images []IncidentActionImage `json:"images,omitempty" toon:"images,omitempty"`
	// Incident IDs to acknowledge. At most 100 per call.
	IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
	// Form summary recorded as a timeline comment. Accepted only when the acknowledgement form contains a summary element.
	Summary string `json:"summary,omitempty" toon:"summary,omitempty"`
}

AckIncidentRequest is generated from the Flashduty OpenAPI schema.

type AddIncidentResponderRequest

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

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" toon:"follow_preference,omitempty"`
	// Channels to use (e.g. `voice`, `sms`, `email`).
	PersonalChannels []string `json:"personal_channels,omitempty" toon:"personal_channels,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}

AddIncidentResponderRequestNotify is generated from the Flashduty OpenAPI schema.

type AddWarRoomMemberRequest added in v0.4.0

type AddWarRoomMemberRequest struct {
	// Chat ID of the war room within the IM platform.
	ChatID string `json:"chat_id" toon:"chat_id"`
	// IM integration that hosts the war room.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Person IDs to add to the war room.
	MemberIDs []int64 `json:"member_ids" toon:"member_ids"`
}

AddWarRoomMemberRequest is generated from the Flashduty OpenAPI schema.

type AffectedStatusPageComponentItem

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

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" toon:"asc,omitempty"`
	// Filter by channel IDs. Max 100.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// End of search window, Unix epoch seconds.
	EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"`
	// Filter by integration IDs.
	IntegrationIDs []int64 `json:"integration_ids,omitempty" toon:"integration_ids,omitempty"`
	// Filter by integration types (plugin keys).
	IntegrationTypes []string `json:"integration_types,omitempty" toon:"integration_types,omitempty"`
	// Sort field (ES field name).
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Comma-separated severity filter, e.g. `Critical,Warning`.
	Severities string `json:"severities,omitempty" toon:"severities,omitempty"`
	// Start of search window, Unix epoch seconds.
	StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"`
}

AlertEventGlobalListRequest is generated from the Flashduty OpenAPI schema.

type AlertEventGlobalListResponse

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

AlertEventGlobalListResponse is generated from the Flashduty OpenAPI schema.

type AlertEventItem

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

AlertEventItem is generated from the Flashduty OpenAPI schema.

type AlertEventListRequest

type AlertEventListRequest struct {
	ListOptions
	// Alert ID (MongoDB ObjectID).
	AlertID string `json:"alert_id" toon:"alert_id"`
	// When true, return events oldest-first. Defaults to newest-first.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
}

AlertEventListRequest is generated from the Flashduty OpenAPI schema.

type AlertEventListResponse

type AlertEventListResponse struct {
	// Whether another page is available.
	HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
	// Raw alert events in the requested order.
	Items []AlertEventItem `json:"items" toon:"items"`
	// Cursor to pass as `search_after_ctx` for the next page.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total matching event count.
	Total int64 `json:"total" toon:"total"`
}

AlertEventListResponse is generated from the Flashduty OpenAPI schema.

type AlertFeedRequest

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

AlertFeedRequest is generated from the Flashduty OpenAPI schema.

type AlertFeedResponse

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

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"
)

func (AlertFeedType) String added in v0.5.2

func (e AlertFeedType) String() string

String returns the underlying string value, implementing fmt.Stringer.

type AlertImage

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

AlertImage is generated from the Flashduty OpenAPI schema.

type AlertInfo

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

AlertInfo is generated from the Flashduty OpenAPI schema.

type AlertInfoRequest

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

AlertInfoRequest is generated from the Flashduty OpenAPI schema.

type AlertItem

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

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" toon:"alert_ids"`
}

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

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" toon:"has_next_page"`
	Items       []AlertItem `json:"items" toon:"items"`
	// Cursor for the next page.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total matching alerts.
	Total int64 `json:"total" toon:"total"`
}

AlertListResponse is generated from the Flashduty OpenAPI schema.

type AlertMergeRequest

type AlertMergeRequest struct {
	// Alert IDs to merge.
	AlertIDs []string `json:"alert_ids" toon:"alert_ids"`
	// Optional comment on the merge action.
	Comment string `json:"comment,omitempty" toon:"comment,omitempty"`
	// Target incident ID.
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// Optional new owner for the target incident.
	OwnerID int64 `json:"owner_id,omitempty" toon:"owner_id,omitempty"`
	// Optional new title for the target incident.
	Title string `json:"title,omitempty" toon:"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" toon:"if,omitempty"`
	// Rule type.
	Kind string `json:"kind,omitempty" toon:"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" toon:"settings,omitempty"`
}

AlertPipeline is generated from the Flashduty OpenAPI schema.

type AlertPipelineInfoRequest

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

AlertPipelineInfoRequest is generated from the Flashduty OpenAPI schema.

type AlertPipelineItem

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

AlertPipelineItem is generated from the Flashduty OpenAPI schema.

type AlertPipelineListRequest

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

AlertPipelineListRequest is generated from the Flashduty OpenAPI schema.

type AlertPipelineListResponse

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

AlertPipelineListResponse is generated from the Flashduty OpenAPI schema.

type AlertPipelineUpsertRequest

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

AlertPipelineUpsertRequest is generated from the Flashduty OpenAPI schema.

type AlertRule

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

AlertRule is generated from the Flashduty OpenAPI schema.

type AlertRuleAudit

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

AlertRuleAudit is generated from the Flashduty OpenAPI schema.

type AlertRuleBasic

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

AlertRuleBasic is generated from the Flashduty OpenAPI schema.

type AlertRuleCounter

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

AlertRuleCounter is generated from the Flashduty OpenAPI schema.

type AlertRuleEnabledTimesItem

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

AlertRuleEnabledTimesItem is generated from the Flashduty OpenAPI schema.

type AlertRuleExport

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

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" toon:"account_id"`
	Annotations map[string]string `json:"annotations" toon:"annotations"`
	// Channel IDs to send alerts to.
	ChannelIDs  []uint64 `json:"channel_ids" toon:"channel_ids"`
	CreatedAt   int64    `json:"created_at" toon:"created_at"`
	CreatorID   uint64   `json:"creator_id" toon:"creator_id"`
	CreatorName string   `json:"creator_name" toon:"creator_name"`
	// 5-field cron schedule.
	CronPattern     string `json:"cron_pattern" toon:"cron_pattern"`
	DebugLogEnabled bool   `json:"debug_log_enabled" toon:"debug_log_enabled"`
	DelaySeconds    int64  `json:"delay_seconds" toon:"delay_seconds"`
	Description     string `json:"description" toon:"description"`
	// Format for the description. Defaults to `text` when omitted or empty.
	DescriptionType string `json:"description_type" toon:"description_type"`
	// Specific data source IDs.
	DsIDs []uint64 `json:"ds_ids" toon:"ds_ids"`
	// Data source name patterns (supports wildcards).
	DsList []string `json:"ds_list" toon:"ds_list"`
	// Data source type.
	DsType  string `json:"ds_type" toon:"ds_type"`
	Enabled bool   `json:"enabled" toon:"enabled"`
	// Time windows when the rule is active. Defaults to all days from 00:00 to 23:59 when omitted or empty.
	EnabledTimes []AlertRuleInfoResponseEnabledTimesItem `json:"enabled_times" toon:"enabled_times"`
	// Folder the rule belongs to.
	FolderID uint64 `json:"folder_id" toon:"folder_id"`
	ID       uint64 `json:"id" toon:"id"`
	// Custom labels.
	Labels map[string]string `json:"labels" toon:"labels"`
	// Rule name.
	Name string `json:"name" toon:"name"`
	// Notification repeat interval in seconds.
	RepeatInterval int64 `json:"repeat_interval" toon:"repeat_interval"`
	// Max number of repeat notifications.
	RepeatTotal int64       `json:"repeat_total" toon:"repeat_total"`
	RuleConfigs RuleConfigs `json:"rule_configs" toon:"rule_configs"`
	UpdatedAt   int64       `json:"updated_at" toon:"updated_at"`
	UpdaterID   uint64      `json:"updater_id" toon:"updater_id"`
	UpdaterName string      `json:"updater_name" toon:"updater_name"`
}

AlertRuleInfoResponse is generated from the Flashduty OpenAPI schema.

type AlertRuleInfoResponseEnabledTimesItem

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

AlertRuleInfoResponseEnabledTimesItem is generated from the Flashduty OpenAPI schema.

type AlertRuleStatus

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

AlertRuleStatus is generated from the Flashduty OpenAPI schema.

type AlertRulesService

type AlertRulesService service

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

func (*AlertRulesService) ReadAuditDetail

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 raw events for an alert with cursor or page-number pagination.

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. CSV headers and formatted values use the request locale, falling back to the member locale and then the account locale. 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. CSV headers and formatted values use the request locale, falling back to the member locale and then the account locale. 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. CSV headers and formatted values use the request locale, falling back to the member locale and then the account locale. 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. CSV headers and formatted values use the request locale, falling back to the member locale and then the account locale. 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" toon:"equals"`
	// Filter that identifies the source alerts to inhibit.
	SourceFilters OrFilterGroup `json:"source_filters" toon:"source_filters"`
}

ApAlertInhibit is generated from the Flashduty OpenAPI schema.

type ApDescriptionReset

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

ApDescriptionReset is generated from the Flashduty OpenAPI schema.

type ApSeverityReset

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

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" toon:"title"`
}

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) WebhookTest added in v0.5.4

Test application webhook.

Send a sample RUM alert event to verify an application's webhook URL.

API: POST /rum/application/webhook/test (rum-application-webhook-test).

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" toon:"assigned_to"`
	// Single incident ID. Ignored when `incident_ids` is also provided.
	IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
	// Batch incident IDs.
	IncidentIDs []string `json:"incident_ids,omitempty" toon:"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" toon:"assigned_at,omitempty"`
	// Email recipients, used by integrations such as ServiceNow.
	Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) to drive assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty" toon:"escalate_rule_id,omitempty"`
	// Escalation rule display name, filled by the server.
	EscalateRuleName string `json:"escalate_rule_name,omitempty" toon:"escalate_rule_name,omitempty"`
	// Opaque assignment ID generated by the server.
	ID string `json:"id,omitempty" toon:"id,omitempty"`
	// Current level index within the escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty" toon:"layer_idx,omitempty"`
	// Member IDs to assign directly.
	PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
	// Assignment type: `assign` direct assignment, `reassign` reassignment, `escalate` escalation-rule driven, `reopen` automatic reassignment on reopen.
	Type string `json:"type,omitempty" toon:"type,omitempty"`
}

AssignedTo is generated from the Flashduty OpenAPI schema.

type AuditLog

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

AuditLog is generated from the Flashduty OpenAPI schema.

type AuditLogParamsItem

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

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" toon:"items"`
}

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" toon:"name"`
	// Human-readable Chinese label shown in the console.
	NameCn string `json:"name_cn" toon:"name_cn"`
}

AuditOperationTypeItem is generated from the Flashduty OpenAPI schema.

type AuditRecordIDRequest added in v0.5.3

type AuditRecordIDRequest struct {
	// Audit record ID — the `id` of an audit row returned by `POST /monit/rule/audits`, NOT the rule ID. Passing a rule ID returns HTTP 400.
	ID uint64 `json:"id" toon:"id"`
}

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

AuditSearchRequest is generated from the Flashduty OpenAPI schema.

type AuditSearchResponse

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

AuditSearchResponse is generated from the Flashduty OpenAPI schema.

type AutomationFireAPITriggerRequest added in v0.5.4

type AutomationFireAPITriggerRequest struct {
	// Context text passed to this Automation run.
	Text string `json:"text,omitempty" toon:"text,omitempty"`
}

AutomationFireAPITriggerRequest is the payload accepted by an Automation HTTP POST trigger.

type AutomationFireAPITriggerResponse added in v0.5.4

type AutomationFireAPITriggerResponse struct {
	// Result type. The API-trigger success path returns routine_fire.
	Type string `json:"type" toon:"type"`
	// Started session ID returned by the API-trigger success path.
	SessionID string `json:"session_id" toon:"session_id"`
	// Console URL for the started session.
	SessionURL string `json:"session_url" toon:"session_url"`
}

AutomationFireAPITriggerResponse is the result returned by an Automation HTTP POST trigger.

type AutomationRuleCreateRequest added in v0.5.4

type AutomationRuleCreateRequest struct {
	// Run cadence. Supports 4 fields (`hour day month weekday`, minute defaults to 0) and 5 fields (`minute hour day month weekday`). The minute must be one fixed integer; 6-field seconds are not supported. A cron that sets both day-of-month and day-of-week is rejected. The create API currently requires this field even for HTTP-POST-only rules; send a valid cron and set `schedule_trigger_enabled=false`.
	CronExpr string `json:"cron_expr" toon:"cron_expr"`
	// Whether the rule is enabled after creation. Omitted API value is false; Chat/CLI create sends true by default unless the user asks for disabled.
	Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// BYOC Runner ID. Used only when `environment_kind=byoc`.
	EnvironmentID string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// Runtime environment kind. Omit or send an empty value for automatic selection.
	EnvironmentKind string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// Whether to create and enable an HTTP POST trigger. When enabled, the response includes a one-time token.
	HTTPPostTriggerEnabled bool `json:"http_post_trigger_enabled,omitempty" toon:"http_post_trigger_enabled,omitempty"`
	// Rule name.
	Name string `json:"name" toon:"name"`
	// On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID.
	OncallIncidentChannelIDs []int64 `json:"oncall_incident_channel_ids,omitempty" toon:"oncall_incident_channel_ids,omitempty"`
	// Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value.
	OncallIncidentSeverities []string `json:"oncall_incident_severities,omitempty" toon:"oncall_incident_severities,omitempty"`
	// Whether the On-call incident trigger is enabled.
	OncallIncidentTriggerEnabled bool `json:"oncall_incident_trigger_enabled,omitempty" toon:"oncall_incident_trigger_enabled,omitempty"`
	// Task prompt sent to the AI SRE agent on each run.
	Prompt string `json:"prompt" toon:"prompt"`
	// Whether the schedule trigger is enabled. Defaults to true when omitted; HTTP-POST-only rules should send false.
	ScheduleTriggerEnabled *bool `json:"schedule_trigger_enabled,omitempty" toon:"schedule_trigger_enabled,omitempty"`
	// Scope team ID. 0 or omitted means a personal rule; >0 means a team in the account. Immutable after creation.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// IANA timezone `cron_expr` is evaluated in, e.g. `Asia/Shanghai`. Must be a timezone name loadable by the server; an invalid value is rejected. Defaults to the caller's member timezone, then the account timezone, then the server default (Asia/Shanghai) when omitted.
	Timezone string `json:"timezone,omitempty" toon:"timezone,omitempty"`
}

AutomationRuleCreateRequest is generated from the Flashduty OpenAPI schema.

type AutomationRuleIDRequest added in v0.5.4

type AutomationRuleIDRequest struct {
	// Rule ID.
	RuleID string `json:"rule_id" toon:"rule_id"`
}

AutomationRuleIDRequest is generated from the Flashduty OpenAPI schema.

type AutomationRuleItem added in v0.5.4

type AutomationRuleItem struct {
	// Account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// True when the caller can manage this rule: the personal rule owner; for team rules, an account admin or a member of the rule's team.
	CanEdit bool `json:"can_edit" toon:"can_edit"`
	// Creation time, Unix milliseconds.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Normalized 5-field cron expression.
	CronExpr string `json:"cron_expr" toon:"cron_expr"`
	// Whether the rule is enabled.
	Enabled bool `json:"enabled" toon:"enabled"`
	// BYOC Runner ID.
	EnvironmentID string `json:"environment_id" toon:"environment_id"`
	// Runtime environment kind. Omit or send an empty value for automatic selection.
	EnvironmentKind string `json:"environment_kind" toon:"environment_kind"`
	// HTTP POST trigger token. Returned only on create or token rotation; save it immediately.
	HTTPPostToken string `json:"http_post_token" toon:"http_post_token"`
	// Whether the HTTP POST trigger is enabled.
	HTTPPostTriggerEnabled bool `json:"http_post_trigger_enabled" toon:"http_post_trigger_enabled"`
	// HTTP POST trigger ID.
	HTTPPostTriggerID string `json:"http_post_trigger_id" toon:"http_post_trigger_id"`
	// HTTP POST trigger path.
	HTTPPostTriggerURL string `json:"http_post_trigger_url" toon:"http_post_trigger_url"`
	// Rule name.
	Name string `json:"name" toon:"name"`
	// On-call integration IDs to watch. Creating or enabling this trigger requires at least one valid ID.
	OncallIncidentChannelIDs []int64 `json:"oncall_incident_channel_ids" toon:"oncall_incident_channel_ids"`
	// Incident severities to watch. Supported values are Critical, Warning, and Info; creating or enabling this trigger requires at least one value.
	OncallIncidentSeverities []string `json:"oncall_incident_severities" toon:"oncall_incident_severities"`
	// Whether the On-call incident trigger is enabled.
	OncallIncidentTriggerEnabled bool `json:"oncall_incident_trigger_enabled" toon:"oncall_incident_trigger_enabled"`
	// On-call incident trigger ID.
	OncallIncidentTriggerID string `json:"oncall_incident_trigger_id" toon:"oncall_incident_trigger_id"`
	// Creator person ID.
	OwnerID int64 `json:"owner_id" toon:"owner_id"`
	// Task prompt.
	Prompt string `json:"prompt" toon:"prompt"`
	// Rule ID.
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Hidden session run scope.
	RunScope string `json:"run_scope" toon:"run_scope"`
	// Next scheduled fire time, Unix milliseconds. 0 means no future scheduled fire is available.
	ScheduleNextFireAtMs TimestampMilli `json:"schedule_next_fire_at_ms" toon:"schedule_next_fire_at_ms"`
	// Whether the schedule trigger is enabled.
	ScheduleTriggerEnabled bool `json:"schedule_trigger_enabled" toon:"schedule_trigger_enabled"`
	// Schedule trigger ID.
	ScheduleTriggerID string `json:"schedule_trigger_id" toon:"schedule_trigger_id"`
	// Scope team ID; 0 means personal rule.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// IANA timezone `cron_expr` is evaluated in. Always populated for rules created after this field shipped; empty on legacy rows created before it, which still resolve to UTC when scheduled.
	Timezone string `json:"timezone" toon:"timezone"`
	// Last update time, Unix milliseconds.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}

AutomationRuleItem is generated from the Flashduty OpenAPI schema.

type AutomationRuleListRequest added in v0.5.4

type AutomationRuleListRequest struct {
	ListOptions
	// Filter by enabled status.
	Enabled *bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// Compatibility field; when scope is empty and this is false, behaves like team scope.
	IncludePerson *bool `json:"include_person,omitempty" toon:"include_person,omitempty"`
	// Filter by name keyword.
	Keyword string `json:"keyword,omitempty" toon:"keyword,omitempty"`
	// Scope filter: `all` (own personal + accessible team rules), `personal`, or `team`; default `all`.
	Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
	// Filter to these team IDs; this narrows results and does not expand access.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}

AutomationRuleListRequest is generated from the Flashduty OpenAPI schema.

type AutomationRuleListResponse added in v0.5.4

type AutomationRuleListResponse struct {
	Rules []AutomationRuleItem `json:"rules" toon:"rules"`
	// Total count.
	Total int64 `json:"total" toon:"total"`
}

AutomationRuleListResponse is generated from the Flashduty OpenAPI schema.

type AutomationRuleUpdateRequest added in v0.5.4

type AutomationRuleUpdateRequest struct {
	// Target rule ID.
	RuleID string `json:"rule_id,omitempty" toon:"rule_id,omitempty"`
	// New rule name.
	Name *string `json:"name,omitempty" toon:"name,omitempty"`
	// Only the current value is accepted; personal/team scope is immutable after creation.
	TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Whether the rule is enabled.
	Enabled *bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// Run cadence. Supports 4 fields (`hour day month weekday`, minute defaults to 0) and 5 fields (`minute hour day month weekday`).
	CronExpr *string `json:"cron_expr,omitempty" toon:"cron_expr,omitempty"`
	// Whether the schedule trigger is enabled.
	ScheduleTriggerEnabled *bool `json:"schedule_trigger_enabled,omitempty" toon:"schedule_trigger_enabled,omitempty"`
	// New task prompt.
	Prompt *string `json:"prompt,omitempty" toon:"prompt,omitempty"`
	// Runtime environment kind. Omit or send an empty value for automatic selection.
	EnvironmentKind *string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// BYOC Runner ID.
	EnvironmentID *string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// Whether the HTTP POST trigger is enabled. Sending true creates one when missing.
	HTTPPostTriggerEnabled *bool `json:"http_post_trigger_enabled,omitempty" toon:"http_post_trigger_enabled,omitempty"`
	// Whether to rotate the HTTP POST trigger token. The new token is returned only in this response.
	RotateHTTPPostTriggerToken bool `json:"rotate_http_post_trigger_token,omitempty" toon:"rotate_http_post_trigger_token,omitempty"`
	// Whether the on-call incident trigger is enabled. Sending true creates it when missing and channel/severity filters are provided.
	OncallIncidentTriggerEnabled *bool `json:"oncall_incident_trigger_enabled,omitempty" toon:"oncall_incident_trigger_enabled,omitempty"`
	// On-call channel IDs whose new incidents can trigger this rule.
	OncallIncidentChannelIDs *[]int64 `json:"oncall_incident_channel_ids,omitempty" toon:"oncall_incident_channel_ids,omitempty"`
	// Incident severities that can trigger this rule.
	OncallIncidentSeverities *[]string `json:"oncall_incident_severities,omitempty" toon:"oncall_incident_severities,omitempty"`
}

AutomationRuleUpdateRequest updates mutable fields on an Automation rule. Pointer fields preserve partial-update semantics: nil means leave unchanged, while a non-nil zero value is sent to the API.

type AutomationRunItem added in v0.5.4

type AutomationRunItem struct {
	// Account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Attempt count.
	Attempts int64 `json:"attempts" toon:"attempts"`
	// Completion time, Unix milliseconds. 0 means not completed.
	CompletedAt TimestampMilli `json:"completed_at" toon:"completed_at"`
	// Creation time, Unix milliseconds.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Duration in milliseconds.
	DurationMs int64 `json:"duration_ms" toon:"duration_ms"`
	// Error code.
	ErrorCode string `json:"error_code" toon:"error_code"`
	// Error message.
	ErrorMessage string `json:"error_message" toon:"error_message"`
	// Run kind.
	Kind string `json:"kind" toon:"kind"`
	// Idempotency key for this occurrence.
	OccurrenceKey string `json:"occurrence_key" toon:"occurrence_key"`
	// Run result JSON.
	ResultJSON any `json:"result_json" toon:"result_json"`
	// Rule ID.
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Run ID.
	RunID string `json:"run_id" toon:"run_id"`
	// Start time, Unix milliseconds.
	StartedAt TimestampMilli `json:"started_at" toon:"started_at"`
	// Run stats JSON.
	StatsJSON any `json:"stats_json" toon:"stats_json"`
	// Run status.
	Status string `json:"status" toon:"status"`
	// Trigger kind.
	TriggerKind string `json:"trigger_kind" toon:"trigger_kind"`
	// Last update time, Unix milliseconds.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}

AutomationRunItem is generated from the Flashduty OpenAPI schema.

type AutomationRunListRequest added in v0.5.4

type AutomationRunListRequest struct {
	ListOptions
	// Target rule ID.
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Start-time lower bound, Unix milliseconds.
	StartedAfterMs int64 `json:"started_after_ms,omitempty" toon:"started_after_ms,omitempty"`
	// Start-time upper bound, Unix milliseconds.
	StartedBeforeMs int64 `json:"started_before_ms,omitempty" toon:"started_before_ms,omitempty"`
	// Run status filter.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
	// Trigger kind filter.
	TriggerKind string `json:"trigger_kind,omitempty" toon:"trigger_kind,omitempty"`
}

AutomationRunListRequest is generated from the Flashduty OpenAPI schema.

type AutomationRunListResponse added in v0.5.4

type AutomationRunListResponse struct {
	Runs []AutomationRunItem `json:"runs" toon:"runs"`
	// Total count.
	Total int64 `json:"total" toon:"total"`
}

AutomationRunListResponse is generated from the Flashduty OpenAPI schema.

type AutomationRunView added in v0.5.7

type AutomationRunView struct {
	// Run ID, always populated once a run is created.
	RunID string `json:"run_id" toon:"run_id"`
	// AI SRE session ID for this run. Always populated in a 200 response, since the call only returns after the session has started.
	SessionID string `json:"session_id" toon:"session_id"`
}

AutomationRunView is generated from the Flashduty OpenAPI schema.

type AutomationTemplateItem added in v0.5.4

type AutomationTemplateItem struct {
	// Template description.
	Description string `json:"description" toon:"description"`
	// Whether the template is enabled.
	Enabled bool `json:"enabled" toon:"enabled"`
	// Icon identifier.
	Icon string `json:"icon" toon:"icon"`
	// Template name.
	Name string `json:"name" toon:"name"`
	// Template prompt.
	Prompt string `json:"prompt" toon:"prompt"`
}

AutomationTemplateItem is generated from the Flashduty OpenAPI schema.

type AutomationTemplateListRequest added in v0.5.4

type AutomationTemplateListRequest struct {
	// Template locale such as zh-CN or en-US. Omit to detect from the request locale.
	Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
}

AutomationTemplateListRequest is generated from the Flashduty OpenAPI schema.

type AutomationTemplateListResponse added in v0.5.4

type AutomationTemplateListResponse struct {
	Templates []AutomationTemplateItem `json:"templates" toon:"templates"`
}

AutomationTemplateListResponse is generated from the Flashduty OpenAPI schema.

type AutomationsService added in v0.5.4

type AutomationsService service

AutomationsService handles the "AI SRE/Automations" API resource.

func (*AutomationsService) RuleReadGet added in v0.5.4

Get Automation rule.

Get one Automation rule by ID.

API: POST /safari/automation/rule/get (automation-rule-read-get).

func (*AutomationsService) RuleReadList added in v0.5.4

List Automation rules.

List Automation rules visible to the caller.

API: POST /safari/automation/rule/list (automation-rule-read-list).

func (*AutomationsService) RuleWriteCreate added in v0.5.4

Create Automation rule.

Create an Automation rule with schedule, HTTP POST, and On-call incident triggers.

API: POST /safari/automation/rule/create (automation-rule-write-create).

func (*AutomationsService) RuleWriteDelete added in v0.5.4

func (s *AutomationsService) RuleWriteDelete(ctx context.Context, req *AutomationRuleIDRequest) (*any, *Response, error)

Delete Automation rule.

Delete an Automation rule.

API: POST /safari/automation/rule/delete (automation-rule-write-delete).

func (*AutomationsService) RuleWriteRun added in v0.5.7

Run Automation rule.

Manually run an Automation rule immediately, outside its schedule.

API: POST /safari/automation/rule/run (automation-rule-write-run).

func (*AutomationsService) RuleWriteUpdate added in v0.5.4

Update Automation rule.

Update mutable Automation rule fields, including HTTP POST and On-call incident trigger settings.

API: POST /safari/automation/rule/update (automation-rule-write-update).

func (*AutomationsService) RunReadList added in v0.5.4

List Automation runs.

List run history for a rule the caller can manage.

API: POST /safari/automation/run/list (automation-run-read-list).

func (*AutomationsService) TemplateReadList added in v0.5.4

List Automation templates.

List preset Automation templates for the requested locale.

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

func (*AutomationsService) TriggerWriteFire added in v0.5.4

TriggerWriteFire triggers an Automation run through its HTTP POST trigger URL.

This endpoint authenticates with the trigger's one-time bearer token rather than the account app_key used by the generated API methods.

API: POST /safari/automation/triggers/{trigger_id}/fire (automation-trigger-write-fire).

type CSVFileResponse

type CSVFileResponse string

func (CSVFileResponse) String added in v0.5.2

func (e CSVFileResponse) String() string

String returns the underlying string value, implementing fmt.Stringer.

type CalEventIDRequest

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

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

CalEventItem is generated from the Flashduty OpenAPI schema.

type CalEventListRequest

type CalEventListRequest struct {
	// Calendar ID.
	CalID string `json:"cal_id" toon:"cal_id"`
	// Day (1-31). 0 means no day filter.
	Day int64 `json:"day,omitempty" toon:"day,omitempty"`
	// Month (1-12). 0 means no month filter.
	Month int64 `json:"month,omitempty" toon:"month,omitempty"`
	// Year. Defaults to the current year when omitted.
	Year int64 `json:"year,omitempty" toon:"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" toon:"items"`
	// Total number of events returned.
	Total int64 `json:"total" toon:"total"`
}

CalEventListResponse is generated from the Flashduty OpenAPI schema.

type CalEventUpsertRequest

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

CalEventUpsertRequest is generated from the Flashduty OpenAPI schema.

type CalEventUpsertResponse

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

CalEventUpsertResponse is generated from the Flashduty OpenAPI schema.

type CalendarCreateRequest

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

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" toon:"cal_id"`
}

CalendarIDRequest is generated from the Flashduty OpenAPI schema.

type CalendarItem

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

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" toon:"kind,omitempty"`
	// Disable locale filtering when listing public-holiday calendars.
	NoLocale bool `json:"no_locale,omitempty" toon:"no_locale,omitempty"`
}

CalendarListRequest is generated from the Flashduty OpenAPI schema.

type CalendarListResponse

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

CalendarListResponse is generated from the Flashduty OpenAPI schema.

type CalendarUpdateRequest

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

CancelStatusPageMigrationRequest is generated from the Flashduty OpenAPI schema.

type ChangeEventItem added in v0.4.0

type ChangeEventItem struct {
	// Account this change event belongs to.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Stable key that groups events belonging to the same change.
	ChangeKey string `json:"change_key" toon:"change_key"`
	// Lifecycle status of the change event.
	ChangeStatus string `json:"change_status" toon:"change_status"`
	// Collaboration channel this change event is routed to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Unix timestamp in seconds when the change event was created.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Unix timestamp in seconds when the change event was deleted.
	DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
	// Change event description.
	Description string `json:"description" toon:"description"`
	// Change event ID, a MongoDB ObjectID hex string.
	EventID string `json:"event_id" toon:"event_id"`
	// Unix timestamp in seconds when the change event occurred.
	EventTime Timestamp `json:"event_time" toon:"event_time"`
	// Integration that reported this change event.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Key-value labels attached to the change event.
	Labels map[string]string `json:"labels" toon:"labels"`
	// External link to the source change record.
	Link string `json:"link" toon:"link"`
	// Change event title.
	Title string `json:"title" toon:"title"`
	// Unix timestamp in seconds when the change event was last updated.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}

ChangeEventItem is generated from the Flashduty OpenAPI schema.

type ChangeItem added in v0.4.0

type ChangeItem struct {
	// Account this change belongs to.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Change ID, a MongoDB ObjectID hex string.
	ChangeID string `json:"change_id" toon:"change_id"`
	// Stable key that groups events belonging to the same change.
	ChangeKey string `json:"change_key" toon:"change_key"`
	// Current lifecycle status of the change.
	ChangeStatus string `json:"change_status" toon:"change_status"`
	// Collaboration channel this change is routed to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Name of the collaboration channel.
	ChannelName string `json:"channel_name" toon:"channel_name"`
	// Status of the collaboration channel.
	ChannelStatus string `json:"channel_status" toon:"channel_status"`
	// Change description.
	Description string `json:"description" toon:"description"`
	// Unix timestamp in seconds when the change ended.
	EndTime Timestamp `json:"end_time" toon:"end_time"`
	// Underlying change events, returned only when include_events is true.
	Events []ChangeEventItem `json:"events" toon:"events"`
	// Integration that reported this change.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Name of the reporting integration.
	IntegrationName string `json:"integration_name" toon:"integration_name"`
	// Key-value labels attached to the change.
	Labels map[string]string `json:"labels" toon:"labels"`
	// Unix timestamp in seconds of the most recent change activity.
	LastTime Timestamp `json:"last_time" toon:"last_time"`
	// External link to the source change record.
	Link string `json:"link" toon:"link"`
	// Unix timestamp in seconds when the change started.
	StartTime Timestamp `json:"start_time" toon:"start_time"`
	// Change title.
	Title string `json:"title" toon:"title"`
}

ChangeItem is generated from the Flashduty OpenAPI schema.

type ChangesService added in v0.4.0

type ChangesService service

ChangesService handles the "On-call/Changes" API resource.

func (*ChangesService) List added in v0.4.0

List changes.

Query change records within a time window, with filtering, search, and pagination.

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

type ChannelCreateResponse

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

ChannelCreateResponse is generated from the Flashduty OpenAPI schema.

type ChannelIDRequest

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

ChannelIDRequest is generated from the Flashduty OpenAPI schema.

type ChannelInfoRequest

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

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" toon:"channel_ids"`
}

ChannelInfosRequest is generated from the Flashduty OpenAPI schema.

type ChannelInfosResponse

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

ChannelInfosResponse is generated from the Flashduty OpenAPI schema.

type ChannelItem

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

ChannelItem is generated from the Flashduty OpenAPI schema.

type ChannelRuleIDRequest

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

ChannelRuleIDRequest is generated from the Flashduty OpenAPI schema.

type ChannelScopedListRequest

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

ChannelScopedListRequest is generated from the Flashduty OpenAPI schema.

type ChannelShort

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

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) 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" toon:"comment,omitempty"`
	// Incident IDs to comment on. At most 100 per call.
	IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
	// When true, do not trigger webhook reply actions for this comment.
	MuteReply bool `json:"mute_reply,omitempty" toon:"mute_reply,omitempty"`
}

CommentIncidentRequest is generated from the Flashduty OpenAPI schema.

type ContextResolvedItem added in v0.5.4

type ContextResolvedItem struct {
	// Resolved account-scoped pack id.
	AccountPackID string `json:"account_pack_id" toon:"account_pack_id"`
	// Bound incident id, when war-room originated.
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// Unix timestamp in milliseconds when the packs were resolved.
	ResolvedAtMs TimestampMilli `json:"resolved_at_ms" toon:"resolved_at_ms"`
	// Resolved team-scoped pack id.
	TeamPackID string `json:"team_pack_id" toon:"team_pack_id"`
	// Per-pack resolved version map.
	Versions map[string]int64 `json:"versions" toon:"versions"`
}

ContextResolvedItem is generated from the Flashduty OpenAPI schema.

type CreateChannelRequest

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

CreateChannelRequest is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestEscalateRule

type CreateChannelRequestEscalateRule struct {
	// Delay window in seconds. 0 disables delay.
	AggrWindow int64 `json:"aggr_window,omitempty" toon:"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" toon:"target"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id" toon:"template_id"`
}

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,omitzero" toon:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty" toon:"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" toon:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []CreateChannelRequestEscalateRuleTargetWebhooksItem `json:"webhooks,omitempty" toon:"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" toon:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty" toon:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty" toon:"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" toon:"settings"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type" toon:"type"`
}

CreateChannelRequestEscalateRuleTargetWebhooksItem is generated from the Flashduty OpenAPI schema.

type CreateChannelRequestFlapping

type CreateChannelRequestFlapping struct {
	// Observation window in minutes.
	InMins int64 `json:"in_mins,omitempty" toon:"in_mins,omitempty"`
	// Disable flapping detection.
	IsDisabled bool `json:"is_disabled,omitempty" toon:"is_disabled,omitempty"`
	// Max state changes allowed within `in_mins`.
	MaxChanges int64 `json:"max_changes,omitempty" toon:"max_changes,omitempty"`
	// Mute duration in minutes after flapping is detected.
	MuteMins int64 `json:"mute_mins,omitempty" toon:"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" toon:"all_equals_required,omitempty"`
	// Per-filter grouping overrides.
	Cases []map[string]any `json:"cases,omitempty" toon:"cases,omitempty"`
	// Groups of label keys whose equality defines a bucket.
	Equals [][]string `json:"equals,omitempty" toon:"equals,omitempty"`
	// Label keys used for intelligent grouping embeddings.
	IKeys []string `json:"i_keys,omitempty" toon:"i_keys,omitempty"`
	// Intelligent grouping similarity threshold.
	IScoreThreshold float64 `json:"i_score_threshold,omitempty" toon:"i_score_threshold,omitempty"`
	// Grouping method: `i` intelligent, `p` pattern, `n` none.
	Method string `json:"method" toon:"method"`
	// Alert storm threshold.
	StormThreshold int64 `json:"storm_threshold,omitempty" toon:"storm_threshold,omitempty"`
	// Multi-level storm thresholds.
	StormThresholds []int64 `json:"storm_thresholds,omitempty" toon:"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" toon:"time_window,omitempty"`
	// Window type. Defaults to `tumbling`.
	WindowType string `json:"window_type,omitempty" toon:"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" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty" toon:"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" toon:"filters,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
}

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" toon:"key"`
	// Filter operator.
	Oper string `json:"oper" toon:"oper"`
	// Values to match.
	Vals []string `json:"vals" toon:"vals"`
}

CreateDropRuleRequestFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateEscalationRuleRequest

type CreateEscalationRuleRequest struct {
	// Delay window in seconds. 0 disables delay.
	AggrWindow int64 `json:"aggr_window,omitempty" toon:"aggr_window,omitempty"`
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty" toon:"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" toon:"filters,omitempty"`
	// Escalation levels in order. At least one level is required.
	Layers []CreateEscalationRuleRequestLayersItem `json:"layers" toon:"layers"`
	// Evaluation priority. Lower runs first.
	Priority *int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id" toon:"template_id"`
	// Optional recurring time windows during which the rule applies.
	TimeFilters []CreateEscalationRuleRequestTimeFiltersItem `json:"time_filters,omitempty" toon:"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" toon:"key"`
	// Filter operator.
	Oper string `json:"oper" toon:"oper"`
	// Values to match.
	Vals []string `json:"vals" toon:"vals"`
}

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" toon:"escalate_window,omitempty"`
	// When true, always escalate regardless of acknowledgement.
	ForceEscalate bool `json:"force_escalate,omitempty" toon:"force_escalate,omitempty"`
	// Max repeat notifications within the level.
	MaxTimes int64 `json:"max_times,omitempty" toon:"max_times,omitempty"`
	// Repeat interval in minutes.
	NotifyStep float64 `json:"notify_step,omitempty" toon:"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" toon:"target"`
}

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,omitzero" toon:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty" toon:"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" toon:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []CreateEscalationRuleRequestLayersItemTargetWebhooksItem `json:"webhooks,omitempty" toon:"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" toon:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty" toon:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty" toon:"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" toon:"settings"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type" toon:"type"`
}

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" toon:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty" toon:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty" toon:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty" toon:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty" toon:"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" toon:"default_value,omitempty"`
	// Optional free-text description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Human-readable name. Must be unique within the account.
	DisplayName string `json:"display_name" toon:"display_name"`
	// 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" toon:"field_name"`
	// Field input type. Immutable after creation.
	FieldType string `json:"field_type" toon:"field_type"`
	// 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" toon:"options,omitempty"`
	// Stored value type. `checkbox` requires `bool`; `single_select`/`multi_select`/`text` require `string`. Immutable after creation.
	ValueType string `json:"value_type" toon:"value_type"`
}

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" toon:"field_id"`
	// Echo of the submitted `field_name`.
	FieldName string `json:"field_name" toon:"field_name"`
}

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,omitzero" toon:"assigned_to,omitempty"`
	// Channel to file the incident into. Optional; leave unset for a standalone incident.
	ChannelID int64 `json:"channel_id,omitempty" toon:"channel_id,omitempty"`
	// Incident description, up to 1024 characters.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Custom field values keyed by field name. When a create form applies, only its visible fields are accepted.
	Fields CustomFieldValues `json:"fields,omitempty" toon:"fields,omitempty"`
	// Incident severity.
	IncidentSeverity string `json:"incident_severity" toon:"incident_severity"`
	// Incident title, up to 512 characters.
	Title string `json:"title,omitempty" toon:"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" toon:"emails,omitempty"`
	// Escalation rule ID (MongoDB ObjectID) to drive assignment.
	EscalateRuleID string `json:"escalate_rule_id,omitempty" toon:"escalate_rule_id,omitempty"`
	// Starting layer index when using an escalation rule.
	LayerIdx int64 `json:"layer_idx,omitempty" toon:"layer_idx,omitempty"`
	// Override the notification channels used for this assignment.
	Notify CreateIncidentRequestAssignedToNotify `json:"notify,omitzero" toon:"notify,omitempty"`
	// Member IDs to assign directly.
	PersonIDs []int64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
	// Assignment type.
	Type string `json:"type,omitempty" toon:"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" toon:"follow_preference,omitempty"`
	// Channels to use (e.g. `voice`, `sms`, `email`).
	PersonalChannels []string `json:"personal_channels,omitempty" toon:"personal_channels,omitempty"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id,omitempty" toon:"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" toon:"incident_id"`
	// Echoes the incident title from the request.
	Title string `json:"title" toon:"title"`
}

CreateIncidentResponse is generated from the Flashduty OpenAPI schema.

type CreateInhibitRuleRequest

type CreateInhibitRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Label keys used to pair source and target alerts.
	Equals []string `json:"equals" toon:"equals"`
	// When true, suppressed target alerts are dropped instead of merged.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
	// 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" toon:"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" toon:"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" toon:"key"`
	// Filter operator.
	Oper string `json:"oper" toon:"oper"`
	// Values to match.
	Vals []string `json:"vals" toon:"vals"`
}

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" toon:"key"`
	// Filter operator.
	Oper string `json:"oper" toon:"oper"`
	// Values to match.
	Vals []string `json:"vals" toon:"vals"`
}

CreateInhibitRuleRequestTargetFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequest

type CreateSilenceRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty" toon:"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" toon:"filters,omitempty"`
	// Source incident ID when the silence was created from an incident.
	FromIncidentID string `json:"from_incident_id,omitempty" toon:"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" toon:"is_auto_delete,omitempty"`
	// When true, silenced alerts are dropped instead of suppressed into incidents.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
	// One-off time window defined by unix seconds.
	TimeFilter CreateSilenceRuleRequestTimeFilter `json:"time_filter,omitzero" toon:"time_filter,omitempty"`
	// Recurring time windows during which silencing applies. Mutually exclusive with `time_filter`.
	TimeFilters []CreateSilenceRuleRequestTimeFiltersItem `json:"time_filters,omitempty" toon:"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" toon:"key"`
	// Filter operator.
	Oper string `json:"oper" toon:"oper"`
	// Values to match.
	Vals []string `json:"vals" toon:"vals"`
}

CreateSilenceRuleRequestFiltersItemItem is generated from the Flashduty OpenAPI schema.

type CreateSilenceRuleRequestTimeFilter

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

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" toon:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty" toon:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty" toon:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty" toon:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty" toon:"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" toon:"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" toon:"close_at_seconds,omitempty"`
	// Event description (Markdown). Required by the validator.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Mark this event as a retrospective (historical) one.
	IsRetrospective bool `json:"is_retrospective,omitempty" toon:"is_retrospective,omitempty"`
	// Linked change IDs (related incidents, deployments, etc.).
	LinkedChanges []string `json:"linked_changes,omitempty" toon:"linked_changes,omitempty"`
	// Notify subscribers about this event and all its updates.
	NotifySubscribers bool `json:"notify_subscribers,omitempty" toon:"notify_subscribers,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Member IDs responsible for this event.
	Responders []int64 `json:"responders,omitempty" toon:"responders,omitempty"`
	// Event start time in unix seconds. Defaults to now when omitted.
	StartAtSeconds int64 `json:"start_at_seconds,omitempty" toon:"start_at_seconds,omitempty"`
	// Initial event status. `investigating`/`identified`/`monitoring`/`resolved` apply to incidents; `scheduled`/`ongoing`/`completed` apply to maintenances.
	Status string `json:"status" toon:"status"`
	// Event title, up to 255 characters.
	Title string `json:"title" toon:"title"`
	// Event type.
	Type string `json:"type" toon:"type"`
	// Timeline updates. Immediate events normally pass one update; retrospective events must pass all historical updates.
	Updates []CreateStatusPageChangeRequestUpdatesItem `json:"updates" toon:"updates"`
}

CreateStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeRequestUpdatesItem

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

CreateStatusPageChangeRequestUpdatesItem is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeRequestUpdatesItemComponentChangesItem

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

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" toon:"at_seconds,omitempty"`
	// Target event ID.
	ChangeID int64 `json:"change_id" toon:"change_id"`
	// Component status transitions applied by this update. Component IDs must be unique.
	ComponentChanges []CreateStatusPageChangeTimelineRequestComponentChangesItem `json:"component_changes,omitempty" toon:"component_changes,omitempty"`
	// Update description (Markdown). Required.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// 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" toon:"status"`
}

CreateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type CreateStatusPageChangeTimelineRequestComponentChangesItem

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

CreateStatusPageChangeTimelineRequestComponentChangesItem is generated from the Flashduty OpenAPI schema.

type CreateStatusPageRequest added in v0.5.5

type CreateStatusPageRequest struct {
	// Get-in-touch contact, such as a mailto or website URL.
	ContactInfo string `json:"contact_info,omitempty" toon:"contact_info,omitempty"`
	// Custom domain for a public status page.
	CustomDomain string `json:"custom_domain,omitempty" toon:"custom_domain,omitempty"`
	// Custom navigation links shown on the status page.
	CustomLinks []map[string]string `json:"custom_links,omitempty" toon:"custom_links,omitempty"`
	// How event dates are displayed.
	DateView string `json:"date_view" toon:"date_view"`
	// How uptime is displayed.
	DisplayUptimeMode string `json:"display_uptime_mode" toon:"display_uptime_mode"`
	// Display name of the status page.
	Name string `json:"name" toon:"name"`
	// Footer content shown on the status page.
	PageFooter string `json:"page_footer,omitempty" toon:"page_footer,omitempty"`
	// Header content shown on the status page.
	PageHeader string `json:"page_header,omitempty" toon:"page_header,omitempty"`
	// Browser title shown for the status page.
	PageTitle    string                     `json:"page_title,omitempty" toon:"page_title,omitempty"`
	Subscription StatusPageSubscriptionItem `json:"subscription,omitzero" toon:"subscription,omitempty"`
	// Visibility type of the status page.
	Type string `json:"type" toon:"type"`
	// URL-safe slug, unique per account and page type.
	URLName string `json:"url_name" toon:"url_name"`
}

CreateStatusPageRequest is generated from the Flashduty OpenAPI schema.

type CreateStatusPageResponse added in v0.5.5

type CreateStatusPageResponse struct {
	// Created status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Created status page name.
	PageName string `json:"page_name" toon:"page_name"`
	// Final URL-safe slug assigned to the status page.
	PageURLName string `json:"page_url_name" toon:"page_url_name"`
}

CreateStatusPageResponse 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" toon:"add_observers,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// IM integration ID. Must have war room enabled; Feishu, DingTalk, WeCom (self-built), Slack and Teams are supported.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Additional member IDs to add to the war room.
	MemberIDs []int64 `json:"member_ids,omitempty" toon:"member_ids,omitempty"`
}

CreateWarRoomRequest is generated from the Flashduty OpenAPI schema.

type CustomFieldValues added in v0.5.7

type CustomFieldValues struct{}

CustomFieldValues is generated from the Flashduty OpenAPI schema.

type DataQueryService added in v0.5.4

type DataQueryService service

DataQueryService handles the "RUM/Data query" API resource.

func (*DataQueryService) Query added in v0.5.4

Query RUM data.

Run one or more SQL-style RUM data queries over a bounded time range.

API: POST /rum/data/query (rum-read-data-query).

type DataSourceItem

type DataSourceItem struct {
	// Account ID.
	AccountID uint64 `json:"account_id" toon:"account_id"`
	// 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" toon:"address"`
	// Monitors edge cluster name responsible for evaluating rules using this datasource.
	EdgeClusterName string `json:"edge_cluster_name" toon:"edge_cluster_name"`
	// Whether the datasource is active.
	Enabled bool `json:"enabled" toon:"enabled"`
	// Unique datasource ID.
	ID uint64 `json:"id" toon:"id"`
	// Datasource display name.
	Name string `json:"name" toon:"name"`
	// Optional description.
	Note    string    `json:"note" toon:"note"`
	Payload DsPayload `json:"payload" toon:"payload"`
	// Datasource type identifier. Allowed: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.
	TypeIdent string `json:"type_ident" toon:"type_ident"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}

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" toon:"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" toon:"address,omitempty"`
	// Monitors edge cluster name responsible for evaluating rules using this datasource.
	EdgeClusterName string `json:"edge_cluster_name" toon:"edge_cluster_name"`
	// Datasource ID. Required for update; omit for create.
	ID uint64 `json:"id,omitempty" toon:"id,omitempty"`
	// Datasource display name.
	Name string `json:"name" toon:"name"`
	// Optional description.
	Note string `json:"note,omitempty" toon:"note,omitempty"`
	// Type-specific configuration block. Must include the key matching `type_ident`.
	Payload DsPayload `json:"payload" toon:"payload"`
	// Datasource type identifier. Allowed: `prometheus`, `loki`, `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`, `victorialogs`.
	TypeIdent string `json:"type_ident" toon:"type_ident"`
}

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 with its configured connection and authentication settings; treat the response as sensitive and avoid logging or forwarding it.

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" toon:"field_id"`
}

DeleteFieldRequest is generated from the Flashduty OpenAPI schema.

type DeletePostMortemRequest

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

DeletePostMortemRequest is generated from the Flashduty OpenAPI schema.

type DeletePostMortemTemplateRequest added in v0.5.4

type DeletePostMortemTemplateRequest struct {
	// Template ID.
	TemplateID string `json:"template_id" toon:"template_id"`
}

DeletePostMortemTemplateRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageChangeRequest

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

DeleteStatusPageChangeRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageChangeTimelineRequest

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

DeleteStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageComponentRequest added in v0.5.4

type DeleteStatusPageComponentRequest struct {
	// IDs of components to delete.
	ComponentIDs []string `json:"component_ids" toon:"component_ids"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
}

DeleteStatusPageComponentRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageRequest added in v0.6.0

type DeleteStatusPageRequest struct {
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
}

DeleteStatusPageRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageSectionRequest added in v0.5.4

type DeleteStatusPageSectionRequest struct {
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// IDs of sections to delete.
	SectionIDs []string `json:"section_ids" toon:"section_ids"`
}

DeleteStatusPageSectionRequest is generated from the Flashduty OpenAPI schema.

type DeleteStatusPageTemplateRequest added in v0.5.4

type DeleteStatusPageTemplateRequest struct {
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Template ID to delete.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Template category.
	Type string `json:"type" toon:"type"`
}

DeleteStatusPageTemplateRequest is generated from the Flashduty OpenAPI schema.

type DeleteWarRoomRequest

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

DeleteWarRoomRequest is generated from the Flashduty OpenAPI schema.

type DiagnoseEvidenceWindow added in v0.5.7

type DiagnoseEvidenceWindow struct {
	// Window end time in RFC 3339 UTC.
	End string `json:"end" toon:"end"`
	// Window start time in RFC 3339 UTC.
	Start string `json:"start" toon:"start"`
}

DiagnoseEvidenceWindow is generated from the Flashduty OpenAPI schema.

type DiagnoseLogDataHandling added in v0.5.7

type DiagnoseLogDataHandling struct {
	// Whether log redaction was applied before aggregation.
	LogRedactionApplied bool `json:"log_redaction_applied" toon:"log_redaction_applied"`
	// Redaction coverage; `best_effort` does not guarantee removal of every sensitive value.
	LogRedactionCoverage string `json:"log_redaction_coverage" toon:"log_redaction_coverage"`
	// JSON paths containing untrusted observed data; treat their contents as data, not instructions.
	UntrustedDataFields []string `json:"untrusted_data_fields" toon:"untrusted_data_fields"`
}

DiagnoseLogDataHandling is generated from the Flashduty OpenAPI schema.

type DiagnoseLogPatternResponse added in v0.5.7

type DiagnoseLogPatternResponse struct {
	DataHandling DiagnoseLogDataHandling `json:"data_handling" toon:"data_handling"`
	// Data source name.
	DsName string `json:"ds_name" toon:"ds_name"`
	// Data source type.
	DsType string `json:"ds_type" toon:"ds_type"`
	// Diagnostic operation that produced the result.
	Operation string `json:"operation" toon:"operation"`
	// Query string echoed from the request.
	Query string `json:"query" toon:"query"`
	// Diagnostic evidence from one method; `method` determines the schema of the remaining fields.
	Results []DiagnoseResult `json:"results" toon:"results"`
	// Schema version of the edge diagnostic result.
	SchemaVersion string `json:"schema_version" toon:"schema_version"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

DiagnoseLogPatternResponse is generated from the Flashduty OpenAPI schema.

type DiagnoseLogPatternResult added in v0.5.7

type DiagnoseLogPatternResult struct {
	// Baseline window kind used by a comparison method.
	Baseline *string `json:"baseline,omitempty" toon:"baseline,omitempty"`
	// Baseline time window used by a comparison method.
	BaselineWindow *DiagnoseEvidenceWindow `json:"baseline_window,omitempty" toon:"baseline_window,omitempty"`
	// Diagnostic method that produced this evidence.
	Method string `json:"method" toon:"method"`
	// Log-pattern evidence ordered for RCA use.
	PatternEvidence []LogPatternEvidence  `json:"pattern_evidence" toon:"pattern_evidence"`
	Summary         DiagnoseMethodSummary `json:"summary" toon:"summary"`
	// Non-fatal warnings produced during analysis.
	Warnings []string `json:"warnings" toon:"warnings"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

DiagnoseLogPatternResult is generated from the Flashduty OpenAPI schema.

type DiagnoseMethodSummary added in v0.5.7

type DiagnoseMethodSummary struct {
	// Total aggregated pattern evidence items before the response limit is applied.
	AggregatedPatternEvidenceTotal *int64 `json:"aggregated_pattern_evidence_total,omitempty" toon:"aggregated_pattern_evidence_total,omitempty"`
	// Whether `max_series` prevented full analysis of all input series.
	AnalysisTruncated *bool `json:"analysis_truncated,omitempty" toon:"analysis_truncated,omitempty"`
	// Log sample summary for the baseline window.
	BaselineSample *LogPatternSampleSummary `json:"baseline_sample,omitempty" toon:"baseline_sample,omitempty"`
	// Log sample summary for the current window.
	CurrentSample *LogPatternSampleSummary `json:"current_sample,omitempty" toon:"current_sample,omitempty"`
	// Factual summary generated from coverage, selection, and return counts.
	EvidenceSummary string `json:"evidence_summary" toon:"evidence_summary"`
	// Number of pattern evidence items returned in this response.
	PatternEvidenceReturned *int64 `json:"pattern_evidence_returned,omitempty" toon:"pattern_evidence_returned,omitempty"`
	// Whether returned pattern evidence was truncated by `max_patterns`.
	PatternEvidenceTruncatedByMaxPatterns *bool `json:"pattern_evidence_truncated_by_max_patterns,omitempty" toon:"pattern_evidence_truncated_by_max_patterns,omitempty"`
	// Number of aggregated patterns observed only in the baseline sample. Omitted when sampling is incomplete.
	PatternsAggregatedOnlyInBaselineSample *int64 `json:"patterns_aggregated_only_in_baseline_sample,omitempty" toon:"patterns_aggregated_only_in_baseline_sample,omitempty"`
	// Series matching internal selection rules before `topk` is applied.
	SelectedSeriesTotal *int64 `json:"selected_series_total,omitempty" toon:"selected_series_total,omitempty"`
	// Number of series analyzed after applying `max_series`.
	SeriesAnalyzed *int64 `json:"series_analyzed,omitempty" toon:"series_analyzed,omitempty"`
	// Number of `series_evidence` items returned in this response.
	SeriesReturned *int64 `json:"series_returned,omitempty" toon:"series_returned,omitempty"`
	// Total input series; for comparisons, the union of current and baseline label sets.
	SeriesTotal *int64 `json:"series_total,omitempty" toon:"series_total,omitempty"`
}

DiagnoseMethodSummary is generated from the Flashduty OpenAPI schema.

type DiagnoseMetricTrendResponse added in v0.5.7

type DiagnoseMetricTrendResponse struct {
	// Data source name.
	DsName string `json:"ds_name" toon:"ds_name"`
	// Data source type.
	DsType string `json:"ds_type" toon:"ds_type"`
	// Diagnostic operation that produced the result.
	Operation string `json:"operation" toon:"operation"`
	// Query string echoed from the request.
	Query string `json:"query" toon:"query"`
	// Diagnostic evidence from one method; `method` determines the schema of the remaining fields.
	Results []DiagnoseResult `json:"results" toon:"results"`
	// Schema version of the edge diagnostic result.
	SchemaVersion string `json:"schema_version" toon:"schema_version"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

DiagnoseMetricTrendResponse is generated from the Flashduty OpenAPI schema.

type DiagnoseMetricTrendResult added in v0.5.7

type DiagnoseMetricTrendResult struct {
	// Baseline window kind used by a comparison method.
	Baseline *string `json:"baseline,omitempty" toon:"baseline,omitempty"`
	// Baseline time window used by a comparison method.
	BaselineWindow *DiagnoseEvidenceWindow `json:"baseline_window,omitempty" toon:"baseline_window,omitempty"`
	// Diagnostic method that produced this evidence.
	Method string `json:"method" toon:"method"`
	// Metric evidence for each returned series.
	SeriesEvidence []MetricTrendSeriesEvidence `json:"series_evidence" toon:"series_evidence"`
	Summary        DiagnoseMethodSummary       `json:"summary" toon:"summary"`
	// Non-fatal warnings produced during analysis.
	Warnings []string `json:"warnings" toon:"warnings"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

DiagnoseMetricTrendResult 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" toon:"account_id,omitempty"`
	// Data source name configured under the tenant.
	DsName string `json:"ds_name" toon:"ds_name"`
	// Data source type. `log_patterns` supports `loki` and `victorialogs`; `metric_trends` supports `prometheus`.
	DsType string               `json:"ds_type" toon:"ds_type"`
	Input  DiagnoseRequestInput `json:"input" toon:"input"`
	// 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" toon:"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" toon:"operation,omitempty"`
	// Execution options, all upper-bounded by monit-edge.
	Options DiagnoseRequestOptions `json:"options,omitzero" toon:"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,omitzero" toon:"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" toon:"query"`
}

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" toon:"baseline,omitempty"`
	// `log_patterns` supports `pattern_snapshot`, `pattern_compare`. `metric_trends` supports `single_window_shape`, `window_compare`.
	Name string `json:"name,omitempty" toon:"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" toon:"examples_per_pattern,omitempty"`
	// Per-window log scan cap. Default 10 000, hard max 50 000.
	MaxLogsScanned int64 `json:"max_logs_scanned,omitempty" toon:"max_logs_scanned,omitempty"`
	// Max patterns returned. Default 20, hard max 50.
	MaxPatterns int64 `json:"max_patterns,omitempty" toon:"max_patterns,omitempty"`
	// `metric_trends` max series considered. Default 50, hard max 200.
	MaxSeries int64 `json:"max_series,omitempty" toon:"max_series,omitempty"`
	// `metric_trends` query_range step. Default 60, range [15, 300].
	StepSeconds int64 `json:"step_seconds,omitempty" toon:"step_seconds,omitempty"`
	// Edge-side diagnostic timeout in seconds. Default 25, hard max 30.
	TimeoutSeconds int64 `json:"timeout_seconds,omitempty" toon:"timeout_seconds,omitempty"`
	// `metric_trends` max notable series returned. Default 10, hard max 50.
	Topk int64 `json:"topk,omitempty" toon:"topk,omitempty"`
}

DiagnoseRequestOptions is generated from the Flashduty OpenAPI schema.

type DiagnoseRequestTimeRange

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

DiagnoseRequestTimeRange is generated from the Flashduty OpenAPI schema.

type DiagnoseResponse

type DiagnoseResponse struct {
	DataHandling *DiagnoseLogDataHandling `json:"data_handling,omitempty" toon:"data_handling,omitempty"`
	// Data source name.
	DsName string `json:"ds_name" toon:"ds_name"`
	// Data source type.
	DsType string `json:"ds_type" toon:"ds_type"`
	// Diagnostic operation that produced the result.
	Operation string `json:"operation" toon:"operation"`
	// Query string echoed from the request.
	Query string `json:"query" toon:"query"`
	// Diagnostic evidence from one method; `method` determines the schema of the remaining fields.
	Results []DiagnoseResult `json:"results" toon:"results"`
	// Schema version of the edge diagnostic result.
	SchemaVersion string `json:"schema_version" toon:"schema_version"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

DiagnoseResponse is generated from the Flashduty OpenAPI schema.

type DiagnoseResult added in v0.5.7

type DiagnoseResult struct {
	// Baseline window kind used by a comparison method.
	Baseline *string `json:"baseline,omitempty" toon:"baseline,omitempty"`
	// Baseline time window used by a comparison method.
	BaselineWindow *DiagnoseEvidenceWindow `json:"baseline_window,omitempty" toon:"baseline_window,omitempty"`
	// Diagnostic method that produced this evidence.
	Method string `json:"method" toon:"method"`
	// Log-pattern evidence ordered for RCA use.
	PatternEvidence *[]LogPatternEvidence `json:"pattern_evidence,omitempty" toon:"pattern_evidence,omitempty"`
	// Metric evidence for each returned series.
	SeriesEvidence *[]MetricTrendSeriesEvidence `json:"series_evidence,omitempty" toon:"series_evidence,omitempty"`
	Summary        DiagnoseMethodSummary        `json:"summary" toon:"summary"`
	// Non-fatal warnings produced during analysis.
	Warnings []string `json:"warnings" toon:"warnings"`
	// Current analysis window using RFC 3339 UTC timestamps.
	Window DiagnoseEvidenceWindow `json:"window" toon:"window"`
}

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

DimensionInsightItem is generated from the Flashduty OpenAPI schema.

type DimensionInsightResponse

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

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" toon:"incident_ids"`
}

DisableIncidentMergeRequest is generated from the Flashduty OpenAPI schema.

type DoIncidentCustomActionRequest

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

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" toon:"message"`
}

DoIncidentCustomActionResponse is generated from the Flashduty OpenAPI schema.

type DsClickHouseConfig

type DsClickHouseConfig struct {
	// Default database for authentication.
	Database string `json:"database,omitempty" toon:"database,omitempty"`
	// Dial timeout in milliseconds.
	DialTimeoutMills int64 `json:"dial_timeout_mills,omitempty" toon:"dial_timeout_mills,omitempty"`
	IdleConns        int64 `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
	LifetimeSeconds  int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
	// Max query execution time in seconds.
	MaxExecutionSeconds int64  `json:"max_execution_seconds,omitempty" toon:"max_execution_seconds,omitempty"`
	OpenConns           int64  `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
	Password            string `json:"password,omitempty" toon:"password,omitempty"`
	TimeoutMills        int64  `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
	TlsCa               string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert             string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsEnabled          bool   `json:"tls_enabled,omitempty" toon:"tls_enabled,omitempty"`
	TlsKey              string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	TlsMaxVersion       string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
	TlsMinVersion       string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
	TlsServerName       string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
	TlsSkipVerify       bool   `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
	Username            string `json:"username,omitempty" toon:"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" toon:"api_key,omitempty"`
	CertificateFingerprint string `json:"certificate_fingerprint,omitempty" toon:"certificate_fingerprint,omitempty"`
	// Elastic Cloud deployment ID. Only for `cloud` deployment.
	CloudID string `json:"cloud_id,omitempty" toon:"cloud_id,omitempty"`
	// Deployment type. `cloud` uses Elastic Cloud; `self-managed` uses a self-hosted cluster.
	Deployment string   `json:"deployment,omitempty" toon:"deployment,omitempty"`
	Headers    []string `json:"headers,omitempty" toon:"headers,omitempty"`
	Password   string   `json:"password,omitempty" toon:"password,omitempty"`
	// Service token; overrides username/password if set.
	ServiceToken string `json:"service_token,omitempty" toon:"service_token,omitempty"`
	TimeoutMills int64  `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
	TlsCa        string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	// Username for `self-managed` deployment.
	Username string `json:"username,omitempty" toon:"username,omitempty"`
}

DsElasticSearchConfig is generated from the Flashduty OpenAPI schema.

type DsLokiConfig

type DsLokiConfig struct {
	BasicAuthEnabled  bool     `json:"basic_auth_enabled,omitempty" toon:"basic_auth_enabled,omitempty"`
	BasicAuthPassword string   `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
	BasicAuthUsername string   `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
	Headers           []string `json:"headers,omitempty" toon:"headers,omitempty"`
	Params            []string `json:"params,omitempty" toon:"params,omitempty"`
	TlsCa             string   `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert           string   `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsKey            string   `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	TlsMaxVersion     string   `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
	TlsMinVersion     string   `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
	TlsServerName     string   `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
	TlsSkipVerify     bool     `json:"tls_skip_verify,omitempty" toon:"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" toon:"idle_conns,omitempty"`
	// Connection maximum lifetime in seconds.
	LifetimeSeconds int64 `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
	// Maximum open connections.
	OpenConns int64  `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
	Password  string `json:"password,omitempty" toon:"password,omitempty"`
	// Query timeout in milliseconds.
	TimeoutMills  int64  `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
	TlsCa         string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert       string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsKey        string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	TlsMaxVersion string `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
	TlsMinVersion string `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
	// TLS mode for the MySQL connection. Empty keeps the legacy per-field TLS behavior.
	TlsMode       string `json:"tls_mode,omitempty" toon:"tls_mode,omitempty"`
	TlsServerName string `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
	TlsSkipVerify bool   `json:"tls_skip_verify,omitempty" toon:"tls_skip_verify,omitempty"`
	Username      string `json:"username,omitempty" toon:"username,omitempty"`
}

DsMySqlConfig is generated from the Flashduty OpenAPI schema.

type DsOracleConfig

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

DsOracleConfig is generated from the Flashduty OpenAPI schema.

type DsPayload

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

DsPayload is generated from the Flashduty OpenAPI schema.

type DsPostgresConfig

type DsPostgresConfig struct {
	IdleConns       int64  `json:"idle_conns,omitempty" toon:"idle_conns,omitempty"`
	LifetimeSeconds int64  `json:"lifetime_seconds,omitempty" toon:"lifetime_seconds,omitempty"`
	OpenConns       int64  `json:"open_conns,omitempty" toon:"open_conns,omitempty"`
	Password        string `json:"password,omitempty" toon:"password,omitempty"`
	// SSL mode for the PostgreSQL connection. Empty keeps the legacy behavior inferred from `tls_ca`.
	SslMode      string `json:"ssl_mode,omitempty" toon:"ssl_mode,omitempty"`
	TimeoutMills int64  `json:"timeout_mills,omitempty" toon:"timeout_mills,omitempty"`
	TlsCa        string `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert      string `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsKey       string `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	Username     string `json:"username,omitempty" toon:"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" toon:"basic_auth_enabled,omitempty"`
	// Basic auth password.
	BasicAuthPassword string `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
	// Basic auth username.
	BasicAuthUsername string `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
	// Custom HTTP headers in `Key: Value` format.
	Headers []string `json:"headers,omitempty" toon:"headers,omitempty"`
	// Custom query parameters in `key=value` format.
	Params        []string `json:"params,omitempty" toon:"params,omitempty"`
	TlsCa         string   `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert       string   `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsKey        string   `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	TlsMaxVersion string   `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
	TlsMinVersion string   `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
	TlsServerName string   `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
	TlsSkipVerify bool     `json:"tls_skip_verify,omitempty" toon:"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" toon:"account_id"`
	ID        uint64 `json:"id" toon:"id"`
	// Identifier used as the `ds_type` of rules, e.g. `prometheus`.
	Ident string `json:"ident" toon:"ident"`
	// Display name, e.g. `Prometheus`.
	Name string `json:"name" toon:"name"`
	// Display order weight; higher appears first.
	Weight int64 `json:"weight" toon:"weight"`
}

DsType is generated from the Flashduty OpenAPI schema.

type DsVictoriaLogsConfig

type DsVictoriaLogsConfig struct {
	BasicAuthEnabled  bool     `json:"basic_auth_enabled,omitempty" toon:"basic_auth_enabled,omitempty"`
	BasicAuthPassword string   `json:"basic_auth_password,omitempty" toon:"basic_auth_password,omitempty"`
	BasicAuthUsername string   `json:"basic_auth_username,omitempty" toon:"basic_auth_username,omitempty"`
	Headers           []string `json:"headers,omitempty" toon:"headers,omitempty"`
	Params            []string `json:"params,omitempty" toon:"params,omitempty"`
	TlsCa             string   `json:"tls_ca,omitempty" toon:"tls_ca,omitempty"`
	TlsCert           string   `json:"tls_cert,omitempty" toon:"tls_cert,omitempty"`
	TlsKey            string   `json:"tls_key,omitempty" toon:"tls_key,omitempty"`
	TlsMaxVersion     string   `json:"tls_max_version,omitempty" toon:"tls_max_version,omitempty"`
	TlsMinVersion     string   `json:"tls_min_version,omitempty" toon:"tls_min_version,omitempty"`
	TlsServerName     string   `json:"tls_server_name,omitempty" toon:"tls_server_name,omitempty"`
	TlsSkipVerify     bool     `json:"tls_skip_verify,omitempty" toon:"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" toon:"access_key_id,omitempty"`
	// Alibaba Cloud Access Key Secret.
	AccessKeySecret string `json:"access_key_secret,omitempty" toon:"access_key_secret,omitempty"`
	// Custom HTTP headers.
	Headers []string `json:"headers,omitempty" toon:"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" toon:"days,omitempty"`
	// End time, e.g. `18:00`.
	Etime string `json:"etime,omitempty" toon:"etime,omitempty"`
	// Start time, e.g. `09:00`.
	Stime string `json:"stime,omitempty" toon:"stime,omitempty"`
}

EnabledTime is generated from the Flashduty OpenAPI schema.

type EnrichFilter

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

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" toon:"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" toon:"kind"`
	// Rule-kind–specific settings. The shape depends on `kind`.
	Settings any `json:"settings" toon:"settings"`
}

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" toon:"integration_id"`
}

EnrichmentInfoRequest is generated from the Flashduty OpenAPI schema.

type EnrichmentItem

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

EnrichmentItem is generated from the Flashduty OpenAPI schema.

type EnrichmentListRequest

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

EnrichmentListRequest is generated from the Flashduty OpenAPI schema.

type EnrichmentListResponse

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

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" toon:"integration_id"`
	// Ordered list of enrichment rules. Replaces all existing rules.
	Rules []EnrichRule `json:"rules" toon:"rules"`
}

EnrichmentUpsertRequest is generated from the Flashduty OpenAPI schema.

type EnvironmentBinding added in v0.5.4

type EnvironmentBinding struct {
	// Environment identifier: a cloud sandbox ID for `cloud` bindings, a runner/environment ID for `byoc` bindings.
	ID string `json:"id" toon:"id"`
	// Environment kind bound to the session: `cloud` (managed sandbox) or `byoc` (self-hosted runner).
	Kind string `json:"kind" toon:"kind"`
	// Human-readable environment name; empty for cloud bindings using the default allowlist.
	Name string `json:"name" toon:"name"`
	// Live binding health, namespaced by kind: BYOC uses online/pending/offline/deleted; cloud uses available/rebuilding/expired.
	Status string `json:"status" toon:"status"`
}

EnvironmentBinding 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 values. The value is a stable wire string — not a localized message and not a numeric status. HTTP status is informational.

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 ("").

func (ErrorCode) String added in v0.5.2

func (e ErrorCode) String() string

String returns the underlying string value, implementing fmt.Stringer.

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" toon:"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" toon:"result_label"`
	// Go `text/template` string. Alert fields are available as `{{.title}}`, `{{.description}}`, and `{{.labels.key}}`. Example: `{{.labels.region}}-{{.labels.env}}`.
	Template string `json:"template" toon:"template"`
}

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" toon:"drop_labels"`
}

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" toon:"g_json,omitempty"`
	// When `true`, overwrite the label if it already exists. Defaults to `false`.
	Override bool `json:"override,omitempty" toon:"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" toon:"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" toon:"result_label"`
	// 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" toon:"source_field"`
}

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" toon:"api_id,omitempty"`
	// Mapping source type. `schema` uses a mapping schema table; `api` calls an external HTTP API.
	MappingType string `json:"mapping_type,omitempty" toon:"mapping_type,omitempty"`
	// When `true`, overwrite labels that already exist. Defaults to `false`.
	Override bool `json:"override,omitempty" toon:"override,omitempty"`
	// Label keys to populate from the mapping lookup result.
	ResultLabels []string `json:"result_labels" toon:"result_labels"`
	// Mapping schema ID (MongoDB ObjectID hex). Required when `mapping_type` is `schema`.
	SchemaID string `json:"schema_id,omitempty" toon:"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" toon:"escalate_window,omitempty"`
	// When true, always escalate regardless of acknowledgement.
	ForceEscalate bool `json:"force_escalate,omitempty" toon:"force_escalate,omitempty"`
	// Max repeat notifications within the level.
	MaxTimes int64 `json:"max_times,omitempty" toon:"max_times,omitempty"`
	// Repeat interval in minutes.
	NotifyStep float64        `json:"notify_step,omitempty" toon:"notify_step,omitempty"`
	Target     EscalateTarget `json:"target" toon:"target"`
}

EscalateLayer is generated from the Flashduty OpenAPI schema.

type EscalateRuleItem

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

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,omitzero" toon:"by,omitempty"`
	// Email addresses to notify (push-only scenarios).
	Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
	// Member IDs to notify directly.
	PersonIDs []int64 `json:"person_ids,omitempty" toon:"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" toon:"schedule_to_role_ids,omitempty"`
	// Team IDs to notify.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
	// Group chat / webhook targets. Required unless `by` is provided.
	Webhooks []EscalateTargetWebhooksItem `json:"webhooks,omitempty" toon:"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" toon:"critical,omitempty"`
	// When true, use each responder's personal preference instead of the lists below.
	FollowPreference bool `json:"follow_preference,omitempty" toon:"follow_preference,omitempty"`
	// Channels for Info events.
	Info []string `json:"info,omitempty" toon:"info,omitempty"`
	// Channels for Warning events.
	Warning []string `json:"warning,omitempty" toon:"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" toon:"settings"`
	// Webhook type (e.g. `feishu`, `dingtalk_app`, `wecom_app`, `slack`, `teams`, `custom`).
	Type string `json:"type" toon:"type"`
}

EscalateTargetWebhooksItem is generated from the Flashduty OpenAPI schema.

type EventItem added in v0.5.4

type EventItem struct {
	// ADK actions envelope (state deltas, transfers, escalation).
	Actions map[string]any `json:"actions" toon:"actions"`
	// Event author (e.g. user, the agent name).
	Author string `json:"author" toon:"author"`
	// ADK branch path for nested agents.
	Branch string `json:"branch" toon:"branch"`
	// ADK content envelope {role, parts:[...]}.
	Content map[string]any `json:"content" toon:"content"`
	// Unix timestamp in milliseconds when the event was written.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Error code when the event represents a failure.
	ErrorCode string `json:"error_code" toon:"error_code"`
	// Human-readable error message, when present.
	ErrorMessage string `json:"error_message" toon:"error_message"`
	// Event identifier.
	EventID string `json:"event_id" toon:"event_id"`
	// ADK invocation id grouping a turn.
	InvocationID string `json:"invocation_id" toon:"invocation_id"`
	// True for a streaming partial chunk.
	Partial bool `json:"partial" toon:"partial"`
	// Owning session id.
	SessionID string `json:"session_id" toon:"session_id"`
	// Event status.
	Status string `json:"status" toon:"status"`
	// True on the terminal event of a turn.
	TurnComplete bool `json:"turn_complete" toon:"turn_complete"`
	// Per-turn token usage metadata.
	UsageMetadata map[string]any `json:"usage_metadata" toon:"usage_metadata"`
}

EventItem is generated from the Flashduty OpenAPI schema.

type ExportLine added in v0.5.4

type ExportLine struct {
	// Account id (on session_meta).
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Dispatched subagent name (on subagent_dispatch).
	AgentName string `json:"agent_name" toon:"agent_name"`
	// Agent app (on session_meta).
	AppName string `json:"app_name" toon:"app_name"`
	// Child session id created by the dispatch (on subagent_dispatch).
	ChildSessionID string `json:"child_session_id" toon:"child_session_id"`
	// Text content of the line (messages, answers, errors).
	Content string `json:"content" toon:"content"`
	// Call duration in milliseconds.
	DurationMs int64 `json:"duration_ms" toon:"duration_ms"`
	// RFC3339 end timestamp; stamped on llm_call/tool_call/session_meta.
	EndedAt string `json:"ended_at" toon:"ended_at"`
	// Error detail when a call failed.
	Error string `json:"error" toon:"error"`
	// Tool call input arguments (on tool_call).
	Input map[string]any `json:"input" toon:"input"`
	// Byte size of the tool input.
	InputBytes int64 `json:"input_bytes" toon:"input_bytes"`
	// Chat model provider key; on session_meta and llm_call.
	Model string `json:"model" toon:"model"`
	// Tool name (on tool_call).
	Name string `json:"name" toon:"name"`
	// Tool call output (on tool_call response side).
	Output string `json:"output" toon:"output"`
	// Byte size of the tool output.
	OutputBytes int64 `json:"output_bytes" toon:"output_bytes"`
	// Parent session id for child sessions (on session_meta).
	ParentSessionID string `json:"parent_session_id" toon:"parent_session_id"`
	// 1-based monotonic sequence within the session (absent on session_meta).
	Seq int64 `json:"seq" toon:"seq"`
	// Session id (on session_meta).
	SessionID string `json:"session_id" toon:"session_id"`
	// RFC3339 start timestamp (session_meta uses session.created_at).
	StartedAt string `json:"started_at" toon:"started_at"`
	// Tool result status, e.g. ok or error.
	Status string `json:"status" toon:"status"`
	// RFC3339 timestamp of the event.
	TS string `json:"ts" toon:"ts"`
	// Line discriminator.
	Type  string      `json:"type" toon:"type"`
	Usage ExportUsage `json:"usage" toon:"usage"`
}

ExportLine is one decoded line of a session export stream. The Type field discriminates the event kind (session_meta, user_message, llm_call, tool_call, subagent_dispatch, final_answer, agent_text, error); the remaining fields are populated per kind. It is hand-maintained here, alongside the hand-written streaming Export endpoint, because the typed generator only models JSON-envelope responses and excludes the NDJSON export stream (so its line schema is pruned as unreferenced).

func DecodeExportLine added in v0.5.4

func DecodeExportLine(line []byte) (*ExportLine, error)

DecodeExportLine unmarshals one raw NDJSON export line into an ExportLine. Use the Type field to discriminate (session_meta, user_message, llm_call, tool_call, subagent_dispatch, final_answer, agent_text, error).

type ExportStatusPageSubscribersRequest

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

ExportStatusPageSubscribersRequest is generated from the Flashduty OpenAPI schema.

type ExportUsage added in v0.5.4

type ExportUsage struct {
	// Tokens written to the prompt cache.
	CacheCreation int64 `json:"cache_creation" toon:"cache_creation"`
	// Tokens served from the prompt cache.
	CacheRead int64 `json:"cache_read" toon:"cache_read"`
	// Prompt (input) tokens for the call.
	InputTokens int64 `json:"input_tokens" toon:"input_tokens"`
	// Generated (output) tokens for the call.
	OutputTokens int64 `json:"output_tokens" toon:"output_tokens"`
}

ExportUsage is the token-usage sub-object on an ExportLine (llm_call events).

type ExportedStatusPageSubscriberItem

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

ExportedStatusPageSubscriberItem is generated from the Flashduty OpenAPI schema.

type FacetCountItem added in v0.5.4

type FacetCountItem struct {
	// Number of events with this facet value in the time range.
	Count int64 `json:"count" toon:"count"`
	// The facet value. Type matches the field's `value_type`.
	FacetValue any `json:"facet_value" toon:"facet_value"`
}

FacetCountItem is generated from the Flashduty OpenAPI schema.

type FacetsService added in v0.5.4

type FacetsService service

FacetsService handles the "RUM/Facets" API resource.

func (*FacetsService) FacetCount added in v0.5.4

Count facet value distribution.

Return the top N values for a facet field within a time range, sorted by occurrence count descending.

API: POST /rum/facet/count (rum-read-facet-count).

func (*FacetsService) FacetList added in v0.5.4

List RUM facet fields.

Return all available RUM field definitions, optionally filtered by scope and facet status.

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

func (*FacetsService) FieldList added in v0.5.4

List RUM fields.

Return RUM field definitions, optionally filtered by scope and facet status.

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

type FeedDetailAlertClose

type FeedDetailAlertClose struct{}

FeedDetailAlertClose is generated from the Flashduty OpenAPI schema.

type FeedDetailAlertComment

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

FeedDetailAlertComment is generated from the Flashduty OpenAPI schema.

type FeedDetailAlertTrigger

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

FeedDetailAlertTrigger is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAck

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

FeedDetailIncidentAck is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAddRspd

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

FeedDetailIncidentAddRspd is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentAssign

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

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" toon:"comment"`
	// Whether replies to this comment are muted.
	MuteReply bool `json:"mute_reply" toon:"mute_reply"`
}

FeedDetailIncidentComment is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentCustomAction

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

FeedDetailIncidentCustomAction is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentMerge

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

FeedDetailIncidentMerge is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentMuteByFlapping

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

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" toon:"reporter_email"`
	Severity      FeedSeverity `json:"severity" toon:"severity"`
	// Initial incident title.
	Title string `json:"title" toon:"title"`
}

FeedDetailIncidentNew is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentNotify

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

FeedDetailIncidentNotify is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentReopen

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

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" toon:"field_name"`
	// New value of the custom field. Type depends on the field definition.
	To any `json:"to" toon:"to"`
}

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" toon:"from"`
	To   FeedSeverity `json:"to" toon:"to"`
}

FeedDetailIncidentResetSeverity is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResetTitle

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

FeedDetailIncidentResetTitle is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentResolve

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

FeedDetailIncidentResolve is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentSnooze

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

FeedDetailIncidentSnooze is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentStorm

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

FeedDetailIncidentStorm is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentUnack

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

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 Timestamp `json:"snoozedBefore" toon:"snoozedBefore"`
}

FeedDetailIncidentWake is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentWarRoomCreate

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

FeedDetailIncidentWarRoomCreate is generated from the Flashduty OpenAPI schema.

type FeedDetailIncidentWarRoomDelete

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

FeedDetailIncidentWarRoomDelete is generated from the Flashduty OpenAPI schema.

type FeedItem

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

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"
)

func (FeedSeverity) String added in v0.5.2

func (e FeedSeverity) String() string

String returns the underlying string value, implementing fmt.Stringer.

type FieldDeleteReference added in v0.5.7

type FieldDeleteReference struct {
	// Console URL for the referencing custom form.
	Href string `json:"href" toon:"href"`
	// Referenced resource kind. Always `custom_form` for this response.
	Kind string `json:"kind" toon:"kind"`
	// Display name of the referencing custom form.
	Name string `json:"name" toon:"name"`
}

FieldDeleteReference is generated from the Flashduty OpenAPI schema.

type FieldDeleteReferenceError added in v0.5.7

type FieldDeleteReferenceError struct {
	Data      FieldDeleteReferenceErrorData `json:"data" toon:"data"`
	Error     any                           `json:"error" toon:"error"`
	RequestID string                        `json:"request_id" toon:"request_id"`
}

FieldDeleteReferenceError is generated from the Flashduty OpenAPI schema.

type FieldDeleteReferenceErrorData added in v0.5.7

type FieldDeleteReferenceErrorData struct {
	Refs []FieldDeleteReference `json:"refs" toon:"refs"`
}

FieldDeleteReferenceErrorData is generated from the Flashduty OpenAPI schema.

type FieldInfoRequest

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

FieldInfoRequest is generated from the Flashduty OpenAPI schema.

type FieldItem

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

FieldItem is generated from the Flashduty OpenAPI schema.

type FieldListRequest

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

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" toon:"key"`
	// 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" toon:"oper"`
	// List of values to match against. Each entry is a plain string or a `/regex/` pattern.
	Vals []string `json:"vals" toon:"vals"`
}

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" toon:"in_mins,omitempty"`
	// Disable flapping detection.
	IsDisabled bool `json:"is_disabled,omitempty" toon:"is_disabled,omitempty"`
	// Max state changes allowed within `in_mins`.
	MaxChanges int64 `json:"max_changes,omitempty" toon:"max_changes,omitempty"`
	// Mute duration in minutes after flapping is detected.
	MuteMins int64 `json:"mute_mins,omitempty" toon:"mute_mins,omitempty"`
}

Flapping is generated from the Flashduty OpenAPI schema.

type GetWarRoomDefaultObserversRequest added in v0.4.0

type GetWarRoomDefaultObserversRequest struct {
	// Incident ID, a MongoDB ObjectID hex string.
	IncidentID string `json:"incident_id" toon:"incident_id"`
}

GetWarRoomDefaultObserversRequest is generated from the Flashduty OpenAPI schema.

type GetWarRoomDefaultObserversResponse added in v0.4.0

type GetWarRoomDefaultObserversResponse struct {
	// Historical responders suggested as default war-room observers.
	Observers []WarRoomPersonItem `json:"observers" toon:"observers"`
}

GetWarRoomDefaultObserversResponse is generated from the Flashduty OpenAPI schema.

type GetWarRoomDetailRequest

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

GetWarRoomDetailRequest is generated from the Flashduty OpenAPI schema.

type GetWebhookHistoryDetailRequest

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

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" toon:"all_equals_required,omitempty"`
	// Per-filter grouping overrides.
	Cases []map[string]any `json:"cases,omitempty" toon:"cases,omitempty"`
	// Groups of label keys whose equality defines a bucket.
	Equals [][]string `json:"equals,omitempty" toon:"equals,omitempty"`
	// Label keys used for intelligent grouping embeddings.
	IKeys []string `json:"i_keys,omitempty" toon:"i_keys,omitempty"`
	// Intelligent grouping similarity threshold.
	IScoreThreshold float64 `json:"i_score_threshold,omitempty" toon:"i_score_threshold,omitempty"`
	// Grouping method: `i` intelligent, `p` pattern, `n` none.
	Method string `json:"method" toon:"method"`
	// Alert storm threshold.
	StormThreshold int64 `json:"storm_threshold,omitempty" toon:"storm_threshold,omitempty"`
	// Multi-level storm thresholds.
	StormThresholds []int64 `json:"storm_thresholds,omitempty" toon:"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" toon:"time_window,omitempty"`
	// Window type. Defaults to `tumbling`.
	WindowType string `json:"window_type,omitempty" toon:"window_type,omitempty"`
}

Group is generated from the Flashduty OpenAPI schema.

type IDRequest

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

IDRequest is generated from the Flashduty OpenAPI schema.

type ImIntegrationsService added in v0.4.0

type ImIntegrationsService service

ImIntegrationsService handles the "On-call/IM integrations" API resource.

func (*ImIntegrationsService) List added in v0.4.0

List war-room-enabled IM integrations.

List IM integrations that have the war-room feature enabled for the account.

API: POST /datasource/im/war-room-enabled/list (im-war-room-enabled-list).

type Image

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

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" toon:"all,omitempty"`
	// Specific event IDs the subscriber should receive notifications for.
	ChangeIDs []int64 `json:"change_ids,omitempty" toon:"change_ids,omitempty"`
	// Component IDs the subscriber should receive notifications for.
	ComponentIDs []string `json:"component_ids,omitempty" toon:"component_ids,omitempty"`
	// Preferred locale for notifications. Defaults to the request locale when omitted.
	Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
	// Email address (for public pages) or user ID (for internal pages).
	Recipient string `json:"recipient" toon:"recipient"`
}

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" toon:"method"`
	// Target status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Subscribers to import.
	Subscribers []ImportStatusPageSubscriberItem `json:"subscribers,omitempty" toon:"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" toon:"Processing"`
	// Count of triggered incidents in the last 30 days.
	Triggered int64 `json:"Triggered" toon:"Triggered"`
}

IncProgressCnts is generated from the Flashduty OpenAPI schema.

type IncidentActionImage added in v0.5.7

type IncidentActionImage struct {
	// Alternative text for the image.
	Alt string `json:"alt,omitempty" toon:"alt,omitempty"`
	// Optional link that the image points to.
	Href string `json:"href,omitempty" toon:"href,omitempty"`
	// Image source. Accepts an `img_` upload token, an `http(s)` URL, or an object-storage key beginning with `/`.
	Src string `json:"src" toon:"src"`
}

IncidentActionImage is generated from the Flashduty OpenAPI schema.

type IncidentCardHiddenFields added in v0.5.7

type IncidentCardHiddenFields map[string][]string

IncidentCardHiddenFields is a map response payload.

type IncidentFeedItem

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

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"
)

func (IncidentFeedType) String added in v0.5.2

func (e IncidentFeedType) String() string

String returns the underlying string value, implementing fmt.Stringer.

type IncidentInfo

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

IncidentInfo is generated from the Flashduty OpenAPI schema.

type IncidentInfoRequest

type IncidentInfoRequest struct {
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
	// Short incident ID (the 6-character uppercased id shown in the UI). Not unique — resolves to the most recent match. Supply either incident_id or num.
	Num string `json:"num,omitempty" toon:"num,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" toon:"has_next_page"`
	// Incident list for the current page.
	Items []IncidentInfo `json:"items" toon:"items"`
	// Opaque cursor to pass as `search_after_ctx` on the next request.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total number of matching incidents.
	Total int64 `json:"total" toon:"total"`
}

IncidentListResponse is generated from the Flashduty OpenAPI schema.

type IncidentRawItem

type IncidentRawItem struct {
	Acknowledgements int64 `json:"acknowledgements" toon:"acknowledgements"`
	// Current assignment target for the incident.
	AssignedTo  IncidentRawItemAssignedTo `json:"assigned_to" toon:"assigned_to"`
	Assignments int64                     `json:"assignments" toon:"assignments"`
	ChannelID   int64                     `json:"channel_id" toon:"channel_id"`
	ChannelName string                    `json:"channel_name" toon:"channel_name"`
	ClosedBy    string                    `json:"closed_by" toon:"closed_by"`
	// Member ID of the person who closed the incident.
	CloserID int64 `json:"closer_id" toon:"closer_id"`
	// Display name of the person who closed the incident.
	CloserName     string `json:"closer_name" toon:"closer_name"`
	CreatedAt      int64  `json:"created_at" toon:"created_at"`
	CreatorID      int64  `json:"creator_id" toon:"creator_id"`
	CreatorName    string `json:"creator_name" toon:"creator_name"`
	Description    string `json:"description" toon:"description"`
	EngagedSeconds int64  `json:"engaged_seconds" toon:"engaged_seconds"`
	Escalations    int64  `json:"escalations" toon:"escalations"`
	// Whether the incident has ever been muted.
	EverMuted bool           `json:"ever_muted" toon:"ever_muted"`
	Fields    map[string]any `json:"fields" toon:"fields"`
	// Incident frequency classification.
	Frequency         string            `json:"frequency" toon:"frequency"`
	Hours             string            `json:"hours" toon:"hours"`
	IncidentID        string            `json:"incident_id" toon:"incident_id"`
	Interruptions     int64             `json:"interruptions" toon:"interruptions"`
	Labels            map[string]string `json:"labels" toon:"labels"`
	ManualEscalations int64             `json:"manual_escalations" toon:"manual_escalations"`
	Notifications     int64             `json:"notifications" toon:"notifications"`
	// Member ID of the incident owner.
	OwnerID int64 `json:"owner_id" toon:"owner_id"`
	// Display name of the incident owner.
	OwnerName string `json:"owner_name" toon:"owner_name"`
	// Incident progress state — one of `Triggered`, `Processing`, `Closed`.
	Progress       string           `json:"progress" toon:"progress"`
	Reassignments  int64            `json:"reassignments" toon:"reassignments"`
	Responders     []map[string]any `json:"responders" toon:"responders"`
	SecondsToAck   int64            `json:"seconds_to_ack" toon:"seconds_to_ack"`
	SecondsToClose int64            `json:"seconds_to_close" toon:"seconds_to_close"`
	Severity       string           `json:"severity" toon:"severity"`
	// Unix timestamp in seconds until which the incident is snoozed.
	SnoozedBefore      Timestamp `json:"snoozed_before" toon:"snoozed_before"`
	TeamID             int64     `json:"team_id" toon:"team_id"`
	TeamName           string    `json:"team_name" toon:"team_name"`
	TimeoutEscalations int64     `json:"timeout_escalations" toon:"timeout_escalations"`
	Title              string    `json:"title" toon:"title"`
}

IncidentRawItem is generated from the Flashduty OpenAPI schema.

type IncidentRawItemAssignedTo

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

IncidentRawItemAssignedTo is generated from the Flashduty OpenAPI schema.

type IncidentShort

type IncidentShort struct {
	// Incident ID (ObjectID hex string).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// Incident progress — one of `Triggered`, `Processing`, `Closed`.
	Progress string `json:"progress" toon:"progress"`
	// Incident title.
	Title string `json:"title" toon:"title"`
}

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 IncidentsPostmortemReadTemplateInfoRequest added in v0.5.4

type IncidentsPostmortemReadTemplateInfoRequest struct {
	// Template ID.
	TemplateID string `url:"template_id"`
}

IncidentsPostmortemReadTemplateInfoRequest holds the query parameters for Get post-mortem template detail.

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 a post-mortem report by its `post_mortem_id`. List reports via `/incident/post-mortem/list` first — each row carries the incident it covers — then fetch the full report here by that id.

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) PostMortemWriteResetContent added in v0.5.9

Reset post-mortem content.

Replace the body of a drafting post-mortem report with Markdown.

API: POST /incident/post-mortem/content/reset (incident-post-mortem-write-reset-content).

func (*IncidentsService) PostmortemReadListTemplates added in v0.5.4

List post-mortem templates.

Return built-in and custom post-mortem templates for the account.

API: POST /incident/post-mortem/template/list (postmortem-read-list-templates).

func (*IncidentsService) PostmortemReadTemplateInfo added in v0.5.4

Get post-mortem template detail.

Return one post-mortem template by ID.

API: GET /incident/post-mortem/template/info (postmortem-read-template-info).

func (*IncidentsService) PostmortemWriteDeleteTemplate added in v0.5.4

func (s *IncidentsService) PostmortemWriteDeleteTemplate(ctx context.Context, req *DeletePostMortemTemplateRequest) (*Response, error)

Delete post-mortem template.

Delete a custom post-mortem template.

API: POST /incident/post-mortem/template/delete (postmortem-write-delete-template).

func (*IncidentsService) PostmortemWriteInit added in v0.5.4

func (s *IncidentsService) PostmortemWriteInit(ctx context.Context, req *InitPostMortemRequest) (*PostMortemItem, *Response, error)

Initialize post-mortem.

Create a post-mortem draft from one or more incidents and a template.

API: POST /incident/post-mortem/init (postmortem-write-init).

func (*IncidentsService) PostmortemWriteResetBasics added in v0.5.4

func (s *IncidentsService) PostmortemWriteResetBasics(ctx context.Context, req *ResetPostMortemBasicsRequest) (*Response, error)

Update post-mortem basics.

Replace the incident facts stored in a post-mortem report.

API: POST /incident/post-mortem/basics/reset (postmortem-write-reset-basics).

func (*IncidentsService) PostmortemWriteResetFollowUps added in v0.5.4

func (s *IncidentsService) PostmortemWriteResetFollowUps(ctx context.Context, req *ResetPostMortemFollowUpsRequest) (*Response, error)

Update post-mortem follow-ups.

Replace the follow-up action items on a post-mortem report.

API: POST /incident/post-mortem/follow-ups/reset (postmortem-write-reset-follow-ups).

func (*IncidentsService) PostmortemWriteResetStatus added in v0.5.4

func (s *IncidentsService) PostmortemWriteResetStatus(ctx context.Context, req *ResetPostMortemStatusRequest) (*Response, error)

Update post-mortem status.

Set a post-mortem report to drafting or published.

API: POST /incident/post-mortem/status/reset (postmortem-write-reset-status).

func (*IncidentsService) PostmortemWriteResetTitle added in v0.5.4

func (s *IncidentsService) PostmortemWriteResetTitle(ctx context.Context, req *ResetPostMortemTitleRequest) (*Response, error)

Update post-mortem title.

Replace the title of a post-mortem report.

API: POST /incident/post-mortem/title/reset (postmortem-write-reset-title).

func (*IncidentsService) PostmortemWriteUpsertTemplate added in v0.5.4

func (s *IncidentsService) PostmortemWriteUpsertTemplate(ctx context.Context, req *UpsertPostMortemTemplateRequest) (*PostMortemTemplate, *Response, error)

Create or update post-mortem template.

Create a custom post-mortem template or update an existing one.

API: POST /incident/post-mortem/template/upsert (postmortem-write-upsert-template).

func (*IncidentsService) ReadGetWarRoomDefaultObservers added in v0.4.0

Get war-room default observers.

Return historical responders suggested as default observers when opening a war room.

API: POST /incident/war-room/default-observers (incident-read-get-war-room-default-observers).

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) ServiceDeskPlusRequestReadList added in v0.5.8

Get ServiceDeskPlus linked incidents.

List synchronization mappings between ServiceDeskPlus requests and Flashduty incidents.

API: POST /incident/sdp/request/list (incident-service-desk-plus-request-read-list).

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).

func (*IncidentsService) WriteAddWarRoomMember added in v0.4.0

func (s *IncidentsService) WriteAddWarRoomMember(ctx context.Context, req *AddWarRoomMemberRequest) (*string, *Response, error)

Add war-room member.

Add one or more members to the IM war room bound to an incident integration.

API: POST /incident/war-room/add-member (incident-write-add-war-room-member).

type InhibitRuleItem

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

InhibitRuleItem is generated from the Flashduty OpenAPI schema.

type InitPostMortemRequest added in v0.5.4

type InitPostMortemRequest struct {
	// Incident IDs to link to the report. 1-10 incidents.
	IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
	// Template ID used to initialize the report.
	TemplateID string `json:"template_id" toon:"template_id"`
}

InitPostMortemRequest is generated from the Flashduty OpenAPI schema.

type InsightAlertByLabelItem

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

InsightAlertByLabelItem is generated from the Flashduty OpenAPI schema.

type InsightAlertByLabelResponse

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

InsightAlertByLabelResponse is generated from the Flashduty OpenAPI schema.

type InsightFilter

type InsightFilter struct {
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// 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" toon:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
	// Include incidents that have ever been muted. By default, they are excluded.
	IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,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" toon:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"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" toon:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"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" toon:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"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" toon:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// 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" toon:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
	// Include incidents that have ever been muted. By default, they are excluded.
	IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,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" toon:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"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" toon:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"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" toon:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"time_zone,omitempty"`
}

InsightIncidentListRequest is generated from the Flashduty OpenAPI schema.

type InsightIncidentListResponse

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

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" toon:"aggregate_unit,omitempty"`
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// 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" toon:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
	// Include incidents that have ever been muted. By default, they are excluded.
	IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,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" toon:"is_my_team,omitempty"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
	// Field to sort the underlying incident set by.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"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" toon:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"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" toon:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
	// When true, metrics are split into `work`/`sleep`/`off` hour buckets.
	SplitHours bool `json:"split_hours,omitempty" toon:"split_hours,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"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" toon:"aggregate_unit,omitempty"`
	// Sort ascending when `true`, descending otherwise.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by channel IDs. At most 100 entries.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Strip HTML markup from the description column when exporting.
	DescriptionHTMLToText bool `json:"description_html_to_text,omitempty" toon:"description_html_to_text,omitempty"`
	// End time, Unix seconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// 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" toon:"export_fields,omitempty"`
	// Custom-field filters (exact match).
	Fields map[string]any `json:"fields,omitempty" toon:"fields,omitempty"`
	// Filter by incident IDs (MongoDB ObjectIDs). At most 100 entries.
	IncidentIDs []string `json:"incident_ids,omitempty" toon:"incident_ids,omitempty"`
	// Include incidents that have ever been muted. By default, they are excluded.
	IncludeEverMuted bool `json:"include_ever_muted,omitempty" toon:"include_ever_muted,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" toon:"is_my_team,omitempty"`
	// Number of top entries to return, between 1 and 100.
	K int64 `json:"k,omitempty" toon:"k,omitempty"`
	// Dimension to aggregate by.
	Label string `json:"label" toon:"label"`
	// Label filters (exact match).
	Labels map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
	// Field to sort results by.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Full-text query applied to incident title and description.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by responder person IDs. At most 100 entries.
	ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
	// Lower bound (inclusive) on time-to-acknowledge, in seconds.
	SecondsToAckFrom int64 `json:"seconds_to_ack_from,omitempty" toon:"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" toon:"seconds_to_ack_to,omitempty"`
	// Lower bound (inclusive) on time-to-close, in seconds.
	SecondsToCloseFrom int64 `json:"seconds_to_close_from,omitempty" toon:"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" toon:"seconds_to_close_to,omitempty"`
	// Filter by severity. At most 3 entries.
	Severities []string `json:"severities,omitempty" toon:"severities,omitempty"`
	// When true, metrics are split into `work`/`sleep`/`off` hour buckets.
	SplitHours bool `json:"split_hours,omitempty" toon:"split_hours,omitempty"`
	// Start time, Unix seconds. Must be greater than 0.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Filter by team IDs. At most 100 entries.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"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 (s *IntegrationsService) DatasourceImPersonTryLink(ctx context.Context, req *TryLinkPersonRequest) (*TryLinkPersonResponse, *Response, error)

Attempt IM person linking.

Try to automatically link unbound members to their IM accounts for one integration.

API: POST /datasource/im/person/try-link (datasourceImPersonTryLink).

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" toon:"country_code,omitempty"`
	// Email address
	Email string `json:"email,omitempty" toon:"email,omitempty"`
	// Locale
	Locale string `json:"locale,omitempty" toon:"locale,omitempty"`
	// Display name
	MemberName string `json:"member_name,omitempty" toon:"member_name,omitempty"`
	// Phone number
	Phone string `json:"phone,omitempty" toon:"phone,omitempty"`
	// External reference ID
	RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
	// Role IDs to assign
	RoleIDs []int64 `json:"role_ids,omitempty" toon:"role_ids,omitempty"`
	// Time zone
	TimeZone string `json:"time_zone,omitempty" toon:"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 LicenseListResponse added in v0.5.7

type LicenseListResponse struct {
	// People holding an active license.
	Items []LicensePersonItem `json:"items" toon:"items"`
	// Number of people holding an active license.
	Total int64 `json:"total" toon:"total"`
}

LicenseListResponse is generated from the Flashduty OpenAPI schema.

type LicensePersonItem added in v0.5.7

type LicensePersonItem struct {
	// Unix timestamp when a fixed license was assigned. `0` for temporary licenses.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// ID of the licensed person.
	PersonID int64 `json:"person_id" toon:"person_id"`
	// Display name of the licensed person.
	PersonName string `json:"person_name" toon:"person_name"`
	// License assignment type. `fixed` is explicitly assigned; `temporary` is held from the active license window.
	Type string `json:"type" toon:"type"`
	// Unix timestamp when a fixed license was last changed. `0` for temporary licenses.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
	// Person ID that last changed a fixed license. `0` for temporary licenses.
	UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}

LicensePersonItem is generated from the Flashduty OpenAPI schema.

type LicensesService added in v0.5.7

type LicensesService service

LicensesService handles the "On-call/Licenses" API resource.

func (*LicensesService) List added in v0.5.7

List On-call licenses.

List people with active fixed or temporary On-call licenses in the current account.

API: POST /oncall/license/list (oncall-license-read-license-list).

type LinkItem

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

LinkItem is generated from the Flashduty OpenAPI schema.

type ListChangeRequest added in v0.4.0

type ListChangeRequest struct {
	ListOptions
	// Sort in ascending order when true.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by collaboration channel IDs.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Unix timestamp in seconds for the end of the query window.
	EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"`
	// Include the underlying change events for each change when true.
	IncludeEvents bool `json:"include_events,omitempty" toon:"include_events,omitempty"`
	// Filter by reporting integration IDs.
	IntegrationIDs []int64 `json:"integration_ids,omitempty" toon:"integration_ids,omitempty"`
	// Field to sort the result by.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Free-text or regular-expression search over change fields.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Unix timestamp in seconds for the start of the query window.
	StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"`
}

ListChangeRequest is generated from the Flashduty OpenAPI schema.

type ListChangeResponse added in v0.4.0

type ListChangeResponse struct {
	// Whether more pages are available after this one.
	HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
	// Changes on the current page.
	Items []ChangeItem `json:"items" toon:"items"`
	// Total number of matching changes.
	Total int64 `json:"total" toon:"total"`
}

ListChangeResponse is generated from the Flashduty OpenAPI schema.

type ListChannelsRequest

type ListChannelsRequest struct {
	ListOptions
	// When true, sort ascending.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by explicit channel IDs.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Exact-match filter on channel name. Takes priority over `query` for name filtering.
	ChannelName string `json:"channel_name,omitempty" toon:"channel_name,omitempty"`
	// When true, return only brief fields (`channel_id`, `channel_name`, `description`, `status`).
	IsBrief bool `json:"is_brief,omitempty" toon:"is_brief,omitempty"`
	// When true, return only channels the caller manages.
	IsMyManaged bool `json:"is_my_managed,omitempty" toon:"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" toon:"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" toon:"is_my_team,omitempty"`
	// Field used to order results.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Free-text query against channel name/description.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"has_next_page"`
	Items       []ChannelItem `json:"items" toon:"items"`
	// Total matching channels.
	Total int64 `json:"total" toon:"total"`
}

ListChannelsResponse is generated from the Flashduty OpenAPI schema.

type ListDropRulesResponse

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

ListDropRulesResponse is generated from the Flashduty OpenAPI schema.

type ListEscalationRulesResponse

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

ListEscalationRulesResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentAlertsRequest

type ListIncidentAlertsRequest struct {
	ListOptions
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// When true, include at most the 20 newest raw events in each alert item as a preview.
	IncludeEvents bool `json:"include_events,omitempty" toon:"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" toon:"is_active,omitempty"`
}

ListIncidentAlertsRequest is generated from the Flashduty OpenAPI schema.

type ListIncidentAlertsResponse

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

ListIncidentAlertsResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentFeedRequest

type ListIncidentFeedRequest struct {
	ListOptions
	// Ascending chronological order when true.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// Optional filter restricting the returned entries to specific types.
	Types []IncidentFeedType `json:"types,omitempty" toon:"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" toon:"has_next_page"`
	// Timeline entries for the current page.
	Items []IncidentFeedItem `json:"items" toon:"items"`
}

ListIncidentFeedResponse is generated from the Flashduty OpenAPI schema.

type ListIncidentsByIDsRequest

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

ListIncidentsByIDsRequest is generated from the Flashduty OpenAPI schema.

type ListIncidentsRequest

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

ListIncidentsRequest is generated from the Flashduty OpenAPI schema.

type ListInhibitRulesResponse

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

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" toon:"incident_id"`
	// Maximum number of similar incidents to return.
	Limit *int64 `json:"limit,omitempty" toon:"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" toon:"items"`
}

ListPastIncidentsResponse is generated from the Flashduty OpenAPI schema.

type ListPostMortemTemplatesRequest added in v0.5.4

type ListPostMortemTemplatesRequest struct {
	ListOptions
	// Ascending order when true.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Field used to order results.
	OrderBy string `json:"order_by,omitempty" toon:"order_by,omitempty"`
}

ListPostMortemTemplatesRequest is generated from the Flashduty OpenAPI schema.

type ListPostMortemTemplatesResponse added in v0.5.4

type ListPostMortemTemplatesResponse struct {
	// True when another page is available.
	HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
	// Templates in the current page.
	Items []PostMortemTemplate `json:"items" toon:"items"`
	// Cursor for forward pagination.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total matching templates.
	Total int64 `json:"total" toon:"total"`
}

ListPostMortemTemplatesResponse is generated from the Flashduty OpenAPI schema.

type ListPostMortemsRequest

type ListPostMortemsRequest struct {
	ListOptions
	// Ascending order when true.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Channel IDs to restrict the query to.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Filter by creation time: upper bound in seconds.
	CreatedAtEndSeconds int64 `json:"created_at_end_seconds,omitempty" toon:"created_at_end_seconds,omitempty"`
	// Filter by creation time: lower bound in seconds.
	CreatedAtStartSeconds int64 `json:"created_at_start_seconds,omitempty" toon:"created_at_start_seconds,omitempty"`
	// Field used to order results.
	OrderBy string `json:"order_by,omitempty" toon:"order_by,omitempty"`
	// Report status. Defaults to `published` on the server when omitted.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
	// Team IDs to restrict the query to.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"has_next_page"`
	// Post-mortem metadata for the current page.
	Items []PostMortemMeta `json:"items" toon:"items"`
	// Cursor for forward pagination.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total matching reports.
	Total int64 `json:"total" toon:"total"`
}

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" toon:"integration_ids"`
}

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" toon:"items"`
}

ListRoutesResponse is generated from the Flashduty OpenAPI schema.

type ListSilenceRulesResponse

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

ListSilenceRulesResponse is generated from the Flashduty OpenAPI schema.

type ListStatusPageResponse added in v0.4.0

type ListStatusPageResponse struct {
	// Status pages owned by the account.
	Items []StatusPageItem `json:"items" toon:"items"`
}

ListStatusPageResponse is generated from the Flashduty OpenAPI schema.

type ListWarRoomEnabledResponse added in v0.4.0

type ListWarRoomEnabledResponse struct {
	// IM integrations with the war-room feature enabled.
	Items []WarRoomDataSourceItem `json:"items" toon:"items"`
}

ListWarRoomEnabledResponse is generated from the Flashduty OpenAPI schema.

type ListWarRoomsRequest

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

ListWarRoomsRequest is generated from the Flashduty OpenAPI schema.

type ListWarRoomsResponse

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

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" toon:"asc,omitempty"`
	// Window end time in Unix milliseconds. Must be greater than `start_time`.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// Filter by event type values.
	EventTypes []string `json:"event_types,omitempty" toon:"event_types,omitempty"`
	// Filter by integration ID.
	IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
	// Page size.
	Limit int64 `json:"limit" toon:"limit"`
	// Sort field. Currently only `event_time` is supported.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Reference ID filter (incident or alert ID).
	RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
	// Opaque cursor returned by a previous call for fetching the next page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
	// Window start time in Unix milliseconds.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Filter by delivery status.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
}

ListWebhookHistoryRequest is generated from the Flashduty OpenAPI schema.

type ListWebhookHistoryResponse

type ListWebhookHistoryResponse struct {
	Items []WebhookHistoryItem `json:"items" toon:"items"`
	// 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" toon:"search_after_ctx"`
	// Total number of matching records.
	Total int64 `json:"total" toon:"total"`
}

ListWebhookHistoryResponse is generated from the Flashduty OpenAPI schema.

type LogPatternDiagnoseSummary added in v0.5.7

type LogPatternDiagnoseSummary struct {
	// Total aggregated pattern evidence items before the response limit is applied.
	AggregatedPatternEvidenceTotal int64 `json:"aggregated_pattern_evidence_total" toon:"aggregated_pattern_evidence_total"`
	// Log sample summary for the baseline window.
	BaselineSample *LogPatternSampleSummary `json:"baseline_sample,omitempty" toon:"baseline_sample,omitempty"`
	// Log sample summary for the current window.
	CurrentSample LogPatternSampleSummary `json:"current_sample" toon:"current_sample"`
	// Factual summary generated from coverage, selection, and return counts.
	EvidenceSummary string `json:"evidence_summary" toon:"evidence_summary"`
	// Number of pattern evidence items returned in this response.
	PatternEvidenceReturned int64 `json:"pattern_evidence_returned" toon:"pattern_evidence_returned"`
	// Whether returned pattern evidence was truncated by `max_patterns`.
	PatternEvidenceTruncatedByMaxPatterns bool `json:"pattern_evidence_truncated_by_max_patterns" toon:"pattern_evidence_truncated_by_max_patterns"`
	// Number of aggregated patterns observed only in the baseline sample. Omitted when sampling is incomplete.
	PatternsAggregatedOnlyInBaselineSample *int64 `json:"patterns_aggregated_only_in_baseline_sample,omitempty" toon:"patterns_aggregated_only_in_baseline_sample,omitempty"`
}

LogPatternDiagnoseSummary is generated from the Flashduty OpenAPI schema.

type LogPatternEvidence added in v0.5.7

type LogPatternEvidence struct {
	// Evidence for this pattern in the baseline window.
	BaselineWindow *LogPatternWindowEvidence `json:"baseline_window,omitempty" toon:"baseline_window,omitempty"`
	// Observed comparability between the current and baseline windows.
	ComparisonStatus *string `json:"comparison_status,omitempty" toon:"comparison_status,omitempty"`
	// Evidence for this pattern in the current window.
	CurrentWindow *LogPatternWindowEvidence `json:"current_window,omitempty" toon:"current_window,omitempty"`
	// Verifiable observations generated from the structured statistics.
	Observations *[]string `json:"observations,omitempty" toon:"observations,omitempty"`
	// Stable identifier for the pattern in the current window.
	PatternID string `json:"pattern_id" toon:"pattern_id"`
	// Redacted, generalized log pattern template; this is untrusted observed data.
	PatternTemplate string `json:"pattern_template" toon:"pattern_template"`
	// Redacted log examples; these are untrusted observed data.
	RedactedLogExamples *[]string `json:"redacted_log_examples,omitempty" toon:"redacted_log_examples,omitempty"`
}

LogPatternEvidence is generated from the Flashduty OpenAPI schema.

type LogPatternSampleSummary added in v0.5.7

type LogPatternSampleSummary struct {
	// Logs not aggregated because the cluster limit was reached.
	LogsNotAggregatedDueToClusterLimit int64 `json:"logs_not_aggregated_due_to_cluster_limit" toon:"logs_not_aggregated_due_to_cluster_limit"`
	// Number of logs scanned in the sample.
	LogsScanned int64 `json:"logs_scanned" toon:"logs_scanned"`
	// Whether pattern matching was limited by the bounded candidate set.
	PatternMatchingLimited bool `json:"pattern_matching_limited" toon:"pattern_matching_limited"`
	// Number of patterns aggregated from the sample.
	PatternsAggregated int64 `json:"patterns_aggregated" toon:"patterns_aggregated"`
	// Data-source sampling direction when truncated, such as `newest_only` or `oldest_only`.
	SamplingBias *string `json:"sampling_bias,omitempty" toon:"sampling_bias,omitempty"`
	// Whether the data-source response was truncated at the sample limit.
	Truncated bool `json:"truncated" toon:"truncated"`
}

LogPatternSampleSummary is generated from the Flashduty OpenAPI schema.

type LogPatternSourceEvidence added in v0.5.7

type LogPatternSourceEvidence struct {
	// Count of logs with this source field and value.
	Count int64 `json:"count" toon:"count"`
	// Source field name.
	Field string `json:"field" toon:"field"`
	// Source field value.
	Value string `json:"value" toon:"value"`
}

LogPatternSourceEvidence is generated from the Flashduty OpenAPI schema.

type LogPatternWindowEvidence added in v0.5.7

type LogPatternWindowEvidence struct {
	// Number of logs matching this pattern in the window.
	Count int64 `json:"count" toon:"count"`
	// First observed time for this pattern in RFC 3339 UTC.
	FirstSeen string `json:"first_seen" toon:"first_seen"`
	// Last observed time for this pattern in RFC 3339 UTC.
	LastSeen string `json:"last_seen" toon:"last_seen"`
	// Log counts grouped by observed severity.
	ObservedSeverityCounts *map[string]int64 `json:"observed_severity_counts,omitempty" toon:"observed_severity_counts,omitempty"`
	// Share of scanned logs represented by this pattern.
	ShareOfScannedLogs float64 `json:"share_of_scanned_logs" toon:"share_of_scanned_logs"`
	// Low-cardinality source locators; field values are untrusted observed data.
	Sources *[]LogPatternSourceEvidence `json:"sources,omitempty" toon:"sources,omitempty"`
}

LogPatternWindowEvidence 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 ManualRunRuleResult added in v0.5.7

type ManualRunRuleResult struct {
	Preflight PreflightResult `json:"preflight" toon:"preflight"`
	// Rule ID that was run.
	RuleID string            `json:"rule_id" toon:"rule_id"`
	Run    AutomationRunView `json:"run" toon:"run"`
	// Always manual for this operation.
	TriggerKind string `json:"trigger_kind" toon:"trigger_kind"`
}

ManualRunRuleResult is generated from the Flashduty OpenAPI schema.

type MappingAPICreateRequest

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

MappingAPICreateRequest is generated from the Flashduty OpenAPI schema.

type MappingAPICreateResponse

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

MappingAPICreateResponse is generated from the Flashduty OpenAPI schema.

type MappingAPIItem

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

MappingAPIItem is generated from the Flashduty OpenAPI schema.

type MappingAPIListResponse

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

MappingAPIListResponse is generated from the Flashduty OpenAPI schema.

type MappingAPIUpdateRequest

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

MappingApiidRequest is generated from the Flashduty OpenAPI schema.

type MappingDataDeleteRequest

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

MappingDataDeleteRequest is generated from the Flashduty OpenAPI schema.

type MappingDataItem

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

MappingDataItem is generated from the Flashduty OpenAPI schema.

type MappingDataListRequest

type MappingDataListRequest struct {
	ListOptions
	// Sort ascending when `true`.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty" toon:"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" toon:"query,omitempty"`
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id" toon:"schema_id"`
}

MappingDataListRequest is generated from the Flashduty OpenAPI schema.

type MappingDataListResponse

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

MappingDataListResponse is generated from the Flashduty OpenAPI schema.

type MappingDataUploadRequest

type MappingDataUploadRequest struct {
	// CSV file to upload.
	File string `json:"file,omitempty" toon:"file,omitempty"`
	// Mapping schema ID (query parameter).
	SchemaID string `json:"schema_id,omitempty" toon:"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" toon:"docs"`
	// Mapping schema ID (MongoDB ObjectID hex).
	SchemaID string `json:"schema_id" toon:"schema_id"`
}

MappingDataUpsertRequest is generated from the Flashduty OpenAPI schema.

type MappingDataUpsertResponse

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

MappingDataUpsertResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaCreateRequest

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

MappingSchemaCreateResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaIDRequest

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

MappingSchemaIDRequest is generated from the Flashduty OpenAPI schema.

type MappingSchemaItem

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

MappingSchemaItem is generated from the Flashduty OpenAPI schema.

type MappingSchemaListResponse

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

MappingSchemaListResponse is generated from the Flashduty OpenAPI schema.

type MappingSchemaUpdateRequest

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

MappingSchemaUpdateRequest is generated from the Flashduty OpenAPI schema.

type McpServerCreateRequest added in v0.4.0

type McpServerCreateRequest struct {
	// Allow this server's OAuth token exchange over plaintext HTTP. Testing use only; defaults to false.
	AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
	// Skip TLS certificate verification when connecting to this server. Testing use only; defaults to false.
	AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
	// Command arguments (stdio transport).
	Args []string `json:"args,omitempty" toon:"args,omitempty"`
	// Authentication mode: shared (default), per_user_secret, or per_user_oauth.
	AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
	// Tool-call timeout in seconds. 0 = default (60s).
	CallTimeout int64 `json:"call_timeout,omitempty" toon:"call_timeout,omitempty"`
	// Executable command (stdio transport).
	Command string `json:"command,omitempty" toon:"command,omitempty"`
	// Connection timeout in seconds. 0 = default (10s).
	ConnectTimeout int64 `json:"connect_timeout,omitempty" toon:"connect_timeout,omitempty"`
	// Server description.
	Description string `json:"description" toon:"description"`
	// Environment variables (stdio transport).
	Env map[string]string `json:"env,omitempty" toon:"env,omitempty"`
	// Runner ID; required when environment_kind is byoc.
	EnvironmentID string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// Pin the server to a specific BYOC runner (`environment_id` required). Omit or send empty for automatic selection; `cloud` is not supported for MCP servers.
	EnvironmentKind string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// HTTP headers (sse / streamable-http).
	Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
	// JSON OAuth metadata; reserved for per_user_oauth.
	OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
	// JSON secret schema; required when auth_mode=per_user_secret.
	SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
	// MCP server name, unique within the account.
	ServerName string `json:"server_name" toon:"server_name"`
	// Marketplace template name when created from a connector template.
	SourceTemplateName string `json:"source_template_name,omitempty" toon:"source_template_name,omitempty"`
	// Initial status.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
	// Team scope: 0 = account-wide; >0 = team.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Transport protocol.
	Transport string `json:"transport" toon:"transport"`
	// Server URL (sse / streamable-http transport).
	URL string `json:"url,omitempty" toon:"url,omitempty"`
}

McpServerCreateRequest is generated from the Flashduty OpenAPI schema.

type McpServerDeleteRequest added in v0.4.0

type McpServerDeleteRequest struct {
	// Target MCP server ID.
	ServerID string `json:"server_id" toon:"server_id"`
}

McpServerDeleteRequest is generated from the Flashduty OpenAPI schema.

type McpServerGetRequest added in v0.4.0

type McpServerGetRequest struct {
	// Target MCP server ID.
	ServerID string `json:"server_id" toon:"server_id"`
}

McpServerGetRequest is generated from the Flashduty OpenAPI schema.

type McpServerItem added in v0.4.0

type McpServerItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// LLM-generated description, preferred over `description` when present.
	AIDescription string `json:"ai_description" toon:"ai_description"`
	// Allow this server's OAuth token exchange over plaintext HTTP; testing use only.
	AllowInsecureOauthHTTP bool `json:"allow_insecure_oauth_http" toon:"allow_insecure_oauth_http"`
	// Skip TLS certificate verification when connecting to this server; testing use only.
	AllowInsecureTlsSkipVerify bool `json:"allow_insecure_tls_skip_verify" toon:"allow_insecure_tls_skip_verify"`
	// Command arguments (stdio transport).
	Args []string `json:"args" toon:"args"`
	// Authentication mode.
	AuthMode string `json:"auth_mode" toon:"auth_mode"`
	// Tool-call timeout in seconds (0 = server default, 60s).
	CallTimeout int64 `json:"call_timeout" toon:"call_timeout"`
	// Whether the caller may edit this server.
	CanEdit bool `json:"can_edit" toon:"can_edit"`
	// Executable command (stdio transport only).
	Command string `json:"command" toon:"command"`
	// Connection timeout in seconds (0 = server default, 10s).
	ConnectTimeout int64 `json:"connect_timeout" toon:"connect_timeout"`
	// Creation time. Unix timestamp in milliseconds.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Member ID that created the server.
	CreatedBy int64 `json:"created_by" toon:"created_by"`
	// Server description.
	Description string `json:"description" toon:"description"`
	// Environment variables (stdio transport). Secret values are masked.
	Env map[string]string `json:"env" toon:"env"`
	// Runner ID when environment_kind is byoc; empty otherwise.
	EnvironmentID string `json:"environment_id" toon:"environment_id"`
	// Runtime environment kind: empty for automatic selection, or `byoc` when pinned to a specific runner. `cloud` cannot be bound to an MCP server.
	EnvironmentKind string `json:"environment_kind" toon:"environment_kind"`
	// HTTP headers (sse / streamable-http). Secret values are masked.
	Headers map[string]string `json:"headers" toon:"headers"`
	// Error message when the live tool list failed.
	ListError string `json:"list_error" toon:"list_error"`
	// JSON-encoded OAuth metadata (per_user_oauth mode).
	OauthMetadata string `json:"oauth_metadata" toon:"oauth_metadata"`
	// Outbound proxy URL used to reach the server.
	ProxyURL string `json:"proxy_url" toon:"proxy_url"`
	// JSON-encoded secret schema (per_user_secret mode).
	SecretSchema string `json:"secret_schema" toon:"secret_schema"`
	// Unique MCP server ID (prefix `mcp_`).
	ServerID string `json:"server_id" toon:"server_id"`
	// MCP server name, unique within the account.
	ServerName string `json:"server_name" toon:"server_name"`
	// Marketplace template this connector was installed from; empty for user-authored.
	SourceTemplateName string `json:"source_template_name" toon:"source_template_name"`
	// Server status.
	Status string `json:"status" toon:"status"`
	// Team scope: 0 = account-wide; >0 = the owning team.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Number of tools in the live list.
	ToolCount int64 `json:"tool_count" toon:"tool_count"`
	// Live tool list; populated by the get/test endpoints.
	Tools []McpToolInfo `json:"tools" toon:"tools"`
	// Transport protocol.
	Transport string `json:"transport" toon:"transport"`
	// Last update time. Unix timestamp in milliseconds.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
	// Server URL (sse / streamable-http transport).
	URL string `json:"url" toon:"url"`
}

McpServerItem is generated from the Flashduty OpenAPI schema.

type McpServerListRequest added in v0.4.0

type McpServerListRequest struct {
	ListOptions
	// Include account-scoped (team_id=0) rows. Defaults to true.
	IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
	// Case-insensitive substring search across name, description, AI-generated description, server ID, transport, URL, command, and source template name.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Restrict results to a scope: `account` for account-wide rows only, `team` for the caller's own visible team rows only, or omit (defaults to `all`) for both, subject to team_ids/include_account.
	Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
	// Filter to these team IDs; empty = the caller's visible set.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}

McpServerListRequest is generated from the Flashduty OpenAPI schema.

type McpServerListResponse added in v0.4.0

type McpServerListResponse struct {
	// MCP servers on this page.
	Servers []McpServerItem `json:"servers" toon:"servers"`
	// Total number of matching servers.
	Total int64 `json:"total" toon:"total"`
}

McpServerListResponse is generated from the Flashduty OpenAPI schema.

type McpServerStatusRequest added in v0.4.0

type McpServerStatusRequest struct {
	// Target MCP server ID.
	ServerID string `json:"server_id" toon:"server_id"`
}

McpServerStatusRequest is generated from the Flashduty OpenAPI schema.

type McpServerUpdateRequest added in v0.4.0

type McpServerUpdateRequest struct {
	// Allow OAuth token exchange over plaintext HTTP. Omit to leave unchanged.
	AllowInsecureOauthHTTP *bool `json:"allow_insecure_oauth_http,omitempty" toon:"allow_insecure_oauth_http,omitempty"`
	// Skip TLS certificate verification. Omit to leave unchanged.
	AllowInsecureTlsSkipVerify *bool `json:"allow_insecure_tls_skip_verify,omitempty" toon:"allow_insecure_tls_skip_verify,omitempty"`
	// Command arguments (stdio transport).
	Args []string `json:"args,omitempty" toon:"args,omitempty"`
	// Authentication mode: shared (default), per_user_secret, or per_user_oauth.
	AuthMode string `json:"auth_mode,omitempty" toon:"auth_mode,omitempty"`
	// Tool-call timeout in seconds. 0 = default (60s).
	CallTimeout int64 `json:"call_timeout,omitempty" toon:"call_timeout,omitempty"`
	// Executable command (stdio transport).
	Command string `json:"command,omitempty" toon:"command,omitempty"`
	// Connection timeout in seconds. 0 = default (10s).
	ConnectTimeout int64 `json:"connect_timeout,omitempty" toon:"connect_timeout,omitempty"`
	// New description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Environment variables (stdio transport).
	Env map[string]string `json:"env,omitempty" toon:"env,omitempty"`
	// Runner ID paired with environment_kind=byoc. Omit (null) to leave the current binding unchanged.
	EnvironmentID *string `json:"environment_id,omitempty" toon:"environment_id,omitempty"`
	// Reassign the runner binding: `byoc` (with environment_id) or empty string to reset to automatic selection. Omit (null) to leave the current binding unchanged.
	EnvironmentKind *string `json:"environment_kind,omitempty" toon:"environment_kind,omitempty"`
	// HTTP headers (sse / streamable-http).
	Headers map[string]string `json:"headers,omitempty" toon:"headers,omitempty"`
	// JSON OAuth metadata; reserved for per_user_oauth.
	OauthMetadata string `json:"oauth_metadata,omitempty" toon:"oauth_metadata,omitempty"`
	// JSON secret schema; required when auth_mode=per_user_secret.
	SecretSchema string `json:"secret_schema,omitempty" toon:"secret_schema,omitempty"`
	// Target MCP server ID.
	ServerID string `json:"server_id" toon:"server_id"`
	// New name.
	ServerName string `json:"server_name,omitempty" toon:"server_name,omitempty"`
	// Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.
	TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Transport protocol.
	Transport string `json:"transport,omitempty" toon:"transport,omitempty"`
	// Server URL (sse / streamable-http transport).
	URL string `json:"url,omitempty" toon:"url,omitempty"`
}

McpServerUpdateRequest is generated from the Flashduty OpenAPI schema.

type McpServersService added in v0.4.0

type McpServersService service

McpServersService handles the "AI SRE/MCP servers" API resource.

func (*McpServersService) ReadServerGet added in v0.4.0

Get MCP server detail.

Get one MCP server and run a live probe of its tool list.

API: POST /safari/mcp/server/get (mcp-read-server-get).

func (*McpServersService) ReadServerList added in v0.4.0

List MCP servers.

List MCP servers visible to the caller across account and team scopes, with pagination.

API: POST /safari/mcp/server/list (mcp-read-server-list).

func (*McpServersService) WriteServerCreate added in v0.4.0

func (s *McpServersService) WriteServerCreate(ctx context.Context, req *McpServerCreateRequest) (*McpServerItem, *Response, error)

Create MCP server.

Register a new MCP server (connector) on the account.

API: POST /safari/mcp/server/create (mcp-write-server-create).

func (*McpServersService) WriteServerDelete added in v0.4.0

func (s *McpServersService) WriteServerDelete(ctx context.Context, req *McpServerDeleteRequest) (*any, *Response, error)

Delete MCP server.

Delete an MCP server by ID.

API: POST /safari/mcp/server/delete (mcp-write-server-delete).

func (*McpServersService) WriteServerDisable added in v0.4.0

func (s *McpServersService) WriteServerDisable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)

Disable MCP server.

Disable an enabled MCP server.

API: POST /safari/mcp/server/disable (mcp-write-server-disable).

func (*McpServersService) WriteServerEnable added in v0.4.0

func (s *McpServersService) WriteServerEnable(ctx context.Context, req *McpServerStatusRequest) (*any, *Response, error)

Enable MCP server.

Enable a disabled MCP server.

API: POST /safari/mcp/server/enable (mcp-write-server-enable).

func (*McpServersService) WriteServerUpdate added in v0.4.0

func (s *McpServersService) WriteServerUpdate(ctx context.Context, req *McpServerUpdateRequest) (*McpServerItem, *Response, error)

Update MCP server.

Update an MCP server's configuration. Omit a field to leave it unchanged.

API: POST /safari/mcp/server/update (mcp-write-server-update).

type McpToolInfo added in v0.4.0

type McpToolInfo struct {
	// Tool description.
	Description string `json:"description" toon:"description"`
	// JSON Schema describing the tool's input parameters.
	InputSchema map[string]any `json:"input_schema" toon:"input_schema"`
	// Tool name.
	Name string `json:"name" toon:"name"`
}

McpToolInfo is generated from the Flashduty OpenAPI schema.

type MemberDeleteRequest

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

MemberInfoResponse is generated from the Flashduty OpenAPI schema.

type MemberInviteRequest

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

MemberInviteRequest is generated from the Flashduty OpenAPI schema.

type MemberInviteResponse

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

MemberInviteResponse is generated from the Flashduty OpenAPI schema.

type MemberItem

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

MemberItem is generated from the Flashduty OpenAPI schema.

type MemberListRequest

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

MemberListRequest is generated from the Flashduty OpenAPI schema.

type MemberListResponse

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

MemberListResponse is generated from the Flashduty OpenAPI schema.

type MemberResetInfoRequest

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

MemberResetInfoRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleGrantRequest

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

MemberRoleGrantRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleRevokeRequest

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

MemberRoleRevokeRequest is generated from the Flashduty OpenAPI schema.

type MemberRoleUpdateRequest

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

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" toon:"comment,omitempty"`
	// Optional new owner member ID for the target incident.
	OwnerID int64 `json:"owner_id,omitempty" toon:"owner_id,omitempty"`
	// When true, soft-delete the source incidents after merging instead of closing them.
	RemoveSourceIncidents bool `json:"remove_source_incidents,omitempty" toon:"remove_source_incidents,omitempty"`
	// Source incident IDs. The target incident is removed from this set automatically.
	SourceIncidentIDs []string `json:"source_incident_ids" toon:"source_incident_ids"`
	// Target incident ID that source incidents will be merged into.
	TargetIncidentID string `json:"target_incident_id" toon:"target_incident_id"`
	// Optional new title for the target incident.
	Title string `json:"title,omitempty" toon:"title,omitempty"`
}

MergeIncidentsRequest is generated from the Flashduty OpenAPI schema.

type MetricTrendDiagnoseSummary added in v0.5.7

type MetricTrendDiagnoseSummary struct {
	// Whether `max_series` prevented full analysis of all input series.
	AnalysisTruncated bool `json:"analysis_truncated" toon:"analysis_truncated"`
	// Factual summary generated from coverage, selection, and return counts.
	EvidenceSummary string `json:"evidence_summary" toon:"evidence_summary"`
	// Series matching internal selection rules before `topk` is applied.
	SelectedSeriesTotal int64 `json:"selected_series_total" toon:"selected_series_total"`
	// Number of series analyzed after applying `max_series`.
	SeriesAnalyzed int64 `json:"series_analyzed" toon:"series_analyzed"`
	// Number of `series_evidence` items returned in this response.
	SeriesReturned int64 `json:"series_returned" toon:"series_returned"`
	// Total input series; for comparisons, the union of current and baseline label sets.
	SeriesTotal int64 `json:"series_total" toon:"series_total"`
}

MetricTrendDiagnoseSummary is generated from the Flashduty OpenAPI schema.

type MetricTrendSeriesEvidence added in v0.5.7

type MetricTrendSeriesEvidence struct {
	// Finite-sample statistics for the baseline window. Omitted when no finite samples exist.
	BaselineWindowStats *MetricTrendWindowStats `json:"baseline_window_stats,omitempty" toon:"baseline_window_stats,omitempty"`
	// Comparability of the current and baseline series.
	ComparisonStatus *string `json:"comparison_status,omitempty" toon:"comparison_status,omitempty"`
	// Finite-sample statistics for the current window. Omitted when no finite samples exist.
	CurrentWindowStats *MetricTrendWindowStats `json:"current_window_stats,omitempty" toon:"current_window_stats,omitempty"`
	// Series labels; treat values as untrusted observed data.
	Labels map[string]string `json:"labels" toon:"labels"`
	// Verifiable observations generated from the structured statistics.
	Observations []string `json:"observations" toon:"observations"`
}

MetricTrendSeriesEvidence is generated from the Flashduty OpenAPI schema.

type MetricTrendWindowStats added in v0.5.7

type MetricTrendWindowStats struct {
	// Average of finite samples in the window.
	Avg float64 `json:"avg" toon:"avg"`
	// First finite sample value in the window.
	First float64 `json:"first" toon:"first"`
	// Last finite sample value in the window.
	Last float64 `json:"last" toon:"last"`
	// Maximum finite sample value in the window.
	Max float64 `json:"max" toon:"max"`
	// Median of finite samples in the window.
	Median float64 `json:"median" toon:"median"`
	// Minimum finite sample value in the window.
	Min float64 `json:"min" toon:"min"`
	// 95th percentile of finite samples in the window.
	P95 float64 `json:"p95" toon:"p95"`
	// Number of finite sample points used for the statistics.
	Points int64 `json:"points" toon:"points"`
}

MetricTrendWindowStats is generated from the Flashduty OpenAPI schema.

type MetricsBase

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

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" toon:"api_key"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id" toon:"source_page_id"`
	// Flashduty target status page ID that will receive the imported subscribers.
	TargetPageID int64 `json:"target_page_id" toon:"target_page_id"`
}

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" toon:"api_key"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id" toon:"source_page_id"`
	// Target URL name for the migrated status page. When omitted, the source page's URL name is reused.
	URLName *string `json:"url_name,omitempty" toon:"url_name,omitempty"`
}

MigrateStatusPageStructureRequest is generated from the Flashduty OpenAPI schema.

type MonitorUtilitiesService added in v0.5.4

type MonitorUtilitiesService service

MonitorUtilitiesService handles the "Monitors/Monitor utilities" API resource.

func (*MonitorUtilitiesService) Sync added in v0.5.4

Preview datasource query.

Execute a synchronous datasource query and return the raw result. Used to preview alert rule expressions before saving.

API: POST /monit/preview/sync (monit-preview-sync).

type NameMessage

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

NameMessage is generated from the Flashduty OpenAPI schema.

type NewMemberItem

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

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) ReadPreview added in v0.4.0

Preview template.

Render a notification template against incident data or mock data and return the output.

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

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" toon:"chat_id"`
	// Chat group display name.
	ChatName string `json:"chat_name" toon:"chat_name"`
	// Integration data source ID used to send the notification.
	DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
	// Failure reason if delivery did not succeed.
	FailedReason string `json:"failed_reason" toon:"failed_reason"`
}

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" toon:"failed_reason"`
	// Recipient member ID.
	PersonID int64 `json:"person_id" toon:"person_id"`
}

NotifyPerson is generated from the Flashduty OpenAPI schema.

type NotifyRobot

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

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" toon:"end_time"`
	// Window start (unix seconds). Must be > 0 and less than `end_time`.
	StartTime int64 `json:"start_time" toon:"start_time"`
}

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

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" toon:"factor_name"`
	// Factor type.
	FactorType string `json:"factor_type" toon:"factor_type"`
}

PermissionFactorItem is generated from the Flashduty OpenAPI schema.

type PermissionFactorListRequest

type PermissionFactorListRequest struct {
	// Filter by factor type.
	FactorTypes []string `json:"factor_types,omitempty" toon:"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" toon:"class"`
	// Human-readable permission description.
	Description string `json:"description" toon:"description"`
	// Unique permission ID.
	ID uint64 `json:"id" toon:"id"`
	// Present when with_all is true. Indicates whether this permission is granted to the requested roles.
	IsGranted bool `json:"is_granted" toon:"is_granted"`
	// Permission display name.
	PermissionName string `json:"permission_name" toon:"permission_name"`
	// Whether this is a read or manage permission.
	PermissionType string `json:"permission_type" toon:"permission_type"`
	// Permission scope (e.g., 'on-call', 'organization').
	Scope string `json:"scope" toon:"scope"`
	// Permission status.
	Status string `json:"status" toon:"status"`
}

PermissionItem is generated from the Flashduty OpenAPI schema.

type PersonInfosRequest

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

PersonInfosRequest is generated from the Flashduty OpenAPI schema.

type PersonInfosResponse

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

PersonInfosResponse is generated from the Flashduty OpenAPI schema.

type PersonItem

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

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" toon:"as"`
	// Member email address.
	Email string `json:"email" toon:"email"`
	// Member ID.
	PersonID int64 `json:"person_id" toon:"person_id"`
	// Member display name.
	PersonName string `json:"person_name" toon:"person_name"`
}

PersonShort is generated from the Flashduty OpenAPI schema.

type PlatformEmptyObject

type PlatformEmptyObject struct{}

PlatformEmptyObject is generated from the Flashduty OpenAPI schema.

type PostMortemContentResetResponse added in v0.5.9

type PostMortemContentResetResponse struct {
	// New collaboration document generation after the reset.
	Generation int64 `json:"generation" toon:"generation"`
	// UTF-8 byte length of the accepted Markdown content.
	MarkdownBytes int64 `json:"markdown_bytes" toon:"markdown_bytes"`
	// SHA-256 hex digest of the accepted Markdown content.
	MarkdownSha256 string `json:"markdown_sha256" toon:"markdown_sha256"`
	// ID of the reset post-mortem report.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
	// Collaboration document generation before the reset.
	PreviousGeneration int64 `json:"previous_generation" toon:"previous_generation"`
	// Content revision before the reset.
	PreviousRevision int64 `json:"previous_revision" toon:"previous_revision"`
	// New content revision after the reset.
	Revision int64 `json:"revision" toon:"revision"`
}

PostMortemContentResetResponse is generated from the Flashduty OpenAPI schema.

type PostMortemItem

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

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" toon:"incidents_earliest_start_seconds"`
	// Highest severity among linked incidents.
	IncidentsHighestSeverity string `json:"incidents_highest_severity" toon:"incidents_highest_severity"`
	// Latest close time among linked incidents (seconds).
	IncidentsLatestCloseSeconds int64 `json:"incidents_latest_close_seconds" toon:"incidents_latest_close_seconds"`
	// Cumulative duration in seconds.
	IncidentsTotalDurationSeconds int64 `json:"incidents_total_duration_seconds" toon:"incidents_total_duration_seconds"`
	// Responders involved in the incident(s).
	Responders []Responder `json:"responders" toon:"responders"`
}

PostMortemItemBasics is generated from the Flashduty OpenAPI schema.

type PostMortemItemContent

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

PostMortemItemContent is generated from the Flashduty OpenAPI schema.

type PostMortemMeta

type PostMortemMeta struct {
	// Account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Member IDs that contributed to the report.
	AuthorIDs []int64 `json:"author_ids" toon:"author_ids"`
	// Owning channel ID. 0 if none.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Channel name, filled by the server.
	ChannelName string `json:"channel_name" toon:"channel_name"`
	// Creation timestamp (seconds).
	CreatedAtSeconds Timestamp `json:"created_at_seconds" toon:"created_at_seconds"`
	// Collaboration document generation. Incremented by each full content reset; 0 for legacy documents.
	Generation int64 `json:"generation" toon:"generation"`
	// Linked incident IDs.
	IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
	// When true, only team members and admins can view.
	IsPrivate bool `json:"is_private" toon:"is_private"`
	// Number of uploaded media files.
	MediaCount int64 `json:"media_count" toon:"media_count"`
	// Deterministic post-mortem ID derived from account and incident IDs.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
	// Content revision for optimistic concurrency. Monotonically increases on collaborative saves and full content resets.
	Revision int64 `json:"revision" toon:"revision"`
	// Report status.
	Status string `json:"status" toon:"status"`
	// Owning team ID. 0 if none.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Template used to initialize the report.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Report title.
	Title string `json:"title" toon:"title"`
	// Last update timestamp (seconds).
	UpdatedAtSeconds Timestamp `json:"updated_at_seconds" toon:"updated_at_seconds"`
}

PostMortemMeta is generated from the Flashduty OpenAPI schema.

type PostMortemTemplate added in v0.5.4

type PostMortemTemplate struct {
	// Account ID that owns the template. 0 for built-in templates.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// BlockNote JSON content used to initialize the report body.
	Content string `json:"content" toon:"content"`
	// Markdown version of the template content, used by AI generation.
	ContentMarkdown string `json:"content_markdown" toon:"content_markdown"`
	// Unix timestamp in seconds when the template was created.
	CreatedAtSeconds Timestamp `json:"created_at_seconds" toon:"created_at_seconds"`
	// Template description.
	Description string `json:"description" toon:"description"`
	// Template name shown in the console.
	Name string `json:"name" toon:"name"`
	// Managing team ID. Built-in templates use 0.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Template ID. Built-in templates use a stable `post_mortem_default_tmpl_*` ID.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Unix timestamp in seconds when the template was last updated.
	UpdatedAtSeconds Timestamp `json:"updated_at_seconds" toon:"updated_at_seconds"`
}

PostMortemTemplate is generated from the Flashduty OpenAPI schema.

type PreflightResult added in v0.5.7

type PreflightResult struct {
	// App the rule is scoped to. Currently always ai-sre; manual runs are only supported for that app.
	AppName string `json:"app_name" toon:"app_name"`
	// Names of the readiness checks performed, in order. Current fixed set: rule_loaded, actor_authorized, app_allowed, runtime_scope_resolved, rule_config_valid.
	Checks []string `json:"checks" toon:"checks"`
	// Whether all readiness checks passed. Always true in a response that reaches the caller — a failed preflight returns a 400/403 error instead of a payload with ok=false.
	OK bool `json:"ok" toon:"ok"`
	// Rule owner person ID.
	OwnerID int64 `json:"owner_id" toon:"owner_id"`
	// Resolved run scope for this run; mirrors the rule's run_scope.
	Scope string `json:"scope" toon:"scope"`
	// Rule's scope team ID; 0 means a personal rule.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Non-fatal warnings surfaced during preflight. Omitted or empty when there are none.
	Warnings []string `json:"warnings" toon:"warnings"`
}

PreflightResult is generated from the Flashduty OpenAPI schema.

type PreviewIncidentCardFixedField added in v0.5.7

type PreviewIncidentCardFixedField struct {
	// Incident-card field name.
	Field string `json:"field" toon:"field"`
	// Rendered display value for the fixed field.
	Value string `json:"value" toon:"value"`
}

PreviewIncidentCardFixedField is generated from the Flashduty OpenAPI schema.

type PreviewSyncRequest added in v0.5.4

type PreviewSyncRequest struct {
	// Additional type-specific query arguments.
	Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
	// Shift the query window backward by this many seconds to compensate for data ingestion latency.
	DelaySeconds int64 `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
	// Datasource display name as configured in the account.
	DsName string `json:"ds_name" toon:"ds_name"`
	// Datasource type, e.g. `prometheus`, `loki`, `elasticsearch`.
	DsType string `json:"ds_type" toon:"ds_type"`
	// Query expression. Format depends on `ds_type` (PromQL for Prometheus, LogQL for Loki, etc.).
	Expr string `json:"expr" toon:"expr"`
}

PreviewSyncRequest is generated from the Flashduty OpenAPI schema.

type PreviewSyncResponse added in v0.5.4

type PreviewSyncResponse struct{}

PreviewSyncResponse is generated from the Flashduty OpenAPI schema.

type PreviewTemplateRequest added in v0.4.0

type PreviewTemplateRequest struct {
	// Template content to render.
	Content                  string                   `json:"content" toon:"content"`
	IncidentCardHiddenFields IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
	// Incident ID whose data is used to render the template; mock data is used when omitted. A MongoDB ObjectID hex string.
	IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
	// Template channel type that selects the rendering engine.
	Type string `json:"type" toon:"type"`
}

PreviewTemplateRequest is generated from the Flashduty OpenAPI schema.

type PreviewTemplateResponse added in v0.4.0

type PreviewTemplateResponse struct {
	// Rendered template output, present when success is true.
	Content string `json:"content" toon:"content"`
	// Fixed incident-card fields returned for supported IM previews after the requested hiding rules are applied.
	FixedFields []PreviewIncidentCardFixedField `json:"fixed_fields" toon:"fixed_fields"`
	// Error message describing why rendering failed, present when success is false.
	Message string `json:"message" toon:"message"`
	// Whether the template rendered without errors.
	Success bool `json:"success" toon:"success"`
}

PreviewTemplateResponse 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" toon:"fields"`
	// Numeric fields. For metric queries the canonical key is `__value__`. May be `null` for detail-oriented sources.
	Values map[string]float64 `json:"values" toon:"values"`
}

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" toon:"account_id,omitempty"`
	// Polymorphic key/value extension parameters forwarded verbatim to monit-edge. All values must be strings, and keys are always namespaced by source (e.g. `sls.project`, `loki.type`). Validation depends on `ds_type`: SLS requires `sls.project` + `sls.logstore`. Elasticsearch accepts `es.type` of `sql`, or omitted — any other value is rejected. Loki and VictoriaLogs accept `<source>.type` of `stats`, `raw`, or omitted; `raw` additionally requires a time range, either `<source>.start` + `<source>.end` or `<source>.timespan.value` + `<source>.timespan.unit` (unit one of `s`, `m`, `h`, `d`). Prometheus and the remaining SQL sources ignore `args` entirely.
	Args map[string]string `json:"args,omitempty" toon:"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" toon:"delay_seconds,omitempty"`
	// Data source name; must match a configured data source under the tenant.
	DsName string `json:"ds_name" toon:"ds_name"`
	// 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" toon:"ds_type"`
	// 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" toon:"expr"`
}

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" toon:"channel_ids,omitempty"`
	// Whether alerting is enabled.
	Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// Associated on-call integration ID (read-only, auto-assigned).
	IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
}

RUMApplicationAlerting is generated from the Flashduty OpenAPI schema.

type RUMApplicationCreateRequest

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

RUMApplicationCreateRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationCreateResponse

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

RUMApplicationCreateResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationIDRequest

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

RUMApplicationIDRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationInfosRequest

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

RUMApplicationInfosRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationInfosResponse

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

RUMApplicationInfosResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationItem

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

RUMApplicationItem is generated from the Flashduty OpenAPI schema.

type RUMApplicationLink struct {
	// Whether this external system link is enabled.
	Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// RUM event types where this external system link is shown.
	EventTypes []string `json:"event_types" toon:"event_types"`
	// Display color for the link icon.
	IconColor string `json:"icon_color,omitempty" toon:"icon_color,omitempty"`
	// Short text shown in the link icon.
	IconText string `json:"icon_text,omitempty" toon:"icon_text,omitempty"`
	// Stable client-side identifier for this external system.
	ID string `json:"id,omitempty" toon:"id,omitempty"`
	// Display name of the external system.
	Name string `json:"name" toon:"name"`
	// HTTP or HTTPS URL template. `${var}` tokens are resolved from the RUM event context.
	URL string `json:"url" toon:"url"`
}

RUMApplicationLink is generated from the Flashduty OpenAPI schema.

type RUMApplicationLinks struct {
	// Whether external link integration is enabled.
	Enabled bool `json:"enabled,omitempty" toon:"enabled,omitempty"`
	// External systems whose URL templates can be opened from matching RUM events.
	Systems []RUMApplicationLink `json:"systems,omitempty" toon:"systems,omitempty"`
}

RUMApplicationLinks is generated from the Flashduty OpenAPI schema.

type RUMApplicationListRequest

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

RUMApplicationListRequest is generated from the Flashduty OpenAPI schema.

type RUMApplicationListResponse

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

RUMApplicationListResponse is generated from the Flashduty OpenAPI schema.

type RUMApplicationTracing

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

RUMApplicationTracing is generated from the Flashduty OpenAPI schema.

type RUMApplicationUpdateRequest

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

RUMApplicationUpdateRequest is generated from the Flashduty OpenAPI schema.

type RUMDataAggregateFunction added in v0.5.4

type RUMDataAggregateFunction struct {
	// Column index used by the aggregate.
	ColumnIndex int64 `json:"column_index" toon:"column_index"`
	// Column name used by the aggregate.
	ColumnName string `json:"column_name" toon:"column_name"`
	// Aggregate function type.
	Type string `json:"type" toon:"type"`
}

RUMDataAggregateFunction is generated from the Flashduty OpenAPI schema.

type RUMDataFieldMeta added in v0.5.4

type RUMDataFieldMeta struct {
	// Column name.
	Name string `json:"name" toon:"name"`
	// Whether values in this column may be null.
	Nullable bool `json:"nullable" toon:"nullable"`
	// Backend database type name for this column.
	Type string `json:"type" toon:"type"`
}

RUMDataFieldMeta is generated from the Flashduty OpenAPI schema.

type RUMDataQueryDefinition added in v0.5.4

type RUMDataQueryDefinition struct {
	// When true, asks the query engine to avoid sampling when possible.
	DisableSampling bool `json:"disable_sampling,omitempty" toon:"disable_sampling,omitempty"`
	// Optional RUM DQL filter expression used together with SQL validation.
	Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
	// Output format. `table` returns rows; `time_series` returns bucketed time-series rows.
	Format string `json:"format" toon:"format"`
	// Client-supplied query ID. The same value is used as the key in the response object.
	ID string `json:"id" toon:"id"`
	// Time bucket interval in seconds for `time_series` queries.
	Interval int64 `json:"interval,omitempty" toon:"interval,omitempty"`
	// Maximum number of points for `time_series` queries.
	MaxPoints int64 `json:"max_points,omitempty" toon:"max_points,omitempty"`
	// Opaque cursor returned by a previous table query for continuing pagination.
	SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
	// RUM SQL query to execute.
	Sql string `json:"sql" toon:"sql"`
	// IANA time zone name used when evaluating time functions, such as `Asia/Shanghai`.
	TimeZone string `json:"time_zone,omitempty" toon:"time_zone,omitempty"`
}

RUMDataQueryDefinition is generated from the Flashduty OpenAPI schema.

type RUMDataQueryOutput added in v0.5.4

type RUMDataQueryOutput struct {
	Data  RUMDataQueryResult `json:"data" toon:"data"`
	Error any                `json:"error" toon:"error"`
}

RUMDataQueryOutput is generated from the Flashduty OpenAPI schema.

type RUMDataQueryRequest added in v0.5.4

type RUMDataQueryRequest struct {
	// End of the query window, Unix epoch milliseconds. Maximum 31-day span.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// Queries to execute concurrently. 1 to 10 queries are allowed.
	Queries []RUMDataQueryDefinition `json:"queries" toon:"queries"`
	// Start of the query window, Unix epoch milliseconds.
	StartTime int64 `json:"start_time" toon:"start_time"`
}

RUMDataQueryRequest is generated from the Flashduty OpenAPI schema.

type RUMDataQueryResponse added in v0.5.4

type RUMDataQueryResponse map[string]RUMDataQueryOutput

RUMDataQueryResponse is a map response payload.

type RUMDataQueryResult added in v0.5.4

type RUMDataQueryResult struct {
	// Column metadata for the values matrix.
	Fields []RUMDataFieldMeta `json:"fields" toon:"fields"`
	// Effective time bucket interval in seconds for time-series queries.
	Interval int64                   `json:"interval" toon:"interval"`
	Sampling RUMDataSamplingDecision `json:"sampling" toon:"sampling"`
	// Opaque cursor for continuing paginated table queries.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Rows returned by the query. Each row aligns with `fields` by index.
	Values [][]any `json:"values" toon:"values"`
}

RUMDataQueryResult is generated from the Flashduty OpenAPI schema.

type RUMDataSamplingDecision added in v0.5.4

type RUMDataSamplingDecision struct {
	// Aggregate functions affected by sampling.
	AggregateFuncs []RUMDataAggregateFunction `json:"aggregate_funcs" toon:"aggregate_funcs"`
	// Whether sampling was applied.
	Enabled bool `json:"enabled" toon:"enabled"`
	// Multiplier used to scale sampled counts back to estimated full counts.
	ScaleFactor float64 `json:"scale_factor" toon:"scale_factor"`
	// Storage tablets selected for the sampled query.
	SelectedTablets []string `json:"selected_tablets" toon:"selected_tablets"`
}

RUMDataSamplingDecision is generated from the Flashduty OpenAPI schema.

type RUMFacetCountRequest added in v0.5.4

type RUMFacetCountRequest struct {
	// RUM DQL filter expression applied before counting.
	Dql string `json:"dql,omitempty" toon:"dql,omitempty"`
	// End of the time range, Unix epoch milliseconds. Maximum 31-day span.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// The field key to count value distribution for.
	FacetKey string `json:"facet_key" toon:"facet_key"`
	// When set, filter events where `facet_key` equals this value before counting. Accepts string, number, or boolean.
	FacetValue any `json:"facet_value,omitempty" toon:"facet_value,omitempty"`
	// Maximum number of top values to return. Default 100, maximum 100.
	Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
	// RUM data scope to query.
	Scope string `json:"scope" toon:"scope"`
	// SQL WHERE clause (no SELECT) for additional filtering.
	Sql string `json:"sql,omitempty" toon:"sql,omitempty"`
	// Start of the time range, Unix epoch milliseconds.
	StartTime int64 `json:"start_time" toon:"start_time"`
}

RUMFacetCountRequest is generated from the Flashduty OpenAPI schema.

type RUMFacetCountResponse added in v0.5.4

type RUMFacetCountResponse struct {
	Items []FacetCountItem `json:"items" toon:"items"`
}

RUMFacetCountResponse is generated from the Flashduty OpenAPI schema.

type RUMFacetListRequest added in v0.5.4

type RUMFacetListRequest struct {
	// When true, return only facet-enabled fields. When false or omitted, return all fields.
	IsFacet bool `json:"is_facet,omitempty" toon:"is_facet,omitempty"`
	// Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`.
	Scopes []string `json:"scopes,omitempty" toon:"scopes,omitempty"`
}

RUMFacetListRequest is generated from the Flashduty OpenAPI schema.

type RUMFacetListResponse added in v0.5.4

type RUMFacetListResponse struct {
	Items []RUMFieldItem `json:"items" toon:"items"`
}

RUMFacetListResponse is generated from the Flashduty OpenAPI schema.

type RUMFieldItem added in v0.5.4

type RUMFieldItem struct {
	// Account ID. 0 for built-in fields.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Description of what this field captures.
	Description string `json:"description" toon:"description"`
	// True if this is a custom field that can be edited by the user.
	EditAble bool `json:"edit_able" toon:"edit_able"`
	// Predefined enumerable values for this field. Element type matches the field's `value_type`: string for `string`, number for `number`, boolean for `boolean`. Empty when the field has no fixed set of values.
	EnumValues []any `json:"enum_values" toon:"enum_values"`
	// Unique field key, e.g. `error.type`.
	FieldKey string `json:"field_key" toon:"field_key"`
	// Human-readable field name.
	FieldName string `json:"field_name" toon:"field_name"`
	// Display group for this field.
	Group string `json:"group" toon:"group"`
	// True if value distribution counting is supported for this field.
	IsFacet bool `json:"is_facet" toon:"is_facet"`
	// True if this field can be used in DQL/SQL queries.
	Queryable bool `json:"queryable" toon:"queryable"`
	// RUM scopes this field appears in.
	Scopes []string `json:"scopes" toon:"scopes"`
	// Display type in the analytics UI.
	ShowType string `json:"show_type" toon:"show_type"`
	// Field status, e.g. `active`.
	Status string `json:"status" toon:"status"`
	// Measurement unit family, e.g. `time`, `bytes`. Empty for dimensionless fields.
	UnitFamily string `json:"unit_family" toon:"unit_family"`
	// Specific measurement unit, e.g. `millisecond`, `byte`.
	UnitName string `json:"unit_name" toon:"unit_name"`
	// Data type of the field value.
	ValueType string `json:"value_type" toon:"value_type"`
}

RUMFieldItem is generated from the Flashduty OpenAPI schema.

type RUMFieldListRequest added in v0.5.4

type RUMFieldListRequest struct {
	// When true, return only facet-enabled fields. When false or omitted, return all fields.
	IsFacet bool `json:"is_facet,omitempty" toon:"is_facet,omitempty"`
	// Filter by RUM data scopes. Valid values: `session`, `view`, `action`, `error`, `resource`, `long_task`, `vital`, `issue`, `sourcemap`.
	Scopes []string `json:"scopes,omitempty" toon:"scopes,omitempty"`
}

RUMFieldListRequest is generated from the Flashduty OpenAPI schema.

type RUMFieldListResponse added in v0.5.4

type RUMFieldListResponse struct {
	Items []RUMFieldItem `json:"items" toon:"items"`
}

RUMFieldListResponse is generated from the Flashduty OpenAPI schema.

type RUMIssueIDRequest

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

RUMIssueIDRequest is generated from the Flashduty OpenAPI schema.

type RUMIssueItem

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

RUMIssueItem is generated from the Flashduty OpenAPI schema.

type RUMIssueItemError

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

RUMIssueItemError is generated from the Flashduty OpenAPI schema.

type RUMIssueItemFirstSeen

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

RUMIssueItemFirstSeen is generated from the Flashduty OpenAPI schema.

type RUMIssueItemLastSeen

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

RUMIssueItemLastSeen is generated from the Flashduty OpenAPI schema.

type RUMIssueItemRegression

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

RUMIssueItemRegression is generated from the Flashduty OpenAPI schema.

type RUMIssueItemSuspectedCause

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

RUMIssueItemSuspectedCause is generated from the Flashduty OpenAPI schema.

type RUMIssueListRequest

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

RUMIssueListRequest is generated from the Flashduty OpenAPI schema.

type RUMIssueListResponse

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

RUMIssueListResponse is generated from the Flashduty OpenAPI schema.

type RUMIssueUpdateRequest

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

RUMIssueUpdateRequest is generated from the Flashduty OpenAPI schema.

type RUMReplayApplication added in v0.5.7

type RUMReplayApplication struct {
	// RUM application ID the session belongs to.
	ID string `json:"id" toon:"id"`
}

RUMReplayApplication is generated from the Flashduty OpenAPI schema.

type RUMReplayDevice added in v0.5.7

type RUMReplayDevice struct {
	// Device type recorded for the session, e.g. `desktop`, `mobile`, `tablet`.
	Type string `json:"type" toon:"type"`
}

RUMReplayDevice is generated from the Flashduty OpenAPI schema.

type RUMReplayForegroundPeriod added in v0.5.7

type RUMReplayForegroundPeriod struct {
	// Unix timestamp in milliseconds when the foreground period ended.
	End TimestampMilli `json:"end" toon:"end"`
	// Unix timestamp in milliseconds when the foreground period started.
	Start TimestampMilli `json:"start" toon:"start"`
	// View ID active during this foreground period.
	ViewID string `json:"view_id" toon:"view_id"`
}

RUMReplayForegroundPeriod is generated from the Flashduty OpenAPI schema.

type RUMReplaySession added in v0.5.7

type RUMReplaySession struct {
	// Unix timestamp in milliseconds when the session ended (or was last updated, if still active).
	End TimestampMilli `json:"end" toon:"end"`
	// Whether the session was still active as of the last recorded event.
	IsActive bool `json:"is_active" toon:"is_active"`
	// Clock skew in milliseconds between the client and Flashduty's servers, added to client timestamps for correction.
	ServerTimeDelta int64 `json:"server_time_delta" toon:"server_time_delta"`
	// SDK platform that recorded the session.
	Source string `json:"source" toon:"source"`
	// Unix timestamp in milliseconds when the session started.
	Start TimestampMilli `json:"start" toon:"start"`
}

RUMReplaySession is generated from the Flashduty OpenAPI schema.

type RUMReplayView added in v0.5.7

type RUMReplayView struct {
	// SDK platform of the container app, when this view is embedded (e.g. a WebView inside a native app).
	ContainerSource string `json:"container_source" toon:"container_source"`
	// View ID of the containing view, when this view is embedded.
	ContainerViewID string `json:"container_view_id" toon:"container_view_id"`
	// Unix timestamp in milliseconds when the view ended.
	End TimestampMilli `json:"end" toon:"end"`
	// Whether the view was still active as of the last recorded event.
	IsActive bool `json:"is_active" toon:"is_active"`
	// How the view was entered, e.g. `initial_load`, `route_change`.
	LoadingType string `json:"loading_type" toon:"loading_type"`
	// View name, typically the route or screen name.
	Name string `json:"name" toon:"name"`
	// Clock skew in milliseconds between the client and Flashduty's servers, added to client timestamps for correction.
	ServerTimeDelta int64 `json:"server_time_delta" toon:"server_time_delta"`
	// SDK platform that recorded the view.
	Source string `json:"source" toon:"source"`
	// Unix timestamp in milliseconds when the view started.
	Start TimestampMilli `json:"start" toon:"start"`
	// URL (web) or screen identifier (mobile) associated with the view.
	URL string `json:"url" toon:"url"`
	// Unique ID of the view within the session.
	ViewID string `json:"view_id" toon:"view_id"`
}

RUMReplayView is generated from the Flashduty OpenAPI schema.

type RUMSessionReplayMetaItem added in v0.5.7

type RUMSessionReplayMetaItem struct {
	Application RUMReplayApplication `json:"application" toon:"application"`
	Device      RUMReplayDevice      `json:"device" toon:"device"`
	// Foreground periods across the session (mobile sessions only; empty for web).
	ForegroundPeriods []RUMReplayForegroundPeriod `json:"foreground_periods" toon:"foreground_periods"`
	Session           RUMReplaySession            `json:"session" toon:"session"`
	// Every view recorded during the session, in chronological order.
	Views []RUMReplayView `json:"views" toon:"views"`
}

RUMSessionReplayMetaItem is generated from the Flashduty OpenAPI schema.

type RUMSessionReplayMetaRequest added in v0.5.7

type RUMSessionReplayMetaRequest struct {
	// RUM session ID.
	SessionID string `json:"session_id" toon:"session_id"`
	// Unix timestamp in milliseconds of the session start time. Optional; disambiguates when a session ID has been reused across different time windows.
	TS int64 `json:"ts,omitempty" toon:"ts,omitempty"`
}

RUMSessionReplayMetaRequest is generated from the Flashduty OpenAPI schema.

type RUMSessionReplaySegmentsRequest added in v0.5.7

type RUMSessionReplaySegmentsRequest struct {
	// Maximum number of segments to return. 1-99, default 20.
	Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
	// Pagination cursor from a previous call. Take it from the `search_after_ctx` field (URL mode) or the `X-Search-After-Ctx` response header (streaming mode).
	SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
	// RUM session ID.
	SessionID string `json:"session_id" toon:"session_id"`
	// Unix timestamp in milliseconds. When set (and `search_after_ctx` is empty), seeks to the most recent full-snapshot segment at or before this time instead of starting from the beginning.
	TS int64 `json:"ts,omitempty" toon:"ts,omitempty"`
	// When `true`, return presigned download URLs as a JSON envelope instead of streaming segment bytes. Defaults to `false`.
	URLMode bool `json:"url_mode,omitempty" toon:"url_mode,omitempty"`
	// Restrict results to segments belonging to this view. Omit to page through the entire session.
	ViewID string `json:"view_id,omitempty" toon:"view_id,omitempty"`
}

RUMSessionReplaySegmentsRequest is generated from the Flashduty OpenAPI schema.

type RUMSessionReplaySegmentsResult added in v0.5.7

type RUMSessionReplaySegmentsResult struct {
	// Presigned, time-limited URLs (valid 1 hour) for downloading each segment's raw compressed bytes.
	Items []string `json:"items" toon:"items"`
	// Pagination cursor to pass as `search_after_ctx` on the next call. Empty when this page was the last one.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
}

RUMSessionReplaySegmentsResult is generated from the Flashduty OpenAPI schema.

type RUMWebhookTestRequest added in v0.5.4

type RUMWebhookTestRequest struct {
	// RUM application ID.
	ApplicationID string `json:"application_id" toon:"application_id"`
	// Webhook URL to receive the sample alert event.
	WebhookURL string `json:"webhook_url" toon:"webhook_url"`
}

RUMWebhookTestRequest is generated from the Flashduty OpenAPI schema.

type RUMWebhookTestResponse added in v0.5.4

type RUMWebhookTestResponse struct {
	// `ok` on success, otherwise the delivery error message.
	Message string `json:"message" toon:"message"`
	// Whether the webhook endpoint accepted the sample event.
	OK bool `json:"ok" toon:"ok"`
	// HTTP status code returned by the webhook endpoint. 0 when the request did not receive a response.
	StatusCode int64 `json:"status_code" toon:"status_code"`
}

RUMWebhookTestResponse 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" toon:"incident_ids"`
}

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" toon:"incident_ids"`
	// Optional reason recorded on the timeline.
	Reason string `json:"reason,omitempty" toon:"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" toon:"field_name"`
	// New field value. Type must match the field definition.
	FieldValue any `json:"field_value,omitempty" toon:"field_value,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
}

ResetIncidentFieldRequest is generated from the Flashduty OpenAPI schema.

type ResetPostMortemBasicsRequest added in v0.5.4

type ResetPostMortemBasicsRequest struct {
	// Unix timestamp in seconds for the earliest linked incident start time.
	IncidentsEarliestStartSeconds int64 `json:"incidents_earliest_start_seconds" toon:"incidents_earliest_start_seconds"`
	// Highest severity among linked incidents.
	IncidentsHighestSeverity string `json:"incidents_highest_severity" toon:"incidents_highest_severity"`
	// Unix timestamp in seconds for the latest linked incident close time. 0 when still open.
	IncidentsLatestCloseSeconds int64 `json:"incidents_latest_close_seconds,omitempty" toon:"incidents_latest_close_seconds,omitempty"`
	// Total incident duration in seconds.
	IncidentsTotalDurationSeconds int64 `json:"incidents_total_duration_seconds,omitempty" toon:"incidents_total_duration_seconds,omitempty"`
	// Post-mortem ID.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
	// Responder member IDs to store on the report.
	ResponderIDs []int64 `json:"responder_ids,omitempty" toon:"responder_ids,omitempty"`
}

ResetPostMortemBasicsRequest is generated from the Flashduty OpenAPI schema.

type ResetPostMortemContentRequest added in v0.5.9

type ResetPostMortemContentRequest struct {
	// Current content revision expected by the caller. Pass 0 for the first write to a document that has never been saved.
	ExpectedRevision *int64 `json:"expected_revision,omitempty" toon:"expected_revision,omitempty"`
	// Non-blank key for safely retrying this exact reset request.
	IdempotencyKey string `json:"idempotency_key" toon:"idempotency_key"`
	// Replacement Markdown content. Limited to 4 MiB.
	Markdown string `json:"markdown" toon:"markdown"`
	// Post-mortem ID to reset.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}

ResetPostMortemContentRequest is generated from the Flashduty OpenAPI schema.

type ResetPostMortemFollowUpsRequest added in v0.5.4

type ResetPostMortemFollowUpsRequest struct {
	// Follow-up action items as free text.
	FollowUps string `json:"follow_ups,omitempty" toon:"follow_ups,omitempty"`
	// Post-mortem ID.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
}

ResetPostMortemFollowUpsRequest is generated from the Flashduty OpenAPI schema.

type ResetPostMortemStatusRequest added in v0.5.4

type ResetPostMortemStatusRequest struct {
	// Post-mortem ID.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
	// Target report status.
	Status string `json:"status" toon:"status"`
}

ResetPostMortemStatusRequest is generated from the Flashduty OpenAPI schema.

type ResetPostMortemTitleRequest added in v0.5.4

type ResetPostMortemTitleRequest struct {
	// Post-mortem ID.
	PostMortemID string `json:"post_mortem_id" toon:"post_mortem_id"`
	// New report title.
	Title string `json:"title" toon:"title"`
}

ResetPostMortemTitleRequest is generated from the Flashduty OpenAPI schema.

type ResolveIncidentRequest

type ResolveIncidentRequest struct {
	// Custom field values for the resolution form. Allowed keys and values depend on the incident's visible form.
	CustomFields CustomFieldValues `json:"custom_fields,omitempty" toon:"custom_fields,omitempty"`
	// New incident description, up to 6,144 characters. When set, it replaces the current description before the incident closes.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Images attached to the resolution timeline entry.
	Images []IncidentActionImage `json:"images,omitempty" toon:"images,omitempty"`
	// Incident IDs to resolve. At most 100 per call.
	IncidentIDs []string `json:"incident_ids" toon:"incident_ids"`
	// Optional resolution note applied to every resolved incident.
	Resolution *string `json:"resolution,omitempty" toon:"resolution,omitempty"`
	// Optional root cause note applied to every resolved incident.
	RootCause *string `json:"root_cause,omitempty" toon:"root_cause,omitempty"`
	// Form summary recorded as a timeline comment. Accepted only when the resolution form contains a summary element.
	Summary string `json:"summary,omitempty" toon:"summary,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 Timestamp `json:"acknowledged_at" toon:"acknowledged_at"`
	// Role label of this responder.
	As string `json:"as" toon:"as"`
	// Unix timestamp (seconds) when the member was assigned.
	AssignedAt Timestamp `json:"assigned_at" toon:"assigned_at"`
	// Member email, filled by the server.
	Email string `json:"email" toon:"email"`
	// Responder member ID.
	PersonID int64 `json:"person_id" toon:"person_id"`
	// Member display name, filled by the server.
	PersonName string `json:"person_name" toon:"person_name"`
}

Responder is generated from the Flashduty OpenAPI schema.

type ResponderInsightItem

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

ResponderInsightItem is generated from the Flashduty OpenAPI schema.

type ResponderInsightResponse

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

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 ResponseEnvelope added in v0.4.0

type ResponseEnvelope struct {
	// Endpoint-specific payload. See each operation's 200 response schema.
	Data  any `json:"data" toon:"data"`
	Error any `json:"error" toon:"error"`
	// Unique ID for this request. Mirrored in the Flashcat-Request-Id header. Include it when reporting issues.
	RequestID string `json:"request_id" toon:"request_id"`
}

ResponseEnvelope is generated from the Flashduty OpenAPI schema.

type RoleGrantRequest

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

RoleGrantRequest is generated from the Flashduty OpenAPI schema.

type RoleIDRequest

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

RoleIDRequest is generated from the Flashduty OpenAPI schema.

type RoleInfoRequest

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

RoleInfoRequest is generated from the Flashduty OpenAPI schema.

type RoleItem

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

RoleItem is generated from the Flashduty OpenAPI schema.

type RoleListRequest

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

RoleListRequest is generated from the Flashduty OpenAPI schema.

type RoleListResponse

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

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" toon:"role_ids,omitempty"`
	// If true, return all permissions with is_granted set to indicate which are granted.
	WithAll bool `json:"with_all,omitempty" toon:"with_all,omitempty"`
}

RolePermissionListRequest is generated from the Flashduty OpenAPI schema.

type RolePermissionListResponse

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

RolePermissionListResponse is generated from the Flashduty OpenAPI schema.

type RoleUpsertRequest

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

RoleUpsertRequest is generated from the Flashduty OpenAPI schema.

type RoleUpsertResponse

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

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" toon:"channel_ids"`
	// If `true`, evaluation continues to the next case after this one matches; otherwise matching stops at the first hit.
	Fallthrough bool `json:"fallthrough" toon:"fallthrough"`
	// List of match conditions that are AND-ed together.
	If []RouteMatchCondition `json:"if" toon:"if"`
	// 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" toon:"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" toon:"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" toon:"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" toon:"integration_id"`
}

RouteInfoRequest is generated from the Flashduty OpenAPI schema.

type RouteItem

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

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" toon:"key"`
	// Match operator. `IN` matches when the field value is one of `vals`; `NOTIN` matches when it is not.
	Oper string `json:"oper" toon:"oper"`
	// 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" toon:"vals"`
}

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" toon:"name"`
	// Index in `cases` where this section starts. Must be between 0 and the length of `cases`.
	Position int64 `json:"position" toon:"position"`
}

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,omitzero" toon:"check_anydata,omitempty"`
	// No-data check configuration.
	CheckNodata RuleConfigsCheckNodata `json:"check_nodata,omitzero" toon:"check_nodata,omitempty"`
	// Threshold check configuration.
	CheckThreshold RuleConfigsCheckThreshold `json:"check_threshold,omitzero" toon:"check_threshold,omitempty"`
	Queries        []RuleConfigsQueriesItem  `json:"queries,omitempty" toon:"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" toon:"relate_queries,omitempty"`
}

RuleConfigs is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckAnydata

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

RuleConfigsCheckAnydata is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckAnydataRecovery

type RuleConfigsCheckAnydataRecovery struct {
	Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
	// Recovery expression. Required when `mode` is `ql`.
	Condition string `json:"condition,omitempty" toon:"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" toon:"mode,omitempty"`
}

RuleConfigsCheckAnydataRecovery is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckNodata

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

RuleConfigsCheckNodata is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckThreshold

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

RuleConfigsCheckThreshold is generated from the Flashduty OpenAPI schema.

type RuleConfigsCheckThresholdRecovery

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

RuleConfigsCheckThresholdRecovery is generated from the Flashduty OpenAPI schema.

type RuleConfigsQueriesItem

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

RuleConfigsQueriesItem is generated from the Flashduty OpenAPI schema.

type RuleConfigsRelateQueriesItem

type RuleConfigsRelateQueriesItem struct {
	Args map[string]string `json:"args,omitempty" toon:"args,omitempty"`
	// Query expression.
	Expr string `json:"expr,omitempty" toon:"expr,omitempty"`
	// Relate-query identifier.
	Name string `json:"name,omitempty" toon:"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" toon:"rule_id"`
	// Rule name echoed back from the request.
	RuleName string `json:"rule_name" toon:"rule_name"`
}

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" toon:"annotations,omitempty"`
	ChannelIDs      []uint64          `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	CronPattern     string            `json:"cron_pattern,omitempty" toon:"cron_pattern,omitempty"`
	DebugLogEnabled bool              `json:"debug_log_enabled,omitempty" toon:"debug_log_enabled,omitempty"`
	DelaySeconds    int64             `json:"delay_seconds,omitempty" toon:"delay_seconds,omitempty"`
	Description     string            `json:"description,omitempty" toon:"description,omitempty"`
	DsIDs           []uint64          `json:"ds_ids,omitempty" toon:"ds_ids,omitempty"`
	DsList          []string          `json:"ds_list,omitempty" toon:"ds_list,omitempty"`
	DsType          string            `json:"ds_type,omitempty" toon:"ds_type,omitempty"`
	Enabled         bool              `json:"enabled,omitempty" toon:"enabled,omitempty"`
	EnabledTimes    []EnabledTime     `json:"enabled_times,omitempty" toon:"enabled_times,omitempty"`
	// Field names to update.
	Fields []string `json:"fields" toon:"fields"`
	// Rule IDs to update.
	IDs            []uint64          `json:"ids" toon:"ids"`
	Labels         map[string]string `json:"labels,omitempty" toon:"labels,omitempty"`
	RepeatInterval int64             `json:"repeat_interval,omitempty" toon:"repeat_interval,omitempty"`
	RepeatTotal    int64             `json:"repeat_total,omitempty" toon:"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" toon:"folder_id,omitempty"`
}

RuleFolderIDRequest is generated from the Flashduty OpenAPI schema.

type RuleIDRequest

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

RuleIDRequest is generated from the Flashduty OpenAPI schema.

type RuleIDsRequest

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

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" toon:"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" toon:"dest_folder_id"`
	// Rule IDs to move.
	IDs []uint64 `json:"ids" toon:"ids"`
}

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" toon:"id,omitempty"`
	// Pagination offset.
	Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
	// SLS project name.
	Project string `json:"project,omitempty" toon:"project,omitempty"`
	// Page size.
	Size int64 `json:"size,omitempty" toon:"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" toon:"id,omitempty"`
	// Pagination offset.
	Offset int64 `json:"offset,omitempty" toon:"offset,omitempty"`
	// Name prefix filter.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Page size.
	Size int64 `json:"size,omitempty" toon:"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" toon:"layer_name"`
	// Layer mode: 0 = common rotation, 1 = override.
	Mode int64 `json:"mode" toon:"mode"`
	// Layer internal name.
	Name string `json:"name" toon:"name"`
	// Computed shifts.
	Schedules []ScheduleCalculatedSchedule `json:"schedules" toon:"schedules"`
}

ScheduleCalculatedLayer is generated from the Flashduty OpenAPI schema.

type ScheduleCalculatedSchedule

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

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" toon:"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" toon:"cycle"`
	// Notification start time within the cycle.
	Start string `json:"start" toon:"start"`
}

ScheduleFixedTimeNotifyInfo is generated from the Flashduty OpenAPI schema.

type ScheduleGroup

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

ScheduleGroup is generated from the Flashduty OpenAPI schema.

type ScheduleIDResponse

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

ScheduleIDResponse is generated from the Flashduty OpenAPI schema.

type ScheduleIDsBodyRequest

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

ScheduleIDsBodyRequest is generated from the Flashduty OpenAPI schema.

type ScheduleIDsRequest

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

ScheduleIDsRequest is generated from the Flashduty OpenAPI schema.

type ScheduleImNotify

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

ScheduleImNotify is generated from the Flashduty OpenAPI schema.

type ScheduleImNotifySettings

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

ScheduleImNotifySettings is generated from the Flashduty OpenAPI schema.

type ScheduleInfoRequest

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

ScheduleInfoRequest is generated from the Flashduty OpenAPI schema.

type ScheduleItem

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

ScheduleItem is generated from the Flashduty OpenAPI schema.

type ScheduleLayer

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

ScheduleLayer is generated from the Flashduty OpenAPI schema.

type ScheduleListRequest

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

ScheduleListRequest is generated from the Flashduty OpenAPI schema.

type ScheduleListResponse

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

ScheduleListResponse is generated from the Flashduty OpenAPI schema.

type ScheduleMember

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

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" toon:"advance_in_time,omitempty"`
	By            ScheduleNotifyBy            `json:"by" toon:"by"`
	FixedTime     ScheduleFixedTimeNotifyInfo `json:"fixed_time" toon:"fixed_time"`
	// Legacy IM-type to token map.
	Im map[string]string `json:"im,omitempty" toon:"im,omitempty"`
	// IM webhook notification channels.
	Webhooks []ScheduleImNotify `json:"webhooks" toon:"webhooks"`
}

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" toon:"follow_preference"`
	// Personal notification channel keys.
	PersonalChannels []string `json:"personal_channels" toon:"personal_channels"`
}

ScheduleNotifyBy is generated from the Flashduty OpenAPI schema.

type ScheduleOncallGroup

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

ScheduleOncallGroup is generated from the Flashduty OpenAPI schema.

type ScheduleRestrictPeriod

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

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" toon:"end,omitempty"`
	// Window start (Unix seconds, 10 digits).
	Start int64 `json:"start,omitempty" toon:"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" toon:"items"`
}

ScheduleSelfResponse is generated from the Flashduty OpenAPI schema.

type ScheduleUpsertRequest

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

type ServiceDeskPlusRequestListRequest struct {
	ListOptions
	// When `true`, sort by internal record ID ascending; otherwise descending.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Channel IDs to filter by.
	ChannelIDs []int64 `json:"channel_ids,omitempty" toon:"channel_ids,omitempty"`
	// Window end, Unix seconds. Must be greater than or equal to `start_time`. Optional when `incident_id` is provided.
	EndTime int64 `json:"end_time,omitempty" toon:"end_time,omitempty"`
	// Flashduty incident ID. When set, the time window can be omitted.
	IncidentID string `json:"incident_id,omitempty" toon:"incident_id,omitempty"`
	// ServiceDeskPlus integration ID.
	IntegrationID int64 `json:"integration_id,omitempty" toon:"integration_id,omitempty"`
	// ServiceDeskPlus request ID.
	RequestID string `json:"request_id,omitempty" toon:"request_id,omitempty"`
	// Window start, Unix seconds. Optional when `incident_id` is provided.
	StartTime int64 `json:"start_time,omitempty" toon:"start_time,omitempty"`
	// Synchronization status filter.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
}

ServiceDeskPlusRequestListRequest is generated from the Flashduty OpenAPI schema.

type ServiceDeskPlusRequestListResponse added in v0.5.8

type ServiceDeskPlusRequestListResponse struct {
	// True when more results are available.
	HasNextPage bool `json:"has_next_page" toon:"has_next_page"`
	// Synchronization records on the current page.
	Items []ServiceDeskPlusRequestMappingItem `json:"items" toon:"items"`
	// Cursor for the next page. Empty when no more data is available.
	SearchAfterCtx string `json:"search_after_ctx" toon:"search_after_ctx"`
	// Total number of matching records, capped at 1,000 for counting.
	Total int64 `json:"total" toon:"total"`
}

ServiceDeskPlusRequestListResponse is generated from the Flashduty OpenAPI schema.

type ServiceDeskPlusRequestMappingItem added in v0.5.8

type ServiceDeskPlusRequestMappingItem struct {
	// Channel ID for the incident.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Channel name for the incident.
	ChannelName string `json:"channel_name" toon:"channel_name"`
	// Mapping record creation time, Unix seconds.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Error message when synchronization failed. Usually absent on successful records.
	ErrorMessage string `json:"error_message" toon:"error_message"`
	// Associated Flashduty incident ID.
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// Associated incident title.
	IncidentTitle string `json:"incident_title" toon:"incident_title"`
	// ServiceDeskPlus integration ID.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// ServiceDeskPlus request ID.
	RequestID string `json:"request_id" toon:"request_id"`
	// ServiceDeskPlus request detail URL.
	RequestLink string `json:"request_link" toon:"request_link"`
	// Synchronization status.
	Status string `json:"status" toon:"status"`
}

ServiceDeskPlusRequestMappingItem is generated from the Flashduty OpenAPI schema.

type SessionDeleteRequest added in v0.5.4

type SessionDeleteRequest struct {
	// Target session ID.
	SessionID string `json:"session_id" toon:"session_id"`
}

SessionDeleteRequest is generated from the Flashduty OpenAPI schema.

type SessionExportRequest added in v0.5.4

type SessionExportRequest struct {
	// When true, each subagent_dispatch line is followed by the child session's full event stream, bracketed by its own session_meta. Defaults to false.
	IncludeSubagents bool `json:"include_subagents,omitempty" toon:"include_subagents,omitempty"`
	// Target session ID.
	SessionID string `json:"session_id" toon:"session_id"`
}

SessionExportRequest is generated from the Flashduty OpenAPI schema.

type SessionGetRequest added in v0.5.4

type SessionGetRequest struct {
	// Page size for events; takes precedence over `num_recent_events`. 0 uses the server default (100).
	Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
	// Legacy page size: number of most-recent events to return. Superseded by `limit` when both are set; 0 uses the server default (100).
	NumRecentEvents int64 `json:"num_recent_events,omitempty" toon:"num_recent_events,omitempty"`
	// Opaque keyset cursor from a previous response; pass it back to fetch the next older page.
	SearchAfterCtx string `json:"search_after_ctx,omitempty" toon:"search_after_ctx,omitempty"`
	// Target session ID.
	SessionID string `json:"session_id" toon:"session_id"`
	// Share token for accessing a session through its share link. Omit it for normal account-authorized access.
	ShareToken string `json:"share_token,omitempty" toon:"share_token,omitempty"`
}

SessionGetRequest is generated from the Flashduty OpenAPI schema.

type SessionGetResponse added in v0.5.4

type SessionGetResponse struct {
	// Recent events, ascending by (created_at, event_id).
	Events []EventItem `json:"events" toon:"events"`
	// True when older events remain beyond this page.
	HasMoreOlder bool `json:"has_more_older" toon:"has_more_older"`
	// Opaque keyset cursor; pass back as search_after_ctx to fetch the next older page. Omitted when has_more_older is false.
	SearchAfterCtx string      `json:"search_after_ctx" toon:"search_after_ctx"`
	Session        SessionItem `json:"session" toon:"session"`
	// Account-wide onboarding flag: true when the account has zero knowledge packs in any scope; not specific to this session.
	SuggestInit bool `json:"suggest_init" toon:"suggest_init"`
}

SessionGetResponse is generated from the Flashduty OpenAPI schema.

type SessionItem added in v0.5.4

type SessionItem struct {
	// How the caller received access to this session. Omitted when no access source is resolved.
	AccessSource string `json:"access_source" toon:"access_source"`
	// Agent app that owns the session.
	AppName string `json:"app_name" toon:"app_name"`
	// Unix timestamp in milliseconds when archived; 0 means not archived.
	ArchivedAt       TimestampMilli     `json:"archived_at" toon:"archived_at"`
	BoundEnvironment EnvironmentBinding `json:"bound_environment" toon:"bound_environment"`
	// True when the caller can add a new turn to this session.
	CanContinue bool `json:"can_continue" toon:"can_continue"`
	// True when the caller can fork this session.
	CanFork bool `json:"can_fork" toon:"can_fork"`
	// True when the caller may rename/archive/delete the session; personal sessions are creator-only, team sessions allow the creator, account admin, or team member.
	CanManage bool `json:"can_manage" toon:"can_manage"`
	// True when the caller can view this session.
	CanView         bool                `json:"can_view" toon:"can_view"`
	ContextResolved ContextResolvedItem `json:"context_resolved" toon:"context_resolved"`
	// The bound model's max context size in tokens. 0 means unknown.
	ContextWindow int64 `json:"context_window" toon:"context_window"`
	// Unix timestamp in milliseconds when the session was created.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Size in tokens of the LLM context window as of the most recent turn. 0 means no turn has completed.
	CurrentContextTokens int64 `json:"current_context_tokens" toon:"current_context_tokens"`
	// Active working duration in milliseconds for the current or most recent round, excluding time spent waiting on ask_user; resets to 0 at the start of each new round.
	CurrentTurnActiveMs int64 `json:"current_turn_active_ms" toon:"current_turn_active_ms"`
	// Unix timestamp in milliseconds when the current or most recent round started; 0 if no round has started yet.
	CurrentTurnStartedAt TimestampMilli `json:"current_turn_started_at" toon:"current_turn_started_at"`
	// Total tokens (input+output+reasoning) for the in-flight round across the parent and its subagents; only computed by session/get while the session is running, always 0 in session/list responses and when idle.
	CurrentTurnTokens int64 `json:"current_turn_tokens" toon:"current_turn_tokens"`
	// Accumulated ask_user human-wait duration in milliseconds for the current round; resets to 0 at the start of each new round.
	CurrentTurnWaitMs int64 `json:"current_turn_wait_ms" toon:"current_turn_wait_ms"`
	// Surface that created the session.
	EntryKind string `json:"entry_kind" toon:"entry_kind"`
	// True when there is assistant output the caller has not yet viewed.
	HasUnread bool `json:"has_unread" toon:"has_unread"`
	// True for incognito (non-persisted-memory) sessions.
	Incognito bool `json:"incognito" toon:"incognito"`
	// True when the caller created this session.
	IsMine bool `json:"is_mine" toon:"is_mine"`
	// True when an agent turn is currently in flight for this session.
	IsRunning bool `json:"is_running" toon:"is_running"`
	// Unix timestamp in milliseconds of the most recent assistant-side event.
	LastEventAt TimestampMilli `json:"last_event_at" toon:"last_event_at"`
	// Parent session id for subagent (child) sessions; empty otherwise.
	ParentSessionID string `json:"parent_session_id" toon:"parent_session_id"`
	// Creator person id.
	PersonID string `json:"person_id" toon:"person_id"`
	// Caller's per-user pin timestamp in milliseconds; 0 means not pinned.
	PinnedAt TimestampMilli `json:"pinned_at" toon:"pinned_at"`
	// Session identifier.
	SessionID string `json:"session_id" toon:"session_id"`
	// Session title; may be empty for untitled sessions.
	SessionName string `json:"session_name" toon:"session_name"`
	// True when the session's share link is active.
	ShareEnabled bool `json:"share_enabled" toon:"share_enabled"`
	// Revision of the share link; it increases when sharing is revoked.
	ShareVersion int64 `json:"share_version" toon:"share_version"`
	// Unix timestamp in milliseconds when sharing was last enabled; 0 if never shared.
	SharedAt TimestampMilli `json:"shared_at" toon:"shared_at"`
	// Person ID that most recently enabled sharing; 0 if never shared.
	SharedBy int64 `json:"shared_by" toon:"shared_by"`
	// Raw session-state bag (session-scoped keys). Omitted when empty.
	State map[string]any `json:"state" toon:"state"`
	// Lifecycle status.
	Status string `json:"status" toon:"status"`
	// Owning team id; 0 means no team is bound. Immutable after create.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Resolved team name; empty for unbound rows or deleted teams.
	TeamName string `json:"team_name" toon:"team_name"`
	// Current save→validate round id (template-assistant only); empty otherwise.
	TemplateStagingRoundID string            `json:"template_staging_round_id" toon:"template_staging_round_id"`
	TokenUsage             SessionTokenUsage `json:"token_usage" toon:"token_usage"`
	// Unix timestamp in milliseconds of the last session update.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
}

SessionItem is generated from the Flashduty OpenAPI schema.

type SessionListRequest added in v0.5.4

type SessionListRequest struct {
	ListOptions
	// Agent app whose sessions to list.
	AppName string `json:"app_name" toon:"app_name"`
	// Ascending order when true; applies only when `orderby` is set.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Restrict to sessions produced by these surfaces; empty returns every kind.
	EntryKinds []string `json:"entry_kinds,omitempty" toon:"entry_kinds,omitempty"`
	// Include subagent-dispatched sessions in the list.
	IncludeSubagentSessions bool `json:"include_subagent_sessions,omitempty" toon:"include_subagent_sessions,omitempty"`
	// Filter by session-name keyword.
	Keyword string `json:"keyword,omitempty" toon:"keyword,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Visibility scope: `all` (own personal + accessible team sessions), `personal`, or `team`; default `all`.
	Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
	// Archive bucket: active (default) returns un-archived, archived returns archived, all returns both.
	Status string `json:"status,omitempty" toon:"status,omitempty"`
	// Optional explicit team filter; intersects with `scope` and never expands access.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}

SessionListRequest is generated from the Flashduty OpenAPI schema.

type SessionListResponse added in v0.5.4

type SessionListResponse struct {
	// The page of sessions.
	Sessions []SessionItem `json:"sessions" toon:"sessions"`
	// Account-wide onboarding flag: true when the account has zero knowledge packs in any scope; not dependent on this call's filters.
	SuggestInit bool `json:"suggest_init" toon:"suggest_init"`
	// Total number of sessions matching the filter (ignoring pagination).
	Total int64 `json:"total" toon:"total"`
}

SessionListResponse is generated from the Flashduty OpenAPI schema.

type SessionReplayService added in v0.5.7

type SessionReplayService service

SessionReplayService handles the "RUM/Session replay" API resource.

func (*SessionReplayService) Metadata added in v0.5.7

Get session replay metadata.

Return the application, device, session bounds, and views recorded for a replayable session.

API: POST /rum/session-replay/metadata (rum-session-replay-read-metadata).

func (*SessionReplayService) Segments added in v0.5.7

List session replay segments.

Page through the recorded replay segments of a session, as presigned URLs or a raw stream.

API: POST /rum/session-replay/segments (rum-session-replay-read-segments).

type SessionTokenUsage added in v0.5.4

type SessionTokenUsage struct {
	// Portion of input_tokens served from the prompt cache.
	CachedTokens int64 `json:"cached_tokens" toon:"cached_tokens"`
	// Total prompt (input) tokens, including the cached portion.
	InputTokens int64 `json:"input_tokens" toon:"input_tokens"`
	// Total generated (output) tokens.
	OutputTokens int64 `json:"output_tokens" toon:"output_tokens"`
	// Total reasoning/thinking tokens.
	ReasoningTokens int64 `json:"reasoning_tokens" toon:"reasoning_tokens"`
}

SessionTokenUsage is generated from the Flashduty OpenAPI schema.

type SessionsService added in v0.5.4

type SessionsService service

SessionsService handles the "AI SRE/Sessions" API resource.

func (*SessionsService) Export added in v0.5.4

Export streams a session's full event transcript as newline-delimited JSON (application/x-ndjson). The first line is always a session_meta envelope; subsequent lines are session events. When req.IncludeSubagents is true, each subagent_dispatch line is followed by the child session's own stream.

Unlike the generated typed endpoints, the success body is NOT a JSON envelope: it is a potentially large line-delimited stream meant to be written straight to a file. The returned io.ReadCloser is the live HTTP response body — the caller owns it and MUST Close it (a deferred close is correct). Parse it line-by-line (see NewExportScanner / DecodeExportLine); do not buffer the whole transcript into memory.

On any non-2xx status the body is the usual JSON error envelope: Export reads and closes it and returns a typed error (*ErrorResponse, or *RateLimitError on 429) with a nil ReadCloser, matching the generated endpoints.

API: POST /safari/session/export (session-read-export).

func (*SessionsService) ReadInfo added in v0.5.4

Get session detail.

Fetch one session plus a backward-paged window of its most recent events.

API: POST /safari/session/get (session-read-info).

func (*SessionsService) ReadList added in v0.5.4

List sessions.

List agent sessions visible to the caller, filtered by app, surface, archive status, and team.

API: POST /safari/session/list (session-read-list).

func (*SessionsService) WriteDelete added in v0.5.4

func (s *SessionsService) WriteDelete(ctx context.Context, req *SessionDeleteRequest) (*any, *Response, error)

Delete session.

Delete a session by ID.

API: POST /safari/session/delete (session-write-delete).

type SilenceRuleItem

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

SilenceRuleItem is generated from the Flashduty OpenAPI schema.

type SkillDeleteRequest added in v0.4.0

type SkillDeleteRequest struct {
	// Target skill ID.
	SkillID string `json:"skill_id" toon:"skill_id"`
}

SkillDeleteRequest is generated from the Flashduty OpenAPI schema.

type SkillGetRequest added in v0.4.0

type SkillGetRequest struct {
	// Target skill ID.
	SkillID string `json:"skill_id" toon:"skill_id"`
}

SkillGetRequest is generated from the Flashduty OpenAPI schema.

type SkillItem added in v0.4.0

type SkillItem struct {
	// Owning account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Skill author.
	Author string `json:"author" toon:"author"`
	// Whether the caller may edit this skill.
	CanEdit bool `json:"can_edit" toon:"can_edit"`
	// SHA-256 checksum of the skill zip.
	Checksum string `json:"checksum" toon:"checksum"`
	// Full SKILL.md content. Omitted in list responses.
	Content string `json:"content" toon:"content"`
	// Set only on install-from-session responses: true = fresh install, false = in-place update.
	Created bool `json:"created" toon:"created"`
	// Creation time. Unix timestamp in milliseconds.
	CreatedAt TimestampMilli `json:"created_at" toon:"created_at"`
	// Member ID that created the skill.
	CreatedBy int64 `json:"created_by" toon:"created_by"`
	// Human-readable description from the SKILL.md frontmatter.
	Description string `json:"description" toon:"description"`
	// Optional English description. English-locale UI responses prefer this over `description`; the skill catalog also uses it as a stable selection signal when `description` is localized for display.
	DescriptionEn string `json:"description_en" toon:"description_en"`
	// True when a marketplace-sourced skill was edited locally (auto-update skips it).
	IsModified bool `json:"is_modified" toon:"is_modified"`
	// Skill license.
	License string `json:"license" toon:"license"`
	// Object-storage key of the skill zip.
	S3Key string `json:"s3_key" toon:"s3_key"`
	// Unique skill ID (prefix `skill_`).
	SkillID string `json:"skill_id" toon:"skill_id"`
	// Skill name, unique within the account.
	SkillName string `json:"skill_name" toon:"skill_name"`
	// Marketplace template this skill was installed from; empty for user-authored.
	SourceTemplateName string `json:"source_template_name" toon:"source_template_name"`
	// Template version at install time.
	SourceTemplateVersion string `json:"source_template_version" toon:"source_template_version"`
	// Skill status. Deleted skills are excluded from every API response, so only these two values are ever returned.
	Status string `json:"status" toon:"status"`
	// Tags parsed from the frontmatter.
	Tags []string `json:"tags" toon:"tags"`
	// Team scope: 0 = account-wide; >0 = the owning team.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Required tools (builtin or `mcp:server/tool`).
	Tools []string `json:"tools" toon:"tools"`
	// True when the marketplace has a newer template version.
	UpdateAvailable bool `json:"update_available" toon:"update_available"`
	// Last update time. Unix timestamp in milliseconds.
	UpdatedAt TimestampMilli `json:"updated_at" toon:"updated_at"`
	// Skill version from the frontmatter.
	Version string `json:"version" toon:"version"`
}

SkillItem is generated from the Flashduty OpenAPI schema.

type SkillListRequest added in v0.4.0

type SkillListRequest struct {
	ListOptions
	// Include account-scoped (team_id=0) rows. Defaults to true. Ignored when `scope` is `account` or `team`.
	IncludeAccount *bool `json:"include_account,omitempty" toon:"include_account,omitempty"`
	// Free-text search across skill name, description, English description, skill ID, marketplace source template name, and author.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Restrict results to `all` (default), `account`-only (team_id=0), or `team`-only (excludes account-scoped rows). Overrides `include_account` when set.
	Scope string `json:"scope,omitempty" toon:"scope,omitempty"`
	// Filter to these team IDs; empty = the caller's visible set.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"team_ids,omitempty"`
}

SkillListRequest is generated from the Flashduty OpenAPI schema.

type SkillListResponse added in v0.4.0

type SkillListResponse struct {
	// Skills on this page.
	Skills []SkillItem `json:"skills" toon:"skills"`
	// Total number of matching skills.
	Total int64 `json:"total" toon:"total"`
}

SkillListResponse is generated from the Flashduty OpenAPI schema.

type SkillStatusRequest added in v0.4.0

type SkillStatusRequest struct {
	// Target skill ID.
	SkillID string `json:"skill_id" toon:"skill_id"`
}

SkillStatusRequest is generated from the Flashduty OpenAPI schema.

type SkillUpdateRequest added in v0.4.0

type SkillUpdateRequest struct {
	// New description. Cannot contain `<` or `>`. Sending an empty string leaves the current value unchanged — there is no way to clear it via this field.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// New English description. Cannot contain `<` or `>`. Omit to leave unchanged; send an empty string to explicitly clear it.
	DescriptionEn *string `json:"description_en,omitempty" toon:"description_en,omitempty"`
	// Target skill ID.
	SkillID string `json:"skill_id" toon:"skill_id"`
	// Reassign team scope: 0 = account-wide; >0 = team. Omit to leave unchanged.
	TeamID *int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}

SkillUpdateRequest is generated from the Flashduty OpenAPI schema.

type SkillUploadRequest added in v0.5.4

type SkillUploadRequest struct {
	// Skill archive (.skill / .zip / .tar.gz / .tgz). Max 100MB; oversized files are rejected before the body is read.
	File string `json:"file" toon:"file"`
	// When true, overwrite an existing skill instead of failing on a name collision — matched by `skill_id` if provided, otherwise by skill name.
	Replace bool `json:"replace,omitempty" toon:"replace,omitempty"`
	// Existing skill ID to target when replacing a specific skill (requires `replace=true`).
	SkillID string `json:"skill_id,omitempty" toon:"skill_id,omitempty"`
	// Team scope for the created/upserted skill: 0 = account-wide. Ignored when replacing a specific skill via `skill_id`.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
}

SkillUploadRequest is generated from the Flashduty OpenAPI schema.

type SkillsService added in v0.4.0

type SkillsService service

SkillsService handles the "AI SRE/Skills" API resource.

func (*SkillsService) ReadEnable added in v0.4.0

func (s *SkillsService) ReadEnable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)

Enable skill.

Enable a disabled skill so the agent can load it.

API: POST /safari/skill/enable (skill-read-enable).

func (*SkillsService) ReadGet added in v0.4.0

func (s *SkillsService) ReadGet(ctx context.Context, req *SkillGetRequest) (*SkillItem, *Response, error)

Get skill detail.

Get one skill including its full SKILL.md content.

API: POST /safari/skill/get (skill-read-get).

func (*SkillsService) ReadList added in v0.4.0

List skills.

List AI SRE skills visible to the caller across account and team scopes, with pagination.

API: POST /safari/skill/list (skill-read-list).

func (*SkillsService) WriteDelete added in v0.4.0

func (s *SkillsService) WriteDelete(ctx context.Context, req *SkillDeleteRequest) (*any, *Response, error)

Delete skill.

Delete a skill by ID.

API: POST /safari/skill/delete (skill-write-delete).

func (*SkillsService) WriteDisable added in v0.4.0

func (s *SkillsService) WriteDisable(ctx context.Context, req *SkillStatusRequest) (*any, *Response, error)

Disable skill.

Disable an enabled skill so the agent stops loading it.

API: POST /safari/skill/disable (skill-write-disable).

func (*SkillsService) WriteUpdate added in v0.4.0

func (s *SkillsService) WriteUpdate(ctx context.Context, req *SkillUpdateRequest) (*SkillItem, *Response, error)

Update skill.

Update a skill's descriptions or reassign its team scope.

API: POST /safari/skill/update (skill-write-update).

func (*SkillsService) WriteUpload added in v0.4.0

func (s *SkillsService) WriteUpload(ctx context.Context) (*SkillItem, *Response, error)

Upload skill.

Upload a skill archive (.skill/.zip/.tar.gz/.tgz) to create or replace a skill.

API: POST /safari/skill/upload (skill-write-upload).

type SnoozeIncidentRequest

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

SnoozeIncidentRequest is generated from the Flashduty OpenAPI schema.

type SourcemapBinaryImage added in v0.5.4

type SourcemapBinaryImage struct {
	// CPU architecture for this binary image.
	Arch string `json:"arch,omitempty" toon:"arch,omitempty"`
	// Whether this binary belongs to the operating system.
	IsSystem bool `json:"is_system" toon:"is_system"`
	// Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer.
	LoadAddress any `json:"load_address,omitempty" toon:"load_address,omitempty"`
	// Runtime address. Accepts a hex string such as `0x100000000` or a decimal integer.
	MaxAddress any `json:"max_address,omitempty" toon:"max_address,omitempty"`
	// Binary image name.
	Name string `json:"name" toon:"name"`
	// Build UUID identifying the binary or dSYM.
	Uuid string `json:"uuid" toon:"uuid"`
}

SourcemapBinaryImage is generated from the Flashduty OpenAPI schema.

type SourcemapCodeSnippet added in v0.5.4

type SourcemapCodeSnippet struct {
	// Source code on that line.
	Code string `json:"code" toon:"code"`
	// Source line number.
	Line int64 `json:"line" toon:"line"`
}

SourcemapCodeSnippet is generated from the Flashduty OpenAPI schema.

type SourcemapEnrichedFrame added in v0.5.4

type SourcemapEnrichedFrame struct {
	// iOS or native memory address.
	Address string `json:"address" toon:"address"`
	// Android Java/Kotlin class name.
	ClassName string `json:"class_name" toon:"class_name"`
	// Source-code snippets around this frame.
	CodeSnippets []SourcemapCodeSnippet `json:"code_snippets" toon:"code_snippets"`
	// Column number for JavaScript or Flutter frames.
	Column int64 `json:"column" toon:"column"`
	// Whether the frame was successfully symbolicated or deobfuscated.
	Converted bool `json:"converted" toon:"converted"`
	// Source file, URL, or module path.
	File string `json:"file" toon:"file"`
	// Function or method name.
	Function string `json:"function" toon:"function"`
	// Line number.
	Line int64 `json:"line" toon:"line"`
	// Android Java/Kotlin method name without class prefix.
	MethodName string `json:"method_name" toon:"method_name"`
	// iOS Swift/Objective-C module name.
	Module string `json:"module" toon:"module"`
	// Unity IL native address.
	NativeAddress string `json:"native_address" toon:"native_address"`
	// Symbol offset from function start.
	Offset        int64               `json:"offset" toon:"offset"`
	OriginalFrame SourcemapStackFrame `json:"original_frame" toon:"original_frame"`
	// Whether the frame is from third-party or system libraries.
	ThirdParty bool `json:"third_party" toon:"third_party"`
}

SourcemapEnrichedFrame is generated from the Flashduty OpenAPI schema.

type SourcemapItem

type SourcemapItem struct {
	// Upload timestamp, Unix epoch seconds.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Git commit SHA for this build.
	GitCommitSHA string `json:"git_commit_sha" toon:"git_commit_sha"`
	// Git repository URL associated with this build.
	GitRepositoryURL string `json:"git_repository_url" toon:"git_repository_url"`
	// Storage key uniquely identifying this sourcemap file.
	Key string `json:"key" toon:"key"`
	// 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" toon:"metadata"`
	// Application or service name.
	Service string `json:"service" toon:"service"`
	// File size in bytes.
	Size int64 `json:"size" toon:"size"`
	// Platform type: `browser`, `android`, or `ios`.
	Type string `json:"type" toon:"type"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
	// Application version string.
	Version string `json:"version" toon:"version"`
}

SourcemapItem is generated from the Flashduty OpenAPI schema.

type SourcemapListRequest

type SourcemapListRequest struct {
	ListOptions
	// Sort ascending. Default false (descending).
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Android only. Filter by Gradle plugin build identifier. Max 200 characters.
	BuildID string `json:"build_id,omitempty" toon:"build_id,omitempty"`
	// End of upload time range, Unix epoch milliseconds. Maximum window: 365 days.
	EndTime int64 `json:"end_time" toon:"end_time"`
	// Sort field.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Substring match on the minified URL (browser) or build ID (android). Max 200 characters.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by service names. Up to 100 values.
	Services []string `json:"services,omitempty" toon:"services,omitempty"`
	// Start of upload time range, Unix epoch milliseconds. Must be > 0 and before `end_time`.
	StartTime int64 `json:"start_time" toon:"start_time"`
	// Platform type. Defaults to `browser` when omitted.
	Type string `json:"type,omitempty" toon:"type,omitempty"`
	// iOS only. Filter by dSYM bundle UUID. Max 200 characters.
	Uuid string `json:"uuid,omitempty" toon:"uuid,omitempty"`
	// Filter by version strings. Up to 100 values.
	Versions []string `json:"versions,omitempty" toon:"versions,omitempty"`
}

SourcemapListRequest is generated from the Flashduty OpenAPI schema.

type SourcemapListResponse

type SourcemapListResponse struct {
	Items []SourcemapItem `json:"items" toon:"items"`
	// Total number of matching records.
	Total int64 `json:"total" toon:"total"`
}

SourcemapListResponse is generated from the Flashduty OpenAPI schema.

type SourcemapStackEnrichRequest added in v0.5.4

type SourcemapStackEnrichRequest struct {
	// Android NDK architecture such as `arm`, `arm64`, `x86`, or `x64`.
	Arch string `json:"arch,omitempty" toon:"arch,omitempty"`
	// Loaded binary images from an iOS crash report.
	BinaryImages []SourcemapBinaryImage `json:"binary_images,omitempty" toon:"binary_images,omitempty"`
	// Android build ID for Gradle plugin 1.13.0 and later.
	BuildID string `json:"build_id,omitempty" toon:"build_id,omitempty"`
	// Number of nearby meaningful source lines to return around converted frames.
	Near int64 `json:"near,omitempty" toon:"near,omitempty"`
	// Skip cached enrich results. Intended for debugging.
	NoCache bool `json:"no_cache,omitempty" toon:"no_cache,omitempty"`
	// Application or service name used when the sourcemap was uploaded.
	Service string `json:"service" toon:"service"`
	// Android error source type. Use `ndk` with `arch` for native symbolication.
	SourceType string `json:"source_type,omitempty" toon:"source_type,omitempty"`
	// Raw stack trace to parse and enrich.
	Stack string `json:"stack,omitempty" toon:"stack,omitempty"`
	// Source platform. Defaults to `browser` when omitted.
	Type string `json:"type,omitempty" toon:"type,omitempty"`
	// Android build variant used by older Gradle plugin versions.
	Variant string `json:"variant,omitempty" toon:"variant,omitempty"`
	// Application version used when the sourcemap was uploaded.
	Version string `json:"version" toon:"version"`
}

SourcemapStackEnrichRequest is generated from the Flashduty OpenAPI schema.

type SourcemapStackEnrichResponse added in v0.5.4

type SourcemapStackEnrichResponse struct {
	Frames []SourcemapEnrichedFrame `json:"frames" toon:"frames"`
}

SourcemapStackEnrichResponse is generated from the Flashduty OpenAPI schema.

type SourcemapStackFrame added in v0.5.4

type SourcemapStackFrame struct {
	// iOS or native memory address.
	Address string `json:"address" toon:"address"`
	// Android Java/Kotlin class name.
	ClassName string `json:"class_name" toon:"class_name"`
	// Column number for JavaScript or Flutter frames.
	Column int64 `json:"column" toon:"column"`
	// Source file, URL, or module path.
	File string `json:"file" toon:"file"`
	// Function or method name.
	Function string `json:"function" toon:"function"`
	// Line number.
	Line int64 `json:"line" toon:"line"`
	// Android Java/Kotlin method name without class prefix.
	MethodName string `json:"method_name" toon:"method_name"`
	// iOS Swift/Objective-C module name.
	Module string `json:"module" toon:"module"`
	// Unity IL native address.
	NativeAddress string `json:"native_address" toon:"native_address"`
	// Symbol offset from function start.
	Offset int64 `json:"offset" toon:"offset"`
}

SourcemapStackFrame 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).

func (*SourcemapsService) StackEnrich added in v0.5.4

Enrich a stack trace.

Symbolicate or deobfuscate a browser, Android, iOS, Mini Program, or HarmonyOS stack trace.

API: POST /sourcemap/stack/enrich (sourcemap-read-stack-enrich).

type StatusPageChangeCreateResponse

type StatusPageChangeCreateResponse struct {
	// Newly created event ID.
	ChangeID int64 `json:"change_id" toon:"change_id"`
	// Event title (echoed from the request).
	ChangeName string `json:"change_name" toon:"change_name"`
}

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" toon:"affected_components"`
	// Maintenance only: whether the status advances automatically based on the scheduled window.
	AutoUpdateBySchedule bool `json:"auto_update_by_schedule" toon:"auto_update_by_schedule"`
	// Event ID.
	ChangeID int64 `json:"change_id" toon:"change_id"`
	// Scheduled close time in unix seconds. Set for retrospective and maintenance events.
	CloseAtSeconds Timestamp `json:"close_at_seconds" toon:"close_at_seconds"`
	// Event description (Markdown).
	Description string `json:"description" toon:"description"`
	// Whether this event is a retrospective (historical) one.
	IsRetrospective bool `json:"is_retrospective" toon:"is_retrospective"`
	// Linked event IDs (related incidents, deployments, etc.).
	LinkedChangeIDs []string `json:"linked_change_ids" toon:"linked_change_ids"`
	// Whether subscribers were notified about this event.
	NotifySubscribers bool `json:"notify_subscribers" toon:"notify_subscribers"`
	// Parent status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Member IDs responsible for this event.
	ResponderIDs []int64 `json:"responder_ids" toon:"responder_ids"`
	// Event start time in unix seconds.
	StartAtSeconds Timestamp `json:"start_at_seconds" toon:"start_at_seconds"`
	// Current event status. Incident statuses: `investigating`/`identified`/`monitoring`/`resolved`. Maintenance statuses: `scheduled`/`ongoing`/`completed`.
	Status string `json:"status" toon:"status"`
	// Event title.
	Title string `json:"title" toon:"title"`
	// Event type.
	Type string `json:"type" toon:"type"`
	// Timeline updates attached to this event, ordered by time.
	Updates []StatusPageChangeUpdateItem `json:"updates" toon:"updates"`
}

StatusPageChangeItem is generated from the Flashduty OpenAPI schema.

type StatusPageChangeListResponse

type StatusPageChangeListResponse struct {
	Items []StatusPageChangeItem `json:"items" toon:"items"`
}

StatusPageChangeListResponse is generated from the Flashduty OpenAPI schema.

type StatusPageChangeTimelineCreateResponse

type StatusPageChangeTimelineCreateResponse struct {
	// Newly created update ID.
	UpdateID string `json:"update_id" toon:"update_id"`
}

StatusPageChangeTimelineCreateResponse is generated from the Flashduty OpenAPI schema.

type StatusPageChangeUpdateItem

type StatusPageChangeUpdateItem struct {
	// Update timestamp in unix seconds.
	AtSeconds Timestamp `json:"at_seconds" toon:"at_seconds"`
	// Component status transitions applied by this update.
	ComponentChanges []StatusPageComponentChangeItem `json:"component_changes" toon:"component_changes"`
	// Update description (Markdown).
	Description string `json:"description" toon:"description"`
	// Event status after this update. Omitted when the update does not change the overall status.
	Status string `json:"status" toon:"status"`
	// Update ID.
	UpdateID string `json:"update_id" toon:"update_id"`
}

StatusPageChangeUpdateItem is generated from the Flashduty OpenAPI schema.

type StatusPageComponentChangeItem

type StatusPageComponentChangeItem struct {
	// Component ID.
	ComponentID string `json:"component_id" toon:"component_id"`
	// Component display name. Populated by the backend on read; ignored on write.
	ComponentName string `json:"component_name" toon:"component_name"`
	// New component status. Incidents support `operational`/`degraded`/`partial_outage`/`full_outage`; maintenances support `operational`/`under_maintenance`.
	Status string `json:"status" toon:"status"`
}

StatusPageComponentChangeItem is generated from the Flashduty OpenAPI schema.

type StatusPageComponentItem

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

StatusPageComponentItem is generated from the Flashduty OpenAPI schema.

type StatusPageItem added in v0.4.0

type StatusPageItem struct {
	// Components tracked on the status page.
	Components []StatusPageComponentItem `json:"components" toon:"components"`
	// Get-in-touch contact, a mailto or website URL.
	ContactInfo string `json:"contact_info" toon:"contact_info"`
	// Custom domain pointing to the status page.
	CustomDomain string `json:"custom_domain" toon:"custom_domain"`
	// Custom navigation links shown on the status page.
	CustomLinks []map[string]string `json:"custom_links" toon:"custom_links"`
	DarkLogo string `json:"dark_logo" toon:"dark_logo"`
	// How the timeline is displayed.
	DateView string `json:"date_view" toon:"date_view"`
	// How uptime is displayed.
	DisplayUptimeMode string `json:"display_uptime_mode" toon:"display_uptime_mode"`
	// Favicon of the status page.
	Favicon string `json:"favicon" toon:"favicon"`
	Logo string `json:"logo" toon:"logo"`
	// URL opened when the logo is clicked.
	LogoURL string `json:"logo_url" toon:"logo_url"`
	// Display name of the status page.
	Name string `json:"name" toon:"name"`
	// Footer content of the status page.
	PageFooter string `json:"page_footer" toon:"page_footer"`
	// Header content of the status page.
	PageHeader string `json:"page_header" toon:"page_header"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Sections grouping the components.
	Sections     []StatusPageSectionItem    `json:"sections" toon:"sections"`
	Subscription StatusPageSubscriptionItem `json:"subscription" toon:"subscription"`
	// Preferred change-event template type.
	TemplatePreference string `json:"template_preference" toon:"template_preference"`
	// Visibility type of the status page.
	Type string `json:"type" toon:"type"`
	// URL-safe slug, unique per account.
	URLName string `json:"url_name" toon:"url_name"`
}

StatusPageItem is generated from the Flashduty OpenAPI schema.

type StatusPageMigrationJob

type StatusPageMigrationJob struct {
	// Owner account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Job creation time, unix seconds.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Terminal error message when `status` is `failed`.
	Error string `json:"error" toon:"error"`
	// Migration job ID.
	JobID string `json:"job_id" toon:"job_id"`
	// Current migration phase.
	Phase string `json:"phase" toon:"phase"`
	// Per-entity progress counters.
	Progress StatusPageMigrationProgress `json:"progress" toon:"progress"`
	// Atlassian Statuspage source page ID.
	SourcePageID string `json:"source_page_id" toon:"source_page_id"`
	// Current job status.
	Status string `json:"status" toon:"status"`
	// Flashduty target status page ID. Set once the job produces one, or supplied up front for subscriber migration.
	TargetPageID int64 `json:"target_page_id" toon:"target_page_id"`
	// Last status update time, unix seconds.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}

StatusPageMigrationJob is generated from the Flashduty OpenAPI schema.

type StatusPageMigrationProgress

type StatusPageMigrationProgress struct {
	// Steps completed so far.
	CompletedSteps       int64 `json:"completed_steps" toon:"completed_steps"`
	ComponentsImported   int64 `json:"components_imported" toon:"components_imported"`
	IncidentsImported    int64 `json:"incidents_imported" toon:"incidents_imported"`
	MaintenancesImported int64 `json:"maintenances_imported" toon:"maintenances_imported"`
	SectionsImported     int64 `json:"sections_imported" toon:"sections_imported"`
	SubscribersImported  int64 `json:"subscribers_imported" toon:"subscribers_imported"`
	// Number of subscribers skipped (e.g. because they would create duplicates).
	SubscribersSkipped int64 `json:"subscribers_skipped" toon:"subscribers_skipped"`
	TemplatesImported  int64 `json:"templates_imported" toon:"templates_imported"`
	// Total steps this job will perform.
	TotalSteps int64 `json:"total_steps" toon:"total_steps"`
	// Non-fatal warnings recorded during the job.
	Warnings []string `json:"warnings" toon:"warnings"`
}

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" toon:"job_id"`
}

StatusPageMigrationStartResponse is generated from the Flashduty OpenAPI schema.

type StatusPageSectionItem added in v0.4.0

type StatusPageSectionItem struct {
	// Section description.
	Description string `json:"description" toon:"description"`
	// Whether the section and its components are hidden from summary endpoints.
	HideAll bool `json:"hide_all" toon:"hide_all"`
	// Whether uptime data is hidden from summary responses.
	HideUptime bool `json:"hide_uptime" toon:"hide_uptime"`
	// Section name.
	Name string `json:"name" toon:"name"`
	// Display order of the section.
	OrderID int64 `json:"order_id" toon:"order_id"`
	// Section ID.
	SectionID string `json:"section_id" toon:"section_id"`
}

StatusPageSectionItem is generated from the Flashduty OpenAPI schema.

type StatusPageSubscriberExportResponse

type StatusPageSubscriberExportResponse string

func (StatusPageSubscriberExportResponse) String added in v0.5.2

String returns the underlying string value, implementing fmt.Stringer.

type StatusPageSubscriberListResponse

type StatusPageSubscriberListResponse struct {
	// Whether there is at least one more page after the current one.
	HasNextPage bool                               `json:"has_next_page" toon:"has_next_page"`
	Items       []ExportedStatusPageSubscriberItem `json:"items" toon:"items"`
	// Total matching subscribers.
	Total int64 `json:"total" toon:"total"`
}

StatusPageSubscriberListResponse is generated from the Flashduty OpenAPI schema.

type StatusPageSubscriptionItem added in v0.4.0

type StatusPageSubscriptionItem struct {
	// Whether email subscription is enabled.
	Email bool `json:"email,omitempty" toon:"email,omitempty"`
	// Whether IM subscription is enabled.
	Im bool `json:"im,omitempty" toon:"im,omitempty"`
}

StatusPageSubscriptionItem is generated from the Flashduty OpenAPI schema.

type StatusPagesChangeActiveListRequest added in v0.4.1

type StatusPagesChangeActiveListRequest struct {
	// Status page ID.
	PageID int64 `url:"page_id"`
	// Event type filter. Required. Returns only in-progress (non-terminal) events — `investigating`/`identified`/`monitoring` for `incident`, `scheduled`/`ongoing` for `maintenance`.
	Type string `url:"type"`
}

StatusPagesChangeActiveListRequest holds the query parameters for List active status page events.

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 StatusPagesInfoRequest added in v0.5.4

type StatusPagesInfoRequest struct {
	// Status page ID
	PageID string `url:"page_id"`
}

StatusPagesInfoRequest holds the query parameters for Get status page detail.

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) ChangeActiveList added in v0.4.1

List active status page events.

List in-progress (non-terminal) events of a given type for a status page.

API: GET /status-page/change/active/list (statusPageChangeActiveList).

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 status page events with only publicly visible affected components.

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) ComponentDelete added in v0.5.4

Delete status page component.

Delete a service component from a status page.

API: POST /status-page/component/delete (statusPageComponentDelete).

func (*StatusPagesService) ComponentUpsert added in v0.5.4

Upsert status page component.

Create or update a service component on a status page.

API: POST /status-page/component/upsert (statusPageComponentUpsert).

func (*StatusPagesService) Create added in v0.5.4

Create status page.

Create a new status page.

API: POST /status-page/create (statusPageCreate).

func (*StatusPagesService) Delete added in v0.5.4

Delete status page.

Delete a status page.

API: POST /status-page/delete (statusPageDelete).

func (*StatusPagesService) Info added in v0.5.4

Get status page detail.

Retrieve detailed configuration for a specific status page.

API: GET /status-page/info (statusPageInfo).

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) ReadPageList added in v0.4.0

List status pages.

List all status pages owned by the account, including their components and sections.

API: GET /status-page/list (status-page-read-page-list).

func (*StatusPagesService) SectionDelete added in v0.5.4

Delete status page section.

Delete a section from a status page.

API: POST /status-page/section/delete (statusPageSectionDelete).

func (*StatusPagesService) SectionUpsert added in v0.5.4

Upsert status page section.

Create or update a section on a status page.

API: POST /status-page/section/upsert (statusPageSectionUpsert).

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).

func (*StatusPagesService) TemplateDelete added in v0.5.4

Delete status page template.

Delete an event template from a status page.

API: POST /status-page/template/delete (statusPageTemplateDelete).

func (*StatusPagesService) TemplateList added in v0.5.4

List status page templates.

List all event templates for a status page.

API: GET /status-page/template/list (statusPageTemplateList).

func (*StatusPagesService) TemplateUpsert added in v0.5.4

Upsert status page template.

Create or update an event template for a status page.

API: POST /status-page/template/upsert (statusPageTemplateUpsert).

func (*StatusPagesService) Update added in v0.5.4

Update status page.

Update an existing status page configuration.

API: POST /status-page/update (statusPageUpdate).

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 StatusPagesTemplateListRequest added in v0.5.4

type StatusPagesTemplateListRequest struct {
	// Status page ID.
	PageID int64 `url:"page_id"`
	// Template category. `pre_defined` returns predefined event templates; `message` returns message notification templates.
	Type string `url:"type"`
}

StatusPagesTemplateListRequest holds the query parameters for List status page templates.

type StoreRulesetItem

type StoreRulesetItem struct {
	// Creation timestamp, Unix epoch seconds.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Account ID of the creator.
	CreatorAccountID uint64 `json:"creator_account_id" toon:"creator_account_id"`
	// Member ID of the creator.
	CreatorID uint64 `json:"creator_id" toon:"creator_id"`
	// Display name of the creator.
	CreatorName string `json:"creator_name" toon:"creator_name"`
	// Ruleset ID.
	ID uint64 `json:"id" toon:"id"`
	// Description or title of the ruleset.
	Note string `json:"note" toon:"note"`
	// Sharing scope. `0` = private (creator only), `1` = account-shared, `2` = public.
	OpenFlag int64 `json:"open_flag" toon:"open_flag"`
	// JSON string containing the alert rule definitions. Omitted in list responses.
	Payload string `json:"payload" toon:"payload"`
	// Datasource type identifier this ruleset applies to.
	TypeIdent string `json:"type_ident" toon:"type_ident"`
	// Last update timestamp, Unix epoch seconds.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}

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" toon:"type_ident"`
}

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" toon:"id"`
	// New description.
	Note string `json:"note" toon:"note"`
	// New sharing scope. `0` = private, `1` = account-shared, `2` = public.
	OpenFlag int64 `json:"open_flag,omitempty" toon:"open_flag,omitempty"`
	// New JSON string of alert rule definitions.
	Payload string `json:"payload" toon:"payload"`
}

StoreRulesetUpdateRequest is generated from the Flashduty OpenAPI schema.

type StoreRulesetUpsertRequest

type StoreRulesetUpsertRequest struct {
	// Description or title of the ruleset.
	Note string `json:"note" toon:"note"`
	// Sharing scope. `0` = private (creator only), `1` = account-shared, `2` = public. Defaults to `0` if omitted.
	OpenFlag int64 `json:"open_flag,omitempty" toon:"open_flag,omitempty"`
	// JSON string containing the alert rule definitions.
	Payload string `json:"payload" toon:"payload"`
	// Datasource type identifier this ruleset applies to, e.g. `prometheus`.
	TypeIdent string `json:"type_ident" toon:"type_ident"`
}

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" toon:"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" toon:"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" toon:"keyword,omitempty"`
	// Page size. Default 50, max 200.
	Limit int64 `json:"limit,omitempty" toon:"limit,omitempty"`
}

TargetsListRequest is generated from the Flashduty OpenAPI schema.

type TargetsListResponse

type TargetsListResponse struct {
	Items []TargetsListResponseItemsItem `json:"items" toon:"items"`
	// Opaque cursor for the next page. Absent / empty means this is the last page.
	NextCursor *string `json:"next_cursor,omitempty" toon:"next_cursor,omitempty"`
	// Total matches for the current `(account_id, keyword)` pair, independent of `cursor`.
	Total int64 `json:"total" toon:"total"`
}

TargetsListResponse is generated from the Flashduty OpenAPI schema.

type TargetsListResponseItemsItem

type TargetsListResponseItemsItem struct {
	// Most recently observed Agent version.
	AgentVersion string `json:"agent_version" toon:"agent_version"`
	// Edge cluster name.
	ClusterName string `json:"cluster_name" toon:"cluster_name"`
	// Edge instance address (`ip:port`), surfaced for diagnostics.
	EdgeIpport string `json:"edge_ipport" toon:"edge_ipport"`
	// Target kind, e.g. `host`, `mysql`. Filtering by kind is not supported in v1.
	TargetKind string `json:"target_kind" toon:"target_kind"`
	// Target identifier; the list is sorted by this field ascending.
	TargetLocator string `json:"target_locator" toon:"target_locator"`
	// Last route-projection upsert time, Unix seconds. Treat as 'most recently observed', not a live-online indicator.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
}

TargetsListResponseItemsItem is generated from the Flashduty OpenAPI schema.

type TeamBriefItem

type TeamBriefItem struct {
	PersonIDs []uint64 `json:"person_ids" toon:"person_ids"`
	TeamID    uint64   `json:"team_id" toon:"team_id"`
	TeamName  string   `json:"team_name" toon:"team_name"`
}

TeamBriefItem is generated from the Flashduty OpenAPI schema.

type TeamDeleteRequest

type TeamDeleteRequest struct {
	// External reference ID.
	RefID string `json:"ref_id,omitempty" toon:"ref_id,omitempty"`
	// Team ID.
	TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Team name.
	TeamName string `json:"team_name,omitempty" toon:"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" toon:"ref_id,omitempty"`
	// Team ID.
	TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Team name.
	TeamName string `json:"team_name,omitempty" toon:"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" toon:"team_ids"`
}

TeamInfosRequest is generated from the Flashduty OpenAPI schema.

type TeamInfosResponse

type TeamInfosResponse struct {
	Items []TeamBriefItem `json:"items" toon:"items"`
}

TeamInfosResponse is generated from the Flashduty OpenAPI schema.

type TeamItem

type TeamItem struct {
	// Owning account ID.
	AccountID uint64 `json:"account_id" toon:"account_id"`
	// Unix epoch seconds the team was created.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Member ID of the creator.
	CreatorID uint64 `json:"creator_id" toon:"creator_id"`
	// Display name of the creator.
	CreatorName string `json:"creator_name" toon:"creator_name"`
	// Free-form description.
	Description string `json:"description" toon:"description"`
	// Member IDs of team members.
	PersonIDs []uint64 `json:"person_ids" toon:"person_ids"`
	// External reference ID for third-party HR system integration.
	RefID string `json:"ref_id" toon:"ref_id"`
	// Team status.
	Status string `json:"status" toon:"status"`
	// Unique team ID.
	TeamID uint64 `json:"team_id" toon:"team_id"`
	// Team display name. 1–39 characters, unique per account.
	TeamName string `json:"team_name" toon:"team_name"`
	// Unix epoch seconds the team was last updated.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
	// Member ID of the last editor.
	UpdatedBy uint64 `json:"updated_by" toon:"updated_by"`
	// Display name of the last editor.
	UpdatedByName string `json:"updated_by_name" toon:"updated_by_name"`
}

TeamItem is generated from the Flashduty OpenAPI schema.

type TeamListRequest

type TeamListRequest struct {
	ListOptions
	// Ascending sort order.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Filter by member ID — return only teams this person belongs to.
	PersonID uint64 `json:"person_id,omitempty" toon:"person_id,omitempty"`
	// Substring match on team name.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
}

TeamListRequest is generated from the Flashduty OpenAPI schema.

type TeamListResponse

type TeamListResponse struct {
	ListOptions
	Items []TeamItem `json:"items" toon:"items"`
	// Total number of teams matching the filter.
	Total int64 `json:"total" toon:"total"`
}

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" toon:"countryCode,omitempty"`
	// Free-form description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Email addresses to invite as members.
	Emails []string `json:"emails,omitempty" toon:"emails,omitempty"`
	// Member IDs to set as team members. Replaces the existing member list.
	PersonIDs []uint64 `json:"person_ids,omitempty" toon:"person_ids,omitempty"`
	// Phone numbers to invite as members.
	Phones []string `json:"phones,omitempty" toon:"phones,omitempty"`
	// External reference ID for HR system integration.
	RefID string `json:"ref_id,omitempty" toon:"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" toon:"reset_if_name_exist,omitempty"`
	// Team ID. Omit or set to 0 to create a new team.
	TeamID uint64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Team display name. 1–39 characters.
	TeamName string `json:"team_name" toon:"team_name"`
}

TeamUpsertRequest is generated from the Flashduty OpenAPI schema.

type TeamUpsertResponse

type TeamUpsertResponse struct {
	// Created or updated team ID.
	TeamID uint64 `json:"team_id" toon:"team_id"`
	// Team name echoed from the request.
	TeamName string `json:"team_name" toon:"team_name"`
}

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" toon:"description,omitempty"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk,omitempty" toon:"dingtalk,omitempty"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app,omitempty" toon:"dingtalk_app,omitempty"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email,omitempty" toon:"email,omitempty"`
	// Feishu robot message template source.
	Feishu string `json:"feishu,omitempty" toon:"feishu,omitempty"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app,omitempty" toon:"feishu_app,omitempty"`
	// Render alert labels as a table in Feishu app cards.
	FeishuAppCardTableEnabled bool                     `json:"feishu_app_card_table_enabled,omitempty" toon:"feishu_app_card_table_enabled,omitempty"`
	IncidentCardHiddenFields  IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
	// Slack robot message template source.
	Slack string `json:"slack,omitempty" toon:"slack,omitempty"`
	// Slack app message template source.
	SlackApp string `json:"slack_app,omitempty" toon:"slack_app,omitempty"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms,omitempty" toon:"sms,omitempty"`
	// Team scope. 0 for account-wide.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app,omitempty" toon:"teams_app,omitempty"`
	// Telegram bot message template source.
	Telegram string `json:"telegram,omitempty" toon:"telegram,omitempty"`
	// Template name, unique per account. 1–39 characters.
	TemplateName string `json:"template_name" toon:"template_name"`
	// Voice call script template source.
	Voice string `json:"voice,omitempty" toon:"voice,omitempty"`
	// WeCom robot message template source.
	Wecom string `json:"wecom,omitempty" toon:"wecom,omitempty"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app,omitempty" toon:"wecom_app,omitempty"`
	// Zoom bot message template source.
	Zoom string `json:"zoom,omitempty" toon:"zoom,omitempty"`
}

TemplateCreateRequest is generated from the Flashduty OpenAPI schema.

type TemplateCreateResponse

type TemplateCreateResponse struct {
	// Newly created template ID.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Template name echoed from the request.
	TemplateName string `json:"template_name" toon:"template_name"`
}

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" toon:"template_id"`
}

TemplateIDRequest is generated from the Flashduty OpenAPI schema.

type TemplateItem

type TemplateItem struct {
	// ID of the owning account.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Unix epoch seconds the template was created.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Member ID of the creator.
	CreatorID int64 `json:"creator_id" toon:"creator_id"`
	// Unix epoch seconds the template was soft-deleted. Absent (omitempty) when the template is live.
	DeletedAt Timestamp `json:"deleted_at" toon:"deleted_at"`
	// Free-form description.
	Description string `json:"description" toon:"description"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk" toon:"dingtalk"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app" toon:"dingtalk_app"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email" toon:"email"`
	// Feishu robot message template source.
	Feishu string `json:"feishu" toon:"feishu"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app" toon:"feishu_app"`
	// Whether alert labels use table rendering in Feishu app cards.
	FeishuAppCardTableEnabled bool                     `json:"feishu_app_card_table_enabled" toon:"feishu_app_card_table_enabled"`
	IncidentCardHiddenFields  IncidentCardHiddenFields `json:"incident_card_hidden_fields" toon:"incident_card_hidden_fields"`
	// Slack robot message template source.
	Slack string `json:"slack" toon:"slack"`
	// Slack app message template source.
	SlackApp string `json:"slack_app" toon:"slack_app"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms" toon:"sms"`
	// Template lifecycle status.
	Status string `json:"status" toon:"status"`
	// ID of the team this template is scoped to, or 0 for account-wide.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app" toon:"teams_app"`
	// Telegram bot message template source.
	Telegram string `json:"telegram" toon:"telegram"`
	// Template ID.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Unique template name within the account.
	TemplateName string `json:"template_name" toon:"template_name"`
	// Unix epoch seconds the template was last updated.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
	// Member ID of the last editor.
	UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
	// Voice call script template source.
	Voice string `json:"voice" toon:"voice"`
	// WeCom robot message template source.
	Wecom string `json:"wecom" toon:"wecom"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app" toon:"wecom_app"`
	// Zoom bot message template source.
	Zoom string `json:"zoom" toon:"zoom"`
}

TemplateItem is generated from the Flashduty OpenAPI schema.

type TemplateListRequest

type TemplateListRequest struct {
	ListOptions
	// Ascending sort order.
	Asc bool `json:"asc,omitempty" toon:"asc,omitempty"`
	// Filter by creator member ID.
	CreatorID *int64 `json:"creator_id,omitempty" toon:"creator_id,omitempty"`
	// When true, only return templates scoped to teams the caller belongs to.
	IsMyTeam bool `json:"is_my_team,omitempty" toon:"is_my_team,omitempty"`
	// Sort field.
	Orderby string `json:"orderby,omitempty" toon:"orderby,omitempty"`
	// Regex or substring match on template_name.
	Query string `json:"query,omitempty" toon:"query,omitempty"`
	// Filter by specific team IDs.
	TeamIDs []int64 `json:"team_ids,omitempty" toon:"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" toon:"has_next_page"`
	Items       []TemplateItem `json:"items" toon:"items"`
	// Total number of templates matching the filter, across all pages.
	Total int64 `json:"total" toon:"total"`
}

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" toon:"description,omitempty"`
	// DingTalk robot message template source.
	Dingtalk string `json:"dingtalk,omitempty" toon:"dingtalk,omitempty"`
	// DingTalk app message template source.
	DingtalkApp string `json:"dingtalk_app,omitempty" toon:"dingtalk_app,omitempty"`
	// Email body template source (Go `html/template` syntax).
	Email string `json:"email,omitempty" toon:"email,omitempty"`
	// Feishu robot message template source.
	Feishu string `json:"feishu,omitempty" toon:"feishu,omitempty"`
	// Feishu app message template source.
	FeishuApp string `json:"feishu_app,omitempty" toon:"feishu_app,omitempty"`
	// When set, enable or disable table rendering for alert labels in Feishu app cards. Omit to keep the existing setting.
	FeishuAppCardTableEnabled *bool                    `json:"feishu_app_card_table_enabled,omitempty" toon:"feishu_app_card_table_enabled,omitempty"`
	IncidentCardHiddenFields  IncidentCardHiddenFields `json:"incident_card_hidden_fields,omitempty" toon:"incident_card_hidden_fields,omitempty"`
	// Slack robot message template source.
	Slack string `json:"slack,omitempty" toon:"slack,omitempty"`
	// Slack app message template source.
	SlackApp string `json:"slack_app,omitempty" toon:"slack_app,omitempty"`
	// SMS template source (Go `text/template` syntax).
	SMS string `json:"sms,omitempty" toon:"sms,omitempty"`
	// Team scope. 0 for account-wide.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Microsoft Teams app message template source.
	TeamsApp string `json:"teams_app,omitempty" toon:"teams_app,omitempty"`
	// Telegram bot message template source.
	Telegram string `json:"telegram,omitempty" toon:"telegram,omitempty"`
	// Target template ID.
	TemplateID string `json:"template_id" toon:"template_id"`
	// Template name. 1–39 characters.
	TemplateName string `json:"template_name" toon:"template_name"`
	// Voice call script template source.
	Voice string `json:"voice,omitempty" toon:"voice,omitempty"`
	// WeCom robot message template source.
	Wecom string `json:"wecom,omitempty" toon:"wecom,omitempty"`
	// WeCom app message template source.
	WecomApp string `json:"wecom_app,omitempty" toon:"wecom_app,omitempty"`
	// Zoom bot message template source.
	Zoom string `json:"zoom,omitempty" toon:"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" toon:"cal_id,omitempty"`
	// End of the window in `HH:MM`.
	End string `json:"end,omitempty" toon:"end,omitempty"`
	// When true, match days marked as days-off in the calendar.
	IsOff bool `json:"is_off,omitempty" toon:"is_off,omitempty"`
	// Days of the week this window repeats on. Empty means every day.
	Repeat []int64 `json:"repeat,omitempty" toon:"repeat,omitempty"`
	// Start of the window in `HH:MM`.
	Start string `json:"start,omitempty" toon:"start,omitempty"`
}

TimeFilter is generated from the Flashduty OpenAPI schema.

type Timestamp added in v0.3.0

type Timestamp int64

Timestamp is a Unix-seconds instant as it appears on the Flashduty API wire.

It marshals to an RFC3339 string in the local timezone, so structured output is human- and LLM-readable instead of an opaque integer. It unmarshals from either a numeric epoch (the wire form) or an RFC3339 string (so a marshaled value round-trips). The zero value marshals to 0 — an unset sentinel, never a 1970 date — and is dropped by `json:",omitempty"`.

Use Timestamp only for absolute instants. Durations, cyclic-window offsets, and counts stay int64.

func (Timestamp) IsZero added in v0.3.0

func (t Timestamp) IsZero() bool

IsZero reports whether the value is the unset sentinel (0).

func (Timestamp) MarshalJSON added in v0.3.0

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON renders a non-zero value as a quoted RFC3339 string in the local timezone; zero renders as the bare integer 0.

func (Timestamp) String added in v0.3.0

func (t Timestamp) String() string

String renders the instant as RFC3339 in the local timezone, or "0" when unset. Non-JSON encoders (TOON, fmt) render the value through this method.

func (Timestamp) Time added in v0.3.0

func (t Timestamp) Time() time.Time

Time returns the instant as a time.Time.

func (Timestamp) Unix added in v0.3.0

func (t Timestamp) Unix() int64

Unix returns the raw wire value (Unix seconds).

func (*Timestamp) UnmarshalJSON added in v0.3.0

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON accepts a numeric Unix-seconds epoch, a quoted integer, an RFC3339 string, or null (→ 0).

type TimestampMilli added in v0.3.0

type TimestampMilli int64

TimestampMilli is a Unix-milliseconds instant. It has the same rendering contract as Timestamp (RFC3339 out, epoch-or-RFC3339 in, zero→0); only the wire unit differs.

func (TimestampMilli) IsZero added in v0.3.0

func (t TimestampMilli) IsZero() bool

IsZero reports whether the value is the unset sentinel (0).

func (TimestampMilli) MarshalJSON added in v0.3.0

func (t TimestampMilli) MarshalJSON() ([]byte, error)

MarshalJSON renders a non-zero value as a quoted RFC3339 string in the local timezone; zero renders as the bare integer 0. RFC3339Nano is used so that sub-second (millisecond) precision survives a marshal→unmarshal round-trip; it elides trailing zeros, so whole-second values render identically to a plain RFC3339 timestamp.

func (TimestampMilli) String added in v0.3.0

func (t TimestampMilli) String() string

String renders the instant as RFC3339Nano in the local timezone (preserving sub-second precision), or "0" when unset. Non-JSON encoders (TOON, fmt) render the value through this method.

func (TimestampMilli) Time added in v0.3.0

func (t TimestampMilli) Time() time.Time

Time returns the instant as a time.Time.

func (TimestampMilli) Unix added in v0.3.0

func (t TimestampMilli) Unix() int64

Unix returns the raw wire value (milliseconds since the Unix epoch).

func (*TimestampMilli) UnmarshalJSON added in v0.3.0

func (t *TimestampMilli) UnmarshalJSON(b []byte) error

UnmarshalJSON accepts a numeric Unix-milliseconds epoch, a quoted integer, an RFC3339 string, or null (→ 0).

type ToolCatalogRequest

type ToolCatalogRequest struct {
	// Optional consistency check. Must equal the authenticated account when supplied.
	AccountID int64 `json:"account_id,omitempty" toon:"account_id,omitempty"`
	// Optional target kind. When omitted, webapi infers it from current target routing. If the call returns `ambiguous_target_kind`, retry with a value from `target_kinds`.
	TargetKind string `json:"target_kind,omitempty" toon:"target_kind,omitempty"`
	// Target identifier (host name, MySQL address, …). Max 256 bytes; no whitespace, control characters, or `|`.
	TargetLocator string `json:"target_locator" toon:"target_locator"`
}

ToolCatalogRequest is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponse

type ToolCatalogResponse struct {
	// Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.
	Error *ToolCatalogResponseError `json:"error,omitempty" toon:"error,omitempty"`
	// Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.
	Target *ToolCatalogResponseTarget `json:"target,omitempty" toon:"target,omitempty"`
	// Tool metadata advertised by the target's agent. Always present; an empty array when `error` is set.
	Tools []ToolCatalogResponseToolsItem `json:"tools" toon:"tools"`
}

ToolCatalogResponse is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponseError

type ToolCatalogResponseError struct {
	Code    string `json:"code" toon:"code"`
	Message string `json:"message" toon:"message"`
	// Returned for `ambiguous_target_kind`; lists the candidate kinds.
	TargetKinds *[]string `json:"target_kinds,omitempty" toon:"target_kinds,omitempty"`
}

ToolCatalogResponseError is generated from the Flashduty OpenAPI schema.

type ToolCatalogResponseTarget

type ToolCatalogResponseTarget struct {
	Kind    string `json:"kind" toon:"kind"`
	Locator string `json:"locator" toon:"locator"`
}

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" toon:"description"`
	// JSON Schema for `tools[].params`.
	InputSchema map[string]any `json:"input_schema" toon:"input_schema"`
	// Tool name; pass into `/monit/tools/invoke` as `tools[].tool`.
	Name string `json:"name" toon:"name"`
	// Target kind this tool applies to.
	TargetKind string `json:"target_kind" toon:"target_kind"`
}

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" toon:"account_id,omitempty"`
	// Optional target kind; auto-inferred when omitted.
	TargetKind string `json:"target_kind,omitempty" toon:"target_kind,omitempty"`
	// Target identifier. Same validation rules as `/monit/tools/catalog`.
	TargetLocator string `json:"target_locator" toon:"target_locator"`
	// Up to 8 tool calls; webapi executes them concurrently and returns results in input order.
	Tools []ToolInvokeRequestToolsItem `json:"tools" toon:"tools"`
}

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" toon:"params,omitempty"`
	// Tool name, typically from `/monit/tools/catalog`.
	Tool string `json:"tool" toon:"tool"`
}

ToolInvokeRequestToolsItem is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponse

type ToolInvokeResponse struct {
	// Request-level business error. Omitted on success. Returned with HTTP 200 — do not rely on the status code alone.
	Error *ToolInvokeResponseError `json:"error,omitempty" toon:"error,omitempty"`
	// Per-tool results, aligned with the request `tools[]` order. Empty when a request-level `error` is present.
	Results []ToolInvokeResponseResultsItem `json:"results" toon:"results"`
	// Resolved target. Omitted when `target_kind` was not supplied and the locator could not be uniquely inferred.
	Target *ToolInvokeResponseTarget `json:"target,omitempty" toon:"target,omitempty"`
}

ToolInvokeResponse is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseError

type ToolInvokeResponseError struct {
	Code        string    `json:"code" toon:"code"`
	Message     string    `json:"message" toon:"message"`
	TargetKinds *[]string `json:"target_kinds,omitempty" toon:"target_kinds,omitempty"`
}

ToolInvokeResponseError is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseResultsItem

type ToolInvokeResponseResultsItem struct {
	// Tool business payload. Present only on success. Webapi already unwraps the monit-agent result envelope, so there is no nested `data.data`.
	Data *map[string]any `json:"data,omitempty" toon:"data,omitempty"`
	// Per-tool failure. Present only on failure, and mutually exclusive with `data` / `summary` / `truncated`.
	Error *ToolInvokeResponseResultsItemError `json:"error,omitempty" toon:"error,omitempty"`
	// Request params echoed back by webapi. Normalized to `{}` when the request omitted them or sent null.
	Params map[string]any `json:"params" toon:"params"`
	// Human/LLM-readable one-line distillation of the result. Present only when non-empty.
	Summary *string `json:"summary,omitempty" toon:"summary,omitempty"`
	// Tool name, aligned one-to-one with the request `tools[]` order.
	Tool string `json:"tool" toon:"tool"`
	// Agent-executed tool version. Omitted when the failure occurred before the agent picked a version.
	ToolVersion *string `json:"tool_version,omitempty" toon:"tool_version,omitempty"`
	// Present only when the result was actually truncated — the field's presence is the signal, so there is no redundant `truncated: true`.
	Truncated *ToolInvokeResponseResultsItemTruncated `json:"truncated,omitempty" toon:"truncated,omitempty"`
}

ToolInvokeResponseResultsItem is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseResultsItemError

type ToolInvokeResponseResultsItemError struct {
	// Common WebAPI codes: `timeout`, `target_unavailable`, `invalid_tool_result`, `internal`, `invalid_args`, `unsupported_syntax`, `path_not_found`, and `catalog_changed`. Agent-specific tool errors may also be returned unchanged.
	Code    string `json:"code" toon:"code"`
	Message string `json:"message" toon:"message"`
}

ToolInvokeResponseResultsItemError is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseResultsItemTruncated added in v0.5.7

type ToolInvokeResponseResultsItemTruncated struct {
	// Why the result was truncated.
	Reason string `json:"reason" toon:"reason"`
}

ToolInvokeResponseResultsItemTruncated is generated from the Flashduty OpenAPI schema.

type ToolInvokeResponseTarget

type ToolInvokeResponseTarget struct {
	Kind    string `json:"kind" toon:"kind"`
	Locator string `json:"locator" toon:"locator"`
}

ToolInvokeResponseTarget is generated from the Flashduty OpenAPI schema.

type TryLinkPersonRequest added in v0.5.4

type TryLinkPersonRequest struct {
	// IM integration ID.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
}

TryLinkPersonRequest is generated from the Flashduty OpenAPI schema.

type TryLinkPersonResponse added in v0.5.4

type TryLinkPersonResponse struct {
	// Person IDs newly linked during this call.
	NewLinkedPersonIDs []int64 `json:"new_linked_person_ids" toon:"new_linked_person_ids"`
}

TryLinkPersonResponse 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" toon:"incident_ids"`
}

UnackIncidentRequest is generated from the Flashduty OpenAPI schema.

type UnsubscribeRuleItem

type UnsubscribeRuleItem struct {
	AccountID   int64       `json:"account_id" toon:"account_id"`
	ChannelID   int64       `json:"channel_id" toon:"channel_id"`
	CreatedAt   int64       `json:"created_at" toon:"created_at"`
	DeletedAt   int64       `json:"deleted_at" toon:"deleted_at"`
	Description string      `json:"description" toon:"description"`
	Filters     FilterGroup `json:"filters" toon:"filters"`
	Priority    int64       `json:"priority" toon:"priority"`
	RuleID      string      `json:"rule_id" toon:"rule_id"`
	RuleName    string      `json:"rule_name" toon:"rule_name"`
	Status      string      `json:"status" toon:"status"`
	UpdatedAt   int64       `json:"updated_at" toon:"updated_at"`
	UpdatedBy   int64       `json:"updated_by" toon:"updated_by"`
}

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" toon:"auto_resolve_mode,omitempty"`
	// Auto-resolve timeout in seconds. 0 disables auto-resolve. Max 30 days.
	AutoResolveTimeout *int64 `json:"auto_resolve_timeout,omitempty" toon:"auto_resolve_timeout,omitempty"`
	// Channel ID to update.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// New channel name. 1 to 59 characters.
	ChannelName *string `json:"channel_name,omitempty" toon:"channel_name,omitempty"`
	// New description. Up to 500 characters.
	Description *string `json:"description,omitempty" toon:"description,omitempty"`
	// Disable automatic incident closing.
	DisableAutoClose *bool `json:"disable_auto_close,omitempty" toon:"disable_auto_close,omitempty"`
	// Disable outlier incident detection.
	DisableOutlierDetection *bool    `json:"disable_outlier_detection,omitempty" toon:"disable_outlier_detection,omitempty"`
	Flapping                Flapping `json:"flapping,omitzero" toon:"flapping,omitempty"`
	Group                   Group    `json:"group,omitzero" toon:"group,omitempty"`
	// Allow external reporters to file incidents into this channel.
	IsExternalReportEnabled *bool `json:"is_external_report_enabled,omitempty" toon:"is_external_report_enabled,omitempty"`
	// When true, the channel is visible only to its managing teams.
	IsPrivate *bool `json:"is_private,omitempty" toon:"is_private,omitempty"`
	// Additional teams that can manage the channel. Up to 3 entries.
	ManagingTeamIDs []int64 `json:"managing_team_ids,omitempty" toon:"managing_team_ids,omitempty"`
	// New owning team ID.
	TeamID *int64 `json:"team_id,omitempty" toon:"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" toon:"external_report_token"`
}

UpdateChannelResponse is generated from the Flashduty OpenAPI schema.

type UpdateDropRuleRequest

type UpdateDropRuleRequest struct {
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty" toon:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Drop rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
}

UpdateDropRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateEscalationRuleRequest

type UpdateEscalationRuleRequest struct {
	// Delay window in seconds. 0 disables delay.
	AggrWindow int64 `json:"aggr_window,omitempty" toon:"aggr_window,omitempty"`
	// Channel the rule belongs to.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty" toon:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty" toon:"filters,omitempty"`
	// Escalation levels in order. At least one level is required.
	Layers []EscalateLayer `json:"layers" toon:"layers"`
	// Evaluation priority. Lower runs first.
	Priority *int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Escalation rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Rule name, 1 to 39 characters.
	RuleName string `json:"rule_name" toon:"rule_name"`
	// Notification template ID (MongoDB ObjectID).
	TemplateID string `json:"template_id" toon:"template_id"`
	// Optional recurring time windows during which the rule applies.
	TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"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" toon:"default_value,omitempty"`
	// New description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// New display name. Must remain unique within the account.
	DisplayName string `json:"display_name,omitempty" toon:"display_name,omitempty"`
	// Field ID — 24-character hex ObjectID.
	FieldID string `json:"field_id" toon:"field_id"`
	// Replacement options list. Must obey the same per-type rules as create.
	Options []string `json:"options,omitempty" toon:"options,omitempty"`
}

UpdateFieldRequest is generated from the Flashduty OpenAPI schema.

type UpdateIncidentFieldsRequest

type UpdateIncidentFieldsRequest struct {
	// New description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// New impact description.
	Impact string `json:"impact,omitempty" toon:"impact,omitempty"`
	// Incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// New severity.
	IncidentSeverity string `json:"incident_severity,omitempty" toon:"incident_severity,omitempty"`
	// New resolution notes.
	Resolution string `json:"resolution,omitempty" toon:"resolution,omitempty"`
	// New root cause analysis.
	RootCause string `json:"root_cause,omitempty" toon:"root_cause,omitempty"`
	// New incident title.
	Title string `json:"title,omitempty" toon:"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" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Label keys used to pair source and target alerts.
	Equals []string `json:"equals" toon:"equals"`
	// When true, suppressed target alerts are dropped instead of merged.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Inhibit rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Rule name, 1 to 39 characters.
	RuleName      string      `json:"rule_name" toon:"rule_name"`
	SourceFilters FilterGroup `json:"source_filters,omitempty" toon:"source_filters,omitempty"`
	TargetFilters FilterGroup `json:"target_filters,omitempty" toon:"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" toon:"channel_id"`
	// Rule description, up to 500 characters.
	Description string      `json:"description,omitempty" toon:"description,omitempty"`
	Filters     FilterGroup `json:"filters,omitempty" toon:"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" toon:"is_auto_delete,omitempty"`
	// When true, silenced alerts are dropped instead of suppressed into incidents.
	IsDirectlyDiscard bool `json:"is_directly_discard,omitempty" toon:"is_directly_discard,omitempty"`
	// Evaluation priority. Lower runs first.
	Priority int64 `json:"priority,omitempty" toon:"priority,omitempty"`
	// Silence rule ID (MongoDB ObjectID).
	RuleID string `json:"rule_id" toon:"rule_id"`
	// Rule name, 1 to 39 characters.
	RuleName   string         `json:"rule_name" toon:"rule_name"`
	TimeFilter OnceTimeFilter `json:"time_filter,omitzero" toon:"time_filter,omitempty"`
	// Recurring time windows. Mutually exclusive with `time_filter`.
	TimeFilters []TimeFilter `json:"time_filters,omitempty" toon:"time_filters,omitempty"`
}

UpdateSilenceRuleRequest is generated from the Flashduty OpenAPI schema.

type UpdateStatusPageChangeRequest

type UpdateStatusPageChangeRequest struct {
	// Target event ID.
	ChangeID int64 `json:"change_id" toon:"change_id"`
	// Linked event IDs. Pass the full replacement list.
	LinkedChanges []string `json:"linked_changes,omitempty" toon:"linked_changes,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Member IDs responsible for this event. Pass the full replacement list.
	Responders []int64 `json:"responders,omitempty" toon:"responders,omitempty"`
	// New event title, up to 255 characters. Omit to keep the existing value.
	Title *string `json:"title,omitempty" toon:"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" toon:"at_seconds,omitempty"`
	// Parent event ID.
	ChangeID int64 `json:"change_id" toon:"change_id"`
	// New update description (Markdown).
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Target timeline update ID.
	UpdateID string `json:"update_id" toon:"update_id"`
}

UpdateStatusPageChangeTimelineRequest is generated from the Flashduty OpenAPI schema.

type UpdateStatusPageRequest added in v0.6.0

type UpdateStatusPageRequest struct {
	// Get-in-touch contact, such as a mailto or website URL. Omit to keep the existing value.
	ContactInfo string `json:"contact_info,omitempty" toon:"contact_info,omitempty"`
	// Custom domain for a public status page. Omit to keep the existing value.
	CustomDomain string `json:"custom_domain,omitempty" toon:"custom_domain,omitempty"`
	// Custom navigation links shown on the status page. Omit to keep the existing value.
	CustomLinks []map[string]string `json:"custom_links,omitempty" toon:"custom_links,omitempty"`
	DarkLogo string `json:"dark_logo,omitempty" toon:"dark_logo,omitempty"`
	// How event dates are displayed. Omit to keep the existing value.
	DateView string `json:"date_view,omitempty" toon:"date_view,omitempty"`
	// How uptime is displayed. Omit to keep the existing value.
	DisplayUptimeMode string `json:"display_uptime_mode,omitempty" toon:"display_uptime_mode,omitempty"`
	// Favicon of the status page. Omit to keep the existing value.
	Favicon string `json:"favicon,omitempty" toon:"favicon,omitempty"`
	Logo string `json:"logo,omitempty" toon:"logo,omitempty"`
	// URL opened when the logo is clicked. Omit to keep the existing value.
	LogoURL string `json:"logo_url,omitempty" toon:"logo_url,omitempty"`
	// Display name of the status page. Omit to keep the existing value.
	Name string `json:"name,omitempty" toon:"name,omitempty"`
	// Footer content shown on the status page. Omit to keep the existing value.
	PageFooter string `json:"page_footer,omitempty" toon:"page_footer,omitempty"`
	// Header content shown on the status page. Omit to keep the existing value.
	PageHeader string `json:"page_header,omitempty" toon:"page_header,omitempty"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Browser title shown for the status page. Omit to keep the existing value.
	PageTitle    string                     `json:"page_title,omitempty" toon:"page_title,omitempty"`
	Subscription StatusPageSubscriptionItem `json:"subscription,omitzero" toon:"subscription,omitempty"`
	// Preferred change-event template type. Omit to keep the existing value.
	TemplatePreference string `json:"template_preference,omitempty" toon:"template_preference,omitempty"`
	// URL-safe slug, unique per account and page type. Omit to keep the existing value.
	URLName string `json:"url_name,omitempty" toon:"url_name,omitempty"`
}

UpdateStatusPageRequest is generated from the Flashduty OpenAPI schema.

type UpsertPostMortemTemplateRequest added in v0.5.4

type UpsertPostMortemTemplateRequest struct {
	// BlockNote JSON template content.
	Content string `json:"content" toon:"content"`
	// Markdown version of the template content.
	ContentMarkdown string `json:"content_markdown,omitempty" toon:"content_markdown,omitempty"`
	// Template description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Template name.
	Name string `json:"name" toon:"name"`
	// Managing team ID. Required when creating a custom template.
	TeamID int64 `json:"team_id,omitempty" toon:"team_id,omitempty"`
	// Template ID. Omit to create a new template; provide it to update an existing template.
	TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
}

UpsertPostMortemTemplateRequest 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" toon:"cases,omitempty"`
	Default RouteDefault `json:"default,omitzero" toon:"default,omitempty"`
	// Integration the rule belongs to.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Optional sections that group consecutive cases for display.
	Sections []RouteSection `json:"sections,omitempty" toon:"sections,omitempty"`
	// Expected current version for optimistic concurrency control. Pass the value returned by the latest read.
	Version int64 `json:"version,omitempty" toon:"version,omitempty"`
}

UpsertRouteRequest is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageComponentRequest added in v0.5.4

type UpsertStatusPageComponentRequest struct {
	// Components to create or update.
	Components []UpsertStatusPageComponentRequestComponentsItem `json:"components" toon:"components"`
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
}

UpsertStatusPageComponentRequest is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageComponentRequestComponentsItem added in v0.5.4

type UpsertStatusPageComponentRequestComponentsItem struct {
	// Component ID. Omit to create a new component; supply to update an existing one.
	ComponentID string `json:"component_id,omitempty" toon:"component_id,omitempty"`
	// Component description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// When true, the component is hidden entirely from summary endpoints.
	HideAll bool `json:"hide_all,omitempty" toon:"hide_all,omitempty"`
	// When true, uptime data is hidden from summary responses.
	HideUptime bool `json:"hide_uptime,omitempty" toon:"hide_uptime,omitempty"`
	// Component display name.
	Name string `json:"name" toon:"name"`
	// Display order within its section.
	OrderID int64 `json:"order_id,omitempty" toon:"order_id,omitempty"`
	// Parent section ID. Omit to place the component at the top level.
	SectionID string `json:"section_id,omitempty" toon:"section_id,omitempty"`
}

UpsertStatusPageComponentRequestComponentsItem is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageComponentResponse added in v0.5.4

type UpsertStatusPageComponentResponse struct {
	// IDs of the created or updated components, in the same order as the request.
	ComponentIDs []string `json:"component_ids" toon:"component_ids"`
}

UpsertStatusPageComponentResponse is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageSectionRequest added in v0.5.4

type UpsertStatusPageSectionRequest struct {
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Sections to create or update.
	Sections []UpsertStatusPageSectionRequestSectionsItem `json:"sections" toon:"sections"`
}

UpsertStatusPageSectionRequest is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageSectionRequestSectionsItem added in v0.5.4

type UpsertStatusPageSectionRequestSectionsItem struct {
	// Section description.
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// When true, the entire section is hidden from summary endpoints.
	HideAll bool `json:"hide_all,omitempty" toon:"hide_all,omitempty"`
	// When true, uptime data for all components in this section is hidden.
	HideUptime bool `json:"hide_uptime,omitempty" toon:"hide_uptime,omitempty"`
	// Section display name.
	Name string `json:"name" toon:"name"`
	// Display order.
	OrderID int64 `json:"order_id,omitempty" toon:"order_id,omitempty"`
	// Section ID. Omit to create a new section; supply to update an existing one.
	SectionID string `json:"section_id,omitempty" toon:"section_id,omitempty"`
}

UpsertStatusPageSectionRequestSectionsItem is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageSectionResponse added in v0.5.4

type UpsertStatusPageSectionResponse struct {
	// IDs of the created or updated sections, in the same order as the request.
	SectionIDs []string `json:"section_ids" toon:"section_ids"`
}

UpsertStatusPageSectionResponse is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageTemplateRequest added in v0.5.4

type UpsertStatusPageTemplateRequest struct {
	// Status page ID.
	PageID int64 `json:"page_id" toon:"page_id"`
	// Template content.
	Template UpsertStatusPageTemplateRequestTemplate `json:"template" toon:"template"`
	// Template category. `pre_defined` for predefined event templates; `message` for notification message templates.
	Type string `json:"type" toon:"type"`
}

UpsertStatusPageTemplateRequest is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageTemplateRequestTemplate added in v0.5.4

type UpsertStatusPageTemplateRequestTemplate struct {
	// Template body text (Markdown).
	Description string `json:"description,omitempty" toon:"description,omitempty"`
	// Event type this template applies to.
	EventType string `json:"event_type" toon:"event_type"`
	// Event status this template represents.
	Status string `json:"status" toon:"status"`
	// Template ID. Omit to create; supply to update.
	TemplateID string `json:"template_id,omitempty" toon:"template_id,omitempty"`
	// Template title.
	Title string `json:"title" toon:"title"`
}

UpsertStatusPageTemplateRequestTemplate is generated from the Flashduty OpenAPI schema.

type UpsertStatusPageTemplateResponse added in v0.5.4

type UpsertStatusPageTemplateResponse struct {
	// ID of the created or updated template.
	TemplateID string `json:"template_id" toon:"template_id"`
}

UpsertStatusPageTemplateResponse 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" toon:"incident_ids"`
}

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" toon:"chat_id"`
	// Chat/group display name.
	ChatName string `json:"chat_name" toon:"chat_name"`
	// Join link for the war room, if provided by the IM.
	ShareLink string `json:"share_link" toon:"share_link"`
}

WarRoom is generated from the Flashduty OpenAPI schema.

type WarRoomDataSourceItem added in v0.4.0

type WarRoomDataSourceItem struct {
	// Account this integration belongs to.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Category of the integration plugin.
	Category string `json:"category" toon:"category"`
	// Unix timestamp in seconds when the integration was created.
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Person who created the integration.
	CreatorID int64 `json:"creator_id" toon:"creator_id"`
	// Integration ID.
	DataSourceID int64 `json:"data_source_id" toon:"data_source_id"`
	// Integration description.
	Description string `json:"description" toon:"description"`
	// Exclusive integration ID associated with this integration.
	ExclusiveDataSourceID int64 `json:"exclusive_data_source_id" toon:"exclusive_data_source_id"`
	// Integration ID, alias of data_source_id.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Push key used by alert sources to send to this integration.
	IntegrationKey string `json:"integration_key" toon:"integration_key"`
	// Unix timestamp in seconds of the most recent activity on the integration.
	LastTime Timestamp `json:"last_time" toon:"last_time"`
	// Integration name.
	Name string `json:"name" toon:"name"`
	// Whether the integration is read-only.
	NoEditable bool `json:"no_editable" toon:"no_editable"`
	// Plugin ID backing this integration.
	PluginID int64 `json:"plugin_id" toon:"plugin_id"`
	// Type identifier of the integration plugin.
	PluginType string `json:"plugin_type" toon:"plugin_type"`
	// Localized display name of the integration plugin type.
	PluginTypeName string `json:"plugin_type_name" toon:"plugin_type_name"`
	// External reference ID of the integration.
	RefID string `json:"ref_id" toon:"ref_id"`
	// Plugin-specific configuration of the integration.
	Settings map[string]any `json:"settings" toon:"settings"`
	// Current status of the integration.
	Status string `json:"status" toon:"status"`
	// Team that owns this integration.
	TeamID int64 `json:"team_id" toon:"team_id"`
	// Unix timestamp in seconds when the integration was last updated.
	UpdatedAt Timestamp `json:"updated_at" toon:"updated_at"`
	// Person who last updated the integration.
	UpdatedBy int64 `json:"updated_by" toon:"updated_by"`
}

WarRoomDataSourceItem is generated from the Flashduty OpenAPI schema.

type WarRoomItem

type WarRoomItem struct {
	// Account ID.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Chat/group ID on the IM side.
	ChatID string `json:"chat_id" toon:"chat_id"`
	// Creation timestamp (seconds).
	CreatedAt Timestamp `json:"created_at" toon:"created_at"`
	// Member ID that created the war room.
	CreatedBy int64 `json:"created_by" toon:"created_by"`
	// Associated incident ID (MongoDB ObjectID).
	IncidentID string `json:"incident_id" toon:"incident_id"`
	// IM integration ID.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// IM plugin type (e.g. `feishu`, `dingtalk`, `wecom`, `slack`).
	PluginType string `json:"plugin_type" toon:"plugin_type"`
	// War room status.
	Status string `json:"status" toon:"status"`
}

WarRoomItem is generated from the Flashduty OpenAPI schema.

type WarRoomPersonItem added in v0.4.0

type WarRoomPersonItem struct {
	// Account this person belongs to.
	AccountID int64 `json:"account_id" toon:"account_id"`
	// Role the person holds in the related context.
	As string `json:"as" toon:"as"`
	// URL of the person's avatar image.
	Avatar string `json:"avatar" toon:"avatar"`
	// Email address of the person.
	Email string `json:"email" toon:"email"`
	// Preferred language locale of the person.
	Locale string `json:"locale" toon:"locale"`
	// Person ID.
	PersonID int64 `json:"person_id" toon:"person_id"`
	// Display name of the person.
	PersonName string `json:"person_name" toon:"person_name"`
	// Phone number of the person.
	Phone string `json:"phone" toon:"phone"`
	// Current status of the person.
	Status string `json:"status" toon:"status"`
	// Time zone of the person.
	TimeZone string `json:"time_zone" toon:"time_zone"`
}

WarRoomPersonItem is generated from the Flashduty OpenAPI schema.

type WebhookHistoryDetail

type WebhookHistoryDetail struct {
	// Attempt sequence number.
	Attempt int64 `json:"attempt" toon:"attempt"`
	// Channel ID when applicable.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Name of the associated channel, resolved at query time.
	ChannelName string `json:"channel_name" toon:"channel_name"`
	// Total elapsed time of the attempt in milliseconds.
	Duration int64 `json:"duration" toon:"duration"`
	// Destination URL.
	Endpoint string `json:"endpoint" toon:"endpoint"`
	// Error message when delivery failed.
	ErrorMessage string `json:"error_message" toon:"error_message"`
	// Event ID.
	EventID string `json:"event_id" toon:"event_id"`
	// Event time as a formatted timestamp string.
	EventTime string `json:"event_time" toon:"event_time"`
	// Event type.
	EventType string `json:"event_type" toon:"event_type"`
	// Integration ID.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Source object ID.
	RefID string `json:"ref_id" toon:"ref_id"`
	// Title of the source incident or alert, resolved at query time.
	RefTitle string `json:"ref_title" toon:"ref_title"`
	// Outbound request body payload.
	RequestBody string `json:"request_body" toon:"request_body"`
	// Serialized outbound request headers.
	RequestHeaders string `json:"request_headers" toon:"request_headers"`
	// Response body.
	ResponseBody string `json:"response_body" toon:"response_body"`
	// Serialized response headers.
	ResponseHeaders string `json:"response_headers" toon:"response_headers"`
	// Delivery outcome.
	Status string `json:"status" toon:"status"`
	// HTTP status code.
	StatusCode int64 `json:"status_code" toon:"status_code"`
	// Source object kind. `incident` or `alert`.
	WebhookType string `json:"webhook_type" toon:"webhook_type"`
}

WebhookHistoryDetail is generated from the Flashduty OpenAPI schema.

type WebhookHistoryItem

type WebhookHistoryItem struct {
	// Attempt sequence number.
	Attempt int64 `json:"attempt" toon:"attempt"`
	// Channel ID associated with the event, when applicable.
	ChannelID int64 `json:"channel_id" toon:"channel_id"`
	// Total elapsed time of the attempt in milliseconds.
	Duration int64 `json:"duration" toon:"duration"`
	// Destination URL.
	Endpoint string `json:"endpoint" toon:"endpoint"`
	// Error message when delivery failed.
	ErrorMessage string `json:"error_message" toon:"error_message"`
	// Unique event identifier for the delivery attempt.
	EventID string `json:"event_id" toon:"event_id"`
	// Event time as a formatted timestamp string.
	EventTime string `json:"event_time" toon:"event_time"`
	// Event type (e.g. `created`, `acknowledged`, `closed`).
	EventType string `json:"event_type" toon:"event_type"`
	// Integration ID that triggered the webhook.
	IntegrationID int64 `json:"integration_id" toon:"integration_id"`
	// Source object ID (incident ID or alert ID).
	RefID string `json:"ref_id" toon:"ref_id"`
	// Outbound request body payload.
	RequestBody string `json:"request_body" toon:"request_body"`
	// Serialized outbound request headers.
	RequestHeaders string `json:"request_headers" toon:"request_headers"`
	// Response body returned by the destination.
	ResponseBody string `json:"response_body" toon:"response_body"`
	// Serialized response headers from the destination.
	ResponseHeaders string `json:"response_headers" toon:"response_headers"`
	// Delivery outcome.
	Status string `json:"status" toon:"status"`
	// HTTP status code returned by the destination.
	StatusCode int64 `json:"status_code" toon:"status_code"`
	// Source object kind. `incident` or `alert`.
	WebhookType string `json:"webhook_type" toon:"webhook_type"`
}

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