verify

package
v8.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(c *messagebird.Client, id string) error

Delete deletes an existing Verify object by its ID.

Types

type Params

type Params struct {
	Originator  string
	Reference   string
	Type        string
	Template    string
	DataCoding  string
	ReportURL   string
	Voice       string
	Language    string
	Timeout     int
	TokenLength int
	Subject     string
}

Params handles optional verification parameters.

type Verify

type Verify struct {
	ID                 string
	HRef               string
	Reference          string
	Status             string
	Messages           map[string]string
	CreatedDatetime    *time.Time
	ValidUntilDatetime *time.Time
	Recipient          string
}

Verify object represents MessageBird server response.

func Create

func Create(c *messagebird.Client, recipient string, params *Params) (*Verify, error)

Create generates a new One-Time-Password for one recipient.

func Read

func Read(c *messagebird.Client, id string) (*Verify, error)

Read retrieves an existing Verify object by its ID.

func VerifyToken

func VerifyToken(c *messagebird.Client, id, token string) (*Verify, error)

VerifyToken performs token value check against MessageBird API.

func (*Verify) UnmarshalJSON

func (v *Verify) UnmarshalJSON(b []byte) error

* The type of the Verify.Recipient object changed from int to string but the api still returns a recipent numeric value whne sms type is used. This was the best way to ensure backward compatibility with the previous versions

type VerifyMessage

type VerifyMessage struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

func ReadVerifyEmailMessage

func ReadVerifyEmailMessage(c *messagebird.Client, id string) (*VerifyMessage, error)

Jump to

Keyboard shortcuts

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