1// Copyright 2020 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 doubleclicksearch provides access to the Search Ads 360 API. 8// 9// For product documentation, see: https://developers.google.com/search-ads 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/doubleclicksearch/v2" 16// ... 17// ctx := context.Background() 18// doubleclicksearchService, err := doubleclicksearch.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// doubleclicksearchService, err := doubleclicksearch.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// doubleclicksearchService, err := doubleclicksearch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package doubleclicksearch // import "google.golang.org/api/doubleclicksearch/v2" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "doubleclicksearch:v2" 75const apiName = "doubleclicksearch" 76const apiVersion = "v2" 77const basePath = "https://doubleclicksearch.googleapis.com/" 78const mtlsBasePath = "https://doubleclicksearch.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // View and manage your advertising data in DoubleClick Search 83 DoubleclicksearchScope = "https://www.googleapis.com/auth/doubleclicksearch" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/doubleclicksearch", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Conversion = NewConversionService(s) 120 s.Reports = NewReportsService(s) 121 s.SavedColumns = NewSavedColumnsService(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Conversion *ConversionService 131 132 Reports *ReportsService 133 134 SavedColumns *SavedColumnsService 135} 136 137func (s *Service) userAgent() string { 138 if s.UserAgent == "" { 139 return googleapi.UserAgent 140 } 141 return googleapi.UserAgent + " " + s.UserAgent 142} 143 144func NewConversionService(s *Service) *ConversionService { 145 rs := &ConversionService{s: s} 146 return rs 147} 148 149type ConversionService struct { 150 s *Service 151} 152 153func NewReportsService(s *Service) *ReportsService { 154 rs := &ReportsService{s: s} 155 return rs 156} 157 158type ReportsService struct { 159 s *Service 160} 161 162func NewSavedColumnsService(s *Service) *SavedColumnsService { 163 rs := &SavedColumnsService{s: s} 164 return rs 165} 166 167type SavedColumnsService struct { 168 s *Service 169} 170 171// Availability: A message containing availability data relevant to 172// DoubleClick Search. 173type Availability struct { 174 // AdvertiserId: DS advertiser ID. 175 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 176 177 // AgencyId: DS agency ID. 178 AgencyId int64 `json:"agencyId,omitempty,string"` 179 180 // AvailabilityTimestamp: The time by which all conversions have been 181 // uploaded, in epoch millis UTC. 182 AvailabilityTimestamp int64 `json:"availabilityTimestamp,omitempty,string"` 183 184 // SegmentationId: The numeric segmentation identifier (for example, 185 // DoubleClick Search Floodlight activity ID). 186 SegmentationId int64 `json:"segmentationId,omitempty,string"` 187 188 // SegmentationName: The friendly segmentation identifier (for example, 189 // DoubleClick Search Floodlight activity name). 190 SegmentationName string `json:"segmentationName,omitempty"` 191 192 // SegmentationType: The segmentation type that this availability is for 193 // (its default value is `FLOODLIGHT`). 194 SegmentationType string `json:"segmentationType,omitempty"` 195 196 // ForceSendFields is a list of field names (e.g. "AdvertiserId") to 197 // unconditionally include in API requests. By default, fields with 198 // empty values are omitted from API requests. However, any non-pointer, 199 // non-interface field appearing in ForceSendFields will be sent to the 200 // server regardless of whether the field is empty or not. This may be 201 // used to include empty fields in Patch requests. 202 ForceSendFields []string `json:"-"` 203 204 // NullFields is a list of field names (e.g. "AdvertiserId") to include 205 // in API requests with the JSON null value. By default, fields with 206 // empty values are omitted from API requests. However, any field with 207 // an empty value appearing in NullFields will be sent to the server as 208 // null. It is an error if a field in this list has a non-empty value. 209 // This may be used to include null fields in Patch requests. 210 NullFields []string `json:"-"` 211} 212 213func (s *Availability) MarshalJSON() ([]byte, error) { 214 type NoMethod Availability 215 raw := NoMethod(*s) 216 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 217} 218 219// Conversion: A conversion containing data relevant to DoubleClick 220// Search. 221type Conversion struct { 222 // AdGroupId: DS ad group ID. 223 AdGroupId int64 `json:"adGroupId,omitempty,string"` 224 225 // AdId: DS ad ID. 226 AdId int64 `json:"adId,omitempty,string"` 227 228 // AdvertiserId: DS advertiser ID. 229 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 230 231 // AgencyId: DS agency ID. 232 AgencyId int64 `json:"agencyId,omitempty,string"` 233 234 // AttributionModel: Available to advertisers only after contacting 235 // DoubleClick Search customer support. 236 AttributionModel string `json:"attributionModel,omitempty"` 237 238 // CampaignId: DS campaign ID. 239 CampaignId int64 `json:"campaignId,omitempty,string"` 240 241 // Channel: Sales channel for the product. Acceptable values are: - 242 // "local": a physical store - "online": an online store 243 Channel string `json:"channel,omitempty"` 244 245 // ClickId: DS click ID for the conversion. 246 ClickId string `json:"clickId,omitempty"` 247 248 // ConversionId: For offline conversions, advertisers provide this ID. 249 // Advertisers can specify any ID that is meaningful to them. Each 250 // conversion in a request must specify a unique ID, and the combination 251 // of ID and timestamp must be unique amongst all conversions within the 252 // advertiser. For online conversions, DS copies the `dsConversionId` or 253 // `floodlightOrderId` into this property depending on the advertiser's 254 // Floodlight instructions. 255 ConversionId string `json:"conversionId,omitempty"` 256 257 // ConversionModifiedTimestamp: The time at which the conversion was 258 // last modified, in epoch millis UTC. 259 ConversionModifiedTimestamp int64 `json:"conversionModifiedTimestamp,omitempty,string"` 260 261 // ConversionTimestamp: The time at which the conversion took place, in 262 // epoch millis UTC. 263 ConversionTimestamp string `json:"conversionTimestamp,omitempty"` 264 265 // CountMillis: Available to advertisers only after contacting 266 // DoubleClick Search customer support. 267 CountMillis int64 `json:"countMillis,omitempty,string"` 268 269 // CriterionId: DS criterion (keyword) ID. 270 CriterionId int64 `json:"criterionId,omitempty,string"` 271 272 // CurrencyCode: The currency code for the conversion's revenue. Should 273 // be in ISO 4217 alphabetic (3-char) format. 274 CurrencyCode string `json:"currencyCode,omitempty"` 275 276 // CustomDimension: Custom dimensions for the conversion, which can be 277 // used to filter data in a report. 278 CustomDimension []*CustomDimension `json:"customDimension,omitempty"` 279 280 // CustomMetric: Custom metrics for the conversion. 281 CustomMetric []*CustomMetric `json:"customMetric,omitempty"` 282 283 // DeviceType: The type of device on which the conversion occurred. 284 DeviceType string `json:"deviceType,omitempty"` 285 286 // DsConversionId: ID that DoubleClick Search generates for each 287 // conversion. 288 DsConversionId int64 `json:"dsConversionId,omitempty,string"` 289 290 // EngineAccountId: DS engine account ID. 291 EngineAccountId int64 `json:"engineAccountId,omitempty,string"` 292 293 // FloodlightOrderId: The Floodlight order ID provided by the advertiser 294 // for the conversion. 295 FloodlightOrderId string `json:"floodlightOrderId,omitempty"` 296 297 // InventoryAccountId: ID that DS generates and uses to uniquely 298 // identify the inventory account that contains the product. 299 InventoryAccountId int64 `json:"inventoryAccountId,omitempty,string"` 300 301 // ProductCountry: The country registered for the Merchant Center feed 302 // that contains the product. Use an ISO 3166 code to specify a country. 303 ProductCountry string `json:"productCountry,omitempty"` 304 305 // ProductGroupId: DS product group ID. 306 ProductGroupId int64 `json:"productGroupId,omitempty,string"` 307 308 // ProductId: The product ID (SKU). 309 ProductId string `json:"productId,omitempty"` 310 311 // ProductLanguage: The language registered for the Merchant Center feed 312 // that contains the product. Use an ISO 639 code to specify a language. 313 ProductLanguage string `json:"productLanguage,omitempty"` 314 315 // QuantityMillis: The quantity of this conversion, in millis. 316 QuantityMillis int64 `json:"quantityMillis,omitempty,string"` 317 318 // RevenueMicros: The revenue amount of this `TRANSACTION` conversion, 319 // in micros (value multiplied by 1000000, no decimal). For example, to 320 // specify a revenue value of "10" enter "10000000" (10 million) in your 321 // request. 322 RevenueMicros string `json:"revenueMicros,omitempty"` 323 324 // SegmentationId: The numeric segmentation identifier (for example, 325 // DoubleClick Search Floodlight activity ID). 326 SegmentationId int64 `json:"segmentationId,omitempty,string"` 327 328 // SegmentationName: The friendly segmentation identifier (for example, 329 // DoubleClick Search Floodlight activity name). 330 SegmentationName string `json:"segmentationName,omitempty"` 331 332 // SegmentationType: The segmentation type of this conversion (for 333 // example, `FLOODLIGHT`). 334 SegmentationType string `json:"segmentationType,omitempty"` 335 336 // State: The state of the conversion, that is, either `ACTIVE` or 337 // `REMOVED`. Note: state DELETED is deprecated. 338 State string `json:"state,omitempty"` 339 340 // StoreId: The ID of the local store for which the product was 341 // advertised. Applicable only when the channel is "local". 342 StoreId string `json:"storeId,omitempty"` 343 344 // Type: The type of the conversion, that is, either `ACTION` or 345 // `TRANSACTION`. An `ACTION` conversion is an action by the user that 346 // has no monetarily quantifiable value, while a `TRANSACTION` 347 // conversion is an action that does have a monetarily quantifiable 348 // value. Examples are email list signups (`ACTION`) versus ecommerce 349 // purchases (`TRANSACTION`). 350 Type string `json:"type,omitempty"` 351 352 // ForceSendFields is a list of field names (e.g. "AdGroupId") to 353 // unconditionally include in API requests. By default, fields with 354 // empty values are omitted from API requests. However, any non-pointer, 355 // non-interface field appearing in ForceSendFields will be sent to the 356 // server regardless of whether the field is empty or not. This may be 357 // used to include empty fields in Patch requests. 358 ForceSendFields []string `json:"-"` 359 360 // NullFields is a list of field names (e.g. "AdGroupId") to include in 361 // API requests with the JSON null value. By default, fields with empty 362 // values are omitted from API requests. However, any field with an 363 // empty value appearing in NullFields will be sent to the server as 364 // null. It is an error if a field in this list has a non-empty value. 365 // This may be used to include null fields in Patch requests. 366 NullFields []string `json:"-"` 367} 368 369func (s *Conversion) MarshalJSON() ([]byte, error) { 370 type NoMethod Conversion 371 raw := NoMethod(*s) 372 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 373} 374 375// ConversionList: A list of conversions. 376type ConversionList struct { 377 // Conversion: The conversions being requested. 378 Conversion []*Conversion `json:"conversion,omitempty"` 379 380 // Kind: Identifies this as a ConversionList resource. Value: the fixed 381 // string doubleclicksearch#conversionList. 382 Kind string `json:"kind,omitempty"` 383 384 // ServerResponse contains the HTTP response code and headers from the 385 // server. 386 googleapi.ServerResponse `json:"-"` 387 388 // ForceSendFields is a list of field names (e.g. "Conversion") to 389 // unconditionally include in API requests. By default, fields with 390 // empty values are omitted from API requests. However, any non-pointer, 391 // non-interface field appearing in ForceSendFields will be sent to the 392 // server regardless of whether the field is empty or not. This may be 393 // used to include empty fields in Patch requests. 394 ForceSendFields []string `json:"-"` 395 396 // NullFields is a list of field names (e.g. "Conversion") to include in 397 // API requests with the JSON null value. By default, fields with empty 398 // values are omitted from API requests. However, any field with an 399 // empty value appearing in NullFields will be sent to the server as 400 // null. It is an error if a field in this list has a non-empty value. 401 // This may be used to include null fields in Patch requests. 402 NullFields []string `json:"-"` 403} 404 405func (s *ConversionList) MarshalJSON() ([]byte, error) { 406 type NoMethod ConversionList 407 raw := NoMethod(*s) 408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 409} 410 411// CustomDimension: A message containing the custom dimension. 412type CustomDimension struct { 413 // Name: Custom dimension name. 414 Name string `json:"name,omitempty"` 415 416 // Value: Custom dimension value. 417 Value string `json:"value,omitempty"` 418 419 // ForceSendFields is a list of field names (e.g. "Name") to 420 // unconditionally include in API requests. By default, fields with 421 // empty values are omitted from API requests. However, any non-pointer, 422 // non-interface field appearing in ForceSendFields will be sent to the 423 // server regardless of whether the field is empty or not. This may be 424 // used to include empty fields in Patch requests. 425 ForceSendFields []string `json:"-"` 426 427 // NullFields is a list of field names (e.g. "Name") to include in API 428 // requests with the JSON null value. By default, fields with empty 429 // values are omitted from API requests. However, any field with an 430 // empty value appearing in NullFields will be sent to the server as 431 // null. It is an error if a field in this list has a non-empty value. 432 // This may be used to include null fields in Patch requests. 433 NullFields []string `json:"-"` 434} 435 436func (s *CustomDimension) MarshalJSON() ([]byte, error) { 437 type NoMethod CustomDimension 438 raw := NoMethod(*s) 439 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 440} 441 442// CustomMetric: A message containing the custom metric. 443type CustomMetric struct { 444 // Name: Custom metric name. 445 Name string `json:"name,omitempty"` 446 447 // Value: Custom metric numeric value. 448 Value float64 `json:"value,omitempty"` 449 450 // ForceSendFields is a list of field names (e.g. "Name") to 451 // unconditionally include in API requests. By default, fields with 452 // empty values are omitted from API requests. However, any non-pointer, 453 // non-interface field appearing in ForceSendFields will be sent to the 454 // server regardless of whether the field is empty or not. This may be 455 // used to include empty fields in Patch requests. 456 ForceSendFields []string `json:"-"` 457 458 // NullFields is a list of field names (e.g. "Name") to include in API 459 // requests with the JSON null value. By default, fields with empty 460 // values are omitted from API requests. However, any field with an 461 // empty value appearing in NullFields will be sent to the server as 462 // null. It is an error if a field in this list has a non-empty value. 463 // This may be used to include null fields in Patch requests. 464 NullFields []string `json:"-"` 465} 466 467func (s *CustomMetric) MarshalJSON() ([]byte, error) { 468 type NoMethod CustomMetric 469 raw := NoMethod(*s) 470 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 471} 472 473func (s *CustomMetric) UnmarshalJSON(data []byte) error { 474 type NoMethod CustomMetric 475 var s1 struct { 476 Value gensupport.JSONFloat64 `json:"value"` 477 *NoMethod 478 } 479 s1.NoMethod = (*NoMethod)(s) 480 if err := json.Unmarshal(data, &s1); err != nil { 481 return err 482 } 483 s.Value = float64(s1.Value) 484 return nil 485} 486 487// Report: A DoubleClick Search report. This object contains the report 488// request, some report metadata such as currency code, and the 489// generated report rows or report files. 490type Report struct { 491 // Files: Asynchronous report only. Contains a list of generated report 492 // files once the report has successfully completed. 493 Files []*ReportFiles `json:"files,omitempty"` 494 495 // Id: Asynchronous report only. Id of the report. 496 Id string `json:"id,omitempty"` 497 498 // IsReportReady: Asynchronous report only. True if and only if the 499 // report has completed successfully and the report files are ready to 500 // be downloaded. 501 IsReportReady bool `json:"isReportReady,omitempty"` 502 503 // Kind: Identifies this as a Report resource. Value: the fixed string 504 // `doubleclicksearch#report`. 505 Kind string `json:"kind,omitempty"` 506 507 // Request: The request that created the report. Optional fields not 508 // specified in the original request are filled with default values. 509 Request *ReportRequest `json:"request,omitempty"` 510 511 // RowCount: The number of report rows generated by the report, not 512 // including headers. 513 RowCount int64 `json:"rowCount,omitempty"` 514 515 // Rows: Synchronous report only. Generated report rows. 516 Rows []googleapi.RawMessage `json:"rows,omitempty"` 517 518 // StatisticsCurrencyCode: The currency code of all monetary values 519 // produced in the report, including values that are set by users (e.g., 520 // keyword bid settings) and metrics (e.g., cost and revenue). The 521 // currency code of a report is determined by the `statisticsCurrency` 522 // field of the report request. 523 StatisticsCurrencyCode string `json:"statisticsCurrencyCode,omitempty"` 524 525 // StatisticsTimeZone: If all statistics of the report are sourced from 526 // the same time zone, this would be it. Otherwise the field is unset. 527 StatisticsTimeZone string `json:"statisticsTimeZone,omitempty"` 528 529 // ServerResponse contains the HTTP response code and headers from the 530 // server. 531 googleapi.ServerResponse `json:"-"` 532 533 // ForceSendFields is a list of field names (e.g. "Files") to 534 // unconditionally include in API requests. By default, fields with 535 // empty values are omitted from API requests. However, any non-pointer, 536 // non-interface field appearing in ForceSendFields will be sent to the 537 // server regardless of whether the field is empty or not. This may be 538 // used to include empty fields in Patch requests. 539 ForceSendFields []string `json:"-"` 540 541 // NullFields is a list of field names (e.g. "Files") to include in API 542 // requests with the JSON null value. By default, fields with empty 543 // values are omitted from API requests. However, any field with an 544 // empty value appearing in NullFields will be sent to the server as 545 // null. It is an error if a field in this list has a non-empty value. 546 // This may be used to include null fields in Patch requests. 547 NullFields []string `json:"-"` 548} 549 550func (s *Report) MarshalJSON() ([]byte, error) { 551 type NoMethod Report 552 raw := NoMethod(*s) 553 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 554} 555 556type ReportFiles struct { 557 // ByteCount: The size of this report file in bytes. 558 ByteCount int64 `json:"byteCount,omitempty,string"` 559 560 // Url: Use this url to download the report file. 561 Url string `json:"url,omitempty"` 562 563 // ForceSendFields is a list of field names (e.g. "ByteCount") to 564 // unconditionally include in API requests. By default, fields with 565 // empty values are omitted from API requests. However, any non-pointer, 566 // non-interface field appearing in ForceSendFields will be sent to the 567 // server regardless of whether the field is empty or not. This may be 568 // used to include empty fields in Patch requests. 569 ForceSendFields []string `json:"-"` 570 571 // NullFields is a list of field names (e.g. "ByteCount") to include in 572 // API requests with the JSON null value. By default, fields with empty 573 // values are omitted from API requests. However, any field with an 574 // empty value appearing in NullFields will be sent to the server as 575 // null. It is an error if a field in this list has a non-empty value. 576 // This may be used to include null fields in Patch requests. 577 NullFields []string `json:"-"` 578} 579 580func (s *ReportFiles) MarshalJSON() ([]byte, error) { 581 type NoMethod ReportFiles 582 raw := NoMethod(*s) 583 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 584} 585 586// ReportApiColumnSpec: A request object used to create a DoubleClick 587// Search report. 588type ReportApiColumnSpec struct { 589 // ColumnName: Name of a DoubleClick Search column to include in the 590 // report. 591 ColumnName string `json:"columnName,omitempty"` 592 593 // CustomDimensionName: Segments a report by a custom dimension. The 594 // report must be scoped to an advertiser or lower, and the custom 595 // dimension must already be set up in DoubleClick Search. The custom 596 // dimension name, which appears in DoubleClick Search, is case 597 // sensitive.\ If used in a conversion report, returns the value of the 598 // specified custom dimension for the given conversion, if set. This 599 // column does not segment the conversion report. 600 CustomDimensionName string `json:"customDimensionName,omitempty"` 601 602 // CustomMetricName: Name of a custom metric to include in the report. 603 // The report must be scoped to an advertiser or lower, and the custom 604 // metric must already be set up in DoubleClick Search. The custom 605 // metric name, which appears in DoubleClick Search, is case sensitive. 606 CustomMetricName string `json:"customMetricName,omitempty"` 607 608 // EndDate: Inclusive day in YYYY-MM-DD format. When provided, this 609 // overrides the overall time range of the report for this column only. 610 // Must be provided together with `startDate`. 611 EndDate string `json:"endDate,omitempty"` 612 613 // GroupByColumn: Synchronous report only. Set to `true` to group by 614 // this column. Defaults to `false`. 615 GroupByColumn bool `json:"groupByColumn,omitempty"` 616 617 // HeaderText: Text used to identify this column in the report output; 618 // defaults to `columnName` or `savedColumnName` when not specified. 619 // This can be used to prevent collisions between DoubleClick Search 620 // columns and saved columns with the same name. 621 HeaderText string `json:"headerText,omitempty"` 622 623 // PlatformSource: The platform that is used to provide data for the 624 // custom dimension. Acceptable values are "floodlight". 625 PlatformSource string `json:"platformSource,omitempty"` 626 627 // ProductReportPerspective: Returns metrics only for a specific type of 628 // product activity. Accepted values are: - "sold": returns metrics 629 // only for products that were sold - "advertised": returns metrics 630 // only for products that were advertised in a Shopping campaign, and 631 // that might or might not have been sold 632 ProductReportPerspective string `json:"productReportPerspective,omitempty"` 633 634 // SavedColumnName: Name of a saved column to include in the report. The 635 // report must be scoped at advertiser or lower, and this saved column 636 // must already be created in the DoubleClick Search UI. 637 SavedColumnName string `json:"savedColumnName,omitempty"` 638 639 // StartDate: Inclusive date in YYYY-MM-DD format. When provided, this 640 // overrides the overall time range of the report for this column only. 641 // Must be provided together with `endDate`. 642 StartDate string `json:"startDate,omitempty"` 643 644 // ForceSendFields is a list of field names (e.g. "ColumnName") to 645 // unconditionally include in API requests. By default, fields with 646 // empty values are omitted from API requests. However, any non-pointer, 647 // non-interface field appearing in ForceSendFields will be sent to the 648 // server regardless of whether the field is empty or not. This may be 649 // used to include empty fields in Patch requests. 650 ForceSendFields []string `json:"-"` 651 652 // NullFields is a list of field names (e.g. "ColumnName") to include in 653 // API requests with the JSON null value. By default, fields with empty 654 // values are omitted from API requests. However, any field with an 655 // empty value appearing in NullFields will be sent to the server as 656 // null. It is an error if a field in this list has a non-empty value. 657 // This may be used to include null fields in Patch requests. 658 NullFields []string `json:"-"` 659} 660 661func (s *ReportApiColumnSpec) MarshalJSON() ([]byte, error) { 662 type NoMethod ReportApiColumnSpec 663 raw := NoMethod(*s) 664 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 665} 666 667// ReportRequest: A request object used to create a DoubleClick Search 668// report. 669type ReportRequest struct { 670 // Columns: The columns to include in the report. This includes both 671 // DoubleClick Search columns and saved columns. For DoubleClick Search 672 // columns, only the `columnName` parameter is required. For saved 673 // columns only the `savedColumnName` parameter is required. Both 674 // `columnName` and `savedColumnName` cannot be set in the same stanza.\ 675 // The maximum number of columns per request is 300. 676 Columns []*ReportApiColumnSpec `json:"columns,omitempty"` 677 678 // DownloadFormat: Format that the report should be returned in. 679 // Currently `csv` or `tsv` is supported. 680 DownloadFormat string `json:"downloadFormat,omitempty"` 681 682 // Filters: A list of filters to be applied to the report.\ The maximum 683 // number of filters per request is 300. 684 Filters []*ReportRequestFilters `json:"filters,omitempty"` 685 686 // IncludeDeletedEntities: Determines if removed entities should be 687 // included in the report. Defaults to `false`. Deprecated, please use 688 // `includeRemovedEntities` instead. 689 IncludeDeletedEntities bool `json:"includeDeletedEntities,omitempty"` 690 691 // IncludeRemovedEntities: Determines if removed entities should be 692 // included in the report. Defaults to `false`. 693 IncludeRemovedEntities bool `json:"includeRemovedEntities,omitempty"` 694 695 // MaxRowsPerFile: Asynchronous report only. The maximum number of rows 696 // per report file. A large report is split into many files based on 697 // this field. Acceptable values are `1000000` to `100000000`, 698 // inclusive. 699 MaxRowsPerFile int64 `json:"maxRowsPerFile,omitempty"` 700 701 // OrderBy: Synchronous report only. A list of columns and directions 702 // defining sorting to be performed on the report rows.\ The maximum 703 // number of orderings per request is 300. 704 OrderBy []*ReportRequestOrderBy `json:"orderBy,omitempty"` 705 706 // ReportScope: The reportScope is a set of IDs that are used to 707 // determine which subset of entities will be returned in the report. 708 // The full lineage of IDs from the lowest scoped level desired up 709 // through agency is required. 710 ReportScope *ReportRequestReportScope `json:"reportScope,omitempty"` 711 712 // ReportType: Determines the type of rows that are returned in the 713 // report. For example, if you specify `reportType: keyword`, each row 714 // in the report will contain data about a keyword. See the [Types of 715 // Reports](/search-ads/v2/report-types/) reference for the columns that 716 // are available for each type. 717 ReportType string `json:"reportType,omitempty"` 718 719 // RowCount: Synchronous report only. The maximum number of rows to 720 // return; additional rows are dropped. Acceptable values are `0` to 721 // `10000`, inclusive. Defaults to `10000`. 722 RowCount int64 `json:"rowCount,omitempty"` 723 724 // StartRow: Synchronous report only. Zero-based index of the first row 725 // to return. Acceptable values are `0` to `50000`, inclusive. Defaults 726 // to `0`. 727 StartRow int64 `json:"startRow,omitempty"` 728 729 // StatisticsCurrency: Specifies the currency in which monetary will be 730 // returned. Possible values are: `usd`, `agency` (valid if the report 731 // is scoped to agency or lower), `advertiser` (valid if the report is 732 // scoped to * advertiser or lower), or `account` (valid if the report 733 // is scoped to engine account or lower). 734 StatisticsCurrency string `json:"statisticsCurrency,omitempty"` 735 736 // TimeRange: If metrics are requested in a report, this argument will 737 // be used to restrict the metrics to a specific time range. 738 TimeRange *ReportRequestTimeRange `json:"timeRange,omitempty"` 739 740 // VerifySingleTimeZone: If `true`, the report would only be created if 741 // all the requested stat data are sourced from a single timezone. 742 // Defaults to `false`. 743 VerifySingleTimeZone bool `json:"verifySingleTimeZone,omitempty"` 744 745 // ForceSendFields is a list of field names (e.g. "Columns") to 746 // unconditionally include in API requests. By default, fields with 747 // empty values are omitted from API requests. However, any non-pointer, 748 // non-interface field appearing in ForceSendFields will be sent to the 749 // server regardless of whether the field is empty or not. This may be 750 // used to include empty fields in Patch requests. 751 ForceSendFields []string `json:"-"` 752 753 // NullFields is a list of field names (e.g. "Columns") to include in 754 // API requests with the JSON null value. By default, fields with empty 755 // values are omitted from API requests. However, any field with an 756 // empty value appearing in NullFields will be sent to the server as 757 // null. It is an error if a field in this list has a non-empty value. 758 // This may be used to include null fields in Patch requests. 759 NullFields []string `json:"-"` 760} 761 762func (s *ReportRequest) MarshalJSON() ([]byte, error) { 763 type NoMethod ReportRequest 764 raw := NoMethod(*s) 765 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 766} 767 768type ReportRequestFilters struct { 769 // Column: Column to perform the filter on. This can be a DoubleClick 770 // Search column or a saved column. 771 Column *ReportApiColumnSpec `json:"column,omitempty"` 772 773 // Operator: Operator to use in the filter. See the filter reference for 774 // a list of available operators. 775 Operator string `json:"operator,omitempty"` 776 777 // Values: A list of values to filter the column value against.\ The 778 // maximum number of filter values per request is 300. 779 Values []interface{} `json:"values,omitempty"` 780 781 // ForceSendFields is a list of field names (e.g. "Column") to 782 // unconditionally include in API requests. By default, fields with 783 // empty values are omitted from API requests. However, any non-pointer, 784 // non-interface field appearing in ForceSendFields will be sent to the 785 // server regardless of whether the field is empty or not. This may be 786 // used to include empty fields in Patch requests. 787 ForceSendFields []string `json:"-"` 788 789 // NullFields is a list of field names (e.g. "Column") to include in API 790 // requests with the JSON null value. By default, fields with empty 791 // values are omitted from API requests. However, any field with an 792 // empty value appearing in NullFields will be sent to the server as 793 // null. It is an error if a field in this list has a non-empty value. 794 // This may be used to include null fields in Patch requests. 795 NullFields []string `json:"-"` 796} 797 798func (s *ReportRequestFilters) MarshalJSON() ([]byte, error) { 799 type NoMethod ReportRequestFilters 800 raw := NoMethod(*s) 801 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 802} 803 804type ReportRequestOrderBy struct { 805 // Column: Column to perform the sort on. This can be a DoubleClick 806 // Search-defined column or a saved column. 807 Column *ReportApiColumnSpec `json:"column,omitempty"` 808 809 // SortOrder: The sort direction, which is either `ascending` or 810 // `descending`. 811 SortOrder string `json:"sortOrder,omitempty"` 812 813 // ForceSendFields is a list of field names (e.g. "Column") to 814 // unconditionally include in API requests. By default, fields with 815 // empty values are omitted from API requests. However, any non-pointer, 816 // non-interface field appearing in ForceSendFields will be sent to the 817 // server regardless of whether the field is empty or not. This may be 818 // used to include empty fields in Patch requests. 819 ForceSendFields []string `json:"-"` 820 821 // NullFields is a list of field names (e.g. "Column") to include in API 822 // requests with the JSON null value. By default, fields with empty 823 // values are omitted from API requests. However, any field with an 824 // empty value appearing in NullFields will be sent to the server as 825 // null. It is an error if a field in this list has a non-empty value. 826 // This may be used to include null fields in Patch requests. 827 NullFields []string `json:"-"` 828} 829 830func (s *ReportRequestOrderBy) MarshalJSON() ([]byte, error) { 831 type NoMethod ReportRequestOrderBy 832 raw := NoMethod(*s) 833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 834} 835 836// ReportRequestReportScope: The reportScope is a set of IDs that are 837// used to determine which subset of entities will be returned in the 838// report. The full lineage of IDs from the lowest scoped level desired 839// up through agency is required. 840type ReportRequestReportScope struct { 841 // AdGroupId: DS ad group ID. 842 AdGroupId int64 `json:"adGroupId,omitempty,string"` 843 844 // AdId: DS ad ID. 845 AdId int64 `json:"adId,omitempty,string"` 846 847 // AdvertiserId: DS advertiser ID. 848 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 849 850 // AgencyId: DS agency ID. 851 AgencyId int64 `json:"agencyId,omitempty,string"` 852 853 // CampaignId: DS campaign ID. 854 CampaignId int64 `json:"campaignId,omitempty,string"` 855 856 // EngineAccountId: DS engine account ID. 857 EngineAccountId int64 `json:"engineAccountId,omitempty,string"` 858 859 // KeywordId: DS keyword ID. 860 KeywordId int64 `json:"keywordId,omitempty,string"` 861 862 // ForceSendFields is a list of field names (e.g. "AdGroupId") to 863 // unconditionally include in API requests. By default, fields with 864 // empty values are omitted from API requests. However, any non-pointer, 865 // non-interface field appearing in ForceSendFields will be sent to the 866 // server regardless of whether the field is empty or not. This may be 867 // used to include empty fields in Patch requests. 868 ForceSendFields []string `json:"-"` 869 870 // NullFields is a list of field names (e.g. "AdGroupId") to include in 871 // API requests with the JSON null value. By default, fields with empty 872 // values are omitted from API requests. However, any field with an 873 // empty value appearing in NullFields will be sent to the server as 874 // null. It is an error if a field in this list has a non-empty value. 875 // This may be used to include null fields in Patch requests. 876 NullFields []string `json:"-"` 877} 878 879func (s *ReportRequestReportScope) MarshalJSON() ([]byte, error) { 880 type NoMethod ReportRequestReportScope 881 raw := NoMethod(*s) 882 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 883} 884 885// ReportRequestTimeRange: If metrics are requested in a report, this 886// argument will be used to restrict the metrics to a specific time 887// range. 888type ReportRequestTimeRange struct { 889 // ChangedAttributesSinceTimestamp: Inclusive UTC timestamp in RFC 890 // format, e.g., `2013-07-16T10:16:23.555Z`. See additional references 891 // on how changed attribute reports work. 892 ChangedAttributesSinceTimestamp string `json:"changedAttributesSinceTimestamp,omitempty"` 893 894 // ChangedMetricsSinceTimestamp: Inclusive UTC timestamp in RFC format, 895 // e.g., `2013-07-16T10:16:23.555Z`. See additional references on how 896 // changed metrics reports work. 897 ChangedMetricsSinceTimestamp string `json:"changedMetricsSinceTimestamp,omitempty"` 898 899 // EndDate: Inclusive date in YYYY-MM-DD format. 900 EndDate string `json:"endDate,omitempty"` 901 902 // StartDate: Inclusive date in YYYY-MM-DD format. 903 StartDate string `json:"startDate,omitempty"` 904 905 // ForceSendFields is a list of field names (e.g. 906 // "ChangedAttributesSinceTimestamp") to unconditionally include in API 907 // requests. By default, fields with empty values are omitted from API 908 // requests. However, any non-pointer, non-interface field appearing in 909 // ForceSendFields will be sent to the server regardless of whether the 910 // field is empty or not. This may be used to include empty fields in 911 // Patch requests. 912 ForceSendFields []string `json:"-"` 913 914 // NullFields is a list of field names (e.g. 915 // "ChangedAttributesSinceTimestamp") to include in API requests with 916 // the JSON null value. By default, fields with empty values are omitted 917 // from API requests. However, any field with an empty value appearing 918 // in NullFields will be sent to the server as null. It is an error if a 919 // field in this list has a non-empty value. This may be used to include 920 // null fields in Patch requests. 921 NullFields []string `json:"-"` 922} 923 924func (s *ReportRequestTimeRange) MarshalJSON() ([]byte, error) { 925 type NoMethod ReportRequestTimeRange 926 raw := NoMethod(*s) 927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 928} 929 930// SavedColumn: A saved column 931type SavedColumn struct { 932 // Kind: Identifies this as a SavedColumn resource. Value: the fixed 933 // string doubleclicksearch#savedColumn. 934 Kind string `json:"kind,omitempty"` 935 936 // SavedColumnName: The name of the saved column. 937 SavedColumnName string `json:"savedColumnName,omitempty"` 938 939 // Type: The type of data this saved column will produce. 940 Type string `json:"type,omitempty"` 941 942 // ForceSendFields is a list of field names (e.g. "Kind") to 943 // unconditionally include in API requests. By default, fields with 944 // empty values are omitted from API requests. However, any non-pointer, 945 // non-interface field appearing in ForceSendFields will be sent to the 946 // server regardless of whether the field is empty or not. This may be 947 // used to include empty fields in Patch requests. 948 ForceSendFields []string `json:"-"` 949 950 // NullFields is a list of field names (e.g. "Kind") to include in API 951 // requests with the JSON null value. By default, fields with empty 952 // values are omitted from API requests. However, any field with an 953 // empty value appearing in NullFields will be sent to the server as 954 // null. It is an error if a field in this list has a non-empty value. 955 // This may be used to include null fields in Patch requests. 956 NullFields []string `json:"-"` 957} 958 959func (s *SavedColumn) MarshalJSON() ([]byte, error) { 960 type NoMethod SavedColumn 961 raw := NoMethod(*s) 962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 963} 964 965// SavedColumnList: A list of saved columns. Advertisers create saved 966// columns to report on Floodlight activities, Google Analytics goals, 967// or custom KPIs. To request reports with saved columns, you'll need 968// the saved column names that are available from this list. 969type SavedColumnList struct { 970 // Items: The saved columns being requested. 971 Items []*SavedColumn `json:"items,omitempty"` 972 973 // Kind: Identifies this as a SavedColumnList resource. Value: the fixed 974 // string doubleclicksearch#savedColumnList. 975 Kind string `json:"kind,omitempty"` 976 977 // ServerResponse contains the HTTP response code and headers from the 978 // server. 979 googleapi.ServerResponse `json:"-"` 980 981 // ForceSendFields is a list of field names (e.g. "Items") to 982 // unconditionally include in API requests. By default, fields with 983 // empty values are omitted from API requests. However, any non-pointer, 984 // non-interface field appearing in ForceSendFields will be sent to the 985 // server regardless of whether the field is empty or not. This may be 986 // used to include empty fields in Patch requests. 987 ForceSendFields []string `json:"-"` 988 989 // NullFields is a list of field names (e.g. "Items") to include in API 990 // requests with the JSON null value. By default, fields with empty 991 // values are omitted from API requests. However, any field with an 992 // empty value appearing in NullFields will be sent to the server as 993 // null. It is an error if a field in this list has a non-empty value. 994 // This may be used to include null fields in Patch requests. 995 NullFields []string `json:"-"` 996} 997 998func (s *SavedColumnList) MarshalJSON() ([]byte, error) { 999 type NoMethod SavedColumnList 1000 raw := NoMethod(*s) 1001 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1002} 1003 1004// UpdateAvailabilityRequest: The request to update availability. 1005type UpdateAvailabilityRequest struct { 1006 // Availabilities: The availabilities being requested. 1007 Availabilities []*Availability `json:"availabilities,omitempty"` 1008 1009 // ForceSendFields is a list of field names (e.g. "Availabilities") to 1010 // unconditionally include in API requests. By default, fields with 1011 // empty values are omitted from API requests. However, any non-pointer, 1012 // non-interface field appearing in ForceSendFields will be sent to the 1013 // server regardless of whether the field is empty or not. This may be 1014 // used to include empty fields in Patch requests. 1015 ForceSendFields []string `json:"-"` 1016 1017 // NullFields is a list of field names (e.g. "Availabilities") to 1018 // include in API requests with the JSON null value. By default, fields 1019 // with empty values are omitted from API requests. However, any field 1020 // with an empty value appearing in NullFields will be sent to the 1021 // server as null. It is an error if a field in this list has a 1022 // non-empty value. This may be used to include null fields in Patch 1023 // requests. 1024 NullFields []string `json:"-"` 1025} 1026 1027func (s *UpdateAvailabilityRequest) MarshalJSON() ([]byte, error) { 1028 type NoMethod UpdateAvailabilityRequest 1029 raw := NoMethod(*s) 1030 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1031} 1032 1033// UpdateAvailabilityResponse: The response to a update availability 1034// request. 1035type UpdateAvailabilityResponse struct { 1036 // Availabilities: The availabilities being returned. 1037 Availabilities []*Availability `json:"availabilities,omitempty"` 1038 1039 // ServerResponse contains the HTTP response code and headers from the 1040 // server. 1041 googleapi.ServerResponse `json:"-"` 1042 1043 // ForceSendFields is a list of field names (e.g. "Availabilities") to 1044 // unconditionally include in API requests. By default, fields with 1045 // empty values are omitted from API requests. However, any non-pointer, 1046 // non-interface field appearing in ForceSendFields will be sent to the 1047 // server regardless of whether the field is empty or not. This may be 1048 // used to include empty fields in Patch requests. 1049 ForceSendFields []string `json:"-"` 1050 1051 // NullFields is a list of field names (e.g. "Availabilities") to 1052 // include in API requests with the JSON null value. By default, fields 1053 // with empty values are omitted from API requests. However, any field 1054 // with an empty value appearing in NullFields will be sent to the 1055 // server as null. It is an error if a field in this list has a 1056 // non-empty value. This may be used to include null fields in Patch 1057 // requests. 1058 NullFields []string `json:"-"` 1059} 1060 1061func (s *UpdateAvailabilityResponse) MarshalJSON() ([]byte, error) { 1062 type NoMethod UpdateAvailabilityResponse 1063 raw := NoMethod(*s) 1064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1065} 1066 1067// method id "doubleclicksearch.conversion.get": 1068 1069type ConversionGetCall struct { 1070 s *Service 1071 agencyId int64 1072 advertiserId int64 1073 engineAccountId int64 1074 urlParams_ gensupport.URLParams 1075 ifNoneMatch_ string 1076 ctx_ context.Context 1077 header_ http.Header 1078} 1079 1080// Get: Retrieves a list of conversions from a DoubleClick Search engine 1081// account. 1082func (r *ConversionService) Get(agencyId int64, advertiserId int64, engineAccountId int64, endDate int64, rowCount int64, startDate int64, startRow int64) *ConversionGetCall { 1083 c := &ConversionGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1084 c.agencyId = agencyId 1085 c.advertiserId = advertiserId 1086 c.engineAccountId = engineAccountId 1087 c.urlParams_.Set("endDate", fmt.Sprint(endDate)) 1088 c.urlParams_.Set("rowCount", fmt.Sprint(rowCount)) 1089 c.urlParams_.Set("startDate", fmt.Sprint(startDate)) 1090 c.urlParams_.Set("startRow", fmt.Sprint(startRow)) 1091 return c 1092} 1093 1094// AdGroupId sets the optional parameter "adGroupId": Numeric ID of the 1095// ad group. 1096func (c *ConversionGetCall) AdGroupId(adGroupId int64) *ConversionGetCall { 1097 c.urlParams_.Set("adGroupId", fmt.Sprint(adGroupId)) 1098 return c 1099} 1100 1101// AdId sets the optional parameter "adId": Numeric ID of the ad. 1102func (c *ConversionGetCall) AdId(adId int64) *ConversionGetCall { 1103 c.urlParams_.Set("adId", fmt.Sprint(adId)) 1104 return c 1105} 1106 1107// CampaignId sets the optional parameter "campaignId": Numeric ID of 1108// the campaign. 1109func (c *ConversionGetCall) CampaignId(campaignId int64) *ConversionGetCall { 1110 c.urlParams_.Set("campaignId", fmt.Sprint(campaignId)) 1111 return c 1112} 1113 1114// CriterionId sets the optional parameter "criterionId": Numeric ID of 1115// the criterion. 1116func (c *ConversionGetCall) CriterionId(criterionId int64) *ConversionGetCall { 1117 c.urlParams_.Set("criterionId", fmt.Sprint(criterionId)) 1118 return c 1119} 1120 1121// Fields allows partial responses to be retrieved. See 1122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1123// for more information. 1124func (c *ConversionGetCall) Fields(s ...googleapi.Field) *ConversionGetCall { 1125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1126 return c 1127} 1128 1129// IfNoneMatch sets the optional parameter which makes the operation 1130// fail if the object's ETag matches the given value. This is useful for 1131// getting updates only after the object has changed since the last 1132// request. Use googleapi.IsNotModified to check whether the response 1133// error from Do is the result of In-None-Match. 1134func (c *ConversionGetCall) IfNoneMatch(entityTag string) *ConversionGetCall { 1135 c.ifNoneMatch_ = entityTag 1136 return c 1137} 1138 1139// Context sets the context to be used in this call's Do method. Any 1140// pending HTTP request will be aborted if the provided context is 1141// canceled. 1142func (c *ConversionGetCall) Context(ctx context.Context) *ConversionGetCall { 1143 c.ctx_ = ctx 1144 return c 1145} 1146 1147// Header returns an http.Header that can be modified by the caller to 1148// add HTTP headers to the request. 1149func (c *ConversionGetCall) Header() http.Header { 1150 if c.header_ == nil { 1151 c.header_ = make(http.Header) 1152 } 1153 return c.header_ 1154} 1155 1156func (c *ConversionGetCall) doRequest(alt string) (*http.Response, error) { 1157 reqHeaders := make(http.Header) 1158 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1159 for k, v := range c.header_ { 1160 reqHeaders[k] = v 1161 } 1162 reqHeaders.Set("User-Agent", c.s.userAgent()) 1163 if c.ifNoneMatch_ != "" { 1164 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1165 } 1166 var body io.Reader = nil 1167 c.urlParams_.Set("alt", alt) 1168 c.urlParams_.Set("prettyPrint", "false") 1169 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion") 1170 urls += "?" + c.urlParams_.Encode() 1171 req, err := http.NewRequest("GET", urls, body) 1172 if err != nil { 1173 return nil, err 1174 } 1175 req.Header = reqHeaders 1176 googleapi.Expand(req.URL, map[string]string{ 1177 "agencyId": strconv.FormatInt(c.agencyId, 10), 1178 "advertiserId": strconv.FormatInt(c.advertiserId, 10), 1179 "engineAccountId": strconv.FormatInt(c.engineAccountId, 10), 1180 }) 1181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1182} 1183 1184// Do executes the "doubleclicksearch.conversion.get" call. 1185// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1186// status code is an error. Response headers are in either 1187// *ConversionList.ServerResponse.Header or (if a response was returned 1188// at all) in error.(*googleapi.Error).Header. Use 1189// googleapi.IsNotModified to check whether the returned error was 1190// because http.StatusNotModified was returned. 1191func (c *ConversionGetCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1192 gensupport.SetOptions(c.urlParams_, opts...) 1193 res, err := c.doRequest("json") 1194 if res != nil && res.StatusCode == http.StatusNotModified { 1195 if res.Body != nil { 1196 res.Body.Close() 1197 } 1198 return nil, &googleapi.Error{ 1199 Code: res.StatusCode, 1200 Header: res.Header, 1201 } 1202 } 1203 if err != nil { 1204 return nil, err 1205 } 1206 defer googleapi.CloseBody(res) 1207 if err := googleapi.CheckResponse(res); err != nil { 1208 return nil, err 1209 } 1210 ret := &ConversionList{ 1211 ServerResponse: googleapi.ServerResponse{ 1212 Header: res.Header, 1213 HTTPStatusCode: res.StatusCode, 1214 }, 1215 } 1216 target := &ret 1217 if err := gensupport.DecodeResponse(target, res); err != nil { 1218 return nil, err 1219 } 1220 return ret, nil 1221 // { 1222 // "description": "Retrieves a list of conversions from a DoubleClick Search engine account.", 1223 // "flatPath": "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion", 1224 // "httpMethod": "GET", 1225 // "id": "doubleclicksearch.conversion.get", 1226 // "parameterOrder": [ 1227 // "agencyId", 1228 // "advertiserId", 1229 // "engineAccountId", 1230 // "endDate", 1231 // "rowCount", 1232 // "startDate", 1233 // "startRow" 1234 // ], 1235 // "parameters": { 1236 // "adGroupId": { 1237 // "description": "Numeric ID of the ad group.", 1238 // "format": "int64", 1239 // "location": "query", 1240 // "type": "string" 1241 // }, 1242 // "adId": { 1243 // "description": "Numeric ID of the ad.", 1244 // "format": "int64", 1245 // "location": "query", 1246 // "type": "string" 1247 // }, 1248 // "advertiserId": { 1249 // "description": "Numeric ID of the advertiser.", 1250 // "format": "int64", 1251 // "location": "path", 1252 // "required": true, 1253 // "type": "string" 1254 // }, 1255 // "agencyId": { 1256 // "description": "Numeric ID of the agency.", 1257 // "format": "int64", 1258 // "location": "path", 1259 // "required": true, 1260 // "type": "string" 1261 // }, 1262 // "campaignId": { 1263 // "description": "Numeric ID of the campaign.", 1264 // "format": "int64", 1265 // "location": "query", 1266 // "type": "string" 1267 // }, 1268 // "criterionId": { 1269 // "description": "Numeric ID of the criterion.", 1270 // "format": "int64", 1271 // "location": "query", 1272 // "type": "string" 1273 // }, 1274 // "endDate": { 1275 // "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1276 // "format": "int32", 1277 // "location": "query", 1278 // "maximum": "99991231", 1279 // "minimum": "20091101", 1280 // "required": true, 1281 // "type": "integer" 1282 // }, 1283 // "engineAccountId": { 1284 // "description": "Numeric ID of the engine account.", 1285 // "format": "int64", 1286 // "location": "path", 1287 // "required": true, 1288 // "type": "string" 1289 // }, 1290 // "rowCount": { 1291 // "description": "The number of conversions to return per call.", 1292 // "format": "int32", 1293 // "location": "query", 1294 // "maximum": "1000", 1295 // "minimum": "1", 1296 // "required": true, 1297 // "type": "integer" 1298 // }, 1299 // "startDate": { 1300 // "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1301 // "format": "int32", 1302 // "location": "query", 1303 // "maximum": "99991231", 1304 // "minimum": "20091101", 1305 // "required": true, 1306 // "type": "integer" 1307 // }, 1308 // "startRow": { 1309 // "description": "The 0-based starting index for retrieving conversions results.", 1310 // "format": "uint32", 1311 // "location": "query", 1312 // "required": true, 1313 // "type": "integer" 1314 // } 1315 // }, 1316 // "path": "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion", 1317 // "response": { 1318 // "$ref": "ConversionList" 1319 // }, 1320 // "scopes": [ 1321 // "https://www.googleapis.com/auth/doubleclicksearch" 1322 // ] 1323 // } 1324 1325} 1326 1327// method id "doubleclicksearch.conversion.insert": 1328 1329type ConversionInsertCall struct { 1330 s *Service 1331 conversionlist *ConversionList 1332 urlParams_ gensupport.URLParams 1333 ctx_ context.Context 1334 header_ http.Header 1335} 1336 1337// Insert: Inserts a batch of new conversions into DoubleClick Search. 1338func (r *ConversionService) Insert(conversionlist *ConversionList) *ConversionInsertCall { 1339 c := &ConversionInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1340 c.conversionlist = conversionlist 1341 return c 1342} 1343 1344// Fields allows partial responses to be retrieved. See 1345// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1346// for more information. 1347func (c *ConversionInsertCall) Fields(s ...googleapi.Field) *ConversionInsertCall { 1348 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1349 return c 1350} 1351 1352// Context sets the context to be used in this call's Do method. Any 1353// pending HTTP request will be aborted if the provided context is 1354// canceled. 1355func (c *ConversionInsertCall) Context(ctx context.Context) *ConversionInsertCall { 1356 c.ctx_ = ctx 1357 return c 1358} 1359 1360// Header returns an http.Header that can be modified by the caller to 1361// add HTTP headers to the request. 1362func (c *ConversionInsertCall) Header() http.Header { 1363 if c.header_ == nil { 1364 c.header_ = make(http.Header) 1365 } 1366 return c.header_ 1367} 1368 1369func (c *ConversionInsertCall) doRequest(alt string) (*http.Response, error) { 1370 reqHeaders := make(http.Header) 1371 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1372 for k, v := range c.header_ { 1373 reqHeaders[k] = v 1374 } 1375 reqHeaders.Set("User-Agent", c.s.userAgent()) 1376 var body io.Reader = nil 1377 body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) 1378 if err != nil { 1379 return nil, err 1380 } 1381 reqHeaders.Set("Content-Type", "application/json") 1382 c.urlParams_.Set("alt", alt) 1383 c.urlParams_.Set("prettyPrint", "false") 1384 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion") 1385 urls += "?" + c.urlParams_.Encode() 1386 req, err := http.NewRequest("POST", urls, body) 1387 if err != nil { 1388 return nil, err 1389 } 1390 req.Header = reqHeaders 1391 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1392} 1393 1394// Do executes the "doubleclicksearch.conversion.insert" call. 1395// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1396// status code is an error. Response headers are in either 1397// *ConversionList.ServerResponse.Header or (if a response was returned 1398// at all) in error.(*googleapi.Error).Header. Use 1399// googleapi.IsNotModified to check whether the returned error was 1400// because http.StatusNotModified was returned. 1401func (c *ConversionInsertCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1402 gensupport.SetOptions(c.urlParams_, opts...) 1403 res, err := c.doRequest("json") 1404 if res != nil && res.StatusCode == http.StatusNotModified { 1405 if res.Body != nil { 1406 res.Body.Close() 1407 } 1408 return nil, &googleapi.Error{ 1409 Code: res.StatusCode, 1410 Header: res.Header, 1411 } 1412 } 1413 if err != nil { 1414 return nil, err 1415 } 1416 defer googleapi.CloseBody(res) 1417 if err := googleapi.CheckResponse(res); err != nil { 1418 return nil, err 1419 } 1420 ret := &ConversionList{ 1421 ServerResponse: googleapi.ServerResponse{ 1422 Header: res.Header, 1423 HTTPStatusCode: res.StatusCode, 1424 }, 1425 } 1426 target := &ret 1427 if err := gensupport.DecodeResponse(target, res); err != nil { 1428 return nil, err 1429 } 1430 return ret, nil 1431 // { 1432 // "description": "Inserts a batch of new conversions into DoubleClick Search.", 1433 // "flatPath": "doubleclicksearch/v2/conversion", 1434 // "httpMethod": "POST", 1435 // "id": "doubleclicksearch.conversion.insert", 1436 // "parameterOrder": [], 1437 // "parameters": {}, 1438 // "path": "doubleclicksearch/v2/conversion", 1439 // "request": { 1440 // "$ref": "ConversionList" 1441 // }, 1442 // "response": { 1443 // "$ref": "ConversionList" 1444 // }, 1445 // "scopes": [ 1446 // "https://www.googleapis.com/auth/doubleclicksearch" 1447 // ] 1448 // } 1449 1450} 1451 1452// method id "doubleclicksearch.conversion.update": 1453 1454type ConversionUpdateCall struct { 1455 s *Service 1456 conversionlist *ConversionList 1457 urlParams_ gensupport.URLParams 1458 ctx_ context.Context 1459 header_ http.Header 1460} 1461 1462// Update: Updates a batch of conversions in DoubleClick Search. 1463func (r *ConversionService) Update(conversionlist *ConversionList) *ConversionUpdateCall { 1464 c := &ConversionUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1465 c.conversionlist = conversionlist 1466 return c 1467} 1468 1469// Fields allows partial responses to be retrieved. See 1470// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1471// for more information. 1472func (c *ConversionUpdateCall) Fields(s ...googleapi.Field) *ConversionUpdateCall { 1473 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1474 return c 1475} 1476 1477// Context sets the context to be used in this call's Do method. Any 1478// pending HTTP request will be aborted if the provided context is 1479// canceled. 1480func (c *ConversionUpdateCall) Context(ctx context.Context) *ConversionUpdateCall { 1481 c.ctx_ = ctx 1482 return c 1483} 1484 1485// Header returns an http.Header that can be modified by the caller to 1486// add HTTP headers to the request. 1487func (c *ConversionUpdateCall) Header() http.Header { 1488 if c.header_ == nil { 1489 c.header_ = make(http.Header) 1490 } 1491 return c.header_ 1492} 1493 1494func (c *ConversionUpdateCall) doRequest(alt string) (*http.Response, error) { 1495 reqHeaders := make(http.Header) 1496 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1497 for k, v := range c.header_ { 1498 reqHeaders[k] = v 1499 } 1500 reqHeaders.Set("User-Agent", c.s.userAgent()) 1501 var body io.Reader = nil 1502 body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) 1503 if err != nil { 1504 return nil, err 1505 } 1506 reqHeaders.Set("Content-Type", "application/json") 1507 c.urlParams_.Set("alt", alt) 1508 c.urlParams_.Set("prettyPrint", "false") 1509 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion") 1510 urls += "?" + c.urlParams_.Encode() 1511 req, err := http.NewRequest("PUT", urls, body) 1512 if err != nil { 1513 return nil, err 1514 } 1515 req.Header = reqHeaders 1516 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1517} 1518 1519// Do executes the "doubleclicksearch.conversion.update" call. 1520// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1521// status code is an error. Response headers are in either 1522// *ConversionList.ServerResponse.Header or (if a response was returned 1523// at all) in error.(*googleapi.Error).Header. Use 1524// googleapi.IsNotModified to check whether the returned error was 1525// because http.StatusNotModified was returned. 1526func (c *ConversionUpdateCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1527 gensupport.SetOptions(c.urlParams_, opts...) 1528 res, err := c.doRequest("json") 1529 if res != nil && res.StatusCode == http.StatusNotModified { 1530 if res.Body != nil { 1531 res.Body.Close() 1532 } 1533 return nil, &googleapi.Error{ 1534 Code: res.StatusCode, 1535 Header: res.Header, 1536 } 1537 } 1538 if err != nil { 1539 return nil, err 1540 } 1541 defer googleapi.CloseBody(res) 1542 if err := googleapi.CheckResponse(res); err != nil { 1543 return nil, err 1544 } 1545 ret := &ConversionList{ 1546 ServerResponse: googleapi.ServerResponse{ 1547 Header: res.Header, 1548 HTTPStatusCode: res.StatusCode, 1549 }, 1550 } 1551 target := &ret 1552 if err := gensupport.DecodeResponse(target, res); err != nil { 1553 return nil, err 1554 } 1555 return ret, nil 1556 // { 1557 // "description": "Updates a batch of conversions in DoubleClick Search.", 1558 // "flatPath": "doubleclicksearch/v2/conversion", 1559 // "httpMethod": "PUT", 1560 // "id": "doubleclicksearch.conversion.update", 1561 // "parameterOrder": [], 1562 // "parameters": {}, 1563 // "path": "doubleclicksearch/v2/conversion", 1564 // "request": { 1565 // "$ref": "ConversionList" 1566 // }, 1567 // "response": { 1568 // "$ref": "ConversionList" 1569 // }, 1570 // "scopes": [ 1571 // "https://www.googleapis.com/auth/doubleclicksearch" 1572 // ] 1573 // } 1574 1575} 1576 1577// method id "doubleclicksearch.conversion.updateAvailability": 1578 1579type ConversionUpdateAvailabilityCall struct { 1580 s *Service 1581 updateavailabilityrequest *UpdateAvailabilityRequest 1582 urlParams_ gensupport.URLParams 1583 ctx_ context.Context 1584 header_ http.Header 1585} 1586 1587// UpdateAvailability: Updates the availabilities of a batch of 1588// floodlight activities in DoubleClick Search. 1589func (r *ConversionService) UpdateAvailability(updateavailabilityrequest *UpdateAvailabilityRequest) *ConversionUpdateAvailabilityCall { 1590 c := &ConversionUpdateAvailabilityCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1591 c.updateavailabilityrequest = updateavailabilityrequest 1592 return c 1593} 1594 1595// Fields allows partial responses to be retrieved. See 1596// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1597// for more information. 1598func (c *ConversionUpdateAvailabilityCall) Fields(s ...googleapi.Field) *ConversionUpdateAvailabilityCall { 1599 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1600 return c 1601} 1602 1603// Context sets the context to be used in this call's Do method. Any 1604// pending HTTP request will be aborted if the provided context is 1605// canceled. 1606func (c *ConversionUpdateAvailabilityCall) Context(ctx context.Context) *ConversionUpdateAvailabilityCall { 1607 c.ctx_ = ctx 1608 return c 1609} 1610 1611// Header returns an http.Header that can be modified by the caller to 1612// add HTTP headers to the request. 1613func (c *ConversionUpdateAvailabilityCall) Header() http.Header { 1614 if c.header_ == nil { 1615 c.header_ = make(http.Header) 1616 } 1617 return c.header_ 1618} 1619 1620func (c *ConversionUpdateAvailabilityCall) doRequest(alt string) (*http.Response, error) { 1621 reqHeaders := make(http.Header) 1622 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1623 for k, v := range c.header_ { 1624 reqHeaders[k] = v 1625 } 1626 reqHeaders.Set("User-Agent", c.s.userAgent()) 1627 var body io.Reader = nil 1628 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateavailabilityrequest) 1629 if err != nil { 1630 return nil, err 1631 } 1632 reqHeaders.Set("Content-Type", "application/json") 1633 c.urlParams_.Set("alt", alt) 1634 c.urlParams_.Set("prettyPrint", "false") 1635 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/conversion/updateAvailability") 1636 urls += "?" + c.urlParams_.Encode() 1637 req, err := http.NewRequest("POST", urls, body) 1638 if err != nil { 1639 return nil, err 1640 } 1641 req.Header = reqHeaders 1642 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1643} 1644 1645// Do executes the "doubleclicksearch.conversion.updateAvailability" call. 1646// Exactly one of *UpdateAvailabilityResponse or error will be non-nil. 1647// Any non-2xx status code is an error. Response headers are in either 1648// *UpdateAvailabilityResponse.ServerResponse.Header or (if a response 1649// was returned at all) in error.(*googleapi.Error).Header. Use 1650// googleapi.IsNotModified to check whether the returned error was 1651// because http.StatusNotModified was returned. 1652func (c *ConversionUpdateAvailabilityCall) Do(opts ...googleapi.CallOption) (*UpdateAvailabilityResponse, error) { 1653 gensupport.SetOptions(c.urlParams_, opts...) 1654 res, err := c.doRequest("json") 1655 if res != nil && res.StatusCode == http.StatusNotModified { 1656 if res.Body != nil { 1657 res.Body.Close() 1658 } 1659 return nil, &googleapi.Error{ 1660 Code: res.StatusCode, 1661 Header: res.Header, 1662 } 1663 } 1664 if err != nil { 1665 return nil, err 1666 } 1667 defer googleapi.CloseBody(res) 1668 if err := googleapi.CheckResponse(res); err != nil { 1669 return nil, err 1670 } 1671 ret := &UpdateAvailabilityResponse{ 1672 ServerResponse: googleapi.ServerResponse{ 1673 Header: res.Header, 1674 HTTPStatusCode: res.StatusCode, 1675 }, 1676 } 1677 target := &ret 1678 if err := gensupport.DecodeResponse(target, res); err != nil { 1679 return nil, err 1680 } 1681 return ret, nil 1682 // { 1683 // "description": "Updates the availabilities of a batch of floodlight activities in DoubleClick Search.", 1684 // "flatPath": "doubleclicksearch/v2/conversion/updateAvailability", 1685 // "httpMethod": "POST", 1686 // "id": "doubleclicksearch.conversion.updateAvailability", 1687 // "parameterOrder": [], 1688 // "parameters": {}, 1689 // "path": "doubleclicksearch/v2/conversion/updateAvailability", 1690 // "request": { 1691 // "$ref": "UpdateAvailabilityRequest" 1692 // }, 1693 // "response": { 1694 // "$ref": "UpdateAvailabilityResponse" 1695 // }, 1696 // "scopes": [ 1697 // "https://www.googleapis.com/auth/doubleclicksearch" 1698 // ] 1699 // } 1700 1701} 1702 1703// method id "doubleclicksearch.reports.generate": 1704 1705type ReportsGenerateCall struct { 1706 s *Service 1707 reportrequest *ReportRequest 1708 urlParams_ gensupport.URLParams 1709 ctx_ context.Context 1710 header_ http.Header 1711} 1712 1713// Generate: Generates and returns a report immediately. 1714func (r *ReportsService) Generate(reportrequest *ReportRequest) *ReportsGenerateCall { 1715 c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1716 c.reportrequest = reportrequest 1717 return c 1718} 1719 1720// Fields allows partial responses to be retrieved. See 1721// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1722// for more information. 1723func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { 1724 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1725 return c 1726} 1727 1728// Context sets the context to be used in this call's Do method. Any 1729// pending HTTP request will be aborted if the provided context is 1730// canceled. 1731func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { 1732 c.ctx_ = ctx 1733 return c 1734} 1735 1736// Header returns an http.Header that can be modified by the caller to 1737// add HTTP headers to the request. 1738func (c *ReportsGenerateCall) Header() http.Header { 1739 if c.header_ == nil { 1740 c.header_ = make(http.Header) 1741 } 1742 return c.header_ 1743} 1744 1745func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { 1746 reqHeaders := make(http.Header) 1747 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1748 for k, v := range c.header_ { 1749 reqHeaders[k] = v 1750 } 1751 reqHeaders.Set("User-Agent", c.s.userAgent()) 1752 var body io.Reader = nil 1753 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 1754 if err != nil { 1755 return nil, err 1756 } 1757 reqHeaders.Set("Content-Type", "application/json") 1758 c.urlParams_.Set("alt", alt) 1759 c.urlParams_.Set("prettyPrint", "false") 1760 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/generate") 1761 urls += "?" + c.urlParams_.Encode() 1762 req, err := http.NewRequest("POST", urls, body) 1763 if err != nil { 1764 return nil, err 1765 } 1766 req.Header = reqHeaders 1767 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1768} 1769 1770// Do executes the "doubleclicksearch.reports.generate" call. 1771// Exactly one of *Report or error will be non-nil. Any non-2xx status 1772// code is an error. Response headers are in either 1773// *Report.ServerResponse.Header or (if a response was returned at all) 1774// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1775// check whether the returned error was because http.StatusNotModified 1776// was returned. 1777func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) { 1778 gensupport.SetOptions(c.urlParams_, opts...) 1779 res, err := c.doRequest("json") 1780 if res != nil && res.StatusCode == http.StatusNotModified { 1781 if res.Body != nil { 1782 res.Body.Close() 1783 } 1784 return nil, &googleapi.Error{ 1785 Code: res.StatusCode, 1786 Header: res.Header, 1787 } 1788 } 1789 if err != nil { 1790 return nil, err 1791 } 1792 defer googleapi.CloseBody(res) 1793 if err := googleapi.CheckResponse(res); err != nil { 1794 return nil, err 1795 } 1796 ret := &Report{ 1797 ServerResponse: googleapi.ServerResponse{ 1798 Header: res.Header, 1799 HTTPStatusCode: res.StatusCode, 1800 }, 1801 } 1802 target := &ret 1803 if err := gensupport.DecodeResponse(target, res); err != nil { 1804 return nil, err 1805 } 1806 return ret, nil 1807 // { 1808 // "description": "Generates and returns a report immediately.", 1809 // "flatPath": "doubleclicksearch/v2/reports/generate", 1810 // "httpMethod": "POST", 1811 // "id": "doubleclicksearch.reports.generate", 1812 // "parameterOrder": [], 1813 // "parameters": {}, 1814 // "path": "doubleclicksearch/v2/reports/generate", 1815 // "request": { 1816 // "$ref": "ReportRequest" 1817 // }, 1818 // "response": { 1819 // "$ref": "Report" 1820 // }, 1821 // "scopes": [ 1822 // "https://www.googleapis.com/auth/doubleclicksearch" 1823 // ] 1824 // } 1825 1826} 1827 1828// method id "doubleclicksearch.reports.get": 1829 1830type ReportsGetCall struct { 1831 s *Service 1832 reportId string 1833 urlParams_ gensupport.URLParams 1834 ifNoneMatch_ string 1835 ctx_ context.Context 1836 header_ http.Header 1837} 1838 1839// Get: Polls for the status of a report request. 1840func (r *ReportsService) Get(reportId string) *ReportsGetCall { 1841 c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1842 c.reportId = reportId 1843 return c 1844} 1845 1846// Fields allows partial responses to be retrieved. See 1847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1848// for more information. 1849func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { 1850 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1851 return c 1852} 1853 1854// IfNoneMatch sets the optional parameter which makes the operation 1855// fail if the object's ETag matches the given value. This is useful for 1856// getting updates only after the object has changed since the last 1857// request. Use googleapi.IsNotModified to check whether the response 1858// error from Do is the result of In-None-Match. 1859func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { 1860 c.ifNoneMatch_ = entityTag 1861 return c 1862} 1863 1864// Context sets the context to be used in this call's Do method. Any 1865// pending HTTP request will be aborted if the provided context is 1866// canceled. 1867func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { 1868 c.ctx_ = ctx 1869 return c 1870} 1871 1872// Header returns an http.Header that can be modified by the caller to 1873// add HTTP headers to the request. 1874func (c *ReportsGetCall) Header() http.Header { 1875 if c.header_ == nil { 1876 c.header_ = make(http.Header) 1877 } 1878 return c.header_ 1879} 1880 1881func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { 1882 reqHeaders := make(http.Header) 1883 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1884 for k, v := range c.header_ { 1885 reqHeaders[k] = v 1886 } 1887 reqHeaders.Set("User-Agent", c.s.userAgent()) 1888 if c.ifNoneMatch_ != "" { 1889 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1890 } 1891 var body io.Reader = nil 1892 c.urlParams_.Set("alt", alt) 1893 c.urlParams_.Set("prettyPrint", "false") 1894 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}") 1895 urls += "?" + c.urlParams_.Encode() 1896 req, err := http.NewRequest("GET", urls, body) 1897 if err != nil { 1898 return nil, err 1899 } 1900 req.Header = reqHeaders 1901 googleapi.Expand(req.URL, map[string]string{ 1902 "reportId": c.reportId, 1903 }) 1904 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1905} 1906 1907// Do executes the "doubleclicksearch.reports.get" call. 1908// Exactly one of *Report or error will be non-nil. Any non-2xx status 1909// code is an error. Response headers are in either 1910// *Report.ServerResponse.Header or (if a response was returned at all) 1911// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1912// check whether the returned error was because http.StatusNotModified 1913// was returned. 1914func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) { 1915 gensupport.SetOptions(c.urlParams_, opts...) 1916 res, err := c.doRequest("json") 1917 if res != nil && res.StatusCode == http.StatusNotModified { 1918 if res.Body != nil { 1919 res.Body.Close() 1920 } 1921 return nil, &googleapi.Error{ 1922 Code: res.StatusCode, 1923 Header: res.Header, 1924 } 1925 } 1926 if err != nil { 1927 return nil, err 1928 } 1929 defer googleapi.CloseBody(res) 1930 if err := googleapi.CheckResponse(res); err != nil { 1931 return nil, err 1932 } 1933 ret := &Report{ 1934 ServerResponse: googleapi.ServerResponse{ 1935 Header: res.Header, 1936 HTTPStatusCode: res.StatusCode, 1937 }, 1938 } 1939 target := &ret 1940 if err := gensupport.DecodeResponse(target, res); err != nil { 1941 return nil, err 1942 } 1943 return ret, nil 1944 // { 1945 // "description": "Polls for the status of a report request.", 1946 // "flatPath": "doubleclicksearch/v2/reports/{reportId}", 1947 // "httpMethod": "GET", 1948 // "id": "doubleclicksearch.reports.get", 1949 // "parameterOrder": [ 1950 // "reportId" 1951 // ], 1952 // "parameters": { 1953 // "reportId": { 1954 // "description": "ID of the report request being polled.", 1955 // "location": "path", 1956 // "required": true, 1957 // "type": "string" 1958 // } 1959 // }, 1960 // "path": "doubleclicksearch/v2/reports/{reportId}", 1961 // "response": { 1962 // "$ref": "Report" 1963 // }, 1964 // "scopes": [ 1965 // "https://www.googleapis.com/auth/doubleclicksearch" 1966 // ] 1967 // } 1968 1969} 1970 1971// method id "doubleclicksearch.reports.getFile": 1972 1973type ReportsGetFileCall struct { 1974 s *Service 1975 reportId string 1976 reportFragment int64 1977 urlParams_ gensupport.URLParams 1978 ifNoneMatch_ string 1979 ctx_ context.Context 1980 header_ http.Header 1981} 1982 1983// GetFile: Downloads a report file encoded in UTF-8. 1984func (r *ReportsService) GetFile(reportId string, reportFragment int64) *ReportsGetFileCall { 1985 c := &ReportsGetFileCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1986 c.reportId = reportId 1987 c.reportFragment = reportFragment 1988 return c 1989} 1990 1991// Fields allows partial responses to be retrieved. See 1992// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1993// for more information. 1994func (c *ReportsGetFileCall) Fields(s ...googleapi.Field) *ReportsGetFileCall { 1995 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1996 return c 1997} 1998 1999// IfNoneMatch sets the optional parameter which makes the operation 2000// fail if the object's ETag matches the given value. This is useful for 2001// getting updates only after the object has changed since the last 2002// request. Use googleapi.IsNotModified to check whether the response 2003// error from Do is the result of In-None-Match. 2004func (c *ReportsGetFileCall) IfNoneMatch(entityTag string) *ReportsGetFileCall { 2005 c.ifNoneMatch_ = entityTag 2006 return c 2007} 2008 2009// Context sets the context to be used in this call's Do and Download 2010// methods. Any pending HTTP request will be aborted if the provided 2011// context is canceled. 2012func (c *ReportsGetFileCall) Context(ctx context.Context) *ReportsGetFileCall { 2013 c.ctx_ = ctx 2014 return c 2015} 2016 2017// Header returns an http.Header that can be modified by the caller to 2018// add HTTP headers to the request. 2019func (c *ReportsGetFileCall) Header() http.Header { 2020 if c.header_ == nil { 2021 c.header_ = make(http.Header) 2022 } 2023 return c.header_ 2024} 2025 2026func (c *ReportsGetFileCall) doRequest(alt string) (*http.Response, error) { 2027 reqHeaders := make(http.Header) 2028 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2029 for k, v := range c.header_ { 2030 reqHeaders[k] = v 2031 } 2032 reqHeaders.Set("User-Agent", c.s.userAgent()) 2033 if c.ifNoneMatch_ != "" { 2034 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2035 } 2036 var body io.Reader = nil 2037 c.urlParams_.Set("alt", alt) 2038 c.urlParams_.Set("prettyPrint", "false") 2039 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}") 2040 urls += "?" + c.urlParams_.Encode() 2041 req, err := http.NewRequest("GET", urls, body) 2042 if err != nil { 2043 return nil, err 2044 } 2045 req.Header = reqHeaders 2046 googleapi.Expand(req.URL, map[string]string{ 2047 "reportId": c.reportId, 2048 "reportFragment": strconv.FormatInt(c.reportFragment, 10), 2049 }) 2050 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2051} 2052 2053// Download fetches the API endpoint's "media" value, instead of the normal 2054// API response value. If the returned error is nil, the Response is guaranteed to 2055// have a 2xx status code. Callers must close the Response.Body as usual. 2056func (c *ReportsGetFileCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 2057 gensupport.SetOptions(c.urlParams_, opts...) 2058 res, err := c.doRequest("media") 2059 if err != nil { 2060 return nil, err 2061 } 2062 if err := googleapi.CheckMediaResponse(res); err != nil { 2063 res.Body.Close() 2064 return nil, err 2065 } 2066 return res, nil 2067} 2068 2069// Do executes the "doubleclicksearch.reports.getFile" call. 2070func (c *ReportsGetFileCall) Do(opts ...googleapi.CallOption) error { 2071 gensupport.SetOptions(c.urlParams_, opts...) 2072 res, err := c.doRequest("json") 2073 if err != nil { 2074 return err 2075 } 2076 defer googleapi.CloseBody(res) 2077 if err := googleapi.CheckResponse(res); err != nil { 2078 return err 2079 } 2080 return nil 2081 // { 2082 // "description": "Downloads a report file encoded in UTF-8.", 2083 // "flatPath": "doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}", 2084 // "httpMethod": "GET", 2085 // "id": "doubleclicksearch.reports.getFile", 2086 // "parameterOrder": [ 2087 // "reportId", 2088 // "reportFragment" 2089 // ], 2090 // "parameters": { 2091 // "reportFragment": { 2092 // "description": "The index of the report fragment to download.", 2093 // "format": "int32", 2094 // "location": "path", 2095 // "minimum": "0", 2096 // "required": true, 2097 // "type": "integer" 2098 // }, 2099 // "reportId": { 2100 // "description": "ID of the report.", 2101 // "location": "path", 2102 // "required": true, 2103 // "type": "string" 2104 // } 2105 // }, 2106 // "path": "doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}", 2107 // "scopes": [ 2108 // "https://www.googleapis.com/auth/doubleclicksearch" 2109 // ], 2110 // "supportsMediaDownload": true, 2111 // "useMediaDownloadService": true 2112 // } 2113 2114} 2115 2116// method id "doubleclicksearch.reports.request": 2117 2118type ReportsRequestCall struct { 2119 s *Service 2120 reportrequest *ReportRequest 2121 urlParams_ gensupport.URLParams 2122 ctx_ context.Context 2123 header_ http.Header 2124} 2125 2126// Request: Inserts a report request into the reporting system. 2127func (r *ReportsService) Request(reportrequest *ReportRequest) *ReportsRequestCall { 2128 c := &ReportsRequestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2129 c.reportrequest = reportrequest 2130 return c 2131} 2132 2133// Fields allows partial responses to be retrieved. See 2134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2135// for more information. 2136func (c *ReportsRequestCall) Fields(s ...googleapi.Field) *ReportsRequestCall { 2137 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2138 return c 2139} 2140 2141// Context sets the context to be used in this call's Do method. Any 2142// pending HTTP request will be aborted if the provided context is 2143// canceled. 2144func (c *ReportsRequestCall) Context(ctx context.Context) *ReportsRequestCall { 2145 c.ctx_ = ctx 2146 return c 2147} 2148 2149// Header returns an http.Header that can be modified by the caller to 2150// add HTTP headers to the request. 2151func (c *ReportsRequestCall) Header() http.Header { 2152 if c.header_ == nil { 2153 c.header_ = make(http.Header) 2154 } 2155 return c.header_ 2156} 2157 2158func (c *ReportsRequestCall) doRequest(alt string) (*http.Response, error) { 2159 reqHeaders := make(http.Header) 2160 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2161 for k, v := range c.header_ { 2162 reqHeaders[k] = v 2163 } 2164 reqHeaders.Set("User-Agent", c.s.userAgent()) 2165 var body io.Reader = nil 2166 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 2167 if err != nil { 2168 return nil, err 2169 } 2170 reqHeaders.Set("Content-Type", "application/json") 2171 c.urlParams_.Set("alt", alt) 2172 c.urlParams_.Set("prettyPrint", "false") 2173 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/reports") 2174 urls += "?" + c.urlParams_.Encode() 2175 req, err := http.NewRequest("POST", urls, body) 2176 if err != nil { 2177 return nil, err 2178 } 2179 req.Header = reqHeaders 2180 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2181} 2182 2183// Do executes the "doubleclicksearch.reports.request" call. 2184// Exactly one of *Report or error will be non-nil. Any non-2xx status 2185// code is an error. Response headers are in either 2186// *Report.ServerResponse.Header or (if a response was returned at all) 2187// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2188// check whether the returned error was because http.StatusNotModified 2189// was returned. 2190func (c *ReportsRequestCall) Do(opts ...googleapi.CallOption) (*Report, error) { 2191 gensupport.SetOptions(c.urlParams_, opts...) 2192 res, err := c.doRequest("json") 2193 if res != nil && res.StatusCode == http.StatusNotModified { 2194 if res.Body != nil { 2195 res.Body.Close() 2196 } 2197 return nil, &googleapi.Error{ 2198 Code: res.StatusCode, 2199 Header: res.Header, 2200 } 2201 } 2202 if err != nil { 2203 return nil, err 2204 } 2205 defer googleapi.CloseBody(res) 2206 if err := googleapi.CheckResponse(res); err != nil { 2207 return nil, err 2208 } 2209 ret := &Report{ 2210 ServerResponse: googleapi.ServerResponse{ 2211 Header: res.Header, 2212 HTTPStatusCode: res.StatusCode, 2213 }, 2214 } 2215 target := &ret 2216 if err := gensupport.DecodeResponse(target, res); err != nil { 2217 return nil, err 2218 } 2219 return ret, nil 2220 // { 2221 // "description": "Inserts a report request into the reporting system.", 2222 // "flatPath": "doubleclicksearch/v2/reports", 2223 // "httpMethod": "POST", 2224 // "id": "doubleclicksearch.reports.request", 2225 // "parameterOrder": [], 2226 // "parameters": {}, 2227 // "path": "doubleclicksearch/v2/reports", 2228 // "request": { 2229 // "$ref": "ReportRequest" 2230 // }, 2231 // "response": { 2232 // "$ref": "Report" 2233 // }, 2234 // "scopes": [ 2235 // "https://www.googleapis.com/auth/doubleclicksearch" 2236 // ] 2237 // } 2238 2239} 2240 2241// method id "doubleclicksearch.savedColumns.list": 2242 2243type SavedColumnsListCall struct { 2244 s *Service 2245 agencyId int64 2246 advertiserId int64 2247 urlParams_ gensupport.URLParams 2248 ifNoneMatch_ string 2249 ctx_ context.Context 2250 header_ http.Header 2251} 2252 2253// List: Retrieve the list of saved columns for a specified advertiser. 2254func (r *SavedColumnsService) List(agencyId int64, advertiserId int64) *SavedColumnsListCall { 2255 c := &SavedColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2256 c.agencyId = agencyId 2257 c.advertiserId = advertiserId 2258 return c 2259} 2260 2261// Fields allows partial responses to be retrieved. See 2262// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2263// for more information. 2264func (c *SavedColumnsListCall) Fields(s ...googleapi.Field) *SavedColumnsListCall { 2265 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2266 return c 2267} 2268 2269// IfNoneMatch sets the optional parameter which makes the operation 2270// fail if the object's ETag matches the given value. This is useful for 2271// getting updates only after the object has changed since the last 2272// request. Use googleapi.IsNotModified to check whether the response 2273// error from Do is the result of In-None-Match. 2274func (c *SavedColumnsListCall) IfNoneMatch(entityTag string) *SavedColumnsListCall { 2275 c.ifNoneMatch_ = entityTag 2276 return c 2277} 2278 2279// Context sets the context to be used in this call's Do method. Any 2280// pending HTTP request will be aborted if the provided context is 2281// canceled. 2282func (c *SavedColumnsListCall) Context(ctx context.Context) *SavedColumnsListCall { 2283 c.ctx_ = ctx 2284 return c 2285} 2286 2287// Header returns an http.Header that can be modified by the caller to 2288// add HTTP headers to the request. 2289func (c *SavedColumnsListCall) Header() http.Header { 2290 if c.header_ == nil { 2291 c.header_ = make(http.Header) 2292 } 2293 return c.header_ 2294} 2295 2296func (c *SavedColumnsListCall) doRequest(alt string) (*http.Response, error) { 2297 reqHeaders := make(http.Header) 2298 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2299 for k, v := range c.header_ { 2300 reqHeaders[k] = v 2301 } 2302 reqHeaders.Set("User-Agent", c.s.userAgent()) 2303 if c.ifNoneMatch_ != "" { 2304 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2305 } 2306 var body io.Reader = nil 2307 c.urlParams_.Set("alt", alt) 2308 c.urlParams_.Set("prettyPrint", "false") 2309 urls := googleapi.ResolveRelative(c.s.BasePath, "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns") 2310 urls += "?" + c.urlParams_.Encode() 2311 req, err := http.NewRequest("GET", urls, body) 2312 if err != nil { 2313 return nil, err 2314 } 2315 req.Header = reqHeaders 2316 googleapi.Expand(req.URL, map[string]string{ 2317 "agencyId": strconv.FormatInt(c.agencyId, 10), 2318 "advertiserId": strconv.FormatInt(c.advertiserId, 10), 2319 }) 2320 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2321} 2322 2323// Do executes the "doubleclicksearch.savedColumns.list" call. 2324// Exactly one of *SavedColumnList or error will be non-nil. Any non-2xx 2325// status code is an error. Response headers are in either 2326// *SavedColumnList.ServerResponse.Header or (if a response was returned 2327// at all) in error.(*googleapi.Error).Header. Use 2328// googleapi.IsNotModified to check whether the returned error was 2329// because http.StatusNotModified was returned. 2330func (c *SavedColumnsListCall) Do(opts ...googleapi.CallOption) (*SavedColumnList, error) { 2331 gensupport.SetOptions(c.urlParams_, opts...) 2332 res, err := c.doRequest("json") 2333 if res != nil && res.StatusCode == http.StatusNotModified { 2334 if res.Body != nil { 2335 res.Body.Close() 2336 } 2337 return nil, &googleapi.Error{ 2338 Code: res.StatusCode, 2339 Header: res.Header, 2340 } 2341 } 2342 if err != nil { 2343 return nil, err 2344 } 2345 defer googleapi.CloseBody(res) 2346 if err := googleapi.CheckResponse(res); err != nil { 2347 return nil, err 2348 } 2349 ret := &SavedColumnList{ 2350 ServerResponse: googleapi.ServerResponse{ 2351 Header: res.Header, 2352 HTTPStatusCode: res.StatusCode, 2353 }, 2354 } 2355 target := &ret 2356 if err := gensupport.DecodeResponse(target, res); err != nil { 2357 return nil, err 2358 } 2359 return ret, nil 2360 // { 2361 // "description": "Retrieve the list of saved columns for a specified advertiser.", 2362 // "flatPath": "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns", 2363 // "httpMethod": "GET", 2364 // "id": "doubleclicksearch.savedColumns.list", 2365 // "parameterOrder": [ 2366 // "agencyId", 2367 // "advertiserId" 2368 // ], 2369 // "parameters": { 2370 // "advertiserId": { 2371 // "description": "DS ID of the advertiser.", 2372 // "format": "int64", 2373 // "location": "path", 2374 // "required": true, 2375 // "type": "string" 2376 // }, 2377 // "agencyId": { 2378 // "description": "DS ID of the agency.", 2379 // "format": "int64", 2380 // "location": "path", 2381 // "required": true, 2382 // "type": "string" 2383 // } 2384 // }, 2385 // "path": "doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns", 2386 // "response": { 2387 // "$ref": "SavedColumnList" 2388 // }, 2389 // "scopes": [ 2390 // "https://www.googleapis.com/auth/doubleclicksearch" 2391 // ] 2392 // } 2393 2394} 2395