Documentation ¶
Overview ¶
* This code was generated by * * SENDGRID-OAI-GENERATOR * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually.
Package sendgrid provides bindings for Sendgrid's REST APIs.
Index ¶
- Constants
- Variables
- func API(request rest.Request) (*rest.Response, error)
- func GetRequest(key, endpoint, host string) rest.Request
- func GetRequestSubuser(key, endpoint, host, subuser string) rest.Request
- func GetTwilioEmailRequest(twilioEmailOptions TwilioEmailOptions) rest.Request
- func MakeRequest(request rest.Request) (*rest.Response, error)
- func MakeRequestAsync(request rest.Request) (chan *rest.Response, chan error)
- func MakeRequestAsyncWithContext(ctx context.Context, request rest.Request) (chan *rest.Response, chan error)
- func MakeRequestRetry(request rest.Request) (*rest.Response, error)
- func MakeRequestRetryWithContext(ctx context.Context, request rest.Request) (*rest.Response, error)
- func MakeRequestWithContext(ctx context.Context, request rest.Request) (*rest.Response, error)
- func SetDataResidency(request rest.Request, region string) (rest.Request, error)
- type Client
- type ClientParams
- type Meta
- type RestClient
- type TwilioEmailOptions
Constants ¶
const (
Version = "4.0.0-rc.3"
)
Version is this client library's current version
Variables ¶
var DefaultClient = rest.DefaultClient
DefaultClient is used if no custom HTTP client is defined
Functions ¶
func API ¶
API sets up the request to the Twilio SendGrid API, this is main interface. Please use the MakeRequest or MakeRequestAsync functions instead. (deprecated)
func GetRequest ¶
GetRequest @return [Request] a default request object
func GetRequestSubuser ¶
GetRequestSubuser like GetRequest but with On-Behalf of Subuser @return [Request] a default request object
func GetTwilioEmailRequest ¶
func GetTwilioEmailRequest(twilioEmailOptions TwilioEmailOptions) rest.Request
GetTwilioEmailRequest create Request @return [Request] a default request object
func MakeRequest ¶
MakeRequest attempts a Twilio SendGrid request synchronously.
func MakeRequestAsync ¶
MakeRequestAsync attempts a request asynchronously in a new go routine. This function returns two channels: responses and errors. This function will retry in the case of a rate limit.
func MakeRequestAsyncWithContext ¶
func MakeRequestAsyncWithContext(ctx context.Context, request rest.Request) (chan *rest.Response, chan error)
MakeRequestAsyncWithContext attempts a request asynchronously in a new go routine with context.Context. This function returns two channels: responses and errors. This function will retry in the case of a rate limit.
func MakeRequestRetry ¶
MakeRequestRetry a synchronous request, but retry in the event of a rate limited response.
func MakeRequestRetryWithContext ¶
MakeRequestRetryWithContext a synchronous request with context.Context, but retry in the event of a rate limited response.
func MakeRequestWithContext ¶
MakeRequestWithContext attempts a Twilio SendGrid request synchronously with context.Context.
func SetDataResidency ¶
SetDataResidency modifies the host as per the region
* This allows support for global and eu regions only. This set will likely expand in the future. * Global should be the default * Global region means the message should be sent through: * HTTP: api.sendgrid.com * EU region means the message should be sent through: * HTTP: api.eu.sendgrid.com
@return [Request] the modified request object
Types ¶
type Client ¶
Client is the Twilio SendGrid Go client
func NewSendClient ¶
NewSendClient constructs a new Twilio SendGrid client given an API key
func NewTwilioEmailSendClient ¶
NewTwilioEmailSendClient constructs a new Twilio Email client given a username and password
type ClientParams ¶
type ClientParams struct { ApiKey string Client client.BaseClient }
type Meta ¶
type Meta struct { FirstPageURL *string `json:"first_page_url"` Key *string `json:"key"` LastPageURL *string `json:"last_page_url,omitempty"` NextPageURL *string `json:"next_page_url"` Page *int `json:"page"` PageSize *int `json:"page_size"` PreviousPageURL *string `json:"previous_page_url"` URL *string `json:"url"` }
Meta holds relevant pagination resources.
type RestClient ¶
type RestClient struct { *client.RequestHandler AccountProvisioningV3 *AccountProvisioningV3.ApiService AlertsV3 *AlertsV3.ApiService ApiKeysV3 *ApiKeysV3.ApiService DomainAuthenticationV3 *DomainAuthenticationV3.ApiService EmailActivityV3 *EmailActivityV3.ApiService EmailValidationV3 *EmailValidationV3.ApiService EnforcedTlsV3 *EnforcedTlsV3.ApiService IntegrationsV3 *IntegrationsV3.ApiService IpAccessManagementV3 *IpAccessManagementV3.ApiService IpAddressManagementV3 *IpAddressManagementV3.ApiService IpWarmupV3 *IpWarmupV3.ApiService IpsV3 *IpsV3.ApiService LinkBrandingV3 *LinkBrandingV3.ApiService LmcCampaignsV3 *LmcCampaignsV3.ApiService LmcContactdbV3 *LmcContactdbV3.ApiService LmcSendersV3 *LmcSendersV3.ApiService MailV3 *MailV3.ApiService MailSettingsV3 *MailSettingsV3.ApiService McContactsV3 *McContactsV3.ApiService McCustomFieldsV3 *McCustomFieldsV3.ApiService McDesignsV3 *McDesignsV3.ApiService McListsV3 *McListsV3.ApiService McSegmentsV3 *McSegmentsV3.ApiService McSegments2V3 *McSegments2V3.ApiService McSendersV3 *McSendersV3.ApiService McSinglesendsV3 *McSinglesendsV3.ApiService McStatsV3 *McStatsV3.ApiService McTestV3 *McTestV3.ApiService PartnerV3 *PartnerV3.ApiService RecipientsDataErasureV3 *RecipientsDataErasureV3.ApiService ReverseDnsV3 *ReverseDnsV3.ApiService ScheduledSendsV3 *ScheduledSendsV3.ApiService ScopesV3 *ScopesV3.ApiService SeqV3 *SeqV3.ApiService SsoV3 *SsoV3.ApiService StatsV3 *StatsV3.ApiService SubusersV3 *SubusersV3.ApiService TeammatesV3 *TeammatesV3.ApiService TemplatesV3 *TemplatesV3.ApiService TrackingSettingsV3 *TrackingSettingsV3.ApiService UserV3 *UserV3.ApiService VerifiedSendersV3 *VerifiedSendersV3.ApiService }
RestClient provides access to Sendgrid services.
func NewRestClient ¶
func NewRestClient() *RestClient
NewRestClient provides an initialized Sendgrid RestClient.
func NewRestClientWithParams ¶
func NewRestClientWithParams(params ClientParams) *RestClient
NewRestClientWithParams provides an initialized Sendgrid RestClient with params.
func (*RestClient) SetEdge ¶
func (c *RestClient) SetEdge(edge string)
SetEdge sets the Edge for the Sendgrid request. Not supported in sendgrid currently
func (*RestClient) SetRegion ¶
func (c *RestClient) SetRegion(region string)
SetRegion sets the Region for the Sendgrid request. Defaults to "us1" if an edge is provided.
func (*RestClient) SetTimeout ¶
func (c *RestClient) SetTimeout(timeout time.Duration)
SetTimeout sets the Timeout for Sendgrid HTTP requests.
Directories ¶
Path | Synopsis |
---|---|
Package client provides internal utilities for the sendgrid-go client library.
|
Package client provides internal utilities for the sendgrid-go client library. |
examples
|
|
helpers
|
|
rest
|
|