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.
 
 
 

2469 lines
86 KiB

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