Documentation ¶
Overview ¶
Package gmailpostmastertools provides access to the Gmail Postmaster Tools API.
For product documentation, see: https://developers.google.com/gmail/postmaster
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 for authentication.
For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options ¶
To use an API key for authentication (note: some APIs do not support API keys), use 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 OAuth flow), use option.WithTokenSource:
config := &oauth2.Config{...} // ... token, err := config.Exchange(ctx, ...) gmailpostmastertoolsService, err := gmailpostmastertools.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
See https://godoc.org/google.golang.org/api/option/ 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 Tools PostmasterReadonlyScope = "https://www.googleapis.com/auth/postmaster.readonly" )
OAuth2 scopes used by this API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliveryError ¶
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. ErrorClass string `json:"errorClass,omitempty"` // ErrorRatio: The ratio of messages where the error occurred vs all // authenticated traffic. ErrorRatio float64 `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). ErrorType string `json:"errorType,omitempty"` // ForceSendFields is a list of field names (e.g. "ErrorClass") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
DeliveryError: Metric on a particular delivery error type.
func (*DeliveryError) MarshalJSON ¶
func (s *DeliveryError) MarshalJSON() ([]byte, error)
func (*DeliveryError) UnmarshalJSON ¶
func (s *DeliveryError) UnmarshalJSON(data []byte) error
type Domain ¶
type Domain struct { // CreateTime: Timestamp when the user registered this domain. Assigned // by the server. CreateTime string `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). Name string `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. Permission string `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 values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
Domain: A registered domain resource in the Postmaster API.
func (*Domain) MarshalJSON ¶
type DomainsGetCall ¶
type DomainsGetCall struct {
// contains filtered or unexported fields
}
func (*DomainsGetCall) Context ¶
func (c *DomainsGetCall) Context(ctx context.Context) *DomainsGetCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*DomainsGetCall) Do ¶
func (c *DomainsGetCall) Do(opts ...googleapi.CallOption) (*Domain, error)
Do executes the "gmailpostmastertools.domains.get" call. Exactly one of *Domain or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Domain.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether 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. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*DomainsGetCall) Header ¶
func (c *DomainsGetCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*DomainsGetCall) IfNoneMatch ¶
func (c *DomainsGetCall) IfNoneMatch(entityTag string) *DomainsGetCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
type DomainsListCall ¶
type DomainsListCall struct {
// contains filtered or unexported fields
}
func (*DomainsListCall) Context ¶
func (c *DomainsListCall) Context(ctx context.Context) *DomainsListCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*DomainsListCall) Do ¶
func (c *DomainsListCall) Do(opts ...googleapi.CallOption) (*ListDomainsResponse, error)
Do executes the "gmailpostmastertools.domains.list" call. Exactly one of *ListDomainsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListDomainsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*DomainsListCall) Fields ¶
func (c *DomainsListCall) Fields(s ...googleapi.Field) *DomainsListCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*DomainsListCall) Header ¶
func (c *DomainsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*DomainsListCall) IfNoneMatch ¶
func (c *DomainsListCall) IfNoneMatch(entityTag string) *DomainsListCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
func (*DomainsListCall) PageSize ¶
func (c *DomainsListCall) PageSize(pageSize int64) *DomainsListCall
PageSize sets the optional parameter "pageSize": Requested page size. Server may return fewer domains than requested. If unspecified, server will pick an appropriate default.
func (*DomainsListCall) PageToken ¶
func (c *DomainsListCall) PageToken(pageToken string) *DomainsListCall
PageToken sets the optional parameter "pageToken": The next_page_token value returned from a previous List request, if any. This is the value of ListDomainsResponse.next_page_token returned from the previous call to `ListDomains` method.
func (*DomainsListCall) Pages ¶
func (c *DomainsListCall) Pages(ctx context.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.
type DomainsService ¶
type DomainsService struct { TrafficStats *DomainsTrafficStatsService // contains filtered or unexported fields }
func NewDomainsService ¶
func NewDomainsService(s *Service) *DomainsService
func (*DomainsService) Get ¶
func (r *DomainsService) Get(name string) *DomainsGetCall
Get: Gets a specific domain registered by the client. Returns NOT_FOUND if the 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 domain name.
func (*DomainsService) List ¶
func (r *DomainsService) List() *DomainsListCall
List: Lists the domains that have been registered by the client. The order of domains in the response is unspecified and non-deterministic. Newly created domains will not necessarily be added to the end of this list.
type DomainsTrafficStatsGetCall ¶
type DomainsTrafficStatsGetCall struct {
// contains filtered or unexported fields
}
func (*DomainsTrafficStatsGetCall) Context ¶
func (c *DomainsTrafficStatsGetCall) Context(ctx context.Context) *DomainsTrafficStatsGetCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*DomainsTrafficStatsGetCall) Do ¶
func (c *DomainsTrafficStatsGetCall) Do(opts ...googleapi.CallOption) (*TrafficStats, error)
Do executes the "gmailpostmastertools.domains.trafficStats.get" call. Exactly one of *TrafficStats or error will be non-nil. 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 check whether 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. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*DomainsTrafficStatsGetCall) Header ¶
func (c *DomainsTrafficStatsGetCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*DomainsTrafficStatsGetCall) IfNoneMatch ¶
func (c *DomainsTrafficStatsGetCall) IfNoneMatch(entityTag string) *DomainsTrafficStatsGetCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
type DomainsTrafficStatsListCall ¶
type DomainsTrafficStatsListCall struct {
// contains filtered or unexported fields
}
func (*DomainsTrafficStatsListCall) Context ¶
func (c *DomainsTrafficStatsListCall) Context(ctx context.Context) *DomainsTrafficStatsListCall
Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.
func (*DomainsTrafficStatsListCall) Do ¶
func (c *DomainsTrafficStatsListCall) Do(opts ...googleapi.CallOption) (*ListTrafficStatsResponse, error)
Do executes the "gmailpostmastertools.domains.trafficStats.list" call. Exactly one of *ListTrafficStatsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListTrafficStatsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (*DomainsTrafficStatsListCall) EndDateDay ¶
func (c *DomainsTrafficStatsListCall) EndDateDay(endDateDay int64) *DomainsTrafficStatsListCall
EndDateDay sets the optional parameter "endDate.day": Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
func (*DomainsTrafficStatsListCall) EndDateMonth ¶
func (c *DomainsTrafficStatsListCall) EndDateMonth(endDateMonth int64) *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(endDateYear int64) *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. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
func (*DomainsTrafficStatsListCall) Header ¶
func (c *DomainsTrafficStatsListCall) Header() http.Header
Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.
func (*DomainsTrafficStatsListCall) IfNoneMatch ¶
func (c *DomainsTrafficStatsListCall) IfNoneMatch(entityTag string) *DomainsTrafficStatsListCall
IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.
func (*DomainsTrafficStatsListCall) PageSize ¶
func (c *DomainsTrafficStatsListCall) PageSize(pageSize int64) *DomainsTrafficStatsListCall
PageSize sets the optional parameter "pageSize": Requested page size. Server may return fewer TrafficStats than requested. If unspecified, server will pick an appropriate default.
func (*DomainsTrafficStatsListCall) PageToken ¶
func (c *DomainsTrafficStatsListCall) PageToken(pageToken string) *DomainsTrafficStatsListCall
PageToken sets the optional parameter "pageToken": The next_page_token value returned from a previous List request, if any. This is the value of ListTrafficStatsResponse.next_page_token returned from the previous call to `ListTrafficStats` method.
func (*DomainsTrafficStatsListCall) Pages ¶
func (c *DomainsTrafficStatsListCall) Pages(ctx context.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(startDateDay int64) *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 a year by itself or a year and month where the day isn't significant.
func (*DomainsTrafficStatsListCall) StartDateMonth ¶
func (c *DomainsTrafficStatsListCall) StartDateMonth(startDateMonth int64) *DomainsTrafficStatsListCall
StartDateMonth sets the optional parameter "startDate.month": Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
func (*DomainsTrafficStatsListCall) StartDateYear ¶
func (c *DomainsTrafficStatsListCall) StartDateYear(startDateYear int64) *DomainsTrafficStatsListCall
StartDateYear sets the optional parameter "startDate.year": Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
type DomainsTrafficStatsService ¶
type DomainsTrafficStatsService struct {
// contains filtered or unexported fields
}
func NewDomainsTrafficStatsService ¶
func NewDomainsTrafficStatsService(s *Service) *DomainsTrafficStatsService
func (*DomainsTrafficStatsService) Get ¶
func (r *DomainsTrafficStatsService) Get(name string) *DomainsTrafficStatsGetCall
Get: Get traffic statistics for a domain on a specific date. Returns PERMISSION_DENIED if user does not have permission to access TrafficStats for 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(parent string) *DomainsTrafficStatsListCall
List: List traffic statistics for all available days. Returns PERMISSION_DENIED if user does not have permission to access TrafficStats for the domain.
- parent: The resource name of the domain whose traffic statistics we'd like to list. It should have the form `domains/{domain_name}`, where domain_name is the fully qualified domain name.
type FeedbackLoop ¶
type FeedbackLoop struct { // Id: Feedback loop identifier that uniquely identifies individual // campaigns. Id string `json:"id,omitempty"` // SpamRatio: The ratio of user marked spam messages with the identifier // vs the total number of inboxed messages with that identifier. SpamRatio float64 `json:"spamRatio,omitempty"` // ForceSendFields is a list of field names (e.g. "Id") to // unconditionally include in API requests. By default, fields with // empty values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
FeedbackLoop: Feedback loop (https://support.google.com/mail/answer/6254652) identifier information.
func (*FeedbackLoop) MarshalJSON ¶
func (s *FeedbackLoop) MarshalJSON() ([]byte, error)
func (*FeedbackLoop) UnmarshalJSON ¶
func (s *FeedbackLoop) UnmarshalJSON(data []byte) error
type IpReputation ¶
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/). IpCount int64 `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. Reputation string `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 values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
IpReputation: IP Reputation information for a set of IPs in a specific reputation category.
func (*IpReputation) MarshalJSON ¶
func (s *IpReputation) MarshalJSON() ([]byte, error)
type ListDomainsResponse ¶
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. NextPageToken string `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 values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with an // empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
ListDomainsResponse: Response message for ListDomains.
func (*ListDomainsResponse) MarshalJSON ¶
func (s *ListDomainsResponse) MarshalJSON() ([]byte, error)
type ListTrafficStatsResponse ¶
type ListTrafficStatsResponse struct { // NextPageToken: Token to retrieve the next page of results, or empty // if there are no more results in the list. NextPageToken string `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 values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field with // an empty value appearing in NullFields will be sent to the server as // null. It is an error if a field in this list has a non-empty value. // This may be used to include null fields in Patch requests. NullFields []string `json:"-"` }
ListTrafficStatsResponse: Response message for ListTrafficStats.
func (*ListTrafficStatsResponse) MarshalJSON ¶
func (s *ListTrafficStatsResponse) MarshalJSON() ([]byte, error)
type Service ¶
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Domains *DomainsService // contains filtered or unexported fields }
func New
deprecated
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.
func NewService ¶
NewService creates a new Service.
type TrafficStats ¶
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. DkimSuccessRatio float64 `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/). DmarcSuccessRatio float64 `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. DomainReputation string `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/). InboundEncryptionRatio float64 `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/20160807 Name string `json:"name,omitempty"` // OutboundEncryptionRatio: The ratio of outgoing mail (from Gmail) that // was accepted over secure transport (TLS). OutboundEncryptionRatio float64 `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. SpfSuccessRatio float64 `json:"spfSuccessRatio,omitempty"` // UserReportedSpamRatio: The ratio of user-report spam vs. email that // was sent to the inbox. This metric only pertains to emails // authenticated by DKIM (http://www.dkim.org/). UserReportedSpamRatio float64 `json:"userReportedSpamRatio,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 values are omitted from API requests. However, any non-pointer, // non-interface field appearing in ForceSendFields will be sent to the // server regardless of whether the field is empty or not. This may be // used to include empty fields in Patch requests. 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. However, any field // with an empty value appearing in NullFields will be sent to the // server as null. It is an error if a field in this list has a // non-empty value. This may be used to include null fields in Patch // requests. NullFields []string `json:"-"` }
TrafficStats: Email traffic statistics pertaining to a specific date.
func (*TrafficStats) MarshalJSON ¶
func (s *TrafficStats) MarshalJSON() ([]byte, error)
func (*TrafficStats) UnmarshalJSON ¶
func (s *TrafficStats) UnmarshalJSON(data []byte) error