You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2564 lines
89 KiB

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