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/doubleclick-search/ 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://www.googleapis.com/doubleclicksearch/v2/" 78 79// OAuth2 scopes used by this API. 80const ( 81 // View and manage your advertising data in DoubleClick Search 82 DoubleclicksearchScope = "https://www.googleapis.com/auth/doubleclicksearch" 83) 84 85// NewService creates a new Service. 86func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 87 scopesOption := option.WithScopes( 88 "https://www.googleapis.com/auth/doubleclicksearch", 89 ) 90 // NOTE: prepend, so we don't override user-specified scopes. 91 opts = append([]option.ClientOption{scopesOption}, opts...) 92 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 93 client, endpoint, err := htransport.NewClient(ctx, opts...) 94 if err != nil { 95 return nil, err 96 } 97 s, err := New(client) 98 if err != nil { 99 return nil, err 100 } 101 if endpoint != "" { 102 s.BasePath = endpoint 103 } 104 return s, nil 105} 106 107// New creates a new Service. It uses the provided http.Client for requests. 108// 109// Deprecated: please use NewService instead. 110// To provide a custom HTTP client, use option.WithHTTPClient. 111// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 112func New(client *http.Client) (*Service, error) { 113 if client == nil { 114 return nil, errors.New("client is nil") 115 } 116 s := &Service{client: client, BasePath: basePath} 117 s.Conversion = NewConversionService(s) 118 s.Reports = NewReportsService(s) 119 s.SavedColumns = NewSavedColumnsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Conversion *ConversionService 129 130 Reports *ReportsService 131 132 SavedColumns *SavedColumnsService 133} 134 135func (s *Service) userAgent() string { 136 if s.UserAgent == "" { 137 return googleapi.UserAgent 138 } 139 return googleapi.UserAgent + " " + s.UserAgent 140} 141 142func NewConversionService(s *Service) *ConversionService { 143 rs := &ConversionService{s: s} 144 return rs 145} 146 147type ConversionService struct { 148 s *Service 149} 150 151func NewReportsService(s *Service) *ReportsService { 152 rs := &ReportsService{s: s} 153 return rs 154} 155 156type ReportsService struct { 157 s *Service 158} 159 160func NewSavedColumnsService(s *Service) *SavedColumnsService { 161 rs := &SavedColumnsService{s: s} 162 return rs 163} 164 165type SavedColumnsService struct { 166 s *Service 167} 168 169// Availability: A message containing availability data relevant to 170// DoubleClick Search. 171type Availability struct { 172 // AdvertiserId: DS advertiser ID. 173 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 174 175 // AgencyId: DS agency ID. 176 AgencyId int64 `json:"agencyId,omitempty,string"` 177 178 // AvailabilityTimestamp: The time by which all conversions have been 179 // uploaded, in epoch millis UTC. 180 AvailabilityTimestamp uint64 `json:"availabilityTimestamp,omitempty,string"` 181 182 // SegmentationId: The numeric segmentation identifier (for example, 183 // DoubleClick Search Floodlight activity ID). 184 SegmentationId int64 `json:"segmentationId,omitempty,string"` 185 186 // SegmentationName: The friendly segmentation identifier (for example, 187 // DoubleClick Search Floodlight activity name). 188 SegmentationName string `json:"segmentationName,omitempty"` 189 190 // SegmentationType: The segmentation type that this availability is for 191 // (its default value is FLOODLIGHT). 192 SegmentationType string `json:"segmentationType,omitempty"` 193 194 // ForceSendFields is a list of field names (e.g. "AdvertiserId") to 195 // unconditionally include in API requests. By default, fields with 196 // empty values are omitted from API requests. However, any non-pointer, 197 // non-interface field appearing in ForceSendFields will be sent to the 198 // server regardless of whether the field is empty or not. This may be 199 // used to include empty fields in Patch requests. 200 ForceSendFields []string `json:"-"` 201 202 // NullFields is a list of field names (e.g. "AdvertiserId") to include 203 // in API requests with the JSON null value. By default, fields with 204 // empty values are omitted from API requests. However, any field with 205 // an empty value appearing in NullFields will be sent to the server as 206 // null. It is an error if a field in this list has a non-empty value. 207 // This may be used to include null fields in Patch requests. 208 NullFields []string `json:"-"` 209} 210 211func (s *Availability) MarshalJSON() ([]byte, error) { 212 type NoMethod Availability 213 raw := NoMethod(*s) 214 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 215} 216 217// Conversion: A conversion containing data relevant to DoubleClick 218// Search. 219type Conversion struct { 220 // AdGroupId: DS ad group ID. 221 AdGroupId int64 `json:"adGroupId,omitempty,string"` 222 223 // AdId: DS ad ID. 224 AdId int64 `json:"adId,omitempty,string"` 225 226 // AdvertiserId: DS advertiser ID. 227 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 228 229 // AgencyId: DS agency ID. 230 AgencyId int64 `json:"agencyId,omitempty,string"` 231 232 // AttributionModel: Available to advertisers only after contacting 233 // DoubleClick Search customer support. 234 AttributionModel string `json:"attributionModel,omitempty"` 235 236 // CampaignId: DS campaign ID. 237 CampaignId int64 `json:"campaignId,omitempty,string"` 238 239 // Channel: Sales channel for the product. Acceptable values are: 240 // - "local": a physical store 241 // - "online": an online store 242 Channel string `json:"channel,omitempty"` 243 244 // ClickId: DS click ID for the conversion. 245 ClickId string `json:"clickId,omitempty"` 246 247 // ConversionId: For offline conversions, advertisers provide this ID. 248 // Advertisers can specify any ID that is meaningful to them. Each 249 // conversion in a request must specify a unique ID, and the combination 250 // of ID and timestamp must be unique amongst all conversions within the 251 // advertiser. 252 // 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 uint64 `json:"conversionModifiedTimestamp,omitempty,string"` 260 261 // ConversionTimestamp: The time at which the conversion took place, in 262 // epoch millis UTC. 263 ConversionTimestamp uint64 `json:"conversionTimestamp,omitempty,string"` 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, in 319 // 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 int64 `json:"revenueMicros,omitempty,string"` 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 has 346 // no monetarily quantifiable value, while a TRANSACTION conversion is 347 // an action that does have a monetarily quantifiable value. Examples 348 // are email list signups (ACTION) versus ecommerce purchases 349 // (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 custome 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 custome 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. 598 // If used in a conversion report, returns the value of the specified 599 // custom dimension for the given conversion, if set. This column does 600 // not segment the conversion report. 601 CustomDimensionName string `json:"customDimensionName,omitempty"` 602 603 // CustomMetricName: Name of a custom metric to include in the report. 604 // The report must be scoped to an advertiser or lower, and the custom 605 // metric must already be set up in DoubleClick Search. The custom 606 // metric name, which appears in DoubleClick Search, is case sensitive. 607 CustomMetricName string `json:"customMetricName,omitempty"` 608 609 // EndDate: Inclusive day in YYYY-MM-DD format. When provided, this 610 // overrides the overall time range of the report for this column only. 611 // Must be provided together with startDate. 612 EndDate string `json:"endDate,omitempty"` 613 614 // GroupByColumn: Synchronous report only. Set to true to group by this 615 // column. Defaults to false. 616 GroupByColumn bool `json:"groupByColumn,omitempty"` 617 618 // HeaderText: Text used to identify this column in the report output; 619 // defaults to columnName or savedColumnName when not specified. This 620 // can be used to prevent collisions between DoubleClick Search columns 621 // and saved columns with the same name. 622 HeaderText string `json:"headerText,omitempty"` 623 624 // PlatformSource: The platform that is used to provide data for the 625 // custom dimension. Acceptable values are "floodlight". 626 PlatformSource string `json:"platformSource,omitempty"` 627 628 // ProductReportPerspective: Returns metrics only for a specific type of 629 // product activity. Accepted values are: 630 // - "sold": returns metrics only for products that were sold 631 // - "advertised": returns metrics only for products that were 632 // advertised in a Shopping campaign, and that might or might not have 633 // been sold 634 ProductReportPerspective string `json:"productReportPerspective,omitempty"` 635 636 // SavedColumnName: Name of a saved column to include in the report. The 637 // report must be scoped at advertiser or lower, and this saved column 638 // must already be created in the DoubleClick Search UI. 639 SavedColumnName string `json:"savedColumnName,omitempty"` 640 641 // StartDate: Inclusive date in YYYY-MM-DD format. When provided, this 642 // overrides the overall time range of the report for this column only. 643 // Must be provided together with endDate. 644 StartDate string `json:"startDate,omitempty"` 645 646 // ForceSendFields is a list of field names (e.g. "ColumnName") to 647 // unconditionally include in API requests. By default, fields with 648 // empty values are omitted from API requests. However, any non-pointer, 649 // non-interface field appearing in ForceSendFields will be sent to the 650 // server regardless of whether the field is empty or not. This may be 651 // used to include empty fields in Patch requests. 652 ForceSendFields []string `json:"-"` 653 654 // NullFields is a list of field names (e.g. "ColumnName") to include in 655 // API requests with the JSON null value. By default, fields with empty 656 // values are omitted from API requests. However, any field with an 657 // empty value appearing in NullFields will be sent to the server as 658 // null. It is an error if a field in this list has a non-empty value. 659 // This may be used to include null fields in Patch requests. 660 NullFields []string `json:"-"` 661} 662 663func (s *ReportApiColumnSpec) MarshalJSON() ([]byte, error) { 664 type NoMethod ReportApiColumnSpec 665 raw := NoMethod(*s) 666 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 667} 668 669// ReportRequest: A request object used to create a DoubleClick Search 670// report. 671type ReportRequest struct { 672 // Columns: The columns to include in the report. This includes both 673 // DoubleClick Search columns and saved columns. For DoubleClick Search 674 // columns, only the columnName parameter is required. For saved columns 675 // only the savedColumnName parameter is required. Both columnName and 676 // savedColumnName cannot be set in the same stanza. 677 // The maximum number of columns per request is 300. 678 Columns []*ReportApiColumnSpec `json:"columns,omitempty"` 679 680 // DownloadFormat: Format that the report should be returned in. 681 // Currently csv or tsv is supported. 682 DownloadFormat string `json:"downloadFormat,omitempty"` 683 684 // Filters: A list of filters to be applied to the report. 685 // The maximum number of filters per request is 300. 686 Filters []*ReportRequestFilters `json:"filters,omitempty"` 687 688 // IncludeDeletedEntities: Determines if removed entities should be 689 // included in the report. Defaults to false. Deprecated, please use 690 // includeRemovedEntities instead. 691 IncludeDeletedEntities bool `json:"includeDeletedEntities,omitempty"` 692 693 // IncludeRemovedEntities: Determines if removed entities should be 694 // included in the report. Defaults to false. 695 IncludeRemovedEntities bool `json:"includeRemovedEntities,omitempty"` 696 697 // MaxRowsPerFile: Asynchronous report only. The maximum number of rows 698 // per report file. A large report is split into many files based on 699 // this field. Acceptable values are 1000000 to 100000000, inclusive. 700 MaxRowsPerFile int64 `json:"maxRowsPerFile,omitempty"` 701 702 // OrderBy: Synchronous report only. A list of columns and directions 703 // defining sorting to be performed on the report rows. 704 // The maximum number of orderings per request is 300. 705 OrderBy []*ReportRequestOrderBy `json:"orderBy,omitempty"` 706 707 // ReportScope: The reportScope is a set of IDs that are used to 708 // determine which subset of entities will be returned in the report. 709 // The full lineage of IDs from the lowest scoped level desired up 710 // through agency is required. 711 ReportScope *ReportRequestReportScope `json:"reportScope,omitempty"` 712 713 // ReportType: Determines the type of rows that are returned in the 714 // report. For example, if you specify reportType: keyword, each row in 715 // the report will contain data about a keyword. See the Types of 716 // Reports reference for the columns that 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 // 723 // Default: 10000 724 RowCount *int64 `json:"rowCount,omitempty"` 725 726 // StartRow: Synchronous report only. Zero-based index of the first row 727 // to return. Acceptable values are 0 to 50000, inclusive. Defaults to 728 // 0. 729 StartRow int64 `json:"startRow,omitempty"` 730 731 // StatisticsCurrency: Specifies the currency in which monetary will be 732 // returned. Possible values are: usd, agency (valid if the report is 733 // scoped to agency or lower), advertiser (valid if the report is scoped 734 // to * advertiser or lower), or account (valid if the report is scoped 735 // to engine account or lower). 736 StatisticsCurrency string `json:"statisticsCurrency,omitempty"` 737 738 // TimeRange: If metrics are requested in a report, this argument will 739 // be used to restrict the metrics to a specific time range. 740 TimeRange *ReportRequestTimeRange `json:"timeRange,omitempty"` 741 742 // VerifySingleTimeZone: If true, the report would only be created if 743 // all the requested stat data are sourced from a single timezone. 744 // Defaults to false. 745 VerifySingleTimeZone bool `json:"verifySingleTimeZone,omitempty"` 746 747 // ForceSendFields is a list of field names (e.g. "Columns") to 748 // unconditionally include in API requests. By default, fields with 749 // empty values are omitted from API requests. However, any non-pointer, 750 // non-interface field appearing in ForceSendFields will be sent to the 751 // server regardless of whether the field is empty or not. This may be 752 // used to include empty fields in Patch requests. 753 ForceSendFields []string `json:"-"` 754 755 // NullFields is a list of field names (e.g. "Columns") to include in 756 // API requests with the JSON null value. By default, fields with empty 757 // values are omitted from API requests. However, any field with an 758 // empty value appearing in NullFields will be sent to the server as 759 // null. It is an error if a field in this list has a non-empty value. 760 // This may be used to include null fields in Patch requests. 761 NullFields []string `json:"-"` 762} 763 764func (s *ReportRequest) MarshalJSON() ([]byte, error) { 765 type NoMethod ReportRequest 766 raw := NoMethod(*s) 767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 768} 769 770type ReportRequestFilters struct { 771 // Column: Column to perform the filter on. This can be a DoubleClick 772 // Search column or a saved column. 773 Column *ReportApiColumnSpec `json:"column,omitempty"` 774 775 // Operator: Operator to use in the filter. See the filter reference for 776 // a list of available operators. 777 Operator string `json:"operator,omitempty"` 778 779 // Values: A list of values to filter the column value against. 780 // The maximum number of filter values per request is 300. 781 Values []interface{} `json:"values,omitempty"` 782 783 // ForceSendFields is a list of field names (e.g. "Column") to 784 // unconditionally include in API requests. By default, fields with 785 // empty values are omitted from API requests. However, any non-pointer, 786 // non-interface field appearing in ForceSendFields will be sent to the 787 // server regardless of whether the field is empty or not. This may be 788 // used to include empty fields in Patch requests. 789 ForceSendFields []string `json:"-"` 790 791 // NullFields is a list of field names (e.g. "Column") to include in API 792 // requests with the JSON null value. By default, fields with empty 793 // values are omitted from API requests. However, any field with an 794 // empty value appearing in NullFields will be sent to the server as 795 // null. It is an error if a field in this list has a non-empty value. 796 // This may be used to include null fields in Patch requests. 797 NullFields []string `json:"-"` 798} 799 800func (s *ReportRequestFilters) MarshalJSON() ([]byte, error) { 801 type NoMethod ReportRequestFilters 802 raw := NoMethod(*s) 803 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 804} 805 806type ReportRequestOrderBy struct { 807 // Column: Column to perform the sort on. This can be a DoubleClick 808 // Search-defined column or a saved column. 809 Column *ReportApiColumnSpec `json:"column,omitempty"` 810 811 // SortOrder: The sort direction, which is either ascending or 812 // descending. 813 SortOrder string `json:"sortOrder,omitempty"` 814 815 // ForceSendFields is a list of field names (e.g. "Column") to 816 // unconditionally include in API requests. By default, fields with 817 // empty values are omitted from API requests. However, any non-pointer, 818 // non-interface field appearing in ForceSendFields will be sent to the 819 // server regardless of whether the field is empty or not. This may be 820 // used to include empty fields in Patch requests. 821 ForceSendFields []string `json:"-"` 822 823 // NullFields is a list of field names (e.g. "Column") to include in API 824 // requests with the JSON null value. By default, fields with empty 825 // values are omitted from API requests. However, any field with an 826 // empty value appearing in NullFields will be sent to the server as 827 // null. It is an error if a field in this list has a non-empty value. 828 // This may be used to include null fields in Patch requests. 829 NullFields []string `json:"-"` 830} 831 832func (s *ReportRequestOrderBy) MarshalJSON() ([]byte, error) { 833 type NoMethod ReportRequestOrderBy 834 raw := NoMethod(*s) 835 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 836} 837 838// ReportRequestReportScope: The reportScope is a set of IDs that are 839// used to determine which subset of entities will be returned in the 840// report. The full lineage of IDs from the lowest scoped level desired 841// up through agency is required. 842type ReportRequestReportScope struct { 843 // AdGroupId: DS ad group ID. 844 AdGroupId int64 `json:"adGroupId,omitempty,string"` 845 846 // AdId: DS ad ID. 847 AdId int64 `json:"adId,omitempty,string"` 848 849 // AdvertiserId: DS advertiser ID. 850 AdvertiserId int64 `json:"advertiserId,omitempty,string"` 851 852 // AgencyId: DS agency ID. 853 AgencyId int64 `json:"agencyId,omitempty,string"` 854 855 // CampaignId: DS campaign ID. 856 CampaignId int64 `json:"campaignId,omitempty,string"` 857 858 // EngineAccountId: DS engine account ID. 859 EngineAccountId int64 `json:"engineAccountId,omitempty,string"` 860 861 // KeywordId: DS keyword ID. 862 KeywordId int64 `json:"keywordId,omitempty,string"` 863 864 // ForceSendFields is a list of field names (e.g. "AdGroupId") to 865 // unconditionally include in API requests. By default, fields with 866 // empty values are omitted from API requests. However, any non-pointer, 867 // non-interface field appearing in ForceSendFields will be sent to the 868 // server regardless of whether the field is empty or not. This may be 869 // used to include empty fields in Patch requests. 870 ForceSendFields []string `json:"-"` 871 872 // NullFields is a list of field names (e.g. "AdGroupId") to include in 873 // API requests with the JSON null value. By default, fields with empty 874 // values are omitted from API requests. However, any field with an 875 // empty value appearing in NullFields will be sent to the server as 876 // null. It is an error if a field in this list has a non-empty value. 877 // This may be used to include null fields in Patch requests. 878 NullFields []string `json:"-"` 879} 880 881func (s *ReportRequestReportScope) MarshalJSON() ([]byte, error) { 882 type NoMethod ReportRequestReportScope 883 raw := NoMethod(*s) 884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 885} 886 887// ReportRequestTimeRange: If metrics are requested in a report, this 888// argument will be used to restrict the metrics to a specific time 889// range. 890type ReportRequestTimeRange struct { 891 // ChangedAttributesSinceTimestamp: Inclusive UTC timestamp in RFC 892 // format, e.g., 2013-07-16T10:16:23.555Z. See additional references on 893 // how changed attribute reports work. 894 ChangedAttributesSinceTimestamp string `json:"changedAttributesSinceTimestamp,omitempty"` 895 896 // ChangedMetricsSinceTimestamp: Inclusive UTC timestamp in RFC format, 897 // e.g., 2013-07-16T10:16:23.555Z. See additional references on how 898 // changed metrics reports work. 899 ChangedMetricsSinceTimestamp string `json:"changedMetricsSinceTimestamp,omitempty"` 900 901 // EndDate: Inclusive date in YYYY-MM-DD format. 902 EndDate string `json:"endDate,omitempty"` 903 904 // StartDate: Inclusive date in YYYY-MM-DD format. 905 StartDate string `json:"startDate,omitempty"` 906 907 // ForceSendFields is a list of field names (e.g. 908 // "ChangedAttributesSinceTimestamp") to unconditionally include in API 909 // requests. By default, fields with empty values are omitted from API 910 // requests. However, any non-pointer, non-interface field appearing in 911 // ForceSendFields will be sent to the server regardless of whether the 912 // field is empty or not. This may be used to include empty fields in 913 // Patch requests. 914 ForceSendFields []string `json:"-"` 915 916 // NullFields is a list of field names (e.g. 917 // "ChangedAttributesSinceTimestamp") to include in API requests with 918 // the JSON null value. By default, fields with empty values are omitted 919 // from API requests. However, any field with an empty value appearing 920 // in NullFields will be sent to the server as null. It is an error if a 921 // field in this list has a non-empty value. This may be used to include 922 // null fields in Patch requests. 923 NullFields []string `json:"-"` 924} 925 926func (s *ReportRequestTimeRange) MarshalJSON() ([]byte, error) { 927 type NoMethod ReportRequestTimeRange 928 raw := NoMethod(*s) 929 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 930} 931 932// SavedColumn: A saved column 933type SavedColumn struct { 934 // Kind: Identifies this as a SavedColumn resource. Value: the fixed 935 // string doubleclicksearch#savedColumn. 936 Kind string `json:"kind,omitempty"` 937 938 // SavedColumnName: The name of the saved column. 939 SavedColumnName string `json:"savedColumnName,omitempty"` 940 941 // Type: The type of data this saved column will produce. 942 Type string `json:"type,omitempty"` 943 944 // ForceSendFields is a list of field names (e.g. "Kind") to 945 // unconditionally include in API requests. By default, fields with 946 // empty values are omitted from API requests. However, any non-pointer, 947 // non-interface field appearing in ForceSendFields will be sent to the 948 // server regardless of whether the field is empty or not. This may be 949 // used to include empty fields in Patch requests. 950 ForceSendFields []string `json:"-"` 951 952 // NullFields is a list of field names (e.g. "Kind") to include in API 953 // requests with the JSON null value. By default, fields with empty 954 // values are omitted from API requests. However, any field with an 955 // empty value appearing in NullFields will be sent to the server as 956 // null. It is an error if a field in this list has a non-empty value. 957 // This may be used to include null fields in Patch requests. 958 NullFields []string `json:"-"` 959} 960 961func (s *SavedColumn) MarshalJSON() ([]byte, error) { 962 type NoMethod SavedColumn 963 raw := NoMethod(*s) 964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 965} 966 967// SavedColumnList: A list of saved columns. Advertisers create saved 968// columns to report on Floodlight activities, Google Analytics goals, 969// or custom KPIs. To request reports with saved columns, you'll need 970// the saved column names that are available from this list. 971type SavedColumnList struct { 972 // Items: The saved columns being requested. 973 Items []*SavedColumn `json:"items,omitempty"` 974 975 // Kind: Identifies this as a SavedColumnList resource. Value: the fixed 976 // string doubleclicksearch#savedColumnList. 977 Kind string `json:"kind,omitempty"` 978 979 // ServerResponse contains the HTTP response code and headers from the 980 // server. 981 googleapi.ServerResponse `json:"-"` 982 983 // ForceSendFields is a list of field names (e.g. "Items") to 984 // unconditionally include in API requests. By default, fields with 985 // empty values are omitted from API requests. However, any non-pointer, 986 // non-interface field appearing in ForceSendFields will be sent to the 987 // server regardless of whether the field is empty or not. This may be 988 // used to include empty fields in Patch requests. 989 ForceSendFields []string `json:"-"` 990 991 // NullFields is a list of field names (e.g. "Items") to include in API 992 // requests with the JSON null value. By default, fields with empty 993 // values are omitted from API requests. However, any field with an 994 // empty value appearing in NullFields will be sent to the server as 995 // null. It is an error if a field in this list has a non-empty value. 996 // This may be used to include null fields in Patch requests. 997 NullFields []string `json:"-"` 998} 999 1000func (s *SavedColumnList) MarshalJSON() ([]byte, error) { 1001 type NoMethod SavedColumnList 1002 raw := NoMethod(*s) 1003 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1004} 1005 1006// UpdateAvailabilityRequest: The request to update availability. 1007type UpdateAvailabilityRequest struct { 1008 // Availabilities: The availabilities being requested. 1009 Availabilities []*Availability `json:"availabilities,omitempty"` 1010 1011 // ForceSendFields is a list of field names (e.g. "Availabilities") to 1012 // unconditionally include in API requests. By default, fields with 1013 // empty values are omitted from API requests. However, any non-pointer, 1014 // non-interface field appearing in ForceSendFields will be sent to the 1015 // server regardless of whether the field is empty or not. This may be 1016 // used to include empty fields in Patch requests. 1017 ForceSendFields []string `json:"-"` 1018 1019 // NullFields is a list of field names (e.g. "Availabilities") to 1020 // include in API requests with the JSON null value. By default, fields 1021 // with empty values are omitted from API requests. However, any field 1022 // with an empty value appearing in NullFields will be sent to the 1023 // server as null. It is an error if a field in this list has a 1024 // non-empty value. This may be used to include null fields in Patch 1025 // requests. 1026 NullFields []string `json:"-"` 1027} 1028 1029func (s *UpdateAvailabilityRequest) MarshalJSON() ([]byte, error) { 1030 type NoMethod UpdateAvailabilityRequest 1031 raw := NoMethod(*s) 1032 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1033} 1034 1035// UpdateAvailabilityResponse: The response to a update availability 1036// request. 1037type UpdateAvailabilityResponse struct { 1038 // Availabilities: The availabilities being returned. 1039 Availabilities []*Availability `json:"availabilities,omitempty"` 1040 1041 // ServerResponse contains the HTTP response code and headers from the 1042 // server. 1043 googleapi.ServerResponse `json:"-"` 1044 1045 // ForceSendFields is a list of field names (e.g. "Availabilities") to 1046 // unconditionally include in API requests. By default, fields with 1047 // empty values are omitted from API requests. However, any non-pointer, 1048 // non-interface field appearing in ForceSendFields will be sent to the 1049 // server regardless of whether the field is empty or not. This may be 1050 // used to include empty fields in Patch requests. 1051 ForceSendFields []string `json:"-"` 1052 1053 // NullFields is a list of field names (e.g. "Availabilities") to 1054 // include in API requests with the JSON null value. By default, fields 1055 // with empty values are omitted from API requests. However, any field 1056 // with an empty value appearing in NullFields will be sent to the 1057 // server as null. It is an error if a field in this list has a 1058 // non-empty value. This may be used to include null fields in Patch 1059 // requests. 1060 NullFields []string `json:"-"` 1061} 1062 1063func (s *UpdateAvailabilityResponse) MarshalJSON() ([]byte, error) { 1064 type NoMethod UpdateAvailabilityResponse 1065 raw := NoMethod(*s) 1066 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1067} 1068 1069// method id "doubleclicksearch.conversion.get": 1070 1071type ConversionGetCall struct { 1072 s *Service 1073 agencyId int64 1074 advertiserId int64 1075 engineAccountId int64 1076 urlParams_ gensupport.URLParams 1077 ifNoneMatch_ string 1078 ctx_ context.Context 1079 header_ http.Header 1080} 1081 1082// Get: Retrieves a list of conversions from a DoubleClick Search engine 1083// account. 1084func (r *ConversionService) Get(agencyId int64, advertiserId int64, engineAccountId int64, endDate int64, rowCount int64, startDate int64, startRow int64) *ConversionGetCall { 1085 c := &ConversionGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1086 c.agencyId = agencyId 1087 c.advertiserId = advertiserId 1088 c.engineAccountId = engineAccountId 1089 c.urlParams_.Set("endDate", fmt.Sprint(endDate)) 1090 c.urlParams_.Set("rowCount", fmt.Sprint(rowCount)) 1091 c.urlParams_.Set("startDate", fmt.Sprint(startDate)) 1092 c.urlParams_.Set("startRow", fmt.Sprint(startRow)) 1093 return c 1094} 1095 1096// AdGroupId sets the optional parameter "adGroupId": Numeric ID of the 1097// ad group. 1098func (c *ConversionGetCall) AdGroupId(adGroupId int64) *ConversionGetCall { 1099 c.urlParams_.Set("adGroupId", fmt.Sprint(adGroupId)) 1100 return c 1101} 1102 1103// AdId sets the optional parameter "adId": Numeric ID of the ad. 1104func (c *ConversionGetCall) AdId(adId int64) *ConversionGetCall { 1105 c.urlParams_.Set("adId", fmt.Sprint(adId)) 1106 return c 1107} 1108 1109// CampaignId sets the optional parameter "campaignId": Numeric ID of 1110// the campaign. 1111func (c *ConversionGetCall) CampaignId(campaignId int64) *ConversionGetCall { 1112 c.urlParams_.Set("campaignId", fmt.Sprint(campaignId)) 1113 return c 1114} 1115 1116// CriterionId sets the optional parameter "criterionId": Numeric ID of 1117// the criterion. 1118func (c *ConversionGetCall) CriterionId(criterionId int64) *ConversionGetCall { 1119 c.urlParams_.Set("criterionId", fmt.Sprint(criterionId)) 1120 return c 1121} 1122 1123// Fields allows partial responses to be retrieved. See 1124// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1125// for more information. 1126func (c *ConversionGetCall) Fields(s ...googleapi.Field) *ConversionGetCall { 1127 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1128 return c 1129} 1130 1131// IfNoneMatch sets the optional parameter which makes the operation 1132// fail if the object's ETag matches the given value. This is useful for 1133// getting updates only after the object has changed since the last 1134// request. Use googleapi.IsNotModified to check whether the response 1135// error from Do is the result of In-None-Match. 1136func (c *ConversionGetCall) IfNoneMatch(entityTag string) *ConversionGetCall { 1137 c.ifNoneMatch_ = entityTag 1138 return c 1139} 1140 1141// Context sets the context to be used in this call's Do method. Any 1142// pending HTTP request will be aborted if the provided context is 1143// canceled. 1144func (c *ConversionGetCall) Context(ctx context.Context) *ConversionGetCall { 1145 c.ctx_ = ctx 1146 return c 1147} 1148 1149// Header returns an http.Header that can be modified by the caller to 1150// add HTTP headers to the request. 1151func (c *ConversionGetCall) Header() http.Header { 1152 if c.header_ == nil { 1153 c.header_ = make(http.Header) 1154 } 1155 return c.header_ 1156} 1157 1158func (c *ConversionGetCall) doRequest(alt string) (*http.Response, error) { 1159 reqHeaders := make(http.Header) 1160 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1161 for k, v := range c.header_ { 1162 reqHeaders[k] = v 1163 } 1164 reqHeaders.Set("User-Agent", c.s.userAgent()) 1165 if c.ifNoneMatch_ != "" { 1166 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1167 } 1168 var body io.Reader = nil 1169 c.urlParams_.Set("alt", alt) 1170 c.urlParams_.Set("prettyPrint", "false") 1171 urls := googleapi.ResolveRelative(c.s.BasePath, "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion") 1172 urls += "?" + c.urlParams_.Encode() 1173 req, err := http.NewRequest("GET", urls, body) 1174 if err != nil { 1175 return nil, err 1176 } 1177 req.Header = reqHeaders 1178 googleapi.Expand(req.URL, map[string]string{ 1179 "agencyId": strconv.FormatInt(c.agencyId, 10), 1180 "advertiserId": strconv.FormatInt(c.advertiserId, 10), 1181 "engineAccountId": strconv.FormatInt(c.engineAccountId, 10), 1182 }) 1183 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1184} 1185 1186// Do executes the "doubleclicksearch.conversion.get" call. 1187// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1188// status code is an error. Response headers are in either 1189// *ConversionList.ServerResponse.Header or (if a response was returned 1190// at all) in error.(*googleapi.Error).Header. Use 1191// googleapi.IsNotModified to check whether the returned error was 1192// because http.StatusNotModified was returned. 1193func (c *ConversionGetCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1194 gensupport.SetOptions(c.urlParams_, opts...) 1195 res, err := c.doRequest("json") 1196 if res != nil && res.StatusCode == http.StatusNotModified { 1197 if res.Body != nil { 1198 res.Body.Close() 1199 } 1200 return nil, &googleapi.Error{ 1201 Code: res.StatusCode, 1202 Header: res.Header, 1203 } 1204 } 1205 if err != nil { 1206 return nil, err 1207 } 1208 defer googleapi.CloseBody(res) 1209 if err := googleapi.CheckResponse(res); err != nil { 1210 return nil, err 1211 } 1212 ret := &ConversionList{ 1213 ServerResponse: googleapi.ServerResponse{ 1214 Header: res.Header, 1215 HTTPStatusCode: res.StatusCode, 1216 }, 1217 } 1218 target := &ret 1219 if err := gensupport.DecodeResponse(target, res); err != nil { 1220 return nil, err 1221 } 1222 return ret, nil 1223 // { 1224 // "description": "Retrieves a list of conversions from a DoubleClick Search engine account.", 1225 // "httpMethod": "GET", 1226 // "id": "doubleclicksearch.conversion.get", 1227 // "parameterOrder": [ 1228 // "agencyId", 1229 // "advertiserId", 1230 // "engineAccountId", 1231 // "endDate", 1232 // "rowCount", 1233 // "startDate", 1234 // "startRow" 1235 // ], 1236 // "parameters": { 1237 // "adGroupId": { 1238 // "description": "Numeric ID of the ad group.", 1239 // "format": "int64", 1240 // "location": "query", 1241 // "type": "string" 1242 // }, 1243 // "adId": { 1244 // "description": "Numeric ID of the ad.", 1245 // "format": "int64", 1246 // "location": "query", 1247 // "type": "string" 1248 // }, 1249 // "advertiserId": { 1250 // "description": "Numeric ID of the advertiser.", 1251 // "format": "int64", 1252 // "location": "path", 1253 // "required": true, 1254 // "type": "string" 1255 // }, 1256 // "agencyId": { 1257 // "description": "Numeric ID of the agency.", 1258 // "format": "int64", 1259 // "location": "path", 1260 // "required": true, 1261 // "type": "string" 1262 // }, 1263 // "campaignId": { 1264 // "description": "Numeric ID of the campaign.", 1265 // "format": "int64", 1266 // "location": "query", 1267 // "type": "string" 1268 // }, 1269 // "criterionId": { 1270 // "description": "Numeric ID of the criterion.", 1271 // "format": "int64", 1272 // "location": "query", 1273 // "type": "string" 1274 // }, 1275 // "endDate": { 1276 // "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1277 // "format": "int32", 1278 // "location": "query", 1279 // "maximum": "99991231", 1280 // "minimum": "20091101", 1281 // "required": true, 1282 // "type": "integer" 1283 // }, 1284 // "engineAccountId": { 1285 // "description": "Numeric ID of the engine account.", 1286 // "format": "int64", 1287 // "location": "path", 1288 // "required": true, 1289 // "type": "string" 1290 // }, 1291 // "rowCount": { 1292 // "description": "The number of conversions to return per call.", 1293 // "format": "int32", 1294 // "location": "query", 1295 // "maximum": "1000", 1296 // "minimum": "1", 1297 // "required": true, 1298 // "type": "integer" 1299 // }, 1300 // "startDate": { 1301 // "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1302 // "format": "int32", 1303 // "location": "query", 1304 // "maximum": "99991231", 1305 // "minimum": "20091101", 1306 // "required": true, 1307 // "type": "integer" 1308 // }, 1309 // "startRow": { 1310 // "description": "The 0-based starting index for retrieving conversions results.", 1311 // "format": "uint32", 1312 // "location": "query", 1313 // "required": true, 1314 // "type": "integer" 1315 // } 1316 // }, 1317 // "path": "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion", 1318 // "response": { 1319 // "$ref": "ConversionList" 1320 // }, 1321 // "scopes": [ 1322 // "https://www.googleapis.com/auth/doubleclicksearch" 1323 // ] 1324 // } 1325 1326} 1327 1328// method id "doubleclicksearch.conversion.insert": 1329 1330type ConversionInsertCall struct { 1331 s *Service 1332 conversionlist *ConversionList 1333 urlParams_ gensupport.URLParams 1334 ctx_ context.Context 1335 header_ http.Header 1336} 1337 1338// Insert: Inserts a batch of new conversions into DoubleClick Search. 1339func (r *ConversionService) Insert(conversionlist *ConversionList) *ConversionInsertCall { 1340 c := &ConversionInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1341 c.conversionlist = conversionlist 1342 return c 1343} 1344 1345// Fields allows partial responses to be retrieved. See 1346// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1347// for more information. 1348func (c *ConversionInsertCall) Fields(s ...googleapi.Field) *ConversionInsertCall { 1349 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1350 return c 1351} 1352 1353// Context sets the context to be used in this call's Do method. Any 1354// pending HTTP request will be aborted if the provided context is 1355// canceled. 1356func (c *ConversionInsertCall) Context(ctx context.Context) *ConversionInsertCall { 1357 c.ctx_ = ctx 1358 return c 1359} 1360 1361// Header returns an http.Header that can be modified by the caller to 1362// add HTTP headers to the request. 1363func (c *ConversionInsertCall) Header() http.Header { 1364 if c.header_ == nil { 1365 c.header_ = make(http.Header) 1366 } 1367 return c.header_ 1368} 1369 1370func (c *ConversionInsertCall) doRequest(alt string) (*http.Response, error) { 1371 reqHeaders := make(http.Header) 1372 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1373 for k, v := range c.header_ { 1374 reqHeaders[k] = v 1375 } 1376 reqHeaders.Set("User-Agent", c.s.userAgent()) 1377 var body io.Reader = nil 1378 body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) 1379 if err != nil { 1380 return nil, err 1381 } 1382 reqHeaders.Set("Content-Type", "application/json") 1383 c.urlParams_.Set("alt", alt) 1384 c.urlParams_.Set("prettyPrint", "false") 1385 urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") 1386 urls += "?" + c.urlParams_.Encode() 1387 req, err := http.NewRequest("POST", urls, body) 1388 if err != nil { 1389 return nil, err 1390 } 1391 req.Header = reqHeaders 1392 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1393} 1394 1395// Do executes the "doubleclicksearch.conversion.insert" call. 1396// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1397// status code is an error. Response headers are in either 1398// *ConversionList.ServerResponse.Header or (if a response was returned 1399// at all) in error.(*googleapi.Error).Header. Use 1400// googleapi.IsNotModified to check whether the returned error was 1401// because http.StatusNotModified was returned. 1402func (c *ConversionInsertCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1403 gensupport.SetOptions(c.urlParams_, opts...) 1404 res, err := c.doRequest("json") 1405 if res != nil && res.StatusCode == http.StatusNotModified { 1406 if res.Body != nil { 1407 res.Body.Close() 1408 } 1409 return nil, &googleapi.Error{ 1410 Code: res.StatusCode, 1411 Header: res.Header, 1412 } 1413 } 1414 if err != nil { 1415 return nil, err 1416 } 1417 defer googleapi.CloseBody(res) 1418 if err := googleapi.CheckResponse(res); err != nil { 1419 return nil, err 1420 } 1421 ret := &ConversionList{ 1422 ServerResponse: googleapi.ServerResponse{ 1423 Header: res.Header, 1424 HTTPStatusCode: res.StatusCode, 1425 }, 1426 } 1427 target := &ret 1428 if err := gensupport.DecodeResponse(target, res); err != nil { 1429 return nil, err 1430 } 1431 return ret, nil 1432 // { 1433 // "description": "Inserts a batch of new conversions into DoubleClick Search.", 1434 // "httpMethod": "POST", 1435 // "id": "doubleclicksearch.conversion.insert", 1436 // "path": "conversion", 1437 // "request": { 1438 // "$ref": "ConversionList" 1439 // }, 1440 // "response": { 1441 // "$ref": "ConversionList" 1442 // }, 1443 // "scopes": [ 1444 // "https://www.googleapis.com/auth/doubleclicksearch" 1445 // ] 1446 // } 1447 1448} 1449 1450// method id "doubleclicksearch.conversion.patch": 1451 1452type ConversionPatchCall struct { 1453 s *Service 1454 conversionlist *ConversionList 1455 urlParams_ gensupport.URLParams 1456 ctx_ context.Context 1457 header_ http.Header 1458} 1459 1460// Patch: Updates a batch of conversions in DoubleClick Search. This 1461// method supports patch semantics. 1462func (r *ConversionService) Patch(advertiserId int64, agencyId int64, endDate int64, engineAccountId int64, rowCount int64, startDate int64, startRow int64, conversionlist *ConversionList) *ConversionPatchCall { 1463 c := &ConversionPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1464 c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId)) 1465 c.urlParams_.Set("agencyId", fmt.Sprint(agencyId)) 1466 c.urlParams_.Set("endDate", fmt.Sprint(endDate)) 1467 c.urlParams_.Set("engineAccountId", fmt.Sprint(engineAccountId)) 1468 c.urlParams_.Set("rowCount", fmt.Sprint(rowCount)) 1469 c.urlParams_.Set("startDate", fmt.Sprint(startDate)) 1470 c.urlParams_.Set("startRow", fmt.Sprint(startRow)) 1471 c.conversionlist = conversionlist 1472 return c 1473} 1474 1475// Fields allows partial responses to be retrieved. See 1476// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1477// for more information. 1478func (c *ConversionPatchCall) Fields(s ...googleapi.Field) *ConversionPatchCall { 1479 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1480 return c 1481} 1482 1483// Context sets the context to be used in this call's Do method. Any 1484// pending HTTP request will be aborted if the provided context is 1485// canceled. 1486func (c *ConversionPatchCall) Context(ctx context.Context) *ConversionPatchCall { 1487 c.ctx_ = ctx 1488 return c 1489} 1490 1491// Header returns an http.Header that can be modified by the caller to 1492// add HTTP headers to the request. 1493func (c *ConversionPatchCall) Header() http.Header { 1494 if c.header_ == nil { 1495 c.header_ = make(http.Header) 1496 } 1497 return c.header_ 1498} 1499 1500func (c *ConversionPatchCall) doRequest(alt string) (*http.Response, error) { 1501 reqHeaders := make(http.Header) 1502 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1503 for k, v := range c.header_ { 1504 reqHeaders[k] = v 1505 } 1506 reqHeaders.Set("User-Agent", c.s.userAgent()) 1507 var body io.Reader = nil 1508 body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) 1509 if err != nil { 1510 return nil, err 1511 } 1512 reqHeaders.Set("Content-Type", "application/json") 1513 c.urlParams_.Set("alt", alt) 1514 c.urlParams_.Set("prettyPrint", "false") 1515 urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") 1516 urls += "?" + c.urlParams_.Encode() 1517 req, err := http.NewRequest("PATCH", urls, body) 1518 if err != nil { 1519 return nil, err 1520 } 1521 req.Header = reqHeaders 1522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1523} 1524 1525// Do executes the "doubleclicksearch.conversion.patch" call. 1526// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1527// status code is an error. Response headers are in either 1528// *ConversionList.ServerResponse.Header or (if a response was returned 1529// at all) in error.(*googleapi.Error).Header. Use 1530// googleapi.IsNotModified to check whether the returned error was 1531// because http.StatusNotModified was returned. 1532func (c *ConversionPatchCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1533 gensupport.SetOptions(c.urlParams_, opts...) 1534 res, err := c.doRequest("json") 1535 if res != nil && res.StatusCode == http.StatusNotModified { 1536 if res.Body != nil { 1537 res.Body.Close() 1538 } 1539 return nil, &googleapi.Error{ 1540 Code: res.StatusCode, 1541 Header: res.Header, 1542 } 1543 } 1544 if err != nil { 1545 return nil, err 1546 } 1547 defer googleapi.CloseBody(res) 1548 if err := googleapi.CheckResponse(res); err != nil { 1549 return nil, err 1550 } 1551 ret := &ConversionList{ 1552 ServerResponse: googleapi.ServerResponse{ 1553 Header: res.Header, 1554 HTTPStatusCode: res.StatusCode, 1555 }, 1556 } 1557 target := &ret 1558 if err := gensupport.DecodeResponse(target, res); err != nil { 1559 return nil, err 1560 } 1561 return ret, nil 1562 // { 1563 // "description": "Updates a batch of conversions in DoubleClick Search. This method supports patch semantics.", 1564 // "httpMethod": "PATCH", 1565 // "id": "doubleclicksearch.conversion.patch", 1566 // "parameterOrder": [ 1567 // "advertiserId", 1568 // "agencyId", 1569 // "endDate", 1570 // "engineAccountId", 1571 // "rowCount", 1572 // "startDate", 1573 // "startRow" 1574 // ], 1575 // "parameters": { 1576 // "advertiserId": { 1577 // "description": "Numeric ID of the advertiser.", 1578 // "format": "int64", 1579 // "location": "query", 1580 // "required": true, 1581 // "type": "string" 1582 // }, 1583 // "agencyId": { 1584 // "description": "Numeric ID of the agency.", 1585 // "format": "int64", 1586 // "location": "query", 1587 // "required": true, 1588 // "type": "string" 1589 // }, 1590 // "endDate": { 1591 // "description": "Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1592 // "format": "int32", 1593 // "location": "query", 1594 // "maximum": "99991231", 1595 // "minimum": "20091101", 1596 // "required": true, 1597 // "type": "integer" 1598 // }, 1599 // "engineAccountId": { 1600 // "description": "Numeric ID of the engine account.", 1601 // "format": "int64", 1602 // "location": "query", 1603 // "required": true, 1604 // "type": "string" 1605 // }, 1606 // "rowCount": { 1607 // "description": "The number of conversions to return per call.", 1608 // "format": "int32", 1609 // "location": "query", 1610 // "maximum": "1000", 1611 // "minimum": "1", 1612 // "required": true, 1613 // "type": "integer" 1614 // }, 1615 // "startDate": { 1616 // "description": "First date (inclusive) on which to retrieve conversions. Format is yyyymmdd.", 1617 // "format": "int32", 1618 // "location": "query", 1619 // "maximum": "99991231", 1620 // "minimum": "20091101", 1621 // "required": true, 1622 // "type": "integer" 1623 // }, 1624 // "startRow": { 1625 // "description": "The 0-based starting index for retrieving conversions results.", 1626 // "format": "uint32", 1627 // "location": "query", 1628 // "required": true, 1629 // "type": "integer" 1630 // } 1631 // }, 1632 // "path": "conversion", 1633 // "request": { 1634 // "$ref": "ConversionList" 1635 // }, 1636 // "response": { 1637 // "$ref": "ConversionList" 1638 // }, 1639 // "scopes": [ 1640 // "https://www.googleapis.com/auth/doubleclicksearch" 1641 // ] 1642 // } 1643 1644} 1645 1646// method id "doubleclicksearch.conversion.update": 1647 1648type ConversionUpdateCall struct { 1649 s *Service 1650 conversionlist *ConversionList 1651 urlParams_ gensupport.URLParams 1652 ctx_ context.Context 1653 header_ http.Header 1654} 1655 1656// Update: Updates a batch of conversions in DoubleClick Search. 1657func (r *ConversionService) Update(conversionlist *ConversionList) *ConversionUpdateCall { 1658 c := &ConversionUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1659 c.conversionlist = conversionlist 1660 return c 1661} 1662 1663// Fields allows partial responses to be retrieved. See 1664// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1665// for more information. 1666func (c *ConversionUpdateCall) Fields(s ...googleapi.Field) *ConversionUpdateCall { 1667 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1668 return c 1669} 1670 1671// Context sets the context to be used in this call's Do method. Any 1672// pending HTTP request will be aborted if the provided context is 1673// canceled. 1674func (c *ConversionUpdateCall) Context(ctx context.Context) *ConversionUpdateCall { 1675 c.ctx_ = ctx 1676 return c 1677} 1678 1679// Header returns an http.Header that can be modified by the caller to 1680// add HTTP headers to the request. 1681func (c *ConversionUpdateCall) Header() http.Header { 1682 if c.header_ == nil { 1683 c.header_ = make(http.Header) 1684 } 1685 return c.header_ 1686} 1687 1688func (c *ConversionUpdateCall) doRequest(alt string) (*http.Response, error) { 1689 reqHeaders := make(http.Header) 1690 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1691 for k, v := range c.header_ { 1692 reqHeaders[k] = v 1693 } 1694 reqHeaders.Set("User-Agent", c.s.userAgent()) 1695 var body io.Reader = nil 1696 body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionlist) 1697 if err != nil { 1698 return nil, err 1699 } 1700 reqHeaders.Set("Content-Type", "application/json") 1701 c.urlParams_.Set("alt", alt) 1702 c.urlParams_.Set("prettyPrint", "false") 1703 urls := googleapi.ResolveRelative(c.s.BasePath, "conversion") 1704 urls += "?" + c.urlParams_.Encode() 1705 req, err := http.NewRequest("PUT", urls, body) 1706 if err != nil { 1707 return nil, err 1708 } 1709 req.Header = reqHeaders 1710 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1711} 1712 1713// Do executes the "doubleclicksearch.conversion.update" call. 1714// Exactly one of *ConversionList or error will be non-nil. Any non-2xx 1715// status code is an error. Response headers are in either 1716// *ConversionList.ServerResponse.Header or (if a response was returned 1717// at all) in error.(*googleapi.Error).Header. Use 1718// googleapi.IsNotModified to check whether the returned error was 1719// because http.StatusNotModified was returned. 1720func (c *ConversionUpdateCall) Do(opts ...googleapi.CallOption) (*ConversionList, error) { 1721 gensupport.SetOptions(c.urlParams_, opts...) 1722 res, err := c.doRequest("json") 1723 if res != nil && res.StatusCode == http.StatusNotModified { 1724 if res.Body != nil { 1725 res.Body.Close() 1726 } 1727 return nil, &googleapi.Error{ 1728 Code: res.StatusCode, 1729 Header: res.Header, 1730 } 1731 } 1732 if err != nil { 1733 return nil, err 1734 } 1735 defer googleapi.CloseBody(res) 1736 if err := googleapi.CheckResponse(res); err != nil { 1737 return nil, err 1738 } 1739 ret := &ConversionList{ 1740 ServerResponse: googleapi.ServerResponse{ 1741 Header: res.Header, 1742 HTTPStatusCode: res.StatusCode, 1743 }, 1744 } 1745 target := &ret 1746 if err := gensupport.DecodeResponse(target, res); err != nil { 1747 return nil, err 1748 } 1749 return ret, nil 1750 // { 1751 // "description": "Updates a batch of conversions in DoubleClick Search.", 1752 // "httpMethod": "PUT", 1753 // "id": "doubleclicksearch.conversion.update", 1754 // "path": "conversion", 1755 // "request": { 1756 // "$ref": "ConversionList" 1757 // }, 1758 // "response": { 1759 // "$ref": "ConversionList" 1760 // }, 1761 // "scopes": [ 1762 // "https://www.googleapis.com/auth/doubleclicksearch" 1763 // ] 1764 // } 1765 1766} 1767 1768// method id "doubleclicksearch.conversion.updateAvailability": 1769 1770type ConversionUpdateAvailabilityCall struct { 1771 s *Service 1772 updateavailabilityrequest *UpdateAvailabilityRequest 1773 urlParams_ gensupport.URLParams 1774 ctx_ context.Context 1775 header_ http.Header 1776} 1777 1778// UpdateAvailability: Updates the availabilities of a batch of 1779// floodlight activities in DoubleClick Search. 1780func (r *ConversionService) UpdateAvailability(updateavailabilityrequest *UpdateAvailabilityRequest) *ConversionUpdateAvailabilityCall { 1781 c := &ConversionUpdateAvailabilityCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1782 c.updateavailabilityrequest = updateavailabilityrequest 1783 return c 1784} 1785 1786// Fields allows partial responses to be retrieved. See 1787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1788// for more information. 1789func (c *ConversionUpdateAvailabilityCall) Fields(s ...googleapi.Field) *ConversionUpdateAvailabilityCall { 1790 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1791 return c 1792} 1793 1794// Context sets the context to be used in this call's Do method. Any 1795// pending HTTP request will be aborted if the provided context is 1796// canceled. 1797func (c *ConversionUpdateAvailabilityCall) Context(ctx context.Context) *ConversionUpdateAvailabilityCall { 1798 c.ctx_ = ctx 1799 return c 1800} 1801 1802// Header returns an http.Header that can be modified by the caller to 1803// add HTTP headers to the request. 1804func (c *ConversionUpdateAvailabilityCall) Header() http.Header { 1805 if c.header_ == nil { 1806 c.header_ = make(http.Header) 1807 } 1808 return c.header_ 1809} 1810 1811func (c *ConversionUpdateAvailabilityCall) doRequest(alt string) (*http.Response, error) { 1812 reqHeaders := make(http.Header) 1813 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1814 for k, v := range c.header_ { 1815 reqHeaders[k] = v 1816 } 1817 reqHeaders.Set("User-Agent", c.s.userAgent()) 1818 var body io.Reader = nil 1819 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateavailabilityrequest) 1820 if err != nil { 1821 return nil, err 1822 } 1823 reqHeaders.Set("Content-Type", "application/json") 1824 c.urlParams_.Set("alt", alt) 1825 c.urlParams_.Set("prettyPrint", "false") 1826 urls := googleapi.ResolveRelative(c.s.BasePath, "conversion/updateAvailability") 1827 urls += "?" + c.urlParams_.Encode() 1828 req, err := http.NewRequest("POST", urls, body) 1829 if err != nil { 1830 return nil, err 1831 } 1832 req.Header = reqHeaders 1833 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1834} 1835 1836// Do executes the "doubleclicksearch.conversion.updateAvailability" call. 1837// Exactly one of *UpdateAvailabilityResponse or error will be non-nil. 1838// Any non-2xx status code is an error. Response headers are in either 1839// *UpdateAvailabilityResponse.ServerResponse.Header or (if a response 1840// was returned at all) in error.(*googleapi.Error).Header. Use 1841// googleapi.IsNotModified to check whether the returned error was 1842// because http.StatusNotModified was returned. 1843func (c *ConversionUpdateAvailabilityCall) Do(opts ...googleapi.CallOption) (*UpdateAvailabilityResponse, error) { 1844 gensupport.SetOptions(c.urlParams_, opts...) 1845 res, err := c.doRequest("json") 1846 if res != nil && res.StatusCode == http.StatusNotModified { 1847 if res.Body != nil { 1848 res.Body.Close() 1849 } 1850 return nil, &googleapi.Error{ 1851 Code: res.StatusCode, 1852 Header: res.Header, 1853 } 1854 } 1855 if err != nil { 1856 return nil, err 1857 } 1858 defer googleapi.CloseBody(res) 1859 if err := googleapi.CheckResponse(res); err != nil { 1860 return nil, err 1861 } 1862 ret := &UpdateAvailabilityResponse{ 1863 ServerResponse: googleapi.ServerResponse{ 1864 Header: res.Header, 1865 HTTPStatusCode: res.StatusCode, 1866 }, 1867 } 1868 target := &ret 1869 if err := gensupport.DecodeResponse(target, res); err != nil { 1870 return nil, err 1871 } 1872 return ret, nil 1873 // { 1874 // "description": "Updates the availabilities of a batch of floodlight activities in DoubleClick Search.", 1875 // "httpMethod": "POST", 1876 // "id": "doubleclicksearch.conversion.updateAvailability", 1877 // "path": "conversion/updateAvailability", 1878 // "request": { 1879 // "$ref": "UpdateAvailabilityRequest", 1880 // "parameterName": "empty" 1881 // }, 1882 // "response": { 1883 // "$ref": "UpdateAvailabilityResponse" 1884 // }, 1885 // "scopes": [ 1886 // "https://www.googleapis.com/auth/doubleclicksearch" 1887 // ] 1888 // } 1889 1890} 1891 1892// method id "doubleclicksearch.reports.generate": 1893 1894type ReportsGenerateCall struct { 1895 s *Service 1896 reportrequest *ReportRequest 1897 urlParams_ gensupport.URLParams 1898 ctx_ context.Context 1899 header_ http.Header 1900} 1901 1902// Generate: Generates and returns a report immediately. 1903func (r *ReportsService) Generate(reportrequest *ReportRequest) *ReportsGenerateCall { 1904 c := &ReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1905 c.reportrequest = reportrequest 1906 return c 1907} 1908 1909// Fields allows partial responses to be retrieved. See 1910// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1911// for more information. 1912func (c *ReportsGenerateCall) Fields(s ...googleapi.Field) *ReportsGenerateCall { 1913 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1914 return c 1915} 1916 1917// Context sets the context to be used in this call's Do method. Any 1918// pending HTTP request will be aborted if the provided context is 1919// canceled. 1920func (c *ReportsGenerateCall) Context(ctx context.Context) *ReportsGenerateCall { 1921 c.ctx_ = ctx 1922 return c 1923} 1924 1925// Header returns an http.Header that can be modified by the caller to 1926// add HTTP headers to the request. 1927func (c *ReportsGenerateCall) Header() http.Header { 1928 if c.header_ == nil { 1929 c.header_ = make(http.Header) 1930 } 1931 return c.header_ 1932} 1933 1934func (c *ReportsGenerateCall) doRequest(alt string) (*http.Response, error) { 1935 reqHeaders := make(http.Header) 1936 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 1937 for k, v := range c.header_ { 1938 reqHeaders[k] = v 1939 } 1940 reqHeaders.Set("User-Agent", c.s.userAgent()) 1941 var body io.Reader = nil 1942 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 1943 if err != nil { 1944 return nil, err 1945 } 1946 reqHeaders.Set("Content-Type", "application/json") 1947 c.urlParams_.Set("alt", alt) 1948 c.urlParams_.Set("prettyPrint", "false") 1949 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/generate") 1950 urls += "?" + c.urlParams_.Encode() 1951 req, err := http.NewRequest("POST", urls, body) 1952 if err != nil { 1953 return nil, err 1954 } 1955 req.Header = reqHeaders 1956 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1957} 1958 1959// Do executes the "doubleclicksearch.reports.generate" call. 1960// Exactly one of *Report or error will be non-nil. Any non-2xx status 1961// code is an error. Response headers are in either 1962// *Report.ServerResponse.Header or (if a response was returned at all) 1963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1964// check whether the returned error was because http.StatusNotModified 1965// was returned. 1966func (c *ReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) { 1967 gensupport.SetOptions(c.urlParams_, opts...) 1968 res, err := c.doRequest("json") 1969 if res != nil && res.StatusCode == http.StatusNotModified { 1970 if res.Body != nil { 1971 res.Body.Close() 1972 } 1973 return nil, &googleapi.Error{ 1974 Code: res.StatusCode, 1975 Header: res.Header, 1976 } 1977 } 1978 if err != nil { 1979 return nil, err 1980 } 1981 defer googleapi.CloseBody(res) 1982 if err := googleapi.CheckResponse(res); err != nil { 1983 return nil, err 1984 } 1985 ret := &Report{ 1986 ServerResponse: googleapi.ServerResponse{ 1987 Header: res.Header, 1988 HTTPStatusCode: res.StatusCode, 1989 }, 1990 } 1991 target := &ret 1992 if err := gensupport.DecodeResponse(target, res); err != nil { 1993 return nil, err 1994 } 1995 return ret, nil 1996 // { 1997 // "description": "Generates and returns a report immediately.", 1998 // "httpMethod": "POST", 1999 // "id": "doubleclicksearch.reports.generate", 2000 // "path": "reports/generate", 2001 // "request": { 2002 // "$ref": "ReportRequest", 2003 // "parameterName": "reportRequest" 2004 // }, 2005 // "response": { 2006 // "$ref": "Report" 2007 // }, 2008 // "scopes": [ 2009 // "https://www.googleapis.com/auth/doubleclicksearch" 2010 // ] 2011 // } 2012 2013} 2014 2015// method id "doubleclicksearch.reports.get": 2016 2017type ReportsGetCall struct { 2018 s *Service 2019 reportId string 2020 urlParams_ gensupport.URLParams 2021 ifNoneMatch_ string 2022 ctx_ context.Context 2023 header_ http.Header 2024} 2025 2026// Get: Polls for the status of a report request. 2027func (r *ReportsService) Get(reportId string) *ReportsGetCall { 2028 c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2029 c.reportId = reportId 2030 return c 2031} 2032 2033// Fields allows partial responses to be retrieved. See 2034// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2035// for more information. 2036func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall { 2037 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2038 return c 2039} 2040 2041// IfNoneMatch sets the optional parameter which makes the operation 2042// fail if the object's ETag matches the given value. This is useful for 2043// getting updates only after the object has changed since the last 2044// request. Use googleapi.IsNotModified to check whether the response 2045// error from Do is the result of In-None-Match. 2046func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall { 2047 c.ifNoneMatch_ = entityTag 2048 return c 2049} 2050 2051// Context sets the context to be used in this call's Do method. Any 2052// pending HTTP request will be aborted if the provided context is 2053// canceled. 2054func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall { 2055 c.ctx_ = ctx 2056 return c 2057} 2058 2059// Header returns an http.Header that can be modified by the caller to 2060// add HTTP headers to the request. 2061func (c *ReportsGetCall) Header() http.Header { 2062 if c.header_ == nil { 2063 c.header_ = make(http.Header) 2064 } 2065 return c.header_ 2066} 2067 2068func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) { 2069 reqHeaders := make(http.Header) 2070 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2071 for k, v := range c.header_ { 2072 reqHeaders[k] = v 2073 } 2074 reqHeaders.Set("User-Agent", c.s.userAgent()) 2075 if c.ifNoneMatch_ != "" { 2076 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2077 } 2078 var body io.Reader = nil 2079 c.urlParams_.Set("alt", alt) 2080 c.urlParams_.Set("prettyPrint", "false") 2081 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}") 2082 urls += "?" + c.urlParams_.Encode() 2083 req, err := http.NewRequest("GET", urls, body) 2084 if err != nil { 2085 return nil, err 2086 } 2087 req.Header = reqHeaders 2088 googleapi.Expand(req.URL, map[string]string{ 2089 "reportId": c.reportId, 2090 }) 2091 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2092} 2093 2094// Do executes the "doubleclicksearch.reports.get" call. 2095// Exactly one of *Report or error will be non-nil. Any non-2xx status 2096// code is an error. Response headers are in either 2097// *Report.ServerResponse.Header or (if a response was returned at all) 2098// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2099// check whether the returned error was because http.StatusNotModified 2100// was returned. 2101func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) { 2102 gensupport.SetOptions(c.urlParams_, opts...) 2103 res, err := c.doRequest("json") 2104 if res != nil && res.StatusCode == http.StatusNotModified { 2105 if res.Body != nil { 2106 res.Body.Close() 2107 } 2108 return nil, &googleapi.Error{ 2109 Code: res.StatusCode, 2110 Header: res.Header, 2111 } 2112 } 2113 if err != nil { 2114 return nil, err 2115 } 2116 defer googleapi.CloseBody(res) 2117 if err := googleapi.CheckResponse(res); err != nil { 2118 return nil, err 2119 } 2120 ret := &Report{ 2121 ServerResponse: googleapi.ServerResponse{ 2122 Header: res.Header, 2123 HTTPStatusCode: res.StatusCode, 2124 }, 2125 } 2126 target := &ret 2127 if err := gensupport.DecodeResponse(target, res); err != nil { 2128 return nil, err 2129 } 2130 return ret, nil 2131 // { 2132 // "description": "Polls for the status of a report request.", 2133 // "httpMethod": "GET", 2134 // "id": "doubleclicksearch.reports.get", 2135 // "parameterOrder": [ 2136 // "reportId" 2137 // ], 2138 // "parameters": { 2139 // "reportId": { 2140 // "description": "ID of the report request being polled.", 2141 // "location": "path", 2142 // "required": true, 2143 // "type": "string" 2144 // } 2145 // }, 2146 // "path": "reports/{reportId}", 2147 // "response": { 2148 // "$ref": "Report" 2149 // }, 2150 // "scopes": [ 2151 // "https://www.googleapis.com/auth/doubleclicksearch" 2152 // ] 2153 // } 2154 2155} 2156 2157// method id "doubleclicksearch.reports.getFile": 2158 2159type ReportsGetFileCall struct { 2160 s *Service 2161 reportId string 2162 reportFragment int64 2163 urlParams_ gensupport.URLParams 2164 ifNoneMatch_ string 2165 ctx_ context.Context 2166 header_ http.Header 2167} 2168 2169// GetFile: Downloads a report file encoded in UTF-8. 2170func (r *ReportsService) GetFile(reportId string, reportFragment int64) *ReportsGetFileCall { 2171 c := &ReportsGetFileCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2172 c.reportId = reportId 2173 c.reportFragment = reportFragment 2174 return c 2175} 2176 2177// Fields allows partial responses to be retrieved. See 2178// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2179// for more information. 2180func (c *ReportsGetFileCall) Fields(s ...googleapi.Field) *ReportsGetFileCall { 2181 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2182 return c 2183} 2184 2185// IfNoneMatch sets the optional parameter which makes the operation 2186// fail if the object's ETag matches the given value. This is useful for 2187// getting updates only after the object has changed since the last 2188// request. Use googleapi.IsNotModified to check whether the response 2189// error from Do is the result of In-None-Match. 2190func (c *ReportsGetFileCall) IfNoneMatch(entityTag string) *ReportsGetFileCall { 2191 c.ifNoneMatch_ = entityTag 2192 return c 2193} 2194 2195// Context sets the context to be used in this call's Do and Download 2196// methods. Any pending HTTP request will be aborted if the provided 2197// context is canceled. 2198func (c *ReportsGetFileCall) Context(ctx context.Context) *ReportsGetFileCall { 2199 c.ctx_ = ctx 2200 return c 2201} 2202 2203// Header returns an http.Header that can be modified by the caller to 2204// add HTTP headers to the request. 2205func (c *ReportsGetFileCall) Header() http.Header { 2206 if c.header_ == nil { 2207 c.header_ = make(http.Header) 2208 } 2209 return c.header_ 2210} 2211 2212func (c *ReportsGetFileCall) doRequest(alt string) (*http.Response, error) { 2213 reqHeaders := make(http.Header) 2214 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2215 for k, v := range c.header_ { 2216 reqHeaders[k] = v 2217 } 2218 reqHeaders.Set("User-Agent", c.s.userAgent()) 2219 if c.ifNoneMatch_ != "" { 2220 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2221 } 2222 var body io.Reader = nil 2223 c.urlParams_.Set("alt", alt) 2224 c.urlParams_.Set("prettyPrint", "false") 2225 urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{reportFragment}") 2226 urls += "?" + c.urlParams_.Encode() 2227 req, err := http.NewRequest("GET", urls, body) 2228 if err != nil { 2229 return nil, err 2230 } 2231 req.Header = reqHeaders 2232 googleapi.Expand(req.URL, map[string]string{ 2233 "reportId": c.reportId, 2234 "reportFragment": strconv.FormatInt(c.reportFragment, 10), 2235 }) 2236 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2237} 2238 2239// Download fetches the API endpoint's "media" value, instead of the normal 2240// API response value. If the returned error is nil, the Response is guaranteed to 2241// have a 2xx status code. Callers must close the Response.Body as usual. 2242func (c *ReportsGetFileCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 2243 gensupport.SetOptions(c.urlParams_, opts...) 2244 res, err := c.doRequest("media") 2245 if err != nil { 2246 return nil, err 2247 } 2248 if err := googleapi.CheckMediaResponse(res); err != nil { 2249 res.Body.Close() 2250 return nil, err 2251 } 2252 return res, nil 2253} 2254 2255// Do executes the "doubleclicksearch.reports.getFile" call. 2256func (c *ReportsGetFileCall) Do(opts ...googleapi.CallOption) error { 2257 gensupport.SetOptions(c.urlParams_, opts...) 2258 res, err := c.doRequest("json") 2259 if err != nil { 2260 return err 2261 } 2262 defer googleapi.CloseBody(res) 2263 if err := googleapi.CheckResponse(res); err != nil { 2264 return err 2265 } 2266 return nil 2267 // { 2268 // "description": "Downloads a report file encoded in UTF-8.", 2269 // "httpMethod": "GET", 2270 // "id": "doubleclicksearch.reports.getFile", 2271 // "parameterOrder": [ 2272 // "reportId", 2273 // "reportFragment" 2274 // ], 2275 // "parameters": { 2276 // "reportFragment": { 2277 // "description": "The index of the report fragment to download.", 2278 // "format": "int32", 2279 // "location": "path", 2280 // "minimum": "0", 2281 // "required": true, 2282 // "type": "integer" 2283 // }, 2284 // "reportId": { 2285 // "description": "ID of the report.", 2286 // "location": "path", 2287 // "required": true, 2288 // "type": "string" 2289 // } 2290 // }, 2291 // "path": "reports/{reportId}/files/{reportFragment}", 2292 // "scopes": [ 2293 // "https://www.googleapis.com/auth/doubleclicksearch" 2294 // ], 2295 // "supportsMediaDownload": true, 2296 // "useMediaDownloadService": true 2297 // } 2298 2299} 2300 2301// method id "doubleclicksearch.reports.request": 2302 2303type ReportsRequestCall struct { 2304 s *Service 2305 reportrequest *ReportRequest 2306 urlParams_ gensupport.URLParams 2307 ctx_ context.Context 2308 header_ http.Header 2309} 2310 2311// Request: Inserts a report request into the reporting system. 2312func (r *ReportsService) Request(reportrequest *ReportRequest) *ReportsRequestCall { 2313 c := &ReportsRequestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2314 c.reportrequest = reportrequest 2315 return c 2316} 2317 2318// Fields allows partial responses to be retrieved. See 2319// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2320// for more information. 2321func (c *ReportsRequestCall) Fields(s ...googleapi.Field) *ReportsRequestCall { 2322 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2323 return c 2324} 2325 2326// Context sets the context to be used in this call's Do method. Any 2327// pending HTTP request will be aborted if the provided context is 2328// canceled. 2329func (c *ReportsRequestCall) Context(ctx context.Context) *ReportsRequestCall { 2330 c.ctx_ = ctx 2331 return c 2332} 2333 2334// Header returns an http.Header that can be modified by the caller to 2335// add HTTP headers to the request. 2336func (c *ReportsRequestCall) Header() http.Header { 2337 if c.header_ == nil { 2338 c.header_ = make(http.Header) 2339 } 2340 return c.header_ 2341} 2342 2343func (c *ReportsRequestCall) doRequest(alt string) (*http.Response, error) { 2344 reqHeaders := make(http.Header) 2345 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2346 for k, v := range c.header_ { 2347 reqHeaders[k] = v 2348 } 2349 reqHeaders.Set("User-Agent", c.s.userAgent()) 2350 var body io.Reader = nil 2351 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportrequest) 2352 if err != nil { 2353 return nil, err 2354 } 2355 reqHeaders.Set("Content-Type", "application/json") 2356 c.urlParams_.Set("alt", alt) 2357 c.urlParams_.Set("prettyPrint", "false") 2358 urls := googleapi.ResolveRelative(c.s.BasePath, "reports") 2359 urls += "?" + c.urlParams_.Encode() 2360 req, err := http.NewRequest("POST", urls, body) 2361 if err != nil { 2362 return nil, err 2363 } 2364 req.Header = reqHeaders 2365 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2366} 2367 2368// Do executes the "doubleclicksearch.reports.request" call. 2369// Exactly one of *Report or error will be non-nil. Any non-2xx status 2370// code is an error. Response headers are in either 2371// *Report.ServerResponse.Header or (if a response was returned at all) 2372// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2373// check whether the returned error was because http.StatusNotModified 2374// was returned. 2375func (c *ReportsRequestCall) Do(opts ...googleapi.CallOption) (*Report, error) { 2376 gensupport.SetOptions(c.urlParams_, opts...) 2377 res, err := c.doRequest("json") 2378 if res != nil && res.StatusCode == http.StatusNotModified { 2379 if res.Body != nil { 2380 res.Body.Close() 2381 } 2382 return nil, &googleapi.Error{ 2383 Code: res.StatusCode, 2384 Header: res.Header, 2385 } 2386 } 2387 if err != nil { 2388 return nil, err 2389 } 2390 defer googleapi.CloseBody(res) 2391 if err := googleapi.CheckResponse(res); err != nil { 2392 return nil, err 2393 } 2394 ret := &Report{ 2395 ServerResponse: googleapi.ServerResponse{ 2396 Header: res.Header, 2397 HTTPStatusCode: res.StatusCode, 2398 }, 2399 } 2400 target := &ret 2401 if err := gensupport.DecodeResponse(target, res); err != nil { 2402 return nil, err 2403 } 2404 return ret, nil 2405 // { 2406 // "description": "Inserts a report request into the reporting system.", 2407 // "httpMethod": "POST", 2408 // "id": "doubleclicksearch.reports.request", 2409 // "path": "reports", 2410 // "request": { 2411 // "$ref": "ReportRequest", 2412 // "parameterName": "reportRequest" 2413 // }, 2414 // "response": { 2415 // "$ref": "Report" 2416 // }, 2417 // "scopes": [ 2418 // "https://www.googleapis.com/auth/doubleclicksearch" 2419 // ] 2420 // } 2421 2422} 2423 2424// method id "doubleclicksearch.savedColumns.list": 2425 2426type SavedColumnsListCall struct { 2427 s *Service 2428 agencyId int64 2429 advertiserId int64 2430 urlParams_ gensupport.URLParams 2431 ifNoneMatch_ string 2432 ctx_ context.Context 2433 header_ http.Header 2434} 2435 2436// List: Retrieve the list of saved columns for a specified advertiser. 2437func (r *SavedColumnsService) List(agencyId int64, advertiserId int64) *SavedColumnsListCall { 2438 c := &SavedColumnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2439 c.agencyId = agencyId 2440 c.advertiserId = advertiserId 2441 return c 2442} 2443 2444// Fields allows partial responses to be retrieved. See 2445// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2446// for more information. 2447func (c *SavedColumnsListCall) Fields(s ...googleapi.Field) *SavedColumnsListCall { 2448 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2449 return c 2450} 2451 2452// IfNoneMatch sets the optional parameter which makes the operation 2453// fail if the object's ETag matches the given value. This is useful for 2454// getting updates only after the object has changed since the last 2455// request. Use googleapi.IsNotModified to check whether the response 2456// error from Do is the result of In-None-Match. 2457func (c *SavedColumnsListCall) IfNoneMatch(entityTag string) *SavedColumnsListCall { 2458 c.ifNoneMatch_ = entityTag 2459 return c 2460} 2461 2462// Context sets the context to be used in this call's Do method. Any 2463// pending HTTP request will be aborted if the provided context is 2464// canceled. 2465func (c *SavedColumnsListCall) Context(ctx context.Context) *SavedColumnsListCall { 2466 c.ctx_ = ctx 2467 return c 2468} 2469 2470// Header returns an http.Header that can be modified by the caller to 2471// add HTTP headers to the request. 2472func (c *SavedColumnsListCall) Header() http.Header { 2473 if c.header_ == nil { 2474 c.header_ = make(http.Header) 2475 } 2476 return c.header_ 2477} 2478 2479func (c *SavedColumnsListCall) doRequest(alt string) (*http.Response, error) { 2480 reqHeaders := make(http.Header) 2481 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200302") 2482 for k, v := range c.header_ { 2483 reqHeaders[k] = v 2484 } 2485 reqHeaders.Set("User-Agent", c.s.userAgent()) 2486 if c.ifNoneMatch_ != "" { 2487 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2488 } 2489 var body io.Reader = nil 2490 c.urlParams_.Set("alt", alt) 2491 c.urlParams_.Set("prettyPrint", "false") 2492 urls := googleapi.ResolveRelative(c.s.BasePath, "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns") 2493 urls += "?" + c.urlParams_.Encode() 2494 req, err := http.NewRequest("GET", urls, body) 2495 if err != nil { 2496 return nil, err 2497 } 2498 req.Header = reqHeaders 2499 googleapi.Expand(req.URL, map[string]string{ 2500 "agencyId": strconv.FormatInt(c.agencyId, 10), 2501 "advertiserId": strconv.FormatInt(c.advertiserId, 10), 2502 }) 2503 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2504} 2505 2506// Do executes the "doubleclicksearch.savedColumns.list" call. 2507// Exactly one of *SavedColumnList or error will be non-nil. Any non-2xx 2508// status code is an error. Response headers are in either 2509// *SavedColumnList.ServerResponse.Header or (if a response was returned 2510// at all) in error.(*googleapi.Error).Header. Use 2511// googleapi.IsNotModified to check whether the returned error was 2512// because http.StatusNotModified was returned. 2513func (c *SavedColumnsListCall) Do(opts ...googleapi.CallOption) (*SavedColumnList, error) { 2514 gensupport.SetOptions(c.urlParams_, opts...) 2515 res, err := c.doRequest("json") 2516 if res != nil && res.StatusCode == http.StatusNotModified { 2517 if res.Body != nil { 2518 res.Body.Close() 2519 } 2520 return nil, &googleapi.Error{ 2521 Code: res.StatusCode, 2522 Header: res.Header, 2523 } 2524 } 2525 if err != nil { 2526 return nil, err 2527 } 2528 defer googleapi.CloseBody(res) 2529 if err := googleapi.CheckResponse(res); err != nil { 2530 return nil, err 2531 } 2532 ret := &SavedColumnList{ 2533 ServerResponse: googleapi.ServerResponse{ 2534 Header: res.Header, 2535 HTTPStatusCode: res.StatusCode, 2536 }, 2537 } 2538 target := &ret 2539 if err := gensupport.DecodeResponse(target, res); err != nil { 2540 return nil, err 2541 } 2542 return ret, nil 2543 // { 2544 // "description": "Retrieve the list of saved columns for a specified advertiser.", 2545 // "httpMethod": "GET", 2546 // "id": "doubleclicksearch.savedColumns.list", 2547 // "parameterOrder": [ 2548 // "agencyId", 2549 // "advertiserId" 2550 // ], 2551 // "parameters": { 2552 // "advertiserId": { 2553 // "description": "DS ID of the advertiser.", 2554 // "format": "int64", 2555 // "location": "path", 2556 // "required": true, 2557 // "type": "string" 2558 // }, 2559 // "agencyId": { 2560 // "description": "DS ID of the agency.", 2561 // "format": "int64", 2562 // "location": "path", 2563 // "required": true, 2564 // "type": "string" 2565 // } 2566 // }, 2567 // "path": "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns", 2568 // "response": { 2569 // "$ref": "SavedColumnList" 2570 // }, 2571 // "scopes": [ 2572 // "https://www.googleapis.com/auth/doubleclicksearch" 2573 // ] 2574 // } 2575 2576} 2577