Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

2718 rader
92 KiB

  1. // Package doubleclickbidmanager provides access to the DoubleClick Bid Manager API.
  2. //
  3. // See https://developers.google.com/bid-manager/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/doubleclickbidmanager/v1"
  8. // ...
  9. // doubleclickbidmanagerService, err := doubleclickbidmanager.New(oauthHttpClient)
  10. package doubleclickbidmanager // import "google.golang.org/api/doubleclickbidmanager/v1"
  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 = "doubleclickbidmanager:v1"
  41. const apiName = "doubleclickbidmanager"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/doubleclickbidmanager/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your reports in DoubleClick Bid Manager
  47. DoubleclickbidmanagerScope = "https://www.googleapis.com/auth/doubleclickbidmanager"
  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.Lineitems = NewLineitemsService(s)
  55. s.Queries = NewQueriesService(s)
  56. s.Reports = NewReportsService(s)
  57. s.Sdf = NewSdfService(s)
  58. return s, nil
  59. }
  60. type Service struct {
  61. client *http.Client
  62. BasePath string // API endpoint base URL
  63. UserAgent string // optional additional User-Agent fragment
  64. Lineitems *LineitemsService
  65. Queries *QueriesService
  66. Reports *ReportsService
  67. Sdf *SdfService
  68. }
  69. func (s *Service) userAgent() string {
  70. if s.UserAgent == "" {
  71. return googleapi.UserAgent
  72. }
  73. return googleapi.UserAgent + " " + s.UserAgent
  74. }
  75. func NewLineitemsService(s *Service) *LineitemsService {
  76. rs := &LineitemsService{s: s}
  77. return rs
  78. }
  79. type LineitemsService struct {
  80. s *Service
  81. }
  82. func NewQueriesService(s *Service) *QueriesService {
  83. rs := &QueriesService{s: s}
  84. return rs
  85. }
  86. type QueriesService struct {
  87. s *Service
  88. }
  89. func NewReportsService(s *Service) *ReportsService {
  90. rs := &ReportsService{s: s}
  91. return rs
  92. }
  93. type ReportsService struct {
  94. s *Service
  95. }
  96. func NewSdfService(s *Service) *SdfService {
  97. rs := &SdfService{s: s}
  98. return rs
  99. }
  100. type SdfService struct {
  101. s *Service
  102. }
  103. // DownloadLineItemsRequest: Request to fetch stored line items.
  104. type DownloadLineItemsRequest struct {
  105. // FileSpec: File specification (column names, types, order) in which
  106. // the line items will be returned. Default to EWF.
  107. //
  108. // Possible values:
  109. // "EWF"
  110. FileSpec string `json:"fileSpec,omitempty"`
  111. // FilterIds: Ids of the specified filter type used to filter line items
  112. // to fetch. If omitted, all the line items will be returned.
  113. FilterIds googleapi.Int64s `json:"filterIds,omitempty"`
  114. // FilterType: Filter type used to filter line items to fetch.
  115. //
  116. // Possible values:
  117. // "ADVERTISER_ID"
  118. // "INSERTION_ORDER_ID"
  119. // "LINE_ITEM_ID"
  120. FilterType string `json:"filterType,omitempty"`
  121. // Format: Format in which the line items will be returned. Default to
  122. // CSV.
  123. //
  124. // Possible values:
  125. // "CSV"
  126. Format string `json:"format,omitempty"`
  127. // ForceSendFields is a list of field names (e.g. "FileSpec") to
  128. // unconditionally include in API requests. By default, fields with
  129. // empty values are omitted from API requests. However, any non-pointer,
  130. // non-interface field appearing in ForceSendFields will be sent to the
  131. // server regardless of whether the field is empty or not. This may be
  132. // used to include empty fields in Patch requests.
  133. ForceSendFields []string `json:"-"`
  134. // NullFields is a list of field names (e.g. "FileSpec") to include in
  135. // API requests with the JSON null value. By default, fields with empty
  136. // values are omitted from API requests. However, any field with an
  137. // empty value appearing in NullFields will be sent to the server as
  138. // null. It is an error if a field in this list has a non-empty value.
  139. // This may be used to include null fields in Patch requests.
  140. NullFields []string `json:"-"`
  141. }
  142. func (s *DownloadLineItemsRequest) MarshalJSON() ([]byte, error) {
  143. type NoMethod DownloadLineItemsRequest
  144. raw := NoMethod(*s)
  145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  146. }
  147. // DownloadLineItemsResponse: Download line items response.
  148. type DownloadLineItemsResponse struct {
  149. // LineItems: Retrieved line items in CSV format. For more information
  150. // about file formats, see Entity Write File Format.
  151. LineItems string `json:"lineItems,omitempty"`
  152. // ServerResponse contains the HTTP response code and headers from the
  153. // server.
  154. googleapi.ServerResponse `json:"-"`
  155. // ForceSendFields is a list of field names (e.g. "LineItems") to
  156. // unconditionally include in API requests. By default, fields with
  157. // empty values are omitted from API requests. However, any non-pointer,
  158. // non-interface field appearing in ForceSendFields will be sent to the
  159. // server regardless of whether the field is empty or not. This may be
  160. // used to include empty fields in Patch requests.
  161. ForceSendFields []string `json:"-"`
  162. // NullFields is a list of field names (e.g. "LineItems") to include in
  163. // API requests with the JSON null value. By default, fields with empty
  164. // values are omitted from API requests. However, any field with an
  165. // empty value appearing in NullFields will be sent to the server as
  166. // null. It is an error if a field in this list has a non-empty value.
  167. // This may be used to include null fields in Patch requests.
  168. NullFields []string `json:"-"`
  169. }
  170. func (s *DownloadLineItemsResponse) MarshalJSON() ([]byte, error) {
  171. type NoMethod DownloadLineItemsResponse
  172. raw := NoMethod(*s)
  173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  174. }
  175. // DownloadRequest: Request to fetch stored insertion orders, line
  176. // items, TrueView ad groups and ads.
  177. type DownloadRequest struct {
  178. // FileTypes: File types that will be returned.
  179. //
  180. // Possible values:
  181. // "AD"
  182. // "AD_GROUP"
  183. // "CAMPAIGN"
  184. // "INSERTION_ORDER"
  185. // "LINE_ITEM"
  186. FileTypes []string `json:"fileTypes,omitempty"`
  187. // FilterIds: The IDs of the specified filter type. This is used to
  188. // filter entities to fetch. At least one ID must be specified. Only one
  189. // ID is allowed for the ADVERTISER_ID filter type. For
  190. // INSERTION_ORDER_ID or LINE_ITEM_ID filter types, all IDs must be from
  191. // the same Advertiser.
  192. FilterIds googleapi.Int64s `json:"filterIds,omitempty"`
  193. // FilterType: Filter type used to filter line items to fetch.
  194. //
  195. // Possible values:
  196. // "ADVERTISER_ID"
  197. // "CAMPAIGN_ID"
  198. // "INSERTION_ORDER_ID"
  199. // "LINE_ITEM_ID"
  200. FilterType string `json:"filterType,omitempty"`
  201. // Version: SDF Version (column names, types, order) in which the
  202. // entities will be returned. Default to 3.
  203. Version string `json:"version,omitempty"`
  204. // ForceSendFields is a list of field names (e.g. "FileTypes") to
  205. // unconditionally include in API requests. By default, fields with
  206. // empty values are omitted from API requests. However, any non-pointer,
  207. // non-interface field appearing in ForceSendFields will be sent to the
  208. // server regardless of whether the field is empty or not. This may be
  209. // used to include empty fields in Patch requests.
  210. ForceSendFields []string `json:"-"`
  211. // NullFields is a list of field names (e.g. "FileTypes") to include in
  212. // API requests with the JSON null value. By default, fields with empty
  213. // values are omitted from API requests. However, any field with an
  214. // empty value appearing in NullFields will be sent to the server as
  215. // null. It is an error if a field in this list has a non-empty value.
  216. // This may be used to include null fields in Patch requests.
  217. NullFields []string `json:"-"`
  218. }
  219. func (s *DownloadRequest) MarshalJSON() ([]byte, error) {
  220. type NoMethod DownloadRequest
  221. raw := NoMethod(*s)
  222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  223. }
  224. // DownloadResponse: Download response.
  225. type DownloadResponse struct {
  226. // AdGroups: Retrieved ad groups in SDF format.
  227. AdGroups string `json:"adGroups,omitempty"`
  228. // Ads: Retrieved ads in SDF format.
  229. Ads string `json:"ads,omitempty"`
  230. // Campaigns: Retrieved campaigns in SDF format.
  231. Campaigns string `json:"campaigns,omitempty"`
  232. // InsertionOrders: Retrieved insertion orders in SDF format.
  233. InsertionOrders string `json:"insertionOrders,omitempty"`
  234. // LineItems: Retrieved line items in SDF format.
  235. LineItems string `json:"lineItems,omitempty"`
  236. // ServerResponse contains the HTTP response code and headers from the
  237. // server.
  238. googleapi.ServerResponse `json:"-"`
  239. // ForceSendFields is a list of field names (e.g. "AdGroups") to
  240. // unconditionally include in API requests. By default, fields with
  241. // empty values are omitted from API requests. However, any non-pointer,
  242. // non-interface field appearing in ForceSendFields will be sent to the
  243. // server regardless of whether the field is empty or not. This may be
  244. // used to include empty fields in Patch requests.
  245. ForceSendFields []string `json:"-"`
  246. // NullFields is a list of field names (e.g. "AdGroups") to include in
  247. // API requests with the JSON null value. By default, fields with empty
  248. // values are omitted from API requests. However, any field with an
  249. // empty value appearing in NullFields will be sent to the server as
  250. // null. It is an error if a field in this list has a non-empty value.
  251. // This may be used to include null fields in Patch requests.
  252. NullFields []string `json:"-"`
  253. }
  254. func (s *DownloadResponse) MarshalJSON() ([]byte, error) {
  255. type NoMethod DownloadResponse
  256. raw := NoMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  258. }
  259. // FilterPair: Filter used to match traffic data in your report.
  260. type FilterPair struct {
  261. // Type: Filter type.
  262. //
  263. // Possible values:
  264. // "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY"
  265. // "FILTER_ACTIVITY_ID"
  266. // "FILTER_ADVERTISER"
  267. // "FILTER_ADVERTISER_CURRENCY"
  268. // "FILTER_ADVERTISER_TIMEZONE"
  269. // "FILTER_AD_POSITION"
  270. // "FILTER_AGE"
  271. // "FILTER_BRANDSAFE_CHANNEL_ID"
  272. // "FILTER_BROWSER"
  273. // "FILTER_BUDGET_SEGMENT_DESCRIPTION"
  274. // "FILTER_CAMPAIGN_DAILY_FREQUENCY"
  275. // "FILTER_CARRIER"
  276. // "FILTER_CHANNEL_ID"
  277. // "FILTER_CITY"
  278. // "FILTER_COMPANION_CREATIVE_ID"
  279. // "FILTER_CONVERSION_DELAY"
  280. // "FILTER_COUNTRY"
  281. // "FILTER_CREATIVE_HEIGHT"
  282. // "FILTER_CREATIVE_ID"
  283. // "FILTER_CREATIVE_SIZE"
  284. // "FILTER_CREATIVE_TYPE"
  285. // "FILTER_CREATIVE_WIDTH"
  286. // "FILTER_DATA_PROVIDER"
  287. // "FILTER_DATE"
  288. // "FILTER_DAY_OF_WEEK"
  289. // "FILTER_DFP_ORDER_ID"
  290. // "FILTER_DMA"
  291. // "FILTER_EXCHANGE_ID"
  292. // "FILTER_FLOODLIGHT_PIXEL_ID"
  293. // "FILTER_GENDER"
  294. // "FILTER_INSERTION_ORDER"
  295. // "FILTER_INVENTORY_FORMAT"
  296. // "FILTER_INVENTORY_SOURCE"
  297. // "FILTER_INVENTORY_SOURCE_TYPE"
  298. // "FILTER_KEYWORD"
  299. // "FILTER_LINE_ITEM"
  300. // "FILTER_LINE_ITEM_DAILY_FREQUENCY"
  301. // "FILTER_LINE_ITEM_LIFETIME_FREQUENCY"
  302. // "FILTER_LINE_ITEM_TYPE"
  303. // "FILTER_MEDIA_PLAN"
  304. // "FILTER_MOBILE_DEVICE_MAKE"
  305. // "FILTER_MOBILE_DEVICE_MAKE_MODEL"
  306. // "FILTER_MOBILE_DEVICE_TYPE"
  307. // "FILTER_MOBILE_GEO"
  308. // "FILTER_MONTH"
  309. // "FILTER_MRAID_SUPPORT"
  310. // "FILTER_NIELSEN_AGE"
  311. // "FILTER_NIELSEN_COUNTRY_CODE"
  312. // "FILTER_NIELSEN_DEVICE_ID"
  313. // "FILTER_NIELSEN_GENDER"
  314. // "FILTER_NOT_SUPPORTED"
  315. // "FILTER_ORDER_ID"
  316. // "FILTER_OS"
  317. // "FILTER_PAGE_CATEGORY"
  318. // "FILTER_PAGE_LAYOUT"
  319. // "FILTER_PARTNER"
  320. // "FILTER_PARTNER_CURRENCY"
  321. // "FILTER_PUBLIC_INVENTORY"
  322. // "FILTER_QUARTER"
  323. // "FILTER_REGION"
  324. // "FILTER_REGULAR_CHANNEL_ID"
  325. // "FILTER_SITE_ID"
  326. // "FILTER_SITE_LANGUAGE"
  327. // "FILTER_SKIPPABLE_SUPPORT"
  328. // "FILTER_TARGETED_USER_LIST"
  329. // "FILTER_TIME_OF_DAY"
  330. // "FILTER_TRUEVIEW_AD_GROUP_AD_ID"
  331. // "FILTER_TRUEVIEW_AD_GROUP_ID"
  332. // "FILTER_TRUEVIEW_AGE"
  333. // "FILTER_TRUEVIEW_CATEGORY"
  334. // "FILTER_TRUEVIEW_CITY"
  335. // "FILTER_TRUEVIEW_CONVERSION_TYPE"
  336. // "FILTER_TRUEVIEW_COUNTRY"
  337. // "FILTER_TRUEVIEW_CUSTOM_AFFINITY"
  338. // "FILTER_TRUEVIEW_DMA"
  339. // "FILTER_TRUEVIEW_GENDER"
  340. // "FILTER_TRUEVIEW_IAR_AGE"
  341. // "FILTER_TRUEVIEW_IAR_CATEGORY"
  342. // "FILTER_TRUEVIEW_IAR_CITY"
  343. // "FILTER_TRUEVIEW_IAR_COUNTRY"
  344. // "FILTER_TRUEVIEW_IAR_GENDER"
  345. // "FILTER_TRUEVIEW_IAR_INTEREST"
  346. // "FILTER_TRUEVIEW_IAR_LANGUAGE"
  347. // "FILTER_TRUEVIEW_IAR_PARENTAL_STATUS"
  348. // "FILTER_TRUEVIEW_IAR_REGION"
  349. // "FILTER_TRUEVIEW_IAR_REMARKETING_LIST"
  350. // "FILTER_TRUEVIEW_IAR_TIME_OF_DAY"
  351. // "FILTER_TRUEVIEW_IAR_YOUTUBE_CHANNEL"
  352. // "FILTER_TRUEVIEW_IAR_YOUTUBE_VIDEO"
  353. // "FILTER_TRUEVIEW_IAR_ZIPCODE"
  354. // "FILTER_TRUEVIEW_INTEREST"
  355. // "FILTER_TRUEVIEW_KEYWORD"
  356. // "FILTER_TRUEVIEW_PARENTAL_STATUS"
  357. // "FILTER_TRUEVIEW_PLACEMENT"
  358. // "FILTER_TRUEVIEW_REGION"
  359. // "FILTER_TRUEVIEW_REMARKETING_LIST"
  360. // "FILTER_TRUEVIEW_URL"
  361. // "FILTER_TRUEVIEW_ZIPCODE"
  362. // "FILTER_UNKNOWN"
  363. // "FILTER_USER_LIST"
  364. // "FILTER_USER_LIST_FIRST_PARTY"
  365. // "FILTER_USER_LIST_THIRD_PARTY"
  366. // "FILTER_VIDEO_AD_POSITION_IN_STREAM"
  367. // "FILTER_VIDEO_COMPANION_SIZE"
  368. // "FILTER_VIDEO_COMPANION_TYPE"
  369. // "FILTER_VIDEO_CREATIVE_DURATION"
  370. // "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE"
  371. // "FILTER_VIDEO_DURATION_SECONDS"
  372. // "FILTER_VIDEO_FORMAT_SUPPORT"
  373. // "FILTER_VIDEO_INVENTORY_TYPE"
  374. // "FILTER_VIDEO_PLAYER_SIZE"
  375. // "FILTER_VIDEO_RATING_TIER"
  376. // "FILTER_VIDEO_SKIPPABLE_SUPPORT"
  377. // "FILTER_VIDEO_VPAID_SUPPORT"
  378. // "FILTER_WEEK"
  379. // "FILTER_YEAR"
  380. // "FILTER_YOUTUBE_VERTICAL"
  381. // "FILTER_ZIP_CODE"
  382. Type string `json:"type,omitempty"`
  383. // Value: Filter value.
  384. Value string `json:"value,omitempty"`
  385. // ForceSendFields is a list of field names (e.g. "Type") to
  386. // unconditionally include in API requests. By default, fields with
  387. // empty values are omitted from API requests. However, any non-pointer,
  388. // non-interface field appearing in ForceSendFields will be sent to the
  389. // server regardless of whether the field is empty or not. This may be
  390. // used to include empty fields in Patch requests.
  391. ForceSendFields []string `json:"-"`
  392. // NullFields is a list of field names (e.g. "Type") to include in API
  393. // requests with the JSON null value. By default, fields with empty
  394. // values are omitted from API requests. However, any field with an
  395. // empty value appearing in NullFields will be sent to the server as
  396. // null. It is an error if a field in this list has a non-empty value.
  397. // This may be used to include null fields in Patch requests.
  398. NullFields []string `json:"-"`
  399. }
  400. func (s *FilterPair) MarshalJSON() ([]byte, error) {
  401. type NoMethod FilterPair
  402. raw := NoMethod(*s)
  403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  404. }
  405. // ListQueriesResponse: List queries response.
  406. type ListQueriesResponse struct {
  407. // Kind: Identifies what kind of resource this is. Value: the fixed
  408. // string "doubleclickbidmanager#listQueriesResponse".
  409. Kind string `json:"kind,omitempty"`
  410. // Queries: Retrieved queries.
  411. Queries []*Query `json:"queries,omitempty"`
  412. // ServerResponse contains the HTTP response code and headers from the
  413. // server.
  414. googleapi.ServerResponse `json:"-"`
  415. // ForceSendFields is a list of field names (e.g. "Kind") to
  416. // unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. // NullFields is a list of field names (e.g. "Kind") to include in API
  423. // requests with the JSON null value. By default, fields with empty
  424. // values are omitted from API requests. However, any field with an
  425. // empty value appearing in NullFields will be sent to the server as
  426. // null. It is an error if a field in this list has a non-empty value.
  427. // This may be used to include null fields in Patch requests.
  428. NullFields []string `json:"-"`
  429. }
  430. func (s *ListQueriesResponse) MarshalJSON() ([]byte, error) {
  431. type NoMethod ListQueriesResponse
  432. raw := NoMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  434. }
  435. // ListReportsResponse: List reports response.
  436. type ListReportsResponse struct {
  437. // Kind: Identifies what kind of resource this is. Value: the fixed
  438. // string "doubleclickbidmanager#listReportsResponse".
  439. Kind string `json:"kind,omitempty"`
  440. // Reports: Retrieved reports.
  441. Reports []*Report `json:"reports,omitempty"`
  442. // ServerResponse contains the HTTP response code and headers from the
  443. // server.
  444. googleapi.ServerResponse `json:"-"`
  445. // ForceSendFields is a list of field names (e.g. "Kind") to
  446. // unconditionally include in API requests. By default, fields with
  447. // empty values are omitted from API requests. However, any non-pointer,
  448. // non-interface field appearing in ForceSendFields will be sent to the
  449. // server regardless of whether the field is empty or not. This may be
  450. // used to include empty fields in Patch requests.
  451. ForceSendFields []string `json:"-"`
  452. // NullFields is a list of field names (e.g. "Kind") to include in API
  453. // requests with the JSON null value. By default, fields with empty
  454. // values are omitted from API requests. However, any field with an
  455. // empty value appearing in NullFields will be sent to the server as
  456. // null. It is an error if a field in this list has a non-empty value.
  457. // This may be used to include null fields in Patch requests.
  458. NullFields []string `json:"-"`
  459. }
  460. func (s *ListReportsResponse) MarshalJSON() ([]byte, error) {
  461. type NoMethod ListReportsResponse
  462. raw := NoMethod(*s)
  463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  464. }
  465. // Parameters: Parameters of a query or report.
  466. type Parameters struct {
  467. // Filters: Filters used to match traffic data in your report.
  468. Filters []*FilterPair `json:"filters,omitempty"`
  469. // GroupBys: Data is grouped by the filters listed in this field.
  470. //
  471. // Possible values:
  472. // "FILTER_ACTIVE_VIEW_EXPECTED_VIEWABILITY"
  473. // "FILTER_ACTIVITY_ID"
  474. // "FILTER_ADVERTISER"
  475. // "FILTER_ADVERTISER_CURRENCY"
  476. // "FILTER_ADVERTISER_TIMEZONE"
  477. // "FILTER_AD_POSITION"
  478. // "FILTER_AGE"
  479. // "FILTER_BRANDSAFE_CHANNEL_ID"
  480. // "FILTER_BROWSER"
  481. // "FILTER_BUDGET_SEGMENT_DESCRIPTION"
  482. // "FILTER_CAMPAIGN_DAILY_FREQUENCY"
  483. // "FILTER_CARRIER"
  484. // "FILTER_CHANNEL_ID"
  485. // "FILTER_CITY"
  486. // "FILTER_COMPANION_CREATIVE_ID"
  487. // "FILTER_CONVERSION_DELAY"
  488. // "FILTER_COUNTRY"
  489. // "FILTER_CREATIVE_HEIGHT"
  490. // "FILTER_CREATIVE_ID"
  491. // "FILTER_CREATIVE_SIZE"
  492. // "FILTER_CREATIVE_TYPE"
  493. // "FILTER_CREATIVE_WIDTH"
  494. // "FILTER_DATA_PROVIDER"
  495. // "FILTER_DATE"
  496. // "FILTER_DAY_OF_WEEK"
  497. // "FILTER_DFP_ORDER_ID"
  498. // "FILTER_DMA"
  499. // "FILTER_EXCHANGE_ID"
  500. // "FILTER_FLOODLIGHT_PIXEL_ID"
  501. // "FILTER_GENDER"
  502. // "FILTER_INSERTION_ORDER"
  503. // "FILTER_INVENTORY_FORMAT"
  504. // "FILTER_INVENTORY_SOURCE"
  505. // "FILTER_INVENTORY_SOURCE_TYPE"
  506. // "FILTER_KEYWORD"
  507. // "FILTER_LINE_ITEM"
  508. // "FILTER_LINE_ITEM_DAILY_FREQUENCY"
  509. // "FILTER_LINE_ITEM_LIFETIME_FREQUENCY"
  510. // "FILTER_LINE_ITEM_TYPE"
  511. // "FILTER_MEDIA_PLAN"
  512. // "FILTER_MOBILE_DEVICE_MAKE"
  513. // "FILTER_MOBILE_DEVICE_MAKE_MODEL"
  514. // "FILTER_MOBILE_DEVICE_TYPE"
  515. // "FILTER_MOBILE_GEO"
  516. // "FILTER_MONTH"
  517. // "FILTER_MRAID_SUPPORT"
  518. // "FILTER_NIELSEN_AGE"
  519. // "FILTER_NIELSEN_COUNTRY_CODE"
  520. // "FILTER_NIELSEN_DEVICE_ID"
  521. // "FILTER_NIELSEN_GENDER"
  522. // "FILTER_NOT_SUPPORTED"
  523. // "FILTER_ORDER_ID"
  524. // "FILTER_OS"
  525. // "FILTER_PAGE_CATEGORY"
  526. // "FILTER_PAGE_LAYOUT"
  527. // "FILTER_PARTNER"
  528. // "FILTER_PARTNER_CURRENCY"
  529. // "FILTER_PUBLIC_INVENTORY"
  530. // "FILTER_QUARTER"
  531. // "FILTER_REGION"
  532. // "FILTER_REGULAR_CHANNEL_ID"
  533. // "FILTER_SITE_ID"
  534. // "FILTER_SITE_LANGUAGE"
  535. // "FILTER_SKIPPABLE_SUPPORT"
  536. // "FILTER_TARGETED_USER_LIST"
  537. // "FILTER_TIME_OF_DAY"
  538. // "FILTER_TRUEVIEW_AD_GROUP_AD_ID"
  539. // "FILTER_TRUEVIEW_AD_GROUP_ID"
  540. // "FILTER_TRUEVIEW_AGE"
  541. // "FILTER_TRUEVIEW_CATEGORY"
  542. // "FILTER_TRUEVIEW_CITY"
  543. // "FILTER_TRUEVIEW_CONVERSION_TYPE"
  544. // "FILTER_TRUEVIEW_COUNTRY"
  545. // "FILTER_TRUEVIEW_CUSTOM_AFFINITY"
  546. // "FILTER_TRUEVIEW_DMA"
  547. // "FILTER_TRUEVIEW_GENDER"
  548. // "FILTER_TRUEVIEW_IAR_AGE"
  549. // "FILTER_TRUEVIEW_IAR_CATEGORY"
  550. // "FILTER_TRUEVIEW_IAR_CITY"
  551. // "FILTER_TRUEVIEW_IAR_COUNTRY"
  552. // "FILTER_TRUEVIEW_IAR_GENDER"
  553. // "FILTER_TRUEVIEW_IAR_INTEREST"
  554. // "FILTER_TRUEVIEW_IAR_LANGUAGE"
  555. // "FILTER_TRUEVIEW_IAR_PARENTAL_STATUS"
  556. // "FILTER_TRUEVIEW_IAR_REGION"
  557. // "FILTER_TRUEVIEW_IAR_REMARKETING_LIST"
  558. // "FILTER_TRUEVIEW_IAR_TIME_OF_DAY"
  559. // "FILTER_TRUEVIEW_IAR_YOUTUBE_CHANNEL"
  560. // "FILTER_TRUEVIEW_IAR_YOUTUBE_VIDEO"
  561. // "FILTER_TRUEVIEW_IAR_ZIPCODE"
  562. // "FILTER_TRUEVIEW_INTEREST"
  563. // "FILTER_TRUEVIEW_KEYWORD"
  564. // "FILTER_TRUEVIEW_PARENTAL_STATUS"
  565. // "FILTER_TRUEVIEW_PLACEMENT"
  566. // "FILTER_TRUEVIEW_REGION"
  567. // "FILTER_TRUEVIEW_REMARKETING_LIST"
  568. // "FILTER_TRUEVIEW_URL"
  569. // "FILTER_TRUEVIEW_ZIPCODE"
  570. // "FILTER_UNKNOWN"
  571. // "FILTER_USER_LIST"
  572. // "FILTER_USER_LIST_FIRST_PARTY"
  573. // "FILTER_USER_LIST_THIRD_PARTY"
  574. // "FILTER_VIDEO_AD_POSITION_IN_STREAM"
  575. // "FILTER_VIDEO_COMPANION_SIZE"
  576. // "FILTER_VIDEO_COMPANION_TYPE"
  577. // "FILTER_VIDEO_CREATIVE_DURATION"
  578. // "FILTER_VIDEO_CREATIVE_DURATION_SKIPPABLE"
  579. // "FILTER_VIDEO_DURATION_SECONDS"
  580. // "FILTER_VIDEO_FORMAT_SUPPORT"
  581. // "FILTER_VIDEO_INVENTORY_TYPE"
  582. // "FILTER_VIDEO_PLAYER_SIZE"
  583. // "FILTER_VIDEO_RATING_TIER"
  584. // "FILTER_VIDEO_SKIPPABLE_SUPPORT"
  585. // "FILTER_VIDEO_VPAID_SUPPORT"
  586. // "FILTER_WEEK"
  587. // "FILTER_YEAR"
  588. // "FILTER_YOUTUBE_VERTICAL"
  589. // "FILTER_ZIP_CODE"
  590. GroupBys []string `json:"groupBys,omitempty"`
  591. // IncludeInviteData: Whether to include data from Invite Media.
  592. IncludeInviteData bool `json:"includeInviteData,omitempty"`
  593. // Metrics: Metrics to include as columns in your report.
  594. //
  595. // Possible values:
  596. // "METRIC_ACTIVE_VIEW_AUDIBLE_VISIBLE_ON_COMPLETE_IMPRESSIONS"
  597. // "METRIC_ACTIVE_VIEW_AVERAGE_VIEWABLE_TIME"
  598. // "METRIC_ACTIVE_VIEW_DISTRIBUTION_UNMEASURABLE"
  599. // "METRIC_ACTIVE_VIEW_DISTRIBUTION_UNVIEWABLE"
  600. // "METRIC_ACTIVE_VIEW_DISTRIBUTION_VIEWABLE"
  601. // "METRIC_ACTIVE_VIEW_ELIGIBLE_IMPRESSIONS"
  602. // "METRIC_ACTIVE_VIEW_MEASURABLE_IMPRESSIONS"
  603. // "METRIC_ACTIVE_VIEW_PCT_MEASURABLE_IMPRESSIONS"
  604. // "METRIC_ACTIVE_VIEW_PCT_VIEWABLE_IMPRESSIONS"
  605. // "METRIC_ACTIVE_VIEW_PERCENT_AUDIBLE_VISIBLE_AT_START"
  606. // "METRIC_ACTIVE_VIEW_PERCENT_AUDIBLE_VISIBLE_FIRST_QUAR"
  607. // "METRIC_ACTIVE_VIEW_PERCENT_AUDIBLE_VISIBLE_ON_COMPLETE"
  608. // "METRIC_ACTIVE_VIEW_PERCENT_AUDIBLE_VISIBLE_SECOND_QUAR"
  609. // "METRIC_ACTIVE_VIEW_PERCENT_AUDIBLE_VISIBLE_THIRD_QUAR"
  610. // "METRIC_ACTIVE_VIEW_PERCENT_VIEWABLE_FOR_TIME_THRESHOLD"
  611. // "METRIC_ACTIVE_VIEW_PERCENT_VISIBLE_AT_START"
  612. // "METRIC_ACTIVE_VIEW_PERCENT_VISIBLE_FIRST_QUAR"
  613. // "METRIC_ACTIVE_VIEW_PERCENT_VISIBLE_ON_COMPLETE"
  614. // "METRIC_ACTIVE_VIEW_PERCENT_VISIBLE_SECOND_QUAR"
  615. // "METRIC_ACTIVE_VIEW_PERCENT_VISIBLE_THIRD_QUAR"
  616. // "METRIC_ACTIVE_VIEW_UNMEASURABLE_IMPRESSIONS"
  617. // "METRIC_ACTIVE_VIEW_UNVIEWABLE_IMPRESSIONS"
  618. // "METRIC_ACTIVE_VIEW_VIEWABLE_FOR_TIME_THRESHOLD"
  619. // "METRIC_ACTIVE_VIEW_VIEWABLE_IMPRESSIONS"
  620. // "METRIC_BID_REQUESTS"
  621. // "METRIC_BILLABLE_COST_ADVERTISER"
  622. // "METRIC_BILLABLE_COST_PARTNER"
  623. // "METRIC_BILLABLE_COST_USD"
  624. // "METRIC_CLICKS"
  625. // "METRIC_CLICK_TO_POST_CLICK_CONVERSION_RATE"
  626. // "METRIC_COMSCORE_VCE_AUDIENCE_AVG_FREQUENCY"
  627. // "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS"
  628. // "METRIC_COMSCORE_VCE_AUDIENCE_IMPRESSIONS_SHARE"
  629. // "METRIC_COMSCORE_VCE_AUDIENCE_REACH_PCT"
  630. // "METRIC_COMSCORE_VCE_AUDIENCE_SHARE_PCT"
  631. // "METRIC_COMSCORE_VCE_GROSS_RATING_POINTS"
  632. // "METRIC_COMSCORE_VCE_POPULATION"
  633. // "METRIC_COMSCORE_VCE_UNIQUE_AUDIENCE"
  634. // "METRIC_CONVERSIONS_PER_MILLE"
  635. // "METRIC_COOKIE_REACH_AVERAGE_IMPRESSION_FREQUENCY"
  636. // "METRIC_COOKIE_REACH_IMPRESSION_REACH"
  637. // "METRIC_CPM_FEE1_ADVERTISER"
  638. // "METRIC_CPM_FEE1_PARTNER"
  639. // "METRIC_CPM_FEE1_USD"
  640. // "METRIC_CPM_FEE2_ADVERTISER"
  641. // "METRIC_CPM_FEE2_PARTNER"
  642. // "METRIC_CPM_FEE2_USD"
  643. // "METRIC_CPM_FEE3_ADVERTISER"
  644. // "METRIC_CPM_FEE3_PARTNER"
  645. // "METRIC_CPM_FEE3_USD"
  646. // "METRIC_CPM_FEE4_ADVERTISER"
  647. // "METRIC_CPM_FEE4_PARTNER"
  648. // "METRIC_CPM_FEE4_USD"
  649. // "METRIC_CPM_FEE5_ADVERTISER"
  650. // "METRIC_CPM_FEE5_PARTNER"
  651. // "METRIC_CPM_FEE5_USD"
  652. // "METRIC_CTR"
  653. // "METRIC_DATA_COST_ADVERTISER"
  654. // "METRIC_DATA_COST_PARTNER"
  655. // "METRIC_DATA_COST_USD"
  656. // "METRIC_FEE10_ADVERTISER"
  657. // "METRIC_FEE10_PARTNER"
  658. // "METRIC_FEE10_USD"
  659. // "METRIC_FEE11_ADVERTISER"
  660. // "METRIC_FEE11_PARTNER"
  661. // "METRIC_FEE11_USD"
  662. // "METRIC_FEE12_ADVERTISER"
  663. // "METRIC_FEE12_PARTNER"
  664. // "METRIC_FEE12_USD"
  665. // "METRIC_FEE13_ADVERTISER"
  666. // "METRIC_FEE13_PARTNER"
  667. // "METRIC_FEE13_USD"
  668. // "METRIC_FEE14_ADVERTISER"
  669. // "METRIC_FEE14_PARTNER"
  670. // "METRIC_FEE14_USD"
  671. // "METRIC_FEE15_ADVERTISER"
  672. // "METRIC_FEE15_PARTNER"
  673. // "METRIC_FEE15_USD"
  674. // "METRIC_FEE16_ADVERTISER"
  675. // "METRIC_FEE16_PARTNER"
  676. // "METRIC_FEE16_USD"
  677. // "METRIC_FEE17_ADVERTISER"
  678. // "METRIC_FEE17_PARTNER"
  679. // "METRIC_FEE17_USD"
  680. // "METRIC_FEE18_ADVERTISER"
  681. // "METRIC_FEE18_PARTNER"
  682. // "METRIC_FEE18_USD"
  683. // "METRIC_FEE19_ADVERTISER"
  684. // "METRIC_FEE19_PARTNER"
  685. // "METRIC_FEE19_USD"
  686. // "METRIC_FEE20_ADVERTISER"
  687. // "METRIC_FEE20_PARTNER"
  688. // "METRIC_FEE20_USD"
  689. // "METRIC_FEE21_ADVERTISER"
  690. // "METRIC_FEE21_PARTNER"
  691. // "METRIC_FEE21_USD"
  692. // "METRIC_FEE22_ADVERTISER"
  693. // "METRIC_FEE22_PARTNER"
  694. // "METRIC_FEE22_USD"
  695. // "METRIC_FEE2_ADVERTISER"
  696. // "METRIC_FEE2_PARTNER"
  697. // "METRIC_FEE2_USD"
  698. // "METRIC_FEE3_ADVERTISER"
  699. // "METRIC_FEE3_PARTNER"
  700. // "METRIC_FEE3_USD"
  701. // "METRIC_FEE4_ADVERTISER"
  702. // "METRIC_FEE4_PARTNER"
  703. // "METRIC_FEE4_USD"
  704. // "METRIC_FEE5_ADVERTISER"
  705. // "METRIC_FEE5_PARTNER"
  706. // "METRIC_FEE5_USD"
  707. // "METRIC_FEE6_ADVERTISER"
  708. // "METRIC_FEE6_PARTNER"
  709. // "METRIC_FEE6_USD"
  710. // "METRIC_FEE7_ADVERTISER"
  711. // "METRIC_FEE7_PARTNER"
  712. // "METRIC_FEE7_USD"
  713. // "METRIC_FEE8_ADVERTISER"
  714. // "METRIC_FEE8_PARTNER"
  715. // "METRIC_FEE8_USD"
  716. // "METRIC_FEE9_ADVERTISER"
  717. // "METRIC_FEE9_PARTNER"
  718. // "METRIC_FEE9_USD"
  719. // "METRIC_IMPRESSIONS"
  720. // "METRIC_IMPRESSIONS_TO_CONVERSION_RATE"
  721. // "METRIC_LAST_CLICKS"
  722. // "METRIC_LAST_IMPRESSIONS"
  723. // "METRIC_MEDIA_COST_ADVERTISER"
  724. // "METRIC_MEDIA_COST_ECPAPC_ADVERTISER"
  725. // "METRIC_MEDIA_COST_ECPAPC_PARTNER"
  726. // "METRIC_MEDIA_COST_ECPAPC_USD"
  727. // "METRIC_MEDIA_COST_ECPAPV_ADVERTISER"
  728. // "METRIC_MEDIA_COST_ECPAPV_PARTNER"
  729. // "METRIC_MEDIA_COST_ECPAPV_USD"
  730. // "METRIC_MEDIA_COST_ECPA_ADVERTISER"
  731. // "METRIC_MEDIA_COST_ECPA_PARTNER"
  732. // "METRIC_MEDIA_COST_ECPA_USD"
  733. // "METRIC_MEDIA_COST_ECPCV_ADVERTISER"
  734. // "METRIC_MEDIA_COST_ECPCV_PARTNER"
  735. // "METRIC_MEDIA_COST_ECPCV_USD"
  736. // "METRIC_MEDIA_COST_ECPC_ADVERTISER"
  737. // "METRIC_MEDIA_COST_ECPC_PARTNER"
  738. // "METRIC_MEDIA_COST_ECPC_USD"
  739. // "METRIC_MEDIA_COST_ECPM_ADVERTISER"
  740. // "METRIC_MEDIA_COST_ECPM_PARTNER"
  741. // "METRIC_MEDIA_COST_ECPM_USD"
  742. // "METRIC_MEDIA_COST_PARTNER"
  743. // "METRIC_MEDIA_COST_USD"
  744. // "METRIC_MEDIA_COST_VIEWABLE_ECPM_ADVERTISER"
  745. // "METRIC_MEDIA_COST_VIEWABLE_ECPM_PARTNER"
  746. // "METRIC_MEDIA_COST_VIEWABLE_ECPM_USD"
  747. // "METRIC_MEDIA_FEE1_ADVERTISER"
  748. // "METRIC_MEDIA_FEE1_PARTNER"
  749. // "METRIC_MEDIA_FEE1_USD"
  750. // "METRIC_MEDIA_FEE2_ADVERTISER"
  751. // "METRIC_MEDIA_FEE2_PARTNER"
  752. // "METRIC_MEDIA_FEE2_USD"
  753. // "METRIC_MEDIA_FEE3_ADVERTISER"
  754. // "METRIC_MEDIA_FEE3_PARTNER"
  755. // "METRIC_MEDIA_FEE3_USD"
  756. // "METRIC_MEDIA_FEE4_ADVERTISER"
  757. // "METRIC_MEDIA_FEE4_PARTNER"
  758. // "METRIC_MEDIA_FEE4_USD"
  759. // "METRIC_MEDIA_FEE5_ADVERTISER"
  760. // "METRIC_MEDIA_FEE5_PARTNER"
  761. // "METRIC_MEDIA_FEE5_USD"
  762. // "METRIC_PIXEL_LOADS"
  763. // "METRIC_PLATFORM_FEE_ADVERTISER"
  764. // "METRIC_PLATFORM_FEE_PARTNER"
  765. // "METRIC_PLATFORM_FEE_USD"
  766. // "METRIC_POST_CLICK_DFA_REVENUE"
  767. // "METRIC_POST_VIEW_DFA_REVENUE"
  768. // "METRIC_PROFIT_ADVERTISER"
  769. // "METRIC_PROFIT_ECPAPC_ADVERTISER"
  770. // "METRIC_PROFIT_ECPAPC_PARTNER"
  771. // "METRIC_PROFIT_ECPAPC_USD"
  772. // "METRIC_PROFIT_ECPAPV_ADVERTISER"
  773. // "METRIC_PROFIT_ECPAPV_PARTNER"
  774. // "METRIC_PROFIT_ECPAPV_USD"
  775. // "METRIC_PROFIT_ECPA_ADVERTISER"
  776. // "METRIC_PROFIT_ECPA_PARTNER"
  777. // "METRIC_PROFIT_ECPA_USD"
  778. // "METRIC_PROFIT_ECPC_ADVERTISER"
  779. // "METRIC_PROFIT_ECPC_PARTNER"
  780. // "METRIC_PROFIT_ECPC_USD"
  781. // "METRIC_PROFIT_ECPM_ADVERTISER"
  782. // "METRIC_PROFIT_ECPM_PARTNER"
  783. // "METRIC_PROFIT_ECPM_USD"
  784. // "METRIC_PROFIT_MARGIN"
  785. // "METRIC_PROFIT_PARTNER"
  786. // "METRIC_PROFIT_USD"
  787. // "METRIC_PROFIT_VIEWABLE_ECPM_ADVERTISER"
  788. // "METRIC_PROFIT_VIEWABLE_ECPM_PARTNER"
  789. // "METRIC_PROFIT_VIEWABLE_ECPM_USD"
  790. // "METRIC_REACH_COOKIE_FREQUENCY"
  791. // "METRIC_REACH_COOKIE_REACH"
  792. // "METRIC_REVENUE_ADVERTISER"
  793. // "METRIC_REVENUE_ECPAPC_ADVERTISER"
  794. // "METRIC_REVENUE_ECPAPC_PARTNER"
  795. // "METRIC_REVENUE_ECPAPC_USD"
  796. // "METRIC_REVENUE_ECPAPV_ADVERTISER"
  797. // "METRIC_REVENUE_ECPAPV_PARTNER"
  798. // "METRIC_REVENUE_ECPAPV_USD"
  799. // "METRIC_REVENUE_ECPA_ADVERTISER"
  800. // "METRIC_REVENUE_ECPA_PARTNER"
  801. // "METRIC_REVENUE_ECPA_USD"
  802. // "METRIC_REVENUE_ECPCV_ADVERTISER"
  803. // "METRIC_REVENUE_ECPCV_PARTNER"
  804. // "METRIC_REVENUE_ECPCV_USD"
  805. // "METRIC_REVENUE_ECPC_ADVERTISER"
  806. // "METRIC_REVENUE_ECPC_PARTNER"
  807. // "METRIC_REVENUE_ECPC_USD"
  808. // "METRIC_REVENUE_ECPIAVC_ADVERTISER"
  809. // "METRIC_REVENUE_ECPM_ADVERTISER"
  810. // "METRIC_REVENUE_ECPM_PARTNER"
  811. // "METRIC_REVENUE_ECPM_USD"
  812. // "METRIC_REVENUE_PARTNER"
  813. // "METRIC_REVENUE_USD"
  814. // "METRIC_REVENUE_VIEWABLE_ECPM_ADVERTISER"
  815. // "METRIC_REVENUE_VIEWABLE_ECPM_PARTNER"
  816. // "METRIC_REVENUE_VIEWABLE_ECPM_USD"
  817. // "METRIC_RICH_MEDIA_VIDEO_COMPLETIONS"
  818. // "METRIC_RICH_MEDIA_VIDEO_FIRST_QUARTILE_COMPLETES"
  819. // "METRIC_RICH_MEDIA_VIDEO_FULL_SCREENS"
  820. // "METRIC_RICH_MEDIA_VIDEO_MIDPOINTS"
  821. // "METRIC_RICH_MEDIA_VIDEO_MUTES"
  822. // "METRIC_RICH_MEDIA_VIDEO_PAUSES"
  823. // "METRIC_RICH_MEDIA_VIDEO_PLAYS"
  824. // "METRIC_RICH_MEDIA_VIDEO_SKIPS"
  825. // "METRIC_RICH_MEDIA_VIDEO_THIRD_QUARTILE_COMPLETES"
  826. // "METRIC_TEA_TRUEVIEW_IMPRESSIONS"
  827. // "METRIC_TEA_TRUEVIEW_UNIQUE_COOKIES"
  828. // "METRIC_TEA_TRUEVIEW_UNIQUE_PEOPLE"
  829. // "METRIC_TOTAL_CONVERSIONS"
  830. // "METRIC_TOTAL_MEDIA_COST_ADVERTISER"
  831. // "METRIC_TOTAL_MEDIA_COST_ECPAPC_ADVERTISER"
  832. // "METRIC_TOTAL_MEDIA_COST_ECPAPC_PARTNER"
  833. // "METRIC_TOTAL_MEDIA_COST_ECPAPC_USD"
  834. // "METRIC_TOTAL_MEDIA_COST_ECPAPV_ADVERTISER"
  835. // "METRIC_TOTAL_MEDIA_COST_ECPAPV_PARTNER"
  836. // "METRIC_TOTAL_MEDIA_COST_ECPAPV_USD"
  837. // "METRIC_TOTAL_MEDIA_COST_ECPA_ADVERTISER"
  838. // "METRIC_TOTAL_MEDIA_COST_ECPA_PARTNER"
  839. // "METRIC_TOTAL_MEDIA_COST_ECPA_USD"
  840. // "METRIC_TOTAL_MEDIA_COST_ECPCV_ADVERTISER"
  841. // "METRIC_TOTAL_MEDIA_COST_ECPCV_PARTNER"
  842. // "METRIC_TOTAL_MEDIA_COST_ECPCV_USD"
  843. // "METRIC_TOTAL_MEDIA_COST_ECPC_ADVERTISER"
  844. // "METRIC_TOTAL_MEDIA_COST_ECPC_PARTNER"
  845. // "METRIC_TOTAL_MEDIA_COST_ECPC_USD"
  846. // "METRIC_TOTAL_MEDIA_COST_ECPM_ADVERTISER"
  847. // "METRIC_TOTAL_MEDIA_COST_ECPM_PARTNER"
  848. // "METRIC_TOTAL_MEDIA_COST_ECPM_USD"
  849. // "METRIC_TOTAL_MEDIA_COST_PARTNER"
  850. // "METRIC_TOTAL_MEDIA_COST_USD"
  851. // "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_ADVERTISER"
  852. // "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_PARTNER"
  853. // "METRIC_TOTAL_MEDIA_COST_VIEWABLE_ECPM_USD"
  854. // "METRIC_TRUEVIEW_AVERAGE_CPE_ADVERTISER"
  855. // "METRIC_TRUEVIEW_AVERAGE_CPE_PARTNER"
  856. // "METRIC_TRUEVIEW_AVERAGE_CPE_USD"
  857. // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_ADVERTISER"
  858. // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_PARTNER"
  859. // "METRIC_TRUEVIEW_CONVERSION_COST_MANY_PER_VIEW_USD"
  860. // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_ADVERTISER"
  861. // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_PARTNER"
  862. // "METRIC_TRUEVIEW_CONVERSION_COST_ONE_PER_VIEW_USD"
  863. // "METRIC_TRUEVIEW_CONVERSION_MANY_PER_VIEW"
  864. // "METRIC_TRUEVIEW_CONVERSION_ONE_PER_VIEW"
  865. // "METRIC_TRUEVIEW_CONVERSION_RATE_ONE_PER_VIEW"
  866. // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_ADVERTISER"
  867. // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_PARTNER"
  868. // "METRIC_TRUEVIEW_CONVERSION_VALUE_MANY_PER_VIEW_USD"
  869. // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_ADVERTISER"
  870. // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_PARTNER"
  871. // "METRIC_TRUEVIEW_CONVERSION_VALUE_ONE_PER_VIEW_USD"
  872. // "METRIC_TRUEVIEW_COST_CONVERSION_MANY_PER_VIEW_RATIO"
  873. // "METRIC_TRUEVIEW_COST_CONVERSION_ONE_PER_VIEW_RATIO"
  874. // "METRIC_TRUEVIEW_CPV_ADVERTISER"
  875. // "METRIC_TRUEVIEW_CPV_PARTNER"
  876. // "METRIC_TRUEVIEW_CPV_USD"
  877. // "METRIC_TRUEVIEW_EARNED_LIKES"
  878. // "METRIC_TRUEVIEW_EARNED_PLAYLIST_ADDITIONS"
  879. // "METRIC_TRUEVIEW_EARNED_SHARES"
  880. // "METRIC_TRUEVIEW_EARNED_SUBSCRIBERS"
  881. // "METRIC_TRUEVIEW_EARNED_VIEWS"
  882. // "METRIC_TRUEVIEW_ENGAGEMENTS"
  883. // "METRIC_TRUEVIEW_ENGAGEMENT_RATE"
  884. // "METRIC_TRUEVIEW_IMPRESSION_SHARE"
  885. // "METRIC_TRUEVIEW_LOST_IS_BUDGET"
  886. // "METRIC_TRUEVIEW_LOST_IS_RANK"
  887. // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUE"
  888. // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_ADVERTISER"
  889. // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_PARTNER"
  890. // "METRIC_TRUEVIEW_TOTAL_CONVERSION_VALUES_USD"
  891. // "METRIC_TRUEVIEW_UNIQUE_VIEWERS"
  892. // "METRIC_TRUEVIEW_VALUE_CONVERSION_MANY_PER_VIEW_RATIO"
  893. // "METRIC_TRUEVIEW_VALUE_CONVERSION_ONE_PER_VIEW_RATIO"
  894. // "METRIC_TRUEVIEW_VIEWS"
  895. // "METRIC_TRUEVIEW_VIEW_RATE"
  896. // "METRIC_TRUEVIEW_VIEW_THROUGH_CONVERSION"
  897. // "METRIC_UNIQUE_VISITORS_COOKIES"
  898. // "METRIC_UNKNOWN"
  899. // "METRIC_VIDEO_COMPANION_CLICKS"
  900. // "METRIC_VIDEO_COMPANION_IMPRESSIONS"
  901. // "METRIC_VIDEO_COMPLETION_RATE"
  902. // "METRIC_VIEWABLE_BID_REQUESTS"
  903. Metrics []string `json:"metrics,omitempty"`
  904. // Type: Report type.
  905. //
  906. // Possible values:
  907. // "TYPE_ACTIVE_GRP"
  908. // "TYPE_AUDIENCE_COMPOSITION"
  909. // "TYPE_AUDIENCE_PERFORMANCE"
  910. // "TYPE_CLIENT_SAFE"
  911. // "TYPE_COMSCORE_VCE"
  912. // "TYPE_CROSS_FEE"
  913. // "TYPE_CROSS_PARTNER"
  914. // "TYPE_CROSS_PARTNER_THIRD_PARTY_DATA_PROVIDER"
  915. // "TYPE_ESTIMATED_CONVERSION"
  916. // "TYPE_FEE"
  917. // "TYPE_GENERAL"
  918. // "TYPE_INVENTORY_AVAILABILITY"
  919. // "TYPE_KEYWORD"
  920. // "TYPE_LINEAR_TV_SEARCH_LIFT"
  921. // "TYPE_NIELSEN_AUDIENCE_PROFILE"
  922. // "TYPE_NIELSEN_DAILY_REACH_BUILD"
  923. // "TYPE_NIELSEN_ONLINE_GLOBAL_MARKET"
  924. // "TYPE_NIELSEN_SITE"
  925. // "TYPE_NOT_SUPPORTED"
  926. // "TYPE_ORDER_ID"
  927. // "TYPE_PAGE_CATEGORY"
  928. // "TYPE_PETRA_NIELSEN_AUDIENCE_PROFILE"
  929. // "TYPE_PETRA_NIELSEN_DAILY_REACH_BUILD"
  930. // "TYPE_PETRA_NIELSEN_ONLINE_GLOBAL_MARKET"
  931. // "TYPE_PIXEL_LOAD"
  932. // "TYPE_REACH_AND_FREQUENCY"
  933. // "TYPE_REACH_AUDIENCE"
  934. // "TYPE_THIRD_PARTY_DATA_PROVIDER"
  935. // "TYPE_TRUEVIEW"
  936. // "TYPE_TRUEVIEW_IAR"
  937. // "TYPE_VERIFICATION"
  938. // "TYPE_YOUTUBE_VERTICAL"
  939. Type string `json:"type,omitempty"`
  940. // ForceSendFields is a list of field names (e.g. "Filters") to
  941. // unconditionally include in API requests. By default, fields with
  942. // empty values are omitted from API requests. However, any non-pointer,
  943. // non-interface field appearing in ForceSendFields will be sent to the
  944. // server regardless of whether the field is empty or not. This may be
  945. // used to include empty fields in Patch requests.
  946. ForceSendFields []string `json:"-"`
  947. // NullFields is a list of field names (e.g. "Filters") to include in
  948. // API requests with the JSON null value. By default, fields with empty
  949. // values are omitted from API requests. However, any field with an
  950. // empty value appearing in NullFields will be sent to the server as
  951. // null. It is an error if a field in this list has a non-empty value.
  952. // This may be used to include null fields in Patch requests.
  953. NullFields []string `json:"-"`
  954. }
  955. func (s *Parameters) MarshalJSON() ([]byte, error) {
  956. type NoMethod Parameters
  957. raw := NoMethod(*s)
  958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  959. }
  960. // Query: Represents a query.
  961. type Query struct {
  962. // Kind: Identifies what kind of resource this is. Value: the fixed
  963. // string "doubleclickbidmanager#query".
  964. Kind string `json:"kind,omitempty"`
  965. // Metadata: Query metadata.
  966. Metadata *QueryMetadata `json:"metadata,omitempty"`
  967. // Params: Query parameters.
  968. Params *Parameters `json:"params,omitempty"`
  969. // QueryId: Query ID.
  970. QueryId int64 `json:"queryId,omitempty,string"`
  971. // ReportDataEndTimeMs: The ending time for the data that is shown in
  972. // the report. Note, reportDataEndTimeMs is required if
  973. // metadata.dataRange is CUSTOM_DATES and ignored otherwise.
  974. ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"`
  975. // ReportDataStartTimeMs: The starting time for the data that is shown
  976. // in the report. Note, reportDataStartTimeMs is required if
  977. // metadata.dataRange is CUSTOM_DATES and ignored otherwise.
  978. ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"`
  979. // Schedule: Information on how often and when to run a query.
  980. Schedule *QuerySchedule `json:"schedule,omitempty"`
  981. // TimezoneCode: Canonical timezone code for report data time. Defaults
  982. // to America/New_York.
  983. TimezoneCode string `json:"timezoneCode,omitempty"`
  984. // ServerResponse contains the HTTP response code and headers from the
  985. // server.
  986. googleapi.ServerResponse `json:"-"`
  987. // ForceSendFields is a list of field names (e.g. "Kind") to
  988. // unconditionally include in API requests. By default, fields with
  989. // empty values are omitted from API requests. However, any non-pointer,
  990. // non-interface field appearing in ForceSendFields will be sent to the
  991. // server regardless of whether the field is empty or not. This may be
  992. // used to include empty fields in Patch requests.
  993. ForceSendFields []string `json:"-"`
  994. // NullFields is a list of field names (e.g. "Kind") to include in API
  995. // requests with the JSON null value. By default, fields with empty
  996. // values are omitted from API requests. However, any field with an
  997. // empty value appearing in NullFields will be sent to the server as
  998. // null. It is an error if a field in this list has a non-empty value.
  999. // This may be used to include null fields in Patch requests.
  1000. NullFields []string `json:"-"`
  1001. }
  1002. func (s *Query) MarshalJSON() ([]byte, error) {
  1003. type NoMethod Query
  1004. raw := NoMethod(*s)
  1005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1006. }
  1007. // QueryMetadata: Query metadata.
  1008. type QueryMetadata struct {
  1009. // DataRange: Range of report data.
  1010. //
  1011. // Possible values:
  1012. // "ALL_TIME"
  1013. // "CURRENT_DAY"
  1014. // "CUSTOM_DATES"
  1015. // "LAST_14_DAYS"
  1016. // "LAST_30_DAYS"
  1017. // "LAST_365_DAYS"
  1018. // "LAST_7_DAYS"
  1019. // "LAST_90_DAYS"
  1020. // "MONTH_TO_DATE"
  1021. // "PREVIOUS_DAY"
  1022. // "PREVIOUS_HALF_MONTH"
  1023. // "PREVIOUS_MONTH"
  1024. // "PREVIOUS_QUARTER"
  1025. // "PREVIOUS_WEEK"
  1026. // "PREVIOUS_YEAR"
  1027. // "QUARTER_TO_DATE"
  1028. // "TYPE_NOT_SUPPORTED"
  1029. // "WEEK_TO_DATE"
  1030. // "YEAR_TO_DATE"
  1031. DataRange string `json:"dataRange,omitempty"`
  1032. // Format: Format of the generated report.
  1033. //
  1034. // Possible values:
  1035. // "CSV"
  1036. // "EXCEL_CSV"
  1037. // "XLSX"
  1038. Format string `json:"format,omitempty"`
  1039. // GoogleCloudStoragePathForLatestReport: The path to the location in
  1040. // Google Cloud Storage where the latest report is stored.
  1041. GoogleCloudStoragePathForLatestReport string `json:"googleCloudStoragePathForLatestReport,omitempty"`
  1042. // GoogleDrivePathForLatestReport: The path in Google Drive for the
  1043. // latest report.
  1044. GoogleDrivePathForLatestReport string `json:"googleDrivePathForLatestReport,omitempty"`
  1045. // LatestReportRunTimeMs: The time when the latest report started to
  1046. // run.
  1047. LatestReportRunTimeMs int64 `json:"latestReportRunTimeMs,omitempty,string"`
  1048. // Locale: Locale of the generated reports. Valid values are cs CZECH de
  1049. // GERMAN en ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko
  1050. // KOREAN pl POLISH pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk
  1051. // UKRAINIAN zh-CN CHINA_CHINESE zh-TW TAIWAN_CHINESE
  1052. //
  1053. // An locale string not in the list above will generate reports in
  1054. // English.
  1055. Locale string `json:"locale,omitempty"`
  1056. // ReportCount: Number of reports that have been generated for the
  1057. // query.
  1058. ReportCount int64 `json:"reportCount,omitempty"`
  1059. // Running: Whether the latest report is currently running.
  1060. Running bool `json:"running,omitempty"`
  1061. // SendNotification: Whether to send an email notification when a report
  1062. // is ready. Default to false.
  1063. SendNotification bool `json:"sendNotification,omitempty"`
  1064. // ShareEmailAddress: List of email addresses which are sent email
  1065. // notifications when the report is finished. Separate from
  1066. // sendNotification.
  1067. ShareEmailAddress []string `json:"shareEmailAddress,omitempty"`
  1068. // Title: Query title. It is used to name the reports generated from
  1069. // this query.
  1070. Title string `json:"title,omitempty"`
  1071. // ForceSendFields is a list of field names (e.g. "DataRange") to
  1072. // unconditionally include in API requests. By default, fields with
  1073. // empty values are omitted from API requests. However, any non-pointer,
  1074. // non-interface field appearing in ForceSendFields will be sent to the
  1075. // server regardless of whether the field is empty or not. This may be
  1076. // used to include empty fields in Patch requests.
  1077. ForceSendFields []string `json:"-"`
  1078. // NullFields is a list of field names (e.g. "DataRange") to include in
  1079. // API requests with the JSON null value. By default, fields with empty
  1080. // values are omitted from API requests. However, any field with an
  1081. // empty value appearing in NullFields will be sent to the server as
  1082. // null. It is an error if a field in this list has a non-empty value.
  1083. // This may be used to include null fields in Patch requests.
  1084. NullFields []string `json:"-"`
  1085. }
  1086. func (s *QueryMetadata) MarshalJSON() ([]byte, error) {
  1087. type NoMethod QueryMetadata
  1088. raw := NoMethod(*s)
  1089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1090. }
  1091. // QuerySchedule: Information on how frequently and when to run a query.
  1092. type QuerySchedule struct {
  1093. // EndTimeMs: Datetime to periodically run the query until.
  1094. EndTimeMs int64 `json:"endTimeMs,omitempty,string"`
  1095. // Frequency: How often the query is run.
  1096. //
  1097. // Possible values:
  1098. // "DAILY"
  1099. // "MONTHLY"
  1100. // "ONE_TIME"
  1101. // "QUARTERLY"
  1102. // "SEMI_MONTHLY"
  1103. // "WEEKLY"
  1104. Frequency string `json:"frequency,omitempty"`
  1105. // NextRunMinuteOfDay: Time of day at which a new report will be
  1106. // generated, represented as minutes past midnight. Range is 0 to 1439.
  1107. // Only applies to scheduled reports.
  1108. NextRunMinuteOfDay int64 `json:"nextRunMinuteOfDay,omitempty"`
  1109. // NextRunTimezoneCode: Canonical timezone code for report generation
  1110. // time. Defaults to America/New_York.
  1111. NextRunTimezoneCode string `json:"nextRunTimezoneCode,omitempty"`
  1112. // ForceSendFields is a list of field names (e.g. "EndTimeMs") to
  1113. // unconditionally include in API requests. By default, fields with
  1114. // empty values are omitted from API requests. However, any non-pointer,
  1115. // non-interface field appearing in ForceSendFields will be sent to the
  1116. // server regardless of whether the field is empty or not. This may be
  1117. // used to include empty fields in Patch requests.
  1118. ForceSendFields []string `json:"-"`
  1119. // NullFields is a list of field names (e.g. "EndTimeMs") to include in
  1120. // API requests with the JSON null value. By default, fields with empty
  1121. // values are omitted from API requests. However, any field with an
  1122. // empty value appearing in NullFields will be sent to the server as
  1123. // null. It is an error if a field in this list has a non-empty value.
  1124. // This may be used to include null fields in Patch requests.
  1125. NullFields []string `json:"-"`
  1126. }
  1127. func (s *QuerySchedule) MarshalJSON() ([]byte, error) {
  1128. type NoMethod QuerySchedule
  1129. raw := NoMethod(*s)
  1130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1131. }
  1132. // Report: Represents a report.
  1133. type Report struct {
  1134. // Key: Key used to identify a report.
  1135. Key *ReportKey `json:"key,omitempty"`
  1136. // Metadata: Report metadata.
  1137. Metadata *ReportMetadata `json:"metadata,omitempty"`
  1138. // Params: Report parameters.
  1139. Params *Parameters `json:"params,omitempty"`
  1140. // ForceSendFields is a list of field names (e.g. "Key") to
  1141. // unconditionally include in API requests. By default, fields with
  1142. // empty values are omitted from API requests. However, any non-pointer,
  1143. // non-interface field appearing in ForceSendFields will be sent to the
  1144. // server regardless of whether the field is empty or not. This may be
  1145. // used to include empty fields in Patch requests.
  1146. ForceSendFields []string `json:"-"`
  1147. // NullFields is a list of field names (e.g. "Key") to include in API
  1148. // requests with the JSON null value. By default, fields with empty
  1149. // values are omitted from API requests. However, any field with an
  1150. // empty value appearing in NullFields will be sent to the server as
  1151. // null. It is an error if a field in this list has a non-empty value.
  1152. // This may be used to include null fields in Patch requests.
  1153. NullFields []string `json:"-"`
  1154. }
  1155. func (s *Report) MarshalJSON() ([]byte, error) {
  1156. type NoMethod Report
  1157. raw := NoMethod(*s)
  1158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1159. }
  1160. // ReportFailure: An explanation of a report failure.
  1161. type ReportFailure struct {
  1162. // ErrorCode: Error code that shows why the report was not created.
  1163. //
  1164. // Possible values:
  1165. // "AUTHENTICATION_ERROR"
  1166. // "DEPRECATED_REPORTING_INVALID_QUERY"
  1167. // "REPORTING_BUCKET_NOT_FOUND"
  1168. // "REPORTING_CREATE_BUCKET_FAILED"
  1169. // "REPORTING_DELETE_BUCKET_FAILED"
  1170. // "REPORTING_FATAL_ERROR"
  1171. // "REPORTING_ILLEGAL_FILENAME"
  1172. // "REPORTING_IMCOMPATIBLE_METRICS"
  1173. // "REPORTING_INVALID_QUERY_MISSING_PARTNER_AND_ADVERTISER_FILTERS"
  1174. // "REPORTING_INVALID_QUERY_TITLE_MISSING"
  1175. // "REPORTING_INVALID_QUERY_TOO_MANY_UNFILTERED_LARGE_GROUP_BYS"
  1176. // "REPORTING_QUERY_NOT_FOUND"
  1177. // "REPORTING_TRANSIENT_ERROR"
  1178. // "REPORTING_UPDATE_BUCKET_PERMISSION_FAILED"
  1179. // "REPORTING_WRITE_BUCKET_OBJECT_FAILED"
  1180. // "SERVER_ERROR"
  1181. // "UNAUTHORIZED_API_ACCESS"
  1182. // "VALIDATION_ERROR"
  1183. ErrorCode string `json:"errorCode,omitempty"`
  1184. // ForceSendFields is a list of field names (e.g. "ErrorCode") to
  1185. // unconditionally include in API requests. By default, fields with
  1186. // empty values are omitted from API requests. However, any non-pointer,
  1187. // non-interface field appearing in ForceSendFields will be sent to the
  1188. // server regardless of whether the field is empty or not. This may be
  1189. // used to include empty fields in Patch requests.
  1190. ForceSendFields []string `json:"-"`
  1191. // NullFields is a list of field names (e.g. "ErrorCode") to include in
  1192. // API requests with the JSON null value. By default, fields with empty
  1193. // values are omitted from API requests. However, any field with an
  1194. // empty value appearing in NullFields will be sent to the server as
  1195. // null. It is an error if a field in this list has a non-empty value.
  1196. // This may be used to include null fields in Patch requests.
  1197. NullFields []string `json:"-"`
  1198. }
  1199. func (s *ReportFailure) MarshalJSON() ([]byte, error) {
  1200. type NoMethod ReportFailure
  1201. raw := NoMethod(*s)
  1202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1203. }
  1204. // ReportKey: Key used to identify a report.
  1205. type ReportKey struct {
  1206. // QueryId: Query ID.
  1207. QueryId int64 `json:"queryId,omitempty,string"`
  1208. // ReportId: Report ID.
  1209. ReportId int64 `json:"reportId,omitempty,string"`
  1210. // ForceSendFields is a list of field names (e.g. "QueryId") to
  1211. // unconditionally include in API requests. By default, fields with
  1212. // empty values are omitted from API requests. However, any non-pointer,
  1213. // non-interface field appearing in ForceSendFields will be sent to the
  1214. // server regardless of whether the field is empty or not. This may be
  1215. // used to include empty fields in Patch requests.
  1216. ForceSendFields []string `json:"-"`
  1217. // NullFields is a list of field names (e.g. "QueryId") to include in
  1218. // API requests with the JSON null value. By default, fields with empty
  1219. // values are omitted from API requests. However, any field with an
  1220. // empty value appearing in NullFields will be sent to the server as
  1221. // null. It is an error if a field in this list has a non-empty value.
  1222. // This may be used to include null fields in Patch requests.
  1223. NullFields []string `json:"-"`
  1224. }
  1225. func (s *ReportKey) MarshalJSON() ([]byte, error) {
  1226. type NoMethod ReportKey
  1227. raw := NoMethod(*s)
  1228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1229. }
  1230. // ReportMetadata: Report metadata.
  1231. type ReportMetadata struct {
  1232. // GoogleCloudStoragePath: The path to the location in Google Cloud
  1233. // Storage where the report is stored.
  1234. GoogleCloudStoragePath string `json:"googleCloudStoragePath,omitempty"`
  1235. // ReportDataEndTimeMs: The ending time for the data that is shown in
  1236. // the report.
  1237. ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"`
  1238. // ReportDataStartTimeMs: The starting time for the data that is shown
  1239. // in the report.
  1240. ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"`
  1241. // Status: Report status.
  1242. Status *ReportStatus `json:"status,omitempty"`
  1243. // ForceSendFields is a list of field names (e.g.
  1244. // "GoogleCloudStoragePath") to unconditionally include in API requests.
  1245. // By default, fields with empty values are omitted from API requests.
  1246. // However, any non-pointer, non-interface field appearing in
  1247. // ForceSendFields will be sent to the server regardless of whether the
  1248. // field is empty or not. This may be used to include empty fields in
  1249. // Patch requests.
  1250. ForceSendFields []string `json:"-"`
  1251. // NullFields is a list of field names (e.g. "GoogleCloudStoragePath")
  1252. // to include in API requests with the JSON null value. By default,
  1253. // fields with empty values are omitted from API requests. However, any
  1254. // field with an empty value appearing in NullFields will be sent to the
  1255. // server as null. It is an error if a field in this list has a
  1256. // non-empty value. This may be used to include null fields in Patch
  1257. // requests.
  1258. NullFields []string `json:"-"`
  1259. }
  1260. func (s *ReportMetadata) MarshalJSON() ([]byte, error) {
  1261. type NoMethod ReportMetadata
  1262. raw := NoMethod(*s)
  1263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1264. }
  1265. // ReportStatus: Report status.
  1266. type ReportStatus struct {
  1267. // Failure: If the report failed, this records the cause.
  1268. Failure *ReportFailure `json:"failure,omitempty"`
  1269. // FinishTimeMs: The time when this report either completed successfully
  1270. // or failed.
  1271. FinishTimeMs int64 `json:"finishTimeMs,omitempty,string"`
  1272. // Format: The file type of the report.
  1273. //
  1274. // Possible values:
  1275. // "CSV"
  1276. // "EXCEL_CSV"
  1277. // "XLSX"
  1278. Format string `json:"format,omitempty"`
  1279. // State: The state of the report.
  1280. //
  1281. // Possible values:
  1282. // "DONE"
  1283. // "FAILED"
  1284. // "RUNNING"
  1285. State string `json:"state,omitempty"`
  1286. // ForceSendFields is a list of field names (e.g. "Failure") to
  1287. // unconditionally include in API requests. By default, fields with
  1288. // empty values are omitted from API requests. However, any non-pointer,
  1289. // non-interface field appearing in ForceSendFields will be sent to the
  1290. // server regardless of whether the field is empty or not. This may be
  1291. // used to include empty fields in Patch requests.
  1292. ForceSendFields []string `json:"-"`
  1293. // NullFields is a list of field names (e.g. "Failure") to include in
  1294. // API requests with the JSON null value. By default, fields with empty
  1295. // values are omitted from API requests. However, any field with an
  1296. // empty value appearing in NullFields will be sent to the server as
  1297. // null. It is an error if a field in this list has a non-empty value.
  1298. // This may be used to include null fields in Patch requests.
  1299. NullFields []string `json:"-"`
  1300. }
  1301. func (s *ReportStatus) MarshalJSON() ([]byte, error) {
  1302. type NoMethod ReportStatus
  1303. raw := NoMethod(*s)
  1304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1305. }
  1306. // RowStatus: Represents the upload status of a row in the request.
  1307. type RowStatus struct {
  1308. // Changed: Whether the stored entity is changed as a result of upload.
  1309. Changed bool `json:"changed,omitempty"`
  1310. // EntityId: Entity Id.
  1311. EntityId int64 `json:"entityId,omitempty,string"`
  1312. // EntityName: Entity name.
  1313. EntityName string `json:"entityName,omitempty"`
  1314. // Errors: Reasons why the entity can't be uploaded.
  1315. Errors []string `json:"errors,omitempty"`
  1316. // Persisted: Whether the entity is persisted.
  1317. Persisted bool `json:"persisted,omitempty"`
  1318. // RowNumber: Row number.
  1319. RowNumber int64 `json:"rowNumber,omitempty"`
  1320. // ForceSendFields is a list of field names (e.g. "Changed") to
  1321. // unconditionally include in API requests. By default, fields with
  1322. // empty values are omitted from API requests. However, any non-pointer,
  1323. // non-interface field appearing in ForceSendFields will be sent to the
  1324. // server regardless of whether the field is empty or not. This may be
  1325. // used to include empty fields in Patch requests.
  1326. ForceSendFields []string `json:"-"`
  1327. // NullFields is a list of field names (e.g. "Changed") to include in
  1328. // API requests with the JSON null value. By default, fields with empty
  1329. // values are omitted from API requests. However, any field with an
  1330. // empty value appearing in NullFields will be sent to the server as
  1331. // null. It is an error if a field in this list has a non-empty value.
  1332. // This may be used to include null fields in Patch requests.
  1333. NullFields []string `json:"-"`
  1334. }
  1335. func (s *RowStatus) MarshalJSON() ([]byte, error) {
  1336. type NoMethod RowStatus
  1337. raw := NoMethod(*s)
  1338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1339. }
  1340. // RunQueryRequest: Request to run a stored query to generate a report.
  1341. type RunQueryRequest struct {
  1342. // DataRange: Report data range used to generate the report.
  1343. //
  1344. // Possible values:
  1345. // "ALL_TIME"
  1346. // "CURRENT_DAY"
  1347. // "CUSTOM_DATES"
  1348. // "LAST_14_DAYS"
  1349. // "LAST_30_DAYS"
  1350. // "LAST_365_DAYS"
  1351. // "LAST_7_DAYS"
  1352. // "LAST_90_DAYS"
  1353. // "MONTH_TO_DATE"
  1354. // "PREVIOUS_DAY"
  1355. // "PREVIOUS_HALF_MONTH"
  1356. // "PREVIOUS_MONTH"
  1357. // "PREVIOUS_QUARTER"
  1358. // "PREVIOUS_WEEK"
  1359. // "PREVIOUS_YEAR"
  1360. // "QUARTER_TO_DATE"
  1361. // "TYPE_NOT_SUPPORTED"
  1362. // "WEEK_TO_DATE"
  1363. // "YEAR_TO_DATE"
  1364. DataRange string `json:"dataRange,omitempty"`
  1365. // ReportDataEndTimeMs: The ending time for the data that is shown in
  1366. // the report. Note, reportDataEndTimeMs is required if dataRange is
  1367. // CUSTOM_DATES and ignored otherwise.
  1368. ReportDataEndTimeMs int64 `json:"reportDataEndTimeMs,omitempty,string"`
  1369. // ReportDataStartTimeMs: The starting time for the data that is shown
  1370. // in the report. Note, reportDataStartTimeMs is required if dataRange
  1371. // is CUSTOM_DATES and ignored otherwise.
  1372. ReportDataStartTimeMs int64 `json:"reportDataStartTimeMs,omitempty,string"`
  1373. // TimezoneCode: Canonical timezone code for report data time. Defaults
  1374. // to America/New_York.
  1375. TimezoneCode string `json:"timezoneCode,omitempty"`
  1376. // ForceSendFields is a list of field names (e.g. "DataRange") to
  1377. // unconditionally include in API requests. By default, fields with
  1378. // empty values are omitted from API requests. However, any non-pointer,
  1379. // non-interface field appearing in ForceSendFields will be sent to the
  1380. // server regardless of whether the field is empty or not. This may be
  1381. // used to include empty fields in Patch requests.
  1382. ForceSendFields []string `json:"-"`
  1383. // NullFields is a list of field names (e.g. "DataRange") to include in
  1384. // API requests with the JSON null value. By default, fields with empty
  1385. // values are omitted from API requests. However, any field with an
  1386. // empty value appearing in NullFields will be sent to the server as
  1387. // null. It is an error if a field in this list has a non-empty value.
  1388. // This may be used to include null fields in Patch requests.
  1389. NullFields []string `json:"-"`
  1390. }
  1391. func (s *RunQueryRequest) MarshalJSON() ([]byte, error) {
  1392. type NoMethod RunQueryRequest
  1393. raw := NoMethod(*s)
  1394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1395. }
  1396. // UploadLineItemsRequest: Request to upload line items.
  1397. type UploadLineItemsRequest struct {
  1398. // DryRun: Set to true to get upload status without actually persisting
  1399. // the line items.
  1400. DryRun bool `json:"dryRun,omitempty"`
  1401. // Format: Format the line items are in. Default to CSV.
  1402. //
  1403. // Possible values:
  1404. // "CSV"
  1405. Format string `json:"format,omitempty"`
  1406. // LineItems: Line items in CSV to upload. Refer to Entity Write File
  1407. // Format for more information on file format.
  1408. LineItems string `json:"lineItems,omitempty"`
  1409. // ForceSendFields is a list of field names (e.g. "DryRun") to
  1410. // unconditionally include in API requests. By default, fields with
  1411. // empty values are omitted from API requests. However, any non-pointer,
  1412. // non-interface field appearing in ForceSendFields will be sent to the
  1413. // server regardless of whether the field is empty or not. This may be
  1414. // used to include empty fields in Patch requests.
  1415. ForceSendFields []string `json:"-"`
  1416. // NullFields is a list of field names (e.g. "DryRun") to include in API
  1417. // requests with the JSON null value. By default, fields with empty
  1418. // values are omitted from API requests. However, any field with an
  1419. // empty value appearing in NullFields will be sent to the server as
  1420. // null. It is an error if a field in this list has a non-empty value.
  1421. // This may be used to include null fields in Patch requests.
  1422. NullFields []string `json:"-"`
  1423. }
  1424. func (s *UploadLineItemsRequest) MarshalJSON() ([]byte, error) {
  1425. type NoMethod UploadLineItemsRequest
  1426. raw := NoMethod(*s)
  1427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1428. }
  1429. // UploadLineItemsResponse: Upload line items response.
  1430. type UploadLineItemsResponse struct {
  1431. // UploadStatus: Status of upload.
  1432. UploadStatus *UploadStatus `json:"uploadStatus,omitempty"`
  1433. // ServerResponse contains the HTTP response code and headers from the
  1434. // server.
  1435. googleapi.ServerResponse `json:"-"`
  1436. // ForceSendFields is a list of field names (e.g. "UploadStatus") to
  1437. // unconditionally include in API requests. By default, fields with
  1438. // empty values are omitted from API requests. However, any non-pointer,
  1439. // non-interface field appearing in ForceSendFields will be sent to the
  1440. // server regardless of whether the field is empty or not. This may be
  1441. // used to include empty fields in Patch requests.
  1442. ForceSendFields []string `json:"-"`
  1443. // NullFields is a list of field names (e.g. "UploadStatus") to include
  1444. // in API requests with the JSON null value. By default, fields with
  1445. // empty values are omitted from API requests. However, any field with
  1446. // an empty value appearing in NullFields will be sent to the server as
  1447. // null. It is an error if a field in this list has a non-empty value.
  1448. // This may be used to include null fields in Patch requests.
  1449. NullFields []string `json:"-"`
  1450. }
  1451. func (s *UploadLineItemsResponse) MarshalJSON() ([]byte, error) {
  1452. type NoMethod UploadLineItemsResponse
  1453. raw := NoMethod(*s)
  1454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1455. }
  1456. // UploadStatus: Represents the status of upload.
  1457. type UploadStatus struct {
  1458. // Errors: Reasons why upload can't be completed.
  1459. Errors []string `json:"errors,omitempty"`
  1460. // RowStatus: Per-row upload status.
  1461. RowStatus []*RowStatus `json:"rowStatus,omitempty"`
  1462. // ForceSendFields is a list of field names (e.g. "Errors") to
  1463. // unconditionally include in API requests. By default, fields with
  1464. // empty values are omitted from API requests. However, any non-pointer,
  1465. // non-interface field appearing in ForceSendFields will be sent to the
  1466. // server regardless of whether the field is empty or not. This may be
  1467. // used to include empty fields in Patch requests.
  1468. ForceSendFields []string `json:"-"`
  1469. // NullFields is a list of field names (e.g. "Errors") to include in API
  1470. // requests with the JSON null value. By default, fields with empty
  1471. // values are omitted from API requests. However, any field with an
  1472. // empty value appearing in NullFields will be sent to the server as
  1473. // null. It is an error if a field in this list has a non-empty value.
  1474. // This may be used to include null fields in Patch requests.
  1475. NullFields []string `json:"-"`
  1476. }
  1477. func (s *UploadStatus) MarshalJSON() ([]byte, error) {
  1478. type NoMethod UploadStatus
  1479. raw := NoMethod(*s)
  1480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1481. }
  1482. // method id "doubleclickbidmanager.lineitems.downloadlineitems":
  1483. type LineitemsDownloadlineitemsCall struct {
  1484. s *Service
  1485. downloadlineitemsrequest *DownloadLineItemsRequest
  1486. urlParams_ gensupport.URLParams
  1487. ctx_ context.Context
  1488. header_ http.Header
  1489. }
  1490. // Downloadlineitems: Retrieves line items in CSV format. TrueView line
  1491. // items are not supported.
  1492. func (r *LineitemsService) Downloadlineitems(downloadlineitemsrequest *DownloadLineItemsRequest) *LineitemsDownloadlineitemsCall {
  1493. c := &LineitemsDownloadlineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1494. c.downloadlineitemsrequest = downloadlineitemsrequest
  1495. return c
  1496. }
  1497. // Fields allows partial responses to be retrieved. See
  1498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1499. // for more information.
  1500. func (c *LineitemsDownloadlineitemsCall) Fields(s ...googleapi.Field) *LineitemsDownloadlineitemsCall {
  1501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1502. return c
  1503. }
  1504. // Context sets the context to be used in this call's Do method. Any
  1505. // pending HTTP request will be aborted if the provided context is
  1506. // canceled.
  1507. func (c *LineitemsDownloadlineitemsCall) Context(ctx context.Context) *LineitemsDownloadlineitemsCall {
  1508. c.ctx_ = ctx
  1509. return c
  1510. }
  1511. // Header returns an http.Header that can be modified by the caller to
  1512. // add HTTP headers to the request.
  1513. func (c *LineitemsDownloadlineitemsCall) Header() http.Header {
  1514. if c.header_ == nil {
  1515. c.header_ = make(http.Header)
  1516. }
  1517. return c.header_
  1518. }
  1519. func (c *LineitemsDownloadlineitemsCall) doRequest(alt string) (*http.Response, error) {
  1520. reqHeaders := make(http.Header)
  1521. for k, v := range c.header_ {
  1522. reqHeaders[k] = v
  1523. }
  1524. reqHeaders.Set("User-Agent", c.s.userAgent())
  1525. var body io.Reader = nil
  1526. body, err := googleapi.WithoutDataWrapper.JSONReader(c.downloadlineitemsrequest)
  1527. if err != nil {
  1528. return nil, err
  1529. }
  1530. reqHeaders.Set("Content-Type", "application/json")
  1531. c.urlParams_.Set("alt", alt)
  1532. urls := googleapi.ResolveRelative(c.s.BasePath, "lineitems/downloadlineitems")
  1533. urls += "?" + c.urlParams_.Encode()
  1534. req, _ := http.NewRequest("POST", urls, body)
  1535. req.Header = reqHeaders
  1536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1537. }
  1538. // Do executes the "doubleclickbidmanager.lineitems.downloadlineitems" call.
  1539. // Exactly one of *DownloadLineItemsResponse or error will be non-nil.
  1540. // Any non-2xx status code is an error. Response headers are in either
  1541. // *DownloadLineItemsResponse.ServerResponse.Header or (if a response
  1542. // was returned at all) in error.(*googleapi.Error).Header. Use
  1543. // googleapi.IsNotModified to check whether the returned error was
  1544. // because http.StatusNotModified was returned.
  1545. func (c *LineitemsDownloadlineitemsCall) Do(opts ...googleapi.CallOption) (*DownloadLineItemsResponse, error) {
  1546. gensupport.SetOptions(c.urlParams_, opts...)
  1547. res, err := c.doRequest("json")
  1548. if res != nil && res.StatusCode == http.StatusNotModified {
  1549. if res.Body != nil {
  1550. res.Body.Close()
  1551. }
  1552. return nil, &googleapi.Error{
  1553. Code: res.StatusCode,
  1554. Header: res.Header,
  1555. }
  1556. }
  1557. if err != nil {
  1558. return nil, err
  1559. }
  1560. defer googleapi.CloseBody(res)
  1561. if err := googleapi.CheckResponse(res); err != nil {
  1562. return nil, err
  1563. }
  1564. ret := &DownloadLineItemsResponse{
  1565. ServerResponse: googleapi.ServerResponse{
  1566. Header: res.Header,
  1567. HTTPStatusCode: res.StatusCode,
  1568. },
  1569. }
  1570. target := &ret
  1571. if err := gensupport.DecodeResponse(target, res); err != nil {
  1572. return nil, err
  1573. }
  1574. return ret, nil
  1575. // {
  1576. // "description": "Retrieves line items in CSV format. TrueView line items are not supported.",
  1577. // "httpMethod": "POST",
  1578. // "id": "doubleclickbidmanager.lineitems.downloadlineitems",
  1579. // "path": "lineitems/downloadlineitems",
  1580. // "request": {
  1581. // "$ref": "DownloadLineItemsRequest"
  1582. // },
  1583. // "response": {
  1584. // "$ref": "DownloadLineItemsResponse"
  1585. // },
  1586. // "scopes": [
  1587. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  1588. // ]
  1589. // }
  1590. }
  1591. // method id "doubleclickbidmanager.lineitems.uploadlineitems":
  1592. type LineitemsUploadlineitemsCall struct {
  1593. s *Service
  1594. uploadlineitemsrequest *UploadLineItemsRequest
  1595. urlParams_ gensupport.URLParams
  1596. ctx_ context.Context
  1597. header_ http.Header
  1598. }
  1599. // Uploadlineitems: Uploads line items in CSV format. TrueView line
  1600. // items are not supported.
  1601. func (r *LineitemsService) Uploadlineitems(uploadlineitemsrequest *UploadLineItemsRequest) *LineitemsUploadlineitemsCall {
  1602. c := &LineitemsUploadlineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1603. c.uploadlineitemsrequest = uploadlineitemsrequest
  1604. return c
  1605. }
  1606. // Fields allows partial responses to be retrieved. See
  1607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1608. // for more information.
  1609. func (c *LineitemsUploadlineitemsCall) Fields(s ...googleapi.Field) *LineitemsUploadlineitemsCall {
  1610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1611. return c
  1612. }
  1613. // Context sets the context to be used in this call's Do method. Any
  1614. // pending HTTP request will be aborted if the provided context is
  1615. // canceled.
  1616. func (c *LineitemsUploadlineitemsCall) Context(ctx context.Context) *LineitemsUploadlineitemsCall {
  1617. c.ctx_ = ctx
  1618. return c
  1619. }
  1620. // Header returns an http.Header that can be modified by the caller to
  1621. // add HTTP headers to the request.
  1622. func (c *LineitemsUploadlineitemsCall) Header() http.Header {
  1623. if c.header_ == nil {
  1624. c.header_ = make(http.Header)
  1625. }
  1626. return c.header_
  1627. }
  1628. func (c *LineitemsUploadlineitemsCall) doRequest(alt string) (*http.Response, error) {
  1629. reqHeaders := make(http.Header)
  1630. for k, v := range c.header_ {
  1631. reqHeaders[k] = v
  1632. }
  1633. reqHeaders.Set("User-Agent", c.s.userAgent())
  1634. var body io.Reader = nil
  1635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.uploadlineitemsrequest)
  1636. if err != nil {
  1637. return nil, err
  1638. }
  1639. reqHeaders.Set("Content-Type", "application/json")
  1640. c.urlParams_.Set("alt", alt)
  1641. urls := googleapi.ResolveRelative(c.s.BasePath, "lineitems/uploadlineitems")
  1642. urls += "?" + c.urlParams_.Encode()
  1643. req, _ := http.NewRequest("POST", urls, body)
  1644. req.Header = reqHeaders
  1645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1646. }
  1647. // Do executes the "doubleclickbidmanager.lineitems.uploadlineitems" call.
  1648. // Exactly one of *UploadLineItemsResponse or error will be non-nil. Any
  1649. // non-2xx status code is an error. Response headers are in either
  1650. // *UploadLineItemsResponse.ServerResponse.Header or (if a response was
  1651. // returned at all) in error.(*googleapi.Error).Header. Use
  1652. // googleapi.IsNotModified to check whether the returned error was
  1653. // because http.StatusNotModified was returned.
  1654. func (c *LineitemsUploadlineitemsCall) Do(opts ...googleapi.CallOption) (*UploadLineItemsResponse, error) {
  1655. gensupport.SetOptions(c.urlParams_, opts...)
  1656. res, err := c.doRequest("json")
  1657. if res != nil && res.StatusCode == http.StatusNotModified {
  1658. if res.Body != nil {
  1659. res.Body.Close()
  1660. }
  1661. return nil, &googleapi.Error{
  1662. Code: res.StatusCode,
  1663. Header: res.Header,
  1664. }
  1665. }
  1666. if err != nil {
  1667. return nil, err
  1668. }
  1669. defer googleapi.CloseBody(res)
  1670. if err := googleapi.CheckResponse(res); err != nil {
  1671. return nil, err
  1672. }
  1673. ret := &UploadLineItemsResponse{
  1674. ServerResponse: googleapi.ServerResponse{
  1675. Header: res.Header,
  1676. HTTPStatusCode: res.StatusCode,
  1677. },
  1678. }
  1679. target := &ret
  1680. if err := gensupport.DecodeResponse(target, res); err != nil {
  1681. return nil, err
  1682. }
  1683. return ret, nil
  1684. // {
  1685. // "description": "Uploads line items in CSV format. TrueView line items are not supported.",
  1686. // "httpMethod": "POST",
  1687. // "id": "doubleclickbidmanager.lineitems.uploadlineitems",
  1688. // "path": "lineitems/uploadlineitems",
  1689. // "request": {
  1690. // "$ref": "UploadLineItemsRequest"
  1691. // },
  1692. // "response": {
  1693. // "$ref": "UploadLineItemsResponse"
  1694. // },
  1695. // "scopes": [
  1696. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  1697. // ]
  1698. // }
  1699. }
  1700. // method id "doubleclickbidmanager.queries.createquery":
  1701. type QueriesCreatequeryCall struct {
  1702. s *Service
  1703. query *Query
  1704. urlParams_ gensupport.URLParams
  1705. ctx_ context.Context
  1706. header_ http.Header
  1707. }
  1708. // Createquery: Creates a query.
  1709. func (r *QueriesService) Createquery(query *Query) *QueriesCreatequeryCall {
  1710. c := &QueriesCreatequeryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1711. c.query = query
  1712. return c
  1713. }
  1714. // Fields allows partial responses to be retrieved. See
  1715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1716. // for more information.
  1717. func (c *QueriesCreatequeryCall) Fields(s ...googleapi.Field) *QueriesCreatequeryCall {
  1718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1719. return c
  1720. }
  1721. // Context sets the context to be used in this call's Do method. Any
  1722. // pending HTTP request will be aborted if the provided context is
  1723. // canceled.
  1724. func (c *QueriesCreatequeryCall) Context(ctx context.Context) *QueriesCreatequeryCall {
  1725. c.ctx_ = ctx
  1726. return c
  1727. }
  1728. // Header returns an http.Header that can be modified by the caller to
  1729. // add HTTP headers to the request.
  1730. func (c *QueriesCreatequeryCall) Header() http.Header {
  1731. if c.header_ == nil {
  1732. c.header_ = make(http.Header)
  1733. }
  1734. return c.header_
  1735. }
  1736. func (c *QueriesCreatequeryCall) doRequest(alt string) (*http.Response, error) {
  1737. reqHeaders := make(http.Header)
  1738. for k, v := range c.header_ {
  1739. reqHeaders[k] = v
  1740. }
  1741. reqHeaders.Set("User-Agent", c.s.userAgent())
  1742. var body io.Reader = nil
  1743. body, err := googleapi.WithoutDataWrapper.JSONReader(c.query)
  1744. if err != nil {
  1745. return nil, err
  1746. }
  1747. reqHeaders.Set("Content-Type", "application/json")
  1748. c.urlParams_.Set("alt", alt)
  1749. urls := googleapi.ResolveRelative(c.s.BasePath, "query")
  1750. urls += "?" + c.urlParams_.Encode()
  1751. req, _ := http.NewRequest("POST", urls, body)
  1752. req.Header = reqHeaders
  1753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1754. }
  1755. // Do executes the "doubleclickbidmanager.queries.createquery" call.
  1756. // Exactly one of *Query or error will be non-nil. Any non-2xx status
  1757. // code is an error. Response headers are in either
  1758. // *Query.ServerResponse.Header or (if a response was returned at all)
  1759. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1760. // check whether the returned error was because http.StatusNotModified
  1761. // was returned.
  1762. func (c *QueriesCreatequeryCall) Do(opts ...googleapi.CallOption) (*Query, error) {
  1763. gensupport.SetOptions(c.urlParams_, opts...)
  1764. res, err := c.doRequest("json")
  1765. if res != nil && res.StatusCode == http.StatusNotModified {
  1766. if res.Body != nil {
  1767. res.Body.Close()
  1768. }
  1769. return nil, &googleapi.Error{
  1770. Code: res.StatusCode,
  1771. Header: res.Header,
  1772. }
  1773. }
  1774. if err != nil {
  1775. return nil, err
  1776. }
  1777. defer googleapi.CloseBody(res)
  1778. if err := googleapi.CheckResponse(res); err != nil {
  1779. return nil, err
  1780. }
  1781. ret := &Query{
  1782. ServerResponse: googleapi.ServerResponse{
  1783. Header: res.Header,
  1784. HTTPStatusCode: res.StatusCode,
  1785. },
  1786. }
  1787. target := &ret
  1788. if err := gensupport.DecodeResponse(target, res); err != nil {
  1789. return nil, err
  1790. }
  1791. return ret, nil
  1792. // {
  1793. // "description": "Creates a query.",
  1794. // "httpMethod": "POST",
  1795. // "id": "doubleclickbidmanager.queries.createquery",
  1796. // "path": "query",
  1797. // "request": {
  1798. // "$ref": "Query"
  1799. // },
  1800. // "response": {
  1801. // "$ref": "Query"
  1802. // },
  1803. // "scopes": [
  1804. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  1805. // ]
  1806. // }
  1807. }
  1808. // method id "doubleclickbidmanager.queries.deletequery":
  1809. type QueriesDeletequeryCall struct {
  1810. s *Service
  1811. queryId int64
  1812. urlParams_ gensupport.URLParams
  1813. ctx_ context.Context
  1814. header_ http.Header
  1815. }
  1816. // Deletequery: Deletes a stored query as well as the associated stored
  1817. // reports.
  1818. func (r *QueriesService) Deletequery(queryId int64) *QueriesDeletequeryCall {
  1819. c := &QueriesDeletequeryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1820. c.queryId = queryId
  1821. return c
  1822. }
  1823. // Fields allows partial responses to be retrieved. See
  1824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1825. // for more information.
  1826. func (c *QueriesDeletequeryCall) Fields(s ...googleapi.Field) *QueriesDeletequeryCall {
  1827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1828. return c
  1829. }
  1830. // Context sets the context to be used in this call's Do method. Any
  1831. // pending HTTP request will be aborted if the provided context is
  1832. // canceled.
  1833. func (c *QueriesDeletequeryCall) Context(ctx context.Context) *QueriesDeletequeryCall {
  1834. c.ctx_ = ctx
  1835. return c
  1836. }
  1837. // Header returns an http.Header that can be modified by the caller to
  1838. // add HTTP headers to the request.
  1839. func (c *QueriesDeletequeryCall) Header() http.Header {
  1840. if c.header_ == nil {
  1841. c.header_ = make(http.Header)
  1842. }
  1843. return c.header_
  1844. }
  1845. func (c *QueriesDeletequeryCall) doRequest(alt string) (*http.Response, error) {
  1846. reqHeaders := make(http.Header)
  1847. for k, v := range c.header_ {
  1848. reqHeaders[k] = v
  1849. }
  1850. reqHeaders.Set("User-Agent", c.s.userAgent())
  1851. var body io.Reader = nil
  1852. c.urlParams_.Set("alt", alt)
  1853. urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}")
  1854. urls += "?" + c.urlParams_.Encode()
  1855. req, _ := http.NewRequest("DELETE", urls, body)
  1856. req.Header = reqHeaders
  1857. googleapi.Expand(req.URL, map[string]string{
  1858. "queryId": strconv.FormatInt(c.queryId, 10),
  1859. })
  1860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1861. }
  1862. // Do executes the "doubleclickbidmanager.queries.deletequery" call.
  1863. func (c *QueriesDeletequeryCall) Do(opts ...googleapi.CallOption) error {
  1864. gensupport.SetOptions(c.urlParams_, opts...)
  1865. res, err := c.doRequest("json")
  1866. if err != nil {
  1867. return err
  1868. }
  1869. defer googleapi.CloseBody(res)
  1870. if err := googleapi.CheckResponse(res); err != nil {
  1871. return err
  1872. }
  1873. return nil
  1874. // {
  1875. // "description": "Deletes a stored query as well as the associated stored reports.",
  1876. // "httpMethod": "DELETE",
  1877. // "id": "doubleclickbidmanager.queries.deletequery",
  1878. // "parameterOrder": [
  1879. // "queryId"
  1880. // ],
  1881. // "parameters": {
  1882. // "queryId": {
  1883. // "description": "Query ID to delete.",
  1884. // "format": "int64",
  1885. // "location": "path",
  1886. // "required": true,
  1887. // "type": "string"
  1888. // }
  1889. // },
  1890. // "path": "query/{queryId}",
  1891. // "scopes": [
  1892. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  1893. // ]
  1894. // }
  1895. }
  1896. // method id "doubleclickbidmanager.queries.getquery":
  1897. type QueriesGetqueryCall struct {
  1898. s *Service
  1899. queryId int64
  1900. urlParams_ gensupport.URLParams
  1901. ifNoneMatch_ string
  1902. ctx_ context.Context
  1903. header_ http.Header
  1904. }
  1905. // Getquery: Retrieves a stored query.
  1906. func (r *QueriesService) Getquery(queryId int64) *QueriesGetqueryCall {
  1907. c := &QueriesGetqueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1908. c.queryId = queryId
  1909. return c
  1910. }
  1911. // Fields allows partial responses to be retrieved. See
  1912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1913. // for more information.
  1914. func (c *QueriesGetqueryCall) Fields(s ...googleapi.Field) *QueriesGetqueryCall {
  1915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1916. return c
  1917. }
  1918. // IfNoneMatch sets the optional parameter which makes the operation
  1919. // fail if the object's ETag matches the given value. This is useful for
  1920. // getting updates only after the object has changed since the last
  1921. // request. Use googleapi.IsNotModified to check whether the response
  1922. // error from Do is the result of In-None-Match.
  1923. func (c *QueriesGetqueryCall) IfNoneMatch(entityTag string) *QueriesGetqueryCall {
  1924. c.ifNoneMatch_ = entityTag
  1925. return c
  1926. }
  1927. // Context sets the context to be used in this call's Do method. Any
  1928. // pending HTTP request will be aborted if the provided context is
  1929. // canceled.
  1930. func (c *QueriesGetqueryCall) Context(ctx context.Context) *QueriesGetqueryCall {
  1931. c.ctx_ = ctx
  1932. return c
  1933. }
  1934. // Header returns an http.Header that can be modified by the caller to
  1935. // add HTTP headers to the request.
  1936. func (c *QueriesGetqueryCall) Header() http.Header {
  1937. if c.header_ == nil {
  1938. c.header_ = make(http.Header)
  1939. }
  1940. return c.header_
  1941. }
  1942. func (c *QueriesGetqueryCall) doRequest(alt string) (*http.Response, error) {
  1943. reqHeaders := make(http.Header)
  1944. for k, v := range c.header_ {
  1945. reqHeaders[k] = v
  1946. }
  1947. reqHeaders.Set("User-Agent", c.s.userAgent())
  1948. if c.ifNoneMatch_ != "" {
  1949. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1950. }
  1951. var body io.Reader = nil
  1952. c.urlParams_.Set("alt", alt)
  1953. urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}")
  1954. urls += "?" + c.urlParams_.Encode()
  1955. req, _ := http.NewRequest("GET", urls, body)
  1956. req.Header = reqHeaders
  1957. googleapi.Expand(req.URL, map[string]string{
  1958. "queryId": strconv.FormatInt(c.queryId, 10),
  1959. })
  1960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1961. }
  1962. // Do executes the "doubleclickbidmanager.queries.getquery" call.
  1963. // Exactly one of *Query or error will be non-nil. Any non-2xx status
  1964. // code is an error. Response headers are in either
  1965. // *Query.ServerResponse.Header or (if a response was returned at all)
  1966. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1967. // check whether the returned error was because http.StatusNotModified
  1968. // was returned.
  1969. func (c *QueriesGetqueryCall) Do(opts ...googleapi.CallOption) (*Query, error) {
  1970. gensupport.SetOptions(c.urlParams_, opts...)
  1971. res, err := c.doRequest("json")
  1972. if res != nil && res.StatusCode == http.StatusNotModified {
  1973. if res.Body != nil {
  1974. res.Body.Close()
  1975. }
  1976. return nil, &googleapi.Error{
  1977. Code: res.StatusCode,
  1978. Header: res.Header,
  1979. }
  1980. }
  1981. if err != nil {
  1982. return nil, err
  1983. }
  1984. defer googleapi.CloseBody(res)
  1985. if err := googleapi.CheckResponse(res); err != nil {
  1986. return nil, err
  1987. }
  1988. ret := &Query{
  1989. ServerResponse: googleapi.ServerResponse{
  1990. Header: res.Header,
  1991. HTTPStatusCode: res.StatusCode,
  1992. },
  1993. }
  1994. target := &ret
  1995. if err := gensupport.DecodeResponse(target, res); err != nil {
  1996. return nil, err
  1997. }
  1998. return ret, nil
  1999. // {
  2000. // "description": "Retrieves a stored query.",
  2001. // "httpMethod": "GET",
  2002. // "id": "doubleclickbidmanager.queries.getquery",
  2003. // "parameterOrder": [
  2004. // "queryId"
  2005. // ],
  2006. // "parameters": {
  2007. // "queryId": {
  2008. // "description": "Query ID to retrieve.",
  2009. // "format": "int64",
  2010. // "location": "path",
  2011. // "required": true,
  2012. // "type": "string"
  2013. // }
  2014. // },
  2015. // "path": "query/{queryId}",
  2016. // "response": {
  2017. // "$ref": "Query"
  2018. // },
  2019. // "scopes": [
  2020. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  2021. // ]
  2022. // }
  2023. }
  2024. // method id "doubleclickbidmanager.queries.listqueries":
  2025. type QueriesListqueriesCall struct {
  2026. s *Service
  2027. urlParams_ gensupport.URLParams
  2028. ifNoneMatch_ string
  2029. ctx_ context.Context
  2030. header_ http.Header
  2031. }
  2032. // Listqueries: Retrieves stored queries.
  2033. func (r *QueriesService) Listqueries() *QueriesListqueriesCall {
  2034. c := &QueriesListqueriesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2035. return c
  2036. }
  2037. // Fields allows partial responses to be retrieved. See
  2038. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2039. // for more information.
  2040. func (c *QueriesListqueriesCall) Fields(s ...googleapi.Field) *QueriesListqueriesCall {
  2041. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2042. return c
  2043. }
  2044. // IfNoneMatch sets the optional parameter which makes the operation
  2045. // fail if the object's ETag matches the given value. This is useful for
  2046. // getting updates only after the object has changed since the last
  2047. // request. Use googleapi.IsNotModified to check whether the response
  2048. // error from Do is the result of In-None-Match.
  2049. func (c *QueriesListqueriesCall) IfNoneMatch(entityTag string) *QueriesListqueriesCall {
  2050. c.ifNoneMatch_ = entityTag
  2051. return c
  2052. }
  2053. // Context sets the context to be used in this call's Do method. Any
  2054. // pending HTTP request will be aborted if the provided context is
  2055. // canceled.
  2056. func (c *QueriesListqueriesCall) Context(ctx context.Context) *QueriesListqueriesCall {
  2057. c.ctx_ = ctx
  2058. return c
  2059. }
  2060. // Header returns an http.Header that can be modified by the caller to
  2061. // add HTTP headers to the request.
  2062. func (c *QueriesListqueriesCall) Header() http.Header {
  2063. if c.header_ == nil {
  2064. c.header_ = make(http.Header)
  2065. }
  2066. return c.header_
  2067. }
  2068. func (c *QueriesListqueriesCall) doRequest(alt string) (*http.Response, error) {
  2069. reqHeaders := make(http.Header)
  2070. for k, v := range c.header_ {
  2071. reqHeaders[k] = v
  2072. }
  2073. reqHeaders.Set("User-Agent", c.s.userAgent())
  2074. if c.ifNoneMatch_ != "" {
  2075. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2076. }
  2077. var body io.Reader = nil
  2078. c.urlParams_.Set("alt", alt)
  2079. urls := googleapi.ResolveRelative(c.s.BasePath, "queries")
  2080. urls += "?" + c.urlParams_.Encode()
  2081. req, _ := http.NewRequest("GET", urls, body)
  2082. req.Header = reqHeaders
  2083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2084. }
  2085. // Do executes the "doubleclickbidmanager.queries.listqueries" call.
  2086. // Exactly one of *ListQueriesResponse or error will be non-nil. Any
  2087. // non-2xx status code is an error. Response headers are in either
  2088. // *ListQueriesResponse.ServerResponse.Header or (if a response was
  2089. // returned at all) in error.(*googleapi.Error).Header. Use
  2090. // googleapi.IsNotModified to check whether the returned error was
  2091. // because http.StatusNotModified was returned.
  2092. func (c *QueriesListqueriesCall) Do(opts ...googleapi.CallOption) (*ListQueriesResponse, error) {
  2093. gensupport.SetOptions(c.urlParams_, opts...)
  2094. res, err := c.doRequest("json")
  2095. if res != nil && res.StatusCode == http.StatusNotModified {
  2096. if res.Body != nil {
  2097. res.Body.Close()
  2098. }
  2099. return nil, &googleapi.Error{
  2100. Code: res.StatusCode,
  2101. Header: res.Header,
  2102. }
  2103. }
  2104. if err != nil {
  2105. return nil, err
  2106. }
  2107. defer googleapi.CloseBody(res)
  2108. if err := googleapi.CheckResponse(res); err != nil {
  2109. return nil, err
  2110. }
  2111. ret := &ListQueriesResponse{
  2112. ServerResponse: googleapi.ServerResponse{
  2113. Header: res.Header,
  2114. HTTPStatusCode: res.StatusCode,
  2115. },
  2116. }
  2117. target := &ret
  2118. if err := gensupport.DecodeResponse(target, res); err != nil {
  2119. return nil, err
  2120. }
  2121. return ret, nil
  2122. // {
  2123. // "description": "Retrieves stored queries.",
  2124. // "httpMethod": "GET",
  2125. // "id": "doubleclickbidmanager.queries.listqueries",
  2126. // "path": "queries",
  2127. // "response": {
  2128. // "$ref": "ListQueriesResponse"
  2129. // },
  2130. // "scopes": [
  2131. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  2132. // ]
  2133. // }
  2134. }
  2135. // method id "doubleclickbidmanager.queries.runquery":
  2136. type QueriesRunqueryCall struct {
  2137. s *Service
  2138. queryId int64
  2139. runqueryrequest *RunQueryRequest
  2140. urlParams_ gensupport.URLParams
  2141. ctx_ context.Context
  2142. header_ http.Header
  2143. }
  2144. // Runquery: Runs a stored query to generate a report.
  2145. func (r *QueriesService) Runquery(queryId int64, runqueryrequest *RunQueryRequest) *QueriesRunqueryCall {
  2146. c := &QueriesRunqueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2147. c.queryId = queryId
  2148. c.runqueryrequest = runqueryrequest
  2149. return c
  2150. }
  2151. // Fields allows partial responses to be retrieved. See
  2152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2153. // for more information.
  2154. func (c *QueriesRunqueryCall) Fields(s ...googleapi.Field) *QueriesRunqueryCall {
  2155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2156. return c
  2157. }
  2158. // Context sets the context to be used in this call's Do method. Any
  2159. // pending HTTP request will be aborted if the provided context is
  2160. // canceled.
  2161. func (c *QueriesRunqueryCall) Context(ctx context.Context) *QueriesRunqueryCall {
  2162. c.ctx_ = ctx
  2163. return c
  2164. }
  2165. // Header returns an http.Header that can be modified by the caller to
  2166. // add HTTP headers to the request.
  2167. func (c *QueriesRunqueryCall) Header() http.Header {
  2168. if c.header_ == nil {
  2169. c.header_ = make(http.Header)
  2170. }
  2171. return c.header_
  2172. }
  2173. func (c *QueriesRunqueryCall) doRequest(alt string) (*http.Response, error) {
  2174. reqHeaders := make(http.Header)
  2175. for k, v := range c.header_ {
  2176. reqHeaders[k] = v
  2177. }
  2178. reqHeaders.Set("User-Agent", c.s.userAgent())
  2179. var body io.Reader = nil
  2180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
  2181. if err != nil {
  2182. return nil, err
  2183. }
  2184. reqHeaders.Set("Content-Type", "application/json")
  2185. c.urlParams_.Set("alt", alt)
  2186. urls := googleapi.ResolveRelative(c.s.BasePath, "query/{queryId}")
  2187. urls += "?" + c.urlParams_.Encode()
  2188. req, _ := http.NewRequest("POST", urls, body)
  2189. req.Header = reqHeaders
  2190. googleapi.Expand(req.URL, map[string]string{
  2191. "queryId": strconv.FormatInt(c.queryId, 10),
  2192. })
  2193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2194. }
  2195. // Do executes the "doubleclickbidmanager.queries.runquery" call.
  2196. func (c *QueriesRunqueryCall) Do(opts ...googleapi.CallOption) error {
  2197. gensupport.SetOptions(c.urlParams_, opts...)
  2198. res, err := c.doRequest("json")
  2199. if err != nil {
  2200. return err
  2201. }
  2202. defer googleapi.CloseBody(res)
  2203. if err := googleapi.CheckResponse(res); err != nil {
  2204. return err
  2205. }
  2206. return nil
  2207. // {
  2208. // "description": "Runs a stored query to generate a report.",
  2209. // "httpMethod": "POST",
  2210. // "id": "doubleclickbidmanager.queries.runquery",
  2211. // "parameterOrder": [
  2212. // "queryId"
  2213. // ],
  2214. // "parameters": {
  2215. // "queryId": {
  2216. // "description": "Query ID to run.",
  2217. // "format": "int64",
  2218. // "location": "path",
  2219. // "required": true,
  2220. // "type": "string"
  2221. // }
  2222. // },
  2223. // "path": "query/{queryId}",
  2224. // "request": {
  2225. // "$ref": "RunQueryRequest"
  2226. // },
  2227. // "scopes": [
  2228. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  2229. // ]
  2230. // }
  2231. }
  2232. // method id "doubleclickbidmanager.reports.listreports":
  2233. type ReportsListreportsCall struct {
  2234. s *Service
  2235. queryId int64
  2236. urlParams_ gensupport.URLParams
  2237. ifNoneMatch_ string
  2238. ctx_ context.Context
  2239. header_ http.Header
  2240. }
  2241. // Listreports: Retrieves stored reports.
  2242. func (r *ReportsService) Listreports(queryId int64) *ReportsListreportsCall {
  2243. c := &ReportsListreportsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2244. c.queryId = queryId
  2245. return c
  2246. }
  2247. // Fields allows partial responses to be retrieved. See
  2248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2249. // for more information.
  2250. func (c *ReportsListreportsCall) Fields(s ...googleapi.Field) *ReportsListreportsCall {
  2251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2252. return c
  2253. }
  2254. // IfNoneMatch sets the optional parameter which makes the operation
  2255. // fail if the object's ETag matches the given value. This is useful for
  2256. // getting updates only after the object has changed since the last
  2257. // request. Use googleapi.IsNotModified to check whether the response
  2258. // error from Do is the result of In-None-Match.
  2259. func (c *ReportsListreportsCall) IfNoneMatch(entityTag string) *ReportsListreportsCall {
  2260. c.ifNoneMatch_ = entityTag
  2261. return c
  2262. }
  2263. // Context sets the context to be used in this call's Do method. Any
  2264. // pending HTTP request will be aborted if the provided context is
  2265. // canceled.
  2266. func (c *ReportsListreportsCall) Context(ctx context.Context) *ReportsListreportsCall {
  2267. c.ctx_ = ctx
  2268. return c
  2269. }
  2270. // Header returns an http.Header that can be modified by the caller to
  2271. // add HTTP headers to the request.
  2272. func (c *ReportsListreportsCall) Header() http.Header {
  2273. if c.header_ == nil {
  2274. c.header_ = make(http.Header)
  2275. }
  2276. return c.header_
  2277. }
  2278. func (c *ReportsListreportsCall) doRequest(alt string) (*http.Response, error) {
  2279. reqHeaders := make(http.Header)
  2280. for k, v := range c.header_ {
  2281. reqHeaders[k] = v
  2282. }
  2283. reqHeaders.Set("User-Agent", c.s.userAgent())
  2284. if c.ifNoneMatch_ != "" {
  2285. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2286. }
  2287. var body io.Reader = nil
  2288. c.urlParams_.Set("alt", alt)
  2289. urls := googleapi.ResolveRelative(c.s.BasePath, "queries/{queryId}/reports")
  2290. urls += "?" + c.urlParams_.Encode()
  2291. req, _ := http.NewRequest("GET", urls, body)
  2292. req.Header = reqHeaders
  2293. googleapi.Expand(req.URL, map[string]string{
  2294. "queryId": strconv.FormatInt(c.queryId, 10),
  2295. })
  2296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2297. }
  2298. // Do executes the "doubleclickbidmanager.reports.listreports" call.
  2299. // Exactly one of *ListReportsResponse or error will be non-nil. Any
  2300. // non-2xx status code is an error. Response headers are in either
  2301. // *ListReportsResponse.ServerResponse.Header or (if a response was
  2302. // returned at all) in error.(*googleapi.Error).Header. Use
  2303. // googleapi.IsNotModified to check whether the returned error was
  2304. // because http.StatusNotModified was returned.
  2305. func (c *ReportsListreportsCall) Do(opts ...googleapi.CallOption) (*ListReportsResponse, error) {
  2306. gensupport.SetOptions(c.urlParams_, opts...)
  2307. res, err := c.doRequest("json")
  2308. if res != nil && res.StatusCode == http.StatusNotModified {
  2309. if res.Body != nil {
  2310. res.Body.Close()
  2311. }
  2312. return nil, &googleapi.Error{
  2313. Code: res.StatusCode,
  2314. Header: res.Header,
  2315. }
  2316. }
  2317. if err != nil {
  2318. return nil, err
  2319. }
  2320. defer googleapi.CloseBody(res)
  2321. if err := googleapi.CheckResponse(res); err != nil {
  2322. return nil, err
  2323. }
  2324. ret := &ListReportsResponse{
  2325. ServerResponse: googleapi.ServerResponse{
  2326. Header: res.Header,
  2327. HTTPStatusCode: res.StatusCode,
  2328. },
  2329. }
  2330. target := &ret
  2331. if err := gensupport.DecodeResponse(target, res); err != nil {
  2332. return nil, err
  2333. }
  2334. return ret, nil
  2335. // {
  2336. // "description": "Retrieves stored reports.",
  2337. // "httpMethod": "GET",
  2338. // "id": "doubleclickbidmanager.reports.listreports",
  2339. // "parameterOrder": [
  2340. // "queryId"
  2341. // ],
  2342. // "parameters": {
  2343. // "queryId": {
  2344. // "description": "Query ID with which the reports are associated.",
  2345. // "format": "int64",
  2346. // "location": "path",
  2347. // "required": true,
  2348. // "type": "string"
  2349. // }
  2350. // },
  2351. // "path": "queries/{queryId}/reports",
  2352. // "response": {
  2353. // "$ref": "ListReportsResponse"
  2354. // },
  2355. // "scopes": [
  2356. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  2357. // ]
  2358. // }
  2359. }
  2360. // method id "doubleclickbidmanager.sdf.download":
  2361. type SdfDownloadCall struct {
  2362. s *Service
  2363. downloadrequest *DownloadRequest
  2364. urlParams_ gensupport.URLParams
  2365. ctx_ context.Context
  2366. header_ http.Header
  2367. }
  2368. // Download: Retrieves entities in SDF format.
  2369. func (r *SdfService) Download(downloadrequest *DownloadRequest) *SdfDownloadCall {
  2370. c := &SdfDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2371. c.downloadrequest = downloadrequest
  2372. return c
  2373. }
  2374. // Fields allows partial responses to be retrieved. See
  2375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2376. // for more information.
  2377. func (c *SdfDownloadCall) Fields(s ...googleapi.Field) *SdfDownloadCall {
  2378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2379. return c
  2380. }
  2381. // Context sets the context to be used in this call's Do method. Any
  2382. // pending HTTP request will be aborted if the provided context is
  2383. // canceled.
  2384. func (c *SdfDownloadCall) Context(ctx context.Context) *SdfDownloadCall {
  2385. c.ctx_ = ctx
  2386. return c
  2387. }
  2388. // Header returns an http.Header that can be modified by the caller to
  2389. // add HTTP headers to the request.
  2390. func (c *SdfDownloadCall) Header() http.Header {
  2391. if c.header_ == nil {
  2392. c.header_ = make(http.Header)
  2393. }
  2394. return c.header_
  2395. }
  2396. func (c *SdfDownloadCall) doRequest(alt string) (*http.Response, error) {
  2397. reqHeaders := make(http.Header)
  2398. for k, v := range c.header_ {
  2399. reqHeaders[k] = v
  2400. }
  2401. reqHeaders.Set("User-Agent", c.s.userAgent())
  2402. var body io.Reader = nil
  2403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.downloadrequest)
  2404. if err != nil {
  2405. return nil, err
  2406. }
  2407. reqHeaders.Set("Content-Type", "application/json")
  2408. c.urlParams_.Set("alt", alt)
  2409. urls := googleapi.ResolveRelative(c.s.BasePath, "sdf/download")
  2410. urls += "?" + c.urlParams_.Encode()
  2411. req, _ := http.NewRequest("POST", urls, body)
  2412. req.Header = reqHeaders
  2413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2414. }
  2415. // Do executes the "doubleclickbidmanager.sdf.download" call.
  2416. // Exactly one of *DownloadResponse or error will be non-nil. Any
  2417. // non-2xx status code is an error. Response headers are in either
  2418. // *DownloadResponse.ServerResponse.Header or (if a response was
  2419. // returned at all) in error.(*googleapi.Error).Header. Use
  2420. // googleapi.IsNotModified to check whether the returned error was
  2421. // because http.StatusNotModified was returned.
  2422. func (c *SdfDownloadCall) Do(opts ...googleapi.CallOption) (*DownloadResponse, error) {
  2423. gensupport.SetOptions(c.urlParams_, opts...)
  2424. res, err := c.doRequest("json")
  2425. if res != nil && res.StatusCode == http.StatusNotModified {
  2426. if res.Body != nil {
  2427. res.Body.Close()
  2428. }
  2429. return nil, &googleapi.Error{
  2430. Code: res.StatusCode,
  2431. Header: res.Header,
  2432. }
  2433. }
  2434. if err != nil {
  2435. return nil, err
  2436. }
  2437. defer googleapi.CloseBody(res)
  2438. if err := googleapi.CheckResponse(res); err != nil {
  2439. return nil, err
  2440. }
  2441. ret := &DownloadResponse{
  2442. ServerResponse: googleapi.ServerResponse{
  2443. Header: res.Header,
  2444. HTTPStatusCode: res.StatusCode,
  2445. },
  2446. }
  2447. target := &ret
  2448. if err := gensupport.DecodeResponse(target, res); err != nil {
  2449. return nil, err
  2450. }
  2451. return ret, nil
  2452. // {
  2453. // "description": "Retrieves entities in SDF format.",
  2454. // "httpMethod": "POST",
  2455. // "id": "doubleclickbidmanager.sdf.download",
  2456. // "path": "sdf/download",
  2457. // "request": {
  2458. // "$ref": "DownloadRequest"
  2459. // },
  2460. // "response": {
  2461. // "$ref": "DownloadResponse"
  2462. // },
  2463. // "scopes": [
  2464. // "https://www.googleapis.com/auth/doubleclickbidmanager"
  2465. // ]
  2466. // }
  2467. }