gmailpostmastertools
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package gmailpostmastertools provides access to the Gmail Postmaster Tools API.
For product documentation, see:https://developers.google.com/workspace/gmail/postmaster
Library status¶
These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.
When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.
Creating a client¶
Usage example:
import "google.golang.org/api/gmailpostmastertools/v1"...ctx := context.Background()gmailpostmastertoolsService, err := gmailpostmastertools.NewService(ctx)
In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options¶
To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/option.WithAPIKey:
gmailpostmastertoolsService, err := gmailpostmastertools.NewService(ctx, option.WithAPIKey("AIza..."))To use an OAuth token (e.g., a user token obtained via a three-legged OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)gmailpostmastertoolsService, err := gmailpostmastertools.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))Seegoogle.golang.org/api/option.ClientOption for details on options.
Index¶
- Constants
- type DeliveryError
- type Domain
- type DomainsGetCall
- func (c *DomainsGetCall) Context(ctx context.Context) *DomainsGetCall
- func (c *DomainsGetCall) Do(opts ...googleapi.CallOption) (*Domain, error)
- func (c *DomainsGetCall) Fields(s ...googleapi.Field) *DomainsGetCall
- func (c *DomainsGetCall) Header() http.Header
- func (c *DomainsGetCall) IfNoneMatch(entityTag string) *DomainsGetCall
- type DomainsListCall
- func (c *DomainsListCall) Context(ctx context.Context) *DomainsListCall
- func (c *DomainsListCall) Do(opts ...googleapi.CallOption) (*ListDomainsResponse, error)
- func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall
- func (c *DomainsListCall) Header() http.Header
- func (c *DomainsListCall) IfNoneMatch(entityTag string) *DomainsListCall
- func (c *DomainsListCall) PageSize(pageSize int64) *DomainsListCall
- func (c *DomainsListCall) PageToken(pageToken string) *DomainsListCall
- func (c *DomainsListCall) Pages(ctx context.Context, f func(*ListDomainsResponse) error) error
- type DomainsService
- type DomainsTrafficStatsGetCall
- func (c *DomainsTrafficStatsGetCall) Context(ctx context.Context) *DomainsTrafficStatsGetCall
- func (c *DomainsTrafficStatsGetCall) Do(opts ...googleapi.CallOption) (*TrafficStats, error)
- func (c *DomainsTrafficStatsGetCall) Fields(s ...googleapi.Field) *DomainsTrafficStatsGetCall
- func (c *DomainsTrafficStatsGetCall) Header() http.Header
- func (c *DomainsTrafficStatsGetCall) IfNoneMatch(entityTag string) *DomainsTrafficStatsGetCall
- type DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) Context(ctx context.Context) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) Do(opts ...googleapi.CallOption) (*ListTrafficStatsResponse, error)
- func (c *DomainsTrafficStatsListCall) EndDateDay(endDateDay int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) EndDateMonth(endDateMonth int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) EndDateYear(endDateYear int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) Fields(s ...googleapi.Field) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) Header() http.Header
- func (c *DomainsTrafficStatsListCall) IfNoneMatch(entityTag string) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) PageSize(pageSize int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) PageToken(pageToken string) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) Pages(ctx context.Context, f func(*ListTrafficStatsResponse) error) error
- func (c *DomainsTrafficStatsListCall) StartDateDay(startDateDay int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) StartDateMonth(startDateMonth int64) *DomainsTrafficStatsListCall
- func (c *DomainsTrafficStatsListCall) StartDateYear(startDateYear int64) *DomainsTrafficStatsListCall
- type DomainsTrafficStatsService
- type FeedbackLoop
- type IpReputation
- type ListDomainsResponse
- type ListTrafficStatsResponse
- type Service
- type TrafficStats
Constants¶
const (// See email traffic metrics for the domains you have registered in Gmail// Postmaster ToolsPostmasterReadonlyScope = "https://www.googleapis.com/auth/postmaster.readonly")
OAuth2 scopes used by this API.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeDeliveryError¶
type DeliveryError struct {// ErrorClass: The class of delivery error.//// Possible values:// "DELIVERY_ERROR_CLASS_UNSPECIFIED" - The default value which should never// be used explicitly.// "PERMANENT_ERROR" - Delivery of message has been rejected.// "TEMPORARY_ERROR" - Temporary failure of message delivery to the// recipient.ErrorClassstring `json:"errorClass,omitempty"`// ErrorRatio: The ratio of messages where the error occurred vs all// authenticated traffic.ErrorRatiofloat64 `json:"errorRatio,omitempty"`// ErrorType: The type of delivery error.//// Possible values:// "DELIVERY_ERROR_TYPE_UNSPECIFIED" - The default value which should never// be used explicitly.// "RATE_LIMIT_EXCEEDED" - The Domain or IP is sending traffic at a// suspiciously high rate, due to which temporary rate limits have been// imposed. The limit will be lifted when Gmail is confident enough of the// nature of the traffic.// "SUSPECTED_SPAM" - The traffic is suspected to be spam, by Gmail, for// various reasons.// "CONTENT_SPAMMY" - The traffic is suspected to be spammy, specific to the// content.// "BAD_ATTACHMENT" - Traffic contains attachments not supported by Gmail.// "BAD_DMARC_POLICY" - The sender domain has set up a DMARC rejection// policy.// "LOW_IP_REPUTATION" - The IP reputation of the sending IP is very low.// "LOW_DOMAIN_REPUTATION" - The Domain reputation of the sending domain is// very low.// "IP_IN_RBL" - The IP is listed in one or more public [Real-time Blackhole// Lists](http://en.wikipedia.org/wiki/DNSBL). Work with the RBL to get your IP// delisted.// "DOMAIN_IN_RBL" - The Domain is listed in one or more public [Real-time// Blackhole Lists](http://en.wikipedia.org/wiki/DNSBL). Work with the RBL to// get your domain delisted.// "BAD_PTR_RECORD" - The sending IP is missing a [PTR// record](https://support.google.com/domains/answer/3251147#ptr).ErrorTypestring `json:"errorType,omitempty"`// ForceSendFields is a list of field names (e.g. "ErrorClass") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ErrorClass") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}DeliveryError: Metric on a particular delivery error type.
func (DeliveryError)MarshalJSON¶
func (sDeliveryError) MarshalJSON() ([]byte,error)
func (*DeliveryError)UnmarshalJSON¶
func (s *DeliveryError) UnmarshalJSON(data []byte)error
typeDomain¶
type Domain struct {// CreateTime: Timestamp when the user registered this domain. Assigned by the// server.CreateTimestring `json:"createTime,omitempty"`// Name: The resource name of the Domain. Domain names have the form// `domains/{domain_name}`, where domain_name is the fully qualified domain// name (i.e., mymail.mydomain.com).Namestring `json:"name,omitempty"`// Permission: User’s permission for this domain. Assigned by the server.//// Possible values:// "PERMISSION_UNSPECIFIED" - The default value and should never be used// explicitly.// "OWNER" - User has read access to the domain and can share access with// others.// "READER" - User has read access to the domain.// "NONE" - User doesn't have permission to access information about the// domain. User did not verify ownership of domain nor was access granted by// other domain owners.Permissionstring `json:"permission,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "CreateTime") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "CreateTime") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}Domain: A registered domain resource in the Postmaster API.
func (Domain)MarshalJSON¶
typeDomainsGetCall¶
type DomainsGetCall struct {// contains filtered or unexported fields}func (*DomainsGetCall)Context¶
func (c *DomainsGetCall) Context(ctxcontext.Context) *DomainsGetCall
Context sets the context to be used in this call's Do method.
func (*DomainsGetCall)Do¶
func (c *DomainsGetCall) Do(opts ...googleapi.CallOption) (*Domain,error)
Do executes the "gmailpostmastertools.domains.get" call.Any non-2xx status code is an error. Response headers are in either*Domain.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*DomainsGetCall)Fields¶
func (c *DomainsGetCall) Fields(s ...googleapi.Field) *DomainsGetCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*DomainsGetCall)Header¶
func (c *DomainsGetCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*DomainsGetCall)IfNoneMatch¶
func (c *DomainsGetCall) IfNoneMatch(entityTagstring) *DomainsGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
typeDomainsListCall¶
type DomainsListCall struct {// contains filtered or unexported fields}func (*DomainsListCall)Context¶
func (c *DomainsListCall) Context(ctxcontext.Context) *DomainsListCall
Context sets the context to be used in this call's Do method.
func (*DomainsListCall)Do¶
func (c *DomainsListCall) Do(opts ...googleapi.CallOption) (*ListDomainsResponse,error)
Do executes the "gmailpostmastertools.domains.list" call.Any non-2xx status code is an error. Response headers are in either*ListDomainsResponse.ServerResponse.Header or (if a response was returned atall) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.
func (*DomainsListCall)Fields¶
func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*DomainsListCall)Header¶
func (c *DomainsListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*DomainsListCall)IfNoneMatch¶
func (c *DomainsListCall) IfNoneMatch(entityTagstring) *DomainsListCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
func (*DomainsListCall)PageSize¶
func (c *DomainsListCall) PageSize(pageSizeint64) *DomainsListCall
PageSize sets the optional parameter "pageSize": Requested page size. Servermay return fewer domains than requested. If unspecified, server will pick anappropriate default.
func (*DomainsListCall)PageToken¶
func (c *DomainsListCall) PageToken(pageTokenstring) *DomainsListCall
PageToken sets the optional parameter "pageToken": The next_page_token valuereturned from a previous List request, if any. This is the value ofListDomainsResponse.next_page_token returned from the previous call to`ListDomains` method.
func (*DomainsListCall)Pages¶
func (c *DomainsListCall) Pages(ctxcontext.Context, f func(*ListDomainsResponse)error)error
Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.
typeDomainsService¶
type DomainsService struct {TrafficStats *DomainsTrafficStatsService// contains filtered or unexported fields}funcNewDomainsService¶
func NewDomainsService(s *Service) *DomainsService
func (*DomainsService)Get¶
func (r *DomainsService) Get(namestring) *DomainsGetCall
Get: Gets a specific domain registered by the client. Returns NOT_FOUND ifthe domain does not exist.
- name: The resource name of the domain. It should have the form`domains/{domain_name}`, where domain_name is the fully qualified domainname.
func (*DomainsService)List¶
func (r *DomainsService) List() *DomainsListCall
List: Lists the domains that have been registered by the client. The orderof domains in the response is unspecified and non-deterministic. Newlycreated domains will not necessarily be added to the end of this list.
typeDomainsTrafficStatsGetCall¶
type DomainsTrafficStatsGetCall struct {// contains filtered or unexported fields}func (*DomainsTrafficStatsGetCall)Context¶
func (c *DomainsTrafficStatsGetCall) Context(ctxcontext.Context) *DomainsTrafficStatsGetCall
Context sets the context to be used in this call's Do method.
func (*DomainsTrafficStatsGetCall)Do¶
func (c *DomainsTrafficStatsGetCall) Do(opts ...googleapi.CallOption) (*TrafficStats,error)
Do executes the "gmailpostmastertools.domains.trafficStats.get" call.Any non-2xx status code is an error. Response headers are in either*TrafficStats.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*DomainsTrafficStatsGetCall)Fields¶
func (c *DomainsTrafficStatsGetCall) Fields(s ...googleapi.Field) *DomainsTrafficStatsGetCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*DomainsTrafficStatsGetCall)Header¶
func (c *DomainsTrafficStatsGetCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*DomainsTrafficStatsGetCall)IfNoneMatch¶
func (c *DomainsTrafficStatsGetCall) IfNoneMatch(entityTagstring) *DomainsTrafficStatsGetCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
typeDomainsTrafficStatsListCall¶
type DomainsTrafficStatsListCall struct {// contains filtered or unexported fields}func (*DomainsTrafficStatsListCall)Context¶
func (c *DomainsTrafficStatsListCall) Context(ctxcontext.Context) *DomainsTrafficStatsListCall
Context sets the context to be used in this call's Do method.
func (*DomainsTrafficStatsListCall)Do¶
func (c *DomainsTrafficStatsListCall) Do(opts ...googleapi.CallOption) (*ListTrafficStatsResponse,error)
Do executes the "gmailpostmastertools.domains.trafficStats.list" call.Any non-2xx status code is an error. Response headers are in either*ListTrafficStatsResponse.ServerResponse.Header or (if a response wasreturned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.
func (*DomainsTrafficStatsListCall)EndDateDay¶
func (c *DomainsTrafficStatsListCall) EndDateDay(endDateDayint64) *DomainsTrafficStatsListCall
EndDateDay sets the optional parameter "endDate.day": Day of a month. Mustbe from 1 to 31 and valid for the year and month, or 0 to specify a year byitself or a year and month where the day isn't significant.
func (*DomainsTrafficStatsListCall)EndDateMonth¶
func (c *DomainsTrafficStatsListCall) EndDateMonth(endDateMonthint64) *DomainsTrafficStatsListCall
EndDateMonth sets the optional parameter "endDate.month": Month of a year.Must be from 1 to 12, or 0 to specify a year without a month and day.
func (*DomainsTrafficStatsListCall)EndDateYear¶
func (c *DomainsTrafficStatsListCall) EndDateYear(endDateYearint64) *DomainsTrafficStatsListCall
EndDateYear sets the optional parameter "endDate.year": Year of the date.Must be from 1 to 9999, or 0 to specify a date without a year.
func (*DomainsTrafficStatsListCall)Fields¶
func (c *DomainsTrafficStatsListCall) Fields(s ...googleapi.Field) *DomainsTrafficStatsListCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*DomainsTrafficStatsListCall)Header¶
func (c *DomainsTrafficStatsListCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
func (*DomainsTrafficStatsListCall)IfNoneMatch¶
func (c *DomainsTrafficStatsListCall) IfNoneMatch(entityTagstring) *DomainsTrafficStatsListCall
IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.
func (*DomainsTrafficStatsListCall)PageSize¶
func (c *DomainsTrafficStatsListCall) PageSize(pageSizeint64) *DomainsTrafficStatsListCall
PageSize sets the optional parameter "pageSize": Requested page size. Servermay return fewer TrafficStats than requested. If unspecified, server willpick an appropriate default.
func (*DomainsTrafficStatsListCall)PageToken¶
func (c *DomainsTrafficStatsListCall) PageToken(pageTokenstring) *DomainsTrafficStatsListCall
PageToken sets the optional parameter "pageToken": The next_page_token valuereturned from a previous List request, if any. This is the value ofListTrafficStatsResponse.next_page_token returned from the previous call to`ListTrafficStats` method.
func (*DomainsTrafficStatsListCall)Pages¶
func (c *DomainsTrafficStatsListCall) Pages(ctxcontext.Context, f func(*ListTrafficStatsResponse)error)error
Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.
func (*DomainsTrafficStatsListCall)StartDateDay¶
func (c *DomainsTrafficStatsListCall) StartDateDay(startDateDayint64) *DomainsTrafficStatsListCall
StartDateDay sets the optional parameter "startDate.day": Day of a month.Must be from 1 to 31 and valid for the year and month, or 0 to specify ayear by itself or a year and month where the day isn't significant.
func (*DomainsTrafficStatsListCall)StartDateMonth¶
func (c *DomainsTrafficStatsListCall) StartDateMonth(startDateMonthint64) *DomainsTrafficStatsListCall
StartDateMonth sets the optional parameter "startDate.month": Month of ayear. Must be from 1 to 12, or 0 to specify a year without a month and day.
func (*DomainsTrafficStatsListCall)StartDateYear¶
func (c *DomainsTrafficStatsListCall) StartDateYear(startDateYearint64) *DomainsTrafficStatsListCall
StartDateYear sets the optional parameter "startDate.year": Year of thedate. Must be from 1 to 9999, or 0 to specify a date without a year.
typeDomainsTrafficStatsService¶
type DomainsTrafficStatsService struct {// contains filtered or unexported fields}funcNewDomainsTrafficStatsService¶
func NewDomainsTrafficStatsService(s *Service) *DomainsTrafficStatsService
func (*DomainsTrafficStatsService)Get¶
func (r *DomainsTrafficStatsService) Get(namestring) *DomainsTrafficStatsGetCall
Get: Get traffic statistics for a domain on a specific date. ReturnsPERMISSION_DENIED if user does not have permission to access TrafficStatsfor the domain.
- name: The resource name of the traffic statistics to get. E.g.,domains/mymail.mydomain.com/trafficStats/20160807.
func (*DomainsTrafficStatsService)List¶
func (r *DomainsTrafficStatsService) List(parentstring) *DomainsTrafficStatsListCall
List: List traffic statistics for all available days. ReturnsPERMISSION_DENIED if user does not have permission to access TrafficStatsfor the domain.
- parent: The resource name of the domain whose traffic statistics we'd liketo list. It should have the form `domains/{domain_name}`, wheredomain_name is the fully qualified domain name.
typeFeedbackLoop¶
type FeedbackLoop struct {// Id: Feedback loop identifier that uniquely identifies individual campaigns.Idstring `json:"id,omitempty"`// SpamRatio: The ratio of user marked spam messages with the identifier vs the// total number of inboxed messages with that identifier.SpamRatiofloat64 `json:"spamRatio,omitempty"`// ForceSendFields is a list of field names (e.g. "Id") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Id") to include in API requests// with the JSON null value. By default, fields with empty values are omitted// from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}FeedbackLoop: Feedback loop (https://support.google.com/mail/answer/6254652)identifier information.
func (FeedbackLoop)MarshalJSON¶
func (sFeedbackLoop) MarshalJSON() ([]byte,error)
func (*FeedbackLoop)UnmarshalJSON¶
func (s *FeedbackLoop) UnmarshalJSON(data []byte)error
typeIpReputation¶
type IpReputation struct {// IpCount: Total number of unique IPs in this reputation category. This metric// only pertains to traffic that passed SPF (http://www.openspf.org/) or DKIM// (http://www.dkim.org/).IpCountint64 `json:"ipCount,omitempty,string"`// Reputation: The reputation category this IP reputation represents.//// Possible values:// "REPUTATION_CATEGORY_UNSPECIFIED" - The default value which should never// be used explicitly. This represents the state where no reputation// information is available.// "HIGH" - Has a good track record of a very low spam rate, and complies// with Gmail's sender guidelines. Mail will rarely be marked by the spam// filter.// "MEDIUM" - Known to send good mail, but is prone to sending a low volume// of spam intermittently. Most of the email from this entity will have a fair// deliverability rate, except when there is a notable increase in spam levels.// "LOW" - Known to send a considerable volume of spam regularly, and mail// from this sender will likely be marked as spam.// "BAD" - History of sending an enormously high volume of spam. Mail coming// from this entity will almost always be rejected at SMTP level or marked as// spam.Reputationstring `json:"reputation,omitempty"`// SampleIps: A sample of IPs in this reputation category.SampleIps []string `json:"sampleIps,omitempty"`// ForceSendFields is a list of field names (e.g. "IpCount") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "IpCount") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}IpReputation: IP Reputation information for a set of IPs in a specificreputation category.
func (IpReputation)MarshalJSON¶
func (sIpReputation) MarshalJSON() ([]byte,error)
typeListDomainsResponse¶
type ListDomainsResponse struct {// Domains: The list of domains.Domains []*Domain `json:"domains,omitempty"`// NextPageToken: Token to retrieve the next page of results, or empty if there// are no more results in the list.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Domains") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Domains") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ListDomainsResponse: Response message for ListDomains.
func (ListDomainsResponse)MarshalJSON¶
func (sListDomainsResponse) MarshalJSON() ([]byte,error)
typeListTrafficStatsResponse¶
type ListTrafficStatsResponse struct {// NextPageToken: Token to retrieve the next page of results, or empty if there// are no more results in the list.NextPageTokenstring `json:"nextPageToken,omitempty"`// TrafficStats: The list of TrafficStats.TrafficStats []*TrafficStats `json:"trafficStats,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "NextPageToken") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "NextPageToken") to include in API// requests with the JSON null value. By default, fields with empty values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}ListTrafficStatsResponse: Response message for ListTrafficStats.
func (ListTrafficStatsResponse)MarshalJSON¶
func (sListTrafficStatsResponse) MarshalJSON() ([]byte,error)
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentDomains *DomainsService// contains filtered or unexported fields} funcNewdeprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead.To provide a custom HTTP client, use option.WithHTTPClient.If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
funcNewService¶
NewService creates a new Service.
typeTrafficStats¶
type TrafficStats struct {// DeliveryErrors: Delivery errors for the domain. This metric only pertains to// traffic that passed SPF (http://www.openspf.org/) or DKIM// (http://www.dkim.org/).DeliveryErrors []*DeliveryError `json:"deliveryErrors,omitempty"`// DkimSuccessRatio: The ratio of mail that successfully authenticated with// DKIM vs. all mail that attempted to authenticate with DKIM// (http://www.dkim.org/). Spoofed mail is excluded.DkimSuccessRatiofloat64 `json:"dkimSuccessRatio,omitempty"`// DmarcSuccessRatio: The ratio of mail that passed DMARC (https://dmarc.org/)// alignment checks vs all mail received from the domain that successfully// authenticated with either of SPF (http://www.openspf.org/) or DKIM// (http://www.dkim.org/).DmarcSuccessRatiofloat64 `json:"dmarcSuccessRatio,omitempty"`// DomainReputation: Reputation of the domain.//// Possible values:// "REPUTATION_CATEGORY_UNSPECIFIED" - The default value which should never// be used explicitly. This represents the state where no reputation// information is available.// "HIGH" - Has a good track record of a very low spam rate, and complies// with Gmail's sender guidelines. Mail will rarely be marked by the spam// filter.// "MEDIUM" - Known to send good mail, but is prone to sending a low volume// of spam intermittently. Most of the email from this entity will have a fair// deliverability rate, except when there is a notable increase in spam levels.// "LOW" - Known to send a considerable volume of spam regularly, and mail// from this sender will likely be marked as spam.// "BAD" - History of sending an enormously high volume of spam. Mail coming// from this entity will almost always be rejected at SMTP level or marked as// spam.DomainReputationstring `json:"domainReputation,omitempty"`// InboundEncryptionRatio: The ratio of incoming mail (to Gmail), that passed// secure transport (TLS) vs all mail received from that domain. This metric// only pertains to traffic that passed SPF (http://www.openspf.org/) or DKIM// (http://www.dkim.org/).InboundEncryptionRatiofloat64 `json:"inboundEncryptionRatio,omitempty"`// IpReputations: Reputation information pertaining to the IP addresses of the// email servers for the domain. There is exactly one entry for each reputation// category except REPUTATION_CATEGORY_UNSPECIFIED.IpReputations []*IpReputation `json:"ipReputations,omitempty"`// Name: The resource name of the traffic statistics. Traffic statistic names// have the form `domains/{domain}/trafficStats/{date}`, where domain_name is// the fully qualified domain name (i.e., mymail.mydomain.com) of the domain// this traffic statistics pertains to and date is the date in yyyymmdd format// that these statistics corresponds to. For example:// domains/mymail.mydomain.com/trafficStats/20160807Namestring `json:"name,omitempty"`// OutboundEncryptionRatio: The ratio of outgoing mail (from Gmail) that was// accepted over secure transport (TLS).OutboundEncryptionRatiofloat64 `json:"outboundEncryptionRatio,omitempty"`// SpammyFeedbackLoops: Spammy [Feedback loop identifiers]// (https://support.google.com/mail/answer/6254652) with their individual spam// rates. This metric only pertains to traffic that is authenticated by DKIM// (http://www.dkim.org/).SpammyFeedbackLoops []*FeedbackLoop `json:"spammyFeedbackLoops,omitempty"`// SpfSuccessRatio: The ratio of mail that successfully authenticated with SPF// vs. all mail that attempted to authenticate with SPF// (http://www.openspf.org/). Spoofed mail is excluded.SpfSuccessRatiofloat64 `json:"spfSuccessRatio,omitempty"`// UserReportedSpamRatio: The ratio of user-report spam vs. email that was sent// to the inbox. This is potentially inexact -- users may want to refer to the// description of the interval fields userReportedSpamRatioLowerBound and// userReportedSpamRatioUpperBound for more explicit accuracy guarantees. This// metric only pertains to emails authenticated by DKIM (http://www.dkim.org/).UserReportedSpamRatiofloat64 `json:"userReportedSpamRatio,omitempty"`// UserReportedSpamRatioLowerBound: The lower bound of the confidence interval// for the user reported spam ratio. If this field is set, then the value of// userReportedSpamRatio is set to the midpoint of this interval and is thus// inexact. However, the true ratio is guaranteed to be in between this lower// bound and the corresponding upper bound 95% of the time. This metric only// pertains to emails authenticated by DKIM (http://www.dkim.org/).UserReportedSpamRatioLowerBoundfloat64 `json:"userReportedSpamRatioLowerBound,omitempty"`// UserReportedSpamRatioUpperBound: The upper bound of the confidence interval// for the user reported spam ratio. If this field is set, then the value of// userReportedSpamRatio is set to the midpoint of this interval and is thus// inexact. However, the true ratio is guaranteed to be in between this upper// bound and the corresponding lower bound 95% of the time. This metric only// pertains to emails authenticated by DKIM (http://www.dkim.org/).UserReportedSpamRatioUpperBoundfloat64 `json:"userReportedSpamRatioUpperBound,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "DeliveryErrors") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "DeliveryErrors") to include in// API requests with the JSON null value. By default, fields with empty values// are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}TrafficStats: Email traffic statistics pertaining to a specific date.
func (TrafficStats)MarshalJSON¶
func (sTrafficStats) MarshalJSON() ([]byte,error)
func (*TrafficStats)UnmarshalJSON¶
func (s *TrafficStats) UnmarshalJSON(data []byte)error