Documentation
¶
Index ¶
- func Bool(v bool) *bool
- func OptionBaseURL(endpoint string) func(*Client)
- func OptionDebug(b bool) func(*Client)
- func OptionHTTPClient(client httpClient) func(*Client)
- func OptionLog(l logger) func(*Client)
- func OptionSubuser(subuser string) func(*Client)
- func String(v string) *string
- type Client
- func (c *Client) AddOptions(s string, opts interface{}) (string, error)
- func (c *Client) Debug() bool
- func (c *Client) Debugf(format string, v ...interface{})
- func (c *Client) Debugln(v ...interface{})
- func (c *Client) DeletePendingTeammate(ctx context.Context, token string) error
- func (c *Client) DeleteTeammate(ctx context.Context, username string) error
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) error
- func (c *Client) GetPendingTeammates(ctx context.Context) (*OutputGetPendingTeammates, error)
- func (c *Client) GetTeammate(ctx context.Context, username string) (*OutputGetTeammate, error)
- func (c *Client) GetTeammates(ctx context.Context) (*OutputGetTeammates, error)
- func (c *Client) InviteTeammate(ctx context.Context, input *InputInviteTeammate) (*OutputInviteTeammate, error)
- func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *Client) UpdateTeammatePermissions(ctx context.Context, username string, input *InputUpdateTeammatePermissions) (*OutputUpdateTeammatePermissions, error)
- type Error
- type ErrorResponse
- type InputInviteTeammate
- type InputUpdateTeammatePermissions
- type Option
- type OutputGetPendingTeammates
- type OutputGetTeammate
- type OutputGetTeammates
- type OutputInviteTeammate
- type OutputUpdateTeammatePermissions
- type PendingTeammate
- type Teammate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func OptionBaseURL ¶
OptionBaseURL - provide a custom base url to the sendgrid client.
func OptionDebug ¶
OptionDebug enable debugging for the client
func OptionHTTPClient ¶
func OptionHTTPClient(client httpClient) func(*Client)
OptionHTTPClient - provide a custom http client to the sendgrid client.
func OptionSubuser ¶
OptionBaseURL - provide a custom base url to the sendgrid client.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client : sendgrid client
func (*Client) AddOptions ¶
AddOptions adds the parameters in opt as URL query parameters to s. opt must be a struct whose fields may contain "url" tags.
func (*Client) DeletePendingTeammate ¶
func (*Client) DeleteTeammate ¶
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it. If rate limit is exceeded and reset time is in the future, Do returns *RateLimitError immediately without making a network API call.
The provided ctx must be non-nil, if it is nil an error is returned. If it is canceled or times out, ctx.Err() will be returned.
func (*Client) GetPendingTeammates ¶
func (c *Client) GetPendingTeammates(ctx context.Context) (*OutputGetPendingTeammates, error)
func (*Client) GetTeammate ¶
func (*Client) GetTeammates ¶
func (c *Client) GetTeammates(ctx context.Context) (*OutputGetTeammates, error)
func (*Client) InviteTeammate ¶
func (c *Client) InviteTeammate(ctx context.Context, input *InputInviteTeammate) (*OutputInviteTeammate, error)
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs 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) UpdateTeammatePermissions ¶
func (c *Client) UpdateTeammatePermissions(ctx context.Context, username string, input *InputUpdateTeammatePermissions) (*OutputUpdateTeammatePermissions, error)
type Error ¶
type Error struct {
Field *string `json:"field,omitempty"`
Message *string `json:"message,omitempty"`
}
Error is sendgrid error
type ErrorResponse ¶
type ErrorResponse struct {
Errors []*Error `json:"errors"`
}
ErrorResponse is sendgrid error response
type InputInviteTeammate ¶
type OutputGetPendingTeammates ¶
type OutputGetPendingTeammates struct {
PendingTeammates []PendingTeammate `json:"result,omitempty"`
}
type OutputGetTeammate ¶
type OutputGetTeammate struct {
Username string `json:"username,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Email string `json:"email,omitempty"`
Scopes []string `json:"scopes,omitempty"`
UserType string `json:"user_type,omitempty"`
IsAdmin bool `json:"is_admin,omitempty"`
Phone string `json:"phone,omitempty"`
Website string `json:"website,omitempty"`
Address string `json:"address,omitempty"`
Address2 string `json:"address2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Zip string `json:"zip,omitempty"`
Country string `json:"country,omitempty"`
}
type OutputGetTeammates ¶
type OutputGetTeammates struct {
Teammates []Teammate `json:"result,omitempty"`
}
type OutputInviteTeammate ¶
type OutputUpdateTeammatePermissions ¶
type OutputUpdateTeammatePermissions struct {
Username string `json:"username,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Email string `json:"email,omitempty"`
Scopes []string `json:"scopes,omitempty"`
UserType string `json:"user_type,omitempty"`
IsAdmin bool `json:"is_admin,omitempty"`
Phone string `json:"phone,omitempty"`
Website string `json:"website,omitempty"`
Address string `json:"address,omitempty"`
Address2 string `json:"address2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Zip string `json:"zip,omitempty"`
Country string `json:"country,omitempty"`
}
type PendingTeammate ¶
type Teammate ¶
type Teammate struct {
Username string `json:"username,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
UserType string `json:"user_type,omitempty"`
IsAdmin bool `json:"is_admin,omitempty"`
Phone string `json:"phone,omitempty"`
Website string `json:"website,omitempty"`
Address string `json:"address,omitempty"`
Address2 string `json:"address2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Zip string `json:"zip,omitempty"`
Country string `json:"country,omitempty"`
}
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
delete_pending_teammate
command
|
|
|
delete_teammate
command
|
|
|
get_teammate
command
|
|
|
get_teammates
command
|
|
|
invite_teammate
command
|
|
|
pending_teammates
command
|
|
|
update_teammate_permissions
command
|