Documentation
¶
Index ¶
- Constants
- Variables
- func NewActivityMetric(label string, value any, options ...ActivityMetricOption) (generated.ActivityMetric, error)
- type ActivityMetric
- type ActivityMetricOption
- type Client
- type LiveActivitiesService
- func (s *LiveActivitiesService) End(input any) (*generated.LiveActivityEndResponse, error)
- func (s *LiveActivitiesService) EndLiveActivity(request generated.LiveActivityEndRequest) (*generated.LiveActivityEndResponse, error)
- func (s *LiveActivitiesService) EndLiveActivityStream(streamKey string, request generated.LiveActivityStreamDeleteRequest) (*generated.LiveActivityStreamDeleteResponse, error)
- func (s *LiveActivitiesService) EndStream(streamKey string, input any) (*generated.LiveActivityStreamDeleteResponse, error)
- func (s *LiveActivitiesService) ReconcileLiveActivityStream(streamKey string, request generated.LiveActivityStreamRequest) (*generated.LiveActivityStreamPutResponse, error)
- func (s *LiveActivitiesService) Start(input any) (*generated.LiveActivityStartResponse, error)
- func (s *LiveActivitiesService) StartLiveActivity(request generated.LiveActivityStartRequest) (*generated.LiveActivityStartResponse, error)
- func (s *LiveActivitiesService) Stream(streamKey string, input any) (*generated.LiveActivityStreamPutResponse, error)
- func (s *LiveActivitiesService) Update(input any) (*generated.LiveActivityUpdateResponse, error)
- func (s *LiveActivitiesService) UpdateLiveActivity(request generated.LiveActivityUpdateRequest) (*generated.LiveActivityUpdateResponse, error)
- type LiveActivityActionInput
- type LiveActivityAlertBadgeInput
- type LiveActivityAlertIconInput
- type LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithAutoDismissMinutes(v int32) LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithCurrentStep(v int32) LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithNumberOfSteps(v int32) LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithPercentage(v float32) LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithUpperLimit(v float32) LiveActivityContentStateInput
- func (in LiveActivityContentStateInput) WithValue(v float32) LiveActivityContentStateInput
- type LiveActivityEndInput
- func (in LiveActivityEndInput) WithAction(v LiveActivityActionInput) LiveActivityEndInput
- func (in LiveActivityEndInput) WithAutoDismissMinutes(v int32) LiveActivityEndInput
- func (in LiveActivityEndInput) WithCurrentStep(v int32) LiveActivityEndInput
- func (in LiveActivityEndInput) WithNumberOfSteps(v int32) LiveActivityEndInput
- func (in LiveActivityEndInput) WithPercentage(v float32) LiveActivityEndInput
- func (in LiveActivityEndInput) WithUpperLimit(v float32) LiveActivityEndInput
- func (in LiveActivityEndInput) WithValue(v float32) LiveActivityEndInput
- type LiveActivityStartInput
- func (in LiveActivityStartInput) WithAction(v LiveActivityActionInput) LiveActivityStartInput
- func (in LiveActivityStartInput) WithCurrentStep(v int32) LiveActivityStartInput
- func (in LiveActivityStartInput) WithNumberOfSteps(v int32) LiveActivityStartInput
- func (in LiveActivityStartInput) WithPercentage(v float32) LiveActivityStartInput
- func (in LiveActivityStartInput) WithUpperLimit(v float32) LiveActivityStartInput
- func (in LiveActivityStartInput) WithValue(v float32) LiveActivityStartInput
- type LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithAction(v LiveActivityActionInput) LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithCurrentStep(v int32) LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithNumberOfSteps(v int32) LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithPercentage(v float32) LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithUpperLimit(v float32) LiveActivityStreamEndInput
- func (in LiveActivityStreamEndInput) WithValue(v float32) LiveActivityStreamEndInput
- type LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithAction(v LiveActivityActionInput) LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithCurrentStep(v int32) LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithNumberOfSteps(v int32) LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithPercentage(v float32) LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithUpperLimit(v float32) LiveActivityStreamInput
- func (in LiveActivityStreamInput) WithValue(v float32) LiveActivityStreamInput
- type LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithAction(v LiveActivityActionInput) LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithCurrentStep(v int32) LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithNumberOfSteps(v int32) LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithPercentage(v float32) LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithUpperLimit(v float32) LiveActivityUpdateInput
- func (in LiveActivityUpdateInput) WithValue(v float32) LiveActivityUpdateInput
- type MetricValueInput
- type MetricsService
- type NotificationsService
- type Options
- type PushNotificationAction
- type PushNotificationActionOption
- type PushNotificationInput
Constants ¶
const ( LiveActivityTypeSegmentedProgress = "segmented_progress" LiveActivityTypeProgress = "progress" LiveActivityTypeMetrics = "metrics" LiveActivityTypeStats = "stats" LiveActivityTypeAlert = "alert" )
const Version = "1.5.0"
Variables ¶
var ErrAPIKeyRequired = errors.New("activitysmith: apiKey is required")
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
}
type LiveActivitiesService ¶
type LiveActivitiesService struct {
// contains filtered or unexported fields
}
func (*LiveActivitiesService) End ¶
func (s *LiveActivitiesService) End(input any) (*generated.LiveActivityEndResponse, error)
func (*LiveActivitiesService) EndLiveActivity ¶
func (s *LiveActivitiesService) EndLiveActivity(request generated.LiveActivityEndRequest) (*generated.LiveActivityEndResponse, error)
func (*LiveActivitiesService) EndLiveActivityStream ¶ added in v1.1.0
func (s *LiveActivitiesService) EndLiveActivityStream(streamKey string, request generated.LiveActivityStreamDeleteRequest) (*generated.LiveActivityStreamDeleteResponse, error)
func (*LiveActivitiesService) EndStream ¶ added in v1.1.0
func (s *LiveActivitiesService) EndStream(streamKey string, input any) (*generated.LiveActivityStreamDeleteResponse, error)
func (*LiveActivitiesService) ReconcileLiveActivityStream ¶ added in v1.1.0
func (s *LiveActivitiesService) ReconcileLiveActivityStream(streamKey string, request generated.LiveActivityStreamRequest) (*generated.LiveActivityStreamPutResponse, error)
func (*LiveActivitiesService) Start ¶
func (s *LiveActivitiesService) Start(input any) (*generated.LiveActivityStartResponse, error)
func (*LiveActivitiesService) StartLiveActivity ¶
func (s *LiveActivitiesService) StartLiveActivity(request generated.LiveActivityStartRequest) (*generated.LiveActivityStartResponse, error)
Backward-compatible aliases.
func (*LiveActivitiesService) Stream ¶ added in v1.1.0
func (s *LiveActivitiesService) Stream(streamKey string, input any) (*generated.LiveActivityStreamPutResponse, error)
func (*LiveActivitiesService) Update ¶
func (s *LiveActivitiesService) Update(input any) (*generated.LiveActivityUpdateResponse, error)
func (*LiveActivitiesService) UpdateLiveActivity ¶
func (s *LiveActivitiesService) UpdateLiveActivity(request generated.LiveActivityUpdateRequest) (*generated.LiveActivityUpdateResponse, error)
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
func AlertBadge ¶ added in v1.5.0
func AlertBadge(title string, color ...string) LiveActivityAlertBadgeInput
type LiveActivityAlertIconInput ¶ added in v1.5.0
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
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 (in LiveActivityContentStateInput) WithAutoDismissMinutes(v int32) LiveActivityContentStateInput
func (LiveActivityContentStateInput) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityContentStateInput) WithCurrentStep(v int32) LiveActivityContentStateInput
func (LiveActivityContentStateInput) WithNumberOfSteps ¶ added in v1.4.0
func (in LiveActivityContentStateInput) WithNumberOfSteps(v int32) LiveActivityContentStateInput
func (LiveActivityContentStateInput) WithPercentage ¶ added in v1.4.0
func (in LiveActivityContentStateInput) WithPercentage(v float32) LiveActivityContentStateInput
func (LiveActivityContentStateInput) WithUpperLimit ¶ added in v1.4.0
func (in LiveActivityContentStateInput) WithUpperLimit(v float32) LiveActivityContentStateInput
func (LiveActivityContentStateInput) WithValue ¶ added in v1.4.0
func (in LiveActivityContentStateInput) WithValue(v float32) LiveActivityContentStateInput
type LiveActivityEndInput ¶ added in v0.1.1
type LiveActivityEndInput struct {
ActivityID string
ContentState LiveActivityContentStateInput
Title string
CurrentStep int32
Percentage float32
Value float32
UpperLimit float32
Type string
Subtitle string
Message string
Icon LiveActivityAlertIconInput
Badge LiveActivityAlertBadgeInput
Color string
StepColor string
NumberOfSteps int32
AutoDismissMinutes int32
Metrics []generated.ActivityMetric
Action *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 (in LiveActivityEndInput) WithAction(v LiveActivityActionInput) LiveActivityEndInput
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) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityEndInput) WithCurrentStep(v int32) 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) 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
func (in LiveActivityEndInput) WithValue(v float32) LiveActivityEndInput
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
Type string
Subtitle string
Message string
Icon LiveActivityAlertIconInput
Badge LiveActivityAlertBadgeInput
Color string
StepColor string
Metrics []generated.ActivityMetric
Action *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 (in LiveActivityStartInput) WithAction(v LiveActivityActionInput) LiveActivityStartInput
func (LiveActivityStartInput) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityStartInput) WithCurrentStep(v int32) 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
func (in LiveActivityStartInput) WithPercentage(v float32) LiveActivityStartInput
WithPercentage forces inclusion of percentage, including explicit zero.
func (LiveActivityStartInput) WithUpperLimit ¶ added in v0.1.7
func (in LiveActivityStartInput) WithUpperLimit(v float32) LiveActivityStartInput
WithUpperLimit forces inclusion of upper_limit, including explicit zero.
func (LiveActivityStartInput) WithValue ¶ added in v0.1.7
func (in LiveActivityStartInput) WithValue(v float32) LiveActivityStartInput
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
Type string
Subtitle string
Message string
Icon LiveActivityAlertIconInput
Badge LiveActivityAlertBadgeInput
Color string
StepColor string
Metrics []generated.ActivityMetric
Action *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 (in LiveActivityStreamEndInput) WithAction(v LiveActivityActionInput) LiveActivityStreamEndInput
func (LiveActivityStreamEndInput) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityStreamEndInput) WithCurrentStep(v int32) LiveActivityStreamEndInput
func (LiveActivityStreamEndInput) WithNumberOfSteps ¶ added in v1.1.0
func (in LiveActivityStreamEndInput) WithNumberOfSteps(v int32) LiveActivityStreamEndInput
func (LiveActivityStreamEndInput) WithPercentage ¶ added in v1.1.0
func (in LiveActivityStreamEndInput) WithPercentage(v float32) LiveActivityStreamEndInput
func (LiveActivityStreamEndInput) WithUpperLimit ¶ added in v1.1.0
func (in LiveActivityStreamEndInput) WithUpperLimit(v float32) LiveActivityStreamEndInput
func (LiveActivityStreamEndInput) WithValue ¶ added in v1.1.0
func (in LiveActivityStreamEndInput) WithValue(v float32) LiveActivityStreamEndInput
type LiveActivityStreamInput ¶ added in v1.1.0
type LiveActivityStreamInput struct {
ContentState LiveActivityContentStateInput
Title string
NumberOfSteps int32
CurrentStep int32
Percentage float32
Value float32
UpperLimit float32
Type string
Subtitle string
Message string
Icon LiveActivityAlertIconInput
Badge LiveActivityAlertBadgeInput
Color string
StepColor string
Metrics []generated.ActivityMetric
Action *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 (in LiveActivityStreamInput) WithAction(v LiveActivityActionInput) LiveActivityStreamInput
func (LiveActivityStreamInput) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityStreamInput) WithCurrentStep(v int32) 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 (in LiveActivityStreamInput) WithPercentage(v float32) LiveActivityStreamInput
func (LiveActivityStreamInput) WithUpperLimit ¶ added in v1.1.0
func (in LiveActivityStreamInput) WithUpperLimit(v float32) LiveActivityStreamInput
func (LiveActivityStreamInput) WithValue ¶ added in v1.1.0
func (in LiveActivityStreamInput) WithValue(v float32) LiveActivityStreamInput
type LiveActivityUpdateInput ¶ added in v0.1.1
type LiveActivityUpdateInput struct {
ActivityID string
ContentState LiveActivityContentStateInput
Title string
CurrentStep int32
Percentage float32
Value float32
UpperLimit float32
Type string
Subtitle string
Message string
Icon LiveActivityAlertIconInput
Badge LiveActivityAlertBadgeInput
Color string
StepColor string
NumberOfSteps int32
Metrics []generated.ActivityMetric
Action *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 (in LiveActivityUpdateInput) WithAction(v LiveActivityActionInput) LiveActivityUpdateInput
func (LiveActivityUpdateInput) WithCurrentStep ¶ added in v1.6.0
func (in LiveActivityUpdateInput) WithCurrentStep(v int32) 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
func (in LiveActivityUpdateInput) WithPercentage(v float32) LiveActivityUpdateInput
WithPercentage forces inclusion of percentage, including explicit zero.
func (LiveActivityUpdateInput) WithUpperLimit ¶ added in v0.1.7
func (in LiveActivityUpdateInput) WithUpperLimit(v float32) LiveActivityUpdateInput
WithUpperLimit forces inclusion of upper_limit, including explicit zero.
func (LiveActivityUpdateInput) WithValue ¶ added in v0.1.7
func (in LiveActivityUpdateInput) WithValue(v float32) LiveActivityUpdateInput
WithValue forces inclusion of value, including explicit zero.
type MetricValueInput ¶ added in v1.2.0
type MetricsService ¶ added in v1.2.0
type MetricsService struct {
// contains filtered or unexported fields
}
func (*MetricsService) Update ¶ added in v1.2.0
func (s *MetricsService) Update(key string, input any) (*generated.MetricValueUpdateResponse, error)
func (*MetricsService) UpdateMetricValue ¶ added in v1.2.0
func (s *MetricsService) UpdateMetricValue(key string, request generated.MetricValueUpdateRequest) (*generated.MetricValueUpdateResponse, error)
Backward-compatible alias.
type NotificationsService ¶
type NotificationsService struct {
// contains filtered or unexported fields
}
func (*NotificationsService) Send ¶
func (s *NotificationsService) Send(input any) (*generated.PushNotificationResponse, error)
func (*NotificationsService) SendPushNotification ¶
func (s *NotificationsService) SendPushNotification(request generated.PushNotificationRequest) (*generated.PushNotificationResponse, error)
Backward-compatible alias.
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.