types

package
v0.88.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChannel

func NewChannel(uuid assets.ChannelUUID, name string, address string, schemes []string, roles []assets.ChannelRole, parent *assets.ChannelReference) assets.Channel

NewChannel creates a new channel

func NewClassifier added in v0.51.0

func NewClassifier(uuid assets.ClassifierUUID, name string, type_ string, intents []string) assets.Classifier

NewClassifier creates a new classifier

func NewField

func NewField(uuid assets.FieldUUID, key string, name string, valueType assets.FieldType) assets.Field

NewField creates a new field from the passed in key, name and type

func NewGlobal added in v0.57.0

func NewGlobal(key, name, value string) assets.Global

NewGlobal creates a new global

func NewGroup

func NewGroup(uuid assets.GroupUUID, name string, query string) assets.Group

NewGroup creates a new group from the passed in UUID, name and query

func NewLabel

func NewLabel(uuid assets.LabelUUID, name string) assets.Label

NewLabel creates a new label from the passed in UUID and name

func NewResthook

func NewResthook(slug string, subscribers []string) assets.Resthook

NewResthook creates a new resthook

func NewTelChannel

func NewTelChannel(uuid assets.ChannelUUID, name string, address string, roles []assets.ChannelRole, parent *assets.ChannelReference, country envs.Country, matchPrefixes []string, allowInternational bool) assets.Channel

NewTelChannel creates a new tel channel

func NewTicketer added in v0.86.0

func NewTicketer(uuid assets.TicketerUUID, name string, type_ string) assets.Ticketer

NewTicketer creates a new ticketer

Types

type Channel

type Channel struct {
	UUID_               assets.ChannelUUID       `json:"uuid" validate:"required,uuid"`
	Name_               string                   `json:"name"`
	Address_            string                   `json:"address"`
	Schemes_            []string                 `json:"schemes" validate:"min=1"`
	Roles_              []assets.ChannelRole     `json:"roles" validate:"min=1,dive,eq=send|eq=receive|eq=call|eq=answer|eq=ussd"`
	Parent_             *assets.ChannelReference `json:"parent" validate:"omitempty,dive"`
	Country_            envs.Country             `json:"country,omitempty"`
	MatchPrefixes_      []string                 `json:"match_prefixes,omitempty"`
	AllowInternational_ bool                     `json:"allow_international,omitempty"`
}

Channel is a JSON serializable implementation of a channel asset

func (*Channel) Address

func (c *Channel) Address() string

Address returns the address of this channel

func (*Channel) AllowInternational added in v0.71.0

func (c *Channel) AllowInternational() bool

AllowInternational returns whether this channel allows sending internationally (only applies to TEL schemes)

func (*Channel) Country

func (c *Channel) Country() envs.Country

Country returns this channel's associated country code (if any)

func (*Channel) MatchPrefixes

func (c *Channel) MatchPrefixes() []string

MatchPrefixes returns this channel's match prefixes values used for selecting a channel for a URN (if any)

func (*Channel) Name

func (c *Channel) Name() string

Name returns the name of this channel

func (*Channel) Parent

func (c *Channel) Parent() *assets.ChannelReference

Parent returns a reference to this channel's parent (if any)

func (*Channel) Roles

func (c *Channel) Roles() []assets.ChannelRole

Roles returns the roles of this channel

func (*Channel) Schemes

func (c *Channel) Schemes() []string

Schemes returns the supported schemes of this channel

func (*Channel) UUID

func (c *Channel) UUID() assets.ChannelUUID

UUID returns the UUID of this channel

type Classifier added in v0.51.0

type Classifier struct {
	UUID_    assets.ClassifierUUID `json:"uuid" validate:"required,uuid"`
	Name_    string                `json:"name"`
	Type_    string                `json:"type"`
	Intents_ []string              `json:"intents"`
}

Classifier is a JSON serializable implementation of a classifier asset

func (*Classifier) Intents added in v0.51.0

func (c *Classifier) Intents() []string

Intents returns the intents of this classifier

func (*Classifier) Name added in v0.51.0

func (c *Classifier) Name() string

Name returns the name of this channel

func (*Classifier) Type added in v0.51.0

func (c *Classifier) Type() string

Type returns the type of this classifier

func (*Classifier) UUID added in v0.51.0

func (c *Classifier) UUID() assets.ClassifierUUID

UUID returns the UUID of this channel

type Field

type Field struct {
	UUID_ assets.FieldUUID `json:"uuid"`
	Key_  string           `json:"key" validate:"required"`
	Name_ string           `json:"name"`
	Type_ assets.FieldType `json:"type" validate:"required"`
}

Field is a JSON serializable implementation of a field asset

func (*Field) Key

func (f *Field) Key() string

Key returns the unique key of the field

func (*Field) Name

func (f *Field) Name() string

Name returns the name of the field

func (*Field) Type

func (f *Field) Type() assets.FieldType

Type returns the value type of the field

func (*Field) UUID added in v0.46.0

func (f *Field) UUID() assets.FieldUUID

UUID returns the UUID of this field

type Flow

type Flow struct {
	UUID_       assets.FlowUUID `json:"uuid" validate:"required,uuid4"`
	Name_       string          `json:"name"`
	Definition_ json.RawMessage
}

Flow is a JSON serializable implementation of a flow asset

func (*Flow) Definition

func (f *Flow) Definition() json.RawMessage

func (*Flow) Name

func (f *Flow) Name() string

Name returns the name of the flow

func (*Flow) UUID

func (f *Flow) UUID() assets.FlowUUID

UUID returns the UUID of the flow

func (*Flow) UnmarshalJSON

func (f *Flow) UnmarshalJSON(data []byte) error

type Global added in v0.57.0

type Global struct {
	Key_   string `json:"key" validate:"required"`
	Name_  string `json:"name"`
	Value_ string `json:"value"`
}

Global is a JSON serializable implementation of a global asset

func (*Global) Key added in v0.57.0

func (g *Global) Key() string

Key returns the key of this global

func (*Global) Name added in v0.57.0

func (g *Global) Name() string

Name returns the name of this global

func (*Global) Value added in v0.57.0

func (g *Global) Value() string

Value returns the type of this global

type Group

type Group struct {
	UUID_  assets.GroupUUID `json:"uuid" validate:"required,uuid4"`
	Name_  string           `json:"name"`
	Query_ string           `json:"query,omitempty"`
}

Group is a JSON serializable implementation of a group asset

func (*Group) Name

func (g *Group) Name() string

Name returns the name of the group

func (*Group) Query

func (g *Group) Query() string

Query returns the query of a dynamic group

func (*Group) UUID

func (g *Group) UUID() assets.GroupUUID

UUID returns the UUID of the group

type Label

type Label struct {
	UUID_ assets.LabelUUID `json:"uuid" validate:"required,uuid4"`
	Name_ string           `json:"name"`
}

Label is a JSON serializable implementation of a label asset

func (*Label) Name

func (l *Label) Name() string

Name returns the name of the label

func (*Label) UUID

func (l *Label) UUID() assets.LabelUUID

UUID returns the UUID of the label

type Resthook

type Resthook struct {
	Slug_        string   `json:"slug" validate:"required"`
	Subscribers_ []string `json:"subscribers" validate:"required,dive,url"`
}

Resthook is a JSON serializable implementation of a resthook asset

func (*Resthook) Slug

func (r *Resthook) Slug() string

Slug returns the slug of the resthook

func (*Resthook) Subscribers

func (r *Resthook) Subscribers() []string

Subscribers returns the subscribers to the resthook

type Template added in v0.32.0

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

Template is a JSON serializable implementation of a template asset

func NewTemplate added in v0.32.0

func NewTemplate(uuid assets.TemplateUUID, name string, translations []*TemplateTranslation) *Template

NewTemplate creates a new template

func (*Template) MarshalJSON added in v0.32.0

func (t *Template) MarshalJSON() ([]byte, error)

MarshalJSON is our marshaller for json data

func (*Template) Name added in v0.32.0

func (t *Template) Name() string

Name returns the name of this template

func (*Template) Translations added in v0.32.0

func (t *Template) Translations() []assets.TemplateTranslation

Translations returns the translations for this template

func (*Template) UUID added in v0.32.0

func (t *Template) UUID() assets.TemplateUUID

UUID returns the UUID of this template

func (*Template) UnmarshalJSON added in v0.32.0

func (t *Template) UnmarshalJSON(data []byte) error

UnmarshalJSON is our unmarshaller for json data

type TemplateTranslation added in v0.32.0

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

TemplateTranslation represents a single template translation

func NewTemplateTranslation added in v0.32.0

func NewTemplateTranslation(channel assets.ChannelReference, language envs.Language, content string, variableCount int) *TemplateTranslation

NewTemplateTranslation creates a new template translation

func (*TemplateTranslation) Channel added in v0.32.0

Channel returns the channel this template translation is for

func (*TemplateTranslation) Content added in v0.32.0

func (t *TemplateTranslation) Content() string

Content returns the translated content for this template

func (*TemplateTranslation) Language added in v0.32.0

func (t *TemplateTranslation) Language() envs.Language

Language returns the language this translation is in

func (*TemplateTranslation) MarshalJSON added in v0.32.0

func (t *TemplateTranslation) MarshalJSON() ([]byte, error)

MarshalJSON is our marshaller for json data

func (*TemplateTranslation) UnmarshalJSON added in v0.32.0

func (t *TemplateTranslation) UnmarshalJSON(data []byte) error

UnmarshalJSON is our unmarshaller for json data

func (*TemplateTranslation) VariableCount added in v0.32.0

func (t *TemplateTranslation) VariableCount() int

VariableCount returns the number of variables in this template

type Ticketer added in v0.86.0

type Ticketer struct {
	UUID_ assets.TicketerUUID `json:"uuid" validate:"required,uuid"`
	Name_ string              `json:"name"`
	Type_ string              `json:"type"`
}

Ticketer is a JSON serializable implementation of a ticketer asset

func (*Ticketer) Name added in v0.86.0

func (t *Ticketer) Name() string

Name returns the name of this ticketer

func (*Ticketer) Type added in v0.86.0

func (t *Ticketer) Type() string

Type returns the type of this ticketer

func (*Ticketer) UUID added in v0.86.0

func (t *Ticketer) UUID() assets.TicketerUUID

UUID returns the UUID of this ticketer

Jump to

Keyboard shortcuts

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