Documentation ¶
Index ¶
- Constants
- type Headers
- type Installation
- type InstallationChange
- func AddSecondaryTile(name string, secondaryTile InstallationSecondaryTile) InstallationChange
- func AddSecondaryTileTag(name, tag string) InstallationChange
- func AddSecondaryTileTemplate(name, templateName string, template InstallationTemplate) InstallationChange
- func AddTag(tag string) InstallationChange
- func AddTemplate(name string, template InstallationTemplate) InstallationChange
- func AddTemplateTag(name, tag string) InstallationChange
- func RemoveSecondaryTile(name string) InstallationChange
- func RemoveSecondaryTileTag(name, tag string) InstallationChange
- func RemoveSecondaryTileTemplate(name, template string) InstallationChange
- func RemoveTag(tag string) InstallationChange
- func RemoveTemplate(name string) InstallationChange
- func RemoveTemplateTag(name, tag string) InstallationChange
- func SetPushChannel(pushChannel string) InstallationChange
- func SetSecondaryTilePushChannel(name, pushChannel string) InstallationChange
- func SetSecondaryTileTags(name string, tags ...string) InstallationChange
- func SetSecondaryTileTemplateBody(name, template, body string) InstallationChange
- func SetSecondaryTileTemplateHeaders(name, template string, headers map[string]string) InstallationChange
- func SetSecondaryTileTemplateTags(name, template string, tags ...string) InstallationChange
- func SetSecondaryTileTemplates(name string, templates map[string]InstallationTemplate) InstallationChange
- func SetSecondaryTiles(secondaryTiles map[string]InstallationSecondaryTile) InstallationChange
- func SetTags(tags ...string) InstallationChange
- func SetTemplateBody(name, body string) InstallationChange
- func SetTemplateHeaders(name string, headers map[string]string) InstallationChange
- func SetTemplateTags(name string, tags ...string) InstallationChange
- func SetTemplates(templates map[string]InstallationTemplate) InstallationChange
- type InstallationChangeOp
- type InstallationPlatform
- type InstallationSecondaryTile
- type InstallationTemplate
- type Notification
- type NotificationDetails
- type NotificationFormat
- type NotificationHub
- func (h *NotificationHub) Install(ctx context.Context, installation Installation) (err error)
- func (h *NotificationHub) Installation(ctx context.Context, installationID string) (raw []byte, installation *Installation, err error)
- func (h *NotificationHub) NotificationDetails(ctx context.Context, notificationID string) (details *NotificationDetails, raw []byte, err error)
- func (h *NotificationHub) Register(ctx context.Context, r Registration) (raw []byte, registrationResult *RegistrationResult, err error)
- func (h *NotificationHub) RegisterWithTemplate(ctx context.Context, r TemplateRegistration) (raw []byte, registrationResult *RegistrationResult, err error)
- func (h *NotificationHub) Registration(ctx context.Context, registrationID string) (raw []byte, registrationResult *RegistrationResult, err error)
- func (h *NotificationHub) Registrations(ctx context.Context) (raw []byte, registrations *Registrations, err error)
- func (h *NotificationHub) Schedule(ctx context.Context, n *Notification, tags *string, deliverTime time.Time) (raw []byte, telemetry *NotificationTelemetry, err error)
- func (h *NotificationHub) Send(ctx context.Context, n *Notification, tags *string) (raw []byte, telemetry *NotificationTelemetry, err error)
- func (h *NotificationHub) SendDirect(ctx context.Context, n *Notification, deviceHandle string) (raw []byte, telemetry *NotificationTelemetry, err error)
- func (h *NotificationHub) SendDirectBatch(ctx context.Context, n *Notification, deviceHandles ...string) (raw []byte, telemetry *NotificationTelemetry, err error)
- func (h *NotificationHub) SetExpirationTimeGenerator(e utils.ExpirationTimeGenerator)
- func (h *NotificationHub) SetHTTPClient(c utils.HTTPClient)
- func (h *NotificationHub) Uninstall(ctx context.Context, installationID string) (err error)
- func (h *NotificationHub) Unregister(ctx context.Context, registration RegisteredDevice) (err error)
- func (h *NotificationHub) Update(ctx context.Context, installationID string, changes ...InstallationChange) (err error)
- type NotificationOutcome
- type NotificationOutcomeName
- type NotificationOutcomes
- type NotificationState
- type NotificationTelemetry
- type RegisteredDevice
- type Registration
- type RegistrationContent
- type RegistrationResult
- type Registrations
- type TargetPlatform
- type TemplateRegistration
Constants ¶
const ( Template NotificationFormat = "template" AppleFormat NotificationFormat = "apple" BaiduFormat NotificationFormat = "baidu" GcmFormat NotificationFormat = "gcm" KindleFormat NotificationFormat = "adm" WindowsFormat NotificationFormat = "windows" WindowsPhoneFormat NotificationFormat = "windowsphone" AdmPlatform TargetPlatform = "adm" AdmTemplatePlatform TargetPlatform = "admtemplate" ApplePlatform TargetPlatform = "apple" AppleTemplatePlatform TargetPlatform = "appletemplate" BaiduPlatform TargetPlatform = "baidu" BaiduTemplatePlatform TargetPlatform = "baidutemplate" GcmPlatform TargetPlatform = "gcm" GcmTemplatePlatform TargetPlatform = "gcmtemplate" TemplatePlatform TargetPlatform = "template" WindowsphonePlatform TargetPlatform = "windowsphone" WindowsphoneTemplatePlatform TargetPlatform = "windowsphonetemplate" WindowsPlatform TargetPlatform = "windows" WindowsTemplatePlatform TargetPlatform = "windowstemplate" APNSPlatform InstallationPlatform = "apns" WNSPlatform InstallationPlatform = "wns" MPNSPlatform InstallationPlatform = "mpns" ADMPlatform InstallationPlatform = "adm" GCMPlatform InstallationPlatform = "gcm" InstallationChangeAdd InstallationChangeOp = "add" InstallationChangeRemove InstallationChangeOp = "remove" InstallationChangeReplace InstallationChangeOp = "replace" // Abandoned: Message processing has been abandoned. // It will happen when the message could not be processed within the acceptable time window. // By default, it's 30 minutes. Abandoned NotificationState = "Abandoned" // Canceled: This scheduled message was canceled by user. Canceled NotificationState = "Canceled" // Completed: Message processing has completed. Completed NotificationState = "Completed" // Enqueued: Message has been accepted but processing has not yet begun. Enqueued NotificationState = "Enqueued" // NoTargetFound: No devices were found to send this message. NoTargetFound NotificationState = "NoTargetFound" // Processing: Message processing has started. Processing NotificationState = "Processing" // Scheduled: Message is in queue and will be sent on the scheduled time. Scheduled NotificationState = "Scheduled" // Unknown: Message processing is in an unknown state. Unknown NotificationState = "Unknown" // AbandonedNotificationMessages: Count of send requests to push service that were dropped because of a timeout. AbandonedNotificationMessages NotificationOutcomeName = "AbandonedNotificationMessages" // BadChannel: Communication to the push service failed because the channel was invalid. BadChannel NotificationOutcomeName = "BadChannel" // ChannelDisconnected: Push service disconnected. ChannelDisconnected NotificationOutcomeName = "ChannelDisconnected" // ChannelThrottled: Push service denied access due to throttling. ChannelThrottled NotificationOutcomeName = "ChannelThrottled" // Dropped: Push service indicates that the message was dropped. Dropped NotificationOutcomeName = "Dropped" // ExpiredChannel: Communication to the push service failed because the channel expired. ExpiredChannel NotificationOutcomeName = "ExpiredChannel" // InvalidCredentials: Credentials used to authenticate to the push service failed. InvalidCredentials NotificationOutcomeName = "InvalidCredentials" // InvalidNotificationSize: Push request is too large. InvalidNotificationSize NotificationOutcomeName = "InvalidNotificationSize" // NoTargets: Count of requests that found nothing to send to. NoTargets NotificationOutcomeName = "NoTargets" // PnsInterfaceError: Push service contract communication failed. PnsInterfaceError NotificationOutcomeName = "PnsInterfaceError" // PnsServerError: Push service indicated that an error happened on their side. PnsServerError NotificationOutcomeName = "PnsServerError" PnsUnavailable NotificationOutcomeName = "PnsUnavailable" // PnsUnreachable: Push service was unresponsive. PnsUnreachable NotificationOutcomeName = "PnsUnreachable" // Skipped: Count of duplicate registrations (same PNS handle found, different registration ID). Skipped NotificationOutcomeName = "Skipped" // Success: Successfully sent the request to some number of devices. Success NotificationOutcomeName = "Success" // Throttled: Push service denied access due to throttling. Throttled NotificationOutcomeName = "Throttled" // UnknownError: An unknown error happened. UnknownError NotificationOutcomeName = "UnknownError" // WrongToken: The PNS handle was not recognized by the PNS as a valid handle. WrongToken NotificationOutcomeName = "WrongToken" )
Public constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Installation ¶
type Installation struct { InstallationID string `json:"installationId,omitempty"` LastActiveOn *time.Time `json:"lastActiveOn,omitempty"` ExpirationTime *time.Time `json:"expirationTime,omitempty"` LastUpdate *time.Time `json:"lastUpdate,omitempty"` Platform InstallationPlatform `json:"platform,omitempty"` PushChannel string `json:"pushChannel,omitempty"` ExpiredPushChannel bool `json:"expiredPushChannel,omitempty"` Tags []string `json:"tags,omitempty"` Templates map[string]InstallationTemplate `json:"templates,omitempty"` SecondaryTiles map[string]InstallationSecondaryTile `json:"secondaryTiles,omitempty"` }
Installation is a device installation in the hub
type InstallationChange ¶
type InstallationChange struct { Op InstallationChangeOp `json:"op,omitempty"` Path string `json:"path,omitempty"` Value string `json:"value,omitempty"` }
InstallationChange is a device installation change
func AddSecondaryTile ¶
func AddSecondaryTile(name string, secondaryTile InstallationSecondaryTile) InstallationChange
AddSecondaryTile adds a secondary tile to the installation Deprecated: doesn't appear to be supported
func AddSecondaryTileTag ¶
func AddSecondaryTileTag(name, tag string) InstallationChange
AddSecondaryTileTag adds a tag to a secondary tile in the installation
func AddSecondaryTileTemplate ¶
func AddSecondaryTileTemplate(name, templateName string, template InstallationTemplate) InstallationChange
AddSecondaryTileTemplate adds a template to the installation
func AddTemplate ¶
func AddTemplate(name string, template InstallationTemplate) InstallationChange
AddTemplate adds a template to the installation
func AddTemplateTag ¶
func AddTemplateTag(name, tag string) InstallationChange
AddTemplateTag adds a tag to a template in the installation
func RemoveSecondaryTile ¶
func RemoveSecondaryTile(name string) InstallationChange
RemoveSecondaryTile removes a secondary tile from the installation Deprecated: doesn't appear to be supported
func RemoveSecondaryTileTag ¶
func RemoveSecondaryTileTag(name, tag string) InstallationChange
RemoveSecondaryTileTag removes a tag from a secondary tile in the installation
func RemoveSecondaryTileTemplate ¶
func RemoveSecondaryTileTemplate(name, template string) InstallationChange
RemoveSecondaryTileTemplate removes a template from the installation
func RemoveTag ¶
func RemoveTag(tag string) InstallationChange
RemoveTag removes a tag from the installation
func RemoveTemplate ¶
func RemoveTemplate(name string) InstallationChange
RemoveTemplate removes a template from the installation
func RemoveTemplateTag ¶
func RemoveTemplateTag(name, tag string) InstallationChange
RemoveTemplateTag removes a tag from a template in the installation
func SetPushChannel ¶
func SetPushChannel(pushChannel string) InstallationChange
SetPushChannel sets the installation push channel
func SetSecondaryTilePushChannel ¶
func SetSecondaryTilePushChannel(name, pushChannel string) InstallationChange
SetSecondaryTilePushChannel sets the push channel on a secondary tile in the installation
func SetSecondaryTileTags ¶
func SetSecondaryTileTags(name string, tags ...string) InstallationChange
SetSecondaryTileTags sets the tags on a secondary tile in the installation
func SetSecondaryTileTemplateBody ¶
func SetSecondaryTileTemplateBody(name, template, body string) InstallationChange
SetSecondaryTileTemplateBody sets the body on a template in the installation
func SetSecondaryTileTemplateHeaders ¶
func SetSecondaryTileTemplateHeaders(name, template string, headers map[string]string) InstallationChange
SetSecondaryTileTemplateHeaders sets the headers on a template in the installation
func SetSecondaryTileTemplateTags ¶
func SetSecondaryTileTemplateTags(name, template string, tags ...string) InstallationChange
SetSecondaryTileTemplateTags sets the tags on a template in the installation
func SetSecondaryTileTemplates ¶
func SetSecondaryTileTemplates(name string, templates map[string]InstallationTemplate) InstallationChange
SetSecondaryTileTemplates sets the installation templates
func SetSecondaryTiles ¶
func SetSecondaryTiles(secondaryTiles map[string]InstallationSecondaryTile) InstallationChange
SetSecondaryTiles sets the installation secondary tiles Deprecated: doesn't appear to be supported
func SetTemplateBody ¶
func SetTemplateBody(name, body string) InstallationChange
SetTemplateBody sets the body on a template in the installation
func SetTemplateHeaders ¶
func SetTemplateHeaders(name string, headers map[string]string) InstallationChange
SetTemplateHeaders sets the headers on a template in the installation
func SetTemplateTags ¶
func SetTemplateTags(name string, tags ...string) InstallationChange
SetTemplateTags sets the tags on a template in the installation
func SetTemplates ¶
func SetTemplates(templates map[string]InstallationTemplate) InstallationChange
SetTemplates sets the installation templates Deprecated: doesn't appear to be supported
type InstallationChangeOp ¶
type InstallationChangeOp string
InstallationChangeOp is the installation change operation
type InstallationPlatform ¶
type InstallationPlatform string
InstallationPlatform is the installation platform
type InstallationSecondaryTile ¶
type InstallationSecondaryTile struct { PushChannel string `json:"pushChannel,omitempty"` Tags []string `json:"tags,omitempty"` Templates map[string]InstallationTemplate `json:"templates,omitempty"` }
InstallationSecondaryTile is a device installation secondary tile
type InstallationTemplate ¶
type InstallationTemplate struct { Body string `json:"body,omitempty"` Headers map[string]string `json:"headers,omitempty"` Expiry *time.Time `json:"expiry,omitempty"` Tags []string `json:"tags,omitempty"` }
InstallationTemplate is a device installation template
type Notification ¶
type Notification struct { Format NotificationFormat Payload []byte }
Notification is a message that can be sent through the hub
func NewNotification ¶
func NewNotification(format NotificationFormat, payload []byte) (*Notification, error)
NewNotification initializes and returns Notification pointer
func (*Notification) String ¶
func (n *Notification) String() string
String returns Notification string representation
type NotificationDetails ¶
type NotificationDetails struct { ID string `xml:"NotificationId"` State NotificationState `xml:"State"` EnqueueTime string `xml:"EnqueueTime"` StartTime string `xml:"StartTime"` EndTime string `xml:"EndTime"` Body string `xml:"NotificationBody"` TargetPlatforms string `xml:"TargetPlatforms"` ApnsOutcomeCounts *NotificationOutcomes `xml:"ApnsOutcomeCounts"` GcmOutcomeCounts *NotificationOutcomes `xml:"GcmOutcomeCounts"` }
NotificationDetails is the detailed information about a sent or scheduled message
type NotificationFormat ¶
type NotificationFormat string
NotificationFormat is the format of a notification
func (NotificationFormat) GetContentType ¶
func (f NotificationFormat) GetContentType() string
GetContentType returns Content-Type associated with NotificationFormat
func (NotificationFormat) IsValid ¶
func (f NotificationFormat) IsValid() bool
IsValid identifies whether notification format is valid
type NotificationHub ¶
type NotificationHub struct { SasKeyValue string SasKeyName string HubURL *url.URL // contains filtered or unexported fields }
NotificationHub is a client for sending messages through Azure Notification Hubs
func NewNotificationHub ¶
func NewNotificationHub(connectionString, hubPath string) *NotificationHub
NewNotificationHub initializes and returns NotificationHub pointer
func (*NotificationHub) Install ¶
func (h *NotificationHub) Install(ctx context.Context, installation Installation) (err error)
Install sends a device installation to the Azure hub
func (*NotificationHub) Installation ¶
func (h *NotificationHub) Installation(ctx context.Context, installationID string) (raw []byte, installation *Installation, err error)
Installation reads one specific installation
func (*NotificationHub) NotificationDetails ¶
func (h *NotificationHub) NotificationDetails(ctx context.Context, notificationID string) (details *NotificationDetails, raw []byte, err error)
NotificationDetails reads one specific registration
func (*NotificationHub) Register ¶
func (h *NotificationHub) Register(ctx context.Context, r Registration) (raw []byte, registrationResult *RegistrationResult, err error)
Register sends a device registration to the Azure hub
func (*NotificationHub) RegisterWithTemplate ¶
func (h *NotificationHub) RegisterWithTemplate(ctx context.Context, r TemplateRegistration) (raw []byte, registrationResult *RegistrationResult, err error)
RegisterWithTemplate sends a device registration with template to the Azure hub
func (*NotificationHub) Registration ¶
func (h *NotificationHub) Registration(ctx context.Context, registrationID string) (raw []byte, registrationResult *RegistrationResult, err error)
Registration reads one specific registration
func (*NotificationHub) Registrations ¶
func (h *NotificationHub) Registrations(ctx context.Context) (raw []byte, registrations *Registrations, err error)
Registrations reads all registrations
func (*NotificationHub) Schedule ¶
func (h *NotificationHub) Schedule(ctx context.Context, n *Notification, tags *string, deliverTime time.Time) (raw []byte, telemetry *NotificationTelemetry, err error)
Schedule publishes a scheduled notification Format tags according to https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-tags-segment-push-message or nil if no tags should be used
func (*NotificationHub) Send ¶
func (h *NotificationHub) Send(ctx context.Context, n *Notification, tags *string) (raw []byte, telemetry *NotificationTelemetry, err error)
Send publishes notification directly Format tags according to https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-tags-segment-push-message ex. "(follows_RedSox || follows_Cardinals) && location_Boston" or nil if no tags should be used
func (*NotificationHub) SendDirect ¶
func (h *NotificationHub) SendDirect(ctx context.Context, n *Notification, deviceHandle string) (raw []byte, telemetry *NotificationTelemetry, err error)
SendDirect publishes notification to a specific device
func (*NotificationHub) SendDirectBatch ¶
func (h *NotificationHub) SendDirectBatch(ctx context.Context, n *Notification, deviceHandles ...string) (raw []byte, telemetry *NotificationTelemetry, err error)
SendDirectBatch publishes notification to a collection of devices
func (*NotificationHub) SetExpirationTimeGenerator ¶
func (h *NotificationHub) SetExpirationTimeGenerator(e utils.ExpirationTimeGenerator)
SetExpirationTimeGenerator makes is possible to use a custom generator
func (*NotificationHub) SetHTTPClient ¶
func (h *NotificationHub) SetHTTPClient(c utils.HTTPClient)
SetHTTPClient makes it possible to use a custom http client
func (*NotificationHub) Uninstall ¶
func (h *NotificationHub) Uninstall(ctx context.Context, installationID string) (err error)
Uninstall sends a device installation delete to the Azure hub
func (*NotificationHub) Unregister ¶
func (h *NotificationHub) Unregister(ctx context.Context, registration RegisteredDevice) (err error)
Unregister sends a device registration delete to the Azure hub
func (*NotificationHub) Update ¶
func (h *NotificationHub) Update(ctx context.Context, installationID string, changes ...InstallationChange) (err error)
Update sends a collection of installation changes to the Azure hub
type NotificationOutcome ¶
type NotificationOutcome struct { Name NotificationOutcomeName `xml:"Name"` Count int `xml:"Count"` }
NotificationOutcome name value pair for statistics
type NotificationOutcomeName ¶
type NotificationOutcomeName string
NotificationOutcomeName is a possible outcome of a notification
type NotificationOutcomes ¶
type NotificationOutcomes struct {
Outcomes []NotificationOutcome `xml:"Outcome"`
}
NotificationOutcomes array of outcomes
type NotificationState ¶
type NotificationState string
NotificationState is the state of the notification
type NotificationTelemetry ¶
type NotificationTelemetry struct {
NotificationMessageID string `json:"notificationMessageID,omitempty"`
}
NotificationTelemetry is the id of a sent or scheduled message
func NewNotificationTelemetryFromHTTPResponse ¶
func NewNotificationTelemetryFromHTTPResponse(response *http.Response) (*NotificationTelemetry, error)
NewNotificationTelemetryFromHTTPResponse reads the Location header from URL Notification Telemetry is only available for Standard tier Notification Hubs.
func NewNotificationTelemetryFromLocationURL ¶
func NewNotificationTelemetryFromLocationURL(url string) *NotificationTelemetry
NewNotificationTelemetryFromLocationURL create Telemetry from Location URL
type RegisteredDevice ¶
type RegisteredDevice struct { DeviceID string `xml:"-" json:"deviceID,omitempty"` ETag string `xml:"ETag" json:"eTag,omitempty"` ExpirationTime *time.Time `xml:"-" json:"expirationTime,omitempty"` Template string `xml:"BodyTemplate" json:"template,omitempty"` RegistrationID string `xml:"RegistrationId" json:"registrationID,omitempty"` Tags []string `xml:"-" json:"tags,omitempty"` DeviceToken *string `xml:"DeviceToken" json:"-"` ExpirationTimeString *string `xml:"ExpirationTime" json:"-"` GcmRegistrationID *string `xml:"GcmRegistrationId" json:"-"` TagsString *string `xml:"Tags" json:"-"` }
RegisteredDevice is a device registration to the hub
type Registration ¶
type Registration struct { DeviceID string `json:"deviceID,omitempty"` ExpirationTime *time.Time `json:"expirationTime,omitempty"` NotificationFormat NotificationFormat `json:"service,omitempty"` RegistrationID string `json:"registrationID,omitempty"` Tags string `json:"tags,omitempty"` }
Registration is a device registration to the hub
func NewRegistration ¶
func NewRegistration(deviceID string, expirationTime *time.Time, notificationFormat NotificationFormat, registrationID string, tags string) *Registration
NewRegistration initializes and returns a Notification pointer
type RegistrationContent ¶
type RegistrationContent struct { Format NotificationFormat `xml:"-" json:"format,omitempty"` Target TargetPlatform `xml:"-" json:"target,omitempty"` RegisteredDevice *RegisteredDevice `xml:"-" json:"registeredDevice,omitempty"` AppleRegistrationDescription *RegisteredDevice `xml:"AppleRegistrationDescription" json:"-"` AppleTemplateRegistrationDescription *RegisteredDevice `xml:"AppleTemplateRegistrationDescription" json:"-"` GcmRegistrationDescription *RegisteredDevice `xml:"GcmRegistrationDescription" json:"-"` GcmTemplateRegistrationDescription *RegisteredDevice `xml:"GcmTemplateRegistrationDescription" json:"-"` }
RegistrationContent is information about a specific device registration
type RegistrationResult ¶
type RegistrationResult struct { ID string `xml:"id" json:"id,omitempty"` Published *time.Time `xml:"published" json:"published,omitempty"` RegistrationContent *RegistrationContent `xml:"content" json:"content,omitempty"` Title string `xml:"title" json:"title,omitempty"` Updated *time.Time `xml:"updated" json:"updated,omitempty"` }
RegistrationResult is the response from registration
type Registrations ¶
type Registrations struct { ID string `xml:"id" json:"id,omitempty"` Title string `xml:"title" json:"title,omitempty"` Updated *time.Time `xml:"updated" json:"updated,omitempty"` Entries []RegistrationResult `xml:"entry" json:"entries,omitempty"` }
Registrations is a list of RegistrationResults
type TargetPlatform ¶
type TargetPlatform string
TargetPlatform is the specific platform
func (TargetPlatform) IsValid ¶
func (f TargetPlatform) IsValid() bool
IsValid identifies whether target is valid
type TemplateRegistration ¶
type TemplateRegistration struct { DeviceID string `json:"deviceID,omitempty"` ExpirationTime *time.Time `json:"expirationTime,omitempty"` RegistrationID string `json:"registrationID,omitempty"` Tags string `json:"tags,omitempty"` Platform TargetPlatform `json:"platform,omitempty"` Template string `json:"template,omitempty"` }
TemplateRegistration is a device registration to the hub supporting a template
func NewTemplateRegistration ¶
func NewTemplateRegistration(deviceID string, expirationTime *time.Time, registrationID string, tags string, platform TargetPlatform, template string) *TemplateRegistration
NewTemplateRegistration initializes and returns a TemplateNotification pointer