...

Package admob

import "google.golang.org/api/admob/v1"
Overview
Index

Overview ▾

Package admob provides access to the AdMob API.

For product documentation, see: https://developers.google.com/admob/api/

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/admob/v1"
...
ctx := context.Background()
admobService, err := admob.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

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

admobService, err := admob.NewService(ctx, option.WithScopes(admob.AdmobReportScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

admobService, err := admob.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, ...)
admobService, err := admob.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

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

Index ▾

Constants
type AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) Context(ctx context.Context) *AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitsResponse, error)
    func (c *AccountsAdUnitsListCall) Fields(s ...googleapi.Field) *AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) Header() http.Header
    func (c *AccountsAdUnitsListCall) IfNoneMatch(entityTag string) *AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) PageSize(pageSize int64) *AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) PageToken(pageToken string) *AccountsAdUnitsListCall
    func (c *AccountsAdUnitsListCall) Pages(ctx context.Context, f func(*ListAdUnitsResponse) error) error
type AccountsAdUnitsService
    func NewAccountsAdUnitsService(s *Service) *AccountsAdUnitsService
    func (r *AccountsAdUnitsService) List(parent string) *AccountsAdUnitsListCall
type AccountsAppsListCall
    func (c *AccountsAppsListCall) Context(ctx context.Context) *AccountsAppsListCall
    func (c *AccountsAppsListCall) Do(opts ...googleapi.CallOption) (*ListAppsResponse, error)
    func (c *AccountsAppsListCall) Fields(s ...googleapi.Field) *AccountsAppsListCall
    func (c *AccountsAppsListCall) Header() http.Header
    func (c *AccountsAppsListCall) IfNoneMatch(entityTag string) *AccountsAppsListCall
    func (c *AccountsAppsListCall) PageSize(pageSize int64) *AccountsAppsListCall
    func (c *AccountsAppsListCall) PageToken(pageToken string) *AccountsAppsListCall
    func (c *AccountsAppsListCall) Pages(ctx context.Context, f func(*ListAppsResponse) error) error
type AccountsAppsService
    func NewAccountsAppsService(s *Service) *AccountsAppsService
    func (r *AccountsAppsService) List(parent string) *AccountsAppsListCall
type AccountsGetCall
    func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall
    func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*PublisherAccount, error)
    func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall
    func (c *AccountsGetCall) Header() http.Header
    func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall
type AccountsListCall
    func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall
    func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListPublisherAccountsResponse, error)
    func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall
    func (c *AccountsListCall) Header() http.Header
    func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall
    func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall
    func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall
    func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListPublisherAccountsResponse) error) error
type AccountsMediationReportGenerateCall
    func (c *AccountsMediationReportGenerateCall) Context(ctx context.Context) *AccountsMediationReportGenerateCall
    func (c *AccountsMediationReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateMediationReportResponse, error)
    func (c *AccountsMediationReportGenerateCall) Fields(s ...googleapi.Field) *AccountsMediationReportGenerateCall
    func (c *AccountsMediationReportGenerateCall) Header() http.Header
type AccountsMediationReportService
    func NewAccountsMediationReportService(s *Service) *AccountsMediationReportService
    func (r *AccountsMediationReportService) Generate(parent string, generatemediationreportrequest *GenerateMediationReportRequest) *AccountsMediationReportGenerateCall
type AccountsNetworkReportGenerateCall
    func (c *AccountsNetworkReportGenerateCall) Context(ctx context.Context) *AccountsNetworkReportGenerateCall
    func (c *AccountsNetworkReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateNetworkReportResponse, error)
    func (c *AccountsNetworkReportGenerateCall) Fields(s ...googleapi.Field) *AccountsNetworkReportGenerateCall
    func (c *AccountsNetworkReportGenerateCall) Header() http.Header
type AccountsNetworkReportService
    func NewAccountsNetworkReportService(s *Service) *AccountsNetworkReportService
    func (r *AccountsNetworkReportService) Generate(parent string, generatenetworkreportrequest *GenerateNetworkReportRequest) *AccountsNetworkReportGenerateCall
type AccountsService
    func NewAccountsService(s *Service) *AccountsService
    func (r *AccountsService) Get(name string) *AccountsGetCall
    func (r *AccountsService) List() *AccountsListCall
type AdUnit
    func (s *AdUnit) MarshalJSON() ([]byte, error)
type App
    func (s *App) MarshalJSON() ([]byte, error)
type AppLinkedAppInfo
    func (s *AppLinkedAppInfo) MarshalJSON() ([]byte, error)
type AppManualAppInfo
    func (s *AppManualAppInfo) MarshalJSON() ([]byte, error)
type Date
    func (s *Date) MarshalJSON() ([]byte, error)
type DateRange
    func (s *DateRange) MarshalJSON() ([]byte, error)
type GenerateMediationReportRequest
    func (s *GenerateMediationReportRequest) MarshalJSON() ([]byte, error)
type GenerateMediationReportResponse
    func (s *GenerateMediationReportResponse) MarshalJSON() ([]byte, error)
type GenerateNetworkReportRequest
    func (s *GenerateNetworkReportRequest) MarshalJSON() ([]byte, error)
type GenerateNetworkReportResponse
    func (s *GenerateNetworkReportResponse) MarshalJSON() ([]byte, error)
type ListAdUnitsResponse
    func (s *ListAdUnitsResponse) MarshalJSON() ([]byte, error)
type ListAppsResponse
    func (s *ListAppsResponse) MarshalJSON() ([]byte, error)
type ListPublisherAccountsResponse
    func (s *ListPublisherAccountsResponse) MarshalJSON() ([]byte, error)
type LocalizationSettings
    func (s *LocalizationSettings) MarshalJSON() ([]byte, error)
type MediationReportSpec
    func (s *MediationReportSpec) MarshalJSON() ([]byte, error)
type MediationReportSpecDimensionFilter
    func (s *MediationReportSpecDimensionFilter) MarshalJSON() ([]byte, error)
type MediationReportSpecSortCondition
    func (s *MediationReportSpecSortCondition) MarshalJSON() ([]byte, error)
type NetworkReportSpec
    func (s *NetworkReportSpec) MarshalJSON() ([]byte, error)
type NetworkReportSpecDimensionFilter
    func (s *NetworkReportSpecDimensionFilter) MarshalJSON() ([]byte, error)
type NetworkReportSpecSortCondition
    func (s *NetworkReportSpecSortCondition) MarshalJSON() ([]byte, error)
type PublisherAccount
    func (s *PublisherAccount) MarshalJSON() ([]byte, error)
type ReportFooter
    func (s *ReportFooter) MarshalJSON() ([]byte, error)
type ReportHeader
    func (s *ReportHeader) MarshalJSON() ([]byte, error)
type ReportRow
    func (s *ReportRow) MarshalJSON() ([]byte, error)
type ReportRowDimensionValue
    func (s *ReportRowDimensionValue) MarshalJSON() ([]byte, error)
type ReportRowMetricValue
    func (s *ReportRowMetricValue) MarshalJSON() ([]byte, error)
    func (s *ReportRowMetricValue) UnmarshalJSON(data []byte) error
type ReportWarning
    func (s *ReportWarning) MarshalJSON() ([]byte, error)
type Service
    func New(client *http.Client) (*Service, error)
    func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
type StringList
    func (s *StringList) MarshalJSON() ([]byte, error)

Package files

admob-gen.go

Constants

OAuth2 scopes used by this API.

const (
    // See your AdMob data
    AdmobReadonlyScope = "https://www.googleapis.com/auth/admob.readonly"

    // See your AdMob data
    AdmobReportScope = "https://www.googleapis.com/auth/admob.report"
)

type AccountsAdUnitsListCall

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

func (*AccountsAdUnitsListCall) Context

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

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

func (*AccountsAdUnitsListCall) Do

func (c *AccountsAdUnitsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitsResponse, error)

Do executes the "admob.accounts.adUnits.list" call. Any non-2xx status code is an error. Response headers are in either *ListAdUnitsResponse.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 (*AccountsAdUnitsListCall) Fields

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

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

func (*AccountsAdUnitsListCall) Header

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

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

func (*AccountsAdUnitsListCall) IfNoneMatch

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

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.

func (*AccountsAdUnitsListCall) PageSize

func (c *AccountsAdUnitsListCall) PageSize(pageSize int64) *AccountsAdUnitsListCall

PageSize sets the optional parameter "pageSize": The maximum number of ad units to return. If unspecified or 0, at most 10,000 ad units will be returned. The maximum value is 20,000; values above 20,000 will be coerced to 20,000.

func (*AccountsAdUnitsListCall) PageToken

func (c *AccountsAdUnitsListCall) PageToken(pageToken string) *AccountsAdUnitsListCall

PageToken sets the optional parameter "pageToken": The value returned by the last `ListAdUnitsResponse`; indicates that this is a continuation of a prior `ListAdUnits` call, and that the system should return the next page of data.

func (*AccountsAdUnitsListCall) Pages

func (c *AccountsAdUnitsListCall) Pages(ctx context.Context, f func(*ListAdUnitsResponse) 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 AccountsAdUnitsService

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

func NewAccountsAdUnitsService

func NewAccountsAdUnitsService(s *Service) *AccountsAdUnitsService

func (*AccountsAdUnitsService) List

func (r *AccountsAdUnitsService) List(parent string) *AccountsAdUnitsListCall

List: List the ad units under the specified AdMob account.

type AccountsAppsListCall

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

func (*AccountsAppsListCall) Context

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

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

func (*AccountsAppsListCall) Do

func (c *AccountsAppsListCall) Do(opts ...googleapi.CallOption) (*ListAppsResponse, error)

Do executes the "admob.accounts.apps.list" call. Any non-2xx status code is an error. Response headers are in either *ListAppsResponse.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 (*AccountsAppsListCall) Fields

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

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

func (*AccountsAppsListCall) Header

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

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

func (*AccountsAppsListCall) IfNoneMatch

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

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.

func (*AccountsAppsListCall) PageSize

func (c *AccountsAppsListCall) PageSize(pageSize int64) *AccountsAppsListCall

PageSize sets the optional parameter "pageSize": The maximum number of apps to return. If unspecified or 0, at most 10,000 apps will be returned. The maximum value is 20,000; values above 20,000 will be coerced to 20,000.

func (*AccountsAppsListCall) PageToken

func (c *AccountsAppsListCall) PageToken(pageToken string) *AccountsAppsListCall

PageToken sets the optional parameter "pageToken": The value returned by the last `ListAppsResponse`; indicates that this is a continuation of a prior `ListApps` call, and that the system should return the next page of data.

func (*AccountsAppsListCall) Pages

func (c *AccountsAppsListCall) Pages(ctx context.Context, f func(*ListAppsResponse) 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 AccountsAppsService

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

func NewAccountsAppsService

func NewAccountsAppsService(s *Service) *AccountsAppsService

func (*AccountsAppsService) List

func (r *AccountsAppsService) List(parent string) *AccountsAppsListCall

List: List the apps under the specified AdMob account.

type AccountsGetCall

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

func (*AccountsGetCall) Context

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

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

func (*AccountsGetCall) Do

func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*PublisherAccount, error)

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

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

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

func (*AccountsGetCall) Header

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

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

func (*AccountsGetCall) IfNoneMatch

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

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 AccountsListCall

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

func (*AccountsListCall) Context

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

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

func (*AccountsListCall) Do

func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListPublisherAccountsResponse, error)

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

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

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

func (*AccountsListCall) Header

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

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

func (*AccountsListCall) IfNoneMatch

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

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.

func (*AccountsListCall) PageSize

func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall

PageSize sets the optional parameter "pageSize": Maximum number of accounts to return.

func (*AccountsListCall) PageToken

func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall

PageToken sets the optional parameter "pageToken": The value returned by the last `ListPublisherAccountsResponse`; indicates that this is a continuation of a prior `ListPublisherAccounts` call, and that the system should return the next page of data.

func (*AccountsListCall) Pages

func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListPublisherAccountsResponse) 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 AccountsMediationReportGenerateCall

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

func (*AccountsMediationReportGenerateCall) Context

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

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

func (*AccountsMediationReportGenerateCall) Do

func (c *AccountsMediationReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateMediationReportResponse, error)

Do executes the "admob.accounts.mediationReport.generate" call. Any non-2xx status code is an error. Response headers are in either *GenerateMediationReportResponse.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 (*AccountsMediationReportGenerateCall) Fields

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

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

func (*AccountsMediationReportGenerateCall) Header

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

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

type AccountsMediationReportService

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

func NewAccountsMediationReportService

func NewAccountsMediationReportService(s *Service) *AccountsMediationReportService

func (*AccountsMediationReportService) Generate

func (r *AccountsMediationReportService) Generate(parent string, generatemediationreportrequest *GenerateMediationReportRequest) *AccountsMediationReportGenerateCall

Generate: Generates an AdMob Mediation report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses.

type AccountsNetworkReportGenerateCall

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

func (*AccountsNetworkReportGenerateCall) Context

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

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

func (*AccountsNetworkReportGenerateCall) Do

func (c *AccountsNetworkReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateNetworkReportResponse, error)

Do executes the "admob.accounts.networkReport.generate" call. Any non-2xx status code is an error. Response headers are in either *GenerateNetworkReportResponse.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 (*AccountsNetworkReportGenerateCall) Fields

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

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

func (*AccountsNetworkReportGenerateCall) Header

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

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

type AccountsNetworkReportService

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

func NewAccountsNetworkReportService

func NewAccountsNetworkReportService(s *Service) *AccountsNetworkReportService

func (*AccountsNetworkReportService) Generate

func (r *AccountsNetworkReportService) Generate(parent string, generatenetworkreportrequest *GenerateNetworkReportRequest) *AccountsNetworkReportGenerateCall

Generate: Generates an AdMob Network report based on the provided report specification. Returns result of a server-side streaming RPC. The result is returned in a sequence of responses.

type AccountsService

type AccountsService struct {
    AdUnits *AccountsAdUnitsService

    Apps *AccountsAppsService

    MediationReport *AccountsMediationReportService

    NetworkReport *AccountsNetworkReportService
    // contains filtered or unexported fields
}

func NewAccountsService

func NewAccountsService(s *Service) *AccountsService

func (*AccountsService) Get

func (r *AccountsService) Get(name string) *AccountsGetCall

Get: Gets information about the specified AdMob publisher account.

func (*AccountsService) List

func (r *AccountsService) List() *AccountsListCall

List: Lists the AdMob publisher account that was most recently signed in to from the AdMob UI. For more information, see https://support.google.com/admob/answer/10243672.

type AdUnit

AdUnit: Describes an AdMob ad unit.

type AdUnit struct {
    // AdFormat: AdFormat of the ad unit. Possible values are as follows:
    // "APP_OPEN" - App Open ad format. "BANNER" - Banner ad format.
    // "BANNER_INTERSTITIAL" - Legacy format that can be used as either banner or
    // interstitial. This format can no longer be created but can be targeted by
    // mediation groups. "INTERSTITIAL" - A full screen ad. Supported ad types are
    // "RICH_MEDIA" and "VIDEO". "NATIVE" - Native ad format. "REWARDED" - An ad
    // that, once viewed, gets a callback verifying the view so that a reward can
    // be given to the user. Supported ad types are "RICH_MEDIA" (interactive) and
    // video where video can not be excluded. "REWARDED_INTERSTITIAL" - Rewarded
    // Interstitial ad format. Only supports video ad type. See
    // https://support.google.com/admob/answer/9884467.
    AdFormat string `json:"adFormat,omitempty"`
    // AdTypes: Ad media type supported by this ad unit. Possible values as
    // follows: "RICH_MEDIA" - Text, image, and other non-video media. "VIDEO" -
    // Video media.
    AdTypes []string `json:"adTypes,omitempty"`
    // AdUnitId: The externally visible ID of the ad unit which can be used to
    // integrate with the AdMob SDK. This is a read only property. Example:
    // ca-app-pub-9876543210987654/0123456789
    AdUnitId string `json:"adUnitId,omitempty"`
    // AppId: The externally visible ID of the app this ad unit is associated with.
    // Example: ca-app-pub-9876543210987654~0123456789
    AppId string `json:"appId,omitempty"`
    // DisplayName: The display name of the ad unit as shown in the AdMob UI, which
    // is provided by the user. The maximum length allowed is 80 characters.
    DisplayName string `json:"displayName,omitempty"`
    // Name: Resource name for this ad unit. Format is
    // accounts/{publisher_id}/adUnits/{ad_unit_id_fragment} Example:
    // accounts/pub-9876543210987654/adUnits/0123456789
    Name string `json:"name,omitempty"`
    // ForceSendFields is a list of field names (e.g. "AdFormat") 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. "AdFormat") 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:"-"`
}

func (*AdUnit) MarshalJSON

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

type App

App: Describes an AdMob app for a specific platform (For example: Android or iOS).

type App struct {
    // AppApprovalState: Output only. The approval state for the app. The field is
    // read-only.
    //
    // Possible values:
    //   "APP_APPROVAL_STATE_UNSPECIFIED" - Default value for an unset field. Do
    // not use.
    //   "ACTION_REQUIRED" - The app requires additional user action to be
    // approved. Please refer to https://support.google.com/admob/answer/10564477
    // for details and next steps.
    //   "IN_REVIEW" - The app is pending review.
    //   "APPROVED" - The app is approved and can serve ads.
    AppApprovalState string `json:"appApprovalState,omitempty"`
    // AppId: The externally visible ID of the app which can be used to integrate
    // with the AdMob SDK. This is a read only property. Example:
    // ca-app-pub-9876543210987654~0123456789
    AppId string `json:"appId,omitempty"`
    // LinkedAppInfo: Immutable. The information for an app that is linked to an
    // app store. This field is present if and only if the app is linked to an app
    // store.
    LinkedAppInfo *AppLinkedAppInfo `json:"linkedAppInfo,omitempty"`
    // ManualAppInfo: The information for an app that is not linked to any app
    // store. After an app is linked, this information is still retrivable. If no
    // name is provided for the app upon creation, a placeholder name will be used.
    ManualAppInfo *AppManualAppInfo `json:"manualAppInfo,omitempty"`
    // Name: Resource name for this app. Format is
    // accounts/{publisher_id}/apps/{app_id_fragment} Example:
    // accounts/pub-9876543210987654/apps/0123456789
    Name string `json:"name,omitempty"`
    // Platform: Describes the platform of the app. Limited to "IOS" and "ANDROID".
    Platform string `json:"platform,omitempty"`
    // ForceSendFields is a list of field names (e.g. "AppApprovalState") 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. "AppApprovalState") 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:"-"`
}

func (*App) MarshalJSON

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

type AppLinkedAppInfo

AppLinkedAppInfo: Information from the app store if the app is linked to an app store.

type AppLinkedAppInfo struct {
    // AppStoreId: The app store ID of the app; present if and only if the app is
    // linked to an app store. If the app is added to the Google Play store, it
    // will be the application ID of the app. For example: "com.example.myapp". See
    // https://developer.android.com/studio/build/application-id. If the app is
    // added to the Apple App Store, it will be app store ID. For example
    // "105169111". Note that setting the app store id is considered an
    // irreversible action. Once an app is linked, it cannot be unlinked.
    AppStoreId string `json:"appStoreId,omitempty"`
    // DisplayName: Output only. Display name of the app as it appears in the app
    // store. This is an output-only field, and may be empty if the app cannot be
    // found in the store.
    DisplayName string `json:"displayName,omitempty"`
    // ForceSendFields is a list of field names (e.g. "AppStoreId") 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. "AppStoreId") 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:"-"`
}

func (*AppLinkedAppInfo) MarshalJSON

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

type AppManualAppInfo

AppManualAppInfo: Information provided for manual apps which are not linked to an application store (Example: Google Play, App Store).

type AppManualAppInfo struct {
    // DisplayName: The display name of the app as shown in the AdMob UI, which is
    // provided by the user. The maximum length allowed is 80 characters.
    DisplayName string `json:"displayName,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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:"-"`
}

func (*AppManualAppInfo) MarshalJSON

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

type Date

Date: Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp

type Date struct {
    // 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.
    Day int64 `json:"day,omitempty"`
    // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
    // a month and day.
    Month int64 `json:"month,omitempty"`
    // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
    // without a year.
    Year int64 `json:"year,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Day") 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. "Day") 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:"-"`
}

func (*Date) MarshalJSON

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

type DateRange

DateRange: Specification of a single date range. Both dates are inclusive.

type DateRange struct {
    // EndDate: End date of the date range, inclusive. Must be greater than or
    // equal to the start date.
    EndDate *Date `json:"endDate,omitempty"`
    // StartDate: Start date of the date range, inclusive. Must be less than or
    // equal to the end date.
    StartDate *Date `json:"startDate,omitempty"`
    // ForceSendFields is a list of field names (e.g. "EndDate") 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. "EndDate") 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:"-"`
}

func (*DateRange) MarshalJSON

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

type GenerateMediationReportRequest

GenerateMediationReportRequest: Request to generate an AdMob Mediation report.

type GenerateMediationReportRequest struct {
    // ReportSpec: Network report specification.
    ReportSpec *MediationReportSpec `json:"reportSpec,omitempty"`
    // ForceSendFields is a list of field names (e.g. "ReportSpec") 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. "ReportSpec") 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:"-"`
}

func (*GenerateMediationReportRequest) MarshalJSON

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

type GenerateMediationReportResponse

GenerateMediationReportResponse: The streaming response for the AdMob Mediation report where the first response contains the report header, then a stream of row responses, and finally a footer as the last response message. For example: [{ "header": { "date_range": { "start_date": {"year": 2018, "month": 9, "day": 1}, "end_date": {"year": 2018, "month": 9, "day": 1} }, "localization_settings": { "currency_code": "USD", "language_code": "en-US" } } }, { "row": { "dimension_values": { "DATE": {"value": "20180918"}, "APP": { "value": "ca-app-pub-8123415297019784~1001342552", "display_label": "My app name!" } }, "metric_values": { "ESTIMATED_EARNINGS": {"decimal_value": "1324746"} } } }, { "footer": {"matching_row_count": 1} }]

type GenerateMediationReportResponse struct {
    // Footer: Additional information about the generated report, such as warnings
    // about the data.
    Footer *ReportFooter `json:"footer,omitempty"`
    // Header: Report generation settings that describes the report contents, such
    // as the report date range and localization settings.
    Header *ReportHeader `json:"header,omitempty"`
    // Row: Actual report data.
    Row *ReportRow `json:"row,omitempty"`

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

func (*GenerateMediationReportResponse) MarshalJSON

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

type GenerateNetworkReportRequest

GenerateNetworkReportRequest: Request to generate an AdMob Network report.

type GenerateNetworkReportRequest struct {
    // ReportSpec: Network report specification.
    ReportSpec *NetworkReportSpec `json:"reportSpec,omitempty"`
    // ForceSendFields is a list of field names (e.g. "ReportSpec") 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. "ReportSpec") 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:"-"`
}

func (*GenerateNetworkReportRequest) MarshalJSON

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

type GenerateNetworkReportResponse

GenerateNetworkReportResponse: The streaming response for the AdMob Network report where the first response contains the report header, then a stream of row responses, and finally a footer as the last response message. For example: [{ "header": { "dateRange": { "startDate": {"year": 2018, "month": 9, "day": 1}, "endDate": {"year": 2018, "month": 9, "day": 1} }, "localizationSettings": { "currencyCode": "USD", "languageCode": "en-US" } } }, { "row": { "dimensionValues": { "DATE": {"value": "20180918"}, "APP": { "value": "ca-app-pub-8123415297019784~1001342552", displayLabel: "My app name!" } }, "metricValues": { "ESTIMATED_EARNINGS": {"microsValue": 6500000} } } }, { "footer": {"matchingRowCount": 1} }]

type GenerateNetworkReportResponse struct {
    // Footer: Additional information about the generated report, such as warnings
    // about the data.
    Footer *ReportFooter `json:"footer,omitempty"`
    // Header: Report generation settings that describes the report contents, such
    // as the report date range and localization settings.
    Header *ReportHeader `json:"header,omitempty"`
    // Row: Actual report data.
    Row *ReportRow `json:"row,omitempty"`

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

func (*GenerateNetworkReportResponse) MarshalJSON

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

type ListAdUnitsResponse

ListAdUnitsResponse: Response for the ad units list request.

type ListAdUnitsResponse struct {
    // AdUnits: The resulting ad units for the requested account.
    AdUnits []*AdUnit `json:"adUnits,omitempty"`
    // NextPageToken: If not empty, indicates that there may be more ad units for
    // the request; this value should be passed in a new `ListAdUnitsRequest`.
    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. "AdUnits") 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. "AdUnits") 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:"-"`
}

func (*ListAdUnitsResponse) MarshalJSON

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

type ListAppsResponse

ListAppsResponse: Response for the apps list request.

type ListAppsResponse struct {
    // Apps: The resulting apps for the requested account.
    Apps []*App `json:"apps,omitempty"`
    // NextPageToken: If not empty, indicates that there may be more apps for the
    // request; this value should be passed in a new `ListAppsRequest`.
    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. "Apps") 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. "Apps") 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:"-"`
}

func (*ListAppsResponse) MarshalJSON

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

type ListPublisherAccountsResponse

ListPublisherAccountsResponse: Response for the publisher account list request.

type ListPublisherAccountsResponse struct {
    // Account: Publisher that the client credentials can access.
    Account []*PublisherAccount `json:"account,omitempty"`
    // NextPageToken: If not empty, indicates that there might be more accounts for
    // the request; you must pass this value in a new
    // `ListPublisherAccountsRequest`.
    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. "Account") 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. "Account") 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:"-"`
}

func (*ListPublisherAccountsResponse) MarshalJSON

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

type LocalizationSettings

LocalizationSettings: Localization settings for reports, such as currency and language. It affects how metrics are calculated.

type LocalizationSettings struct {
    // CurrencyCode: Currency code of the earning related metrics, which is the
    // 3-letter code defined in ISO 4217. The daily average rate is used for the
    // currency conversion. Defaults to the account currency code if unspecified.
    CurrencyCode string `json:"currencyCode,omitempty"`
    // LanguageCode: Language used for any localized text, such as some dimension
    // value display labels. The language tag defined in the IETF BCP47. Defaults
    // to 'en-US' if unspecified.
    LanguageCode string `json:"languageCode,omitempty"`
    // ForceSendFields is a list of field names (e.g. "CurrencyCode") 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. "CurrencyCode") 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:"-"`
}

func (*LocalizationSettings) MarshalJSON

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

type MediationReportSpec

MediationReportSpec: The specification for generating an AdMob Mediation report. For example, the specification to get observed ECPM sliced by ad source and app for the 'US' and 'CN' countries can look like the following example: { "date_range": { "start_date": {"year": 2021, "month": 9, "day": 1}, "end_date": {"year": 2021, "month": 9, "day": 30} }, "dimensions": ["AD_SOURCE", "APP", "COUNTRY"], "metrics": ["OBSERVED_ECPM"], "dimension_filters": [ { "dimension": "COUNTRY", "matches_any": {"values": [{"value": "US", "value": "CN"}]} } ], "sort_conditions": [ {"dimension":"APP", order: "ASCENDING"} ], "localization_settings": { "currency_code": "USD", "language_code": "en-US" } } For a better understanding, you can treat the preceding specification like the following pseudo SQL: SELECT AD_SOURCE, APP, COUNTRY, OBSERVED_ECPM FROM MEDIATION_REPORT WHERE DATE >= '2021-09-01' AND DATE <= '2021-09-30' AND COUNTRY IN ('US', 'CN') GROUP BY AD_SOURCE, APP, COUNTRY ORDER BY APP ASC;

type MediationReportSpec struct {
    // DateRange: The date range for which the report is generated.
    DateRange *DateRange `json:"dateRange,omitempty"`
    // DimensionFilters: Describes which report rows to match based on their
    // dimension values.
    DimensionFilters []*MediationReportSpecDimensionFilter `json:"dimensionFilters,omitempty"`
    // Dimensions: List of dimensions of the report. The value combination of these
    // dimensions determines the row of the report. If no dimensions are specified,
    // the report returns a single row of requested metrics for the entire account.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources)
    // (for example, "5450213213286189855" and "AdMob Network" as label value).
    //   "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for
    // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value).
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "MEDIATION_GROUP" - The unique ID of the mediation group (for example,
    // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value).
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimensions []string `json:"dimensions,omitempty"`
    // LocalizationSettings: Localization settings of the report.
    LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"`
    // MaxReportRows: Maximum number of report data rows to return. If the value is
    // not set, the API returns as many rows as possible, up to 100000. Acceptable
    // values are 1-100000, inclusive. Values larger than 100000 return an error.
    MaxReportRows int64 `json:"maxReportRows,omitempty"`
    // Metrics: List of metrics of the report. A report must specify at least one
    // metric.
    //
    // Possible values:
    //   "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "AD_REQUESTS" - The number of requests. The value is an integer.
    //   "CLICKS" - The number of times a user clicks an ad. The value is an
    // integer.
    //   "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $6.50 would be represented as 6500000. Estimated earnings per mediation
    // group and per ad source instance level is supported dating back to October
    // 20, 2019. Third-party estimated earnings will show 0 for dates prior to
    // October 20, 2019.
    //   "IMPRESSIONS" - The total number of ads shown to users. The value is an
    // integer.
    //   "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a
    // double precision (approximate) decimal value.
    //   "MATCHED_REQUESTS" - The number of times ads are returned in response to a
    // request. The value is an integer.
    //   "MATCH_RATE" - The ratio of matched ad requests over the total ad
    // requests. The value is a double precision (approximate) decimal value.
    //   "OBSERVED_ECPM" - The third-party ad network's estimated average eCPM. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $2.30 would be represented as 2300000. The estimated average eCPM per
    // mediation group and per ad source instance level is supported dating back to
    // October 20, 2019. Third-party estimated average eCPM will show 0 for dates
    // prior to October 20, 2019.
    Metrics []string `json:"metrics,omitempty"`
    // SortConditions: Describes the sorting of report rows. The order of the
    // condition in the list defines its precedence; the earlier the condition, the
    // higher its precedence. If no sort conditions are specified, the row ordering
    // is undefined.
    SortConditions []*MediationReportSpecSortCondition `json:"sortConditions,omitempty"`
    // TimeZone: A report time zone. Accepts an IANA TZ name values, such as
    // "America/Los_Angeles." If no time zone is defined, the account default takes
    // effect. Check default value by the get account action. **Warning:** The
    // "America/Los_Angeles" is the only supported value at the moment.
    TimeZone string `json:"timeZone,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DateRange") 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. "DateRange") 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:"-"`
}

func (*MediationReportSpec) MarshalJSON

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

type MediationReportSpecDimensionFilter

MediationReportSpecDimensionFilter: Describes which report rows to match based on their dimension values.

type MediationReportSpecDimensionFilter struct {
    // Dimension: Applies the filter criterion to the specified dimension.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources)
    // (for example, "5450213213286189855" and "AdMob Network" as label value).
    //   "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for
    // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value).
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "MEDIATION_GROUP" - The unique ID of the mediation group (for example,
    // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value).
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimension string `json:"dimension,omitempty"`
    // MatchesAny: Matches a row if its value for the specified dimension is in one
    // of the values specified in this condition.
    MatchesAny *StringList `json:"matchesAny,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Dimension") 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. "Dimension") 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:"-"`
}

func (*MediationReportSpecDimensionFilter) MarshalJSON

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

type MediationReportSpecSortCondition

MediationReportSpecSortCondition: Sorting direction to be applied on a dimension or a metric.

type MediationReportSpecSortCondition struct {
    // Dimension: Sort by the specified dimension.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources)
    // (for example, "5450213213286189855" and "AdMob Network" as label value).
    //   "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for
    // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value).
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "MEDIATION_GROUP" - The unique ID of the mediation group (for example,
    // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value).
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimension string `json:"dimension,omitempty"`
    // Metric: Sort by the specified metric.
    //
    // Possible values:
    //   "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "AD_REQUESTS" - The number of requests. The value is an integer.
    //   "CLICKS" - The number of times a user clicks an ad. The value is an
    // integer.
    //   "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $6.50 would be represented as 6500000. Estimated earnings per mediation
    // group and per ad source instance level is supported dating back to October
    // 20, 2019. Third-party estimated earnings will show 0 for dates prior to
    // October 20, 2019.
    //   "IMPRESSIONS" - The total number of ads shown to users. The value is an
    // integer.
    //   "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a
    // double precision (approximate) decimal value.
    //   "MATCHED_REQUESTS" - The number of times ads are returned in response to a
    // request. The value is an integer.
    //   "MATCH_RATE" - The ratio of matched ad requests over the total ad
    // requests. The value is a double precision (approximate) decimal value.
    //   "OBSERVED_ECPM" - The third-party ad network's estimated average eCPM. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $2.30 would be represented as 2300000. The estimated average eCPM per
    // mediation group and per ad source instance level is supported dating back to
    // October 20, 2019. Third-party estimated average eCPM will show 0 for dates
    // prior to October 20, 2019.
    Metric string `json:"metric,omitempty"`
    // Order: Sorting order of the dimension or metric.
    //
    // Possible values:
    //   "SORT_ORDER_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "ASCENDING" - Sort dimension value or metric value in ascending order.
    //   "DESCENDING" - Sort dimension value or metric value in descending order.
    Order string `json:"order,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Dimension") 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. "Dimension") 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:"-"`
}

func (*MediationReportSpecSortCondition) MarshalJSON

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

type NetworkReportSpec

NetworkReportSpec: The specification for generating an AdMob Network report. For example, the specification to get clicks and estimated earnings for only the 'US' and 'CN' countries can look like the following example: { 'date_range': { 'start_date': {'year': 2021, 'month': 9, 'day': 1}, 'end_date': {'year': 2021, 'month': 9, 'day': 30} }, 'dimensions': ['DATE', 'APP', 'COUNTRY'], 'metrics': ['CLICKS', 'ESTIMATED_EARNINGS'], 'dimension_filters': [ { 'dimension': 'COUNTRY', 'matches_any': {'values': [{'value': 'US', 'value': 'CN'}]} } ], 'sort_conditions': [ {'dimension':'APP', order: 'ASCENDING'}, {'metric':'CLICKS', order: 'DESCENDING'} ], 'localization_settings': { 'currency_code': 'USD', 'language_code': 'en-US' } } For a better understanding, you can treat the preceding specification like the following pseudo SQL: SELECT DATE, APP, COUNTRY, CLICKS, ESTIMATED_EARNINGS FROM NETWORK_REPORT WHERE DATE >= '2021-09-01' AND DATE <= '2021-09-30' AND COUNTRY IN ('US', 'CN') GROUP BY DATE, APP, COUNTRY ORDER BY APP ASC, CLICKS DESC;

type NetworkReportSpec struct {
    // DateRange: The date range for which the report is generated.
    DateRange *DateRange `json:"dateRange,omitempty"`
    // DimensionFilters: Describes which report rows to match based on their
    // dimension values.
    DimensionFilters []*NetworkReportSpecDimensionFilter `json:"dimensionFilters,omitempty"`
    // Dimensions: List of dimensions of the report. The value combination of these
    // dimensions determines the row of the report. If no dimensions are specified,
    // the report returns a single row of requested metrics for the entire account.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad
    // delivery dimension. **Warning:** The dimension is incompatible with
    // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS),
    // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and
    // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics.
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimensions []string `json:"dimensions,omitempty"`
    // LocalizationSettings: Localization settings of the report.
    LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"`
    // MaxReportRows: Maximum number of report data rows to return. If the value is
    // not set, the API returns as many rows as possible, up to 100000. Acceptable
    // values are 1-100000, inclusive. Values larger than 100000 return an error.
    MaxReportRows int64 `json:"maxReportRows,omitempty"`
    // Metrics: List of metrics of the report. A report must specify at least one
    // metric.
    //
    // Possible values:
    //   "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "AD_REQUESTS" - The number of ad requests. The value is an integer.
    // **Warning:** The metric is incompatible with
    // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "CLICKS" - The number of times a user clicks an ad. The value is an
    // integer.
    //   "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $6.50 would be represented as 6500000.
    //   "IMPRESSIONS" - The total number of ads shown to users. The value is an
    // integer.
    //   "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a
    // double precision (approximate) decimal value.
    //   "IMPRESSION_RPM" - The estimated earnings per thousand ad impressions. The
    // value is in micros. For example, $1.03 would be represented as 1030000.
    // Equivalent to eCPM in the AdMob UI. **Warning:** The metric is incompatible
    // with [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "MATCHED_REQUESTS" - The number of times ads are returned in response to a
    // request. The value is an integer.
    //   "MATCH_RATE" - The ratio of matched ad requests over the total ad
    // requests. The value is a double precision (approximate) decimal value.
    // **Warning:** The metric is incompatible with
    // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "SHOW_RATE" - The ratio of ads that are displayed over ads that are
    // returned, defined as impressions / matched requests. The value is a double
    // precision (approximate) decimal value.
    Metrics []string `json:"metrics,omitempty"`
    // SortConditions: Describes the sorting of report rows. The order of the
    // condition in the list defines its precedence; the earlier the condition, the
    // higher its precedence. If no sort conditions are specified, the row ordering
    // is undefined.
    SortConditions []*NetworkReportSpecSortCondition `json:"sortConditions,omitempty"`
    // TimeZone: A report time zone. Accepts an IANA TZ name values, such as
    // "America/Los_Angeles." If no time zone is defined, the account default takes
    // effect. Check default value by the get account action. **Warning:** The
    // "America/Los_Angeles" is the only supported value at the moment.
    TimeZone string `json:"timeZone,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DateRange") 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. "DateRange") 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:"-"`
}

func (*NetworkReportSpec) MarshalJSON

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

type NetworkReportSpecDimensionFilter

NetworkReportSpecDimensionFilter: Describes which report rows to match based on their dimension values.

type NetworkReportSpecDimensionFilter struct {
    // Dimension: Applies the filter criterion to the specified dimension.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad
    // delivery dimension. **Warning:** The dimension is incompatible with
    // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS),
    // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and
    // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics.
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimension string `json:"dimension,omitempty"`
    // MatchesAny: Matches a row if its value for the specified dimension is in one
    // of the values specified in this condition.
    MatchesAny *StringList `json:"matchesAny,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Dimension") 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. "Dimension") 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:"-"`
}

func (*NetworkReportSpecDimensionFilter) MarshalJSON

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

type NetworkReportSpecSortCondition

NetworkReportSpecSortCondition: Sorting direction to be applied on a dimension or a metric.

type NetworkReportSpecSortCondition struct {
    // Dimension: Sort by the specified dimension.
    //
    // Possible values:
    //   "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests
    // can specify at most one time dimension.
    //   "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests
    // can specify at most one time dimension.
    //   "WEEK" - The date of the first day of a week in the YYYYMMDD format (for
    // example, "20210701"). Requests can specify at most one time dimension.
    //   "AD_UNIT" - The unique ID of the ad unit (for example,
    // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is
    // included automatically.
    //   "APP" - The unique ID of the mobile application (for example,
    // "ca-app-pub-1234~1234").
    //   "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad
    // delivery dimension. **Warning:** The dimension is incompatible with
    // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS),
    // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and
    // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics.
    //   "COUNTRY" - CLDR country code of the place where the ad views/clicks occur
    // (for example, "US" or "FR"). This is a geography dimension.
    //   "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad
    // delivery dimension.
    //   "PLATFORM" - Mobile OS platform of the app (for example, "Android" or
    // "iOS").
    //   "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1".
    //   "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0".
    //   "APP_VERSION_NAME" - For Android, the app version name can be found in
    // versionName in PackageInfo. For iOS, the app version name can be found in
    // CFBundleShortVersionString.
    //   "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g.
    // "Non-personalized ads").
    Dimension string `json:"dimension,omitempty"`
    // Metric: Sort by the specified metric.
    //
    // Possible values:
    //   "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "AD_REQUESTS" - The number of ad requests. The value is an integer.
    // **Warning:** The metric is incompatible with
    // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "CLICKS" - The number of times a user clicks an ad. The value is an
    // integer.
    //   "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The
    // currency unit (USD, EUR, or other) of the earning metrics are determined by
    // the localization setting for currency. The amount is in micros. For example,
    // $6.50 would be represented as 6500000.
    //   "IMPRESSIONS" - The total number of ads shown to users. The value is an
    // integer.
    //   "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a
    // double precision (approximate) decimal value.
    //   "IMPRESSION_RPM" - The estimated earnings per thousand ad impressions. The
    // value is in micros. For example, $1.03 would be represented as 1030000.
    // Equivalent to eCPM in the AdMob UI. **Warning:** The metric is incompatible
    // with [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "MATCHED_REQUESTS" - The number of times ads are returned in response to a
    // request. The value is an integer.
    //   "MATCH_RATE" - The ratio of matched ad requests over the total ad
    // requests. The value is a double precision (approximate) decimal value.
    // **Warning:** The metric is incompatible with
    // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension.
    //   "SHOW_RATE" - The ratio of ads that are displayed over ads that are
    // returned, defined as impressions / matched requests. The value is a double
    // precision (approximate) decimal value.
    Metric string `json:"metric,omitempty"`
    // Order: Sorting order of the dimension or metric.
    //
    // Possible values:
    //   "SORT_ORDER_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "ASCENDING" - Sort dimension value or metric value in ascending order.
    //   "DESCENDING" - Sort dimension value or metric value in descending order.
    Order string `json:"order,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Dimension") 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. "Dimension") 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:"-"`
}

func (*NetworkReportSpecSortCondition) MarshalJSON

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

type PublisherAccount

PublisherAccount: A publisher account contains information relevant to the use of this API, such as the time zone used for the reports.

type PublisherAccount struct {
    // CurrencyCode: Currency code of the earning-related metrics, which is the
    // 3-letter code defined in ISO 4217. The daily average rate is used for the
    // currency conversion.
    CurrencyCode string `json:"currencyCode,omitempty"`
    // Name: Resource name of this account. Format is accounts/{publisher_id}.
    Name string `json:"name,omitempty"`
    // PublisherId: The unique ID by which this publisher account can be identified
    // in the API requests (for example, pub-1234567890).
    PublisherId string `json:"publisherId,omitempty"`
    // ReportingTimeZone: The time zone that is used in reports that are generated
    // for this account. The value is a time-zone ID as specified by the CLDR
    // project, for example, "America/Los_Angeles".
    ReportingTimeZone string `json:"reportingTimeZone,omitempty"`

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

func (*PublisherAccount) MarshalJSON

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

type ReportFooter

ReportFooter: Groups data available after report generation, for example, warnings and row counts. Always sent as the last message in the stream response.

type ReportFooter struct {
    // MatchingRowCount: Total number of rows that matched the request. Warning:
    // This count does NOT always match the number of rows in the response. Do not
    // make that assumption when processing the response.
    MatchingRowCount int64 `json:"matchingRowCount,omitempty,string"`
    // Warnings: Warnings associated with generation of the report.
    Warnings []*ReportWarning `json:"warnings,omitempty"`
    // ForceSendFields is a list of field names (e.g. "MatchingRowCount") 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. "MatchingRowCount") 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:"-"`
}

func (*ReportFooter) MarshalJSON

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

type ReportHeader

ReportHeader: Groups data helps to treat the generated report. Always sent as a first message in the stream response.

type ReportHeader struct {
    // DateRange: The date range for which the report is generated. This is
    // identical to the range specified in the report request.
    DateRange *DateRange `json:"dateRange,omitempty"`
    // LocalizationSettings: Localization settings of the report. This is identical
    // to the settings in the report request.
    LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"`
    // ReportingTimeZone: The report time zone. The value is a time-zone ID as
    // specified by the CLDR project, for example, "America/Los_Angeles".
    ReportingTimeZone string `json:"reportingTimeZone,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DateRange") 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. "DateRange") 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:"-"`
}

func (*ReportHeader) MarshalJSON

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

type ReportRow

ReportRow: A row of the returning report.

type ReportRow struct {
    // DimensionValues: Map of dimension values in a row, with keys as enum name of
    // the dimensions.
    DimensionValues map[string]ReportRowDimensionValue `json:"dimensionValues,omitempty"`
    // MetricValues: Map of metric values in a row, with keys as enum name of the
    // metrics. If a metric being requested has no value returned, the map will not
    // include it.
    MetricValues map[string]ReportRowMetricValue `json:"metricValues,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DimensionValues") 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. "DimensionValues") 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:"-"`
}

func (*ReportRow) MarshalJSON

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

type ReportRowDimensionValue

ReportRowDimensionValue: Representation of a dimension value.

type ReportRowDimensionValue struct {
    // DisplayLabel: The localized string representation of the value. If
    // unspecified, the display label should be derived from the value.
    DisplayLabel string `json:"displayLabel,omitempty"`
    // Value: Dimension value in the format specified in the report's spec
    // Dimension enum.
    Value string `json:"value,omitempty"`
    // ForceSendFields is a list of field names (e.g. "DisplayLabel") 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. "DisplayLabel") 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:"-"`
}

func (*ReportRowDimensionValue) MarshalJSON

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

type ReportRowMetricValue

ReportRowMetricValue: Representation of a metric value.

type ReportRowMetricValue struct {
    // DoubleValue: Double precision (approximate) decimal values. Rates are from 0
    // to 1.
    DoubleValue float64 `json:"doubleValue,omitempty"`
    // IntegerValue: Metric integer value.
    IntegerValue int64 `json:"integerValue,omitempty,string"`
    // MicrosValue: Amount in micros. One million is equivalent to one unit.
    // Currency value is in the unit (USD, EUR or other) specified by the request.
    // For example, $6.50 whould be represented as 6500000 micros.
    MicrosValue int64 `json:"microsValue,omitempty,string"`
    // ForceSendFields is a list of field names (e.g. "DoubleValue") 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. "DoubleValue") 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:"-"`
}

func (*ReportRowMetricValue) MarshalJSON

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

func (*ReportRowMetricValue) UnmarshalJSON

func (s *ReportRowMetricValue) UnmarshalJSON(data []byte) error

type ReportWarning

ReportWarning: Warnings associated with generation of the report.

type ReportWarning struct {
    // Description: Describes the details of the warning message, in English.
    Description string `json:"description,omitempty"`
    // Type: Type of the warning.
    //
    // Possible values:
    //   "TYPE_UNSPECIFIED" - Default value for an unset field. Do not use.
    //   "DATA_BEFORE_ACCOUNT_TIMEZONE_CHANGE" - Some data in this report is
    // aggregated based on a time zone different from the requested time zone. This
    // could happen if a local time-zone report has the start time before the last
    // time this time zone changed. The description field will contain the date of
    // the last time zone change.
    //   "DATA_DELAYED" - There is an unusual delay in processing the source data
    // for the requested date range. The report results might be less up to date
    // than usual. AdMob is aware of the issue and is actively working to resolve
    // it.
    //   "OTHER" - Warnings that are exposed without a specific type. Useful when
    // new warning types are added but the API is not changed yet.
    //   "REPORT_CURRENCY_NOT_ACCOUNT_CURRENCY" - The currency being requested is
    // not the account currency. The earning metrics will be based on the requested
    // currency, and thus not a good estimation of the final payment anymore, due
    // to the currency rate fluctuation.
    Type string `json:"type,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Description") 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. "Description") 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:"-"`
}

func (*ReportWarning) MarshalJSON

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

type Service

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

    Accounts *AccountsService
    // contains filtered or unexported fields
}

func New

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

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

NewService creates a new Service.

type StringList

StringList: List of string values.

type StringList struct {
    // Values: The string values.
    Values []string `json:"values,omitempty"`
    // ForceSendFields is a list of field names (e.g. "Values") 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. "Values") 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:"-"`
}

func (*StringList) MarshalJSON

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