Documentation
¶
Overview ¶
Package tpns provides an interface for HSDP Third Party Notification Service (TPNS)
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrBaseTPNSCannotBeEmpty = errors.New("TPNS base URL cannot be empty")
)
Errors
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // User agent used when communicating with the HSDP IAM API. UserAgent string Messages *MessagesService // contains filtered or unexported fields }
A Client manages communication with HSDP IAM API
func NewClient ¶
NewClient returns a new HSDP TDR API client. If a nil httpClient is provided, http.DefaultClient will be used. A configured IAM client must be provided as well
func (*Client) Do ¶
Do executes a http request. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewTPNSRequest ¶
func (c *Client) NewTPNSRequest(method, path string, opt interface{}, options []OptionFunc) (*http.Request, error)
NewTPNSRequest creates an new TPNS API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
func (*Client) SetBaseTPNSURL ¶
SetBaseTPNSURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.
type Code ¶ added in v0.30.0
type Code struct {
Coding []Coding `json:"coding"`
}
Code describes a coding
type ErrorResponse ¶ added in v0.30.0
type ErrorResponse struct { Response *http.Response `json:"-"` Code string `json:"responseCode"` Message string `json:"responseMessage"` }
ErrorResponse represents an IAM errors response containing a code and a human readable message
func (*ErrorResponse) Error ¶ added in v0.30.0
func (e *ErrorResponse) Error() string
type Issue ¶ added in v0.30.0
type Issue struct { Severity string `json:"Severity"` Details string `json:"Details"` Code Code `json:"Code"` }
Issue describes an issue
type IssueResponse ¶ added in v0.30.0
type IssueResponse struct {
Issues []Issue `json:"issue"`
}
IssueResponse encapsulates one or more issues
type Message ¶
type Message struct { MessageType string `json:"MessageType"` PropositionID string `json:"PropositionId"` CustomProperties map[string]string `json:"CustomProperties"` Lookup bool `json:"Lookup"` Content string `json:"Content"` Targets []string `json:"Targets"` }
Message describes a push message
type MessagesService ¶
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService provides operations on TPNS messages
type OptionFunc ¶
OptionFunc is the function signature function for options