pushnotificationsv1

package
v0.0.0-...-411f466 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pushnotificationsv1 : Operations and models for the PushNotificationsV1 service

Index

Constants

View Source
const DefaultServiceName = "push_notifications"

DefaultServiceName is the default key used to find external configuration information.

Variables

This section is empty.

Functions

func UnmarshalMessage

func UnmarshalMessage(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalMessage unmarshals an instance of Message from the specified map of raw messages.

func UnmarshalSendMessageBody

func UnmarshalSendMessageBody(m map[string]json.RawMessage, result interface{}) (err error)

UnmarshalSendMessageBody unmarshals an instance of SendMessageBody from the specified map of raw messages.

Types

type Message

type Message struct {
	// The notification message to be shown to the user.
	Alert *string `json:"alert" validate:"required"`
}

Message : Message struct

type PushNotificationsV1

type PushNotificationsV1 struct {
	Service *core.BaseService
}

PushNotificationsV1 : The IBM® Cloud Push Notifications service provides a unified push service to send real-time notifications to mobile and web applications.

Version: 1.0.0 See: https://cloud.ibm.com/docs/mobilepush?topic=mobilepush-getting-started

func NewPushNotificationsV1

func NewPushNotificationsV1(options *PushNotificationsV1Options) (service *PushNotificationsV1, err error)

NewPushNotificationsV1 : constructs an instance of PushNotificationsV1 with passed in options.

func (*PushNotificationsV1) NewMessage

func (*PushNotificationsV1) NewMessage(alert string) (model *Message, err error)

NewMessage : Instantiate Message (Generic Model Constructor)

func (*PushNotificationsV1) NewSendMessageBody

func (*PushNotificationsV1) NewSendMessageBody(message *Message) (model *SendMessageBody, err error)

NewSendMessageBody : Instantiate SendMessageBody (Generic Model Constructor)

func (*PushNotificationsV1) NewSendPushOptions

func (*PushNotificationsV1) NewSendPushOptions(applicationID string, message *Message) *SendPushOptions

NewSendPushOptions : Instantiate SendPushOptions

func (*PushNotificationsV1) SendPush

func (pushNotifications *PushNotificationsV1) SendPush(sendPushOptions *SendPushOptions) (result *SendMessageBody, response *core.DetailedResponse, err error)

SendPush : Send message with different options When the request to send the message is accepted, sends push notifications to the specified targets and returns HTTP return code 202. Sent messages are stored and would auto expire in 10 days. You would not be able to retrieve information about a message using GET, after this specified time limit. Available in server side frameworks.

func (*PushNotificationsV1) SetServiceURL

func (pushNotifications *PushNotificationsV1) SetServiceURL(url string) error

SetServiceURL sets the service URL

type PushNotificationsV1Options

type PushNotificationsV1Options struct {
	ServiceName   string
	URL           string
	Authenticator core.Authenticator
}

PushNotificationsV1Options : Service options

type SendMessageBody

type SendMessageBody struct {
	Message *Message `json:"message" validate:"required"`
}

SendMessageBody : Details of the content of the notification message.

type SendPushOptions

type SendPushOptions struct {
	// Application ID.
	ApplicationID *string `json:"applicationId" validate:"required"`

	Message *Message `json:"message" validate:"required"`

	// Allows users to set headers on API requests
	Headers map[string]string
}

SendPushOptions : The SendPush options.

func (*SendPushOptions) SetApplicationID

func (options *SendPushOptions) SetApplicationID(applicationID string) *SendPushOptions

SetApplicationID : Allow user to set ApplicationID

func (*SendPushOptions) SetHeaders

func (options *SendPushOptions) SetHeaders(param map[string]string) *SendPushOptions

SetHeaders : Allow user to set Headers

func (*SendPushOptions) SetMessage

func (options *SendPushOptions) SetMessage(message *Message) *SendPushOptions

SetMessage : Allow user to set Message

Jump to

Keyboard shortcuts

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