activitysmith

package module
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 8 Imported by: 0

README

ActivitySmith Go SDK

The ActivitySmith Go SDK provides convenient access to the ActivitySmith API from Go applications.

Documentation

See API reference.

Table of Contents

Installation

go get github.com/ActivitySmithHQ/activitysmith-go

Setup

package main

import (
	"log"

	activitysmithsdk "github.com/ActivitySmithHQ/activitysmith-go"
)

func main() {
	activitysmith, err := activitysmithsdk.New("YOUR_API_KEY")
	if err != nil {
		log.Fatal(err)
	}

	_ = activitysmith
}

Push Notifications

Send a Push Notification

Push notification example

Use activitysmith.Notifications.Send with either activitysmithsdk.PushNotificationInput for common notification fields or generated.PushNotificationRequest if you want full control over the generated model.

input := activitysmithsdk.PushNotificationInput{
	Title:   "New subscription 💸",
	Message: "Customer upgraded to Pro plan",
}

_, err := activitysmith.Notifications.Send(input)
if err != nil {
	log.Fatal(err)
}
Rich Push Notifications with Media

Rich push notification with image

input := activitysmithsdk.PushNotificationInput{
	Title:       "Homepage ready",
	Message:     "Your agent finished the redesign.",
	Media:       "https://cdn.example.com/output/homepage-v2.png",
	Redirection: "https://github.com/acme/web/pull/482",
}

_, err := activitysmith.Notifications.Send(input)
if err != nil {
	log.Fatal(err)
}

Send images, videos, or audio with your push notifications, press and hold to preview media directly from the notification, then tap through to open the linked content.

Rich push notification with audio

What will work:

  • direct image URL: .jpg, .png, .gif, etc.
  • direct audio file URL: .mp3, .m4a, etc.
  • direct video file URL: .mp4, .mov, etc.
  • URL that responds with a proper media Content-Type, even if the path has no extension
Actionable Push Notifications

Actionable push notification example

Push notification Redirection and Actions are optional. Use them to open HTTPS URLs, run a specific iPhone Shortcut with shortcuts://run-shortcut?name=..., or trigger backend webhook workflows. Webhooks are executed by the ActivitySmith backend.

_, err := activitysmith.Notifications.Send(activitysmithsdk.PushNotificationInput{
	Title:       "New subscription 💸",
	Message:     "Customer upgraded to Pro plan",
	Redirection: "https://crm.example.com/customers/cus_9f3a1d",
	Actions: []activitysmithsdk.PushNotificationAction{
		activitysmithsdk.PushAction(
			"Open CRM Profile",
			"open_url",
			"https://crm.example.com/customers/cus_9f3a1d",
		),
		activitysmithsdk.PushAction(
			"Chat with Jarvis",
			"open_url",
			"shortcuts://run-shortcut?name=Jarvis",
		),
		activitysmithsdk.PushAction(
			"Start Onboarding Workflow",
			"webhook",
			"https://hooks.example.com/activitysmith/onboarding/start",
			activitysmithsdk.PushActionMethod("POST"),
			activitysmithsdk.PushActionBody(map[string]interface{}{
				"customer_id": "cus_9f3a1d",
				"plan":        "pro",
			}),
		),
	},
})
if err != nil {
	log.Fatal(err)
}

Live Activities

There are six types of Live Activities:

  • stats: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance
  • metrics: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate
  • segmented_progress: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs
  • progress: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads
  • alert: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states
  • timer: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs
Start & Update Live Activity

Use a stable streamKey to identify the metric, job, deployment, or system you want to keep visible. The first Stream(...) call starts the Live Activity. Later calls with the same streamKey update it.

Stats

Stats Live Activity stream example

activitysmith.LiveActivities.Stream(
	"sales-hourly",
	activitysmithsdk.LiveActivityStreamInput{
		Title:    "Sales",
		Subtitle: "last hour",
		Type:     "stats",
		Metrics: []activitysmithsdk.ActivityMetric{
			activitysmithsdk.Metric("Revenue", "$2430", activitysmithsdk.MetricColor("blue")),
			activitysmithsdk.Metric("Orders", "37", activitysmithsdk.MetricColor("green")),
			activitysmithsdk.Metric("Conversion", "4.8%", activitysmithsdk.MetricColor("magenta")),
			activitysmithsdk.Metric("Avg Order", "$65.68", activitysmithsdk.MetricColor("yellow")),
			activitysmithsdk.Metric("Refunds", "$84", activitysmithsdk.MetricColor("red")),
			activitysmithsdk.Metric("New Buyers", "18", activitysmithsdk.MetricColor("cyan")),
		},
	},
)
Metrics

Metrics Live Activity stream example

activitysmith.LiveActivities.Stream(
	"prod-web-1",
	activitysmithsdk.LiveActivityStreamInput{
		Title:    "Server Health",
		Subtitle: "prod-web-1",
		Type:     "metrics",
		Metrics: []activitysmithsdk.ActivityMetric{
			activitysmithsdk.Metric("CPU", 9, activitysmithsdk.MetricUnit("%")),
			activitysmithsdk.Metric("MEM", 45, activitysmithsdk.MetricUnit("%")),
		},
	},
)
Segmented Progress

Segmented Progress Live Activity stream example

activitysmith.LiveActivities.Stream(
	"nightly-backup",
	activitysmithsdk.LiveActivityStreamInput{
		Title:         "Nightly Backup",
		Subtitle:      "upload archive",
		Type:          "segmented_progress",
		NumberOfSteps: 3,
		CurrentStep:   2,
	},
)
Progress

Progress Live Activity stream example

activitysmith.LiveActivities.Stream(
	"search-reindex",
	activitysmithsdk.LiveActivityStreamInput{
		Title:      "Search Reindex",
		Subtitle:   "catalog-v2",
		Type:       "progress",
		Percentage: 42,
	},
)
Alert

Alert Live Activity stream example

activitysmith.LiveActivities.Stream(
	"customer-ops",
	activitysmithsdk.LiveActivityStreamInput{
		Title:   "Reactivation",
		Message: "Lumen came back after 2 weeks",
		Type:    activitysmithsdk.LiveActivityTypeAlert,
		Icon:    activitysmithsdk.AlertIcon("cloud.sun", "yellow"),
		Badge:   activitysmithsdk.AlertBadge("Customer", "magenta"),
	},
)
Timer

Timer Live Activity showing a benchmark run countdown

activitysmith.LiveActivities.Stream(
	"benchmark-run",
	activitysmithsdk.LiveActivityStreamInput{
		Title:           "Benchmark Run",
		Subtitle:        "sampling",
		Type:            "timer",
		DurationSeconds: 300,
		Color:           "cyan",
	},
)

For a countdown, send duration_seconds. You can update title, subtitle, color, or any other visible field as the work changes. Leave duration_seconds out unless you want to change the timer.

To start at 00:00 and count up, set counts_down: false and leave out duration_seconds.

End Live Activity

Call EndStream(...) with the same streamKey to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set AutoDismissMinutes to choose a different dismissal time, including 0 for immediate dismissal.

activitysmith.LiveActivities.EndStream(
	"prod-web-1",
	activitysmithsdk.LiveActivityStreamEndInput{
		Title:    "Server Health",
		Subtitle: "prod-web-1",
		Type:     "metrics",
		Metrics: []activitysmithsdk.ActivityMetric{
			activitysmithsdk.Metric("CPU", 7, activitysmithsdk.MetricUnit("%")),
			activitysmithsdk.Metric("MEM", 38, activitysmithsdk.MetricUnit("%")),
		},
		AutoDismissMinutes: 2,
	},
)
Live Activity Action

Live Activities can include an action button.

  • open_url: open an HTTPS URL.
  • open_url with a shortcuts:// URL: run an Apple Shortcut, for example to open an app.
  • webhook: trigger a backend GET/POST workflow.

Live Activity with action button

Open URL action
activitysmith.LiveActivities.Stream(
	"prod-web-1",
	activitysmithsdk.LiveActivityStreamInput{
		Title:    "Server Health",
		Subtitle: "prod-web-1",
		Type:     "metrics",
		Metrics: []activitysmithsdk.ActivityMetric{
			activitysmithsdk.Metric("CPU", 76, activitysmithsdk.MetricUnit("%")),
			activitysmithsdk.Metric("MEM", 52, activitysmithsdk.MetricUnit("%")),
		},
		Action: &activitysmithsdk.LiveActivityActionInput{
			Title: "Dashboard",
			Type:  "open_url",
			URL:   "https://ops.example.com/servers/prod-web-1",
		},
	},
)
Apple Shortcut action
activitysmith.LiveActivities.Stream(
	"deploy-payments-api",
	activitysmithsdk.LiveActivityStreamInput{
		Title:         "Deploying payments-api",
		Subtitle:      "Running database migrations",
		Type:          "segmented_progress",
		NumberOfSteps: 5,
		CurrentStep:   3,
		Action: &activitysmithsdk.LiveActivityActionInput{
			Title: "Chat with Jarvis",
			Type:  "open_url",
			URL:   "shortcuts://run-shortcut?name=Jarvis",
		},
	},
)
Webhook action
activitysmith.LiveActivities.Stream(
	"search-reindex",
	activitysmithsdk.LiveActivityStreamInput{
		Title:         "Reindexing product search",
		Subtitle:      "Shard 7 of 12",
		Type:          "segmented_progress",
		NumberOfSteps: 12,
		CurrentStep:   7,
		Action: &activitysmithsdk.LiveActivityActionInput{
			Title:  "Pause Reindex",
			Type:   "webhook",
			URL:    "https://ops.example.com/hooks/search/reindex/pause",
			Method: "POST",
			Body: map[string]interface{}{
				"job_id":       "reindex-2026-03-19",
				"requested_by": "activitysmith-go",
			},
		},
	},
)
Secondary action

Alert Live Activity with primary and secondary action buttons

Use SecondaryAction when you want a second button beside the primary Action.

The secondary action button is supported for alert, progress, and segmented_progress Live Activities. Both buttons use the same open_url, webhook, and Apple Shortcut payload shapes.

activitysmith.LiveActivities.Stream(
	"agent-approval",
	activitysmithsdk.LiveActivityStreamInput{
		Title:   "Approval Needed",
		Message: "Should I send the follow-up email to Brightlane?",
		Type:    "alert",
		Color:   "green",
		Icon:    activitysmithsdk.AlertIcon("sparkles", "green"),
		Badge:   activitysmithsdk.AlertBadge("Agent", "green"),
		Action: &activitysmithsdk.LiveActivityActionInput{
			Title:  "Send",
			Type:   "webhook",
			URL:    "https://agent.example.com/live-activity/approve",
			Method: "POST",
			Body: map[string]interface{}{
				"approval_id": "approval_01JY3J7Q9S0P8M1V5PZK7DR4M2",
				"decision":    "send",
			},
		},
		SecondaryAction: &activitysmithsdk.LiveActivityActionInput{
			Title:  "Deny",
			Type:   "webhook",
			URL:    "https://agent.example.com/live-activity/deny",
			Method: "POST",
			Body: map[string]interface{}{
				"approval_id": "approval_01JY3J7Q9S0P8M1V5PZK7DR4M2",
				"decision":    "deny",
			},
		},
	},
)
Icons and Badges

Add more context to Live Activities with icons and badges.

Icon

Supported Live Activity types: stats, metrics, progress, segmented_progress, alert, and timer.

Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen

activitysmith.LiveActivities.Stream(
	"prod-web-1",
	activitysmithsdk.LiveActivityStreamInput{
		Title:    "Server Health",
		Subtitle: "prod-web-1",
		Type:     "metrics",
		Icon:     activitysmithsdk.AlertIcon("server.rack", "blue"),
		Metrics: []activitysmithsdk.ActivityMetric{
			activitysmithsdk.Metric("CPU", 18, activitysmithsdk.MetricUnit("%")),
			activitysmithsdk.Metric("MEM", 42, activitysmithsdk.MetricUnit("%")),
		},
	},
)

The Icon symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools:

  • ActivitySmith app - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use
  • SF Symbols - Apple's official macOS app
  • Interactful - free third-party iOS app listing all SF Symbols under Foundations -> Iconography
Badge

Badges are supported by alert, progress, and segmented_progress Live Activities.

Progress Live Activity with a badge on the iPhone Lock Screen

activitysmith.LiveActivities.Stream(
	"nightly-database-backup",
	activitysmithsdk.LiveActivityStreamInput{
		Title:      "Nightly Database Backup",
		Subtitle:   "verify restore",
		Type:       "progress",
		Badge:      activitysmithsdk.AlertBadge("S3", "cyan"),
		Percentage: 62,
	},
)
Live Activity Colors

Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge:

lime, green, cyan, blue, purple, magenta, red, orange, yellow, gray

Widgets

Lock screen widgets

ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the web app, then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically.

Create widget metric

_, err := activitysmith.Metrics.Update("deploy.success_rate", 99.9)
if err != nil {
	log.Fatal(err)
}

String metric values work too.

_, err = activitysmith.Metrics.Update("prod.status", "healthy")
if err != nil {
	log.Fatal(err)
}

App Icon Badge Count

ActivitySmith app icon with an App Icon Badge Count

Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view.

Set or update the badge value.

activitysmith.BadgeCount(8333)

To clear the badge, set its value to 0.

activitysmith.BadgeCount(0)

Channels

Use channels to target specific team members or devices

Push Notifications
activitysmith.Notifications.Send(activitysmithsdk.PushNotificationInput{
	Title:    "New subscription 💸",
	Message:  "Customer upgraded to Pro plan",
	Channels: []string{"sales", "customer-success"},
})
Live Activities
activitysmith.LiveActivities.Start(activitysmithsdk.LiveActivityStartInput{
	Title:      "Nightly Database Backup",
	Subtitle:   "verify restore",
	Type:       "progress",
	Percentage: 62,
	Channels:   []string{"sales", "customer-success"},
})
App Icon Badge Count
activitysmith.BadgeCount(3, "sales", "customer-success")

Error Handling

SDK methods return (response, error). Always check error on each call.

Requirements

  • Go 1.22+

License

MIT

Documentation

Index

Constants

View Source
const (
	LiveActivityTypeSegmentedProgress = "segmented_progress"
	LiveActivityTypeProgress          = "progress"
	LiveActivityTypeMetrics           = "metrics"
	LiveActivityTypeStats             = "stats"
	LiveActivityTypeAlert             = "alert"
	LiveActivityTypeTimer             = "timer"
)
View Source
const Version = "1.9.0"

Variables

View Source
var ErrAPIKeyRequired = errors.New("activitysmith: apiKey is required")
View Source
var ErrPushNotificationMediaActionsConflict = errors.New("activitysmith: media cannot be combined with actions")

Functions

func NewActivityMetric added in v1.3.0

func NewActivityMetric(label string, value any, options ...ActivityMetricOption) (generated.ActivityMetric, error)

Types

type ActivityMetric added in v1.4.0

type ActivityMetric = generated.ActivityMetric

func Metric added in v1.4.0

func Metric(label string, value any, options ...ActivityMetricOption) ActivityMetric

type ActivityMetricOption added in v1.3.0

type ActivityMetricOption func(*generated.ActivityMetric)

func MetricColor added in v1.4.0

func MetricColor(color string) ActivityMetricOption

func MetricUnit added in v1.4.0

func MetricUnit(unit string) ActivityMetricOption

func WithActivityMetricColor added in v1.3.0

func WithActivityMetricColor(color string) ActivityMetricOption

func WithActivityMetricUnit added in v1.3.0

func WithActivityMetricUnit(unit string) ActivityMetricOption

type Client

type Client struct {
	Notifications  *NotificationsService
	LiveActivities *LiveActivitiesService
	Metrics        *MetricsService
	// contains filtered or unexported fields
}

func New

func New(apiKey string, opts ...*Options) (*Client, error)

func (*Client) APIClient

func (c *Client) APIClient() *generated.APIClient

func (*Client) BadgeCount added in v1.9.0

func (c *Client) BadgeCount(value int, channels ...string) (*generated.AppIconBadgeCountUpdateResponse, error)

BadgeCount sets the count shown on the ActivitySmith app icon. Pass 0 to clear it.

func (*Client) Context

func (c *Client) Context() context.Context

type LiveActivitiesService

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

func (*LiveActivitiesService) End

func (*LiveActivitiesService) EndLiveActivity

func (*LiveActivitiesService) EndLiveActivityStream added in v1.1.0

func (*LiveActivitiesService) EndStream added in v1.1.0

func (*LiveActivitiesService) ReconcileLiveActivityStream added in v1.1.0

func (s *LiveActivitiesService) ReconcileLiveActivityStream(streamKey string, request generated.LiveActivityStreamRequest) (*generated.LiveActivityStreamPutResponse, error)

func (*LiveActivitiesService) Start

func (*LiveActivitiesService) StartLiveActivity

Backward-compatible aliases.

func (*LiveActivitiesService) Stream added in v1.1.0

func (*LiveActivitiesService) Update

func (*LiveActivitiesService) UpdateLiveActivity

type LiveActivityActionInput added in v1.0.0

type LiveActivityActionInput struct {
	Title  string
	Type   string
	URL    string
	Method string
	Body   map[string]interface{}
}

LiveActivityActionInput is a handwritten DX input for the optional Live Activity button.

type LiveActivityAlertBadgeInput added in v1.5.0

type LiveActivityAlertBadgeInput struct {
	Title string
	Color string
}

func AlertBadge added in v1.5.0

func AlertBadge(title string, color ...string) LiveActivityAlertBadgeInput

type LiveActivityAlertIconInput added in v1.5.0

type LiveActivityAlertIconInput struct {
	Symbol string
	Color  string
}

func AlertIcon added in v1.5.0

func AlertIcon(symbol string, color ...string) LiveActivityAlertIconInput

type LiveActivityContentStateInput added in v1.4.0

type LiveActivityContentStateInput struct {
	Title              string
	NumberOfSteps      int32
	CurrentStep        int32
	Percentage         float32
	Value              float32
	UpperLimit         float32
	DurationSeconds    float32
	CountsDown         bool
	Type               string
	Subtitle           string
	Message            string
	Icon               LiveActivityAlertIconInput
	Badge              LiveActivityAlertBadgeInput
	Color              string
	StepColor          string
	AutoDismissMinutes int32
	Metrics            []ActivityMetric
	// contains filtered or unexported fields
}

LiveActivityContentStateInput keeps the visible Live Activity state separate from top-level routing fields such as action and channels.

func (LiveActivityContentStateInput) WithAutoDismissMinutes added in v1.4.0

func (LiveActivityContentStateInput) WithCountsDown added in v1.7.0

func (LiveActivityContentStateInput) WithCurrentStep added in v1.6.0

func (LiveActivityContentStateInput) WithDurationSeconds added in v1.7.0

func (LiveActivityContentStateInput) WithNumberOfSteps added in v1.4.0

func (LiveActivityContentStateInput) WithPercentage added in v1.4.0

func (LiveActivityContentStateInput) WithUpperLimit added in v1.4.0

func (LiveActivityContentStateInput) WithValue added in v1.4.0

type LiveActivityEndInput added in v0.1.1

type LiveActivityEndInput struct {
	ActivityID         string
	ContentState       LiveActivityContentStateInput
	Title              string
	CurrentStep        int32
	Percentage         float32
	Value              float32
	UpperLimit         float32
	DurationSeconds    float32
	CountsDown         bool
	Type               string
	Subtitle           string
	Message            string
	Icon               LiveActivityAlertIconInput
	Badge              LiveActivityAlertBadgeInput
	Color              string
	StepColor          string
	NumberOfSteps      int32
	AutoDismissMinutes int32
	Metrics            []generated.ActivityMetric
	Action             *LiveActivityActionInput
	SecondaryAction    *LiveActivityActionInput
	// contains filtered or unexported fields
}

LiveActivityEndInput is a handwritten DX input with plain optional values.

func (LiveActivityEndInput) WithAction added in v1.0.0

func (LiveActivityEndInput) WithAutoDismissMinutes added in v0.1.1

func (in LiveActivityEndInput) WithAutoDismissMinutes(v int32) LiveActivityEndInput

WithAutoDismissMinutes forces inclusion of auto_dismiss_minutes, including explicit zero.

func (LiveActivityEndInput) WithCountsDown added in v1.7.0

func (in LiveActivityEndInput) WithCountsDown(v bool) LiveActivityEndInput

func (LiveActivityEndInput) WithCurrentStep added in v1.6.0

func (in LiveActivityEndInput) WithCurrentStep(v int32) LiveActivityEndInput

func (LiveActivityEndInput) WithDurationSeconds added in v1.7.0

func (in LiveActivityEndInput) WithDurationSeconds(v float32) LiveActivityEndInput

func (LiveActivityEndInput) WithNumberOfSteps added in v0.1.1

func (in LiveActivityEndInput) WithNumberOfSteps(v int32) LiveActivityEndInput

WithNumberOfSteps forces inclusion of number_of_steps, including explicit zero.

func (LiveActivityEndInput) WithPercentage added in v0.1.7

func (in LiveActivityEndInput) WithPercentage(v float32) LiveActivityEndInput

WithPercentage forces inclusion of percentage, including explicit zero.

func (LiveActivityEndInput) WithSecondaryAction added in v1.8.0

func (LiveActivityEndInput) WithUpperLimit added in v0.1.7

func (in LiveActivityEndInput) WithUpperLimit(v float32) LiveActivityEndInput

WithUpperLimit forces inclusion of upper_limit, including explicit zero.

func (LiveActivityEndInput) WithValue added in v0.1.7

WithValue forces inclusion of value, including explicit zero.

type LiveActivityStartInput added in v0.1.1

type LiveActivityStartInput struct {
	ContentState    LiveActivityContentStateInput
	Title           string
	NumberOfSteps   int32
	CurrentStep     int32
	Percentage      float32
	Value           float32
	UpperLimit      float32
	DurationSeconds float32
	CountsDown      bool
	Type            string
	Subtitle        string
	Message         string
	Icon            LiveActivityAlertIconInput
	Badge           LiveActivityAlertBadgeInput
	Color           string
	StepColor       string
	Metrics         []generated.ActivityMetric
	Action          *LiveActivityActionInput
	SecondaryAction *LiveActivityActionInput
	Channels        []string
	// contains filtered or unexported fields
}

LiveActivityStartInput is a handwritten DX input with plain optional values.

func (LiveActivityStartInput) WithAction added in v1.0.0

func (LiveActivityStartInput) WithCountsDown added in v1.7.0

func (in LiveActivityStartInput) WithCountsDown(v bool) LiveActivityStartInput

func (LiveActivityStartInput) WithCurrentStep added in v1.6.0

func (in LiveActivityStartInput) WithCurrentStep(v int32) LiveActivityStartInput

func (LiveActivityStartInput) WithDurationSeconds added in v1.7.0

func (in LiveActivityStartInput) WithDurationSeconds(v float32) LiveActivityStartInput

func (LiveActivityStartInput) WithNumberOfSteps added in v0.1.7

func (in LiveActivityStartInput) WithNumberOfSteps(v int32) LiveActivityStartInput

WithNumberOfSteps forces inclusion of number_of_steps, including explicit zero.

func (LiveActivityStartInput) WithPercentage added in v0.1.7

WithPercentage forces inclusion of percentage, including explicit zero.

func (LiveActivityStartInput) WithSecondaryAction added in v1.8.0

func (LiveActivityStartInput) WithUpperLimit added in v0.1.7

WithUpperLimit forces inclusion of upper_limit, including explicit zero.

func (LiveActivityStartInput) WithValue added in v0.1.7

WithValue forces inclusion of value, including explicit zero.

type LiveActivityStreamEndInput added in v1.1.0

type LiveActivityStreamEndInput struct {
	ContentState    LiveActivityContentStateInput
	Title           string
	NumberOfSteps   int32
	CurrentStep     int32
	Percentage      float32
	Value           float32
	UpperLimit      float32
	DurationSeconds float32
	CountsDown      bool
	Type            string
	Subtitle        string
	Message         string
	Icon            LiveActivityAlertIconInput
	Badge           LiveActivityAlertBadgeInput
	Color           string
	StepColor       string
	Metrics         []generated.ActivityMetric
	Action          *LiveActivityActionInput
	SecondaryAction *LiveActivityActionInput
	Alert           *generated.AlertPayload
	// contains filtered or unexported fields
}

LiveActivityStreamEndInput is an optional payload for ending a managed stream.

func (LiveActivityStreamEndInput) WithAction added in v1.1.0

func (LiveActivityStreamEndInput) WithCountsDown added in v1.7.0

func (LiveActivityStreamEndInput) WithCurrentStep added in v1.6.0

func (LiveActivityStreamEndInput) WithDurationSeconds added in v1.7.0

func (LiveActivityStreamEndInput) WithNumberOfSteps added in v1.1.0

func (LiveActivityStreamEndInput) WithPercentage added in v1.1.0

func (LiveActivityStreamEndInput) WithSecondaryAction added in v1.8.0

func (LiveActivityStreamEndInput) WithUpperLimit added in v1.1.0

func (LiveActivityStreamEndInput) WithValue added in v1.1.0

type LiveActivityStreamInput added in v1.1.0

type LiveActivityStreamInput struct {
	ContentState    LiveActivityContentStateInput
	Title           string
	NumberOfSteps   int32
	CurrentStep     int32
	Percentage      float32
	Value           float32
	UpperLimit      float32
	DurationSeconds float32
	CountsDown      bool
	Type            string
	Subtitle        string
	Message         string
	Icon            LiveActivityAlertIconInput
	Badge           LiveActivityAlertBadgeInput
	Color           string
	StepColor       string
	Metrics         []generated.ActivityMetric
	Action          *LiveActivityActionInput
	SecondaryAction *LiveActivityActionInput
	Alert           *generated.AlertPayload
	Channels        []string
	// contains filtered or unexported fields
}

LiveActivityStreamInput is a handwritten DX input with plain optional values.

func (LiveActivityStreamInput) WithAction added in v1.1.0

func (LiveActivityStreamInput) WithCountsDown added in v1.7.0

func (LiveActivityStreamInput) WithCurrentStep added in v1.6.0

func (LiveActivityStreamInput) WithDurationSeconds added in v1.7.0

func (in LiveActivityStreamInput) WithDurationSeconds(v float32) LiveActivityStreamInput

func (LiveActivityStreamInput) WithNumberOfSteps added in v1.1.0

func (in LiveActivityStreamInput) WithNumberOfSteps(v int32) LiveActivityStreamInput

func (LiveActivityStreamInput) WithPercentage added in v1.1.0

func (LiveActivityStreamInput) WithSecondaryAction added in v1.8.0

func (LiveActivityStreamInput) WithUpperLimit added in v1.1.0

func (LiveActivityStreamInput) WithValue added in v1.1.0

type LiveActivityUpdateInput added in v0.1.1

type LiveActivityUpdateInput struct {
	ActivityID      string
	ContentState    LiveActivityContentStateInput
	Title           string
	CurrentStep     int32
	Percentage      float32
	Value           float32
	UpperLimit      float32
	DurationSeconds float32
	CountsDown      bool
	Type            string
	Subtitle        string
	Message         string
	Icon            LiveActivityAlertIconInput
	Badge           LiveActivityAlertBadgeInput
	Color           string
	StepColor       string
	NumberOfSteps   int32
	Metrics         []generated.ActivityMetric
	Action          *LiveActivityActionInput
	SecondaryAction *LiveActivityActionInput
	// contains filtered or unexported fields
}

LiveActivityUpdateInput is a handwritten DX input with plain optional values.

func (LiveActivityUpdateInput) WithAction added in v1.0.0

func (LiveActivityUpdateInput) WithCountsDown added in v1.7.0

func (LiveActivityUpdateInput) WithCurrentStep added in v1.6.0

func (LiveActivityUpdateInput) WithDurationSeconds added in v1.7.0

func (in LiveActivityUpdateInput) WithDurationSeconds(v float32) LiveActivityUpdateInput

func (LiveActivityUpdateInput) WithNumberOfSteps added in v0.1.1

func (in LiveActivityUpdateInput) WithNumberOfSteps(v int32) LiveActivityUpdateInput

WithNumberOfSteps forces inclusion of number_of_steps, including explicit zero.

func (LiveActivityUpdateInput) WithPercentage added in v0.1.7

WithPercentage forces inclusion of percentage, including explicit zero.

func (LiveActivityUpdateInput) WithSecondaryAction added in v1.8.0

func (LiveActivityUpdateInput) WithUpperLimit added in v0.1.7

WithUpperLimit forces inclusion of upper_limit, including explicit zero.

func (LiveActivityUpdateInput) WithValue added in v0.1.7

WithValue forces inclusion of value, including explicit zero.

type MetricValueInput added in v1.2.0

type MetricValueInput struct {
	Value     any
	Timestamp *time.Time
}

type MetricsService added in v1.2.0

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

func (*MetricsService) Update added in v1.2.0

func (*MetricsService) UpdateMetricValue added in v1.2.0

Backward-compatible alias.

type NotificationsService

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

func (*NotificationsService) Send

func (*NotificationsService) SendPushNotification

Backward-compatible alias.

type Options

type Options struct {
	Context context.Context
}

type PushNotificationAction added in v1.4.0

type PushNotificationAction = generated.PushNotificationAction

func PushAction added in v1.4.0

func PushAction(title string, type_ string, url string, options ...PushNotificationActionOption) PushNotificationAction

type PushNotificationActionOption added in v1.4.0

type PushNotificationActionOption func(*generated.PushNotificationAction)

func PushActionBody added in v1.4.0

func PushActionBody(body map[string]interface{}) PushNotificationActionOption

func PushActionMethod added in v1.4.0

func PushActionMethod(method string) PushNotificationActionOption

type PushNotificationInput added in v0.1.1

type PushNotificationInput struct {
	Title       string
	Message     string
	Subtitle    string
	Media       string
	Redirection string
	Actions     []PushNotificationAction
	Channels    []string
}

PushNotificationInput is a handwritten DX input with plain optional values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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