openapi

package
v4.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 6 Imported by: 0

README

Go API client for

The Twilio SendGrid Subusers API allows you to create and manage your Subuser accounts. Subusers are available on Pro and Premier plans, and you can think of them as sub-accounts. Each Subuser can have its own sending domains, IP addresses, and reporting. SendGrid recommends creating Subusers for each of the different types of emails you send—one Subuser for transactional emails and another for marketing emails. Independent Software Vendor (ISV) customers may also create Subusers for each of their customers.

You can also manage Subusers in the Twilio SendGrid application user interface. See Subusers for more information.

Overview

This API client was generated by the OpenAPI Generator project from the OpenAPI specs located at twilio/sendgrid-oai. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version:
  • Build date: 2024-10-24T13:26:06.760119Z[Etc/UTC]
  • Build package: com.sendgrid.oai.go.SendgridGoGenerator For more information, please visit https://support.sendgrid.com/hc/en-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import "./"

Documentation for API Endpoints

All URIs are relative to https://api.sendgrid.com

Class Method HTTP request Description
CreateSubuser CreateSubuser Post /v3/subusers Create Subuser
DeleteSubuser DeleteSubuser Delete /v3/subusers/{SubuserName} Delete a subuser
GetSubuserCredit GetSubuserCredit Get /v3/subusers/{SubuserName}/credits Get the Credits for a Subuser
ListMonthlyStat ListMonthlyStat Get /v3/subusers/stats/monthly Retrieve monthly stats for all subusers
ListReputation ListReputation Get /v3/subusers/reputations Retrieve Subuser Reputations
ListStat ListStat Get /v3/subusers/stats Retrieve email statistics for your subusers.
ListStatSum ListStatSum Get /v3/subusers/stats/sums Retrieve the totals for each email statistic metric for all subusers.
ListSubuser ListSubuser Get /v3/subusers List all Subusers
ListSubuserMonthlyStat ListSubuserMonthlyStat Get /v3/subusers/{SubuserName}/stats/monthly Retrieve the monthly email statistics for a single subuser
UpdateSubuser UpdateSubuser Patch /v3/subusers/{SubuserName} Enable/disable a subuser
UpdateSubuserCredit UpdateSubuserCredit Put /v3/subusers/{SubuserName}/credits Update the Credits for a Subuser
UpdateSubuserIp UpdateSubuserIp Put /v3/subusers/{SubuserName}/ips Update IPs assigned to a subuser
UpdateSubuserRemainingCredit UpdateSubuserRemainingCredit Patch /v3/subusers/{SubuserName}/credits/remaining Update the remaining credits for a Subuser
UpdateSubuserWebsiteAccess UpdateSubuserWebsiteAccess Patch /v3/subusers/{SubuserName}/website_access Enable/Disable website access for a Subuser

Documentation For Models

Documentation For Authorization

BearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedBy

type AggregatedBy string

AggregatedBy the model 'AggregatedBy'

const (
	AGGREGATEDBY_DAY   AggregatedBy = "day"
	AGGREGATEDBY_WEEK  AggregatedBy = "week"
	AGGREGATEDBY_MONTH AggregatedBy = "month"
)

List of AggregatedBy

type ApiService

type ApiService struct {
	// contains filtered or unexported fields
}

func NewApiService

func NewApiService(requestHandler *sendgrid.RequestHandler) *ApiService

func NewApiServiceWithClient

func NewApiServiceWithClient(client sendgrid.BaseClient) *ApiService

func (*ApiService) CreateSubuser

func (c *ApiService) CreateSubuser(params *CreateSubuserParam) (interface{}, error)

**This endpoint allows you to create a new subuser.**

func (*ApiService) DeleteSubuser

func (c *ApiService) DeleteSubuser(params *DeleteSubuserParam) (interface{}, error)

**This endpoint allows you to delete a subuser.** This is a permanent action. Once deleted, a subuser cannot be retrieved.

func (*ApiService) GetSubuserCredit

func (c *ApiService) GetSubuserCredit(params *GetSubuserCreditParam) (interface{}, error)

**This endpoint allows you to retrieve a Credits overview for a Subuser.**

func (*ApiService) ListMonthlyStat

func (c *ApiService) ListMonthlyStat(params *ListMonthlyStatParam) (interface{}, error)

**This endpoint allows you to retrieve the monthly email statistics for all subusers over the given date range.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.

func (*ApiService) ListReputation

func (c *ApiService) ListReputation(params *ListReputationParam) (interface{}, error)

**This endpoint allows you to request the reputations for your subusers.** Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will affect your sender rating.

func (*ApiService) ListStat

func (c *ApiService) ListStat(params *ListStatParam) (interface{}, error)

**This endpoint allows you to retrieve the email statistics for the given subusers.** You may retrieve statistics for up to 10 different subusers by including an additional _subusers_ parameter for each additional subuser.

func (*ApiService) ListStatSum

func (c *ApiService) ListStatSum(params *ListStatSumParam) (interface{}, error)

**This endpoint allows you to retrieve the total sums of each email statistic metric for all subusers over the given date range.**

func (*ApiService) ListSubuser

func (c *ApiService) ListSubuser(params *ListSubuserParam) (interface{}, error)

**This endpoint allows you to retrieve a paginated list of all your subusers.** You can use the `username` query parameter to filter the list for specific subusers. You can use the `limit` query parameter to set the page size. If your list contains more items than the page size permits, you can make multiple requests. Use the `offset` query parameter to control the position in the list from which to start retrieving additional items.

func (*ApiService) ListSubuserMonthlyStat

func (c *ApiService) ListSubuserMonthlyStat(params *ListSubuserMonthlyStatParam) (interface{}, error)

**This endpoint allows you to retrive the monthly email statistics for a specific subuser.** When using the `sort_by_metric` to sort your stats by a specific metric, you can not sort by the following metrics: `bounce_drops`, `deferred`, `invalid_emails`, `processed`, `spam_report_drops`, `spam_reports`, or `unsubscribe_drops`.

func (*ApiService) UpdateSubuser

func (c *ApiService) UpdateSubuser(params *UpdateSubuserParam) (interface{}, error)

**This endpoint allows you to enable or disable a subuser.**

func (*ApiService) UpdateSubuserCredit

func (c *ApiService) UpdateSubuserCredit(params *UpdateSubuserCreditParam) (interface{}, error)

**This endpoint allows you to update the Credits for a Subuser.**

func (*ApiService) UpdateSubuserIp

func (c *ApiService) UpdateSubuserIp(params *UpdateSubuserIpParam) (interface{}, error)

**This endpoint allows you update your subusers' assigned IP.** Each subuser should be assigned to an IP address from which all of this subuser's mail will be sent. Often, this is the same IP as the parent account, but each subuser can have one or more of their own IP addresses as well. More information: * [How to request more IPs](https://sendgrid.com/docs/ui/account-and-settings/dedicated-ip-addresses/) * [Setup Reverse DNS](https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-reverse-dns/)

func (*ApiService) UpdateSubuserRemainingCredit

func (c *ApiService) UpdateSubuserRemainingCredit(params *UpdateSubuserRemainingCreditParam) (interface{}, error)

**This endpoint allows you to update the remaining credits for a Subuser.**

func (*ApiService) UpdateSubuserWebsiteAccess

func (c *ApiService) UpdateSubuserWebsiteAccess(params *UpdateSubuserWebsiteAccessParam) (interface{}, error)

Enable/Disable website access for a Subuser, while still preserving email send functionality.

type CategoryStats

type CategoryStats struct {
	// The date the statistics were gathered.
	Date  string                     `json:"date"`
	Stats *[]CategoryStatsStatsInner `json:"stats,omitempty"`
}

CategoryStats struct for CategoryStats

type CategoryStatsStatsInner

type CategoryStatsStatsInner struct {
	Metrics *CategoryStatsStatsInnerMetrics `json:"metrics,omitempty"`
	// The name of the category.
	Name *string `json:"name,omitempty"`
	// How you are segmenting your statistics.
	Type string `json:"type"`
}

CategoryStatsStatsInner struct for CategoryStatsStatsInner

type CategoryStatsStatsInnerMetrics

type CategoryStatsStatsInnerMetrics struct {
	// The number of emails that were not allowed to be delivered by ISPs.
	Blocks int32 `json:"blocks"`
	// The number of emails that were dropped because of a bounce.
	BounceDrops int32 `json:"bounce_drops"`
	// The number of emails that bounced instead of being delivered.
	Bounces int32 `json:"bounces"`
	// The number of links that were clicked.
	Clicks int32 `json:"clicks"`
	// The number of emails that temporarily could not be delivered.
	Deferred int32 `json:"deferred"`
	// The number of emails SendGrid was able to confirm were actually delivered to a recipient.
	Delivered int32 `json:"delivered"`
	// The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.
	InvalidEmails int32 `json:"invalid_emails"`
	// The total number of times your emails were opened by recipients.
	Opens int32 `json:"opens"`
	// Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.
	Processed int32 `json:"processed"`
	// The number of emails that were requested to be delivered.
	Requests int32 `json:"requests"`
	// The number of emails that were dropped due to a recipient previously marking your emails as spam.
	SpamReportDrops int32 `json:"spam_report_drops"`
	// The number of recipients who marked your email as spam.
	SpamReports int32 `json:"spam_reports"`
	// The number of unique recipients who clicked links in your emails.
	UniqueClicks int32 `json:"unique_clicks"`
	// The number of unique recipients who opened your emails.
	UniqueOpens int32 `json:"unique_opens"`
	// The number of emails dropped due to a recipient unsubscribing from your emails.
	UnsubscribeDrops int32 `json:"unsubscribe_drops"`
	// The number of recipients who unsubscribed from your emails.
	Unsubscribes int32 `json:"unsubscribes"`
}

CategoryStatsStatsInnerMetrics struct for CategoryStatsStatsInnerMetrics

type CreateSubuserParam

type CreateSubuserParam struct {
	//
	CreateSubuserRequest *CreateSubuserRequest `json:"CreateSubuserRequest,omitempty"`
}

func (*CreateSubuserParam) SetCreateSubuserRequest

func (params *CreateSubuserParam) SetCreateSubuserRequest(CreateSubuserRequest CreateSubuserRequest) *CreateSubuserParam

type CreateSubuserRequest

type CreateSubuserRequest struct {
	// The username for this subuser.
	Username string `json:"username"`
	// The email address of the subuser.
	Email string `json:"email"`
	// The password this subuser will use when logging into SendGrid.
	Password string `json:"password"`
	// The IP addresses that should be assigned to this subuser.
	Ips []string `json:"ips"`
	// The region this Subuser should be assigned to. Can be `global` or `eu`. (Regional email is in Public Beta and requires SendGrid Pro plan or above.).
	Region *Region1 `json:"region,omitempty"`
	// A flag that determines if the Subuser's region should be returned in the response. (Regional email is in Public Beta and requires SendGrid Pro plan or above.)
	IncludeRegion *bool `json:"include_region,omitempty"`
}

CreateSubuserRequest struct for CreateSubuserRequest

type DeleteSubuserParam

type DeleteSubuserParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
}

func (*DeleteSubuserParam) SetSubuserName

func (params *DeleteSubuserParam) SetSubuserName(SubuserName string) *DeleteSubuserParam

type ErrorResponse

type ErrorResponse struct {
	Errors *[]ErrorResponseErrorsInner `json:"errors,omitempty"`
	// When applicable, this property value will be an error ID.
	Id *string `json:"id,omitempty"`
}

ErrorResponse struct for ErrorResponse

type ErrorResponseErrorsInner

type ErrorResponseErrorsInner struct {
	// An error message.
	Message *string `json:"message,omitempty"`
	// When applicable, this property value will be the field that generated the error.
	Field *string `json:"field,omitempty"`
	// When applicable, this property value will be helper text or a link to documentation to help you troubleshoot the error.
	Help *map[string]interface{} `json:"help,omitempty"`
}

ErrorResponseErrorsInner struct for ErrorResponseErrorsInner

type GetSubuserCreditParam

type GetSubuserCreditParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
}

func (*GetSubuserCreditParam) SetSubuserName

func (params *GetSubuserCreditParam) SetSubuserName(SubuserName string) *GetSubuserCreditParam

type ListMonthlyStatParam

type ListMonthlyStatParam struct {
	// The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD
	Date *string `json:"date"`
	// A substring search of your subusers.
	Subuser *string `json:"subuser,omitempty"`
	// The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.'
	SortByMetric *SortByMetric `json:"sort_by_metric,omitempty"`
	// The direction you want to sort.
	SortByDirection *SortByDirection1 `json:"sort_by_direction,omitempty"`
	// Optional field to limit the number of results returned.
	Limit *int32 `json:"limit,omitempty"`
	// Optional beginning point in the list to retrieve from.
	Offset *int32 `json:"offset,omitempty"`
}

func (*ListMonthlyStatParam) SetDate

func (params *ListMonthlyStatParam) SetDate(Date string) *ListMonthlyStatParam

func (*ListMonthlyStatParam) SetLimit

func (params *ListMonthlyStatParam) SetLimit(Limit int32) *ListMonthlyStatParam

func (*ListMonthlyStatParam) SetOffset

func (params *ListMonthlyStatParam) SetOffset(Offset int32) *ListMonthlyStatParam

func (*ListMonthlyStatParam) SetSortByDirection

func (params *ListMonthlyStatParam) SetSortByDirection(SortByDirection SortByDirection1) *ListMonthlyStatParam

func (*ListMonthlyStatParam) SetSortByMetric

func (params *ListMonthlyStatParam) SetSortByMetric(SortByMetric SortByMetric) *ListMonthlyStatParam

func (*ListMonthlyStatParam) SetSubuser

func (params *ListMonthlyStatParam) SetSubuser(Subuser string) *ListMonthlyStatParam

type ListReputation200ResponseInner

type ListReputation200ResponseInner struct {
	// The sender reputation this subuser has attained.
	Reputation float32 `json:"reputation"`
	// The subuser that has this reputation.
	Username string `json:"username"`
}

ListReputation200ResponseInner struct for ListReputation200ResponseInner

type ListReputationParam

type ListReputationParam struct {
	//
	Usernames *string `json:"usernames,omitempty"`
}

func (*ListReputationParam) SetUsernames

func (params *ListReputationParam) SetUsernames(Usernames string) *ListReputationParam

type ListStatParam

type ListStatParam struct {
	// The subuser you want to retrieve statistics for. You may include this parameter up to 10 times to retrieve statistics for multiple subusers.
	Subusers *string `json:"subusers"`
	// The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.
	StartDate *string `json:"start_date"`
	// Limits the number of results returned per page.
	Limit *int32 `json:"limit,omitempty"`
	// The point in the list to begin retrieving results from.
	Offset *int32 `json:"offset,omitempty"`
	// How to group the statistics. Must be either \"day\", \"week\", or \"month\".
	AggregatedBy *AggregatedBy `json:"aggregated_by,omitempty"`
	// The end date of the statistics to retrieve. Defaults to today.
	EndDate *string `json:"end_date,omitempty"`
}

func (*ListStatParam) SetAggregatedBy

func (params *ListStatParam) SetAggregatedBy(AggregatedBy AggregatedBy) *ListStatParam

func (*ListStatParam) SetEndDate

func (params *ListStatParam) SetEndDate(EndDate string) *ListStatParam

func (*ListStatParam) SetLimit

func (params *ListStatParam) SetLimit(Limit int32) *ListStatParam

func (*ListStatParam) SetOffset

func (params *ListStatParam) SetOffset(Offset int32) *ListStatParam

func (*ListStatParam) SetStartDate

func (params *ListStatParam) SetStartDate(StartDate string) *ListStatParam

func (*ListStatParam) SetSubusers

func (params *ListStatParam) SetSubusers(Subusers string) *ListStatParam

type ListStatSumParam

type ListStatSumParam struct {
	// The starting date of the statistics to retrieve. Must follow format YYYY-MM-DD.
	StartDate *string `json:"start_date"`
	// The direction you want to sort.
	SortByDirection *SortByDirection2 `json:"sort_by_direction,omitempty"`
	// The end date of the statistics to retrieve. Defaults to today. Must follow format YYYY-MM-DD.
	EndDate *string `json:"end_date,omitempty"`
	// Limits the number of results returned per page.
	Limit *int32 `json:"limit,omitempty"`
	// The point in the list to begin retrieving results from.
	Offset *int32 `json:"offset,omitempty"`
	// How to group the statistics. Defaults to today. Must follow format YYYY-MM-DD.
	AggregatedBy *string `json:"aggregated_by,omitempty"`
	// The metric that you want to sort by.  Must be a single metric.
	SortByMetric *string `json:"sort_by_metric,omitempty"`
}

func (*ListStatSumParam) SetAggregatedBy

func (params *ListStatSumParam) SetAggregatedBy(AggregatedBy string) *ListStatSumParam

func (*ListStatSumParam) SetEndDate

func (params *ListStatSumParam) SetEndDate(EndDate string) *ListStatSumParam

func (*ListStatSumParam) SetLimit

func (params *ListStatSumParam) SetLimit(Limit int32) *ListStatSumParam

func (*ListStatSumParam) SetOffset

func (params *ListStatSumParam) SetOffset(Offset int32) *ListStatSumParam

func (*ListStatSumParam) SetSortByDirection

func (params *ListStatSumParam) SetSortByDirection(SortByDirection SortByDirection2) *ListStatSumParam

func (*ListStatSumParam) SetSortByMetric

func (params *ListStatSumParam) SetSortByMetric(SortByMetric string) *ListStatSumParam

func (*ListStatSumParam) SetStartDate

func (params *ListStatSumParam) SetStartDate(StartDate string) *ListStatSumParam

type ListSubuserMonthlyStatParam

type ListSubuserMonthlyStatParam struct {
	// The date of the month to retrieve statistics for. Must be formatted YYYY-MM-DD
	Date *string `json:"date"`
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
	// The metric that you want to sort by. Metrics that you can sort by are: `blocks`, `bounces`, `clicks`, `delivered`, `opens`, `requests`, `unique_clicks`, `unique_opens`, and `unsubscribes`.'
	SortByMetric *string `json:"sort_by_metric,omitempty"`
	// The direction you want to sort.
	SortByDirection *SortByDirection `json:"sort_by_direction,omitempty"`
	// Optional field to limit the number of results returned.
	Limit *int32 `json:"limit,omitempty"`
	// Optional beginning point in the list to retrieve from.
	Offset *int32 `json:"offset,omitempty"`
}

func (*ListSubuserMonthlyStatParam) SetDate

func (*ListSubuserMonthlyStatParam) SetLimit

func (*ListSubuserMonthlyStatParam) SetOffset

func (*ListSubuserMonthlyStatParam) SetSortByDirection

func (params *ListSubuserMonthlyStatParam) SetSortByDirection(SortByDirection SortByDirection) *ListSubuserMonthlyStatParam

func (*ListSubuserMonthlyStatParam) SetSortByMetric

func (params *ListSubuserMonthlyStatParam) SetSortByMetric(SortByMetric string) *ListSubuserMonthlyStatParam

func (*ListSubuserMonthlyStatParam) SetSubuserName

func (params *ListSubuserMonthlyStatParam) SetSubuserName(SubuserName string) *ListSubuserMonthlyStatParam

type ListSubuserParam

type ListSubuserParam struct {
	// The username of this subuser.
	Username *string `json:"username,omitempty"`
	// `limit` sets the page size, i.e. maximum number of items from the list to be returned for a single API request. If omitted, the default page size is used.
	Limit *int32 `json:"limit,omitempty"`
	// Filter for Subusers in this region. If not provided, all Subusers will be returned. All users can also be explicitly requested by using the filter `all`. Users who are not pinned to a region will be displayed as `global`.
	Region *Region `json:"region,omitempty"`
	// Optional flag to include the regions of the Subusers in the response. If not provided, the region will be omitted from the response.
	IncludeRegion *bool `json:"include_region,omitempty"`
	// The number of items in the list to skip over before starting to retrieve the items for the requested page. The default `offset` of `0` represents the beginning of the list, i.e. the start of the first page. To request the second page of the list, set the `offset` to the page size as determined by `limit`. Use multiples of the page size as your `offset` to request further consecutive pages. E.g. assume your page size is set to `10`. An `offset` of `10` requests the second page, an `offset` of `20` requests the third page and so on, provided there are sufficiently many items in your list.
	Offset *int32 `json:"offset,omitempty"`
}

func (*ListSubuserParam) SetIncludeRegion

func (params *ListSubuserParam) SetIncludeRegion(IncludeRegion bool) *ListSubuserParam

func (*ListSubuserParam) SetLimit

func (params *ListSubuserParam) SetLimit(Limit int32) *ListSubuserParam

func (*ListSubuserParam) SetOffset

func (params *ListSubuserParam) SetOffset(Offset int32) *ListSubuserParam

func (*ListSubuserParam) SetRegion

func (params *ListSubuserParam) SetRegion(Region Region) *ListSubuserParam

func (*ListSubuserParam) SetUsername

func (params *ListSubuserParam) SetUsername(Username string) *ListSubuserParam

type Region

type Region string

Region the model 'Region'

const (
	REGION_ALL    Region = "all"
	REGION_GLOBAL Region = "global"
	REGION_EU     Region = "eu"
)

List of Region

type Region1

type Region1 string

Region1 the model 'Region1'

const (
	REGION1_GLOBAL Region1 = "global"
	REGION1_EU     Region1 = "eu"
)

List of Region1

type Region2

type Region2 string

Region2 the model 'Region2'

const (
	REGION2_GLOBAL Region2 = "global"
	REGION2_EU     Region2 = "eu"
)

List of Region2

type Region3

type Region3 string

Region3 the model 'Region3'

const (
	REGION3_GLOBAL Region3 = "global"
	REGION3_EU     Region3 = "eu"
)

List of Region3

type ResetFrequency

type ResetFrequency string

ResetFrequency the model 'ResetFrequency'

const (
	RESETFREQUENCY_MONTHLY ResetFrequency = "monthly"
	RESETFREQUENCY_WEEKLY  ResetFrequency = "weekly"
	RESETFREQUENCY_DAILY   ResetFrequency = "daily"
)

List of ResetFrequency

type ResetFrequency1

type ResetFrequency1 string

ResetFrequency1 the model 'ResetFrequency1'

const (
	RESETFREQUENCY1_MONTHLY ResetFrequency1 = "monthly"
	RESETFREQUENCY1_WEEKLY  ResetFrequency1 = "weekly"
	RESETFREQUENCY1_DAILY   ResetFrequency1 = "daily"
)

List of ResetFrequency1

type SortByDirection

type SortByDirection string

SortByDirection the model 'SortByDirection'

const (
	SORTBYDIRECTION_DESC SortByDirection = "desc"
	SORTBYDIRECTION_ASC  SortByDirection = "asc"
)

List of SortByDirection

type SortByDirection1

type SortByDirection1 string

SortByDirection1 the model 'SortByDirection1'

const (
	SORTBYDIRECTION1_DESC SortByDirection1 = "desc"
	SORTBYDIRECTION1_ASC  SortByDirection1 = "asc"
)

List of SortByDirection1

type SortByDirection2

type SortByDirection2 string

SortByDirection2 the model 'SortByDirection2'

const (
	SORTBYDIRECTION2_DESC SortByDirection2 = "desc"
	SORTBYDIRECTION2_ASC  SortByDirection2 = "asc"
)

List of SortByDirection2

type SortByMetric

type SortByMetric string

SortByMetric the model 'SortByMetric'

const (
	SORTBYMETRIC_BLOCKS        SortByMetric = "blocks"
	SORTBYMETRIC_BOUNCES       SortByMetric = "bounces"
	SORTBYMETRIC_CLICKS        SortByMetric = "clicks"
	SORTBYMETRIC_DELIVERED     SortByMetric = "delivered"
	SORTBYMETRIC_OPENS         SortByMetric = "opens"
	SORTBYMETRIC_REQUESTS      SortByMetric = "requests"
	SORTBYMETRIC_UNIQUE_CLICKS SortByMetric = "unique_clicks"
	SORTBYMETRIC_UNIQUE_OPENS  SortByMetric = "unique_opens"
	SORTBYMETRIC_UNSUBSCRIBES  SortByMetric = "unsubscribes"
)

List of SortByMetric

type Subuser

type Subuser struct {
	// Whether or not the user is enabled or disabled.
	Disabled bool `json:"disabled"`
	// The ID of this subuser.
	Id float32 `json:"id"`
	// The name by which this subuser will be referred.
	Username string `json:"username"`
	// The email address to contact this subuser.
	Email string `json:"email"`
	// The region this Subuser is assigned to. This property is returned only if the `include_region` parameter was included and set to `true` in the API request.
	Region *Region2 `json:"region,omitempty"`
}

Subuser struct for Subuser

type SubuserCredits

type SubuserCredits struct {
	// Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis.
	Type Type `json:"type"`
	// The frequency with which a Subuser's credits are reset if `type` is set to `recurring`, otherwise `null`.
	ResetFrequency ResetFrequency `json:"reset_frequency"`
	// Total number of remaining credits. `remain` is `null` if the reset `type` for the Subuser's credits is set to `unlimited`.
	Remain int32 `json:"remain"`
	// Total number of allowable credits. `total` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`.
	Total int32 `json:"total"`
	// Total number of used credits. `used` is `null` if the reset `type` for the Subuser's credits is set to `unlimited` or `nonrecurring`.
	Used int32 `json:"used"`
}

SubuserCredits struct for SubuserCredits

type SubuserCreditsRequest

type SubuserCreditsRequest struct {
	// Type determines how credits are reset for a Subuser. `unlimited` indicates that there is no limit to the Subuser's credits. `recurring` indicates that the credits for the Subuser are reset according to the frequency determined by `reset_frequency`. `nonrecurring` indicates that there is no recurring schedule to reset credits and resets must be done on an ad hoc basis.
	Type Type1 `json:"type"`
	// The frequency with which a Subuser's credits are reset if `type` is set to `recurring`. Do _not_ include `reset_frequency` if you choose a reset `type` value of `unlimited` or `nonrecurring`.
	ResetFrequency *ResetFrequency1 `json:"reset_frequency,omitempty"`
	// Total number of credits to which the Subuser is to be reset. If `type` is `nonrecurring` then the Subuser's credits will be reset to `total` on a one-time basis. If `type` is `recurring` then the Subuser's credits will be reset to `total` every time a reset is scheduled in accordance with the `reset_frequency`. Do _not_ include `total` if you choose a reset `type` value of `unlimited`.
	Total *int32 `json:"total,omitempty"`
}

SubuserCreditsRequest struct for SubuserCreditsRequest

type SubuserPost

type SubuserPost struct {
	// The username of the subuser.
	Username string `json:"username"`
	// The user ID for this subuser.
	UserId float32 `json:"user_id"`
	// The email address for this subuser.
	Email            string                       `json:"email"`
	CreditAllocation *SubuserPostCreditAllocation `json:"credit_allocation,omitempty"`
	// The region this Subuser is assigned to. The property is returned only if the `include_region` parameter is included and set to `true` in the API request.
	Region *Region3 `json:"region,omitempty"`
}

SubuserPost struct for SubuserPost

type SubuserPostCreditAllocation

type SubuserPostCreditAllocation struct {
	Type *string `json:"type,omitempty"`
}

SubuserPostCreditAllocation struct for SubuserPostCreditAllocation

type SubuserStats

type SubuserStats struct {
	// The date the statistics were gathered.
	Date *string `json:"date,omitempty"`
	// The list of statistics.
	Stats *[]SubuserStatsStatsInner `json:"stats,omitempty"`
}

SubuserStats struct for SubuserStats

type SubuserStatsStatsInner

type SubuserStatsStatsInner struct {
	// The first name of the subuser.
	FirstName *string `json:"first_name,omitempty"`
	// The last name of the subuser.
	LastName *string                        `json:"last_name,omitempty"`
	Metrics  *SubuserStatsStatsInnerMetrics `json:"metrics,omitempty"`
	// The username of the subuser.
	Name *string `json:"name,omitempty"`
	// The type of account.
	Type *string `json:"type,omitempty"`
}

SubuserStatsStatsInner struct for SubuserStatsStatsInner

type SubuserStatsStatsInnerMetrics

type SubuserStatsStatsInnerMetrics struct {
	// The number of emails that were not allowed to be delivered by ISPs.
	Blocks *int32 `json:"blocks,omitempty"`
	// The number of emails that were dropped because of a bounce.
	BounceDrops *int32 `json:"bounce_drops,omitempty"`
	// The number of emails that bounced instead of being delivered.
	Bounces *int32 `json:"bounces,omitempty"`
	// The number of links that were clicked in your emails.
	Clicks *int32 `json:"clicks,omitempty"`
	// The number of emails that temporarily could not be delivered.
	Deferred *int32 `json:"deferred,omitempty"`
	// The number of emails SendGrid was able to confirm were actually delivered to a recipient.
	Delivered *int32 `json:"delivered,omitempty"`
	// The number of recipients who had malformed email addresses or whose mail provider reported the address as invalid.
	InvalidEmails *int32 `json:"invalid_emails,omitempty"`
	// The total number of times your emails were opened by recipients.
	Opens *int32 `json:"opens,omitempty"`
	// Requests from your website, application, or mail client via SMTP Relay or the API that SendGrid processed.
	Processed *int32 `json:"processed,omitempty"`
	// The number of emails that were requested to be delivered.
	Requests *int32 `json:"requests,omitempty"`
	// The number of emails that were dropped due to a recipient previously marking your emails as spam.
	SpamReportDrops *int32 `json:"spam_report_drops,omitempty"`
	// The number of recipients who marked your email as spam.
	SpamReports *int32 `json:"spam_reports,omitempty"`
	// The number of unique recipients who clicked links in your emails.
	UniqueClicks *int32 `json:"unique_clicks,omitempty"`
	// The number of unique recipients who opened your emails.
	UniqueOpens *int32 `json:"unique_opens,omitempty"`
	// The number of emails dropped due to a recipient unsubscribing from your emails.
	UnsubscribeDrops *int32 `json:"unsubscribe_drops,omitempty"`
	// The number of recipients who unsubscribed from your emails.
	Unsubscribes *int32 `json:"unsubscribes,omitempty"`
}

SubuserStatsStatsInnerMetrics struct for SubuserStatsStatsInnerMetrics

type Type

type Type string

Type the model 'Type'

const (
	TYPE_UNLIMITED    Type = "unlimited"
	TYPE_RECURRING    Type = "recurring"
	TYPE_NONRECURRING Type = "nonrecurring"
)

List of Type

type Type1

type Type1 string

Type1 the model 'Type1'

const (
	TYPE1_UNLIMITED    Type1 = "unlimited"
	TYPE1_RECURRING    Type1 = "recurring"
	TYPE1_NONRECURRING Type1 = "nonrecurring"
)

List of Type1

type UpdateSubuserCreditParam

type UpdateSubuserCreditParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
	//
	SubuserCreditsRequest *SubuserCreditsRequest `json:"SubuserCreditsRequest"`
}

func (*UpdateSubuserCreditParam) SetSubuserCreditsRequest

func (params *UpdateSubuserCreditParam) SetSubuserCreditsRequest(SubuserCreditsRequest SubuserCreditsRequest) *UpdateSubuserCreditParam

func (*UpdateSubuserCreditParam) SetSubuserName

func (params *UpdateSubuserCreditParam) SetSubuserName(SubuserName string) *UpdateSubuserCreditParam

type UpdateSubuserIp200Response

type UpdateSubuserIp200Response struct {
	// The IP addresses that are assigned to the subuser.
	Ips *[]string `json:"ips,omitempty"`
}

UpdateSubuserIp200Response struct for UpdateSubuserIp200Response

type UpdateSubuserIpParam

type UpdateSubuserIpParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
	//
	RequestBody *[]string `json:"request_body,omitempty"`
}

func (*UpdateSubuserIpParam) SetRequestBody

func (params *UpdateSubuserIpParam) SetRequestBody(RequestBody []string) *UpdateSubuserIpParam

func (*UpdateSubuserIpParam) SetSubuserName

func (params *UpdateSubuserIpParam) SetSubuserName(SubuserName string) *UpdateSubuserIpParam

type UpdateSubuserParam

type UpdateSubuserParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
	//
	UpdateSubuserRequest *UpdateSubuserRequest `json:"UpdateSubuserRequest,omitempty"`
}

func (*UpdateSubuserParam) SetSubuserName

func (params *UpdateSubuserParam) SetSubuserName(SubuserName string) *UpdateSubuserParam

func (*UpdateSubuserParam) SetUpdateSubuserRequest

func (params *UpdateSubuserParam) SetUpdateSubuserRequest(UpdateSubuserRequest UpdateSubuserRequest) *UpdateSubuserParam

type UpdateSubuserRemainingCreditParam

type UpdateSubuserRemainingCreditParam struct {
	// The username of the Subuser.
	SubuserName *string `json:"subuser_name"`
	//
	UpdateSubuserRemainingCreditRequest *UpdateSubuserRemainingCreditRequest `json:"UpdateSubuserRemainingCreditRequest"`
}

func (*UpdateSubuserRemainingCreditParam) SetSubuserName

func (params *UpdateSubuserRemainingCreditParam) SetSubuserName(SubuserName string) *UpdateSubuserRemainingCreditParam

func (*UpdateSubuserRemainingCreditParam) SetUpdateSubuserRemainingCreditRequest

func (params *UpdateSubuserRemainingCreditParam) SetUpdateSubuserRemainingCreditRequest(UpdateSubuserRemainingCreditRequest UpdateSubuserRemainingCreditRequest) *UpdateSubuserRemainingCreditParam

type UpdateSubuserRemainingCreditRequest

type UpdateSubuserRemainingCreditRequest struct {
	// The number of credits to add to or subtract from the current remaining credits for the Subuser. Use a positive number to increase the remaining credits or a negative number to reduce the remaining credits.
	AllocationUpdate int32 `json:"allocation_update"`
}

UpdateSubuserRemainingCreditRequest struct for UpdateSubuserRemainingCreditRequest

type UpdateSubuserRequest

type UpdateSubuserRequest struct {
	// Whether or not this subuser is disabled. `true` means disabled, `false` means enabled.
	Disabled *bool `json:"disabled,omitempty"`
}

UpdateSubuserRequest struct for UpdateSubuserRequest

type UpdateSubuserWebsiteAccessParam

type UpdateSubuserWebsiteAccessParam struct {
	//
	SubuserName *string `json:"subuser_name"`
	//
	UpdateSubuserWebsiteAccessRequest *UpdateSubuserWebsiteAccessRequest `json:"UpdateSubuserWebsiteAccessRequest,omitempty"`
}

func (*UpdateSubuserWebsiteAccessParam) SetSubuserName

func (params *UpdateSubuserWebsiteAccessParam) SetSubuserName(SubuserName string) *UpdateSubuserWebsiteAccessParam

func (*UpdateSubuserWebsiteAccessParam) SetUpdateSubuserWebsiteAccessRequest

func (params *UpdateSubuserWebsiteAccessParam) SetUpdateSubuserWebsiteAccessRequest(UpdateSubuserWebsiteAccessRequest UpdateSubuserWebsiteAccessRequest) *UpdateSubuserWebsiteAccessParam

type UpdateSubuserWebsiteAccessRequest

type UpdateSubuserWebsiteAccessRequest struct {
	// Whether or not to disable website access to the Subuser. `true` means disabled, `false` means enabled.
	Disabled *bool `json:"disabled,omitempty"`
}

UpdateSubuserWebsiteAccessRequest struct for UpdateSubuserWebsiteAccessRequest

Jump to

Keyboard shortcuts

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