model

package
v0.0.0-...-0406d23 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Audience

type Audience struct {
	Model       `bson:",inline"`
	Name        string                `json:"name" bson:"name"`
	Description *string               `json:"description,omitempty" bson:"description,omitempty"`
	Segments    []*primitive.ObjectID `json:"segments,omitempty" bson:"segments,omitempty"`
	Metadata    primitive.M           `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Status      string                `json:"status" bson:"status"`
}

func (*Audience) Collection

func (i *Audience) Collection() string

func (*Audience) Index

func (i *Audience) Index() []mongo.IndexModel

func (*Audience) MarshalBSON

func (i *Audience) MarshalBSON() ([]byte, error)

type Audiences

type Audiences struct {
	Data  []*Audience `json:"data,omitempty"`
	Count int         `json:"count"`
}

type Campaign

type Campaign struct {
	Model    `bson:",inline"`
	Audience *primitive.ObjectID `json:"audience,omitempty" bson:"audience,omitempty"`
	Type     string              `json:"type" bson:"type"`
	Name     string              `json:"name" bson:"name"`
	Metadata primitive.M         `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Status   string              `json:"status" bson:"status"`
}

func (*Campaign) Collection

func (i *Campaign) Collection() string

func (*Campaign) Index

func (i *Campaign) Index() []mongo.IndexModel

func (Campaign) IsEntity

func (Campaign) IsEntity()

func (*Campaign) MarshalBSON

func (i *Campaign) MarshalBSON() ([]byte, error)

type CampaignStatus

type CampaignStatus string
const (
	CampaignStatusDraft      CampaignStatus = "DRAFT"
	CampaignStatusScheduled  CampaignStatus = "SCHEDULED"
	CampaignStatusInProgress CampaignStatus = "IN_PROGRESS"
	CampaignStatusCompleted  CampaignStatus = "COMPLETED"
)

func (CampaignStatus) IsValid

func (e CampaignStatus) IsValid() bool

func (CampaignStatus) MarshalGQL

func (e CampaignStatus) MarshalGQL(w io.Writer)

func (CampaignStatus) String

func (e CampaignStatus) String() string

func (*CampaignStatus) UnmarshalGQL

func (e *CampaignStatus) UnmarshalGQL(v interface{}) error

type CampaignType

type CampaignType string
const (
	CampaignTypeEmail            CampaignType = "EMAIL"
	CampaignTypeSms              CampaignType = "SMS"
	CampaignTypePushNotification CampaignType = "PUSH_NOTIFICATION"
)

func (CampaignType) IsValid

func (e CampaignType) IsValid() bool

func (CampaignType) MarshalGQL

func (e CampaignType) MarshalGQL(w io.Writer)

func (CampaignType) String

func (e CampaignType) String() string

func (*CampaignType) UnmarshalGQL

func (e *CampaignType) UnmarshalGQL(v interface{}) error

type Campaigns

type Campaigns struct {
	Count int         `json:"count"`
	Data  []*Campaign `json:"data,omitempty"`
}

type Comment

type Comment struct {
	ID string `json:"id"`
}

func (Comment) IsEntity

func (Comment) IsEntity()
type Link struct {
	Model       `bson:",inline"`
	Domain      string               `json:"domain" bson:"domain"`
	Code        string               `json:"code" bson:"code"`
	URL         string               `json:"url" bson:"url"`
	Title       *string              `json:"title,omitempty" bson:"title,omitempty"`
	Status      *string              `json:"status,omitempty" bson:"status,omitempty"`
	Engagements int64                `json:"engagements" bson:"engagements"`
	UID         primitive.ObjectID   `json:"uid" bson:"uid"`
	Tags        []primitive.ObjectID `json:"tags" bson:"tags"`
}

func (*Link) Collection

func (i *Link) Collection() string

func (*Link) Index

func (i *Link) Index() []mongo.IndexModel

func (Link) IsEntity

func (Link) IsEntity()

func (*Link) MarshalBSON

func (i *Link) MarshalBSON() ([]byte, error)
type Links struct {
	Data  []*Link `json:"data,omitempty"`
	Count int     `json:"count"`
}

type Model

type Model struct {
	ID        primitive.ObjectID  `json:"id,omitempty" bson:"_id,omitempty"`
	Workspace primitive.ObjectID  `json:"workspace,omitempty" bson:"workspace,omitempty"`
	Metadata  primitive.M         `json:"metadata,omitempty" bson:"metadata,omitempty"`
	Created   primitive.Timestamp `json:"created,omitempty" bson:"created,omitempty"`
	Updated   primitive.Timestamp `json:"updated,omitempty" bson:"updated,omitempty"`
	Deleted   primitive.Timestamp `json:"deleted,omitempty" bson:"deleted,omitempty"`
	Timestamp primitive.Timestamp `json:"timestamp,omitempty" bson:"timestamp,omitempty"`
}

type NewAudience

type NewAudience struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Segment     *SegmentInput          `json:"segment"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type NewCampaign

type NewCampaign struct {
	Audience string                 `json:"audience"`
	Slug     string                 `json:"slug"`
	Type     CampaignType           `json:"type"`
	Name     string                 `json:"name"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type NewLink struct {
	Domain   string                 `json:"domain"`
	Code     string                 `json:"code"`
	URL      string                 `json:"url"`
	Title    *string                `json:"title,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Tags     []*string              `json:"tags,omitempty"`
	Status   *string                `json:"status,omitempty"`
}

type RuleInput

type RuleInput struct {
	Field    string `json:"field"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
}

type Schedule

type Schedule struct {
	ID        string                 `json:"id"`
	Campaign  string                 `json:"campaign"`
	Start     string                 `json:"start"`
	End       string                 `json:"end"`
	Recurring bool                   `json:"recurring"`
	Frequency *string                `json:"frequency,omitempty"`
	Interval  *int                   `json:"interval,omitempty"`
	Days      []*string              `json:"days,omitempty"`
	Time      string                 `json:"time"`
	Timezone  string                 `json:"timezone"`
	Metadata  map[string]interface{} `json:"metadata,omitempty"`
	Created   string                 `json:"created"`
	Updated   string                 `json:"updated"`
}

type Segment

type Segment struct {
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	Description *string            `json:"description,omitempty"`
	Criteria    []*SegmentCriteria `json:"criteria"`
	Created     string             `json:"created"`
	Updated     string             `json:"updated"`
	CreatedBy   *string            `json:"createdBy,omitempty"`
	UpdatedBy   *string            `json:"updatedBy,omitempty"`
}

type SegmentCriteria

type SegmentCriteria struct {
	Field    string          `json:"field"`
	Operator SegmentOperator `json:"operator"`
	Value    string          `json:"value"`
}

type SegmentInput

type SegmentInput struct {
	ID          *string      `json:"id,omitempty"`
	Name        string       `json:"name"`
	Description *string      `json:"description,omitempty"`
	Type        string       `json:"type"`
	Rules       []*RuleInput `json:"rules,omitempty"`
}

type SegmentOperator

type SegmentOperator string
const (
	SegmentOperatorEquals      SegmentOperator = "EQUALS"
	SegmentOperatorNotEquals   SegmentOperator = "NOT_EQUALS"
	SegmentOperatorContains    SegmentOperator = "CONTAINS"
	SegmentOperatorNotContains SegmentOperator = "NOT_CONTAINS"
	SegmentOperatorGreaterThan SegmentOperator = "GREATER_THAN"
	SegmentOperatorLessThan    SegmentOperator = "LESS_THAN"
)

func (SegmentOperator) IsValid

func (e SegmentOperator) IsValid() bool

func (SegmentOperator) MarshalGQL

func (e SegmentOperator) MarshalGQL(w io.Writer)

func (SegmentOperator) String

func (e SegmentOperator) String() string

func (*SegmentOperator) UnmarshalGQL

func (e *SegmentOperator) UnmarshalGQL(v interface{}) error

type Segments

type Segments struct {
	Count int        `json:"count"`
	Data  []*Segment `json:"data,omitempty"`
}

type Share

type Share struct {
	ID string `json:"id" bson:"_id"`
}

func (Share) IsEntity

func (Share) IsEntity()

type Term

type Term struct {
	ID string `json:"id" bson:"_id"`
}

func (Term) IsEntity

func (Term) IsEntity()

type UpdateAudience

type UpdateAudience struct {
	Name        *string                `json:"name,omitempty"`
	Description *string                `json:"description,omitempty"`
	Segment     *SegmentInput          `json:"segment,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

type UpdateCampaign

type UpdateCampaign struct {
	Audience *string                `json:"audience,omitempty"`
	Slug     *string                `json:"slug,omitempty"`
	Type     *CampaignType          `json:"type,omitempty"`
	Name     *string                `json:"name,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}
type UpdateLink struct {
	Domain      *string                `json:"domain,omitempty"`
	Code        *string                `json:"code,omitempty"`
	URL         *string                `json:"url,omitempty"`
	Title       *string                `json:"title,omitempty"`
	Destination *string                `json:"destination,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      *string                `json:"status,omitempty"`
}

type User

type User struct {
	ID string `json:"id" bson:"_id"`
}

func (User) IsEntity

func (User) IsEntity()

Jump to

Keyboard shortcuts

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