adexperiencereport

package
v0.182.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package adexperiencereport provides access to the Ad Experience Report API.

For product documentation, see: https://developers.google.com/ad-experience-report/

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any 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/adexperiencereport/v1"
...
ctx := context.Background()
adexperiencereportService, err := adexperiencereport.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 google.golang.org/api/option.WithAPIKey:

adexperiencereportService, err := adexperiencereport.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
adexperiencereportService, err := adexperiencereport.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlatformSummary

type PlatformSummary struct {
	// BetterAdsStatus: The site's Ad Experience Report status on this platform.
	//
	// Possible values:
	//   "UNKNOWN" - Not reviewed.
	//   "PASSING" - Passing.
	//   "WARNING" - Warning. No longer a possible status.
	//   "FAILING" - Failing.
	BetterAdsStatus string `json:"betterAdsStatus,omitempty"`
	// EnforcementTime: The time at which enforcement
	// (https://support.google.com/webtools/answer/7308033) against the site began
	// or will begin on this platform. Not set when the filter_status is OFF.
	EnforcementTime string `json:"enforcementTime,omitempty"`
	// FilterStatus: The site's enforcement status
	// (https://support.google.com/webtools/answer/7308033) on this platform.
	//
	// Possible values:
	//   "UNKNOWN" - N/A.
	//   "ON" - Ad filtering is on.
	//   "OFF" - Ad filtering is off.
	//   "PAUSED" - Ad filtering is paused.
	//   "PENDING" - Ad filtering is pending.
	FilterStatus string `json:"filterStatus,omitempty"`
	// LastChangeTime: The time at which the site's status last changed on this
	// platform.
	LastChangeTime string `json:"lastChangeTime,omitempty"`
	// Region: The site's regions on this platform. No longer populated, because
	// there is no longer any semantic difference between sites in different
	// regions.
	//
	// Possible values:
	//   "REGION_UNKNOWN" - Ad standard not yet defined for your region.
	//   "REGION_A" - Region A.
	//   "REGION_B" - Region B.
	//   "REGION_C" - Region C.
	Region []string `json:"region,omitempty"`
	// ReportUrl: A link to the full Ad Experience Report for the site on this
	// platform.. Not set in ViolatingSitesResponse. Note that you must complete
	// the Search Console verification process
	// (https://support.google.com/webmasters/answer/9008080) for the site before
	// you can access the full report.
	ReportUrl string `json:"reportUrl,omitempty"`
	// UnderReview: Whether the site is currently under review on this platform.
	UnderReview bool `json:"underReview,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BetterAdsStatus") 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. "BetterAdsStatus") 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:"-"`
}

PlatformSummary: A site's Ad Experience Report summary on a single platform.

func (*PlatformSummary) MarshalJSON

func (s *PlatformSummary) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Sites *SitesService

	ViolatingSites *ViolatingSitesService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

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 added in v0.3.0

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type SiteSummaryResponse

type SiteSummaryResponse struct {
	// DesktopSummary: The site's Ad Experience Report summary on desktop.
	DesktopSummary *PlatformSummary `json:"desktopSummary,omitempty"`
	// MobileSummary: The site's Ad Experience Report summary on mobile.
	MobileSummary *PlatformSummary `json:"mobileSummary,omitempty"`
	// ReviewedSite: The name of the reviewed site, e.g. `google.com`.
	ReviewedSite string `json:"reviewedSite,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "DesktopSummary") 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. "DesktopSummary") 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:"-"`
}

SiteSummaryResponse: Response message for GetSiteSummary.

func (*SiteSummaryResponse) MarshalJSON

func (s *SiteSummaryResponse) MarshalJSON() ([]byte, error)

type SitesGetCall

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

func (*SitesGetCall) Context

func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall

Context sets the context to be used in this call's Do method.

func (*SitesGetCall) Do

Do executes the "adexperiencereport.sites.get" call. Any non-2xx status code is an error. Response headers are in either *SiteSummaryResponse.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 (*SitesGetCall) Fields

func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*SitesGetCall) Header

func (c *SitesGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*SitesGetCall) IfNoneMatch

func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall

IfNoneMatch sets an 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.

type SitesService

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

func NewSitesService

func NewSitesService(s *Service) *SitesService

func (*SitesService) Get

func (r *SitesService) Get(name string) *SitesGetCall

Get: Gets a site's Ad Experience Report summary.

  • name: The name of the site whose summary to get, e.g. `sites/http%3A%2F%2Fwww.google.com%2F`. Format: `sites/{site}`.

type ViolatingSitesListCall

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

func (*ViolatingSitesListCall) Context

Context sets the context to be used in this call's Do method.

func (*ViolatingSitesListCall) Do

Do executes the "adexperiencereport.violatingSites.list" call. Any non-2xx status code is an error. Response headers are in either *ViolatingSitesResponse.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 (*ViolatingSitesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*ViolatingSitesListCall) Header

func (c *ViolatingSitesListCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*ViolatingSitesListCall) IfNoneMatch

func (c *ViolatingSitesListCall) IfNoneMatch(entityTag string) *ViolatingSitesListCall

IfNoneMatch sets an 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.

type ViolatingSitesResponse

type ViolatingSitesResponse struct {
	// ViolatingSites: The list of violating sites.
	ViolatingSites []*SiteSummaryResponse `json:"violatingSites,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "ViolatingSites") 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. "ViolatingSites") 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:"-"`
}

ViolatingSitesResponse: Response message for ListViolatingSites.

func (*ViolatingSitesResponse) MarshalJSON

func (s *ViolatingSitesResponse) MarshalJSON() ([]byte, error)

type ViolatingSitesService

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

func NewViolatingSitesService

func NewViolatingSitesService(s *Service) *ViolatingSitesService

func (*ViolatingSitesService) List

List: Lists sites that are failing in the Ad Experience Report on at least one platform.

Jump to

Keyboard shortcuts

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