1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package admob provides access to the AdMob API. 8 // 9 // For product documentation, see: https://developers.google.com/admob/api/ 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/admob/v1beta" 27 // ... 28 // ctx := context.Background() 29 // admobService, err := admob.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // admobService, err := admob.NewService(ctx, option.WithScopes(admob.AdmobReportScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // admobService, err := admob.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // admobService, err := admob.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package admob // import "google.golang.org/api/admob/v1beta" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "admob:v1beta" 95 const apiName = "admob" 96 const apiVersion = "v1beta" 97 const basePath = "https://admob.googleapis.com/" 98 const basePathTemplate = "https://admob.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://admob.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See your AdMob data 104 AdmobReadonlyScope = "https://www.googleapis.com/auth/admob.readonly" 105 106 // See your AdMob data 107 AdmobReportScope = "https://www.googleapis.com/auth/admob.report" 108 ) 109 110 // NewService creates a new Service. 111 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 112 scopesOption := internaloption.WithDefaultScopes( 113 "https://www.googleapis.com/auth/admob.readonly", 114 "https://www.googleapis.com/auth/admob.report", 115 ) 116 // NOTE: prepend, so we don't override user-specified scopes. 117 opts = append([]option.ClientOption{scopesOption}, opts...) 118 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 119 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 120 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 121 opts = append(opts, internaloption.EnableNewAuthLibrary()) 122 client, endpoint, err := htransport.NewClient(ctx, opts...) 123 if err != nil { 124 return nil, err 125 } 126 s, err := New(client) 127 if err != nil { 128 return nil, err 129 } 130 if endpoint != "" { 131 s.BasePath = endpoint 132 } 133 return s, nil 134 } 135 136 // New creates a new Service. It uses the provided http.Client for requests. 137 // 138 // Deprecated: please use NewService instead. 139 // To provide a custom HTTP client, use option.WithHTTPClient. 140 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 141 func New(client *http.Client) (*Service, error) { 142 if client == nil { 143 return nil, errors.New("client is nil") 144 } 145 s := &Service{client: client, BasePath: basePath} 146 s.Accounts = NewAccountsService(s) 147 return s, nil 148 } 149 150 type Service struct { 151 client *http.Client 152 BasePath string // API endpoint base URL 153 UserAgent string // optional additional User-Agent fragment 154 155 Accounts *AccountsService 156 } 157 158 func (s *Service) userAgent() string { 159 if s.UserAgent == "" { 160 return googleapi.UserAgent 161 } 162 return googleapi.UserAgent + " " + s.UserAgent 163 } 164 165 func NewAccountsService(s *Service) *AccountsService { 166 rs := &AccountsService{s: s} 167 rs.AdSources = NewAccountsAdSourcesService(s) 168 rs.AdUnitMappings = NewAccountsAdUnitMappingsService(s) 169 rs.AdUnits = NewAccountsAdUnitsService(s) 170 rs.Apps = NewAccountsAppsService(s) 171 rs.CampaignReport = NewAccountsCampaignReportService(s) 172 rs.MediationGroups = NewAccountsMediationGroupsService(s) 173 rs.MediationReport = NewAccountsMediationReportService(s) 174 rs.NetworkReport = NewAccountsNetworkReportService(s) 175 return rs 176 } 177 178 type AccountsService struct { 179 s *Service 180 181 AdSources *AccountsAdSourcesService 182 183 AdUnitMappings *AccountsAdUnitMappingsService 184 185 AdUnits *AccountsAdUnitsService 186 187 Apps *AccountsAppsService 188 189 CampaignReport *AccountsCampaignReportService 190 191 MediationGroups *AccountsMediationGroupsService 192 193 MediationReport *AccountsMediationReportService 194 195 NetworkReport *AccountsNetworkReportService 196 } 197 198 func NewAccountsAdSourcesService(s *Service) *AccountsAdSourcesService { 199 rs := &AccountsAdSourcesService{s: s} 200 rs.Adapters = NewAccountsAdSourcesAdaptersService(s) 201 return rs 202 } 203 204 type AccountsAdSourcesService struct { 205 s *Service 206 207 Adapters *AccountsAdSourcesAdaptersService 208 } 209 210 func NewAccountsAdSourcesAdaptersService(s *Service) *AccountsAdSourcesAdaptersService { 211 rs := &AccountsAdSourcesAdaptersService{s: s} 212 return rs 213 } 214 215 type AccountsAdSourcesAdaptersService struct { 216 s *Service 217 } 218 219 func NewAccountsAdUnitMappingsService(s *Service) *AccountsAdUnitMappingsService { 220 rs := &AccountsAdUnitMappingsService{s: s} 221 return rs 222 } 223 224 type AccountsAdUnitMappingsService struct { 225 s *Service 226 } 227 228 func NewAccountsAdUnitsService(s *Service) *AccountsAdUnitsService { 229 rs := &AccountsAdUnitsService{s: s} 230 rs.AdUnitMappings = NewAccountsAdUnitsAdUnitMappingsService(s) 231 return rs 232 } 233 234 type AccountsAdUnitsService struct { 235 s *Service 236 237 AdUnitMappings *AccountsAdUnitsAdUnitMappingsService 238 } 239 240 func NewAccountsAdUnitsAdUnitMappingsService(s *Service) *AccountsAdUnitsAdUnitMappingsService { 241 rs := &AccountsAdUnitsAdUnitMappingsService{s: s} 242 return rs 243 } 244 245 type AccountsAdUnitsAdUnitMappingsService struct { 246 s *Service 247 } 248 249 func NewAccountsAppsService(s *Service) *AccountsAppsService { 250 rs := &AccountsAppsService{s: s} 251 return rs 252 } 253 254 type AccountsAppsService struct { 255 s *Service 256 } 257 258 func NewAccountsCampaignReportService(s *Service) *AccountsCampaignReportService { 259 rs := &AccountsCampaignReportService{s: s} 260 return rs 261 } 262 263 type AccountsCampaignReportService struct { 264 s *Service 265 } 266 267 func NewAccountsMediationGroupsService(s *Service) *AccountsMediationGroupsService { 268 rs := &AccountsMediationGroupsService{s: s} 269 rs.MediationAbExperiments = NewAccountsMediationGroupsMediationAbExperimentsService(s) 270 return rs 271 } 272 273 type AccountsMediationGroupsService struct { 274 s *Service 275 276 MediationAbExperiments *AccountsMediationGroupsMediationAbExperimentsService 277 } 278 279 func NewAccountsMediationGroupsMediationAbExperimentsService(s *Service) *AccountsMediationGroupsMediationAbExperimentsService { 280 rs := &AccountsMediationGroupsMediationAbExperimentsService{s: s} 281 return rs 282 } 283 284 type AccountsMediationGroupsMediationAbExperimentsService struct { 285 s *Service 286 } 287 288 func NewAccountsMediationReportService(s *Service) *AccountsMediationReportService { 289 rs := &AccountsMediationReportService{s: s} 290 return rs 291 } 292 293 type AccountsMediationReportService struct { 294 s *Service 295 } 296 297 func NewAccountsNetworkReportService(s *Service) *AccountsNetworkReportService { 298 rs := &AccountsNetworkReportService{s: s} 299 return rs 300 } 301 302 type AccountsNetworkReportService struct { 303 s *Service 304 } 305 306 // AdSource: Definition of a mediation ad source. 307 type AdSource struct { 308 // AdSourceId: ID of this ad source. 309 AdSourceId string `json:"adSourceId,omitempty"` 310 // Name: Resource name of this ad source. Format is: 311 // accounts/{publisher_id}/adSources/{ad_source_id} 312 Name string `json:"name,omitempty"` 313 // Title: Display name of this ad source. 314 Title string `json:"title,omitempty"` 315 // ForceSendFields is a list of field names (e.g. "AdSourceId") to 316 // unconditionally include in API requests. By default, fields with empty or 317 // default values are omitted from API requests. See 318 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 319 // details. 320 ForceSendFields []string `json:"-"` 321 // NullFields is a list of field names (e.g. "AdSourceId") to include in API 322 // requests with the JSON null value. By default, fields with empty values are 323 // omitted from API requests. See 324 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 325 NullFields []string `json:"-"` 326 } 327 328 func (s *AdSource) MarshalJSON() ([]byte, error) { 329 type NoMethod AdSource 330 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 331 } 332 333 // AdUnit: Describes an AdMob ad unit. 334 type AdUnit struct { 335 // AdFormat: AdFormat of the ad unit. Possible values are as follows: 336 // "APP_OPEN" - App Open ad format. "BANNER" - Banner ad format. 337 // "BANNER_INTERSTITIAL" - Legacy format that can be used as either banner or 338 // interstitial. This format can no longer be created but can be targeted by 339 // mediation groups. "INTERSTITIAL" - A full screen ad. Supported ad types are 340 // "RICH_MEDIA" and "VIDEO". "NATIVE" - Native ad format. "REWARDED" - An ad 341 // that, once viewed, gets a callback verifying the view so that a reward can 342 // be given to the user. Supported ad types are "RICH_MEDIA" (interactive) and 343 // video where video can not be excluded. "REWARDED_INTERSTITIAL" - Rewarded 344 // Interstitial ad format. Only supports video ad type. See 345 // https://support.google.com/admob/answer/9884467. 346 AdFormat string `json:"adFormat,omitempty"` 347 // AdTypes: Ad media type supported by this ad unit. Possible values as 348 // follows: "RICH_MEDIA" - Text, image, and other non-video media. "VIDEO" - 349 // Video media. 350 AdTypes []string `json:"adTypes,omitempty"` 351 // AdUnitId: The externally visible ID of the ad unit which can be used to 352 // integrate with the AdMob SDK. This is a read only property. Example: 353 // ca-app-pub-9876543210987654/0123456789 354 AdUnitId string `json:"adUnitId,omitempty"` 355 // AppId: The externally visible ID of the app this ad unit is associated with. 356 // Example: ca-app-pub-9876543210987654~0123456789 357 AppId string `json:"appId,omitempty"` 358 // DisplayName: The display name of the ad unit as shown in the AdMob UI, which 359 // is provided by the user. The maximum length allowed is 80 characters. 360 DisplayName string `json:"displayName,omitempty"` 361 // Name: Resource name for this ad unit. Format is 362 // accounts/{publisher_id}/adUnits/{ad_unit_id_fragment} Example: 363 // accounts/pub-9876543210987654/adUnits/0123456789 364 Name string `json:"name,omitempty"` 365 // RewardSettings: Optional. Settings for a rewarded ad unit. This can be set 366 // or unset only when the ad_format is "REWARDED". 367 RewardSettings *AdUnitRewardSettings `json:"rewardSettings,omitempty"` 368 369 // ServerResponse contains the HTTP response code and headers from the server. 370 googleapi.ServerResponse `json:"-"` 371 // ForceSendFields is a list of field names (e.g. "AdFormat") to 372 // unconditionally include in API requests. By default, fields with empty or 373 // default values are omitted from API requests. See 374 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 375 // details. 376 ForceSendFields []string `json:"-"` 377 // NullFields is a list of field names (e.g. "AdFormat") to include in API 378 // requests with the JSON null value. By default, fields with empty values are 379 // omitted from API requests. See 380 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 381 NullFields []string `json:"-"` 382 } 383 384 func (s *AdUnit) MarshalJSON() ([]byte, error) { 385 type NoMethod AdUnit 386 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 387 } 388 389 // AdUnitMapping: Settings to map an AdMob ad unit to a 3rd party ad unit. 390 type AdUnitMapping struct { 391 // AdUnitConfigurations: Settings for the specified ad unit to make an ad 392 // request to 3rd party ad network. Key-value pairs with values set by the user 393 // for the keys requested by the ad network. Please see 394 // https://support.google.com/admob/answer/3245073 for details on how to 395 // configure the network settings. 396 AdUnitConfigurations map[string]string `json:"adUnitConfigurations,omitempty"` 397 // AdapterId: The ID of mediation ad source adapter used by this ad unit 398 // mapping. The adapter determines the information needed in the 399 // ad_network_settings. 400 AdapterId int64 `json:"adapterId,omitempty,string"` 401 // DisplayName: Optional. The display name of this ad unit mapping instance. 402 DisplayName string `json:"displayName,omitempty"` 403 // Name: Resource name of this ad unit mapping. Format is: 404 // accounts/{publisher_id}/adUnits/{ad_unit_id_fragment}/adUnitMappings/{ad_unit 405 // _mapping_id} Example: 406 // accounts/pub-1234567890123456/adUnits/0123456789/adUnitMappings/987654321 407 Name string `json:"name,omitempty"` 408 // State: Output only. The status of this ad unit mapping. 409 // 410 // Possible values: 411 // "STATE_UNSPECIFIED" - The default value. 412 // "ENABLED" - The ad unit mapping is active and used to serve ads or 413 // collecting stats. 414 State string `json:"state,omitempty"` 415 416 // ServerResponse contains the HTTP response code and headers from the server. 417 googleapi.ServerResponse `json:"-"` 418 // ForceSendFields is a list of field names (e.g. "AdUnitConfigurations") to 419 // unconditionally include in API requests. By default, fields with empty or 420 // default values are omitted from API requests. See 421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 422 // details. 423 ForceSendFields []string `json:"-"` 424 // NullFields is a list of field names (e.g. "AdUnitConfigurations") to include 425 // in API requests with the JSON null value. By default, fields with empty 426 // values are omitted from API requests. See 427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 428 NullFields []string `json:"-"` 429 } 430 431 func (s *AdUnitMapping) MarshalJSON() ([]byte, error) { 432 type NoMethod AdUnitMapping 433 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 434 } 435 436 // AdUnitRewardSettings: Settings for a rewarded ad unit. 437 type AdUnitRewardSettings struct { 438 // UnitAmount: Reward amount for this ad unit. 439 UnitAmount int64 `json:"unitAmount,omitempty,string"` 440 // UnitType: Reward item for this ad unit. 441 UnitType string `json:"unitType,omitempty"` 442 // ForceSendFields is a list of field names (e.g. "UnitAmount") to 443 // unconditionally include in API requests. By default, fields with empty or 444 // default values are omitted from API requests. See 445 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 446 // details. 447 ForceSendFields []string `json:"-"` 448 // NullFields is a list of field names (e.g. "UnitAmount") to include in API 449 // requests with the JSON null value. By default, fields with empty values are 450 // omitted from API requests. See 451 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 452 NullFields []string `json:"-"` 453 } 454 455 func (s *AdUnitRewardSettings) MarshalJSON() ([]byte, error) { 456 type NoMethod AdUnitRewardSettings 457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 458 } 459 460 // Adapter: Describes adapters supported by each mediation ad source. Adapters 461 // correspond to a specific SDK implementation of the ad source, and are each 462 // associated with a single platform and a list of supported ad unit formats. 463 // Adapters may also require setting some configurations to perform ad 464 // requests. Configurations can be specified in the AdUnitMapping by setting 465 // the ad_unit_configurations (#AdUnitMapping.ad_unit_configurations) key/value 466 // pairs. For example, the ad_unit_configurations can be used to pass various 467 // IDs to the adapter's third-party SDK. 468 type Adapter struct { 469 // AdapterConfigMetadata: Output only. Configuration metadata associated with 470 // this adapter. 471 AdapterConfigMetadata []*AdapterAdapterConfigMetadata `json:"adapterConfigMetadata,omitempty"` 472 // AdapterId: Output only. ID of this adapter. It is used to set adapter_id 473 // (#AdUnitMapping.adapter_id). 474 AdapterId string `json:"adapterId,omitempty"` 475 // Formats: Output only. Indicates the formats of the ad units supported by 476 // this adapter. 477 Formats []string `json:"formats,omitempty"` 478 // Name: Output only. Resource name of the adapter. Format is: 479 // accounts/{publisher_id}/adSources/{ad_source_id}/adapters/{adapter_id}. 480 Name string `json:"name,omitempty"` 481 // Platform: Output only. Mobile application platform supported by this 482 // adapter. Supported values are: IOS, ANDROID, WINDOWS_PHONE 483 Platform string `json:"platform,omitempty"` 484 // Title: Output only. The display name of this adapter. 485 Title string `json:"title,omitempty"` 486 // ForceSendFields is a list of field names (e.g. "AdapterConfigMetadata") to 487 // unconditionally include in API requests. By default, fields with empty or 488 // default values are omitted from API requests. See 489 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 490 // details. 491 ForceSendFields []string `json:"-"` 492 // NullFields is a list of field names (e.g. "AdapterConfigMetadata") to 493 // include in API requests with the JSON null value. By default, fields with 494 // empty values are omitted from API requests. See 495 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 496 NullFields []string `json:"-"` 497 } 498 499 func (s *Adapter) MarshalJSON() ([]byte, error) { 500 type NoMethod Adapter 501 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 502 } 503 504 // AdapterAdapterConfigMetadata: Configuration metadata associated with this 505 // adapter. They are used to define the ad_unit_configurations associated with 506 // AdUnitMappings for the this adapter. 507 type AdapterAdapterConfigMetadata struct { 508 // AdapterConfigMetadataId: This is used to fill the key of the 509 // ad_unit_configurations (#AdUnitMapping.ad_unit_configurations). 510 AdapterConfigMetadataId string `json:"adapterConfigMetadataId,omitempty"` 511 // AdapterConfigMetadataLabel: Name of the adapter configuration metadata. 512 AdapterConfigMetadataLabel string `json:"adapterConfigMetadataLabel,omitempty"` 513 // IsRequired: Whether this metadata is required for configuring the 514 // AdUnitMappings. 515 IsRequired bool `json:"isRequired,omitempty"` 516 // ForceSendFields is a list of field names (e.g. "AdapterConfigMetadataId") to 517 // unconditionally include in API requests. By default, fields with empty or 518 // default values are omitted from API requests. See 519 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 520 // details. 521 ForceSendFields []string `json:"-"` 522 // NullFields is a list of field names (e.g. "AdapterConfigMetadataId") to 523 // include in API requests with the JSON null value. By default, fields with 524 // empty values are omitted from API requests. See 525 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 526 NullFields []string `json:"-"` 527 } 528 529 func (s *AdapterAdapterConfigMetadata) MarshalJSON() ([]byte, error) { 530 type NoMethod AdapterAdapterConfigMetadata 531 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 532 } 533 534 // App: Describes an AdMob app for a specific platform (For example: Android or 535 // iOS). 536 type App struct { 537 // AppApprovalState: Output only. The approval state for the app. The field is 538 // read-only. 539 // 540 // Possible values: 541 // "APP_APPROVAL_STATE_UNSPECIFIED" - Default value for an unset field. Do 542 // not use. 543 // "ACTION_REQUIRED" - The app requires additional user action to be 544 // approved. Please refer to https://support.google.com/admob/answer/10564477 545 // for details and next steps. 546 // "IN_REVIEW" - The app is pending review. 547 // "APPROVED" - The app is approved and can serve ads. 548 AppApprovalState string `json:"appApprovalState,omitempty"` 549 // AppId: The externally visible ID of the app which can be used to integrate 550 // with the AdMob SDK. This is a read only property. Example: 551 // ca-app-pub-9876543210987654~0123456789 552 AppId string `json:"appId,omitempty"` 553 // LinkedAppInfo: Immutable. The information for an app that is linked to an 554 // app store. This field is present if and only if the app is linked to an app 555 // store. 556 LinkedAppInfo *AppLinkedAppInfo `json:"linkedAppInfo,omitempty"` 557 // ManualAppInfo: The information for an app that is not linked to any app 558 // store. After an app is linked, this information is still retrivable. If no 559 // name is provided for the app upon creation, a placeholder name will be used. 560 ManualAppInfo *AppManualAppInfo `json:"manualAppInfo,omitempty"` 561 // Name: Resource name for this app. Format is 562 // accounts/{publisher_id}/apps/{app_id_fragment} Example: 563 // accounts/pub-9876543210987654/apps/0123456789 564 Name string `json:"name,omitempty"` 565 // Platform: Describes the platform of the app. Limited to "IOS" and "ANDROID". 566 Platform string `json:"platform,omitempty"` 567 568 // ServerResponse contains the HTTP response code and headers from the server. 569 googleapi.ServerResponse `json:"-"` 570 // ForceSendFields is a list of field names (e.g. "AppApprovalState") to 571 // unconditionally include in API requests. By default, fields with empty or 572 // default values are omitted from API requests. See 573 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 574 // details. 575 ForceSendFields []string `json:"-"` 576 // NullFields is a list of field names (e.g. "AppApprovalState") to include in 577 // API requests with the JSON null value. By default, fields with empty values 578 // are omitted from API requests. See 579 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 580 NullFields []string `json:"-"` 581 } 582 583 func (s *App) MarshalJSON() ([]byte, error) { 584 type NoMethod App 585 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 586 } 587 588 // AppLinkedAppInfo: Information from the app store if the app is linked to an 589 // app store. 590 type AppLinkedAppInfo struct { 591 // AndroidAppStores: Optional. The app store information for published Android 592 // apps. This field is only used for apps on the Android platform and will be 593 // ignored if the PLATFORM is set to iOS. The default value is the Google Play 594 // App store. This field can be updated after app is created. If the app is not 595 // published, this field will not be included in the response. 596 // 597 // Possible values: 598 // "ANDROID_APP_STORE_UNSPECIFIED" - Default value for an unset field. Do not 599 // use. 600 // "GOOGLE_PLAY_APP_STORE" - Google Play Store. 601 // "AMAZON_APP_STORE" - Amazon Appstore. 602 // "OPPO_APP_STORE" - Oppo App Market. 603 // "SAMSUNG_APP_STORE" - Samsung Galaxy Store. 604 // "VIVO_APP_STORE" - VIVO App Store. 605 // "XIAOMI_APP_STORE" - Xiaomi GetApps. 606 AndroidAppStores []string `json:"androidAppStores,omitempty"` 607 // AppStoreId: The app store ID of the app; present if and only if the app is 608 // linked to an app store. If the app is added to the Google Play store, it 609 // will be the application ID of the app. For example: "com.example.myapp". See 610 // https://developer.android.com/studio/build/application-id. If the app is 611 // added to the Apple App Store, it will be app store ID. For example 612 // "105169111". Note that setting the app store id is considered an 613 // irreversible action. Once an app is linked, it cannot be unlinked. 614 AppStoreId string `json:"appStoreId,omitempty"` 615 // DisplayName: Output only. Display name of the app as it appears in the app 616 // store. This is an output-only field, and may be empty if the app cannot be 617 // found in the store. 618 DisplayName string `json:"displayName,omitempty"` 619 // ForceSendFields is a list of field names (e.g. "AndroidAppStores") to 620 // unconditionally include in API requests. By default, fields with empty or 621 // default values are omitted from API requests. See 622 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 623 // details. 624 ForceSendFields []string `json:"-"` 625 // NullFields is a list of field names (e.g. "AndroidAppStores") to include in 626 // API requests with the JSON null value. By default, fields with empty values 627 // are omitted from API requests. See 628 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 629 NullFields []string `json:"-"` 630 } 631 632 func (s *AppLinkedAppInfo) MarshalJSON() ([]byte, error) { 633 type NoMethod AppLinkedAppInfo 634 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 635 } 636 637 // AppManualAppInfo: Information provided for manual apps which are not linked 638 // to an application store (Example: Google Play, App Store). 639 type AppManualAppInfo struct { 640 // DisplayName: The display name of the app as shown in the AdMob UI, which is 641 // provided by the user. The maximum length allowed is 80 characters. 642 DisplayName string `json:"displayName,omitempty"` 643 // ForceSendFields is a list of field names (e.g. "DisplayName") to 644 // unconditionally include in API requests. By default, fields with empty or 645 // default values are omitted from API requests. See 646 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 647 // details. 648 ForceSendFields []string `json:"-"` 649 // NullFields is a list of field names (e.g. "DisplayName") to include in API 650 // requests with the JSON null value. By default, fields with empty values are 651 // omitted from API requests. See 652 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 653 NullFields []string `json:"-"` 654 } 655 656 func (s *AppManualAppInfo) MarshalJSON() ([]byte, error) { 657 type NoMethod AppManualAppInfo 658 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 659 } 660 661 // BatchCreateAdUnitMappingsRequest: Request to create a batch of ad unit 662 // mappings under the specific AdMob account. 663 type BatchCreateAdUnitMappingsRequest struct { 664 // Requests: Required. The request message specifying the ad unit mappings to 665 // create. A maximum of 100 ad unit mappings can be created in a batch. If the 666 // number of ad unit mappings in the batch request exceed 100, the entire 667 // request will be rejected and no ad unit mappings will be created. 668 Requests []*CreateAdUnitMappingRequest `json:"requests,omitempty"` 669 // ForceSendFields is a list of field names (e.g. "Requests") to 670 // unconditionally include in API requests. By default, fields with empty or 671 // default values are omitted from API requests. See 672 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 673 // details. 674 ForceSendFields []string `json:"-"` 675 // NullFields is a list of field names (e.g. "Requests") to include in API 676 // requests with the JSON null value. By default, fields with empty values are 677 // omitted from API requests. See 678 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 679 NullFields []string `json:"-"` 680 } 681 682 func (s *BatchCreateAdUnitMappingsRequest) MarshalJSON() ([]byte, error) { 683 type NoMethod BatchCreateAdUnitMappingsRequest 684 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 685 } 686 687 // BatchCreateAdUnitMappingsResponse: Response containing a batch of created ad 688 // unit mappings. 689 type BatchCreateAdUnitMappingsResponse struct { 690 // AdUnitMappings: The Ad units mappings created under the requested account. 691 AdUnitMappings []*AdUnitMapping `json:"adUnitMappings,omitempty"` 692 693 // ServerResponse contains the HTTP response code and headers from the server. 694 googleapi.ServerResponse `json:"-"` 695 // ForceSendFields is a list of field names (e.g. "AdUnitMappings") to 696 // unconditionally include in API requests. By default, fields with empty or 697 // default values are omitted from API requests. See 698 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 699 // details. 700 ForceSendFields []string `json:"-"` 701 // NullFields is a list of field names (e.g. "AdUnitMappings") to include in 702 // API requests with the JSON null value. By default, fields with empty values 703 // are omitted from API requests. See 704 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 705 NullFields []string `json:"-"` 706 } 707 708 func (s *BatchCreateAdUnitMappingsResponse) MarshalJSON() ([]byte, error) { 709 type NoMethod BatchCreateAdUnitMappingsResponse 710 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 711 } 712 713 // CampaignReportSpec: The specification for generating a Campaign report. For 714 // example, the specification to get IMPRESSIONS and CLICKS sliced by 715 // CAMPAIGN_ID can look like the following example: { "date_range": { 716 // "start_date": {"year": 2021, "month": 12, "day": 1}, "end_date": {"year": 717 // 2021, "month": 12, "day": 30} }, "dimensions": ["CAMPAIGN_ID"], "metrics": 718 // ["IMPRESSIONS", "CLICKS"], } 719 type CampaignReportSpec struct { 720 // DateRange: The date range for which the report is generated. The max range 721 // is 30 days. 722 DateRange *DateRange `json:"dateRange,omitempty"` 723 // Dimensions: List of dimensions of the report. The value combination of these 724 // dimensions determines the row of the report. If no dimensions are specified, 725 // the report returns a single row of requested metrics for the entire account. 726 // 727 // Possible values: 728 // "DIMENSION_UNSPECIFIED" - Default value of an unspecified dimension. Do 729 // not use. 730 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). 731 // "CAMPAIGN_ID" - The unique ID of the campaign, for example "123456789", 732 // which is consistent with the campaign id from campaign list api. 733 // "CAMPAIGN_NAME" - The name of the campaign. 734 // "AD_ID" - The unique ID of the ad, for example "123456789". 735 // "AD_NAME" - The name of the ad, which may not be unique. 736 // "PLACEMENT_ID" - The vendor-specific unique ID of the app where the ad is 737 // placed. For example, com.goog.bar for Android and 123456789 for iOS apps. 738 // "PLACEMENT_NAME" - The name of the app where the ad is placed. 739 // "PLACEMENT_PLATFORM" - The platform of the app where the ad is placed. 740 // "COUNTRY" - The name of the targeted country. 741 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 742 // delivery dimension. 743 Dimensions []string `json:"dimensions,omitempty"` 744 // LanguageCode: Language used for any localized text, such as certain 745 // applicable dimension values. The language tag is defined in the IETF BCP47. 746 // Defaults to 'en-US' if unspecified or invalid. 747 LanguageCode string `json:"languageCode,omitempty"` 748 // Metrics: List of metrics of the report. A report must specify at least one 749 // metric. 750 // 751 // Possible values: 752 // "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use. 753 // "IMPRESSIONS" - The number of times an ad is shown to the user. 754 // "CLICKS" - The number of times a user clicks an ad. 755 // "CLICK_THROUGH_RATE" - The number of clicks an ad receives divided by the 756 // number of times the ad is shown. 757 // "INSTALLS" - The number of times apps were downloaded to devices. 758 // "ESTIMATED_COST" - The estimated cost of serving a campaign ad instead of 759 // an ad that earns revenue. The currency is the reporting currency for 760 // campaigns. 761 // "AVERAGE_CPI" - The average cost per install. This means the average 762 // amount that was spent to acquire a new user. The currency is the reporting 763 // currency for campaigns. 764 // "INTERACTIONS" - The number of times a user interacts with an ad. This 765 // consists of clicks and engagements. 766 Metrics []string `json:"metrics,omitempty"` 767 // ForceSendFields is a list of field names (e.g. "DateRange") to 768 // unconditionally include in API requests. By default, fields with empty or 769 // default values are omitted from API requests. See 770 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 771 // details. 772 ForceSendFields []string `json:"-"` 773 // NullFields is a list of field names (e.g. "DateRange") to include in API 774 // requests with the JSON null value. By default, fields with empty values are 775 // omitted from API requests. See 776 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 777 NullFields []string `json:"-"` 778 } 779 780 func (s *CampaignReportSpec) MarshalJSON() ([]byte, error) { 781 type NoMethod CampaignReportSpec 782 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 783 } 784 785 // CreateAdUnitMappingRequest: Request to create an ad unit mapping under the 786 // specific AdMob account and ad unit. 787 type CreateAdUnitMappingRequest struct { 788 // AdUnitMapping: Required. The ad unit mapping to create. 789 AdUnitMapping *AdUnitMapping `json:"adUnitMapping,omitempty"` 790 // Parent: Required. The parent which owns the ad unit mapping. Format: 791 // accounts/{publisher_id}/adUnits/{ad_unit_id} 792 Parent string `json:"parent,omitempty"` 793 // ForceSendFields is a list of field names (e.g. "AdUnitMapping") to 794 // unconditionally include in API requests. By default, fields with empty or 795 // default values are omitted from API requests. See 796 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 797 // details. 798 ForceSendFields []string `json:"-"` 799 // NullFields is a list of field names (e.g. "AdUnitMapping") to include in API 800 // requests with the JSON null value. By default, fields with empty values are 801 // omitted from API requests. See 802 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 803 NullFields []string `json:"-"` 804 } 805 806 func (s *CreateAdUnitMappingRequest) MarshalJSON() ([]byte, error) { 807 type NoMethod CreateAdUnitMappingRequest 808 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 809 } 810 811 // Date: Represents a whole or partial calendar date, such as a birthday. The 812 // time of day and time zone are either specified elsewhere or are 813 // insignificant. The date is relative to the Gregorian Calendar. This can 814 // represent one of the following: * A full date, with non-zero year, month, 815 // and day values. * A month and day, with a zero year (for example, an 816 // anniversary). * A year on its own, with a zero month and a zero day. * A 817 // year and month, with a zero day (for example, a credit card expiration 818 // date). Related types: * google.type.TimeOfDay * google.type.DateTime * 819 // google.protobuf.Timestamp 820 type Date struct { 821 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month, 822 // or 0 to specify a year by itself or a year and month where the day isn't 823 // significant. 824 Day int64 `json:"day,omitempty"` 825 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without 826 // a month and day. 827 Month int64 `json:"month,omitempty"` 828 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date 829 // without a year. 830 Year int64 `json:"year,omitempty"` 831 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally 832 // include in API requests. By default, fields with empty or default values are 833 // omitted from API requests. See 834 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 835 // details. 836 ForceSendFields []string `json:"-"` 837 // NullFields is a list of field names (e.g. "Day") to include in API requests 838 // with the JSON null value. By default, fields with empty values are omitted 839 // from API requests. See 840 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 841 NullFields []string `json:"-"` 842 } 843 844 func (s *Date) MarshalJSON() ([]byte, error) { 845 type NoMethod Date 846 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 847 } 848 849 // DateRange: Specification of a single date range. Both dates are inclusive. 850 type DateRange struct { 851 // EndDate: End date of the date range, inclusive. Must be greater than or 852 // equal to the start date. 853 EndDate *Date `json:"endDate,omitempty"` 854 // StartDate: Start date of the date range, inclusive. Must be less than or 855 // equal to the end date. 856 StartDate *Date `json:"startDate,omitempty"` 857 // ForceSendFields is a list of field names (e.g. "EndDate") to unconditionally 858 // include in API requests. By default, fields with empty or default values are 859 // omitted from API requests. See 860 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 861 // details. 862 ForceSendFields []string `json:"-"` 863 // NullFields is a list of field names (e.g. "EndDate") to include in API 864 // requests with the JSON null value. By default, fields with empty values are 865 // omitted from API requests. See 866 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 867 NullFields []string `json:"-"` 868 } 869 870 func (s *DateRange) MarshalJSON() ([]byte, error) { 871 type NoMethod DateRange 872 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 873 } 874 875 // GenerateCampaignReportRequest: Request to generate campaign report. 876 type GenerateCampaignReportRequest struct { 877 // ReportSpec: Campaign report specification. 878 ReportSpec *CampaignReportSpec `json:"reportSpec,omitempty"` 879 // ForceSendFields is a list of field names (e.g. "ReportSpec") to 880 // unconditionally include in API requests. By default, fields with empty or 881 // default values are omitted from API requests. See 882 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 883 // details. 884 ForceSendFields []string `json:"-"` 885 // NullFields is a list of field names (e.g. "ReportSpec") to include in API 886 // requests with the JSON null value. By default, fields with empty values are 887 // omitted from API requests. See 888 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 889 NullFields []string `json:"-"` 890 } 891 892 func (s *GenerateCampaignReportRequest) MarshalJSON() ([]byte, error) { 893 type NoMethod GenerateCampaignReportRequest 894 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 895 } 896 897 // GenerateCampaignReportResponse: Campaign Report API response. 898 type GenerateCampaignReportResponse struct { 899 // Rows: The campaign report data from the specified publisher. At most 100000 900 // rows will be returned from the API. 901 Rows []*ReportRow `json:"rows,omitempty"` 902 903 // ServerResponse contains the HTTP response code and headers from the server. 904 googleapi.ServerResponse `json:"-"` 905 // ForceSendFields is a list of field names (e.g. "Rows") to unconditionally 906 // include in API requests. By default, fields with empty or default values are 907 // omitted from API requests. See 908 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 909 // details. 910 ForceSendFields []string `json:"-"` 911 // NullFields is a list of field names (e.g. "Rows") to include in API requests 912 // with the JSON null value. By default, fields with empty values are omitted 913 // from API requests. See 914 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 915 NullFields []string `json:"-"` 916 } 917 918 func (s *GenerateCampaignReportResponse) MarshalJSON() ([]byte, error) { 919 type NoMethod GenerateCampaignReportResponse 920 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 921 } 922 923 // GenerateMediationReportRequest: Request to generate an AdMob Mediation 924 // report. 925 type GenerateMediationReportRequest struct { 926 // ReportSpec: Network report specification. 927 ReportSpec *MediationReportSpec `json:"reportSpec,omitempty"` 928 // ForceSendFields is a list of field names (e.g. "ReportSpec") to 929 // unconditionally include in API requests. By default, fields with empty or 930 // default values are omitted from API requests. See 931 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 932 // details. 933 ForceSendFields []string `json:"-"` 934 // NullFields is a list of field names (e.g. "ReportSpec") to include in API 935 // requests with the JSON null value. By default, fields with empty values are 936 // omitted from API requests. See 937 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 938 NullFields []string `json:"-"` 939 } 940 941 func (s *GenerateMediationReportRequest) MarshalJSON() ([]byte, error) { 942 type NoMethod GenerateMediationReportRequest 943 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 944 } 945 946 // GenerateMediationReportResponse: The streaming response for the AdMob 947 // Mediation report where the first response contains the report header, then a 948 // stream of row responses, and finally a footer as the last response message. 949 // For example: [{ "header": { "date_range": { "start_date": {"year": 2018, 950 // "month": 9, "day": 1}, "end_date": {"year": 2018, "month": 9, "day": 1} }, 951 // "localization_settings": { "currency_code": "USD", "language_code": "en-US" 952 // } } }, { "row": { "dimension_values": { "DATE": {"value": "20180918"}, 953 // "APP": { "value": "ca-app-pub-8123415297019784~1001342552", "display_label": 954 // "My app name!" } }, "metric_values": { "ESTIMATED_EARNINGS": 955 // {"decimal_value": "1324746"} } } }, { "footer": {"matching_row_count": 1} }] 956 type GenerateMediationReportResponse struct { 957 // Footer: Additional information about the generated report, such as warnings 958 // about the data. 959 Footer *ReportFooter `json:"footer,omitempty"` 960 // Header: Report generation settings that describes the report contents, such 961 // as the report date range and localization settings. 962 Header *ReportHeader `json:"header,omitempty"` 963 // Row: Actual report data. 964 Row *ReportRow `json:"row,omitempty"` 965 966 // ServerResponse contains the HTTP response code and headers from the server. 967 googleapi.ServerResponse `json:"-"` 968 // ForceSendFields is a list of field names (e.g. "Footer") to unconditionally 969 // include in API requests. By default, fields with empty or default values are 970 // omitted from API requests. See 971 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 972 // details. 973 ForceSendFields []string `json:"-"` 974 // NullFields is a list of field names (e.g. "Footer") to include in API 975 // requests with the JSON null value. By default, fields with empty values are 976 // omitted from API requests. See 977 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 978 NullFields []string `json:"-"` 979 } 980 981 func (s *GenerateMediationReportResponse) MarshalJSON() ([]byte, error) { 982 type NoMethod GenerateMediationReportResponse 983 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 984 } 985 986 // GenerateNetworkReportRequest: Request to generate an AdMob Network report. 987 type GenerateNetworkReportRequest struct { 988 // ReportSpec: Network report specification. 989 ReportSpec *NetworkReportSpec `json:"reportSpec,omitempty"` 990 // ForceSendFields is a list of field names (e.g. "ReportSpec") to 991 // unconditionally include in API requests. By default, fields with empty or 992 // default values are omitted from API requests. See 993 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 994 // details. 995 ForceSendFields []string `json:"-"` 996 // NullFields is a list of field names (e.g. "ReportSpec") to include in API 997 // requests with the JSON null value. By default, fields with empty values are 998 // omitted from API requests. See 999 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1000 NullFields []string `json:"-"` 1001 } 1002 1003 func (s *GenerateNetworkReportRequest) MarshalJSON() ([]byte, error) { 1004 type NoMethod GenerateNetworkReportRequest 1005 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1006 } 1007 1008 // GenerateNetworkReportResponse: The streaming response for the AdMob Network 1009 // report where the first response contains the report header, then a stream of 1010 // row responses, and finally a footer as the last response message. For 1011 // example: [{ "header": { "dateRange": { "startDate": {"year": 2018, "month": 1012 // 9, "day": 1}, "endDate": {"year": 2018, "month": 9, "day": 1} }, 1013 // "localizationSettings": { "currencyCode": "USD", "languageCode": "en-US" } } 1014 // }, { "row": { "dimensionValues": { "DATE": {"value": "20180918"}, "APP": { 1015 // "value": "ca-app-pub-8123415297019784~1001342552", displayLabel: "My app 1016 // name!" } }, "metricValues": { "ESTIMATED_EARNINGS": {"microsValue": 6500000} 1017 // } } }, { "footer": {"matchingRowCount": 1} }] 1018 type GenerateNetworkReportResponse struct { 1019 // Footer: Additional information about the generated report, such as warnings 1020 // about the data. 1021 Footer *ReportFooter `json:"footer,omitempty"` 1022 // Header: Report generation settings that describes the report contents, such 1023 // as the report date range and localization settings. 1024 Header *ReportHeader `json:"header,omitempty"` 1025 // Row: Actual report data. 1026 Row *ReportRow `json:"row,omitempty"` 1027 1028 // ServerResponse contains the HTTP response code and headers from the server. 1029 googleapi.ServerResponse `json:"-"` 1030 // ForceSendFields is a list of field names (e.g. "Footer") to unconditionally 1031 // include in API requests. By default, fields with empty or default values are 1032 // omitted from API requests. See 1033 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1034 // details. 1035 ForceSendFields []string `json:"-"` 1036 // NullFields is a list of field names (e.g. "Footer") to include in API 1037 // requests with the JSON null value. By default, fields with empty values are 1038 // omitted from API requests. See 1039 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1040 NullFields []string `json:"-"` 1041 } 1042 1043 func (s *GenerateNetworkReportResponse) MarshalJSON() ([]byte, error) { 1044 type NoMethod GenerateNetworkReportResponse 1045 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1046 } 1047 1048 // ListAdSourcesResponse: Response for the ListAdSourcesRequest. 1049 type ListAdSourcesResponse struct { 1050 // AdSources: The ad sources. 1051 AdSources []*AdSource `json:"adSources,omitempty"` 1052 // NextPageToken: Used to set the `page_token` in the `ListAdSourcesRequest` to 1053 // retrieve the next page. If this field is omitted, there are no subsequent 1054 // pages. 1055 NextPageToken string `json:"nextPageToken,omitempty"` 1056 1057 // ServerResponse contains the HTTP response code and headers from the server. 1058 googleapi.ServerResponse `json:"-"` 1059 // ForceSendFields is a list of field names (e.g. "AdSources") to 1060 // unconditionally include in API requests. By default, fields with empty or 1061 // default values are omitted from API requests. See 1062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1063 // details. 1064 ForceSendFields []string `json:"-"` 1065 // NullFields is a list of field names (e.g. "AdSources") to include in API 1066 // requests with the JSON null value. By default, fields with empty values are 1067 // omitted from API requests. See 1068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1069 NullFields []string `json:"-"` 1070 } 1071 1072 func (s *ListAdSourcesResponse) MarshalJSON() ([]byte, error) { 1073 type NoMethod ListAdSourcesResponse 1074 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1075 } 1076 1077 // ListAdUnitMappingsResponse: Response for the ListAdUnitMappingsRequest. 1078 type ListAdUnitMappingsResponse struct { 1079 // AdUnitMappings: The ad unit mappings from the specified account and ad unit. 1080 AdUnitMappings []*AdUnitMapping `json:"adUnitMappings,omitempty"` 1081 // NextPageToken: Used to set the `page_token` in the 1082 // `ListAdUnitMappingsRequest` to retrieve the next page. If this field is 1083 // omitted, there are no subsequent pages. 1084 NextPageToken string `json:"nextPageToken,omitempty"` 1085 1086 // ServerResponse contains the HTTP response code and headers from the server. 1087 googleapi.ServerResponse `json:"-"` 1088 // ForceSendFields is a list of field names (e.g. "AdUnitMappings") to 1089 // unconditionally include in API requests. By default, fields with empty or 1090 // default values are omitted from API requests. See 1091 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1092 // details. 1093 ForceSendFields []string `json:"-"` 1094 // NullFields is a list of field names (e.g. "AdUnitMappings") to include in 1095 // API requests with the JSON null value. By default, fields with empty values 1096 // are omitted from API requests. See 1097 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1098 NullFields []string `json:"-"` 1099 } 1100 1101 func (s *ListAdUnitMappingsResponse) MarshalJSON() ([]byte, error) { 1102 type NoMethod ListAdUnitMappingsResponse 1103 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1104 } 1105 1106 // ListAdUnitsResponse: Response for the ad units list request. 1107 type ListAdUnitsResponse struct { 1108 // AdUnits: The resulting ad units for the requested account. 1109 AdUnits []*AdUnit `json:"adUnits,omitempty"` 1110 // NextPageToken: If not empty, indicates that there may be more ad units for 1111 // the request; this value should be passed in a new `ListAdUnitsRequest`. 1112 NextPageToken string `json:"nextPageToken,omitempty"` 1113 1114 // ServerResponse contains the HTTP response code and headers from the server. 1115 googleapi.ServerResponse `json:"-"` 1116 // ForceSendFields is a list of field names (e.g. "AdUnits") to unconditionally 1117 // include in API requests. By default, fields with empty or default values are 1118 // omitted from API requests. See 1119 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1120 // details. 1121 ForceSendFields []string `json:"-"` 1122 // NullFields is a list of field names (e.g. "AdUnits") to include in API 1123 // requests with the JSON null value. By default, fields with empty values are 1124 // omitted from API requests. See 1125 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1126 NullFields []string `json:"-"` 1127 } 1128 1129 func (s *ListAdUnitsResponse) MarshalJSON() ([]byte, error) { 1130 type NoMethod ListAdUnitsResponse 1131 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1132 } 1133 1134 // ListAdaptersResponse: Response for the ListAdaptersRequest. 1135 type ListAdaptersResponse struct { 1136 // Adapters: The adapter. 1137 Adapters []*Adapter `json:"adapters,omitempty"` 1138 // NextPageToken: Used to set the `page_token` in the `ListAdapterRequest` to 1139 // retrieve the next page. If this field is omitted, there are no subsequent 1140 // pages. 1141 NextPageToken string `json:"nextPageToken,omitempty"` 1142 1143 // ServerResponse contains the HTTP response code and headers from the server. 1144 googleapi.ServerResponse `json:"-"` 1145 // ForceSendFields is a list of field names (e.g. "Adapters") to 1146 // unconditionally include in API requests. By default, fields with empty or 1147 // default values are omitted from API requests. See 1148 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1149 // details. 1150 ForceSendFields []string `json:"-"` 1151 // NullFields is a list of field names (e.g. "Adapters") to include in API 1152 // requests with the JSON null value. By default, fields with empty values are 1153 // omitted from API requests. See 1154 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1155 NullFields []string `json:"-"` 1156 } 1157 1158 func (s *ListAdaptersResponse) MarshalJSON() ([]byte, error) { 1159 type NoMethod ListAdaptersResponse 1160 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1161 } 1162 1163 // ListAppsResponse: Response for the apps list request. 1164 type ListAppsResponse struct { 1165 // Apps: The resulting apps for the requested account. 1166 Apps []*App `json:"apps,omitempty"` 1167 // NextPageToken: If not empty, indicates that there may be more apps for the 1168 // request; this value should be passed in a new `ListAppsRequest`. 1169 NextPageToken string `json:"nextPageToken,omitempty"` 1170 1171 // ServerResponse contains the HTTP response code and headers from the server. 1172 googleapi.ServerResponse `json:"-"` 1173 // ForceSendFields is a list of field names (e.g. "Apps") to unconditionally 1174 // include in API requests. By default, fields with empty or default values are 1175 // omitted from API requests. See 1176 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1177 // details. 1178 ForceSendFields []string `json:"-"` 1179 // NullFields is a list of field names (e.g. "Apps") to include in API requests 1180 // with the JSON null value. By default, fields with empty values are omitted 1181 // from API requests. See 1182 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1183 NullFields []string `json:"-"` 1184 } 1185 1186 func (s *ListAppsResponse) MarshalJSON() ([]byte, error) { 1187 type NoMethod ListAppsResponse 1188 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1189 } 1190 1191 // ListMediationGroupsResponse: Response for the mediation groups list request. 1192 type ListMediationGroupsResponse struct { 1193 // MediationGroups: The resulting mediation groups for the requested account. 1194 MediationGroups []*MediationGroup `json:"mediationGroups,omitempty"` 1195 // NextPageToken: If not empty, indicates that there may be more mediation 1196 // groups for the request; this value should be passed in a new 1197 // `ListMediationGroupsRequest`. 1198 NextPageToken string `json:"nextPageToken,omitempty"` 1199 1200 // ServerResponse contains the HTTP response code and headers from the server. 1201 googleapi.ServerResponse `json:"-"` 1202 // ForceSendFields is a list of field names (e.g. "MediationGroups") to 1203 // unconditionally include in API requests. By default, fields with empty or 1204 // default values are omitted from API requests. See 1205 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1206 // details. 1207 ForceSendFields []string `json:"-"` 1208 // NullFields is a list of field names (e.g. "MediationGroups") to include in 1209 // API requests with the JSON null value. By default, fields with empty values 1210 // are omitted from API requests. See 1211 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1212 NullFields []string `json:"-"` 1213 } 1214 1215 func (s *ListMediationGroupsResponse) MarshalJSON() ([]byte, error) { 1216 type NoMethod ListMediationGroupsResponse 1217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1218 } 1219 1220 // ListPublisherAccountsResponse: Response for the publisher account list 1221 // request. 1222 type ListPublisherAccountsResponse struct { 1223 // Account: Publisher that the client credentials can access. 1224 Account []*PublisherAccount `json:"account,omitempty"` 1225 // NextPageToken: If not empty, indicates that there might be more accounts for 1226 // the request; you must pass this value in a new 1227 // `ListPublisherAccountsRequest`. 1228 NextPageToken string `json:"nextPageToken,omitempty"` 1229 1230 // ServerResponse contains the HTTP response code and headers from the server. 1231 googleapi.ServerResponse `json:"-"` 1232 // ForceSendFields is a list of field names (e.g. "Account") to unconditionally 1233 // include in API requests. By default, fields with empty or default values are 1234 // omitted from API requests. See 1235 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1236 // details. 1237 ForceSendFields []string `json:"-"` 1238 // NullFields is a list of field names (e.g. "Account") to include in API 1239 // requests with the JSON null value. By default, fields with empty values are 1240 // omitted from API requests. See 1241 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1242 NullFields []string `json:"-"` 1243 } 1244 1245 func (s *ListPublisherAccountsResponse) MarshalJSON() ([]byte, error) { 1246 type NoMethod ListPublisherAccountsResponse 1247 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1248 } 1249 1250 // LocalizationSettings: Localization settings for reports, such as currency 1251 // and language. It affects how metrics are calculated. 1252 type LocalizationSettings struct { 1253 // CurrencyCode: Currency code of the earning related metrics, which is the 1254 // 3-letter code defined in ISO 4217. The daily average rate is used for the 1255 // currency conversion. Defaults to the account currency code if unspecified. 1256 CurrencyCode string `json:"currencyCode,omitempty"` 1257 // LanguageCode: Language used for any localized text, such as some dimension 1258 // value display labels. The language tag defined in the IETF BCP47. Defaults 1259 // to 'en-US' if unspecified. 1260 LanguageCode string `json:"languageCode,omitempty"` 1261 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to 1262 // unconditionally include in API requests. By default, fields with empty or 1263 // default values are omitted from API requests. See 1264 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1265 // details. 1266 ForceSendFields []string `json:"-"` 1267 // NullFields is a list of field names (e.g. "CurrencyCode") to include in API 1268 // requests with the JSON null value. By default, fields with empty values are 1269 // omitted from API requests. See 1270 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1271 NullFields []string `json:"-"` 1272 } 1273 1274 func (s *LocalizationSettings) MarshalJSON() ([]byte, error) { 1275 type NoMethod LocalizationSettings 1276 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1277 } 1278 1279 // MediationAbExperiment: The mediation A/B experiment. 1280 type MediationAbExperiment struct { 1281 // ControlMediationLines: Output only. The experiment mediation lines for 1282 // control. They are inherited from the parent mediation group. It is an output 1283 // only field. 1284 ControlMediationLines []*MediationAbExperimentExperimentMediationLine `json:"controlMediationLines,omitempty"` 1285 // DisplayName: The display name for the mediation A/B experiment. 1286 DisplayName string `json:"displayName,omitempty"` 1287 // EndTime: Output only. The time at which the experiment was ended or target 1288 // to end (in UTC). 1289 EndTime string `json:"endTime,omitempty"` 1290 // ExperimentId: Output only. Unique identifier for the mediation A/B 1291 // experiment. It is an output only property. 1292 ExperimentId string `json:"experimentId,omitempty"` 1293 // MediationGroupId: Output only. The mediation group id this experiment 1294 // belongs to. This can be used for filtering the experiments in the list 1295 // experiments API. 1296 MediationGroupId string `json:"mediationGroupId,omitempty"` 1297 // Name: Resource name for this experiment. The format is 1298 // accounts/{publisher_id}/ 1299 // mediationGroups/{mediation_group_id}/mediationAbExperiment/ 1300 // {mediation_group_experiment_id}. For example: 1301 // accounts/pub-9876543210987654/mediationGroups/0123456789/ 1302 // mediationAbExperiment/12345 1303 Name string `json:"name,omitempty"` 1304 // StartTime: Output only. The time at which the experiment was started (in 1305 // UTC). 1306 StartTime string `json:"startTime,omitempty"` 1307 // State: Output only. The state of the experiment. It is an output only field. 1308 // 1309 // Possible values: 1310 // "EXPERIMENT_STATE_UNSPECIFIED" - Default for an unset field. Do not use. 1311 // "EXPIRED" - The experiment has expired. 1312 // "RUNNING" - The experiment is running and thus used in serving. 1313 // "ENDED" - The experiment is ended, but not yet expired. Serving continues 1314 // in the original configurations while the experiment is ready to call an 1315 // action. 1316 State string `json:"state,omitempty"` 1317 // TreatmentMediationLines: The experiment mediation lines created for the 1318 // treatment. They will be used for serving when the experiment status is 1319 // RUNNING. 1320 TreatmentMediationLines []*MediationAbExperimentExperimentMediationLine `json:"treatmentMediationLines,omitempty"` 1321 // TreatmentTrafficPercentage: The percentage of the mediation A/B experiment 1322 // traffic that will be send to the treatment (variant B). The remainder is 1323 // sent to the control (variant A). The percentage is expressed as an integer 1324 // in the inclusive range of [1,99]. See 1325 // https://support.google.com/admob/answer/9572326 for details. 1326 TreatmentTrafficPercentage int64 `json:"treatmentTrafficPercentage,omitempty,string"` 1327 // VariantLeader: Output only. The variant leader for the experiment according 1328 // to some key metrics. 1329 // 1330 // Possible values: 1331 // "VARIANT_LEADER_UNSPECIFIED" - Default value of the enum. Do not use. 1332 // "CONTROL" - The control leading the experiment. 1333 // "TREATMENT" - The treatment leading the experiment. 1334 // "INSUFFICIENT_DATA" - Collected data (impressions) are insufficient to 1335 // determine a leader. 1336 // "TOO_EARLY_TO_CALL" - Experiment hasn't run long enough to determine a 1337 // leader. 1338 // "NO_VARIANT_LEADER" - Neither variant is a decisive winner in the observed 1339 // data. 1340 VariantLeader string `json:"variantLeader,omitempty"` 1341 1342 // ServerResponse contains the HTTP response code and headers from the server. 1343 googleapi.ServerResponse `json:"-"` 1344 // ForceSendFields is a list of field names (e.g. "ControlMediationLines") to 1345 // unconditionally include in API requests. By default, fields with empty or 1346 // default values are omitted from API requests. See 1347 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1348 // details. 1349 ForceSendFields []string `json:"-"` 1350 // NullFields is a list of field names (e.g. "ControlMediationLines") to 1351 // include in API requests with the JSON null value. By default, fields with 1352 // empty values are omitted from API requests. See 1353 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1354 NullFields []string `json:"-"` 1355 } 1356 1357 func (s *MediationAbExperiment) MarshalJSON() ([]byte, error) { 1358 type NoMethod MediationAbExperiment 1359 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1360 } 1361 1362 // MediationAbExperimentExperimentMediationLine: The mediation group line for 1363 // the experiment. It will be used for serving during the run of the 1364 // experiment. 1365 type MediationAbExperimentExperimentMediationLine struct { 1366 // MediationGroupLine: The mediation group line used by the experiment. 1367 MediationGroupLine *MediationGroupMediationGroupLine `json:"mediationGroupLine,omitempty"` 1368 // ForceSendFields is a list of field names (e.g. "MediationGroupLine") to 1369 // unconditionally include in API requests. By default, fields with empty or 1370 // default values are omitted from API requests. See 1371 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1372 // details. 1373 ForceSendFields []string `json:"-"` 1374 // NullFields is a list of field names (e.g. "MediationGroupLine") to include 1375 // in API requests with the JSON null value. By default, fields with empty 1376 // values are omitted from API requests. See 1377 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1378 NullFields []string `json:"-"` 1379 } 1380 1381 func (s *MediationAbExperimentExperimentMediationLine) MarshalJSON() ([]byte, error) { 1382 type NoMethod MediationAbExperimentExperimentMediationLine 1383 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1384 } 1385 1386 // MediationGroup: Describes an AdMob Mediation group. 1387 type MediationGroup struct { 1388 // DisplayName: User provided name for the mediation group. The maximum length 1389 // allowed is 120 characters. 1390 DisplayName string `json:"displayName,omitempty"` 1391 // MediationAbExperimentState: Output only. The state of the mediation a/b 1392 // experiment that belongs to this mediation group. 1393 // 1394 // Possible values: 1395 // "EXPERIMENT_STATE_UNSPECIFIED" - Default value for an unset field. Do not 1396 // use. 1397 // "RUNNING" - The mediation group has an experiment in the RUNNING state. 1398 // "NOT_RUNNING" - There is no experiment in the RUNNING state in the 1399 // mediation group. 1400 MediationAbExperimentState string `json:"mediationAbExperimentState,omitempty"` 1401 // MediationGroupId: The ID of the mediation group. Example: "0123456789". This 1402 // is a read only property. 1403 MediationGroupId string `json:"mediationGroupId,omitempty"` 1404 // MediationGroupLines: The mediation lines used for serving for this mediation 1405 // group. Key is the ID of the mediation group line. For creation, use distinct 1406 // negative values as placeholder. 1407 MediationGroupLines map[string]MediationGroupMediationGroupLine `json:"mediationGroupLines,omitempty"` 1408 // Name: Resource name for this mediation group. Format is: 1409 // accounts/{publisher_id}/mediationGroups/{mediation_group_id} Example: 1410 // accounts/pub-9876543210987654/mediationGroups/0123456789 1411 Name string `json:"name,omitempty"` 1412 // State: The status of the mediation group. Only enabled mediation groups will 1413 // be served. 1414 // 1415 // Possible values: 1416 // "STATE_UNSPECIFIED" - Default value for an unset field. Do not use. 1417 // "ENABLED" - The mediation group is active and used to serve ads or to 1418 // collect stats. 1419 // "DISABLED" - The mediation group has been disabled and is no longer 1420 // serving ads or collecting stats. Disabled mediation groups can be 1421 // re-enabled. 1422 State string `json:"state,omitempty"` 1423 // Targeting: Set of criteria targeted by this mediation group, such as ad 1424 // units and geo locations. 1425 Targeting *MediationGroupTargeting `json:"targeting,omitempty"` 1426 1427 // ServerResponse contains the HTTP response code and headers from the server. 1428 googleapi.ServerResponse `json:"-"` 1429 // ForceSendFields is a list of field names (e.g. "DisplayName") to 1430 // unconditionally include in API requests. By default, fields with empty or 1431 // default values are omitted from API requests. See 1432 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1433 // details. 1434 ForceSendFields []string `json:"-"` 1435 // NullFields is a list of field names (e.g. "DisplayName") to include in API 1436 // requests with the JSON null value. By default, fields with empty values are 1437 // omitted from API requests. See 1438 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1439 NullFields []string `json:"-"` 1440 } 1441 1442 func (s *MediationGroup) MarshalJSON() ([]byte, error) { 1443 type NoMethod MediationGroup 1444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1445 } 1446 1447 // MediationGroupMediationGroupLine: Settings for an ad network used by a 1448 // mediation group. 1449 type MediationGroupMediationGroupLine struct { 1450 // AdSourceId: The ID of the ad source this mediation line is associated with. 1451 AdSourceId string `json:"adSourceId,omitempty"` 1452 // AdUnitMappings: References of the ad unit mappings for each ad unit 1453 // associated with this mediation line. Key is the ad unit ID, value is 1454 // resource name of the ad unit mapping. For mediation lines where the ad 1455 // source id is the AdMob Network, ad unit mappings will be ignored. 1456 AdUnitMappings map[string]string `json:"adUnitMappings,omitempty"` 1457 // CpmMicros: The CPM for this allocation line. $0.01 is the minimum allowed 1458 // amount. For LIVE CPM modes, the default amount is $0.01. This value is 1459 // ignored if `cpm_mode` is `LIVE`. **Warning:** "USD" is the only supported 1460 // currency at the moment. The unit is in micros. 1461 CpmMicros int64 `json:"cpmMicros,omitempty,string"` 1462 // CpmMode: Indicates how the CPM for this mediation line is provided. Note 1463 // that `MANUAL` and `LIVE` are the only fully-supported mode at the moment. 1464 // Please use the AdMob UI (https://admob.google.com) if you wish to create or 1465 // update to other cpm modes. 1466 // 1467 // Possible values: 1468 // "CPM_MODE_UNSPECIFIED" - Default value for an unset field. Do not use. 1469 // "LIVE" - CPM is calculated per ad request based on the ad auction. 1470 // "MANUAL" - CPM is set by the user manually. 1471 // "ANO" - CPM is retrieved from the ad network using the publisher specified 1472 // credentials. Output only. 1473 CpmMode string `json:"cpmMode,omitempty"` 1474 // DisplayName: User-provided label for this mediation line. The maximum length 1475 // allowed is 255 characters. 1476 DisplayName string `json:"displayName,omitempty"` 1477 // ExperimentVariant: Output only. The Mediation A/B experiment variant to 1478 // which the mediation group line belongs to. 1479 // 1480 // Possible values: 1481 // "VARIANT_UNSPECIFIED" - Default value for an unset field. Do not use. 1482 // "VARIANT_A" - The mediation group line belongs to the variant A. 1483 // "VARIANT_B" - The mediation group line belongs to the variant B. 1484 // "ORIGINAL" - The mediation group line isn't a part of an experiment. 1485 ExperimentVariant string `json:"experimentVariant,omitempty"` 1486 // Id: The 16 digit ID for this mediation line e.g. 0123456789012345. When 1487 // creating a new mediation group line, use a distinct negative integer as the 1488 // ID place holder. 1489 Id string `json:"id,omitempty"` 1490 // State: The status of the mediation group line. Only enabled mediation group 1491 // lines will be served. 1492 // 1493 // Possible values: 1494 // "STATE_UNSPECIFIED" - Default value for an unset field. Do not use. 1495 // "ENABLED" - The mediation group line is active and used to serve ads. 1496 // "DISABLED" - The mediation group line has been disabled and is no longer 1497 // served. Disabled mediation group lines can be re-enabled. 1498 // "REMOVED" - The mediation group line will be removed and no longer served. 1499 // Removed mediation group lines can not be re-enabled and will no longer be 1500 // visible. This is an input only field. 1501 State string `json:"state,omitempty"` 1502 // ForceSendFields is a list of field names (e.g. "AdSourceId") to 1503 // unconditionally include in API requests. By default, fields with empty or 1504 // default values are omitted from API requests. See 1505 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1506 // details. 1507 ForceSendFields []string `json:"-"` 1508 // NullFields is a list of field names (e.g. "AdSourceId") to include in API 1509 // requests with the JSON null value. By default, fields with empty values are 1510 // omitted from API requests. See 1511 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1512 NullFields []string `json:"-"` 1513 } 1514 1515 func (s *MediationGroupMediationGroupLine) MarshalJSON() ([]byte, error) { 1516 type NoMethod MediationGroupMediationGroupLine 1517 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1518 } 1519 1520 // MediationGroupTargeting: Set of criteria targeted by this mediation group. 1521 // For example, a mediation group can target specific ad unit IDs, platform, 1522 // format and geo location. 1523 type MediationGroupTargeting struct { 1524 // AdUnitIds: Ad units targeted by this mediation group. Example: 1525 // "ca-app-pub-1234/8790". 1526 AdUnitIds []string `json:"adUnitIds,omitempty"` 1527 // ExcludedRegionCodes: The Unicode country/region code (CLDR) of a location, 1528 // such as "US". Unset if this mediation group does not exclude any region. 1529 ExcludedRegionCodes []string `json:"excludedRegionCodes,omitempty"` 1530 // Format: Ad format targeted by this mediation group. Examples: "banner", 1531 // "native". 1532 Format string `json:"format,omitempty"` 1533 // IdfaTargeting: The parameter can be used to target ad requests based on the 1534 // availability of the IDFA. If set to ALL, the mediation group applies to all 1535 // ad requests (with or without IDFA). If set to AVAILABLE, the mediation group 1536 // applies to ad requests with IDFA. If set to NOT_AVAILABLE, the mediation 1537 // group applies to ad requests without IDFA. Doesn't need to be specified for 1538 // an ANDROID device. 1539 // 1540 // Possible values: 1541 // "IDFA_TARGETING_UNSPECIFIED" - Default value. This value is unused. 1542 // "ALL" - All the devices are targeted, regardless of IDFA availability. 1543 // "AVAILABLE" - Only the devices with IDFA availability are targeted. 1544 // "NOT_AVAILABLE" - Only the devices without IDFA availability are targeted. 1545 IdfaTargeting string `json:"idfaTargeting,omitempty"` 1546 // Platform: Describes the platform of the app. Examples: "IOS", "Android". 1547 Platform string `json:"platform,omitempty"` 1548 // TargetedRegionCodes: The Unicode country/region code (CLDR) of a location, 1549 // such as "US". Unset if this mediation group targets all available regions. 1550 // For more information, see 1551 // http://www.unicode.org/reports/tr35/#unicode_region_subtag. 1552 TargetedRegionCodes []string `json:"targetedRegionCodes,omitempty"` 1553 // ForceSendFields is a list of field names (e.g. "AdUnitIds") to 1554 // unconditionally include in API requests. By default, fields with empty or 1555 // default values are omitted from API requests. See 1556 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1557 // details. 1558 ForceSendFields []string `json:"-"` 1559 // NullFields is a list of field names (e.g. "AdUnitIds") to include in API 1560 // requests with the JSON null value. By default, fields with empty values are 1561 // omitted from API requests. See 1562 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1563 NullFields []string `json:"-"` 1564 } 1565 1566 func (s *MediationGroupTargeting) MarshalJSON() ([]byte, error) { 1567 type NoMethod MediationGroupTargeting 1568 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1569 } 1570 1571 // MediationReportSpec: The specification for generating an AdMob Mediation 1572 // report. For example, the specification to get observed ECPM sliced by ad 1573 // source and app for the 'US' and 'CN' countries can look like the following 1574 // example: { "date_range": { "start_date": {"year": 2021, "month": 9, "day": 1575 // 1}, "end_date": {"year": 2021, "month": 9, "day": 30} }, "dimensions": 1576 // ["AD_SOURCE", "APP", "COUNTRY"], "metrics": ["OBSERVED_ECPM"], 1577 // "dimension_filters": [ { "dimension": "COUNTRY", "matches_any": {"values": 1578 // [{"value": "US", "value": "CN"}]} } ], "sort_conditions": [ 1579 // {"dimension":"APP", order: "ASCENDING"} ], "localization_settings": { 1580 // "currency_code": "USD", "language_code": "en-US" } } For a better 1581 // understanding, you can treat the preceding specification like the following 1582 // pseudo SQL: SELECT AD_SOURCE, APP, COUNTRY, OBSERVED_ECPM FROM 1583 // MEDIATION_REPORT WHERE DATE >= '2021-09-01' AND DATE <= '2021-09-30' AND 1584 // COUNTRY IN ('US', 'CN') GROUP BY AD_SOURCE, APP, COUNTRY ORDER BY APP ASC; 1585 type MediationReportSpec struct { 1586 // DateRange: The date range for which the report is generated. 1587 DateRange *DateRange `json:"dateRange,omitempty"` 1588 // DimensionFilters: Describes which report rows to match based on their 1589 // dimension values. 1590 DimensionFilters []*MediationReportSpecDimensionFilter `json:"dimensionFilters,omitempty"` 1591 // Dimensions: List of dimensions of the report. The value combination of these 1592 // dimensions determines the row of the report. If no dimensions are specified, 1593 // the report returns a single row of requested metrics for the entire account. 1594 // 1595 // Possible values: 1596 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 1597 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 1598 // can specify at most one time dimension. 1599 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 1600 // can specify at most one time dimension. 1601 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 1602 // example, "20210701"). Requests can specify at most one time dimension. 1603 // "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources) 1604 // (for example, "5450213213286189855" and "AdMob Network" as label value). 1605 // "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for 1606 // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value). 1607 // "AD_UNIT" - The unique ID of the ad unit (for example, 1608 // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is 1609 // included automatically. 1610 // "APP" - The unique ID of the mobile application (for example, 1611 // "ca-app-pub-1234~1234"). 1612 // "MEDIATION_GROUP" - The unique ID of the mediation group (for example, 1613 // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value). 1614 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 1615 // (for example, "US" or "FR"). This is a geography dimension. 1616 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 1617 // delivery dimension. 1618 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 1619 // "iOS"). 1620 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 1621 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 1622 // "APP_VERSION_NAME" - For Android, the app version name can be found in 1623 // versionName in PackageInfo. For iOS, the app version name can be found in 1624 // CFBundleShortVersionString. 1625 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 1626 // "Non-personalized ads"). 1627 Dimensions []string `json:"dimensions,omitempty"` 1628 // LocalizationSettings: Localization settings of the report. 1629 LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"` 1630 // MaxReportRows: Maximum number of report data rows to return. If the value is 1631 // not set, the API returns as many rows as possible, up to 100000. Acceptable 1632 // values are 1-100000, inclusive. Values larger than 100000 return an error. 1633 MaxReportRows int64 `json:"maxReportRows,omitempty"` 1634 // Metrics: List of metrics of the report. A report must specify at least one 1635 // metric. 1636 // 1637 // Possible values: 1638 // "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use. 1639 // "AD_REQUESTS" - The number of requests. The value is an integer. 1640 // "CLICKS" - The number of times a user clicks an ad. The value is an 1641 // integer. 1642 // "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The 1643 // currency unit (USD, EUR, or other) of the earning metrics are determined by 1644 // the localization setting for currency. The amount is in micros. For example, 1645 // $6.50 would be represented as 6500000. Estimated earnings per mediation 1646 // group and per ad source instance level is supported dating back to October 1647 // 20, 2019. Third-party estimated earnings will show 0 for dates prior to 1648 // October 20, 2019. 1649 // "IMPRESSIONS" - The total number of ads shown to users. The value is an 1650 // integer. 1651 // "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a 1652 // double precision (approximate) decimal value. 1653 // "MATCHED_REQUESTS" - The number of times ads are returned in response to a 1654 // request. The value is an integer. 1655 // "MATCH_RATE" - The ratio of matched ad requests over the total ad 1656 // requests. The value is a double precision (approximate) decimal value. 1657 // "OBSERVED_ECPM" - The third-party ad network's estimated average eCPM. The 1658 // currency unit (USD, EUR, or other) of the earning metrics are determined by 1659 // the localization setting for currency. The amount is in micros. For example, 1660 // $2.30 would be represented as 2300000. The estimated average eCPM per 1661 // mediation group and per ad source instance level is supported dating back to 1662 // October 20, 2019. Third-party estimated average eCPM will show 0 for dates 1663 // prior to October 20, 2019. 1664 Metrics []string `json:"metrics,omitempty"` 1665 // SortConditions: Describes the sorting of report rows. The order of the 1666 // condition in the list defines its precedence; the earlier the condition, the 1667 // higher its precedence. If no sort conditions are specified, the row ordering 1668 // is undefined. 1669 SortConditions []*MediationReportSpecSortCondition `json:"sortConditions,omitempty"` 1670 // TimeZone: A report time zone. Accepts an IANA TZ name values, such as 1671 // "America/Los_Angeles." If no time zone is defined, the account default takes 1672 // effect. Check default value by the get account action. **Warning:** The 1673 // "America/Los_Angeles" is the only supported value at the moment. 1674 TimeZone string `json:"timeZone,omitempty"` 1675 // ForceSendFields is a list of field names (e.g. "DateRange") to 1676 // unconditionally include in API requests. By default, fields with empty or 1677 // default values are omitted from API requests. See 1678 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1679 // details. 1680 ForceSendFields []string `json:"-"` 1681 // NullFields is a list of field names (e.g. "DateRange") to include in API 1682 // requests with the JSON null value. By default, fields with empty values are 1683 // omitted from API requests. See 1684 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1685 NullFields []string `json:"-"` 1686 } 1687 1688 func (s *MediationReportSpec) MarshalJSON() ([]byte, error) { 1689 type NoMethod MediationReportSpec 1690 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1691 } 1692 1693 // MediationReportSpecDimensionFilter: Describes which report rows to match 1694 // based on their dimension values. 1695 type MediationReportSpecDimensionFilter struct { 1696 // Dimension: Applies the filter criterion to the specified dimension. 1697 // 1698 // Possible values: 1699 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 1700 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 1701 // can specify at most one time dimension. 1702 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 1703 // can specify at most one time dimension. 1704 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 1705 // example, "20210701"). Requests can specify at most one time dimension. 1706 // "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources) 1707 // (for example, "5450213213286189855" and "AdMob Network" as label value). 1708 // "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for 1709 // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value). 1710 // "AD_UNIT" - The unique ID of the ad unit (for example, 1711 // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is 1712 // included automatically. 1713 // "APP" - The unique ID of the mobile application (for example, 1714 // "ca-app-pub-1234~1234"). 1715 // "MEDIATION_GROUP" - The unique ID of the mediation group (for example, 1716 // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value). 1717 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 1718 // (for example, "US" or "FR"). This is a geography dimension. 1719 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 1720 // delivery dimension. 1721 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 1722 // "iOS"). 1723 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 1724 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 1725 // "APP_VERSION_NAME" - For Android, the app version name can be found in 1726 // versionName in PackageInfo. For iOS, the app version name can be found in 1727 // CFBundleShortVersionString. 1728 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 1729 // "Non-personalized ads"). 1730 Dimension string `json:"dimension,omitempty"` 1731 // MatchesAny: Matches a row if its value for the specified dimension is in one 1732 // of the values specified in this condition. 1733 MatchesAny *StringList `json:"matchesAny,omitempty"` 1734 // ForceSendFields is a list of field names (e.g. "Dimension") to 1735 // unconditionally include in API requests. By default, fields with empty or 1736 // default values are omitted from API requests. See 1737 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1738 // details. 1739 ForceSendFields []string `json:"-"` 1740 // NullFields is a list of field names (e.g. "Dimension") to include in API 1741 // requests with the JSON null value. By default, fields with empty values are 1742 // omitted from API requests. See 1743 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1744 NullFields []string `json:"-"` 1745 } 1746 1747 func (s *MediationReportSpecDimensionFilter) MarshalJSON() ([]byte, error) { 1748 type NoMethod MediationReportSpecDimensionFilter 1749 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1750 } 1751 1752 // MediationReportSpecSortCondition: Sorting direction to be applied on a 1753 // dimension or a metric. 1754 type MediationReportSpecSortCondition struct { 1755 // Dimension: Sort by the specified dimension. 1756 // 1757 // Possible values: 1758 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 1759 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 1760 // can specify at most one time dimension. 1761 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 1762 // can specify at most one time dimension. 1763 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 1764 // example, "20210701"). Requests can specify at most one time dimension. 1765 // "AD_SOURCE" - The [unique ID of the ad source](/admob/api/v1/ad_sources) 1766 // (for example, "5450213213286189855" and "AdMob Network" as label value). 1767 // "AD_SOURCE_INSTANCE" - The unique ID of the ad source instance (for 1768 // example, "ca-app-pub-1234:asi:5678" and "AdMob (default)" as label value). 1769 // "AD_UNIT" - The unique ID of the ad unit (for example, 1770 // "ca-app-pub-1234/8790"). If AD_UNIT dimension is specified, then APP is 1771 // included automatically. 1772 // "APP" - The unique ID of the mobile application (for example, 1773 // "ca-app-pub-1234~1234"). 1774 // "MEDIATION_GROUP" - The unique ID of the mediation group (for example, 1775 // "ca-app-pub-1234:mg:1234" and "AdMob (default)" as label value). 1776 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 1777 // (for example, "US" or "FR"). This is a geography dimension. 1778 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 1779 // delivery dimension. 1780 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 1781 // "iOS"). 1782 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 1783 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 1784 // "APP_VERSION_NAME" - For Android, the app version name can be found in 1785 // versionName in PackageInfo. For iOS, the app version name can be found in 1786 // CFBundleShortVersionString. 1787 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 1788 // "Non-personalized ads"). 1789 Dimension string `json:"dimension,omitempty"` 1790 // Metric: Sort by the specified metric. 1791 // 1792 // Possible values: 1793 // "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use. 1794 // "AD_REQUESTS" - The number of requests. The value is an integer. 1795 // "CLICKS" - The number of times a user clicks an ad. The value is an 1796 // integer. 1797 // "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The 1798 // currency unit (USD, EUR, or other) of the earning metrics are determined by 1799 // the localization setting for currency. The amount is in micros. For example, 1800 // $6.50 would be represented as 6500000. Estimated earnings per mediation 1801 // group and per ad source instance level is supported dating back to October 1802 // 20, 2019. Third-party estimated earnings will show 0 for dates prior to 1803 // October 20, 2019. 1804 // "IMPRESSIONS" - The total number of ads shown to users. The value is an 1805 // integer. 1806 // "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a 1807 // double precision (approximate) decimal value. 1808 // "MATCHED_REQUESTS" - The number of times ads are returned in response to a 1809 // request. The value is an integer. 1810 // "MATCH_RATE" - The ratio of matched ad requests over the total ad 1811 // requests. The value is a double precision (approximate) decimal value. 1812 // "OBSERVED_ECPM" - The third-party ad network's estimated average eCPM. The 1813 // currency unit (USD, EUR, or other) of the earning metrics are determined by 1814 // the localization setting for currency. The amount is in micros. For example, 1815 // $2.30 would be represented as 2300000. The estimated average eCPM per 1816 // mediation group and per ad source instance level is supported dating back to 1817 // October 20, 2019. Third-party estimated average eCPM will show 0 for dates 1818 // prior to October 20, 2019. 1819 Metric string `json:"metric,omitempty"` 1820 // Order: Sorting order of the dimension or metric. 1821 // 1822 // Possible values: 1823 // "SORT_ORDER_UNSPECIFIED" - Default value for an unset field. Do not use. 1824 // "ASCENDING" - Sort dimension value or metric value in ascending order. 1825 // "DESCENDING" - Sort dimension value or metric value in descending order. 1826 Order string `json:"order,omitempty"` 1827 // ForceSendFields is a list of field names (e.g. "Dimension") to 1828 // unconditionally include in API requests. By default, fields with empty or 1829 // default values are omitted from API requests. See 1830 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1831 // details. 1832 ForceSendFields []string `json:"-"` 1833 // NullFields is a list of field names (e.g. "Dimension") to include in API 1834 // requests with the JSON null value. By default, fields with empty values are 1835 // omitted from API requests. See 1836 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1837 NullFields []string `json:"-"` 1838 } 1839 1840 func (s *MediationReportSpecSortCondition) MarshalJSON() ([]byte, error) { 1841 type NoMethod MediationReportSpecSortCondition 1842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1843 } 1844 1845 // NetworkReportSpec: The specification for generating an AdMob Network report. 1846 // For example, the specification to get clicks and estimated earnings for only 1847 // the 'US' and 'CN' countries can look like the following example: { 1848 // 'date_range': { 'start_date': {'year': 2021, 'month': 9, 'day': 1}, 1849 // 'end_date': {'year': 2021, 'month': 9, 'day': 30} }, 'dimensions': ['DATE', 1850 // 'APP', 'COUNTRY'], 'metrics': ['CLICKS', 'ESTIMATED_EARNINGS'], 1851 // 'dimension_filters': [ { 'dimension': 'COUNTRY', 'matches_any': {'values': 1852 // [{'value': 'US', 'value': 'CN'}]} } ], 'sort_conditions': [ 1853 // {'dimension':'APP', order: 'ASCENDING'}, {'metric':'CLICKS', order: 1854 // 'DESCENDING'} ], 'localization_settings': { 'currency_code': 'USD', 1855 // 'language_code': 'en-US' } } For a better understanding, you can treat the 1856 // preceding specification like the following pseudo SQL: SELECT DATE, APP, 1857 // COUNTRY, CLICKS, ESTIMATED_EARNINGS FROM NETWORK_REPORT WHERE DATE >= 1858 // '2021-09-01' AND DATE <= '2021-09-30' AND COUNTRY IN ('US', 'CN') GROUP BY 1859 // DATE, APP, COUNTRY ORDER BY APP ASC, CLICKS DESC; 1860 type NetworkReportSpec struct { 1861 // DateRange: The date range for which the report is generated. 1862 DateRange *DateRange `json:"dateRange,omitempty"` 1863 // DimensionFilters: Describes which report rows to match based on their 1864 // dimension values. 1865 DimensionFilters []*NetworkReportSpecDimensionFilter `json:"dimensionFilters,omitempty"` 1866 // Dimensions: List of dimensions of the report. The value combination of these 1867 // dimensions determines the row of the report. If no dimensions are specified, 1868 // the report returns a single row of requested metrics for the entire account. 1869 // 1870 // Possible values: 1871 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 1872 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 1873 // can specify at most one time dimension. 1874 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 1875 // can specify at most one time dimension. 1876 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 1877 // example, "20210701"). Requests can specify at most one time dimension. 1878 // "AD_UNIT" - The unique ID of the ad unit (for example, 1879 // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is 1880 // included automatically. 1881 // "APP" - The unique ID of the mobile application (for example, 1882 // "ca-app-pub-1234~1234"). 1883 // "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad 1884 // delivery dimension. **Warning:** The dimension is incompatible with 1885 // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS), 1886 // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and 1887 // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics. 1888 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 1889 // (for example, "US" or "FR"). This is a geography dimension. 1890 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 1891 // delivery dimension. 1892 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 1893 // "iOS"). 1894 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 1895 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 1896 // "APP_VERSION_NAME" - For Android, the app version name can be found in 1897 // versionName in PackageInfo. For iOS, the app version name can be found in 1898 // CFBundleShortVersionString. 1899 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 1900 // "Non-personalized ads"). 1901 Dimensions []string `json:"dimensions,omitempty"` 1902 // LocalizationSettings: Localization settings of the report. 1903 LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"` 1904 // MaxReportRows: Maximum number of report data rows to return. If the value is 1905 // not set, the API returns as many rows as possible, up to 100000. Acceptable 1906 // values are 1-100000, inclusive. Values larger than 100000 return an error. 1907 MaxReportRows int64 `json:"maxReportRows,omitempty"` 1908 // Metrics: List of metrics of the report. A report must specify at least one 1909 // metric. 1910 // 1911 // Possible values: 1912 // "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use. 1913 // "AD_REQUESTS" - The number of ad requests. The value is an integer. 1914 // **Warning:** The metric is incompatible with 1915 // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 1916 // "CLICKS" - The number of times a user clicks an ad. The value is an 1917 // integer. 1918 // "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The 1919 // currency unit (USD, EUR, or other) of the earning metrics are determined by 1920 // the localization setting for currency. The amount is in micros. For example, 1921 // $6.50 would be represented as 6500000. 1922 // "IMPRESSIONS" - The total number of ads shown to users. The value is an 1923 // integer. 1924 // "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a 1925 // double precision (approximate) decimal value. 1926 // "IMPRESSION_RPM" - The estimated earnings per thousand ad impressions. The 1927 // value is in micros. For example, $1.03 would be represented as 1030000. 1928 // Equivalent to eCPM in the AdMob UI. **Warning:** The metric is incompatible 1929 // with [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 1930 // "MATCHED_REQUESTS" - The number of times ads are returned in response to a 1931 // request. The value is an integer. 1932 // "MATCH_RATE" - The ratio of matched ad requests over the total ad 1933 // requests. The value is a double precision (approximate) decimal value. 1934 // **Warning:** The metric is incompatible with 1935 // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 1936 // "SHOW_RATE" - The ratio of ads that are displayed over ads that are 1937 // returned, defined as impressions / matched requests. The value is a double 1938 // precision (approximate) decimal value. 1939 Metrics []string `json:"metrics,omitempty"` 1940 // SortConditions: Describes the sorting of report rows. The order of the 1941 // condition in the list defines its precedence; the earlier the condition, the 1942 // higher its precedence. If no sort conditions are specified, the row ordering 1943 // is undefined. 1944 SortConditions []*NetworkReportSpecSortCondition `json:"sortConditions,omitempty"` 1945 // TimeZone: A report time zone. Accepts an IANA TZ name values, such as 1946 // "America/Los_Angeles." If no time zone is defined, the account default takes 1947 // effect. Check default value by the get account action. **Warning:** The 1948 // "America/Los_Angeles" is the only supported value at the moment. 1949 TimeZone string `json:"timeZone,omitempty"` 1950 // ForceSendFields is a list of field names (e.g. "DateRange") to 1951 // unconditionally include in API requests. By default, fields with empty or 1952 // default values are omitted from API requests. See 1953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1954 // details. 1955 ForceSendFields []string `json:"-"` 1956 // NullFields is a list of field names (e.g. "DateRange") to include in API 1957 // requests with the JSON null value. By default, fields with empty values are 1958 // omitted from API requests. See 1959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1960 NullFields []string `json:"-"` 1961 } 1962 1963 func (s *NetworkReportSpec) MarshalJSON() ([]byte, error) { 1964 type NoMethod NetworkReportSpec 1965 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1966 } 1967 1968 // NetworkReportSpecDimensionFilter: Describes which report rows to match based 1969 // on their dimension values. 1970 type NetworkReportSpecDimensionFilter struct { 1971 // Dimension: Applies the filter criterion to the specified dimension. 1972 // 1973 // Possible values: 1974 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 1975 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 1976 // can specify at most one time dimension. 1977 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 1978 // can specify at most one time dimension. 1979 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 1980 // example, "20210701"). Requests can specify at most one time dimension. 1981 // "AD_UNIT" - The unique ID of the ad unit (for example, 1982 // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is 1983 // included automatically. 1984 // "APP" - The unique ID of the mobile application (for example, 1985 // "ca-app-pub-1234~1234"). 1986 // "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad 1987 // delivery dimension. **Warning:** The dimension is incompatible with 1988 // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS), 1989 // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and 1990 // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics. 1991 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 1992 // (for example, "US" or "FR"). This is a geography dimension. 1993 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 1994 // delivery dimension. 1995 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 1996 // "iOS"). 1997 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 1998 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 1999 // "APP_VERSION_NAME" - For Android, the app version name can be found in 2000 // versionName in PackageInfo. For iOS, the app version name can be found in 2001 // CFBundleShortVersionString. 2002 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 2003 // "Non-personalized ads"). 2004 Dimension string `json:"dimension,omitempty"` 2005 // MatchesAny: Matches a row if its value for the specified dimension is in one 2006 // of the values specified in this condition. 2007 MatchesAny *StringList `json:"matchesAny,omitempty"` 2008 // ForceSendFields is a list of field names (e.g. "Dimension") to 2009 // unconditionally include in API requests. By default, fields with empty or 2010 // default values are omitted from API requests. See 2011 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2012 // details. 2013 ForceSendFields []string `json:"-"` 2014 // NullFields is a list of field names (e.g. "Dimension") to include in API 2015 // requests with the JSON null value. By default, fields with empty values are 2016 // omitted from API requests. See 2017 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2018 NullFields []string `json:"-"` 2019 } 2020 2021 func (s *NetworkReportSpecDimensionFilter) MarshalJSON() ([]byte, error) { 2022 type NoMethod NetworkReportSpecDimensionFilter 2023 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2024 } 2025 2026 // NetworkReportSpecSortCondition: Sorting direction to be applied on a 2027 // dimension or a metric. 2028 type NetworkReportSpecSortCondition struct { 2029 // Dimension: Sort by the specified dimension. 2030 // 2031 // Possible values: 2032 // "DIMENSION_UNSPECIFIED" - Default value for an unset field. Do not use. 2033 // "DATE" - A date in the YYYYMMDD format (for example, "20210701"). Requests 2034 // can specify at most one time dimension. 2035 // "MONTH" - A month in the YYYYMM format (for example, "202107"). Requests 2036 // can specify at most one time dimension. 2037 // "WEEK" - The date of the first day of a week in the YYYYMMDD format (for 2038 // example, "20210701"). Requests can specify at most one time dimension. 2039 // "AD_UNIT" - The unique ID of the ad unit (for example, 2040 // "ca-app-pub-1234/1234"). If AD_UNIT dimension is specified, then APP is 2041 // included automatically. 2042 // "APP" - The unique ID of the mobile application (for example, 2043 // "ca-app-pub-1234~1234"). 2044 // "AD_TYPE" - Type of the ad (for example, "text" or "image"), an ad 2045 // delivery dimension. **Warning:** The dimension is incompatible with 2046 // [AD_REQUESTS](#Metric.ENUM_VALUES.AD_REQUESTS), 2047 // [MATCH_RATE](#Metric.ENUM_VALUES.MATCH_RATE) and 2048 // [IMPRESSION_RPM](#Metric.ENUM_VALUES.IMPRESSION_RPM) metrics. 2049 // "COUNTRY" - CLDR country code of the place where the ad views/clicks occur 2050 // (for example, "US" or "FR"). This is a geography dimension. 2051 // "FORMAT" - Format of the ad unit (for example, "banner", "native"), an ad 2052 // delivery dimension. 2053 // "PLATFORM" - Mobile OS platform of the app (for example, "Android" or 2054 // "iOS"). 2055 // "MOBILE_OS_VERSION" - Mobile operating system version, e.g. "iOS 13.5.1". 2056 // "GMA_SDK_VERSION" - GMA SDK version, e.g. "iOS 7.62.0". 2057 // "APP_VERSION_NAME" - For Android, the app version name can be found in 2058 // versionName in PackageInfo. For iOS, the app version name can be found in 2059 // CFBundleShortVersionString. 2060 // "SERVING_RESTRICTION" - Restriction mode for ads serving (e.g. 2061 // "Non-personalized ads"). 2062 Dimension string `json:"dimension,omitempty"` 2063 // Metric: Sort by the specified metric. 2064 // 2065 // Possible values: 2066 // "METRIC_UNSPECIFIED" - Default value for an unset field. Do not use. 2067 // "AD_REQUESTS" - The number of ad requests. The value is an integer. 2068 // **Warning:** The metric is incompatible with 2069 // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 2070 // "CLICKS" - The number of times a user clicks an ad. The value is an 2071 // integer. 2072 // "ESTIMATED_EARNINGS" - The estimated earnings of the AdMob publisher. The 2073 // currency unit (USD, EUR, or other) of the earning metrics are determined by 2074 // the localization setting for currency. The amount is in micros. For example, 2075 // $6.50 would be represented as 6500000. 2076 // "IMPRESSIONS" - The total number of ads shown to users. The value is an 2077 // integer. 2078 // "IMPRESSION_CTR" - The ratio of clicks over impressions. The value is a 2079 // double precision (approximate) decimal value. 2080 // "IMPRESSION_RPM" - The estimated earnings per thousand ad impressions. The 2081 // value is in micros. For example, $1.03 would be represented as 1030000. 2082 // Equivalent to eCPM in the AdMob UI. **Warning:** The metric is incompatible 2083 // with [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 2084 // "MATCHED_REQUESTS" - The number of times ads are returned in response to a 2085 // request. The value is an integer. 2086 // "MATCH_RATE" - The ratio of matched ad requests over the total ad 2087 // requests. The value is a double precision (approximate) decimal value. 2088 // **Warning:** The metric is incompatible with 2089 // [AD_TYPE](#Dimension.ENUM_VALUES.AD_TYPE) dimension. 2090 // "SHOW_RATE" - The ratio of ads that are displayed over ads that are 2091 // returned, defined as impressions / matched requests. The value is a double 2092 // precision (approximate) decimal value. 2093 Metric string `json:"metric,omitempty"` 2094 // Order: Sorting order of the dimension or metric. 2095 // 2096 // Possible values: 2097 // "SORT_ORDER_UNSPECIFIED" - Default value for an unset field. Do not use. 2098 // "ASCENDING" - Sort dimension value or metric value in ascending order. 2099 // "DESCENDING" - Sort dimension value or metric value in descending order. 2100 Order string `json:"order,omitempty"` 2101 // ForceSendFields is a list of field names (e.g. "Dimension") to 2102 // unconditionally include in API requests. By default, fields with empty or 2103 // default values are omitted from API requests. See 2104 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2105 // details. 2106 ForceSendFields []string `json:"-"` 2107 // NullFields is a list of field names (e.g. "Dimension") to include in API 2108 // requests with the JSON null value. By default, fields with empty values are 2109 // omitted from API requests. See 2110 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2111 NullFields []string `json:"-"` 2112 } 2113 2114 func (s *NetworkReportSpecSortCondition) MarshalJSON() ([]byte, error) { 2115 type NoMethod NetworkReportSpecSortCondition 2116 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2117 } 2118 2119 // PublisherAccount: A publisher account contains information relevant to the 2120 // use of this API, such as the time zone used for the reports. 2121 type PublisherAccount struct { 2122 // CurrencyCode: Currency code of the earning-related metrics, which is the 2123 // 3-letter code defined in ISO 4217. The daily average rate is used for the 2124 // currency conversion. 2125 CurrencyCode string `json:"currencyCode,omitempty"` 2126 // Name: Resource name of this account. Format is accounts/{publisher_id}. 2127 Name string `json:"name,omitempty"` 2128 // PublisherId: The unique ID by which this publisher account can be identified 2129 // in the API requests (for example, pub-1234567890). 2130 PublisherId string `json:"publisherId,omitempty"` 2131 // ReportingTimeZone: The time zone that is used in reports that are generated 2132 // for this account. The value is a time-zone ID as specified by the CLDR 2133 // project, for example, "America/Los_Angeles". 2134 ReportingTimeZone string `json:"reportingTimeZone,omitempty"` 2135 2136 // ServerResponse contains the HTTP response code and headers from the server. 2137 googleapi.ServerResponse `json:"-"` 2138 // ForceSendFields is a list of field names (e.g. "CurrencyCode") to 2139 // unconditionally include in API requests. By default, fields with empty or 2140 // default values are omitted from API requests. See 2141 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2142 // details. 2143 ForceSendFields []string `json:"-"` 2144 // NullFields is a list of field names (e.g. "CurrencyCode") to include in API 2145 // requests with the JSON null value. By default, fields with empty values are 2146 // omitted from API requests. See 2147 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2148 NullFields []string `json:"-"` 2149 } 2150 2151 func (s *PublisherAccount) MarshalJSON() ([]byte, error) { 2152 type NoMethod PublisherAccount 2153 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2154 } 2155 2156 // ReportFooter: Groups data available after report generation, for example, 2157 // warnings and row counts. Always sent as the last message in the stream 2158 // response. 2159 type ReportFooter struct { 2160 // MatchingRowCount: Total number of rows that matched the request. Warning: 2161 // This count does NOT always match the number of rows in the response. Do not 2162 // make that assumption when processing the response. 2163 MatchingRowCount int64 `json:"matchingRowCount,omitempty,string"` 2164 // Warnings: Warnings associated with generation of the report. 2165 Warnings []*ReportWarning `json:"warnings,omitempty"` 2166 // ForceSendFields is a list of field names (e.g. "MatchingRowCount") to 2167 // unconditionally include in API requests. By default, fields with empty or 2168 // default values are omitted from API requests. See 2169 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2170 // details. 2171 ForceSendFields []string `json:"-"` 2172 // NullFields is a list of field names (e.g. "MatchingRowCount") to include in 2173 // API requests with the JSON null value. By default, fields with empty values 2174 // are omitted from API requests. See 2175 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2176 NullFields []string `json:"-"` 2177 } 2178 2179 func (s *ReportFooter) MarshalJSON() ([]byte, error) { 2180 type NoMethod ReportFooter 2181 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2182 } 2183 2184 // ReportHeader: Groups data helps to treat the generated report. Always sent 2185 // as a first message in the stream response. 2186 type ReportHeader struct { 2187 // DateRange: The date range for which the report is generated. This is 2188 // identical to the range specified in the report request. 2189 DateRange *DateRange `json:"dateRange,omitempty"` 2190 // LocalizationSettings: Localization settings of the report. This is identical 2191 // to the settings in the report request. 2192 LocalizationSettings *LocalizationSettings `json:"localizationSettings,omitempty"` 2193 // ReportingTimeZone: The report time zone. The value is a time-zone ID as 2194 // specified by the CLDR project, for example, "America/Los_Angeles". 2195 ReportingTimeZone string `json:"reportingTimeZone,omitempty"` 2196 // ForceSendFields is a list of field names (e.g. "DateRange") to 2197 // unconditionally include in API requests. By default, fields with empty or 2198 // default values are omitted from API requests. See 2199 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2200 // details. 2201 ForceSendFields []string `json:"-"` 2202 // NullFields is a list of field names (e.g. "DateRange") to include in API 2203 // requests with the JSON null value. By default, fields with empty values are 2204 // omitted from API requests. See 2205 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2206 NullFields []string `json:"-"` 2207 } 2208 2209 func (s *ReportHeader) MarshalJSON() ([]byte, error) { 2210 type NoMethod ReportHeader 2211 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2212 } 2213 2214 // ReportRow: A row of the returning report. 2215 type ReportRow struct { 2216 // DimensionValues: Map of dimension values in a row, with keys as enum name of 2217 // the dimensions. 2218 DimensionValues map[string]ReportRowDimensionValue `json:"dimensionValues,omitempty"` 2219 // MetricValues: Map of metric values in a row, with keys as enum name of the 2220 // metrics. If a metric being requested has no value returned, the map will not 2221 // include it. 2222 MetricValues map[string]ReportRowMetricValue `json:"metricValues,omitempty"` 2223 // ForceSendFields is a list of field names (e.g. "DimensionValues") to 2224 // unconditionally include in API requests. By default, fields with empty or 2225 // default values are omitted from API requests. See 2226 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2227 // details. 2228 ForceSendFields []string `json:"-"` 2229 // NullFields is a list of field names (e.g. "DimensionValues") to include in 2230 // API requests with the JSON null value. By default, fields with empty values 2231 // are omitted from API requests. See 2232 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2233 NullFields []string `json:"-"` 2234 } 2235 2236 func (s *ReportRow) MarshalJSON() ([]byte, error) { 2237 type NoMethod ReportRow 2238 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2239 } 2240 2241 // ReportRowDimensionValue: Representation of a dimension value. 2242 type ReportRowDimensionValue struct { 2243 // DisplayLabel: The localized string representation of the value. If 2244 // unspecified, the display label should be derived from the value. 2245 DisplayLabel string `json:"displayLabel,omitempty"` 2246 // Value: Dimension value in the format specified in the report's spec 2247 // Dimension enum. 2248 Value string `json:"value,omitempty"` 2249 // ForceSendFields is a list of field names (e.g. "DisplayLabel") to 2250 // unconditionally include in API requests. By default, fields with empty or 2251 // default values are omitted from API requests. See 2252 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2253 // details. 2254 ForceSendFields []string `json:"-"` 2255 // NullFields is a list of field names (e.g. "DisplayLabel") to include in API 2256 // requests with the JSON null value. By default, fields with empty values are 2257 // omitted from API requests. See 2258 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2259 NullFields []string `json:"-"` 2260 } 2261 2262 func (s *ReportRowDimensionValue) MarshalJSON() ([]byte, error) { 2263 type NoMethod ReportRowDimensionValue 2264 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2265 } 2266 2267 // ReportRowMetricValue: Representation of a metric value. 2268 type ReportRowMetricValue struct { 2269 // DoubleValue: Double precision (approximate) decimal values. Rates are from 0 2270 // to 1. 2271 DoubleValue float64 `json:"doubleValue,omitempty"` 2272 // IntegerValue: Metric integer value. 2273 IntegerValue int64 `json:"integerValue,omitempty,string"` 2274 // MicrosValue: Amount in micros. One million is equivalent to one unit. 2275 // Currency value is in the unit (USD, EUR or other) specified by the request. 2276 // For example, $6.50 whould be represented as 6500000 micros. 2277 MicrosValue int64 `json:"microsValue,omitempty,string"` 2278 // ForceSendFields is a list of field names (e.g. "DoubleValue") to 2279 // unconditionally include in API requests. By default, fields with empty or 2280 // default values are omitted from API requests. See 2281 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2282 // details. 2283 ForceSendFields []string `json:"-"` 2284 // NullFields is a list of field names (e.g. "DoubleValue") to include in API 2285 // requests with the JSON null value. By default, fields with empty values are 2286 // omitted from API requests. See 2287 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2288 NullFields []string `json:"-"` 2289 } 2290 2291 func (s *ReportRowMetricValue) MarshalJSON() ([]byte, error) { 2292 type NoMethod ReportRowMetricValue 2293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2294 } 2295 2296 func (s *ReportRowMetricValue) UnmarshalJSON(data []byte) error { 2297 type NoMethod ReportRowMetricValue 2298 var s1 struct { 2299 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` 2300 *NoMethod 2301 } 2302 s1.NoMethod = (*NoMethod)(s) 2303 if err := json.Unmarshal(data, &s1); err != nil { 2304 return err 2305 } 2306 s.DoubleValue = float64(s1.DoubleValue) 2307 return nil 2308 } 2309 2310 // ReportWarning: Warnings associated with generation of the report. 2311 type ReportWarning struct { 2312 // Description: Describes the details of the warning message, in English. 2313 Description string `json:"description,omitempty"` 2314 // Type: Type of the warning. 2315 // 2316 // Possible values: 2317 // "TYPE_UNSPECIFIED" - Default value for an unset field. Do not use. 2318 // "DATA_BEFORE_ACCOUNT_TIMEZONE_CHANGE" - Some data in this report is 2319 // aggregated based on a time zone different from the requested time zone. This 2320 // could happen if a local time-zone report has the start time before the last 2321 // time this time zone changed. The description field will contain the date of 2322 // the last time zone change. 2323 // "DATA_DELAYED" - There is an unusual delay in processing the source data 2324 // for the requested date range. The report results might be less up to date 2325 // than usual. AdMob is aware of the issue and is actively working to resolve 2326 // it. 2327 // "OTHER" - Warnings that are exposed without a specific type. Useful when 2328 // new warning types are added but the API is not changed yet. 2329 // "REPORT_CURRENCY_NOT_ACCOUNT_CURRENCY" - The currency being requested is 2330 // not the account currency. The earning metrics will be based on the requested 2331 // currency, and thus not a good estimation of the final payment anymore, due 2332 // to the currency rate fluctuation. 2333 Type string `json:"type,omitempty"` 2334 // ForceSendFields is a list of field names (e.g. "Description") to 2335 // unconditionally include in API requests. By default, fields with empty or 2336 // default values are omitted from API requests. See 2337 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2338 // details. 2339 ForceSendFields []string `json:"-"` 2340 // NullFields is a list of field names (e.g. "Description") to include in API 2341 // requests with the JSON null value. By default, fields with empty values are 2342 // omitted from API requests. See 2343 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2344 NullFields []string `json:"-"` 2345 } 2346 2347 func (s *ReportWarning) MarshalJSON() ([]byte, error) { 2348 type NoMethod ReportWarning 2349 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2350 } 2351 2352 // StopMediationAbExperimentRequest: Request to end the mediation A/B 2353 // experiment and choose a winning variant. 2354 type StopMediationAbExperimentRequest struct { 2355 // VariantChoice: The choice for the winning variant. 2356 // 2357 // Possible values: 2358 // "VARIANT_CHOICE_UNSPECIFIED" - Default value for an unset field. Do not 2359 // use. 2360 // "VARIANT_CHOICE_A" - Use the mediation lines from Variant A and complete 2361 // the experiment. Variant A contains the original serving lines before the 2362 // experiment creation. 2363 // "VARIANT_CHOICE_B" - Use the mediation lines form Variant B and complete 2364 // the experiment. Variant B contains the newly added serving lines. 2365 VariantChoice string `json:"variantChoice,omitempty"` 2366 // ForceSendFields is a list of field names (e.g. "VariantChoice") to 2367 // unconditionally include in API requests. By default, fields with empty or 2368 // default values are omitted from API requests. See 2369 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2370 // details. 2371 ForceSendFields []string `json:"-"` 2372 // NullFields is a list of field names (e.g. "VariantChoice") to include in API 2373 // requests with the JSON null value. By default, fields with empty values are 2374 // omitted from API requests. See 2375 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2376 NullFields []string `json:"-"` 2377 } 2378 2379 func (s *StopMediationAbExperimentRequest) MarshalJSON() ([]byte, error) { 2380 type NoMethod StopMediationAbExperimentRequest 2381 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2382 } 2383 2384 // StringList: List of string values. 2385 type StringList struct { 2386 // Values: The string values. 2387 Values []string `json:"values,omitempty"` 2388 // ForceSendFields is a list of field names (e.g. "Values") to unconditionally 2389 // include in API requests. By default, fields with empty or default values are 2390 // omitted from API requests. See 2391 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2392 // details. 2393 ForceSendFields []string `json:"-"` 2394 // NullFields is a list of field names (e.g. "Values") to include in API 2395 // requests with the JSON null value. By default, fields with empty values are 2396 // omitted from API requests. See 2397 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2398 NullFields []string `json:"-"` 2399 } 2400 2401 func (s *StringList) MarshalJSON() ([]byte, error) { 2402 type NoMethod StringList 2403 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2404 } 2405 2406 type AccountsGetCall struct { 2407 s *Service 2408 name string 2409 urlParams_ gensupport.URLParams 2410 ifNoneMatch_ string 2411 ctx_ context.Context 2412 header_ http.Header 2413 } 2414 2415 // Get: Gets information about the specified AdMob publisher account. 2416 // 2417 // - name: Resource name of the publisher account to retrieve. Example: 2418 // accounts/pub-9876543210987654. 2419 func (r *AccountsService) Get(name string) *AccountsGetCall { 2420 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2421 c.name = name 2422 return c 2423 } 2424 2425 // Fields allows partial responses to be retrieved. See 2426 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2427 // details. 2428 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall { 2429 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2430 return c 2431 } 2432 2433 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2434 // object's ETag matches the given value. This is useful for getting updates 2435 // only after the object has changed since the last request. 2436 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall { 2437 c.ifNoneMatch_ = entityTag 2438 return c 2439 } 2440 2441 // Context sets the context to be used in this call's Do method. 2442 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall { 2443 c.ctx_ = ctx 2444 return c 2445 } 2446 2447 // Header returns a http.Header that can be modified by the caller to add 2448 // headers to the request. 2449 func (c *AccountsGetCall) Header() http.Header { 2450 if c.header_ == nil { 2451 c.header_ = make(http.Header) 2452 } 2453 return c.header_ 2454 } 2455 2456 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) { 2457 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2458 if c.ifNoneMatch_ != "" { 2459 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2460 } 2461 var body io.Reader = nil 2462 c.urlParams_.Set("alt", alt) 2463 c.urlParams_.Set("prettyPrint", "false") 2464 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") 2465 urls += "?" + c.urlParams_.Encode() 2466 req, err := http.NewRequest("GET", urls, body) 2467 if err != nil { 2468 return nil, err 2469 } 2470 req.Header = reqHeaders 2471 googleapi.Expand(req.URL, map[string]string{ 2472 "name": c.name, 2473 }) 2474 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2475 } 2476 2477 // Do executes the "admob.accounts.get" call. 2478 // Any non-2xx status code is an error. Response headers are in either 2479 // *PublisherAccount.ServerResponse.Header or (if a response was returned at 2480 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2481 // check whether the returned error was because http.StatusNotModified was 2482 // returned. 2483 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*PublisherAccount, error) { 2484 gensupport.SetOptions(c.urlParams_, opts...) 2485 res, err := c.doRequest("json") 2486 if res != nil && res.StatusCode == http.StatusNotModified { 2487 if res.Body != nil { 2488 res.Body.Close() 2489 } 2490 return nil, gensupport.WrapError(&googleapi.Error{ 2491 Code: res.StatusCode, 2492 Header: res.Header, 2493 }) 2494 } 2495 if err != nil { 2496 return nil, err 2497 } 2498 defer googleapi.CloseBody(res) 2499 if err := googleapi.CheckResponse(res); err != nil { 2500 return nil, gensupport.WrapError(err) 2501 } 2502 ret := &PublisherAccount{ 2503 ServerResponse: googleapi.ServerResponse{ 2504 Header: res.Header, 2505 HTTPStatusCode: res.StatusCode, 2506 }, 2507 } 2508 target := &ret 2509 if err := gensupport.DecodeResponse(target, res); err != nil { 2510 return nil, err 2511 } 2512 return ret, nil 2513 } 2514 2515 type AccountsListCall struct { 2516 s *Service 2517 urlParams_ gensupport.URLParams 2518 ifNoneMatch_ string 2519 ctx_ context.Context 2520 header_ http.Header 2521 } 2522 2523 // List: Lists the AdMob publisher account that was most recently signed in to 2524 // from the AdMob UI. For more information, see 2525 // https://support.google.com/admob/answer/10243672. 2526 func (r *AccountsService) List() *AccountsListCall { 2527 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2528 return c 2529 } 2530 2531 // PageSize sets the optional parameter "pageSize": Maximum number of accounts 2532 // to return. 2533 func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall { 2534 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2535 return c 2536 } 2537 2538 // PageToken sets the optional parameter "pageToken": The value returned by the 2539 // last `ListPublisherAccountsResponse`; indicates that this is a continuation 2540 // of a prior `ListPublisherAccounts` call, and that the system should return 2541 // the next page of data. 2542 func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall { 2543 c.urlParams_.Set("pageToken", pageToken) 2544 return c 2545 } 2546 2547 // Fields allows partial responses to be retrieved. See 2548 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2549 // details. 2550 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall { 2551 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2552 return c 2553 } 2554 2555 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2556 // object's ETag matches the given value. This is useful for getting updates 2557 // only after the object has changed since the last request. 2558 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall { 2559 c.ifNoneMatch_ = entityTag 2560 return c 2561 } 2562 2563 // Context sets the context to be used in this call's Do method. 2564 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall { 2565 c.ctx_ = ctx 2566 return c 2567 } 2568 2569 // Header returns a http.Header that can be modified by the caller to add 2570 // headers to the request. 2571 func (c *AccountsListCall) Header() http.Header { 2572 if c.header_ == nil { 2573 c.header_ = make(http.Header) 2574 } 2575 return c.header_ 2576 } 2577 2578 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) { 2579 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2580 if c.ifNoneMatch_ != "" { 2581 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2582 } 2583 var body io.Reader = nil 2584 c.urlParams_.Set("alt", alt) 2585 c.urlParams_.Set("prettyPrint", "false") 2586 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/accounts") 2587 urls += "?" + c.urlParams_.Encode() 2588 req, err := http.NewRequest("GET", urls, body) 2589 if err != nil { 2590 return nil, err 2591 } 2592 req.Header = reqHeaders 2593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2594 } 2595 2596 // Do executes the "admob.accounts.list" call. 2597 // Any non-2xx status code is an error. Response headers are in either 2598 // *ListPublisherAccountsResponse.ServerResponse.Header or (if a response was 2599 // returned at all) in error.(*googleapi.Error).Header. Use 2600 // googleapi.IsNotModified to check whether the returned error was because 2601 // http.StatusNotModified was returned. 2602 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListPublisherAccountsResponse, error) { 2603 gensupport.SetOptions(c.urlParams_, opts...) 2604 res, err := c.doRequest("json") 2605 if res != nil && res.StatusCode == http.StatusNotModified { 2606 if res.Body != nil { 2607 res.Body.Close() 2608 } 2609 return nil, gensupport.WrapError(&googleapi.Error{ 2610 Code: res.StatusCode, 2611 Header: res.Header, 2612 }) 2613 } 2614 if err != nil { 2615 return nil, err 2616 } 2617 defer googleapi.CloseBody(res) 2618 if err := googleapi.CheckResponse(res); err != nil { 2619 return nil, gensupport.WrapError(err) 2620 } 2621 ret := &ListPublisherAccountsResponse{ 2622 ServerResponse: googleapi.ServerResponse{ 2623 Header: res.Header, 2624 HTTPStatusCode: res.StatusCode, 2625 }, 2626 } 2627 target := &ret 2628 if err := gensupport.DecodeResponse(target, res); err != nil { 2629 return nil, err 2630 } 2631 return ret, nil 2632 } 2633 2634 // Pages invokes f for each page of results. 2635 // A non-nil error returned from f will halt the iteration. 2636 // The provided context supersedes any context provided to the Context method. 2637 func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListPublisherAccountsResponse) error) error { 2638 c.ctx_ = ctx 2639 defer c.PageToken(c.urlParams_.Get("pageToken")) 2640 for { 2641 x, err := c.Do() 2642 if err != nil { 2643 return err 2644 } 2645 if err := f(x); err != nil { 2646 return err 2647 } 2648 if x.NextPageToken == "" { 2649 return nil 2650 } 2651 c.PageToken(x.NextPageToken) 2652 } 2653 } 2654 2655 type AccountsAdSourcesListCall struct { 2656 s *Service 2657 parent string 2658 urlParams_ gensupport.URLParams 2659 ifNoneMatch_ string 2660 ctx_ context.Context 2661 header_ http.Header 2662 } 2663 2664 // List: List the ad sources. 2665 // 2666 // - parent: The parent which owns this collection of ad sources. Format: 2667 // accounts/{publisher_id}. 2668 func (r *AccountsAdSourcesService) List(parent string) *AccountsAdSourcesListCall { 2669 c := &AccountsAdSourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2670 c.parent = parent 2671 return c 2672 } 2673 2674 // PageSize sets the optional parameter "pageSize": The maximum number of ad 2675 // sources to return. If unspecified or 0, at most 10,000 ad sources will be 2676 // returned. The maximum value is 20,000; values above 10,000 will be coerced 2677 // to 20,000. 2678 func (c *AccountsAdSourcesListCall) PageSize(pageSize int64) *AccountsAdSourcesListCall { 2679 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2680 return c 2681 } 2682 2683 // PageToken sets the optional parameter "pageToken": A page token, received 2684 // from a previous `ListAdSources` call. Provide this to retrieve the 2685 // subsequent page. 2686 func (c *AccountsAdSourcesListCall) PageToken(pageToken string) *AccountsAdSourcesListCall { 2687 c.urlParams_.Set("pageToken", pageToken) 2688 return c 2689 } 2690 2691 // Fields allows partial responses to be retrieved. See 2692 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2693 // details. 2694 func (c *AccountsAdSourcesListCall) Fields(s ...googleapi.Field) *AccountsAdSourcesListCall { 2695 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2696 return c 2697 } 2698 2699 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2700 // object's ETag matches the given value. This is useful for getting updates 2701 // only after the object has changed since the last request. 2702 func (c *AccountsAdSourcesListCall) IfNoneMatch(entityTag string) *AccountsAdSourcesListCall { 2703 c.ifNoneMatch_ = entityTag 2704 return c 2705 } 2706 2707 // Context sets the context to be used in this call's Do method. 2708 func (c *AccountsAdSourcesListCall) Context(ctx context.Context) *AccountsAdSourcesListCall { 2709 c.ctx_ = ctx 2710 return c 2711 } 2712 2713 // Header returns a http.Header that can be modified by the caller to add 2714 // headers to the request. 2715 func (c *AccountsAdSourcesListCall) Header() http.Header { 2716 if c.header_ == nil { 2717 c.header_ = make(http.Header) 2718 } 2719 return c.header_ 2720 } 2721 2722 func (c *AccountsAdSourcesListCall) doRequest(alt string) (*http.Response, error) { 2723 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2724 if c.ifNoneMatch_ != "" { 2725 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2726 } 2727 var body io.Reader = nil 2728 c.urlParams_.Set("alt", alt) 2729 c.urlParams_.Set("prettyPrint", "false") 2730 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adSources") 2731 urls += "?" + c.urlParams_.Encode() 2732 req, err := http.NewRequest("GET", urls, body) 2733 if err != nil { 2734 return nil, err 2735 } 2736 req.Header = reqHeaders 2737 googleapi.Expand(req.URL, map[string]string{ 2738 "parent": c.parent, 2739 }) 2740 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2741 } 2742 2743 // Do executes the "admob.accounts.adSources.list" call. 2744 // Any non-2xx status code is an error. Response headers are in either 2745 // *ListAdSourcesResponse.ServerResponse.Header or (if a response was returned 2746 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2747 // check whether the returned error was because http.StatusNotModified was 2748 // returned. 2749 func (c *AccountsAdSourcesListCall) Do(opts ...googleapi.CallOption) (*ListAdSourcesResponse, error) { 2750 gensupport.SetOptions(c.urlParams_, opts...) 2751 res, err := c.doRequest("json") 2752 if res != nil && res.StatusCode == http.StatusNotModified { 2753 if res.Body != nil { 2754 res.Body.Close() 2755 } 2756 return nil, gensupport.WrapError(&googleapi.Error{ 2757 Code: res.StatusCode, 2758 Header: res.Header, 2759 }) 2760 } 2761 if err != nil { 2762 return nil, err 2763 } 2764 defer googleapi.CloseBody(res) 2765 if err := googleapi.CheckResponse(res); err != nil { 2766 return nil, gensupport.WrapError(err) 2767 } 2768 ret := &ListAdSourcesResponse{ 2769 ServerResponse: googleapi.ServerResponse{ 2770 Header: res.Header, 2771 HTTPStatusCode: res.StatusCode, 2772 }, 2773 } 2774 target := &ret 2775 if err := gensupport.DecodeResponse(target, res); err != nil { 2776 return nil, err 2777 } 2778 return ret, nil 2779 } 2780 2781 // Pages invokes f for each page of results. 2782 // A non-nil error returned from f will halt the iteration. 2783 // The provided context supersedes any context provided to the Context method. 2784 func (c *AccountsAdSourcesListCall) Pages(ctx context.Context, f func(*ListAdSourcesResponse) error) error { 2785 c.ctx_ = ctx 2786 defer c.PageToken(c.urlParams_.Get("pageToken")) 2787 for { 2788 x, err := c.Do() 2789 if err != nil { 2790 return err 2791 } 2792 if err := f(x); err != nil { 2793 return err 2794 } 2795 if x.NextPageToken == "" { 2796 return nil 2797 } 2798 c.PageToken(x.NextPageToken) 2799 } 2800 } 2801 2802 type AccountsAdSourcesAdaptersListCall struct { 2803 s *Service 2804 parent string 2805 urlParams_ gensupport.URLParams 2806 ifNoneMatch_ string 2807 ctx_ context.Context 2808 header_ http.Header 2809 } 2810 2811 // List: List the adapters of the ad source. 2812 // 2813 // - parent: The parent which owns this collection of adapters. Format: 2814 // accounts/{publisher_id}/adSources/{ad_source_id}. 2815 func (r *AccountsAdSourcesAdaptersService) List(parent string) *AccountsAdSourcesAdaptersListCall { 2816 c := &AccountsAdSourcesAdaptersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2817 c.parent = parent 2818 return c 2819 } 2820 2821 // PageSize sets the optional parameter "pageSize": The maximum number of 2822 // adapters to return. If unspecified or 0, at most 10,000 adapters will be 2823 // returned. The maximum value is 20,000; values above 20,000 will be coerced 2824 // to 20,000. 2825 func (c *AccountsAdSourcesAdaptersListCall) PageSize(pageSize int64) *AccountsAdSourcesAdaptersListCall { 2826 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2827 return c 2828 } 2829 2830 // PageToken sets the optional parameter "pageToken": A page token, received 2831 // from a previous `ListAdapters` call. Provide this to retrieve the subsequent 2832 // page. 2833 func (c *AccountsAdSourcesAdaptersListCall) PageToken(pageToken string) *AccountsAdSourcesAdaptersListCall { 2834 c.urlParams_.Set("pageToken", pageToken) 2835 return c 2836 } 2837 2838 // Fields allows partial responses to be retrieved. See 2839 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2840 // details. 2841 func (c *AccountsAdSourcesAdaptersListCall) Fields(s ...googleapi.Field) *AccountsAdSourcesAdaptersListCall { 2842 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2843 return c 2844 } 2845 2846 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2847 // object's ETag matches the given value. This is useful for getting updates 2848 // only after the object has changed since the last request. 2849 func (c *AccountsAdSourcesAdaptersListCall) IfNoneMatch(entityTag string) *AccountsAdSourcesAdaptersListCall { 2850 c.ifNoneMatch_ = entityTag 2851 return c 2852 } 2853 2854 // Context sets the context to be used in this call's Do method. 2855 func (c *AccountsAdSourcesAdaptersListCall) Context(ctx context.Context) *AccountsAdSourcesAdaptersListCall { 2856 c.ctx_ = ctx 2857 return c 2858 } 2859 2860 // Header returns a http.Header that can be modified by the caller to add 2861 // headers to the request. 2862 func (c *AccountsAdSourcesAdaptersListCall) Header() http.Header { 2863 if c.header_ == nil { 2864 c.header_ = make(http.Header) 2865 } 2866 return c.header_ 2867 } 2868 2869 func (c *AccountsAdSourcesAdaptersListCall) doRequest(alt string) (*http.Response, error) { 2870 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2871 if c.ifNoneMatch_ != "" { 2872 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2873 } 2874 var body io.Reader = nil 2875 c.urlParams_.Set("alt", alt) 2876 c.urlParams_.Set("prettyPrint", "false") 2877 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adapters") 2878 urls += "?" + c.urlParams_.Encode() 2879 req, err := http.NewRequest("GET", urls, body) 2880 if err != nil { 2881 return nil, err 2882 } 2883 req.Header = reqHeaders 2884 googleapi.Expand(req.URL, map[string]string{ 2885 "parent": c.parent, 2886 }) 2887 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2888 } 2889 2890 // Do executes the "admob.accounts.adSources.adapters.list" call. 2891 // Any non-2xx status code is an error. Response headers are in either 2892 // *ListAdaptersResponse.ServerResponse.Header or (if a response was returned 2893 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2894 // check whether the returned error was because http.StatusNotModified was 2895 // returned. 2896 func (c *AccountsAdSourcesAdaptersListCall) Do(opts ...googleapi.CallOption) (*ListAdaptersResponse, error) { 2897 gensupport.SetOptions(c.urlParams_, opts...) 2898 res, err := c.doRequest("json") 2899 if res != nil && res.StatusCode == http.StatusNotModified { 2900 if res.Body != nil { 2901 res.Body.Close() 2902 } 2903 return nil, gensupport.WrapError(&googleapi.Error{ 2904 Code: res.StatusCode, 2905 Header: res.Header, 2906 }) 2907 } 2908 if err != nil { 2909 return nil, err 2910 } 2911 defer googleapi.CloseBody(res) 2912 if err := googleapi.CheckResponse(res); err != nil { 2913 return nil, gensupport.WrapError(err) 2914 } 2915 ret := &ListAdaptersResponse{ 2916 ServerResponse: googleapi.ServerResponse{ 2917 Header: res.Header, 2918 HTTPStatusCode: res.StatusCode, 2919 }, 2920 } 2921 target := &ret 2922 if err := gensupport.DecodeResponse(target, res); err != nil { 2923 return nil, err 2924 } 2925 return ret, nil 2926 } 2927 2928 // Pages invokes f for each page of results. 2929 // A non-nil error returned from f will halt the iteration. 2930 // The provided context supersedes any context provided to the Context method. 2931 func (c *AccountsAdSourcesAdaptersListCall) Pages(ctx context.Context, f func(*ListAdaptersResponse) error) error { 2932 c.ctx_ = ctx 2933 defer c.PageToken(c.urlParams_.Get("pageToken")) 2934 for { 2935 x, err := c.Do() 2936 if err != nil { 2937 return err 2938 } 2939 if err := f(x); err != nil { 2940 return err 2941 } 2942 if x.NextPageToken == "" { 2943 return nil 2944 } 2945 c.PageToken(x.NextPageToken) 2946 } 2947 } 2948 2949 type AccountsAdUnitMappingsBatchCreateCall struct { 2950 s *Service 2951 parent string 2952 batchcreateadunitmappingsrequest *BatchCreateAdUnitMappingsRequest 2953 urlParams_ gensupport.URLParams 2954 ctx_ context.Context 2955 header_ http.Header 2956 } 2957 2958 // BatchCreate: Batch create the ad unit mappings under the specific AdMob 2959 // account. The maximum allowed batch size is 100. This method has limited 2960 // access. If you see a 403 permission denied error, please reach out to your 2961 // account manager for access. 2962 // 2963 // - parent: The AdMob account which owns this collection of ad unit mappings. 2964 // Format: accounts/{publisher_id} See 2965 // https://support.google.com/admob/answer/2784578 for instructions on how to 2966 // find your AdMob publisher ID. 2967 func (r *AccountsAdUnitMappingsService) BatchCreate(parent string, batchcreateadunitmappingsrequest *BatchCreateAdUnitMappingsRequest) *AccountsAdUnitMappingsBatchCreateCall { 2968 c := &AccountsAdUnitMappingsBatchCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2969 c.parent = parent 2970 c.batchcreateadunitmappingsrequest = batchcreateadunitmappingsrequest 2971 return c 2972 } 2973 2974 // Fields allows partial responses to be retrieved. See 2975 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2976 // details. 2977 func (c *AccountsAdUnitMappingsBatchCreateCall) Fields(s ...googleapi.Field) *AccountsAdUnitMappingsBatchCreateCall { 2978 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2979 return c 2980 } 2981 2982 // Context sets the context to be used in this call's Do method. 2983 func (c *AccountsAdUnitMappingsBatchCreateCall) Context(ctx context.Context) *AccountsAdUnitMappingsBatchCreateCall { 2984 c.ctx_ = ctx 2985 return c 2986 } 2987 2988 // Header returns a http.Header that can be modified by the caller to add 2989 // headers to the request. 2990 func (c *AccountsAdUnitMappingsBatchCreateCall) Header() http.Header { 2991 if c.header_ == nil { 2992 c.header_ = make(http.Header) 2993 } 2994 return c.header_ 2995 } 2996 2997 func (c *AccountsAdUnitMappingsBatchCreateCall) doRequest(alt string) (*http.Response, error) { 2998 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2999 var body io.Reader = nil 3000 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchcreateadunitmappingsrequest) 3001 if err != nil { 3002 return nil, err 3003 } 3004 c.urlParams_.Set("alt", alt) 3005 c.urlParams_.Set("prettyPrint", "false") 3006 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnitMappings:batchCreate") 3007 urls += "?" + c.urlParams_.Encode() 3008 req, err := http.NewRequest("POST", urls, body) 3009 if err != nil { 3010 return nil, err 3011 } 3012 req.Header = reqHeaders 3013 googleapi.Expand(req.URL, map[string]string{ 3014 "parent": c.parent, 3015 }) 3016 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3017 } 3018 3019 // Do executes the "admob.accounts.adUnitMappings.batchCreate" call. 3020 // Any non-2xx status code is an error. Response headers are in either 3021 // *BatchCreateAdUnitMappingsResponse.ServerResponse.Header or (if a response 3022 // was returned at all) in error.(*googleapi.Error).Header. Use 3023 // googleapi.IsNotModified to check whether the returned error was because 3024 // http.StatusNotModified was returned. 3025 func (c *AccountsAdUnitMappingsBatchCreateCall) Do(opts ...googleapi.CallOption) (*BatchCreateAdUnitMappingsResponse, error) { 3026 gensupport.SetOptions(c.urlParams_, opts...) 3027 res, err := c.doRequest("json") 3028 if res != nil && res.StatusCode == http.StatusNotModified { 3029 if res.Body != nil { 3030 res.Body.Close() 3031 } 3032 return nil, gensupport.WrapError(&googleapi.Error{ 3033 Code: res.StatusCode, 3034 Header: res.Header, 3035 }) 3036 } 3037 if err != nil { 3038 return nil, err 3039 } 3040 defer googleapi.CloseBody(res) 3041 if err := googleapi.CheckResponse(res); err != nil { 3042 return nil, gensupport.WrapError(err) 3043 } 3044 ret := &BatchCreateAdUnitMappingsResponse{ 3045 ServerResponse: googleapi.ServerResponse{ 3046 Header: res.Header, 3047 HTTPStatusCode: res.StatusCode, 3048 }, 3049 } 3050 target := &ret 3051 if err := gensupport.DecodeResponse(target, res); err != nil { 3052 return nil, err 3053 } 3054 return ret, nil 3055 } 3056 3057 type AccountsAdUnitsCreateCall struct { 3058 s *Service 3059 parent string 3060 adunit *AdUnit 3061 urlParams_ gensupport.URLParams 3062 ctx_ context.Context 3063 header_ http.Header 3064 } 3065 3066 // Create: Creates an ad unit under the specified AdMob account. This method 3067 // has limited access. If you see a 403 permission denied error, please reach 3068 // out to your account manager for access. 3069 // 3070 // - parent: Resource name of the account to create the specified ad unit for. 3071 // Example: accounts/pub-9876543210987654. 3072 func (r *AccountsAdUnitsService) Create(parent string, adunit *AdUnit) *AccountsAdUnitsCreateCall { 3073 c := &AccountsAdUnitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3074 c.parent = parent 3075 c.adunit = adunit 3076 return c 3077 } 3078 3079 // Fields allows partial responses to be retrieved. See 3080 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3081 // details. 3082 func (c *AccountsAdUnitsCreateCall) Fields(s ...googleapi.Field) *AccountsAdUnitsCreateCall { 3083 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3084 return c 3085 } 3086 3087 // Context sets the context to be used in this call's Do method. 3088 func (c *AccountsAdUnitsCreateCall) Context(ctx context.Context) *AccountsAdUnitsCreateCall { 3089 c.ctx_ = ctx 3090 return c 3091 } 3092 3093 // Header returns a http.Header that can be modified by the caller to add 3094 // headers to the request. 3095 func (c *AccountsAdUnitsCreateCall) Header() http.Header { 3096 if c.header_ == nil { 3097 c.header_ = make(http.Header) 3098 } 3099 return c.header_ 3100 } 3101 3102 func (c *AccountsAdUnitsCreateCall) doRequest(alt string) (*http.Response, error) { 3103 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3104 var body io.Reader = nil 3105 body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunit) 3106 if err != nil { 3107 return nil, err 3108 } 3109 c.urlParams_.Set("alt", alt) 3110 c.urlParams_.Set("prettyPrint", "false") 3111 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnits") 3112 urls += "?" + c.urlParams_.Encode() 3113 req, err := http.NewRequest("POST", urls, body) 3114 if err != nil { 3115 return nil, err 3116 } 3117 req.Header = reqHeaders 3118 googleapi.Expand(req.URL, map[string]string{ 3119 "parent": c.parent, 3120 }) 3121 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3122 } 3123 3124 // Do executes the "admob.accounts.adUnits.create" call. 3125 // Any non-2xx status code is an error. Response headers are in either 3126 // *AdUnit.ServerResponse.Header or (if a response was returned at all) in 3127 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3128 // whether the returned error was because http.StatusNotModified was returned. 3129 func (c *AccountsAdUnitsCreateCall) Do(opts ...googleapi.CallOption) (*AdUnit, error) { 3130 gensupport.SetOptions(c.urlParams_, opts...) 3131 res, err := c.doRequest("json") 3132 if res != nil && res.StatusCode == http.StatusNotModified { 3133 if res.Body != nil { 3134 res.Body.Close() 3135 } 3136 return nil, gensupport.WrapError(&googleapi.Error{ 3137 Code: res.StatusCode, 3138 Header: res.Header, 3139 }) 3140 } 3141 if err != nil { 3142 return nil, err 3143 } 3144 defer googleapi.CloseBody(res) 3145 if err := googleapi.CheckResponse(res); err != nil { 3146 return nil, gensupport.WrapError(err) 3147 } 3148 ret := &AdUnit{ 3149 ServerResponse: googleapi.ServerResponse{ 3150 Header: res.Header, 3151 HTTPStatusCode: res.StatusCode, 3152 }, 3153 } 3154 target := &ret 3155 if err := gensupport.DecodeResponse(target, res); err != nil { 3156 return nil, err 3157 } 3158 return ret, nil 3159 } 3160 3161 type AccountsAdUnitsListCall struct { 3162 s *Service 3163 parent string 3164 urlParams_ gensupport.URLParams 3165 ifNoneMatch_ string 3166 ctx_ context.Context 3167 header_ http.Header 3168 } 3169 3170 // List: List the ad units under the specified AdMob account. 3171 // 3172 // - parent: Resource name of the account to list ad units for. Example: 3173 // accounts/pub-9876543210987654. 3174 func (r *AccountsAdUnitsService) List(parent string) *AccountsAdUnitsListCall { 3175 c := &AccountsAdUnitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3176 c.parent = parent 3177 return c 3178 } 3179 3180 // PageSize sets the optional parameter "pageSize": The maximum number of ad 3181 // units to return. If unspecified or 0, at most 10,000 ad units will be 3182 // returned. The maximum value is 20,000; values above 20,000 will be coerced 3183 // to 20,000. 3184 func (c *AccountsAdUnitsListCall) PageSize(pageSize int64) *AccountsAdUnitsListCall { 3185 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3186 return c 3187 } 3188 3189 // PageToken sets the optional parameter "pageToken": The value returned by the 3190 // last `ListAdUnitsResponse`; indicates that this is a continuation of a prior 3191 // `ListAdUnits` call, and that the system should return the next page of data. 3192 func (c *AccountsAdUnitsListCall) PageToken(pageToken string) *AccountsAdUnitsListCall { 3193 c.urlParams_.Set("pageToken", pageToken) 3194 return c 3195 } 3196 3197 // Fields allows partial responses to be retrieved. See 3198 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3199 // details. 3200 func (c *AccountsAdUnitsListCall) Fields(s ...googleapi.Field) *AccountsAdUnitsListCall { 3201 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3202 return c 3203 } 3204 3205 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3206 // object's ETag matches the given value. This is useful for getting updates 3207 // only after the object has changed since the last request. 3208 func (c *AccountsAdUnitsListCall) IfNoneMatch(entityTag string) *AccountsAdUnitsListCall { 3209 c.ifNoneMatch_ = entityTag 3210 return c 3211 } 3212 3213 // Context sets the context to be used in this call's Do method. 3214 func (c *AccountsAdUnitsListCall) Context(ctx context.Context) *AccountsAdUnitsListCall { 3215 c.ctx_ = ctx 3216 return c 3217 } 3218 3219 // Header returns a http.Header that can be modified by the caller to add 3220 // headers to the request. 3221 func (c *AccountsAdUnitsListCall) Header() http.Header { 3222 if c.header_ == nil { 3223 c.header_ = make(http.Header) 3224 } 3225 return c.header_ 3226 } 3227 3228 func (c *AccountsAdUnitsListCall) doRequest(alt string) (*http.Response, error) { 3229 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3230 if c.ifNoneMatch_ != "" { 3231 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3232 } 3233 var body io.Reader = nil 3234 c.urlParams_.Set("alt", alt) 3235 c.urlParams_.Set("prettyPrint", "false") 3236 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnits") 3237 urls += "?" + c.urlParams_.Encode() 3238 req, err := http.NewRequest("GET", urls, body) 3239 if err != nil { 3240 return nil, err 3241 } 3242 req.Header = reqHeaders 3243 googleapi.Expand(req.URL, map[string]string{ 3244 "parent": c.parent, 3245 }) 3246 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3247 } 3248 3249 // Do executes the "admob.accounts.adUnits.list" call. 3250 // Any non-2xx status code is an error. Response headers are in either 3251 // *ListAdUnitsResponse.ServerResponse.Header or (if a response was returned at 3252 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3253 // check whether the returned error was because http.StatusNotModified was 3254 // returned. 3255 func (c *AccountsAdUnitsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitsResponse, error) { 3256 gensupport.SetOptions(c.urlParams_, opts...) 3257 res, err := c.doRequest("json") 3258 if res != nil && res.StatusCode == http.StatusNotModified { 3259 if res.Body != nil { 3260 res.Body.Close() 3261 } 3262 return nil, gensupport.WrapError(&googleapi.Error{ 3263 Code: res.StatusCode, 3264 Header: res.Header, 3265 }) 3266 } 3267 if err != nil { 3268 return nil, err 3269 } 3270 defer googleapi.CloseBody(res) 3271 if err := googleapi.CheckResponse(res); err != nil { 3272 return nil, gensupport.WrapError(err) 3273 } 3274 ret := &ListAdUnitsResponse{ 3275 ServerResponse: googleapi.ServerResponse{ 3276 Header: res.Header, 3277 HTTPStatusCode: res.StatusCode, 3278 }, 3279 } 3280 target := &ret 3281 if err := gensupport.DecodeResponse(target, res); err != nil { 3282 return nil, err 3283 } 3284 return ret, nil 3285 } 3286 3287 // Pages invokes f for each page of results. 3288 // A non-nil error returned from f will halt the iteration. 3289 // The provided context supersedes any context provided to the Context method. 3290 func (c *AccountsAdUnitsListCall) Pages(ctx context.Context, f func(*ListAdUnitsResponse) error) error { 3291 c.ctx_ = ctx 3292 defer c.PageToken(c.urlParams_.Get("pageToken")) 3293 for { 3294 x, err := c.Do() 3295 if err != nil { 3296 return err 3297 } 3298 if err := f(x); err != nil { 3299 return err 3300 } 3301 if x.NextPageToken == "" { 3302 return nil 3303 } 3304 c.PageToken(x.NextPageToken) 3305 } 3306 } 3307 3308 type AccountsAdUnitsAdUnitMappingsCreateCall struct { 3309 s *Service 3310 parent string 3311 adunitmapping *AdUnitMapping 3312 urlParams_ gensupport.URLParams 3313 ctx_ context.Context 3314 header_ http.Header 3315 } 3316 3317 // Create: Create an ad unit mapping under the specific AdMob account and ad 3318 // unit. This method has limited access. If you see a 403 permission denied 3319 // error, please reach out to your account manager for access. 3320 // 3321 // - parent: The parent which owns the ad unit mapping. Format: 3322 // accounts/{publisher_id}/adUnits/{ad_unit_id}. 3323 func (r *AccountsAdUnitsAdUnitMappingsService) Create(parent string, adunitmapping *AdUnitMapping) *AccountsAdUnitsAdUnitMappingsCreateCall { 3324 c := &AccountsAdUnitsAdUnitMappingsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3325 c.parent = parent 3326 c.adunitmapping = adunitmapping 3327 return c 3328 } 3329 3330 // Fields allows partial responses to be retrieved. See 3331 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3332 // details. 3333 func (c *AccountsAdUnitsAdUnitMappingsCreateCall) Fields(s ...googleapi.Field) *AccountsAdUnitsAdUnitMappingsCreateCall { 3334 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3335 return c 3336 } 3337 3338 // Context sets the context to be used in this call's Do method. 3339 func (c *AccountsAdUnitsAdUnitMappingsCreateCall) Context(ctx context.Context) *AccountsAdUnitsAdUnitMappingsCreateCall { 3340 c.ctx_ = ctx 3341 return c 3342 } 3343 3344 // Header returns a http.Header that can be modified by the caller to add 3345 // headers to the request. 3346 func (c *AccountsAdUnitsAdUnitMappingsCreateCall) Header() http.Header { 3347 if c.header_ == nil { 3348 c.header_ = make(http.Header) 3349 } 3350 return c.header_ 3351 } 3352 3353 func (c *AccountsAdUnitsAdUnitMappingsCreateCall) doRequest(alt string) (*http.Response, error) { 3354 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3355 var body io.Reader = nil 3356 body, err := googleapi.WithoutDataWrapper.JSONReader(c.adunitmapping) 3357 if err != nil { 3358 return nil, err 3359 } 3360 c.urlParams_.Set("alt", alt) 3361 c.urlParams_.Set("prettyPrint", "false") 3362 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnitMappings") 3363 urls += "?" + c.urlParams_.Encode() 3364 req, err := http.NewRequest("POST", urls, body) 3365 if err != nil { 3366 return nil, err 3367 } 3368 req.Header = reqHeaders 3369 googleapi.Expand(req.URL, map[string]string{ 3370 "parent": c.parent, 3371 }) 3372 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3373 } 3374 3375 // Do executes the "admob.accounts.adUnits.adUnitMappings.create" call. 3376 // Any non-2xx status code is an error. Response headers are in either 3377 // *AdUnitMapping.ServerResponse.Header or (if a response was returned at all) 3378 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3379 // whether the returned error was because http.StatusNotModified was returned. 3380 func (c *AccountsAdUnitsAdUnitMappingsCreateCall) Do(opts ...googleapi.CallOption) (*AdUnitMapping, error) { 3381 gensupport.SetOptions(c.urlParams_, opts...) 3382 res, err := c.doRequest("json") 3383 if res != nil && res.StatusCode == http.StatusNotModified { 3384 if res.Body != nil { 3385 res.Body.Close() 3386 } 3387 return nil, gensupport.WrapError(&googleapi.Error{ 3388 Code: res.StatusCode, 3389 Header: res.Header, 3390 }) 3391 } 3392 if err != nil { 3393 return nil, err 3394 } 3395 defer googleapi.CloseBody(res) 3396 if err := googleapi.CheckResponse(res); err != nil { 3397 return nil, gensupport.WrapError(err) 3398 } 3399 ret := &AdUnitMapping{ 3400 ServerResponse: googleapi.ServerResponse{ 3401 Header: res.Header, 3402 HTTPStatusCode: res.StatusCode, 3403 }, 3404 } 3405 target := &ret 3406 if err := gensupport.DecodeResponse(target, res); err != nil { 3407 return nil, err 3408 } 3409 return ret, nil 3410 } 3411 3412 type AccountsAdUnitsAdUnitMappingsListCall struct { 3413 s *Service 3414 parent string 3415 urlParams_ gensupport.URLParams 3416 ifNoneMatch_ string 3417 ctx_ context.Context 3418 header_ http.Header 3419 } 3420 3421 // List: List ad unit mappings under the specified AdMob account and ad unit. 3422 // This method has limited access. If you see a 403 permission denied error, 3423 // please reach out to your account manager for access. 3424 // 3425 // - parent: The parent which owns this collection of ad unit mappings. Format: 3426 // accounts/{publisher_id}/adUnits/{ad_unit_id}. 3427 func (r *AccountsAdUnitsAdUnitMappingsService) List(parent string) *AccountsAdUnitsAdUnitMappingsListCall { 3428 c := &AccountsAdUnitsAdUnitMappingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3429 c.parent = parent 3430 return c 3431 } 3432 3433 // Filter sets the optional parameter "filter": The filter string that uses 3434 // EBNF grammar syntax (https://google.aip.dev/assets/misc/ebnf-filtering.txt). 3435 // Possible field to filter by is: - "DISPLAY_NAME" Possible filter function 3436 // is: - `IN`: Used to filter fields that represent a singleton including 3437 // "DISPLAY_NAME". The filter functions can be added together using `AND`. `OR` 3438 // functionality is not supported. Example: filter: IN(DISPLAY_NAME, "Test Ad 3439 // Unit Mapping 1", "Test Ad Unit Mapping 2") 3440 func (c *AccountsAdUnitsAdUnitMappingsListCall) Filter(filter string) *AccountsAdUnitsAdUnitMappingsListCall { 3441 c.urlParams_.Set("filter", filter) 3442 return c 3443 } 3444 3445 // PageSize sets the optional parameter "pageSize": The maximum number of ad 3446 // unit mappings to return. If unspecified or 0, at most 10,000 ad unit 3447 // mappings will be returned. The maximum value is 20,000; values above 20,000 3448 // will be coerced to 20,000. 3449 func (c *AccountsAdUnitsAdUnitMappingsListCall) PageSize(pageSize int64) *AccountsAdUnitsAdUnitMappingsListCall { 3450 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3451 return c 3452 } 3453 3454 // PageToken sets the optional parameter "pageToken": A page token, received 3455 // from a previous `ListAdUnitMappings` call. Provide this to retrieve the 3456 // subsequent page. 3457 func (c *AccountsAdUnitsAdUnitMappingsListCall) PageToken(pageToken string) *AccountsAdUnitsAdUnitMappingsListCall { 3458 c.urlParams_.Set("pageToken", pageToken) 3459 return c 3460 } 3461 3462 // Fields allows partial responses to be retrieved. See 3463 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3464 // details. 3465 func (c *AccountsAdUnitsAdUnitMappingsListCall) Fields(s ...googleapi.Field) *AccountsAdUnitsAdUnitMappingsListCall { 3466 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3467 return c 3468 } 3469 3470 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3471 // object's ETag matches the given value. This is useful for getting updates 3472 // only after the object has changed since the last request. 3473 func (c *AccountsAdUnitsAdUnitMappingsListCall) IfNoneMatch(entityTag string) *AccountsAdUnitsAdUnitMappingsListCall { 3474 c.ifNoneMatch_ = entityTag 3475 return c 3476 } 3477 3478 // Context sets the context to be used in this call's Do method. 3479 func (c *AccountsAdUnitsAdUnitMappingsListCall) Context(ctx context.Context) *AccountsAdUnitsAdUnitMappingsListCall { 3480 c.ctx_ = ctx 3481 return c 3482 } 3483 3484 // Header returns a http.Header that can be modified by the caller to add 3485 // headers to the request. 3486 func (c *AccountsAdUnitsAdUnitMappingsListCall) Header() http.Header { 3487 if c.header_ == nil { 3488 c.header_ = make(http.Header) 3489 } 3490 return c.header_ 3491 } 3492 3493 func (c *AccountsAdUnitsAdUnitMappingsListCall) doRequest(alt string) (*http.Response, error) { 3494 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3495 if c.ifNoneMatch_ != "" { 3496 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3497 } 3498 var body io.Reader = nil 3499 c.urlParams_.Set("alt", alt) 3500 c.urlParams_.Set("prettyPrint", "false") 3501 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/adUnitMappings") 3502 urls += "?" + c.urlParams_.Encode() 3503 req, err := http.NewRequest("GET", urls, body) 3504 if err != nil { 3505 return nil, err 3506 } 3507 req.Header = reqHeaders 3508 googleapi.Expand(req.URL, map[string]string{ 3509 "parent": c.parent, 3510 }) 3511 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3512 } 3513 3514 // Do executes the "admob.accounts.adUnits.adUnitMappings.list" call. 3515 // Any non-2xx status code is an error. Response headers are in either 3516 // *ListAdUnitMappingsResponse.ServerResponse.Header or (if a response was 3517 // returned at all) in error.(*googleapi.Error).Header. Use 3518 // googleapi.IsNotModified to check whether the returned error was because 3519 // http.StatusNotModified was returned. 3520 func (c *AccountsAdUnitsAdUnitMappingsListCall) Do(opts ...googleapi.CallOption) (*ListAdUnitMappingsResponse, error) { 3521 gensupport.SetOptions(c.urlParams_, opts...) 3522 res, err := c.doRequest("json") 3523 if res != nil && res.StatusCode == http.StatusNotModified { 3524 if res.Body != nil { 3525 res.Body.Close() 3526 } 3527 return nil, gensupport.WrapError(&googleapi.Error{ 3528 Code: res.StatusCode, 3529 Header: res.Header, 3530 }) 3531 } 3532 if err != nil { 3533 return nil, err 3534 } 3535 defer googleapi.CloseBody(res) 3536 if err := googleapi.CheckResponse(res); err != nil { 3537 return nil, gensupport.WrapError(err) 3538 } 3539 ret := &ListAdUnitMappingsResponse{ 3540 ServerResponse: googleapi.ServerResponse{ 3541 Header: res.Header, 3542 HTTPStatusCode: res.StatusCode, 3543 }, 3544 } 3545 target := &ret 3546 if err := gensupport.DecodeResponse(target, res); err != nil { 3547 return nil, err 3548 } 3549 return ret, nil 3550 } 3551 3552 // Pages invokes f for each page of results. 3553 // A non-nil error returned from f will halt the iteration. 3554 // The provided context supersedes any context provided to the Context method. 3555 func (c *AccountsAdUnitsAdUnitMappingsListCall) Pages(ctx context.Context, f func(*ListAdUnitMappingsResponse) error) error { 3556 c.ctx_ = ctx 3557 defer c.PageToken(c.urlParams_.Get("pageToken")) 3558 for { 3559 x, err := c.Do() 3560 if err != nil { 3561 return err 3562 } 3563 if err := f(x); err != nil { 3564 return err 3565 } 3566 if x.NextPageToken == "" { 3567 return nil 3568 } 3569 c.PageToken(x.NextPageToken) 3570 } 3571 } 3572 3573 type AccountsAppsCreateCall struct { 3574 s *Service 3575 parent string 3576 app *App 3577 urlParams_ gensupport.URLParams 3578 ctx_ context.Context 3579 header_ http.Header 3580 } 3581 3582 // Create: Creates an app under the specified AdMob account. This method has 3583 // limited access. If you see a 403 permission denied error, please reach out 3584 // to your account manager for access. 3585 // 3586 // - parent: Resource name of the account for which the app is being created. 3587 // Example: accounts/pub-9876543210987654. 3588 func (r *AccountsAppsService) Create(parent string, app *App) *AccountsAppsCreateCall { 3589 c := &AccountsAppsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3590 c.parent = parent 3591 c.app = app 3592 return c 3593 } 3594 3595 // Fields allows partial responses to be retrieved. See 3596 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3597 // details. 3598 func (c *AccountsAppsCreateCall) Fields(s ...googleapi.Field) *AccountsAppsCreateCall { 3599 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3600 return c 3601 } 3602 3603 // Context sets the context to be used in this call's Do method. 3604 func (c *AccountsAppsCreateCall) Context(ctx context.Context) *AccountsAppsCreateCall { 3605 c.ctx_ = ctx 3606 return c 3607 } 3608 3609 // Header returns a http.Header that can be modified by the caller to add 3610 // headers to the request. 3611 func (c *AccountsAppsCreateCall) Header() http.Header { 3612 if c.header_ == nil { 3613 c.header_ = make(http.Header) 3614 } 3615 return c.header_ 3616 } 3617 3618 func (c *AccountsAppsCreateCall) doRequest(alt string) (*http.Response, error) { 3619 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3620 var body io.Reader = nil 3621 body, err := googleapi.WithoutDataWrapper.JSONReader(c.app) 3622 if err != nil { 3623 return nil, err 3624 } 3625 c.urlParams_.Set("alt", alt) 3626 c.urlParams_.Set("prettyPrint", "false") 3627 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps") 3628 urls += "?" + c.urlParams_.Encode() 3629 req, err := http.NewRequest("POST", urls, body) 3630 if err != nil { 3631 return nil, err 3632 } 3633 req.Header = reqHeaders 3634 googleapi.Expand(req.URL, map[string]string{ 3635 "parent": c.parent, 3636 }) 3637 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3638 } 3639 3640 // Do executes the "admob.accounts.apps.create" call. 3641 // Any non-2xx status code is an error. Response headers are in either 3642 // *App.ServerResponse.Header or (if a response was returned at all) in 3643 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3644 // whether the returned error was because http.StatusNotModified was returned. 3645 func (c *AccountsAppsCreateCall) Do(opts ...googleapi.CallOption) (*App, error) { 3646 gensupport.SetOptions(c.urlParams_, opts...) 3647 res, err := c.doRequest("json") 3648 if res != nil && res.StatusCode == http.StatusNotModified { 3649 if res.Body != nil { 3650 res.Body.Close() 3651 } 3652 return nil, gensupport.WrapError(&googleapi.Error{ 3653 Code: res.StatusCode, 3654 Header: res.Header, 3655 }) 3656 } 3657 if err != nil { 3658 return nil, err 3659 } 3660 defer googleapi.CloseBody(res) 3661 if err := googleapi.CheckResponse(res); err != nil { 3662 return nil, gensupport.WrapError(err) 3663 } 3664 ret := &App{ 3665 ServerResponse: googleapi.ServerResponse{ 3666 Header: res.Header, 3667 HTTPStatusCode: res.StatusCode, 3668 }, 3669 } 3670 target := &ret 3671 if err := gensupport.DecodeResponse(target, res); err != nil { 3672 return nil, err 3673 } 3674 return ret, nil 3675 } 3676 3677 type AccountsAppsListCall struct { 3678 s *Service 3679 parent string 3680 urlParams_ gensupport.URLParams 3681 ifNoneMatch_ string 3682 ctx_ context.Context 3683 header_ http.Header 3684 } 3685 3686 // List: List the apps under the specified AdMob account. 3687 // 3688 // - parent: Resource name of the account to list apps for. Example: 3689 // accounts/pub-9876543210987654. 3690 func (r *AccountsAppsService) List(parent string) *AccountsAppsListCall { 3691 c := &AccountsAppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3692 c.parent = parent 3693 return c 3694 } 3695 3696 // PageSize sets the optional parameter "pageSize": The maximum number of apps 3697 // to return. If unspecified or 0, at most 10,000 apps will be returned. The 3698 // maximum value is 20,000; values above 20,000 will be coerced to 20,000. 3699 func (c *AccountsAppsListCall) PageSize(pageSize int64) *AccountsAppsListCall { 3700 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3701 return c 3702 } 3703 3704 // PageToken sets the optional parameter "pageToken": The value returned by the 3705 // last `ListAppsResponse`; indicates that this is a continuation of a prior 3706 // `ListApps` call, and that the system should return the next page of data. 3707 func (c *AccountsAppsListCall) PageToken(pageToken string) *AccountsAppsListCall { 3708 c.urlParams_.Set("pageToken", pageToken) 3709 return c 3710 } 3711 3712 // Fields allows partial responses to be retrieved. See 3713 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3714 // details. 3715 func (c *AccountsAppsListCall) Fields(s ...googleapi.Field) *AccountsAppsListCall { 3716 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3717 return c 3718 } 3719 3720 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3721 // object's ETag matches the given value. This is useful for getting updates 3722 // only after the object has changed since the last request. 3723 func (c *AccountsAppsListCall) IfNoneMatch(entityTag string) *AccountsAppsListCall { 3724 c.ifNoneMatch_ = entityTag 3725 return c 3726 } 3727 3728 // Context sets the context to be used in this call's Do method. 3729 func (c *AccountsAppsListCall) Context(ctx context.Context) *AccountsAppsListCall { 3730 c.ctx_ = ctx 3731 return c 3732 } 3733 3734 // Header returns a http.Header that can be modified by the caller to add 3735 // headers to the request. 3736 func (c *AccountsAppsListCall) Header() http.Header { 3737 if c.header_ == nil { 3738 c.header_ = make(http.Header) 3739 } 3740 return c.header_ 3741 } 3742 3743 func (c *AccountsAppsListCall) doRequest(alt string) (*http.Response, error) { 3744 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3745 if c.ifNoneMatch_ != "" { 3746 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3747 } 3748 var body io.Reader = nil 3749 c.urlParams_.Set("alt", alt) 3750 c.urlParams_.Set("prettyPrint", "false") 3751 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/apps") 3752 urls += "?" + c.urlParams_.Encode() 3753 req, err := http.NewRequest("GET", urls, body) 3754 if err != nil { 3755 return nil, err 3756 } 3757 req.Header = reqHeaders 3758 googleapi.Expand(req.URL, map[string]string{ 3759 "parent": c.parent, 3760 }) 3761 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3762 } 3763 3764 // Do executes the "admob.accounts.apps.list" call. 3765 // Any non-2xx status code is an error. Response headers are in either 3766 // *ListAppsResponse.ServerResponse.Header or (if a response was returned at 3767 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3768 // check whether the returned error was because http.StatusNotModified was 3769 // returned. 3770 func (c *AccountsAppsListCall) Do(opts ...googleapi.CallOption) (*ListAppsResponse, error) { 3771 gensupport.SetOptions(c.urlParams_, opts...) 3772 res, err := c.doRequest("json") 3773 if res != nil && res.StatusCode == http.StatusNotModified { 3774 if res.Body != nil { 3775 res.Body.Close() 3776 } 3777 return nil, gensupport.WrapError(&googleapi.Error{ 3778 Code: res.StatusCode, 3779 Header: res.Header, 3780 }) 3781 } 3782 if err != nil { 3783 return nil, err 3784 } 3785 defer googleapi.CloseBody(res) 3786 if err := googleapi.CheckResponse(res); err != nil { 3787 return nil, gensupport.WrapError(err) 3788 } 3789 ret := &ListAppsResponse{ 3790 ServerResponse: googleapi.ServerResponse{ 3791 Header: res.Header, 3792 HTTPStatusCode: res.StatusCode, 3793 }, 3794 } 3795 target := &ret 3796 if err := gensupport.DecodeResponse(target, res); err != nil { 3797 return nil, err 3798 } 3799 return ret, nil 3800 } 3801 3802 // Pages invokes f for each page of results. 3803 // A non-nil error returned from f will halt the iteration. 3804 // The provided context supersedes any context provided to the Context method. 3805 func (c *AccountsAppsListCall) Pages(ctx context.Context, f func(*ListAppsResponse) error) error { 3806 c.ctx_ = ctx 3807 defer c.PageToken(c.urlParams_.Get("pageToken")) 3808 for { 3809 x, err := c.Do() 3810 if err != nil { 3811 return err 3812 } 3813 if err := f(x); err != nil { 3814 return err 3815 } 3816 if x.NextPageToken == "" { 3817 return nil 3818 } 3819 c.PageToken(x.NextPageToken) 3820 } 3821 } 3822 3823 type AccountsCampaignReportGenerateCall struct { 3824 s *Service 3825 parent string 3826 generatecampaignreportrequest *GenerateCampaignReportRequest 3827 urlParams_ gensupport.URLParams 3828 ctx_ context.Context 3829 header_ http.Header 3830 } 3831 3832 // Generate: Generates Campaign Report based on provided specifications. 3833 // 3834 // - parent: Resource name of the account to generate the report for. Example: 3835 // accounts/pub-9876543210987654. 3836 func (r *AccountsCampaignReportService) Generate(parent string, generatecampaignreportrequest *GenerateCampaignReportRequest) *AccountsCampaignReportGenerateCall { 3837 c := &AccountsCampaignReportGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3838 c.parent = parent 3839 c.generatecampaignreportrequest = generatecampaignreportrequest 3840 return c 3841 } 3842 3843 // Fields allows partial responses to be retrieved. See 3844 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3845 // details. 3846 func (c *AccountsCampaignReportGenerateCall) Fields(s ...googleapi.Field) *AccountsCampaignReportGenerateCall { 3847 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3848 return c 3849 } 3850 3851 // Context sets the context to be used in this call's Do method. 3852 func (c *AccountsCampaignReportGenerateCall) Context(ctx context.Context) *AccountsCampaignReportGenerateCall { 3853 c.ctx_ = ctx 3854 return c 3855 } 3856 3857 // Header returns a http.Header that can be modified by the caller to add 3858 // headers to the request. 3859 func (c *AccountsCampaignReportGenerateCall) Header() http.Header { 3860 if c.header_ == nil { 3861 c.header_ = make(http.Header) 3862 } 3863 return c.header_ 3864 } 3865 3866 func (c *AccountsCampaignReportGenerateCall) doRequest(alt string) (*http.Response, error) { 3867 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3868 var body io.Reader = nil 3869 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatecampaignreportrequest) 3870 if err != nil { 3871 return nil, err 3872 } 3873 c.urlParams_.Set("alt", alt) 3874 c.urlParams_.Set("prettyPrint", "false") 3875 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/campaignReport:generate") 3876 urls += "?" + c.urlParams_.Encode() 3877 req, err := http.NewRequest("POST", urls, body) 3878 if err != nil { 3879 return nil, err 3880 } 3881 req.Header = reqHeaders 3882 googleapi.Expand(req.URL, map[string]string{ 3883 "parent": c.parent, 3884 }) 3885 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3886 } 3887 3888 // Do executes the "admob.accounts.campaignReport.generate" call. 3889 // Any non-2xx status code is an error. Response headers are in either 3890 // *GenerateCampaignReportResponse.ServerResponse.Header or (if a response was 3891 // returned at all) in error.(*googleapi.Error).Header. Use 3892 // googleapi.IsNotModified to check whether the returned error was because 3893 // http.StatusNotModified was returned. 3894 func (c *AccountsCampaignReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateCampaignReportResponse, error) { 3895 gensupport.SetOptions(c.urlParams_, opts...) 3896 res, err := c.doRequest("json") 3897 if res != nil && res.StatusCode == http.StatusNotModified { 3898 if res.Body != nil { 3899 res.Body.Close() 3900 } 3901 return nil, gensupport.WrapError(&googleapi.Error{ 3902 Code: res.StatusCode, 3903 Header: res.Header, 3904 }) 3905 } 3906 if err != nil { 3907 return nil, err 3908 } 3909 defer googleapi.CloseBody(res) 3910 if err := googleapi.CheckResponse(res); err != nil { 3911 return nil, gensupport.WrapError(err) 3912 } 3913 ret := &GenerateCampaignReportResponse{ 3914 ServerResponse: googleapi.ServerResponse{ 3915 Header: res.Header, 3916 HTTPStatusCode: res.StatusCode, 3917 }, 3918 } 3919 target := &ret 3920 if err := gensupport.DecodeResponse(target, res); err != nil { 3921 return nil, err 3922 } 3923 return ret, nil 3924 } 3925 3926 type AccountsMediationGroupsCreateCall struct { 3927 s *Service 3928 parent string 3929 mediationgroup *MediationGroup 3930 urlParams_ gensupport.URLParams 3931 ctx_ context.Context 3932 header_ http.Header 3933 } 3934 3935 // Create: Create a mediation group under the specific AdMob account. This 3936 // method has limited access. If you see a 403 permission denied error, please 3937 // reach out to your account manager for access. 3938 // 3939 // - parent: The parent which owns the mediation group. Format: 3940 // accounts/{publisher_id}. 3941 func (r *AccountsMediationGroupsService) Create(parent string, mediationgroup *MediationGroup) *AccountsMediationGroupsCreateCall { 3942 c := &AccountsMediationGroupsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3943 c.parent = parent 3944 c.mediationgroup = mediationgroup 3945 return c 3946 } 3947 3948 // Fields allows partial responses to be retrieved. See 3949 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3950 // details. 3951 func (c *AccountsMediationGroupsCreateCall) Fields(s ...googleapi.Field) *AccountsMediationGroupsCreateCall { 3952 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3953 return c 3954 } 3955 3956 // Context sets the context to be used in this call's Do method. 3957 func (c *AccountsMediationGroupsCreateCall) Context(ctx context.Context) *AccountsMediationGroupsCreateCall { 3958 c.ctx_ = ctx 3959 return c 3960 } 3961 3962 // Header returns a http.Header that can be modified by the caller to add 3963 // headers to the request. 3964 func (c *AccountsMediationGroupsCreateCall) Header() http.Header { 3965 if c.header_ == nil { 3966 c.header_ = make(http.Header) 3967 } 3968 return c.header_ 3969 } 3970 3971 func (c *AccountsMediationGroupsCreateCall) doRequest(alt string) (*http.Response, error) { 3972 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3973 var body io.Reader = nil 3974 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationgroup) 3975 if err != nil { 3976 return nil, err 3977 } 3978 c.urlParams_.Set("alt", alt) 3979 c.urlParams_.Set("prettyPrint", "false") 3980 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/mediationGroups") 3981 urls += "?" + c.urlParams_.Encode() 3982 req, err := http.NewRequest("POST", urls, body) 3983 if err != nil { 3984 return nil, err 3985 } 3986 req.Header = reqHeaders 3987 googleapi.Expand(req.URL, map[string]string{ 3988 "parent": c.parent, 3989 }) 3990 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3991 } 3992 3993 // Do executes the "admob.accounts.mediationGroups.create" call. 3994 // Any non-2xx status code is an error. Response headers are in either 3995 // *MediationGroup.ServerResponse.Header or (if a response was returned at all) 3996 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3997 // whether the returned error was because http.StatusNotModified was returned. 3998 func (c *AccountsMediationGroupsCreateCall) Do(opts ...googleapi.CallOption) (*MediationGroup, error) { 3999 gensupport.SetOptions(c.urlParams_, opts...) 4000 res, err := c.doRequest("json") 4001 if res != nil && res.StatusCode == http.StatusNotModified { 4002 if res.Body != nil { 4003 res.Body.Close() 4004 } 4005 return nil, gensupport.WrapError(&googleapi.Error{ 4006 Code: res.StatusCode, 4007 Header: res.Header, 4008 }) 4009 } 4010 if err != nil { 4011 return nil, err 4012 } 4013 defer googleapi.CloseBody(res) 4014 if err := googleapi.CheckResponse(res); err != nil { 4015 return nil, gensupport.WrapError(err) 4016 } 4017 ret := &MediationGroup{ 4018 ServerResponse: googleapi.ServerResponse{ 4019 Header: res.Header, 4020 HTTPStatusCode: res.StatusCode, 4021 }, 4022 } 4023 target := &ret 4024 if err := gensupport.DecodeResponse(target, res); err != nil { 4025 return nil, err 4026 } 4027 return ret, nil 4028 } 4029 4030 type AccountsMediationGroupsListCall struct { 4031 s *Service 4032 parent string 4033 urlParams_ gensupport.URLParams 4034 ifNoneMatch_ string 4035 ctx_ context.Context 4036 header_ http.Header 4037 } 4038 4039 // List: List mediation groups under the specified AdMob account. This method 4040 // has limited access. If you see a 403 permission denied error, please reach 4041 // out to your account manager for access. 4042 // 4043 // - parent: Resource name of the account to list mediation groups for. 4044 // Example: accounts/pub-9876543210987654. 4045 func (r *AccountsMediationGroupsService) List(parent string) *AccountsMediationGroupsListCall { 4046 c := &AccountsMediationGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4047 c.parent = parent 4048 return c 4049 } 4050 4051 // Filter sets the optional parameter "filter": The filter string that uses 4052 // EBNF grammar syntax (https://google.aip.dev/assets/misc/ebnf-filtering.txt). 4053 // Possible fields to filter by are: - "AD_SOURCE_IDS" - "AD_UNIT_IDS" - 4054 // "APP_IDS" - "DISPLAY_NAME" - "FORMAT" - "MEDIATION_GROUP_ID" - "PLATFORM" - 4055 // "STATE" - "TARGETED_REGION_CODES" Possible filter functions are: - `IN`: 4056 // Used to filter fields that represent a singleton including 4057 // "MEDIATION_GROUP_ID", "DISPLAY_NAME", "STATE", "PLATFORM", and "FORMAT". - 4058 // `CONTAINS_ANY`: Used to filter fields that represent a collection including 4059 // "AD_SOURCE_IDS", "AD_UNIT_IDS", "APP_IDS", and "TARGETED_REGION_CODES". The 4060 // filter functions can be added together using `AND`. `OR` functionality is 4061 // not supported. Example: filter: IN(DISPLAY_NAME, "Test Group 1", "Test Group 4062 // 2") AND IN(PLATFORM, "ANDROID") AND CONTAINS_ANY(AD_SOURCE_IDS, 4063 // "5450213213286189855") 4064 func (c *AccountsMediationGroupsListCall) Filter(filter string) *AccountsMediationGroupsListCall { 4065 c.urlParams_.Set("filter", filter) 4066 return c 4067 } 4068 4069 // PageSize sets the optional parameter "pageSize": The maximum number of 4070 // mediation groups to return. If unspecified or 0, at most 10,000 mediation 4071 // groups will be returned. The maximum value is 20,000; values above 20,000 4072 // will be coerced to 20,000. 4073 func (c *AccountsMediationGroupsListCall) PageSize(pageSize int64) *AccountsMediationGroupsListCall { 4074 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4075 return c 4076 } 4077 4078 // PageToken sets the optional parameter "pageToken": The value returned by the 4079 // last `ListMediationGroupsResponse`; indicates that this is a continuation of 4080 // a prior `ListMediationGroups` call, and that the system should return the 4081 // next page of data. 4082 func (c *AccountsMediationGroupsListCall) PageToken(pageToken string) *AccountsMediationGroupsListCall { 4083 c.urlParams_.Set("pageToken", pageToken) 4084 return c 4085 } 4086 4087 // Fields allows partial responses to be retrieved. See 4088 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4089 // details. 4090 func (c *AccountsMediationGroupsListCall) Fields(s ...googleapi.Field) *AccountsMediationGroupsListCall { 4091 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4092 return c 4093 } 4094 4095 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4096 // object's ETag matches the given value. This is useful for getting updates 4097 // only after the object has changed since the last request. 4098 func (c *AccountsMediationGroupsListCall) IfNoneMatch(entityTag string) *AccountsMediationGroupsListCall { 4099 c.ifNoneMatch_ = entityTag 4100 return c 4101 } 4102 4103 // Context sets the context to be used in this call's Do method. 4104 func (c *AccountsMediationGroupsListCall) Context(ctx context.Context) *AccountsMediationGroupsListCall { 4105 c.ctx_ = ctx 4106 return c 4107 } 4108 4109 // Header returns a http.Header that can be modified by the caller to add 4110 // headers to the request. 4111 func (c *AccountsMediationGroupsListCall) Header() http.Header { 4112 if c.header_ == nil { 4113 c.header_ = make(http.Header) 4114 } 4115 return c.header_ 4116 } 4117 4118 func (c *AccountsMediationGroupsListCall) doRequest(alt string) (*http.Response, error) { 4119 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4120 if c.ifNoneMatch_ != "" { 4121 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4122 } 4123 var body io.Reader = nil 4124 c.urlParams_.Set("alt", alt) 4125 c.urlParams_.Set("prettyPrint", "false") 4126 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/mediationGroups") 4127 urls += "?" + c.urlParams_.Encode() 4128 req, err := http.NewRequest("GET", urls, body) 4129 if err != nil { 4130 return nil, err 4131 } 4132 req.Header = reqHeaders 4133 googleapi.Expand(req.URL, map[string]string{ 4134 "parent": c.parent, 4135 }) 4136 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4137 } 4138 4139 // Do executes the "admob.accounts.mediationGroups.list" call. 4140 // Any non-2xx status code is an error. Response headers are in either 4141 // *ListMediationGroupsResponse.ServerResponse.Header or (if a response was 4142 // returned at all) in error.(*googleapi.Error).Header. Use 4143 // googleapi.IsNotModified to check whether the returned error was because 4144 // http.StatusNotModified was returned. 4145 func (c *AccountsMediationGroupsListCall) Do(opts ...googleapi.CallOption) (*ListMediationGroupsResponse, error) { 4146 gensupport.SetOptions(c.urlParams_, opts...) 4147 res, err := c.doRequest("json") 4148 if res != nil && res.StatusCode == http.StatusNotModified { 4149 if res.Body != nil { 4150 res.Body.Close() 4151 } 4152 return nil, gensupport.WrapError(&googleapi.Error{ 4153 Code: res.StatusCode, 4154 Header: res.Header, 4155 }) 4156 } 4157 if err != nil { 4158 return nil, err 4159 } 4160 defer googleapi.CloseBody(res) 4161 if err := googleapi.CheckResponse(res); err != nil { 4162 return nil, gensupport.WrapError(err) 4163 } 4164 ret := &ListMediationGroupsResponse{ 4165 ServerResponse: googleapi.ServerResponse{ 4166 Header: res.Header, 4167 HTTPStatusCode: res.StatusCode, 4168 }, 4169 } 4170 target := &ret 4171 if err := gensupport.DecodeResponse(target, res); err != nil { 4172 return nil, err 4173 } 4174 return ret, nil 4175 } 4176 4177 // Pages invokes f for each page of results. 4178 // A non-nil error returned from f will halt the iteration. 4179 // The provided context supersedes any context provided to the Context method. 4180 func (c *AccountsMediationGroupsListCall) Pages(ctx context.Context, f func(*ListMediationGroupsResponse) error) error { 4181 c.ctx_ = ctx 4182 defer c.PageToken(c.urlParams_.Get("pageToken")) 4183 for { 4184 x, err := c.Do() 4185 if err != nil { 4186 return err 4187 } 4188 if err := f(x); err != nil { 4189 return err 4190 } 4191 if x.NextPageToken == "" { 4192 return nil 4193 } 4194 c.PageToken(x.NextPageToken) 4195 } 4196 } 4197 4198 type AccountsMediationGroupsPatchCall struct { 4199 s *Service 4200 name string 4201 mediationgroup *MediationGroup 4202 urlParams_ gensupport.URLParams 4203 ctx_ context.Context 4204 header_ http.Header 4205 } 4206 4207 // Patch: Update the specified mediation group under the specified AdMob 4208 // account. This method has limited access. If you see a 403 permission denied 4209 // error, please reach out to your account manager for access. 4210 // 4211 // - name: Resource name for this mediation group. Format is: 4212 // accounts/{publisher_id}/mediationGroups/{mediation_group_id} Example: 4213 // accounts/pub-9876543210987654/mediationGroups/0123456789. 4214 func (r *AccountsMediationGroupsService) Patch(name string, mediationgroup *MediationGroup) *AccountsMediationGroupsPatchCall { 4215 c := &AccountsMediationGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4216 c.name = name 4217 c.mediationgroup = mediationgroup 4218 return c 4219 } 4220 4221 // UpdateMask sets the optional parameter "updateMask": List of mediation group 4222 // fields to be updated. Updates to repeated fields such as items in a list 4223 // will fully replace the existing value(s) with the new value(s). Updates to 4224 // individual values in a map can be done by indexing by the key. The following 4225 // field masks are supported for mediation group updates: - 4226 // "mediation_group_lines[\"{mediation_group_line_id}\"]" clang-format off - 4227 // "mediation_group_lines[\"{mediation_group_line_id}\"].ad_unit_mappings[\"{ad_ 4228 // unit_id}\"]" clang-format on - 4229 // "mediation_group_lines[\"{mediation_group_line_id}\"].cpm_micros" - 4230 // "mediation_group_lines[\"{mediation_group_line_id}\"].cpm_mode" - 4231 // "mediation_group_lines[\"{mediation_group_line_id}\"].state" - 4232 // "mediation_group_lines[\"{mediation_group_line_id}\"].display_name" - 4233 // "targeting.ad_unit_ids" To update a mediation group with a new mediation 4234 // group line, use a distinct negative number for the 4235 // "mediation_group_line_id". For Example: update_mask { paths: 4236 // "mediation_group_lines[\"123456789012345\"].cpm_micros" } 4237 func (c *AccountsMediationGroupsPatchCall) UpdateMask(updateMask string) *AccountsMediationGroupsPatchCall { 4238 c.urlParams_.Set("updateMask", updateMask) 4239 return c 4240 } 4241 4242 // Fields allows partial responses to be retrieved. See 4243 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4244 // details. 4245 func (c *AccountsMediationGroupsPatchCall) Fields(s ...googleapi.Field) *AccountsMediationGroupsPatchCall { 4246 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4247 return c 4248 } 4249 4250 // Context sets the context to be used in this call's Do method. 4251 func (c *AccountsMediationGroupsPatchCall) Context(ctx context.Context) *AccountsMediationGroupsPatchCall { 4252 c.ctx_ = ctx 4253 return c 4254 } 4255 4256 // Header returns a http.Header that can be modified by the caller to add 4257 // headers to the request. 4258 func (c *AccountsMediationGroupsPatchCall) Header() http.Header { 4259 if c.header_ == nil { 4260 c.header_ = make(http.Header) 4261 } 4262 return c.header_ 4263 } 4264 4265 func (c *AccountsMediationGroupsPatchCall) doRequest(alt string) (*http.Response, error) { 4266 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4267 var body io.Reader = nil 4268 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationgroup) 4269 if err != nil { 4270 return nil, err 4271 } 4272 c.urlParams_.Set("alt", alt) 4273 c.urlParams_.Set("prettyPrint", "false") 4274 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}") 4275 urls += "?" + c.urlParams_.Encode() 4276 req, err := http.NewRequest("PATCH", urls, body) 4277 if err != nil { 4278 return nil, err 4279 } 4280 req.Header = reqHeaders 4281 googleapi.Expand(req.URL, map[string]string{ 4282 "name": c.name, 4283 }) 4284 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4285 } 4286 4287 // Do executes the "admob.accounts.mediationGroups.patch" call. 4288 // Any non-2xx status code is an error. Response headers are in either 4289 // *MediationGroup.ServerResponse.Header or (if a response was returned at all) 4290 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4291 // whether the returned error was because http.StatusNotModified was returned. 4292 func (c *AccountsMediationGroupsPatchCall) Do(opts ...googleapi.CallOption) (*MediationGroup, error) { 4293 gensupport.SetOptions(c.urlParams_, opts...) 4294 res, err := c.doRequest("json") 4295 if res != nil && res.StatusCode == http.StatusNotModified { 4296 if res.Body != nil { 4297 res.Body.Close() 4298 } 4299 return nil, gensupport.WrapError(&googleapi.Error{ 4300 Code: res.StatusCode, 4301 Header: res.Header, 4302 }) 4303 } 4304 if err != nil { 4305 return nil, err 4306 } 4307 defer googleapi.CloseBody(res) 4308 if err := googleapi.CheckResponse(res); err != nil { 4309 return nil, gensupport.WrapError(err) 4310 } 4311 ret := &MediationGroup{ 4312 ServerResponse: googleapi.ServerResponse{ 4313 Header: res.Header, 4314 HTTPStatusCode: res.StatusCode, 4315 }, 4316 } 4317 target := &ret 4318 if err := gensupport.DecodeResponse(target, res); err != nil { 4319 return nil, err 4320 } 4321 return ret, nil 4322 } 4323 4324 type AccountsMediationGroupsMediationAbExperimentsCreateCall struct { 4325 s *Service 4326 parent string 4327 mediationabexperiment *MediationAbExperiment 4328 urlParams_ gensupport.URLParams 4329 ctx_ context.Context 4330 header_ http.Header 4331 } 4332 4333 // Create: Create an A/B testing experiment for a specified AdMob account and a 4334 // mediation group. This method has limited access. If you see a 403 permission 4335 // denied error, please reach out to your account manager for access. 4336 // 4337 // - parent: The parent which owns the mediation group. Format: 4338 // accounts/{publisher_id}/mediationGroups/{mediation_group_id}. 4339 func (r *AccountsMediationGroupsMediationAbExperimentsService) Create(parent string, mediationabexperiment *MediationAbExperiment) *AccountsMediationGroupsMediationAbExperimentsCreateCall { 4340 c := &AccountsMediationGroupsMediationAbExperimentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4341 c.parent = parent 4342 c.mediationabexperiment = mediationabexperiment 4343 return c 4344 } 4345 4346 // Fields allows partial responses to be retrieved. See 4347 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4348 // details. 4349 func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) Fields(s ...googleapi.Field) *AccountsMediationGroupsMediationAbExperimentsCreateCall { 4350 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4351 return c 4352 } 4353 4354 // Context sets the context to be used in this call's Do method. 4355 func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) Context(ctx context.Context) *AccountsMediationGroupsMediationAbExperimentsCreateCall { 4356 c.ctx_ = ctx 4357 return c 4358 } 4359 4360 // Header returns a http.Header that can be modified by the caller to add 4361 // headers to the request. 4362 func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) Header() http.Header { 4363 if c.header_ == nil { 4364 c.header_ = make(http.Header) 4365 } 4366 return c.header_ 4367 } 4368 4369 func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) doRequest(alt string) (*http.Response, error) { 4370 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4371 var body io.Reader = nil 4372 body, err := googleapi.WithoutDataWrapper.JSONReader(c.mediationabexperiment) 4373 if err != nil { 4374 return nil, err 4375 } 4376 c.urlParams_.Set("alt", alt) 4377 c.urlParams_.Set("prettyPrint", "false") 4378 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/mediationAbExperiments") 4379 urls += "?" + c.urlParams_.Encode() 4380 req, err := http.NewRequest("POST", urls, body) 4381 if err != nil { 4382 return nil, err 4383 } 4384 req.Header = reqHeaders 4385 googleapi.Expand(req.URL, map[string]string{ 4386 "parent": c.parent, 4387 }) 4388 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4389 } 4390 4391 // Do executes the "admob.accounts.mediationGroups.mediationAbExperiments.create" call. 4392 // Any non-2xx status code is an error. Response headers are in either 4393 // *MediationAbExperiment.ServerResponse.Header or (if a response was returned 4394 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4395 // check whether the returned error was because http.StatusNotModified was 4396 // returned. 4397 func (c *AccountsMediationGroupsMediationAbExperimentsCreateCall) Do(opts ...googleapi.CallOption) (*MediationAbExperiment, error) { 4398 gensupport.SetOptions(c.urlParams_, opts...) 4399 res, err := c.doRequest("json") 4400 if res != nil && res.StatusCode == http.StatusNotModified { 4401 if res.Body != nil { 4402 res.Body.Close() 4403 } 4404 return nil, gensupport.WrapError(&googleapi.Error{ 4405 Code: res.StatusCode, 4406 Header: res.Header, 4407 }) 4408 } 4409 if err != nil { 4410 return nil, err 4411 } 4412 defer googleapi.CloseBody(res) 4413 if err := googleapi.CheckResponse(res); err != nil { 4414 return nil, gensupport.WrapError(err) 4415 } 4416 ret := &MediationAbExperiment{ 4417 ServerResponse: googleapi.ServerResponse{ 4418 Header: res.Header, 4419 HTTPStatusCode: res.StatusCode, 4420 }, 4421 } 4422 target := &ret 4423 if err := gensupport.DecodeResponse(target, res); err != nil { 4424 return nil, err 4425 } 4426 return ret, nil 4427 } 4428 4429 type AccountsMediationGroupsMediationAbExperimentsStopCall struct { 4430 s *Service 4431 name string 4432 stopmediationabexperimentrequest *StopMediationAbExperimentRequest 4433 urlParams_ gensupport.URLParams 4434 ctx_ context.Context 4435 header_ http.Header 4436 } 4437 4438 // Stop: Stop the mediation A/B experiment and choose a variant. This method 4439 // has limited access. If you see a 403 permission denied error, please reach 4440 // out to your account manager for access. 4441 // 4442 // - name: Name of the mediation group, the experiment for which to choose a 4443 // variant for. Example: 4444 // accounts/pub-9876543210987654/mediationGroups/0123456789/ 4445 // mediationAbExperiments. 4446 func (r *AccountsMediationGroupsMediationAbExperimentsService) Stop(name string, stopmediationabexperimentrequest *StopMediationAbExperimentRequest) *AccountsMediationGroupsMediationAbExperimentsStopCall { 4447 c := &AccountsMediationGroupsMediationAbExperimentsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4448 c.name = name 4449 c.stopmediationabexperimentrequest = stopmediationabexperimentrequest 4450 return c 4451 } 4452 4453 // Fields allows partial responses to be retrieved. See 4454 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4455 // details. 4456 func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) Fields(s ...googleapi.Field) *AccountsMediationGroupsMediationAbExperimentsStopCall { 4457 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4458 return c 4459 } 4460 4461 // Context sets the context to be used in this call's Do method. 4462 func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) Context(ctx context.Context) *AccountsMediationGroupsMediationAbExperimentsStopCall { 4463 c.ctx_ = ctx 4464 return c 4465 } 4466 4467 // Header returns a http.Header that can be modified by the caller to add 4468 // headers to the request. 4469 func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) Header() http.Header { 4470 if c.header_ == nil { 4471 c.header_ = make(http.Header) 4472 } 4473 return c.header_ 4474 } 4475 4476 func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) doRequest(alt string) (*http.Response, error) { 4477 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4478 var body io.Reader = nil 4479 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopmediationabexperimentrequest) 4480 if err != nil { 4481 return nil, err 4482 } 4483 c.urlParams_.Set("alt", alt) 4484 c.urlParams_.Set("prettyPrint", "false") 4485 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}:stop") 4486 urls += "?" + c.urlParams_.Encode() 4487 req, err := http.NewRequest("POST", urls, body) 4488 if err != nil { 4489 return nil, err 4490 } 4491 req.Header = reqHeaders 4492 googleapi.Expand(req.URL, map[string]string{ 4493 "name": c.name, 4494 }) 4495 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4496 } 4497 4498 // Do executes the "admob.accounts.mediationGroups.mediationAbExperiments.stop" call. 4499 // Any non-2xx status code is an error. Response headers are in either 4500 // *MediationAbExperiment.ServerResponse.Header or (if a response was returned 4501 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4502 // check whether the returned error was because http.StatusNotModified was 4503 // returned. 4504 func (c *AccountsMediationGroupsMediationAbExperimentsStopCall) Do(opts ...googleapi.CallOption) (*MediationAbExperiment, error) { 4505 gensupport.SetOptions(c.urlParams_, opts...) 4506 res, err := c.doRequest("json") 4507 if res != nil && res.StatusCode == http.StatusNotModified { 4508 if res.Body != nil { 4509 res.Body.Close() 4510 } 4511 return nil, gensupport.WrapError(&googleapi.Error{ 4512 Code: res.StatusCode, 4513 Header: res.Header, 4514 }) 4515 } 4516 if err != nil { 4517 return nil, err 4518 } 4519 defer googleapi.CloseBody(res) 4520 if err := googleapi.CheckResponse(res); err != nil { 4521 return nil, gensupport.WrapError(err) 4522 } 4523 ret := &MediationAbExperiment{ 4524 ServerResponse: googleapi.ServerResponse{ 4525 Header: res.Header, 4526 HTTPStatusCode: res.StatusCode, 4527 }, 4528 } 4529 target := &ret 4530 if err := gensupport.DecodeResponse(target, res); err != nil { 4531 return nil, err 4532 } 4533 return ret, nil 4534 } 4535 4536 type AccountsMediationReportGenerateCall struct { 4537 s *Service 4538 parent string 4539 generatemediationreportrequest *GenerateMediationReportRequest 4540 urlParams_ gensupport.URLParams 4541 ctx_ context.Context 4542 header_ http.Header 4543 } 4544 4545 // Generate: Generates an AdMob Mediation report based on the provided report 4546 // specification. Returns result of a server-side streaming RPC. The result is 4547 // returned in a sequence of responses. 4548 // 4549 // - parent: Resource name of the account to generate the report for. Example: 4550 // accounts/pub-9876543210987654. 4551 func (r *AccountsMediationReportService) Generate(parent string, generatemediationreportrequest *GenerateMediationReportRequest) *AccountsMediationReportGenerateCall { 4552 c := &AccountsMediationReportGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4553 c.parent = parent 4554 c.generatemediationreportrequest = generatemediationreportrequest 4555 return c 4556 } 4557 4558 // Fields allows partial responses to be retrieved. See 4559 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4560 // details. 4561 func (c *AccountsMediationReportGenerateCall) Fields(s ...googleapi.Field) *AccountsMediationReportGenerateCall { 4562 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4563 return c 4564 } 4565 4566 // Context sets the context to be used in this call's Do method. 4567 func (c *AccountsMediationReportGenerateCall) Context(ctx context.Context) *AccountsMediationReportGenerateCall { 4568 c.ctx_ = ctx 4569 return c 4570 } 4571 4572 // Header returns a http.Header that can be modified by the caller to add 4573 // headers to the request. 4574 func (c *AccountsMediationReportGenerateCall) Header() http.Header { 4575 if c.header_ == nil { 4576 c.header_ = make(http.Header) 4577 } 4578 return c.header_ 4579 } 4580 4581 func (c *AccountsMediationReportGenerateCall) doRequest(alt string) (*http.Response, error) { 4582 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4583 var body io.Reader = nil 4584 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatemediationreportrequest) 4585 if err != nil { 4586 return nil, err 4587 } 4588 c.urlParams_.Set("alt", alt) 4589 c.urlParams_.Set("prettyPrint", "false") 4590 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/mediationReport:generate") 4591 urls += "?" + c.urlParams_.Encode() 4592 req, err := http.NewRequest("POST", urls, body) 4593 if err != nil { 4594 return nil, err 4595 } 4596 req.Header = reqHeaders 4597 googleapi.Expand(req.URL, map[string]string{ 4598 "parent": c.parent, 4599 }) 4600 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4601 } 4602 4603 // Do executes the "admob.accounts.mediationReport.generate" call. 4604 // Any non-2xx status code is an error. Response headers are in either 4605 // *GenerateMediationReportResponse.ServerResponse.Header or (if a response was 4606 // returned at all) in error.(*googleapi.Error).Header. Use 4607 // googleapi.IsNotModified to check whether the returned error was because 4608 // http.StatusNotModified was returned. 4609 func (c *AccountsMediationReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateMediationReportResponse, error) { 4610 gensupport.SetOptions(c.urlParams_, opts...) 4611 res, err := c.doRequest("json") 4612 if res != nil && res.StatusCode == http.StatusNotModified { 4613 if res.Body != nil { 4614 res.Body.Close() 4615 } 4616 return nil, gensupport.WrapError(&googleapi.Error{ 4617 Code: res.StatusCode, 4618 Header: res.Header, 4619 }) 4620 } 4621 if err != nil { 4622 return nil, err 4623 } 4624 defer googleapi.CloseBody(res) 4625 if err := googleapi.CheckResponse(res); err != nil { 4626 return nil, gensupport.WrapError(err) 4627 } 4628 ret := &GenerateMediationReportResponse{ 4629 ServerResponse: googleapi.ServerResponse{ 4630 Header: res.Header, 4631 HTTPStatusCode: res.StatusCode, 4632 }, 4633 } 4634 target := &ret 4635 if err := gensupport.DecodeResponse(target, res); err != nil { 4636 return nil, err 4637 } 4638 return ret, nil 4639 } 4640 4641 type AccountsNetworkReportGenerateCall struct { 4642 s *Service 4643 parent string 4644 generatenetworkreportrequest *GenerateNetworkReportRequest 4645 urlParams_ gensupport.URLParams 4646 ctx_ context.Context 4647 header_ http.Header 4648 } 4649 4650 // Generate: Generates an AdMob Network report based on the provided report 4651 // specification. Returns result of a server-side streaming RPC. The result is 4652 // returned in a sequence of responses. 4653 // 4654 // - parent: Resource name of the account to generate the report for. Example: 4655 // accounts/pub-9876543210987654. 4656 func (r *AccountsNetworkReportService) Generate(parent string, generatenetworkreportrequest *GenerateNetworkReportRequest) *AccountsNetworkReportGenerateCall { 4657 c := &AccountsNetworkReportGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4658 c.parent = parent 4659 c.generatenetworkreportrequest = generatenetworkreportrequest 4660 return c 4661 } 4662 4663 // Fields allows partial responses to be retrieved. See 4664 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4665 // details. 4666 func (c *AccountsNetworkReportGenerateCall) Fields(s ...googleapi.Field) *AccountsNetworkReportGenerateCall { 4667 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4668 return c 4669 } 4670 4671 // Context sets the context to be used in this call's Do method. 4672 func (c *AccountsNetworkReportGenerateCall) Context(ctx context.Context) *AccountsNetworkReportGenerateCall { 4673 c.ctx_ = ctx 4674 return c 4675 } 4676 4677 // Header returns a http.Header that can be modified by the caller to add 4678 // headers to the request. 4679 func (c *AccountsNetworkReportGenerateCall) Header() http.Header { 4680 if c.header_ == nil { 4681 c.header_ = make(http.Header) 4682 } 4683 return c.header_ 4684 } 4685 4686 func (c *AccountsNetworkReportGenerateCall) doRequest(alt string) (*http.Response, error) { 4687 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4688 var body io.Reader = nil 4689 body, err := googleapi.WithoutDataWrapper.JSONReader(c.generatenetworkreportrequest) 4690 if err != nil { 4691 return nil, err 4692 } 4693 c.urlParams_.Set("alt", alt) 4694 c.urlParams_.Set("prettyPrint", "false") 4695 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/networkReport:generate") 4696 urls += "?" + c.urlParams_.Encode() 4697 req, err := http.NewRequest("POST", urls, body) 4698 if err != nil { 4699 return nil, err 4700 } 4701 req.Header = reqHeaders 4702 googleapi.Expand(req.URL, map[string]string{ 4703 "parent": c.parent, 4704 }) 4705 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4706 } 4707 4708 // Do executes the "admob.accounts.networkReport.generate" call. 4709 // Any non-2xx status code is an error. Response headers are in either 4710 // *GenerateNetworkReportResponse.ServerResponse.Header or (if a response was 4711 // returned at all) in error.(*googleapi.Error).Header. Use 4712 // googleapi.IsNotModified to check whether the returned error was because 4713 // http.StatusNotModified was returned. 4714 func (c *AccountsNetworkReportGenerateCall) Do(opts ...googleapi.CallOption) (*GenerateNetworkReportResponse, error) { 4715 gensupport.SetOptions(c.urlParams_, opts...) 4716 res, err := c.doRequest("json") 4717 if res != nil && res.StatusCode == http.StatusNotModified { 4718 if res.Body != nil { 4719 res.Body.Close() 4720 } 4721 return nil, gensupport.WrapError(&googleapi.Error{ 4722 Code: res.StatusCode, 4723 Header: res.Header, 4724 }) 4725 } 4726 if err != nil { 4727 return nil, err 4728 } 4729 defer googleapi.CloseBody(res) 4730 if err := googleapi.CheckResponse(res); err != nil { 4731 return nil, gensupport.WrapError(err) 4732 } 4733 ret := &GenerateNetworkReportResponse{ 4734 ServerResponse: googleapi.ServerResponse{ 4735 Header: res.Header, 4736 HTTPStatusCode: res.StatusCode, 4737 }, 4738 } 4739 target := &ret 4740 if err := gensupport.DecodeResponse(target, res); err != nil { 4741 return nil, err 4742 } 4743 return ret, nil 4744 } 4745