Documentation ¶
Index ¶
- func NewChannel(uuid assets.ChannelUUID, name string, address string, schemes []string, ...) assets.Channel
- func NewField(key string, name string, valueType assets.FieldType) assets.Field
- func NewGroup(uuid assets.GroupUUID, name string, query string) assets.Group
- func NewLabel(uuid assets.LabelUUID, name string) assets.Label
- func NewResthook(slug string, subscribers []string) assets.Resthook
- func NewTelChannel(uuid assets.ChannelUUID, name string, address string, ...) assets.Channel
- type Channel
- func (c *Channel) Address() string
- func (c *Channel) Country() string
- func (c *Channel) MatchPrefixes() []string
- func (c *Channel) Name() string
- func (c *Channel) Parent() *assets.ChannelReference
- func (c *Channel) Roles() []assets.ChannelRole
- func (c *Channel) Schemes() []string
- func (c *Channel) UUID() assets.ChannelUUID
- type Field
- type Flow
- type Group
- type Label
- type Resthook
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 NewResthook ¶
NewResthook creates a new resthook
func NewTelChannel ¶
func NewTelChannel(uuid assets.ChannelUUID, name string, address string, roles []assets.ChannelRole, parent *assets.ChannelReference, country string, matchPrefixes []string) assets.Channel
NewTelChannel creates a new tel channel
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_ string `json:"country,omitempty"` MatchPrefixes_ []string `json:"match_prefixes,omitempty"` }
Channel is a JSON serializable implementation of a channel asset
func (*Channel) MatchPrefixes ¶
MatchPrefixes returns this channel's match prefixes values used for selecting a channel for a URN (if any)
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) UUID ¶
func (c *Channel) UUID() assets.ChannelUUID
UUID returns the UUID of this channel
type Field ¶
type Field struct { Key_ string `json:"key" validate:"required"` Name_ string `json:"name"` Type_ assets.FieldType `json:"value_type" validate:"required"` }
Field is a JSON serializable implementation of a field asset
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) UnmarshalJSON ¶
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
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
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) Subscribers ¶
Subscribers returns the subscribers to the resthook