api_model

package
v0.0.0-...-ba64992 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DigestFlow

type DigestFlow struct {
	Timing DigestTiming `bson:"timing" json:"timing"`

	// EventTime Timing == DigestEvent, seconds
	EventTime int `bson:"eventTime" json:"eventTime"`
}

type DigestTiming

type DigestTiming string
const (
	DigestEvent    DigestTiming = "event"
	DigestSchedule DigestTiming = "schedule"
)

type FlowType

type FlowType string
const (
	FlowNotification FlowType = "notification"
	FlowEmail        FlowType = "email"
	FlowDigest       FlowType = "digest"
)

type Notification

type Notification struct {
	Id         string `json:"id"`
	Subject    string `json:"subject"`
	Step       Step   `json:"step"`
	ReadMarked bool   `json:"readMarked"`
	Deleted    bool   `json:"deleted"`
}

type Step

type Step struct {
	Digest     bool              `json:"digest"`
	Events     []json.RawMessage `json:"events"`
	TotalCount int               `json:"totalCount"`
}

type Subscriber

type Subscriber struct {
	AccountId string `json:"accountId" bson:"accountId"`
	FullName  string `json:"fullName" bson:"fullName"`
	Email     string `json:"email" bson:"email"`
	Locale    string `json:"locale" bson:"locale"`
}

type Tenant

type Tenant struct {
	Id   string         `json:"id" bson:"id"`
	Name string         `json:"name" bson:"name"`
	Data map[string]any `json:"data" bson:"data"`
}

type Workflow

type Workflow struct {
	Name     string              `json:"name"`
	Revision int64               `json:"revision"`
	Flow     []*WorkflowFlowItem `json:"flow"`
}

type WorkflowFlowItem

type WorkflowFlowItem struct {
	Type FlowType `bson:"type" json:"type"`

	// Type == FlowDigest
	Digest *DigestFlow `bson:"digest,omitempty" json:"digest,omitempty"`

	// Type == FlowNotification or FlowEmail
	SubjectTemplate string `bson:"subjectTemplate,omitempty" json:"subjectTemplate,omitempty"`

	// Type == FlowEmail
	ContentTemplate string `bson:"contentTemplate,omitempty" json:"contentTemplate,omitempty"`
}

type WorkflowTriggerRequest

type WorkflowTriggerRequest struct {
	Tenant     Tenant         `json:"tenant"`
	Subscriber Subscriber     `json:"subscriber"`
	Event      map[string]any `json:"event"`
}

type WorkflowTriggerResponse

type WorkflowTriggerResponse struct {
	EventId string `json:"eventId"`
}

Jump to

Keyboard shortcuts

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