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

3478 lines
118 KiB

  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // AUTO-GENERATED CODE. DO NOT EDIT.
  5. // Package adexchangeseller provides access to the Ad Exchange Seller API.
  6. //
  7. // See https://developers.google.com/ad-exchange/seller-rest/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/adexchangeseller/v2.0"
  12. // ...
  13. // adexchangesellerService, err := adexchangeseller.New(oauthHttpClient)
  14. package adexchangeseller // import "google.golang.org/api/adexchangeseller/v2.0"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "adexchangeseller:v2.0"
  43. const apiName = "adexchangeseller"
  44. const apiVersion = "v2.0"
  45. const basePath = "https://www.googleapis.com/adexchangeseller/v2.0/"
  46. // OAuth2 scopes used by this API.
  47. const (
  48. // View and manage your Ad Exchange data
  49. AdexchangeSellerScope = "https://www.googleapis.com/auth/adexchange.seller"
  50. // View your Ad Exchange data
  51. AdexchangeSellerReadonlyScope = "https://www.googleapis.com/auth/adexchange.seller.readonly"
  52. )
  53. func New(client *http.Client) (*Service, error) {
  54. if client == nil {
  55. return nil, errors.New("client is nil")
  56. }
  57. s := &Service{client: client, BasePath: basePath}
  58. s.Accounts = NewAccountsService(s)
  59. return s, nil
  60. }
  61. type Service struct {
  62. client *http.Client
  63. BasePath string // API endpoint base URL
  64. UserAgent string // optional additional User-Agent fragment
  65. Accounts *AccountsService
  66. }
  67. func (s *Service) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewAccountsService(s *Service) *AccountsService {
  74. rs := &AccountsService{s: s}
  75. rs.Adclients = NewAccountsAdclientsService(s)
  76. rs.Alerts = NewAccountsAlertsService(s)
  77. rs.Customchannels = NewAccountsCustomchannelsService(s)
  78. rs.Metadata = NewAccountsMetadataService(s)
  79. rs.Preferreddeals = NewAccountsPreferreddealsService(s)
  80. rs.Reports = NewAccountsReportsService(s)
  81. rs.Urlchannels = NewAccountsUrlchannelsService(s)
  82. return rs
  83. }
  84. type AccountsService struct {
  85. s *Service
  86. Adclients *AccountsAdclientsService
  87. Alerts *AccountsAlertsService
  88. Customchannels *AccountsCustomchannelsService
  89. Metadata *AccountsMetadataService
  90. Preferreddeals *AccountsPreferreddealsService
  91. Reports *AccountsReportsService
  92. Urlchannels *AccountsUrlchannelsService
  93. }
  94. func NewAccountsAdclientsService(s *Service) *AccountsAdclientsService {
  95. rs := &AccountsAdclientsService{s: s}
  96. return rs
  97. }
  98. type AccountsAdclientsService struct {
  99. s *Service
  100. }
  101. func NewAccountsAlertsService(s *Service) *AccountsAlertsService {
  102. rs := &AccountsAlertsService{s: s}
  103. return rs
  104. }
  105. type AccountsAlertsService struct {
  106. s *Service
  107. }
  108. func NewAccountsCustomchannelsService(s *Service) *AccountsCustomchannelsService {
  109. rs := &AccountsCustomchannelsService{s: s}
  110. return rs
  111. }
  112. type AccountsCustomchannelsService struct {
  113. s *Service
  114. }
  115. func NewAccountsMetadataService(s *Service) *AccountsMetadataService {
  116. rs := &AccountsMetadataService{s: s}
  117. rs.Dimensions = NewAccountsMetadataDimensionsService(s)
  118. rs.Metrics = NewAccountsMetadataMetricsService(s)
  119. return rs
  120. }
  121. type AccountsMetadataService struct {
  122. s *Service
  123. Dimensions *AccountsMetadataDimensionsService
  124. Metrics *AccountsMetadataMetricsService
  125. }
  126. func NewAccountsMetadataDimensionsService(s *Service) *AccountsMetadataDimensionsService {
  127. rs := &AccountsMetadataDimensionsService{s: s}
  128. return rs
  129. }
  130. type AccountsMetadataDimensionsService struct {
  131. s *Service
  132. }
  133. func NewAccountsMetadataMetricsService(s *Service) *AccountsMetadataMetricsService {
  134. rs := &AccountsMetadataMetricsService{s: s}
  135. return rs
  136. }
  137. type AccountsMetadataMetricsService struct {
  138. s *Service
  139. }
  140. func NewAccountsPreferreddealsService(s *Service) *AccountsPreferreddealsService {
  141. rs := &AccountsPreferreddealsService{s: s}
  142. return rs
  143. }
  144. type AccountsPreferreddealsService struct {
  145. s *Service
  146. }
  147. func NewAccountsReportsService(s *Service) *AccountsReportsService {
  148. rs := &AccountsReportsService{s: s}
  149. rs.Saved = NewAccountsReportsSavedService(s)
  150. return rs
  151. }
  152. type AccountsReportsService struct {
  153. s *Service
  154. Saved *AccountsReportsSavedService
  155. }
  156. func NewAccountsReportsSavedService(s *Service) *AccountsReportsSavedService {
  157. rs := &AccountsReportsSavedService{s: s}
  158. return rs
  159. }
  160. type AccountsReportsSavedService struct {
  161. s *Service
  162. }
  163. func NewAccountsUrlchannelsService(s *Service) *AccountsUrlchannelsService {
  164. rs := &AccountsUrlchannelsService{s: s}
  165. return rs
  166. }
  167. type AccountsUrlchannelsService struct {
  168. s *Service
  169. }
  170. type Account struct {
  171. // Id: Unique identifier of this account.
  172. Id string `json:"id,omitempty"`
  173. // Kind: Kind of resource this is, in this case
  174. // adexchangeseller#account.
  175. Kind string `json:"kind,omitempty"`
  176. // Name: Name of this account.
  177. Name string `json:"name,omitempty"`
  178. // ServerResponse contains the HTTP response code and headers from the
  179. // server.
  180. googleapi.ServerResponse `json:"-"`
  181. // ForceSendFields is a list of field names (e.g. "Id") to
  182. // unconditionally include in API requests. By default, fields with
  183. // empty values are omitted from API requests. However, any non-pointer,
  184. // non-interface field appearing in ForceSendFields will be sent to the
  185. // server regardless of whether the field is empty or not. This may be
  186. // used to include empty fields in Patch requests.
  187. ForceSendFields []string `json:"-"`
  188. // NullFields is a list of field names (e.g. "Id") to include in API
  189. // requests with the JSON null value. By default, fields with empty
  190. // values are omitted from API requests. However, any field with an
  191. // empty value appearing in NullFields will be sent to the server as
  192. // null. It is an error if a field in this list has a non-empty value.
  193. // This may be used to include null fields in Patch requests.
  194. NullFields []string `json:"-"`
  195. }
  196. func (s *Account) MarshalJSON() ([]byte, error) {
  197. type NoMethod Account
  198. raw := NoMethod(*s)
  199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  200. }
  201. type Accounts struct {
  202. // Etag: ETag of this response for caching purposes.
  203. Etag string `json:"etag,omitempty"`
  204. // Items: The accounts returned in this list response.
  205. Items []*Account `json:"items,omitempty"`
  206. // Kind: Kind of list this is, in this case adexchangeseller#accounts.
  207. Kind string `json:"kind,omitempty"`
  208. // NextPageToken: Continuation token used to page through accounts. To
  209. // retrieve the next page of results, set the next request's "pageToken"
  210. // value to this.
  211. NextPageToken string `json:"nextPageToken,omitempty"`
  212. // ServerResponse contains the HTTP response code and headers from the
  213. // server.
  214. googleapi.ServerResponse `json:"-"`
  215. // ForceSendFields is a list of field names (e.g. "Etag") to
  216. // unconditionally include in API requests. By default, fields with
  217. // empty values are omitted from API requests. However, any non-pointer,
  218. // non-interface field appearing in ForceSendFields will be sent to the
  219. // server regardless of whether the field is empty or not. This may be
  220. // used to include empty fields in Patch requests.
  221. ForceSendFields []string `json:"-"`
  222. // NullFields is a list of field names (e.g. "Etag") to include in API
  223. // requests with the JSON null value. By default, fields with empty
  224. // values are omitted from API requests. However, any field with an
  225. // empty value appearing in NullFields will be sent to the server as
  226. // null. It is an error if a field in this list has a non-empty value.
  227. // This may be used to include null fields in Patch requests.
  228. NullFields []string `json:"-"`
  229. }
  230. func (s *Accounts) MarshalJSON() ([]byte, error) {
  231. type NoMethod Accounts
  232. raw := NoMethod(*s)
  233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  234. }
  235. type AdClient struct {
  236. // ArcOptIn: Whether this ad client is opted in to ARC.
  237. ArcOptIn bool `json:"arcOptIn,omitempty"`
  238. // Id: Unique identifier of this ad client.
  239. Id string `json:"id,omitempty"`
  240. // Kind: Kind of resource this is, in this case
  241. // adexchangeseller#adClient.
  242. Kind string `json:"kind,omitempty"`
  243. // ProductCode: This ad client's product code, which corresponds to the
  244. // PRODUCT_CODE report dimension.
  245. ProductCode string `json:"productCode,omitempty"`
  246. // SupportsReporting: Whether this ad client supports being reported on.
  247. SupportsReporting bool `json:"supportsReporting,omitempty"`
  248. // ForceSendFields is a list of field names (e.g. "ArcOptIn") to
  249. // unconditionally include in API requests. By default, fields with
  250. // empty values are omitted from API requests. However, any non-pointer,
  251. // non-interface field appearing in ForceSendFields will be sent to the
  252. // server regardless of whether the field is empty or not. This may be
  253. // used to include empty fields in Patch requests.
  254. ForceSendFields []string `json:"-"`
  255. // NullFields is a list of field names (e.g. "ArcOptIn") to include in
  256. // API requests with the JSON null value. By default, fields with empty
  257. // values are omitted from API requests. However, any field with an
  258. // empty value appearing in NullFields will be sent to the server as
  259. // null. It is an error if a field in this list has a non-empty value.
  260. // This may be used to include null fields in Patch requests.
  261. NullFields []string `json:"-"`
  262. }
  263. func (s *AdClient) MarshalJSON() ([]byte, error) {
  264. type NoMethod AdClient
  265. raw := NoMethod(*s)
  266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  267. }
  268. type AdClients struct {
  269. // Etag: ETag of this response for caching purposes.
  270. Etag string `json:"etag,omitempty"`
  271. // Items: The ad clients returned in this list response.
  272. Items []*AdClient `json:"items,omitempty"`
  273. // Kind: Kind of list this is, in this case adexchangeseller#adClients.
  274. Kind string `json:"kind,omitempty"`
  275. // NextPageToken: Continuation token used to page through ad clients. To
  276. // retrieve the next page of results, set the next request's "pageToken"
  277. // value to this.
  278. NextPageToken string `json:"nextPageToken,omitempty"`
  279. // ServerResponse contains the HTTP response code and headers from the
  280. // server.
  281. googleapi.ServerResponse `json:"-"`
  282. // ForceSendFields is a list of field names (e.g. "Etag") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "Etag") to include in API
  290. // requests with the JSON null value. By default, fields with empty
  291. // values are omitted from API requests. However, any field with an
  292. // empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *AdClients) MarshalJSON() ([]byte, error) {
  298. type NoMethod AdClients
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. type Alert struct {
  303. // Id: Unique identifier of this alert. This should be considered an
  304. // opaque identifier; it is not safe to rely on it being in any
  305. // particular format.
  306. Id string `json:"id,omitempty"`
  307. // Kind: Kind of resource this is, in this case adexchangeseller#alert.
  308. Kind string `json:"kind,omitempty"`
  309. // Message: The localized alert message.
  310. Message string `json:"message,omitempty"`
  311. // Severity: Severity of this alert. Possible values: INFO, WARNING,
  312. // SEVERE.
  313. Severity string `json:"severity,omitempty"`
  314. // Type: Type of this alert. Possible values: SELF_HOLD,
  315. // MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION,
  316. // PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, GRAYLISTED_PUBLISHER,
  317. // API_HOLD.
  318. Type string `json:"type,omitempty"`
  319. // ForceSendFields is a list of field names (e.g. "Id") to
  320. // unconditionally include in API requests. By default, fields with
  321. // empty values are omitted from API requests. However, any non-pointer,
  322. // non-interface field appearing in ForceSendFields will be sent to the
  323. // server regardless of whether the field is empty or not. This may be
  324. // used to include empty fields in Patch requests.
  325. ForceSendFields []string `json:"-"`
  326. // NullFields is a list of field names (e.g. "Id") to include in API
  327. // requests with the JSON null value. By default, fields with empty
  328. // values are omitted from API requests. However, any field with an
  329. // empty value appearing in NullFields will be sent to the server as
  330. // null. It is an error if a field in this list has a non-empty value.
  331. // This may be used to include null fields in Patch requests.
  332. NullFields []string `json:"-"`
  333. }
  334. func (s *Alert) MarshalJSON() ([]byte, error) {
  335. type NoMethod Alert
  336. raw := NoMethod(*s)
  337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  338. }
  339. type Alerts struct {
  340. // Items: The alerts returned in this list response.
  341. Items []*Alert `json:"items,omitempty"`
  342. // Kind: Kind of list this is, in this case adexchangeseller#alerts.
  343. Kind string `json:"kind,omitempty"`
  344. // ServerResponse contains the HTTP response code and headers from the
  345. // server.
  346. googleapi.ServerResponse `json:"-"`
  347. // ForceSendFields is a list of field names (e.g. "Items") to
  348. // unconditionally include in API requests. By default, fields with
  349. // empty values are omitted from API requests. However, any non-pointer,
  350. // non-interface field appearing in ForceSendFields will be sent to the
  351. // server regardless of whether the field is empty or not. This may be
  352. // used to include empty fields in Patch requests.
  353. ForceSendFields []string `json:"-"`
  354. // NullFields is a list of field names (e.g. "Items") to include in API
  355. // requests with the JSON null value. By default, fields with empty
  356. // values are omitted from API requests. However, any field with an
  357. // empty value appearing in NullFields will be sent to the server as
  358. // null. It is an error if a field in this list has a non-empty value.
  359. // This may be used to include null fields in Patch requests.
  360. NullFields []string `json:"-"`
  361. }
  362. func (s *Alerts) MarshalJSON() ([]byte, error) {
  363. type NoMethod Alerts
  364. raw := NoMethod(*s)
  365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  366. }
  367. type CustomChannel struct {
  368. // Code: Code of this custom channel, not necessarily unique across ad
  369. // clients.
  370. Code string `json:"code,omitempty"`
  371. // Id: Unique identifier of this custom channel. This should be
  372. // considered an opaque identifier; it is not safe to rely on it being
  373. // in any particular format.
  374. Id string `json:"id,omitempty"`
  375. // Kind: Kind of resource this is, in this case
  376. // adexchangeseller#customChannel.
  377. Kind string `json:"kind,omitempty"`
  378. // Name: Name of this custom channel.
  379. Name string `json:"name,omitempty"`
  380. // TargetingInfo: The targeting information of this custom channel, if
  381. // activated.
  382. TargetingInfo *CustomChannelTargetingInfo `json:"targetingInfo,omitempty"`
  383. // ServerResponse contains the HTTP response code and headers from the
  384. // server.
  385. googleapi.ServerResponse `json:"-"`
  386. // ForceSendFields is a list of field names (e.g. "Code") to
  387. // unconditionally include in API requests. By default, fields with
  388. // empty values are omitted from API requests. However, any non-pointer,
  389. // non-interface field appearing in ForceSendFields will be sent to the
  390. // server regardless of whether the field is empty or not. This may be
  391. // used to include empty fields in Patch requests.
  392. ForceSendFields []string `json:"-"`
  393. // NullFields is a list of field names (e.g. "Code") to include in API
  394. // requests with the JSON null value. By default, fields with empty
  395. // values are omitted from API requests. However, any field with an
  396. // empty value appearing in NullFields will be sent to the server as
  397. // null. It is an error if a field in this list has a non-empty value.
  398. // This may be used to include null fields in Patch requests.
  399. NullFields []string `json:"-"`
  400. }
  401. func (s *CustomChannel) MarshalJSON() ([]byte, error) {
  402. type NoMethod CustomChannel
  403. raw := NoMethod(*s)
  404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  405. }
  406. // CustomChannelTargetingInfo: The targeting information of this custom
  407. // channel, if activated.
  408. type CustomChannelTargetingInfo struct {
  409. // AdsAppearOn: The name used to describe this channel externally.
  410. AdsAppearOn string `json:"adsAppearOn,omitempty"`
  411. // Description: The external description of the channel.
  412. Description string `json:"description,omitempty"`
  413. // Location: The locations in which ads appear. (Only valid for content
  414. // and mobile content ads). Acceptable values for content ads are:
  415. // TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER,
  416. // MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT,
  417. // MULTIPLE_LOCATIONS. Acceptable values for mobile content ads are:
  418. // TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
  419. Location string `json:"location,omitempty"`
  420. // SiteLanguage: The language of the sites ads will be displayed on.
  421. SiteLanguage string `json:"siteLanguage,omitempty"`
  422. // ForceSendFields is a list of field names (e.g. "AdsAppearOn") to
  423. // unconditionally include in API requests. By default, fields with
  424. // empty values are omitted from API requests. However, any non-pointer,
  425. // non-interface field appearing in ForceSendFields will be sent to the
  426. // server regardless of whether the field is empty or not. This may be
  427. // used to include empty fields in Patch requests.
  428. ForceSendFields []string `json:"-"`
  429. // NullFields is a list of field names (e.g. "AdsAppearOn") to include
  430. // in API requests with the JSON null value. By default, fields with
  431. // empty values are omitted from API requests. However, any field with
  432. // an empty value appearing in NullFields will be sent to the server as
  433. // null. It is an error if a field in this list has a non-empty value.
  434. // This may be used to include null fields in Patch requests.
  435. NullFields []string `json:"-"`
  436. }
  437. func (s *CustomChannelTargetingInfo) MarshalJSON() ([]byte, error) {
  438. type NoMethod CustomChannelTargetingInfo
  439. raw := NoMethod(*s)
  440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  441. }
  442. type CustomChannels struct {
  443. // Etag: ETag of this response for caching purposes.
  444. Etag string `json:"etag,omitempty"`
  445. // Items: The custom channels returned in this list response.
  446. Items []*CustomChannel `json:"items,omitempty"`
  447. // Kind: Kind of list this is, in this case
  448. // adexchangeseller#customChannels.
  449. Kind string `json:"kind,omitempty"`
  450. // NextPageToken: Continuation token used to page through custom
  451. // channels. To retrieve the next page of results, set the next
  452. // request's "pageToken" value to this.
  453. NextPageToken string `json:"nextPageToken,omitempty"`
  454. // ServerResponse contains the HTTP response code and headers from the
  455. // server.
  456. googleapi.ServerResponse `json:"-"`
  457. // ForceSendFields is a list of field names (e.g. "Etag") to
  458. // unconditionally include in API requests. By default, fields with
  459. // empty values are omitted from API requests. However, any non-pointer,
  460. // non-interface field appearing in ForceSendFields will be sent to the
  461. // server regardless of whether the field is empty or not. This may be
  462. // used to include empty fields in Patch requests.
  463. ForceSendFields []string `json:"-"`
  464. // NullFields is a list of field names (e.g. "Etag") to include in API
  465. // requests with the JSON null value. By default, fields with empty
  466. // values are omitted from API requests. However, any field with an
  467. // empty value appearing in NullFields will be sent to the server as
  468. // null. It is an error if a field in this list has a non-empty value.
  469. // This may be used to include null fields in Patch requests.
  470. NullFields []string `json:"-"`
  471. }
  472. func (s *CustomChannels) MarshalJSON() ([]byte, error) {
  473. type NoMethod CustomChannels
  474. raw := NoMethod(*s)
  475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  476. }
  477. type Metadata struct {
  478. Items []*ReportingMetadataEntry `json:"items,omitempty"`
  479. // Kind: Kind of list this is, in this case adexchangeseller#metadata.
  480. Kind string `json:"kind,omitempty"`
  481. // ServerResponse contains the HTTP response code and headers from the
  482. // server.
  483. googleapi.ServerResponse `json:"-"`
  484. // ForceSendFields is a list of field names (e.g. "Items") to
  485. // unconditionally include in API requests. By default, fields with
  486. // empty values are omitted from API requests. However, any non-pointer,
  487. // non-interface field appearing in ForceSendFields will be sent to the
  488. // server regardless of whether the field is empty or not. This may be
  489. // used to include empty fields in Patch requests.
  490. ForceSendFields []string `json:"-"`
  491. // NullFields is a list of field names (e.g. "Items") to include in API
  492. // requests with the JSON null value. By default, fields with empty
  493. // values are omitted from API requests. However, any field with an
  494. // empty value appearing in NullFields will be sent to the server as
  495. // null. It is an error if a field in this list has a non-empty value.
  496. // This may be used to include null fields in Patch requests.
  497. NullFields []string `json:"-"`
  498. }
  499. func (s *Metadata) MarshalJSON() ([]byte, error) {
  500. type NoMethod Metadata
  501. raw := NoMethod(*s)
  502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  503. }
  504. type PreferredDeal struct {
  505. // AdvertiserName: The name of the advertiser this deal is for.
  506. AdvertiserName string `json:"advertiserName,omitempty"`
  507. // BuyerNetworkName: The name of the buyer network this deal is for.
  508. BuyerNetworkName string `json:"buyerNetworkName,omitempty"`
  509. // CurrencyCode: The currency code that applies to the fixed_cpm value.
  510. // If not set then assumed to be USD.
  511. CurrencyCode string `json:"currencyCode,omitempty"`
  512. // EndTime: Time when this deal stops being active in seconds since the
  513. // epoch (GMT). If not set then this deal is valid until manually
  514. // disabled by the publisher.
  515. EndTime uint64 `json:"endTime,omitempty,string"`
  516. // FixedCpm: The fixed price for this preferred deal. In cpm micros of
  517. // currency according to currencyCode. If set, then this preferred deal
  518. // is eligible for the fixed price tier of buying (highest priority, pay
  519. // exactly the configured fixed price).
  520. FixedCpm int64 `json:"fixedCpm,omitempty,string"`
  521. // Id: Unique identifier of this preferred deal.
  522. Id int64 `json:"id,omitempty,string"`
  523. // Kind: Kind of resource this is, in this case
  524. // adexchangeseller#preferredDeal.
  525. Kind string `json:"kind,omitempty"`
  526. // StartTime: Time when this deal becomes active in seconds since the
  527. // epoch (GMT). If not set then this deal is active immediately upon
  528. // creation.
  529. StartTime uint64 `json:"startTime,omitempty,string"`
  530. // ServerResponse contains the HTTP response code and headers from the
  531. // server.
  532. googleapi.ServerResponse `json:"-"`
  533. // ForceSendFields is a list of field names (e.g. "AdvertiserName") to
  534. // unconditionally include in API requests. By default, fields with
  535. // empty values are omitted from API requests. However, any non-pointer,
  536. // non-interface field appearing in ForceSendFields will be sent to the
  537. // server regardless of whether the field is empty or not. This may be
  538. // used to include empty fields in Patch requests.
  539. ForceSendFields []string `json:"-"`
  540. // NullFields is a list of field names (e.g. "AdvertiserName") to
  541. // include in API requests with the JSON null value. By default, fields
  542. // with empty values are omitted from API requests. However, any field
  543. // with an empty value appearing in NullFields will be sent to the
  544. // server as null. It is an error if a field in this list has a
  545. // non-empty value. This may be used to include null fields in Patch
  546. // requests.
  547. NullFields []string `json:"-"`
  548. }
  549. func (s *PreferredDeal) MarshalJSON() ([]byte, error) {
  550. type NoMethod PreferredDeal
  551. raw := NoMethod(*s)
  552. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  553. }
  554. type PreferredDeals struct {
  555. // Items: The preferred deals returned in this list response.
  556. Items []*PreferredDeal `json:"items,omitempty"`
  557. // Kind: Kind of list this is, in this case
  558. // adexchangeseller#preferredDeals.
  559. Kind string `json:"kind,omitempty"`
  560. // ServerResponse contains the HTTP response code and headers from the
  561. // server.
  562. googleapi.ServerResponse `json:"-"`
  563. // ForceSendFields is a list of field names (e.g. "Items") to
  564. // unconditionally include in API requests. By default, fields with
  565. // empty values are omitted from API requests. However, any non-pointer,
  566. // non-interface field appearing in ForceSendFields will be sent to the
  567. // server regardless of whether the field is empty or not. This may be
  568. // used to include empty fields in Patch requests.
  569. ForceSendFields []string `json:"-"`
  570. // NullFields is a list of field names (e.g. "Items") to include in API
  571. // requests with the JSON null value. By default, fields with empty
  572. // values are omitted from API requests. However, any field with an
  573. // empty value appearing in NullFields will be sent to the server as
  574. // null. It is an error if a field in this list has a non-empty value.
  575. // This may be used to include null fields in Patch requests.
  576. NullFields []string `json:"-"`
  577. }
  578. func (s *PreferredDeals) MarshalJSON() ([]byte, error) {
  579. type NoMethod PreferredDeals
  580. raw := NoMethod(*s)
  581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  582. }
  583. type Report struct {
  584. // Averages: The averages of the report. This is the same length as any
  585. // other row in the report; cells corresponding to dimension columns are
  586. // empty.
  587. Averages []string `json:"averages,omitempty"`
  588. // Headers: The header information of the columns requested in the
  589. // report. This is a list of headers; one for each dimension in the
  590. // request, followed by one for each metric in the request.
  591. Headers []*ReportHeaders `json:"headers,omitempty"`
  592. // Kind: Kind this is, in this case adexchangeseller#report.
  593. Kind string `json:"kind,omitempty"`
  594. // Rows: The output rows of the report. Each row is a list of cells; one
  595. // for each dimension in the request, followed by one for each metric in
  596. // the request. The dimension cells contain strings, and the metric
  597. // cells contain numbers.
  598. Rows [][]string `json:"rows,omitempty"`
  599. // TotalMatchedRows: The total number of rows matched by the report
  600. // request. Fewer rows may be returned in the response due to being
  601. // limited by the row count requested or the report row limit.
  602. TotalMatchedRows int64 `json:"totalMatchedRows,omitempty,string"`
  603. // Totals: The totals of the report. This is the same length as any
  604. // other row in the report; cells corresponding to dimension columns are
  605. // empty.
  606. Totals []string `json:"totals,omitempty"`
  607. // Warnings: Any warnings associated with generation of the report.
  608. Warnings []string `json:"warnings,omitempty"`
  609. // ServerResponse contains the HTTP response code and headers from the
  610. // server.
  611. googleapi.ServerResponse `json:"-"`
  612. // ForceSendFields is a list of field names (e.g. "Averages") to
  613. // unconditionally include in API requests. By default, fields with
  614. // empty values are omitted from API requests. However, any non-pointer,
  615. // non-interface field appearing in ForceSendFields will be sent to the
  616. // server regardless of whether the field is empty or not. This may be
  617. // used to include empty fields in Patch requests.
  618. ForceSendFields []string `json:"-"`
  619. // NullFields is a list of field names (e.g. "Averages") to include in
  620. // API requests with the JSON null value. By default, fields with empty
  621. // values are omitted from API requests. However, any field with an
  622. // empty value appearing in NullFields will be sent to the server as
  623. // null. It is an error if a field in this list has a non-empty value.
  624. // This may be used to include null fields in Patch requests.
  625. NullFields []string `json:"-"`
  626. }
  627. func (s *Report) MarshalJSON() ([]byte, error) {
  628. type NoMethod Report
  629. raw := NoMethod(*s)
  630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  631. }
  632. type ReportHeaders struct {
  633. // Currency: The currency of this column. Only present if the header
  634. // type is METRIC_CURRENCY.
  635. Currency string `json:"currency,omitempty"`
  636. // Name: The name of the header.
  637. Name string `json:"name,omitempty"`
  638. // Type: The type of the header; one of DIMENSION, METRIC_TALLY,
  639. // METRIC_RATIO, or METRIC_CURRENCY.
  640. Type string `json:"type,omitempty"`
  641. // ForceSendFields is a list of field names (e.g. "Currency") to
  642. // unconditionally include in API requests. By default, fields with
  643. // empty values are omitted from API requests. However, any non-pointer,
  644. // non-interface field appearing in ForceSendFields will be sent to the
  645. // server regardless of whether the field is empty or not. This may be
  646. // used to include empty fields in Patch requests.
  647. ForceSendFields []string `json:"-"`
  648. // NullFields is a list of field names (e.g. "Currency") to include in
  649. // API requests with the JSON null value. By default, fields with empty
  650. // values are omitted from API requests. However, any field with an
  651. // empty value appearing in NullFields will be sent to the server as
  652. // null. It is an error if a field in this list has a non-empty value.
  653. // This may be used to include null fields in Patch requests.
  654. NullFields []string `json:"-"`
  655. }
  656. func (s *ReportHeaders) MarshalJSON() ([]byte, error) {
  657. type NoMethod ReportHeaders
  658. raw := NoMethod(*s)
  659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  660. }
  661. type ReportingMetadataEntry struct {
  662. // CompatibleDimensions: For metrics this is a list of dimension IDs
  663. // which the metric is compatible with, for dimensions it is a list of
  664. // compatibility groups the dimension belongs to.
  665. CompatibleDimensions []string `json:"compatibleDimensions,omitempty"`
  666. // CompatibleMetrics: The names of the metrics the dimension or metric
  667. // this reporting metadata entry describes is compatible with.
  668. CompatibleMetrics []string `json:"compatibleMetrics,omitempty"`
  669. // Id: Unique identifier of this reporting metadata entry, corresponding
  670. // to the name of the appropriate dimension or metric.
  671. Id string `json:"id,omitempty"`
  672. // Kind: Kind of resource this is, in this case
  673. // adexchangeseller#reportingMetadataEntry.
  674. Kind string `json:"kind,omitempty"`
  675. // RequiredDimensions: The names of the dimensions which the dimension
  676. // or metric this reporting metadata entry describes requires to also be
  677. // present in order for the report to be valid. Omitting these will not
  678. // cause an error or warning, but may result in data which cannot be
  679. // correctly interpreted.
  680. RequiredDimensions []string `json:"requiredDimensions,omitempty"`
  681. // RequiredMetrics: The names of the metrics which the dimension or
  682. // metric this reporting metadata entry describes requires to also be
  683. // present in order for the report to be valid. Omitting these will not
  684. // cause an error or warning, but may result in data which cannot be
  685. // correctly interpreted.
  686. RequiredMetrics []string `json:"requiredMetrics,omitempty"`
  687. // SupportedProducts: The codes of the projects supported by the
  688. // dimension or metric this reporting metadata entry describes.
  689. SupportedProducts []string `json:"supportedProducts,omitempty"`
  690. // ForceSendFields is a list of field names (e.g.
  691. // "CompatibleDimensions") to unconditionally include in API requests.
  692. // By default, fields with empty values are omitted from API requests.
  693. // However, any non-pointer, non-interface field appearing in
  694. // ForceSendFields will be sent to the server regardless of whether the
  695. // field is empty or not. This may be used to include empty fields in
  696. // Patch requests.
  697. ForceSendFields []string `json:"-"`
  698. // NullFields is a list of field names (e.g. "CompatibleDimensions") to
  699. // include in API requests with the JSON null value. By default, fields
  700. // with empty values are omitted from API requests. However, any field
  701. // with an empty value appearing in NullFields will be sent to the
  702. // server as null. It is an error if a field in this list has a
  703. // non-empty value. This may be used to include null fields in Patch
  704. // requests.
  705. NullFields []string `json:"-"`
  706. }
  707. func (s *ReportingMetadataEntry) MarshalJSON() ([]byte, error) {
  708. type NoMethod ReportingMetadataEntry
  709. raw := NoMethod(*s)
  710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  711. }
  712. type SavedReport struct {
  713. // Id: Unique identifier of this saved report.
  714. Id string `json:"id,omitempty"`
  715. // Kind: Kind of resource this is, in this case
  716. // adexchangeseller#savedReport.
  717. Kind string `json:"kind,omitempty"`
  718. // Name: This saved report's name.
  719. Name string `json:"name,omitempty"`
  720. // ForceSendFields is a list of field names (e.g. "Id") to
  721. // unconditionally include in API requests. By default, fields with
  722. // empty values are omitted from API requests. However, any non-pointer,
  723. // non-interface field appearing in ForceSendFields will be sent to the
  724. // server regardless of whether the field is empty or not. This may be
  725. // used to include empty fields in Patch requests.
  726. ForceSendFields []string `json:"-"`
  727. // NullFields is a list of field names (e.g. "Id") to include in API
  728. // requests with the JSON null value. By default, fields with empty
  729. // values are omitted from API requests. However, any field with an
  730. // empty value appearing in NullFields will be sent to the server as
  731. // null. It is an error if a field in this list has a non-empty value.
  732. // This may be used to include null fields in Patch requests.
  733. NullFields []string `json:"-"`
  734. }
  735. func (s *SavedReport) MarshalJSON() ([]byte, error) {
  736. type NoMethod SavedReport
  737. raw := NoMethod(*s)
  738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  739. }
  740. type SavedReports struct {
  741. // Etag: ETag of this response for caching purposes.
  742. Etag string `json:"etag,omitempty"`
  743. // Items: The saved reports returned in this list response.
  744. Items []*SavedReport `json:"items,omitempty"`
  745. // Kind: Kind of list this is, in this case
  746. // adexchangeseller#savedReports.
  747. Kind string `json:"kind,omitempty"`
  748. // NextPageToken: Continuation token used to page through saved reports.
  749. // To retrieve the next page of results, set the next request's
  750. // "pageToken" value to this.
  751. NextPageToken string `json:"nextPageToken,omitempty"`
  752. // ServerResponse contains the HTTP response code and headers from the
  753. // server.
  754. googleapi.ServerResponse `json:"-"`
  755. // ForceSendFields is a list of field names (e.g. "Etag") to
  756. // unconditionally include in API requests. By default, fields with
  757. // empty values are omitted from API requests. However, any non-pointer,
  758. // non-interface field appearing in ForceSendFields will be sent to the
  759. // server regardless of whether the field is empty or not. This may be
  760. // used to include empty fields in Patch requests.
  761. ForceSendFields []string `json:"-"`
  762. // NullFields is a list of field names (e.g. "Etag") to include in API
  763. // requests with the JSON null value. By default, fields with empty
  764. // values are omitted from API requests. However, any field with an
  765. // empty value appearing in NullFields will be sent to the server as
  766. // null. It is an error if a field in this list has a non-empty value.
  767. // This may be used to include null fields in Patch requests.
  768. NullFields []string `json:"-"`
  769. }
  770. func (s *SavedReports) MarshalJSON() ([]byte, error) {
  771. type NoMethod SavedReports
  772. raw := NoMethod(*s)
  773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  774. }
  775. type UrlChannel struct {
  776. // Id: Unique identifier of this URL channel. This should be considered
  777. // an opaque identifier; it is not safe to rely on it being in any
  778. // particular format.
  779. Id string `json:"id,omitempty"`
  780. // Kind: Kind of resource this is, in this case
  781. // adexchangeseller#urlChannel.
  782. Kind string `json:"kind,omitempty"`
  783. // UrlPattern: URL Pattern of this URL channel. Does not include
  784. // "http://" or "https://". Example: www.example.com/home
  785. UrlPattern string `json:"urlPattern,omitempty"`
  786. // ForceSendFields is a list of field names (e.g. "Id") to
  787. // unconditionally include in API requests. By default, fields with
  788. // empty values are omitted from API requests. However, any non-pointer,
  789. // non-interface field appearing in ForceSendFields will be sent to the
  790. // server regardless of whether the field is empty or not. This may be
  791. // used to include empty fields in Patch requests.
  792. ForceSendFields []string `json:"-"`
  793. // NullFields is a list of field names (e.g. "Id") to include in API
  794. // requests with the JSON null value. By default, fields with empty
  795. // values are omitted from API requests. However, any field with an
  796. // empty value appearing in NullFields will be sent to the server as
  797. // null. It is an error if a field in this list has a non-empty value.
  798. // This may be used to include null fields in Patch requests.
  799. NullFields []string `json:"-"`
  800. }
  801. func (s *UrlChannel) MarshalJSON() ([]byte, error) {
  802. type NoMethod UrlChannel
  803. raw := NoMethod(*s)
  804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  805. }
  806. type UrlChannels struct {
  807. // Etag: ETag of this response for caching purposes.
  808. Etag string `json:"etag,omitempty"`
  809. // Items: The URL channels returned in this list response.
  810. Items []*UrlChannel `json:"items,omitempty"`
  811. // Kind: Kind of list this is, in this case
  812. // adexchangeseller#urlChannels.
  813. Kind string `json:"kind,omitempty"`
  814. // NextPageToken: Continuation token used to page through URL channels.
  815. // To retrieve the next page of results, set the next request's
  816. // "pageToken" value to this.
  817. NextPageToken string `json:"nextPageToken,omitempty"`
  818. // ServerResponse contains the HTTP response code and headers from the
  819. // server.
  820. googleapi.ServerResponse `json:"-"`
  821. // ForceSendFields is a list of field names (e.g. "Etag") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. // NullFields is a list of field names (e.g. "Etag") to include in API
  829. // requests with the JSON null value. By default, fields with empty
  830. // values are omitted from API requests. However, any field with an
  831. // empty value appearing in NullFields will be sent to the server as
  832. // null. It is an error if a field in this list has a non-empty value.
  833. // This may be used to include null fields in Patch requests.
  834. NullFields []string `json:"-"`
  835. }
  836. func (s *UrlChannels) MarshalJSON() ([]byte, error) {
  837. type NoMethod UrlChannels
  838. raw := NoMethod(*s)
  839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  840. }
  841. // method id "adexchangeseller.accounts.get":
  842. type AccountsGetCall struct {
  843. s *Service
  844. accountId string
  845. urlParams_ gensupport.URLParams
  846. ifNoneMatch_ string
  847. ctx_ context.Context
  848. header_ http.Header
  849. }
  850. // Get: Get information about the selected Ad Exchange account.
  851. func (r *AccountsService) Get(accountId string) *AccountsGetCall {
  852. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  853. c.accountId = accountId
  854. return c
  855. }
  856. // Fields allows partial responses to be retrieved. See
  857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  858. // for more information.
  859. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  861. return c
  862. }
  863. // IfNoneMatch sets the optional parameter which makes the operation
  864. // fail if the object's ETag matches the given value. This is useful for
  865. // getting updates only after the object has changed since the last
  866. // request. Use googleapi.IsNotModified to check whether the response
  867. // error from Do is the result of In-None-Match.
  868. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  869. c.ifNoneMatch_ = entityTag
  870. return c
  871. }
  872. // Context sets the context to be used in this call's Do method. Any
  873. // pending HTTP request will be aborted if the provided context is
  874. // canceled.
  875. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  876. c.ctx_ = ctx
  877. return c
  878. }
  879. // Header returns an http.Header that can be modified by the caller to
  880. // add HTTP headers to the request.
  881. func (c *AccountsGetCall) Header() http.Header {
  882. if c.header_ == nil {
  883. c.header_ = make(http.Header)
  884. }
  885. return c.header_
  886. }
  887. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  888. reqHeaders := make(http.Header)
  889. for k, v := range c.header_ {
  890. reqHeaders[k] = v
  891. }
  892. reqHeaders.Set("User-Agent", c.s.userAgent())
  893. if c.ifNoneMatch_ != "" {
  894. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  895. }
  896. var body io.Reader = nil
  897. c.urlParams_.Set("alt", alt)
  898. c.urlParams_.Set("prettyPrint", "false")
  899. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}")
  900. urls += "?" + c.urlParams_.Encode()
  901. req, _ := http.NewRequest("GET", urls, body)
  902. req.Header = reqHeaders
  903. googleapi.Expand(req.URL, map[string]string{
  904. "accountId": c.accountId,
  905. })
  906. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  907. }
  908. // Do executes the "adexchangeseller.accounts.get" call.
  909. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  910. // code is an error. Response headers are in either
  911. // *Account.ServerResponse.Header or (if a response was returned at all)
  912. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  913. // check whether the returned error was because http.StatusNotModified
  914. // was returned.
  915. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  916. gensupport.SetOptions(c.urlParams_, opts...)
  917. res, err := c.doRequest("json")
  918. if res != nil && res.StatusCode == http.StatusNotModified {
  919. if res.Body != nil {
  920. res.Body.Close()
  921. }
  922. return nil, &googleapi.Error{
  923. Code: res.StatusCode,
  924. Header: res.Header,
  925. }
  926. }
  927. if err != nil {
  928. return nil, err
  929. }
  930. defer googleapi.CloseBody(res)
  931. if err := googleapi.CheckResponse(res); err != nil {
  932. return nil, err
  933. }
  934. ret := &Account{
  935. ServerResponse: googleapi.ServerResponse{
  936. Header: res.Header,
  937. HTTPStatusCode: res.StatusCode,
  938. },
  939. }
  940. target := &ret
  941. if err := gensupport.DecodeResponse(target, res); err != nil {
  942. return nil, err
  943. }
  944. return ret, nil
  945. // {
  946. // "description": "Get information about the selected Ad Exchange account.",
  947. // "httpMethod": "GET",
  948. // "id": "adexchangeseller.accounts.get",
  949. // "parameterOrder": [
  950. // "accountId"
  951. // ],
  952. // "parameters": {
  953. // "accountId": {
  954. // "description": "Account to get information about. Tip: 'myaccount' is a valid ID.",
  955. // "location": "path",
  956. // "required": true,
  957. // "type": "string"
  958. // }
  959. // },
  960. // "path": "accounts/{accountId}",
  961. // "response": {
  962. // "$ref": "Account"
  963. // },
  964. // "scopes": [
  965. // "https://www.googleapis.com/auth/adexchange.seller",
  966. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  967. // ]
  968. // }
  969. }
  970. // method id "adexchangeseller.accounts.list":
  971. type AccountsListCall struct {
  972. s *Service
  973. urlParams_ gensupport.URLParams
  974. ifNoneMatch_ string
  975. ctx_ context.Context
  976. header_ http.Header
  977. }
  978. // List: List all accounts available to this Ad Exchange account.
  979. func (r *AccountsService) List() *AccountsListCall {
  980. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  981. return c
  982. }
  983. // MaxResults sets the optional parameter "maxResults": The maximum
  984. // number of accounts to include in the response, used for paging.
  985. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  986. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  987. return c
  988. }
  989. // PageToken sets the optional parameter "pageToken": A continuation
  990. // token, used to page through accounts. To retrieve the next page, set
  991. // this parameter to the value of "nextPageToken" from the previous
  992. // response.
  993. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  994. c.urlParams_.Set("pageToken", pageToken)
  995. return c
  996. }
  997. // Fields allows partial responses to be retrieved. See
  998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  999. // for more information.
  1000. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  1001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1002. return c
  1003. }
  1004. // IfNoneMatch sets the optional parameter which makes the operation
  1005. // fail if the object's ETag matches the given value. This is useful for
  1006. // getting updates only after the object has changed since the last
  1007. // request. Use googleapi.IsNotModified to check whether the response
  1008. // error from Do is the result of In-None-Match.
  1009. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  1010. c.ifNoneMatch_ = entityTag
  1011. return c
  1012. }
  1013. // Context sets the context to be used in this call's Do method. Any
  1014. // pending HTTP request will be aborted if the provided context is
  1015. // canceled.
  1016. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  1017. c.ctx_ = ctx
  1018. return c
  1019. }
  1020. // Header returns an http.Header that can be modified by the caller to
  1021. // add HTTP headers to the request.
  1022. func (c *AccountsListCall) Header() http.Header {
  1023. if c.header_ == nil {
  1024. c.header_ = make(http.Header)
  1025. }
  1026. return c.header_
  1027. }
  1028. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  1029. reqHeaders := make(http.Header)
  1030. for k, v := range c.header_ {
  1031. reqHeaders[k] = v
  1032. }
  1033. reqHeaders.Set("User-Agent", c.s.userAgent())
  1034. if c.ifNoneMatch_ != "" {
  1035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1036. }
  1037. var body io.Reader = nil
  1038. c.urlParams_.Set("alt", alt)
  1039. c.urlParams_.Set("prettyPrint", "false")
  1040. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  1041. urls += "?" + c.urlParams_.Encode()
  1042. req, _ := http.NewRequest("GET", urls, body)
  1043. req.Header = reqHeaders
  1044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1045. }
  1046. // Do executes the "adexchangeseller.accounts.list" call.
  1047. // Exactly one of *Accounts or error will be non-nil. Any non-2xx status
  1048. // code is an error. Response headers are in either
  1049. // *Accounts.ServerResponse.Header or (if a response was returned at
  1050. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1051. // to check whether the returned error was because
  1052. // http.StatusNotModified was returned.
  1053. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*Accounts, error) {
  1054. gensupport.SetOptions(c.urlParams_, opts...)
  1055. res, err := c.doRequest("json")
  1056. if res != nil && res.StatusCode == http.StatusNotModified {
  1057. if res.Body != nil {
  1058. res.Body.Close()
  1059. }
  1060. return nil, &googleapi.Error{
  1061. Code: res.StatusCode,
  1062. Header: res.Header,
  1063. }
  1064. }
  1065. if err != nil {
  1066. return nil, err
  1067. }
  1068. defer googleapi.CloseBody(res)
  1069. if err := googleapi.CheckResponse(res); err != nil {
  1070. return nil, err
  1071. }
  1072. ret := &Accounts{
  1073. ServerResponse: googleapi.ServerResponse{
  1074. Header: res.Header,
  1075. HTTPStatusCode: res.StatusCode,
  1076. },
  1077. }
  1078. target := &ret
  1079. if err := gensupport.DecodeResponse(target, res); err != nil {
  1080. return nil, err
  1081. }
  1082. return ret, nil
  1083. // {
  1084. // "description": "List all accounts available to this Ad Exchange account.",
  1085. // "httpMethod": "GET",
  1086. // "id": "adexchangeseller.accounts.list",
  1087. // "parameters": {
  1088. // "maxResults": {
  1089. // "description": "The maximum number of accounts to include in the response, used for paging.",
  1090. // "format": "int32",
  1091. // "location": "query",
  1092. // "maximum": "10000",
  1093. // "minimum": "0",
  1094. // "type": "integer"
  1095. // },
  1096. // "pageToken": {
  1097. // "description": "A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1098. // "location": "query",
  1099. // "type": "string"
  1100. // }
  1101. // },
  1102. // "path": "accounts",
  1103. // "response": {
  1104. // "$ref": "Accounts"
  1105. // },
  1106. // "scopes": [
  1107. // "https://www.googleapis.com/auth/adexchange.seller",
  1108. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1109. // ]
  1110. // }
  1111. }
  1112. // Pages invokes f for each page of results.
  1113. // A non-nil error returned from f will halt the iteration.
  1114. // The provided context supersedes any context provided to the Context method.
  1115. func (c *AccountsListCall) Pages(ctx context.Context, f func(*Accounts) error) error {
  1116. c.ctx_ = ctx
  1117. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1118. for {
  1119. x, err := c.Do()
  1120. if err != nil {
  1121. return err
  1122. }
  1123. if err := f(x); err != nil {
  1124. return err
  1125. }
  1126. if x.NextPageToken == "" {
  1127. return nil
  1128. }
  1129. c.PageToken(x.NextPageToken)
  1130. }
  1131. }
  1132. // method id "adexchangeseller.accounts.adclients.list":
  1133. type AccountsAdclientsListCall struct {
  1134. s *Service
  1135. accountId string
  1136. urlParams_ gensupport.URLParams
  1137. ifNoneMatch_ string
  1138. ctx_ context.Context
  1139. header_ http.Header
  1140. }
  1141. // List: List all ad clients in this Ad Exchange account.
  1142. func (r *AccountsAdclientsService) List(accountId string) *AccountsAdclientsListCall {
  1143. c := &AccountsAdclientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1144. c.accountId = accountId
  1145. return c
  1146. }
  1147. // MaxResults sets the optional parameter "maxResults": The maximum
  1148. // number of ad clients to include in the response, used for paging.
  1149. func (c *AccountsAdclientsListCall) MaxResults(maxResults int64) *AccountsAdclientsListCall {
  1150. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1151. return c
  1152. }
  1153. // PageToken sets the optional parameter "pageToken": A continuation
  1154. // token, used to page through ad clients. To retrieve the next page,
  1155. // set this parameter to the value of "nextPageToken" from the previous
  1156. // response.
  1157. func (c *AccountsAdclientsListCall) PageToken(pageToken string) *AccountsAdclientsListCall {
  1158. c.urlParams_.Set("pageToken", pageToken)
  1159. return c
  1160. }
  1161. // Fields allows partial responses to be retrieved. See
  1162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1163. // for more information.
  1164. func (c *AccountsAdclientsListCall) Fields(s ...googleapi.Field) *AccountsAdclientsListCall {
  1165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1166. return c
  1167. }
  1168. // IfNoneMatch sets the optional parameter which makes the operation
  1169. // fail if the object's ETag matches the given value. This is useful for
  1170. // getting updates only after the object has changed since the last
  1171. // request. Use googleapi.IsNotModified to check whether the response
  1172. // error from Do is the result of In-None-Match.
  1173. func (c *AccountsAdclientsListCall) IfNoneMatch(entityTag string) *AccountsAdclientsListCall {
  1174. c.ifNoneMatch_ = entityTag
  1175. return c
  1176. }
  1177. // Context sets the context to be used in this call's Do method. Any
  1178. // pending HTTP request will be aborted if the provided context is
  1179. // canceled.
  1180. func (c *AccountsAdclientsListCall) Context(ctx context.Context) *AccountsAdclientsListCall {
  1181. c.ctx_ = ctx
  1182. return c
  1183. }
  1184. // Header returns an http.Header that can be modified by the caller to
  1185. // add HTTP headers to the request.
  1186. func (c *AccountsAdclientsListCall) Header() http.Header {
  1187. if c.header_ == nil {
  1188. c.header_ = make(http.Header)
  1189. }
  1190. return c.header_
  1191. }
  1192. func (c *AccountsAdclientsListCall) doRequest(alt string) (*http.Response, error) {
  1193. reqHeaders := make(http.Header)
  1194. for k, v := range c.header_ {
  1195. reqHeaders[k] = v
  1196. }
  1197. reqHeaders.Set("User-Agent", c.s.userAgent())
  1198. if c.ifNoneMatch_ != "" {
  1199. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1200. }
  1201. var body io.Reader = nil
  1202. c.urlParams_.Set("alt", alt)
  1203. c.urlParams_.Set("prettyPrint", "false")
  1204. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients")
  1205. urls += "?" + c.urlParams_.Encode()
  1206. req, _ := http.NewRequest("GET", urls, body)
  1207. req.Header = reqHeaders
  1208. googleapi.Expand(req.URL, map[string]string{
  1209. "accountId": c.accountId,
  1210. })
  1211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1212. }
  1213. // Do executes the "adexchangeseller.accounts.adclients.list" call.
  1214. // Exactly one of *AdClients or error will be non-nil. Any non-2xx
  1215. // status code is an error. Response headers are in either
  1216. // *AdClients.ServerResponse.Header or (if a response was returned at
  1217. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1218. // to check whether the returned error was because
  1219. // http.StatusNotModified was returned.
  1220. func (c *AccountsAdclientsListCall) Do(opts ...googleapi.CallOption) (*AdClients, error) {
  1221. gensupport.SetOptions(c.urlParams_, opts...)
  1222. res, err := c.doRequest("json")
  1223. if res != nil && res.StatusCode == http.StatusNotModified {
  1224. if res.Body != nil {
  1225. res.Body.Close()
  1226. }
  1227. return nil, &googleapi.Error{
  1228. Code: res.StatusCode,
  1229. Header: res.Header,
  1230. }
  1231. }
  1232. if err != nil {
  1233. return nil, err
  1234. }
  1235. defer googleapi.CloseBody(res)
  1236. if err := googleapi.CheckResponse(res); err != nil {
  1237. return nil, err
  1238. }
  1239. ret := &AdClients{
  1240. ServerResponse: googleapi.ServerResponse{
  1241. Header: res.Header,
  1242. HTTPStatusCode: res.StatusCode,
  1243. },
  1244. }
  1245. target := &ret
  1246. if err := gensupport.DecodeResponse(target, res); err != nil {
  1247. return nil, err
  1248. }
  1249. return ret, nil
  1250. // {
  1251. // "description": "List all ad clients in this Ad Exchange account.",
  1252. // "httpMethod": "GET",
  1253. // "id": "adexchangeseller.accounts.adclients.list",
  1254. // "parameterOrder": [
  1255. // "accountId"
  1256. // ],
  1257. // "parameters": {
  1258. // "accountId": {
  1259. // "description": "Account to which the ad client belongs.",
  1260. // "location": "path",
  1261. // "required": true,
  1262. // "type": "string"
  1263. // },
  1264. // "maxResults": {
  1265. // "description": "The maximum number of ad clients to include in the response, used for paging.",
  1266. // "format": "uint32",
  1267. // "location": "query",
  1268. // "maximum": "10000",
  1269. // "minimum": "0",
  1270. // "type": "integer"
  1271. // },
  1272. // "pageToken": {
  1273. // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1274. // "location": "query",
  1275. // "type": "string"
  1276. // }
  1277. // },
  1278. // "path": "accounts/{accountId}/adclients",
  1279. // "response": {
  1280. // "$ref": "AdClients"
  1281. // },
  1282. // "scopes": [
  1283. // "https://www.googleapis.com/auth/adexchange.seller",
  1284. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1285. // ]
  1286. // }
  1287. }
  1288. // Pages invokes f for each page of results.
  1289. // A non-nil error returned from f will halt the iteration.
  1290. // The provided context supersedes any context provided to the Context method.
  1291. func (c *AccountsAdclientsListCall) Pages(ctx context.Context, f func(*AdClients) error) error {
  1292. c.ctx_ = ctx
  1293. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1294. for {
  1295. x, err := c.Do()
  1296. if err != nil {
  1297. return err
  1298. }
  1299. if err := f(x); err != nil {
  1300. return err
  1301. }
  1302. if x.NextPageToken == "" {
  1303. return nil
  1304. }
  1305. c.PageToken(x.NextPageToken)
  1306. }
  1307. }
  1308. // method id "adexchangeseller.accounts.alerts.list":
  1309. type AccountsAlertsListCall struct {
  1310. s *Service
  1311. accountId string
  1312. urlParams_ gensupport.URLParams
  1313. ifNoneMatch_ string
  1314. ctx_ context.Context
  1315. header_ http.Header
  1316. }
  1317. // List: List the alerts for this Ad Exchange account.
  1318. func (r *AccountsAlertsService) List(accountId string) *AccountsAlertsListCall {
  1319. c := &AccountsAlertsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1320. c.accountId = accountId
  1321. return c
  1322. }
  1323. // Locale sets the optional parameter "locale": The locale to use for
  1324. // translating alert messages. The account locale will be used if this
  1325. // is not supplied. The AdSense default (English) will be used if the
  1326. // supplied locale is invalid or unsupported.
  1327. func (c *AccountsAlertsListCall) Locale(locale string) *AccountsAlertsListCall {
  1328. c.urlParams_.Set("locale", locale)
  1329. return c
  1330. }
  1331. // Fields allows partial responses to be retrieved. See
  1332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1333. // for more information.
  1334. func (c *AccountsAlertsListCall) Fields(s ...googleapi.Field) *AccountsAlertsListCall {
  1335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1336. return c
  1337. }
  1338. // IfNoneMatch sets the optional parameter which makes the operation
  1339. // fail if the object's ETag matches the given value. This is useful for
  1340. // getting updates only after the object has changed since the last
  1341. // request. Use googleapi.IsNotModified to check whether the response
  1342. // error from Do is the result of In-None-Match.
  1343. func (c *AccountsAlertsListCall) IfNoneMatch(entityTag string) *AccountsAlertsListCall {
  1344. c.ifNoneMatch_ = entityTag
  1345. return c
  1346. }
  1347. // Context sets the context to be used in this call's Do method. Any
  1348. // pending HTTP request will be aborted if the provided context is
  1349. // canceled.
  1350. func (c *AccountsAlertsListCall) Context(ctx context.Context) *AccountsAlertsListCall {
  1351. c.ctx_ = ctx
  1352. return c
  1353. }
  1354. // Header returns an http.Header that can be modified by the caller to
  1355. // add HTTP headers to the request.
  1356. func (c *AccountsAlertsListCall) Header() http.Header {
  1357. if c.header_ == nil {
  1358. c.header_ = make(http.Header)
  1359. }
  1360. return c.header_
  1361. }
  1362. func (c *AccountsAlertsListCall) doRequest(alt string) (*http.Response, error) {
  1363. reqHeaders := make(http.Header)
  1364. for k, v := range c.header_ {
  1365. reqHeaders[k] = v
  1366. }
  1367. reqHeaders.Set("User-Agent", c.s.userAgent())
  1368. if c.ifNoneMatch_ != "" {
  1369. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1370. }
  1371. var body io.Reader = nil
  1372. c.urlParams_.Set("alt", alt)
  1373. c.urlParams_.Set("prettyPrint", "false")
  1374. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/alerts")
  1375. urls += "?" + c.urlParams_.Encode()
  1376. req, _ := http.NewRequest("GET", urls, body)
  1377. req.Header = reqHeaders
  1378. googleapi.Expand(req.URL, map[string]string{
  1379. "accountId": c.accountId,
  1380. })
  1381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1382. }
  1383. // Do executes the "adexchangeseller.accounts.alerts.list" call.
  1384. // Exactly one of *Alerts or error will be non-nil. Any non-2xx status
  1385. // code is an error. Response headers are in either
  1386. // *Alerts.ServerResponse.Header or (if a response was returned at all)
  1387. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1388. // check whether the returned error was because http.StatusNotModified
  1389. // was returned.
  1390. func (c *AccountsAlertsListCall) Do(opts ...googleapi.CallOption) (*Alerts, error) {
  1391. gensupport.SetOptions(c.urlParams_, opts...)
  1392. res, err := c.doRequest("json")
  1393. if res != nil && res.StatusCode == http.StatusNotModified {
  1394. if res.Body != nil {
  1395. res.Body.Close()
  1396. }
  1397. return nil, &googleapi.Error{
  1398. Code: res.StatusCode,
  1399. Header: res.Header,
  1400. }
  1401. }
  1402. if err != nil {
  1403. return nil, err
  1404. }
  1405. defer googleapi.CloseBody(res)
  1406. if err := googleapi.CheckResponse(res); err != nil {
  1407. return nil, err
  1408. }
  1409. ret := &Alerts{
  1410. ServerResponse: googleapi.ServerResponse{
  1411. Header: res.Header,
  1412. HTTPStatusCode: res.StatusCode,
  1413. },
  1414. }
  1415. target := &ret
  1416. if err := gensupport.DecodeResponse(target, res); err != nil {
  1417. return nil, err
  1418. }
  1419. return ret, nil
  1420. // {
  1421. // "description": "List the alerts for this Ad Exchange account.",
  1422. // "httpMethod": "GET",
  1423. // "id": "adexchangeseller.accounts.alerts.list",
  1424. // "parameterOrder": [
  1425. // "accountId"
  1426. // ],
  1427. // "parameters": {
  1428. // "accountId": {
  1429. // "description": "Account owning the alerts.",
  1430. // "location": "path",
  1431. // "required": true,
  1432. // "type": "string"
  1433. // },
  1434. // "locale": {
  1435. // "description": "The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported.",
  1436. // "location": "query",
  1437. // "type": "string"
  1438. // }
  1439. // },
  1440. // "path": "accounts/{accountId}/alerts",
  1441. // "response": {
  1442. // "$ref": "Alerts"
  1443. // },
  1444. // "scopes": [
  1445. // "https://www.googleapis.com/auth/adexchange.seller",
  1446. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1447. // ]
  1448. // }
  1449. }
  1450. // method id "adexchangeseller.accounts.customchannels.get":
  1451. type AccountsCustomchannelsGetCall struct {
  1452. s *Service
  1453. accountId string
  1454. adClientId string
  1455. customChannelId string
  1456. urlParams_ gensupport.URLParams
  1457. ifNoneMatch_ string
  1458. ctx_ context.Context
  1459. header_ http.Header
  1460. }
  1461. // Get: Get the specified custom channel from the specified ad client.
  1462. func (r *AccountsCustomchannelsService) Get(accountId string, adClientId string, customChannelId string) *AccountsCustomchannelsGetCall {
  1463. c := &AccountsCustomchannelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1464. c.accountId = accountId
  1465. c.adClientId = adClientId
  1466. c.customChannelId = customChannelId
  1467. return c
  1468. }
  1469. // Fields allows partial responses to be retrieved. See
  1470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1471. // for more information.
  1472. func (c *AccountsCustomchannelsGetCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsGetCall {
  1473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1474. return c
  1475. }
  1476. // IfNoneMatch sets the optional parameter which makes the operation
  1477. // fail if the object's ETag matches the given value. This is useful for
  1478. // getting updates only after the object has changed since the last
  1479. // request. Use googleapi.IsNotModified to check whether the response
  1480. // error from Do is the result of In-None-Match.
  1481. func (c *AccountsCustomchannelsGetCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsGetCall {
  1482. c.ifNoneMatch_ = entityTag
  1483. return c
  1484. }
  1485. // Context sets the context to be used in this call's Do method. Any
  1486. // pending HTTP request will be aborted if the provided context is
  1487. // canceled.
  1488. func (c *AccountsCustomchannelsGetCall) Context(ctx context.Context) *AccountsCustomchannelsGetCall {
  1489. c.ctx_ = ctx
  1490. return c
  1491. }
  1492. // Header returns an http.Header that can be modified by the caller to
  1493. // add HTTP headers to the request.
  1494. func (c *AccountsCustomchannelsGetCall) Header() http.Header {
  1495. if c.header_ == nil {
  1496. c.header_ = make(http.Header)
  1497. }
  1498. return c.header_
  1499. }
  1500. func (c *AccountsCustomchannelsGetCall) doRequest(alt string) (*http.Response, error) {
  1501. reqHeaders := make(http.Header)
  1502. for k, v := range c.header_ {
  1503. reqHeaders[k] = v
  1504. }
  1505. reqHeaders.Set("User-Agent", c.s.userAgent())
  1506. if c.ifNoneMatch_ != "" {
  1507. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1508. }
  1509. var body io.Reader = nil
  1510. c.urlParams_.Set("alt", alt)
  1511. c.urlParams_.Set("prettyPrint", "false")
  1512. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}")
  1513. urls += "?" + c.urlParams_.Encode()
  1514. req, _ := http.NewRequest("GET", urls, body)
  1515. req.Header = reqHeaders
  1516. googleapi.Expand(req.URL, map[string]string{
  1517. "accountId": c.accountId,
  1518. "adClientId": c.adClientId,
  1519. "customChannelId": c.customChannelId,
  1520. })
  1521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1522. }
  1523. // Do executes the "adexchangeseller.accounts.customchannels.get" call.
  1524. // Exactly one of *CustomChannel or error will be non-nil. Any non-2xx
  1525. // status code is an error. Response headers are in either
  1526. // *CustomChannel.ServerResponse.Header or (if a response was returned
  1527. // at all) in error.(*googleapi.Error).Header. Use
  1528. // googleapi.IsNotModified to check whether the returned error was
  1529. // because http.StatusNotModified was returned.
  1530. func (c *AccountsCustomchannelsGetCall) Do(opts ...googleapi.CallOption) (*CustomChannel, error) {
  1531. gensupport.SetOptions(c.urlParams_, opts...)
  1532. res, err := c.doRequest("json")
  1533. if res != nil && res.StatusCode == http.StatusNotModified {
  1534. if res.Body != nil {
  1535. res.Body.Close()
  1536. }
  1537. return nil, &googleapi.Error{
  1538. Code: res.StatusCode,
  1539. Header: res.Header,
  1540. }
  1541. }
  1542. if err != nil {
  1543. return nil, err
  1544. }
  1545. defer googleapi.CloseBody(res)
  1546. if err := googleapi.CheckResponse(res); err != nil {
  1547. return nil, err
  1548. }
  1549. ret := &CustomChannel{
  1550. ServerResponse: googleapi.ServerResponse{
  1551. Header: res.Header,
  1552. HTTPStatusCode: res.StatusCode,
  1553. },
  1554. }
  1555. target := &ret
  1556. if err := gensupport.DecodeResponse(target, res); err != nil {
  1557. return nil, err
  1558. }
  1559. return ret, nil
  1560. // {
  1561. // "description": "Get the specified custom channel from the specified ad client.",
  1562. // "httpMethod": "GET",
  1563. // "id": "adexchangeseller.accounts.customchannels.get",
  1564. // "parameterOrder": [
  1565. // "accountId",
  1566. // "adClientId",
  1567. // "customChannelId"
  1568. // ],
  1569. // "parameters": {
  1570. // "accountId": {
  1571. // "description": "Account to which the ad client belongs.",
  1572. // "location": "path",
  1573. // "required": true,
  1574. // "type": "string"
  1575. // },
  1576. // "adClientId": {
  1577. // "description": "Ad client which contains the custom channel.",
  1578. // "location": "path",
  1579. // "required": true,
  1580. // "type": "string"
  1581. // },
  1582. // "customChannelId": {
  1583. // "description": "Custom channel to retrieve.",
  1584. // "location": "path",
  1585. // "required": true,
  1586. // "type": "string"
  1587. // }
  1588. // },
  1589. // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}",
  1590. // "response": {
  1591. // "$ref": "CustomChannel"
  1592. // },
  1593. // "scopes": [
  1594. // "https://www.googleapis.com/auth/adexchange.seller",
  1595. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1596. // ]
  1597. // }
  1598. }
  1599. // method id "adexchangeseller.accounts.customchannels.list":
  1600. type AccountsCustomchannelsListCall struct {
  1601. s *Service
  1602. accountId string
  1603. adClientId string
  1604. urlParams_ gensupport.URLParams
  1605. ifNoneMatch_ string
  1606. ctx_ context.Context
  1607. header_ http.Header
  1608. }
  1609. // List: List all custom channels in the specified ad client for this Ad
  1610. // Exchange account.
  1611. func (r *AccountsCustomchannelsService) List(accountId string, adClientId string) *AccountsCustomchannelsListCall {
  1612. c := &AccountsCustomchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1613. c.accountId = accountId
  1614. c.adClientId = adClientId
  1615. return c
  1616. }
  1617. // MaxResults sets the optional parameter "maxResults": The maximum
  1618. // number of custom channels to include in the response, used for
  1619. // paging.
  1620. func (c *AccountsCustomchannelsListCall) MaxResults(maxResults int64) *AccountsCustomchannelsListCall {
  1621. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1622. return c
  1623. }
  1624. // PageToken sets the optional parameter "pageToken": A continuation
  1625. // token, used to page through custom channels. To retrieve the next
  1626. // page, set this parameter to the value of "nextPageToken" from the
  1627. // previous response.
  1628. func (c *AccountsCustomchannelsListCall) PageToken(pageToken string) *AccountsCustomchannelsListCall {
  1629. c.urlParams_.Set("pageToken", pageToken)
  1630. return c
  1631. }
  1632. // Fields allows partial responses to be retrieved. See
  1633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1634. // for more information.
  1635. func (c *AccountsCustomchannelsListCall) Fields(s ...googleapi.Field) *AccountsCustomchannelsListCall {
  1636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1637. return c
  1638. }
  1639. // IfNoneMatch sets the optional parameter which makes the operation
  1640. // fail if the object's ETag matches the given value. This is useful for
  1641. // getting updates only after the object has changed since the last
  1642. // request. Use googleapi.IsNotModified to check whether the response
  1643. // error from Do is the result of In-None-Match.
  1644. func (c *AccountsCustomchannelsListCall) IfNoneMatch(entityTag string) *AccountsCustomchannelsListCall {
  1645. c.ifNoneMatch_ = entityTag
  1646. return c
  1647. }
  1648. // Context sets the context to be used in this call's Do method. Any
  1649. // pending HTTP request will be aborted if the provided context is
  1650. // canceled.
  1651. func (c *AccountsCustomchannelsListCall) Context(ctx context.Context) *AccountsCustomchannelsListCall {
  1652. c.ctx_ = ctx
  1653. return c
  1654. }
  1655. // Header returns an http.Header that can be modified by the caller to
  1656. // add HTTP headers to the request.
  1657. func (c *AccountsCustomchannelsListCall) Header() http.Header {
  1658. if c.header_ == nil {
  1659. c.header_ = make(http.Header)
  1660. }
  1661. return c.header_
  1662. }
  1663. func (c *AccountsCustomchannelsListCall) doRequest(alt string) (*http.Response, error) {
  1664. reqHeaders := make(http.Header)
  1665. for k, v := range c.header_ {
  1666. reqHeaders[k] = v
  1667. }
  1668. reqHeaders.Set("User-Agent", c.s.userAgent())
  1669. if c.ifNoneMatch_ != "" {
  1670. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1671. }
  1672. var body io.Reader = nil
  1673. c.urlParams_.Set("alt", alt)
  1674. c.urlParams_.Set("prettyPrint", "false")
  1675. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/customchannels")
  1676. urls += "?" + c.urlParams_.Encode()
  1677. req, _ := http.NewRequest("GET", urls, body)
  1678. req.Header = reqHeaders
  1679. googleapi.Expand(req.URL, map[string]string{
  1680. "accountId": c.accountId,
  1681. "adClientId": c.adClientId,
  1682. })
  1683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1684. }
  1685. // Do executes the "adexchangeseller.accounts.customchannels.list" call.
  1686. // Exactly one of *CustomChannels or error will be non-nil. Any non-2xx
  1687. // status code is an error. Response headers are in either
  1688. // *CustomChannels.ServerResponse.Header or (if a response was returned
  1689. // at all) in error.(*googleapi.Error).Header. Use
  1690. // googleapi.IsNotModified to check whether the returned error was
  1691. // because http.StatusNotModified was returned.
  1692. func (c *AccountsCustomchannelsListCall) Do(opts ...googleapi.CallOption) (*CustomChannels, error) {
  1693. gensupport.SetOptions(c.urlParams_, opts...)
  1694. res, err := c.doRequest("json")
  1695. if res != nil && res.StatusCode == http.StatusNotModified {
  1696. if res.Body != nil {
  1697. res.Body.Close()
  1698. }
  1699. return nil, &googleapi.Error{
  1700. Code: res.StatusCode,
  1701. Header: res.Header,
  1702. }
  1703. }
  1704. if err != nil {
  1705. return nil, err
  1706. }
  1707. defer googleapi.CloseBody(res)
  1708. if err := googleapi.CheckResponse(res); err != nil {
  1709. return nil, err
  1710. }
  1711. ret := &CustomChannels{
  1712. ServerResponse: googleapi.ServerResponse{
  1713. Header: res.Header,
  1714. HTTPStatusCode: res.StatusCode,
  1715. },
  1716. }
  1717. target := &ret
  1718. if err := gensupport.DecodeResponse(target, res); err != nil {
  1719. return nil, err
  1720. }
  1721. return ret, nil
  1722. // {
  1723. // "description": "List all custom channels in the specified ad client for this Ad Exchange account.",
  1724. // "httpMethod": "GET",
  1725. // "id": "adexchangeseller.accounts.customchannels.list",
  1726. // "parameterOrder": [
  1727. // "accountId",
  1728. // "adClientId"
  1729. // ],
  1730. // "parameters": {
  1731. // "accountId": {
  1732. // "description": "Account to which the ad client belongs.",
  1733. // "location": "path",
  1734. // "required": true,
  1735. // "type": "string"
  1736. // },
  1737. // "adClientId": {
  1738. // "description": "Ad client for which to list custom channels.",
  1739. // "location": "path",
  1740. // "required": true,
  1741. // "type": "string"
  1742. // },
  1743. // "maxResults": {
  1744. // "description": "The maximum number of custom channels to include in the response, used for paging.",
  1745. // "format": "uint32",
  1746. // "location": "query",
  1747. // "maximum": "10000",
  1748. // "minimum": "0",
  1749. // "type": "integer"
  1750. // },
  1751. // "pageToken": {
  1752. // "description": "A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  1753. // "location": "query",
  1754. // "type": "string"
  1755. // }
  1756. // },
  1757. // "path": "accounts/{accountId}/adclients/{adClientId}/customchannels",
  1758. // "response": {
  1759. // "$ref": "CustomChannels"
  1760. // },
  1761. // "scopes": [
  1762. // "https://www.googleapis.com/auth/adexchange.seller",
  1763. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1764. // ]
  1765. // }
  1766. }
  1767. // Pages invokes f for each page of results.
  1768. // A non-nil error returned from f will halt the iteration.
  1769. // The provided context supersedes any context provided to the Context method.
  1770. func (c *AccountsCustomchannelsListCall) Pages(ctx context.Context, f func(*CustomChannels) error) error {
  1771. c.ctx_ = ctx
  1772. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1773. for {
  1774. x, err := c.Do()
  1775. if err != nil {
  1776. return err
  1777. }
  1778. if err := f(x); err != nil {
  1779. return err
  1780. }
  1781. if x.NextPageToken == "" {
  1782. return nil
  1783. }
  1784. c.PageToken(x.NextPageToken)
  1785. }
  1786. }
  1787. // method id "adexchangeseller.accounts.metadata.dimensions.list":
  1788. type AccountsMetadataDimensionsListCall struct {
  1789. s *Service
  1790. accountId string
  1791. urlParams_ gensupport.URLParams
  1792. ifNoneMatch_ string
  1793. ctx_ context.Context
  1794. header_ http.Header
  1795. }
  1796. // List: List the metadata for the dimensions available to this
  1797. // AdExchange account.
  1798. func (r *AccountsMetadataDimensionsService) List(accountId string) *AccountsMetadataDimensionsListCall {
  1799. c := &AccountsMetadataDimensionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1800. c.accountId = accountId
  1801. return c
  1802. }
  1803. // Fields allows partial responses to be retrieved. See
  1804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1805. // for more information.
  1806. func (c *AccountsMetadataDimensionsListCall) Fields(s ...googleapi.Field) *AccountsMetadataDimensionsListCall {
  1807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1808. return c
  1809. }
  1810. // IfNoneMatch sets the optional parameter which makes the operation
  1811. // fail if the object's ETag matches the given value. This is useful for
  1812. // getting updates only after the object has changed since the last
  1813. // request. Use googleapi.IsNotModified to check whether the response
  1814. // error from Do is the result of In-None-Match.
  1815. func (c *AccountsMetadataDimensionsListCall) IfNoneMatch(entityTag string) *AccountsMetadataDimensionsListCall {
  1816. c.ifNoneMatch_ = entityTag
  1817. return c
  1818. }
  1819. // Context sets the context to be used in this call's Do method. Any
  1820. // pending HTTP request will be aborted if the provided context is
  1821. // canceled.
  1822. func (c *AccountsMetadataDimensionsListCall) Context(ctx context.Context) *AccountsMetadataDimensionsListCall {
  1823. c.ctx_ = ctx
  1824. return c
  1825. }
  1826. // Header returns an http.Header that can be modified by the caller to
  1827. // add HTTP headers to the request.
  1828. func (c *AccountsMetadataDimensionsListCall) Header() http.Header {
  1829. if c.header_ == nil {
  1830. c.header_ = make(http.Header)
  1831. }
  1832. return c.header_
  1833. }
  1834. func (c *AccountsMetadataDimensionsListCall) doRequest(alt string) (*http.Response, error) {
  1835. reqHeaders := make(http.Header)
  1836. for k, v := range c.header_ {
  1837. reqHeaders[k] = v
  1838. }
  1839. reqHeaders.Set("User-Agent", c.s.userAgent())
  1840. if c.ifNoneMatch_ != "" {
  1841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1842. }
  1843. var body io.Reader = nil
  1844. c.urlParams_.Set("alt", alt)
  1845. c.urlParams_.Set("prettyPrint", "false")
  1846. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/dimensions")
  1847. urls += "?" + c.urlParams_.Encode()
  1848. req, _ := http.NewRequest("GET", urls, body)
  1849. req.Header = reqHeaders
  1850. googleapi.Expand(req.URL, map[string]string{
  1851. "accountId": c.accountId,
  1852. })
  1853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1854. }
  1855. // Do executes the "adexchangeseller.accounts.metadata.dimensions.list" call.
  1856. // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  1857. // code is an error. Response headers are in either
  1858. // *Metadata.ServerResponse.Header or (if a response was returned at
  1859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1860. // to check whether the returned error was because
  1861. // http.StatusNotModified was returned.
  1862. func (c *AccountsMetadataDimensionsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  1863. gensupport.SetOptions(c.urlParams_, opts...)
  1864. res, err := c.doRequest("json")
  1865. if res != nil && res.StatusCode == http.StatusNotModified {
  1866. if res.Body != nil {
  1867. res.Body.Close()
  1868. }
  1869. return nil, &googleapi.Error{
  1870. Code: res.StatusCode,
  1871. Header: res.Header,
  1872. }
  1873. }
  1874. if err != nil {
  1875. return nil, err
  1876. }
  1877. defer googleapi.CloseBody(res)
  1878. if err := googleapi.CheckResponse(res); err != nil {
  1879. return nil, err
  1880. }
  1881. ret := &Metadata{
  1882. ServerResponse: googleapi.ServerResponse{
  1883. Header: res.Header,
  1884. HTTPStatusCode: res.StatusCode,
  1885. },
  1886. }
  1887. target := &ret
  1888. if err := gensupport.DecodeResponse(target, res); err != nil {
  1889. return nil, err
  1890. }
  1891. return ret, nil
  1892. // {
  1893. // "description": "List the metadata for the dimensions available to this AdExchange account.",
  1894. // "httpMethod": "GET",
  1895. // "id": "adexchangeseller.accounts.metadata.dimensions.list",
  1896. // "parameterOrder": [
  1897. // "accountId"
  1898. // ],
  1899. // "parameters": {
  1900. // "accountId": {
  1901. // "description": "Account with visibility to the dimensions.",
  1902. // "location": "path",
  1903. // "required": true,
  1904. // "type": "string"
  1905. // }
  1906. // },
  1907. // "path": "accounts/{accountId}/metadata/dimensions",
  1908. // "response": {
  1909. // "$ref": "Metadata"
  1910. // },
  1911. // "scopes": [
  1912. // "https://www.googleapis.com/auth/adexchange.seller",
  1913. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  1914. // ]
  1915. // }
  1916. }
  1917. // method id "adexchangeseller.accounts.metadata.metrics.list":
  1918. type AccountsMetadataMetricsListCall struct {
  1919. s *Service
  1920. accountId string
  1921. urlParams_ gensupport.URLParams
  1922. ifNoneMatch_ string
  1923. ctx_ context.Context
  1924. header_ http.Header
  1925. }
  1926. // List: List the metadata for the metrics available to this AdExchange
  1927. // account.
  1928. func (r *AccountsMetadataMetricsService) List(accountId string) *AccountsMetadataMetricsListCall {
  1929. c := &AccountsMetadataMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1930. c.accountId = accountId
  1931. return c
  1932. }
  1933. // Fields allows partial responses to be retrieved. See
  1934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1935. // for more information.
  1936. func (c *AccountsMetadataMetricsListCall) Fields(s ...googleapi.Field) *AccountsMetadataMetricsListCall {
  1937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1938. return c
  1939. }
  1940. // IfNoneMatch sets the optional parameter which makes the operation
  1941. // fail if the object's ETag matches the given value. This is useful for
  1942. // getting updates only after the object has changed since the last
  1943. // request. Use googleapi.IsNotModified to check whether the response
  1944. // error from Do is the result of In-None-Match.
  1945. func (c *AccountsMetadataMetricsListCall) IfNoneMatch(entityTag string) *AccountsMetadataMetricsListCall {
  1946. c.ifNoneMatch_ = entityTag
  1947. return c
  1948. }
  1949. // Context sets the context to be used in this call's Do method. Any
  1950. // pending HTTP request will be aborted if the provided context is
  1951. // canceled.
  1952. func (c *AccountsMetadataMetricsListCall) Context(ctx context.Context) *AccountsMetadataMetricsListCall {
  1953. c.ctx_ = ctx
  1954. return c
  1955. }
  1956. // Header returns an http.Header that can be modified by the caller to
  1957. // add HTTP headers to the request.
  1958. func (c *AccountsMetadataMetricsListCall) Header() http.Header {
  1959. if c.header_ == nil {
  1960. c.header_ = make(http.Header)
  1961. }
  1962. return c.header_
  1963. }
  1964. func (c *AccountsMetadataMetricsListCall) doRequest(alt string) (*http.Response, error) {
  1965. reqHeaders := make(http.Header)
  1966. for k, v := range c.header_ {
  1967. reqHeaders[k] = v
  1968. }
  1969. reqHeaders.Set("User-Agent", c.s.userAgent())
  1970. if c.ifNoneMatch_ != "" {
  1971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1972. }
  1973. var body io.Reader = nil
  1974. c.urlParams_.Set("alt", alt)
  1975. c.urlParams_.Set("prettyPrint", "false")
  1976. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/metadata/metrics")
  1977. urls += "?" + c.urlParams_.Encode()
  1978. req, _ := http.NewRequest("GET", urls, body)
  1979. req.Header = reqHeaders
  1980. googleapi.Expand(req.URL, map[string]string{
  1981. "accountId": c.accountId,
  1982. })
  1983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1984. }
  1985. // Do executes the "adexchangeseller.accounts.metadata.metrics.list" call.
  1986. // Exactly one of *Metadata or error will be non-nil. Any non-2xx status
  1987. // code is an error. Response headers are in either
  1988. // *Metadata.ServerResponse.Header or (if a response was returned at
  1989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1990. // to check whether the returned error was because
  1991. // http.StatusNotModified was returned.
  1992. func (c *AccountsMetadataMetricsListCall) Do(opts ...googleapi.CallOption) (*Metadata, error) {
  1993. gensupport.SetOptions(c.urlParams_, opts...)
  1994. res, err := c.doRequest("json")
  1995. if res != nil && res.StatusCode == http.StatusNotModified {
  1996. if res.Body != nil {
  1997. res.Body.Close()
  1998. }
  1999. return nil, &googleapi.Error{
  2000. Code: res.StatusCode,
  2001. Header: res.Header,
  2002. }
  2003. }
  2004. if err != nil {
  2005. return nil, err
  2006. }
  2007. defer googleapi.CloseBody(res)
  2008. if err := googleapi.CheckResponse(res); err != nil {
  2009. return nil, err
  2010. }
  2011. ret := &Metadata{
  2012. ServerResponse: googleapi.ServerResponse{
  2013. Header: res.Header,
  2014. HTTPStatusCode: res.StatusCode,
  2015. },
  2016. }
  2017. target := &ret
  2018. if err := gensupport.DecodeResponse(target, res); err != nil {
  2019. return nil, err
  2020. }
  2021. return ret, nil
  2022. // {
  2023. // "description": "List the metadata for the metrics available to this AdExchange account.",
  2024. // "httpMethod": "GET",
  2025. // "id": "adexchangeseller.accounts.metadata.metrics.list",
  2026. // "parameterOrder": [
  2027. // "accountId"
  2028. // ],
  2029. // "parameters": {
  2030. // "accountId": {
  2031. // "description": "Account with visibility to the metrics.",
  2032. // "location": "path",
  2033. // "required": true,
  2034. // "type": "string"
  2035. // }
  2036. // },
  2037. // "path": "accounts/{accountId}/metadata/metrics",
  2038. // "response": {
  2039. // "$ref": "Metadata"
  2040. // },
  2041. // "scopes": [
  2042. // "https://www.googleapis.com/auth/adexchange.seller",
  2043. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2044. // ]
  2045. // }
  2046. }
  2047. // method id "adexchangeseller.accounts.preferreddeals.get":
  2048. type AccountsPreferreddealsGetCall struct {
  2049. s *Service
  2050. accountId string
  2051. dealId string
  2052. urlParams_ gensupport.URLParams
  2053. ifNoneMatch_ string
  2054. ctx_ context.Context
  2055. header_ http.Header
  2056. }
  2057. // Get: Get information about the selected Ad Exchange Preferred Deal.
  2058. func (r *AccountsPreferreddealsService) Get(accountId string, dealId string) *AccountsPreferreddealsGetCall {
  2059. c := &AccountsPreferreddealsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2060. c.accountId = accountId
  2061. c.dealId = dealId
  2062. return c
  2063. }
  2064. // Fields allows partial responses to be retrieved. See
  2065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2066. // for more information.
  2067. func (c *AccountsPreferreddealsGetCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsGetCall {
  2068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2069. return c
  2070. }
  2071. // IfNoneMatch sets the optional parameter which makes the operation
  2072. // fail if the object's ETag matches the given value. This is useful for
  2073. // getting updates only after the object has changed since the last
  2074. // request. Use googleapi.IsNotModified to check whether the response
  2075. // error from Do is the result of In-None-Match.
  2076. func (c *AccountsPreferreddealsGetCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsGetCall {
  2077. c.ifNoneMatch_ = entityTag
  2078. return c
  2079. }
  2080. // Context sets the context to be used in this call's Do method. Any
  2081. // pending HTTP request will be aborted if the provided context is
  2082. // canceled.
  2083. func (c *AccountsPreferreddealsGetCall) Context(ctx context.Context) *AccountsPreferreddealsGetCall {
  2084. c.ctx_ = ctx
  2085. return c
  2086. }
  2087. // Header returns an http.Header that can be modified by the caller to
  2088. // add HTTP headers to the request.
  2089. func (c *AccountsPreferreddealsGetCall) Header() http.Header {
  2090. if c.header_ == nil {
  2091. c.header_ = make(http.Header)
  2092. }
  2093. return c.header_
  2094. }
  2095. func (c *AccountsPreferreddealsGetCall) doRequest(alt string) (*http.Response, error) {
  2096. reqHeaders := make(http.Header)
  2097. for k, v := range c.header_ {
  2098. reqHeaders[k] = v
  2099. }
  2100. reqHeaders.Set("User-Agent", c.s.userAgent())
  2101. if c.ifNoneMatch_ != "" {
  2102. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2103. }
  2104. var body io.Reader = nil
  2105. c.urlParams_.Set("alt", alt)
  2106. c.urlParams_.Set("prettyPrint", "false")
  2107. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals/{dealId}")
  2108. urls += "?" + c.urlParams_.Encode()
  2109. req, _ := http.NewRequest("GET", urls, body)
  2110. req.Header = reqHeaders
  2111. googleapi.Expand(req.URL, map[string]string{
  2112. "accountId": c.accountId,
  2113. "dealId": c.dealId,
  2114. })
  2115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2116. }
  2117. // Do executes the "adexchangeseller.accounts.preferreddeals.get" call.
  2118. // Exactly one of *PreferredDeal or error will be non-nil. Any non-2xx
  2119. // status code is an error. Response headers are in either
  2120. // *PreferredDeal.ServerResponse.Header or (if a response was returned
  2121. // at all) in error.(*googleapi.Error).Header. Use
  2122. // googleapi.IsNotModified to check whether the returned error was
  2123. // because http.StatusNotModified was returned.
  2124. func (c *AccountsPreferreddealsGetCall) Do(opts ...googleapi.CallOption) (*PreferredDeal, error) {
  2125. gensupport.SetOptions(c.urlParams_, opts...)
  2126. res, err := c.doRequest("json")
  2127. if res != nil && res.StatusCode == http.StatusNotModified {
  2128. if res.Body != nil {
  2129. res.Body.Close()
  2130. }
  2131. return nil, &googleapi.Error{
  2132. Code: res.StatusCode,
  2133. Header: res.Header,
  2134. }
  2135. }
  2136. if err != nil {
  2137. return nil, err
  2138. }
  2139. defer googleapi.CloseBody(res)
  2140. if err := googleapi.CheckResponse(res); err != nil {
  2141. return nil, err
  2142. }
  2143. ret := &PreferredDeal{
  2144. ServerResponse: googleapi.ServerResponse{
  2145. Header: res.Header,
  2146. HTTPStatusCode: res.StatusCode,
  2147. },
  2148. }
  2149. target := &ret
  2150. if err := gensupport.DecodeResponse(target, res); err != nil {
  2151. return nil, err
  2152. }
  2153. return ret, nil
  2154. // {
  2155. // "description": "Get information about the selected Ad Exchange Preferred Deal.",
  2156. // "httpMethod": "GET",
  2157. // "id": "adexchangeseller.accounts.preferreddeals.get",
  2158. // "parameterOrder": [
  2159. // "accountId",
  2160. // "dealId"
  2161. // ],
  2162. // "parameters": {
  2163. // "accountId": {
  2164. // "description": "Account owning the deal.",
  2165. // "location": "path",
  2166. // "required": true,
  2167. // "type": "string"
  2168. // },
  2169. // "dealId": {
  2170. // "description": "Preferred deal to get information about.",
  2171. // "location": "path",
  2172. // "required": true,
  2173. // "type": "string"
  2174. // }
  2175. // },
  2176. // "path": "accounts/{accountId}/preferreddeals/{dealId}",
  2177. // "response": {
  2178. // "$ref": "PreferredDeal"
  2179. // },
  2180. // "scopes": [
  2181. // "https://www.googleapis.com/auth/adexchange.seller",
  2182. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2183. // ]
  2184. // }
  2185. }
  2186. // method id "adexchangeseller.accounts.preferreddeals.list":
  2187. type AccountsPreferreddealsListCall struct {
  2188. s *Service
  2189. accountId string
  2190. urlParams_ gensupport.URLParams
  2191. ifNoneMatch_ string
  2192. ctx_ context.Context
  2193. header_ http.Header
  2194. }
  2195. // List: List the preferred deals for this Ad Exchange account.
  2196. func (r *AccountsPreferreddealsService) List(accountId string) *AccountsPreferreddealsListCall {
  2197. c := &AccountsPreferreddealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2198. c.accountId = accountId
  2199. return c
  2200. }
  2201. // Fields allows partial responses to be retrieved. See
  2202. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2203. // for more information.
  2204. func (c *AccountsPreferreddealsListCall) Fields(s ...googleapi.Field) *AccountsPreferreddealsListCall {
  2205. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2206. return c
  2207. }
  2208. // IfNoneMatch sets the optional parameter which makes the operation
  2209. // fail if the object's ETag matches the given value. This is useful for
  2210. // getting updates only after the object has changed since the last
  2211. // request. Use googleapi.IsNotModified to check whether the response
  2212. // error from Do is the result of In-None-Match.
  2213. func (c *AccountsPreferreddealsListCall) IfNoneMatch(entityTag string) *AccountsPreferreddealsListCall {
  2214. c.ifNoneMatch_ = entityTag
  2215. return c
  2216. }
  2217. // Context sets the context to be used in this call's Do method. Any
  2218. // pending HTTP request will be aborted if the provided context is
  2219. // canceled.
  2220. func (c *AccountsPreferreddealsListCall) Context(ctx context.Context) *AccountsPreferreddealsListCall {
  2221. c.ctx_ = ctx
  2222. return c
  2223. }
  2224. // Header returns an http.Header that can be modified by the caller to
  2225. // add HTTP headers to the request.
  2226. func (c *AccountsPreferreddealsListCall) Header() http.Header {
  2227. if c.header_ == nil {
  2228. c.header_ = make(http.Header)
  2229. }
  2230. return c.header_
  2231. }
  2232. func (c *AccountsPreferreddealsListCall) doRequest(alt string) (*http.Response, error) {
  2233. reqHeaders := make(http.Header)
  2234. for k, v := range c.header_ {
  2235. reqHeaders[k] = v
  2236. }
  2237. reqHeaders.Set("User-Agent", c.s.userAgent())
  2238. if c.ifNoneMatch_ != "" {
  2239. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2240. }
  2241. var body io.Reader = nil
  2242. c.urlParams_.Set("alt", alt)
  2243. c.urlParams_.Set("prettyPrint", "false")
  2244. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/preferreddeals")
  2245. urls += "?" + c.urlParams_.Encode()
  2246. req, _ := http.NewRequest("GET", urls, body)
  2247. req.Header = reqHeaders
  2248. googleapi.Expand(req.URL, map[string]string{
  2249. "accountId": c.accountId,
  2250. })
  2251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2252. }
  2253. // Do executes the "adexchangeseller.accounts.preferreddeals.list" call.
  2254. // Exactly one of *PreferredDeals or error will be non-nil. Any non-2xx
  2255. // status code is an error. Response headers are in either
  2256. // *PreferredDeals.ServerResponse.Header or (if a response was returned
  2257. // at all) in error.(*googleapi.Error).Header. Use
  2258. // googleapi.IsNotModified to check whether the returned error was
  2259. // because http.StatusNotModified was returned.
  2260. func (c *AccountsPreferreddealsListCall) Do(opts ...googleapi.CallOption) (*PreferredDeals, error) {
  2261. gensupport.SetOptions(c.urlParams_, opts...)
  2262. res, err := c.doRequest("json")
  2263. if res != nil && res.StatusCode == http.StatusNotModified {
  2264. if res.Body != nil {
  2265. res.Body.Close()
  2266. }
  2267. return nil, &googleapi.Error{
  2268. Code: res.StatusCode,
  2269. Header: res.Header,
  2270. }
  2271. }
  2272. if err != nil {
  2273. return nil, err
  2274. }
  2275. defer googleapi.CloseBody(res)
  2276. if err := googleapi.CheckResponse(res); err != nil {
  2277. return nil, err
  2278. }
  2279. ret := &PreferredDeals{
  2280. ServerResponse: googleapi.ServerResponse{
  2281. Header: res.Header,
  2282. HTTPStatusCode: res.StatusCode,
  2283. },
  2284. }
  2285. target := &ret
  2286. if err := gensupport.DecodeResponse(target, res); err != nil {
  2287. return nil, err
  2288. }
  2289. return ret, nil
  2290. // {
  2291. // "description": "List the preferred deals for this Ad Exchange account.",
  2292. // "httpMethod": "GET",
  2293. // "id": "adexchangeseller.accounts.preferreddeals.list",
  2294. // "parameterOrder": [
  2295. // "accountId"
  2296. // ],
  2297. // "parameters": {
  2298. // "accountId": {
  2299. // "description": "Account owning the deals.",
  2300. // "location": "path",
  2301. // "required": true,
  2302. // "type": "string"
  2303. // }
  2304. // },
  2305. // "path": "accounts/{accountId}/preferreddeals",
  2306. // "response": {
  2307. // "$ref": "PreferredDeals"
  2308. // },
  2309. // "scopes": [
  2310. // "https://www.googleapis.com/auth/adexchange.seller",
  2311. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2312. // ]
  2313. // }
  2314. }
  2315. // method id "adexchangeseller.accounts.reports.generate":
  2316. type AccountsReportsGenerateCall struct {
  2317. s *Service
  2318. accountId string
  2319. urlParams_ gensupport.URLParams
  2320. ifNoneMatch_ string
  2321. ctx_ context.Context
  2322. header_ http.Header
  2323. }
  2324. // Generate: Generate an Ad Exchange report based on the report request
  2325. // sent in the query parameters. Returns the result as JSON; to retrieve
  2326. // output in CSV format specify "alt=csv" as a query parameter.
  2327. func (r *AccountsReportsService) Generate(accountId string, startDate string, endDate string) *AccountsReportsGenerateCall {
  2328. c := &AccountsReportsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2329. c.accountId = accountId
  2330. c.urlParams_.Set("startDate", startDate)
  2331. c.urlParams_.Set("endDate", endDate)
  2332. return c
  2333. }
  2334. // Dimension sets the optional parameter "dimension": Dimensions to base
  2335. // the report on.
  2336. func (c *AccountsReportsGenerateCall) Dimension(dimension ...string) *AccountsReportsGenerateCall {
  2337. c.urlParams_.SetMulti("dimension", append([]string{}, dimension...))
  2338. return c
  2339. }
  2340. // Filter sets the optional parameter "filter": Filters to be run on the
  2341. // report.
  2342. func (c *AccountsReportsGenerateCall) Filter(filter ...string) *AccountsReportsGenerateCall {
  2343. c.urlParams_.SetMulti("filter", append([]string{}, filter...))
  2344. return c
  2345. }
  2346. // Locale sets the optional parameter "locale": Optional locale to use
  2347. // for translating report output to a local language. Defaults to
  2348. // "en_US" if not specified.
  2349. func (c *AccountsReportsGenerateCall) Locale(locale string) *AccountsReportsGenerateCall {
  2350. c.urlParams_.Set("locale", locale)
  2351. return c
  2352. }
  2353. // MaxResults sets the optional parameter "maxResults": The maximum
  2354. // number of rows of report data to return.
  2355. func (c *AccountsReportsGenerateCall) MaxResults(maxResults int64) *AccountsReportsGenerateCall {
  2356. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2357. return c
  2358. }
  2359. // Metric sets the optional parameter "metric": Numeric columns to
  2360. // include in the report.
  2361. func (c *AccountsReportsGenerateCall) Metric(metric ...string) *AccountsReportsGenerateCall {
  2362. c.urlParams_.SetMulti("metric", append([]string{}, metric...))
  2363. return c
  2364. }
  2365. // Sort sets the optional parameter "sort": The name of a dimension or
  2366. // metric to sort the resulting report on, optionally prefixed with "+"
  2367. // to sort ascending or "-" to sort descending. If no prefix is
  2368. // specified, the column is sorted ascending.
  2369. func (c *AccountsReportsGenerateCall) Sort(sort ...string) *AccountsReportsGenerateCall {
  2370. c.urlParams_.SetMulti("sort", append([]string{}, sort...))
  2371. return c
  2372. }
  2373. // StartIndex sets the optional parameter "startIndex": Index of the
  2374. // first row of report data to return.
  2375. func (c *AccountsReportsGenerateCall) StartIndex(startIndex int64) *AccountsReportsGenerateCall {
  2376. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  2377. return c
  2378. }
  2379. // Fields allows partial responses to be retrieved. See
  2380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2381. // for more information.
  2382. func (c *AccountsReportsGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsGenerateCall {
  2383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2384. return c
  2385. }
  2386. // IfNoneMatch sets the optional parameter which makes the operation
  2387. // fail if the object's ETag matches the given value. This is useful for
  2388. // getting updates only after the object has changed since the last
  2389. // request. Use googleapi.IsNotModified to check whether the response
  2390. // error from Do is the result of In-None-Match.
  2391. func (c *AccountsReportsGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsGenerateCall {
  2392. c.ifNoneMatch_ = entityTag
  2393. return c
  2394. }
  2395. // Context sets the context to be used in this call's Do and Download
  2396. // methods. Any pending HTTP request will be aborted if the provided
  2397. // context is canceled.
  2398. func (c *AccountsReportsGenerateCall) Context(ctx context.Context) *AccountsReportsGenerateCall {
  2399. c.ctx_ = ctx
  2400. return c
  2401. }
  2402. // Header returns an http.Header that can be modified by the caller to
  2403. // add HTTP headers to the request.
  2404. func (c *AccountsReportsGenerateCall) Header() http.Header {
  2405. if c.header_ == nil {
  2406. c.header_ = make(http.Header)
  2407. }
  2408. return c.header_
  2409. }
  2410. func (c *AccountsReportsGenerateCall) doRequest(alt string) (*http.Response, error) {
  2411. reqHeaders := make(http.Header)
  2412. for k, v := range c.header_ {
  2413. reqHeaders[k] = v
  2414. }
  2415. reqHeaders.Set("User-Agent", c.s.userAgent())
  2416. if c.ifNoneMatch_ != "" {
  2417. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2418. }
  2419. var body io.Reader = nil
  2420. c.urlParams_.Set("alt", alt)
  2421. c.urlParams_.Set("prettyPrint", "false")
  2422. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports")
  2423. urls += "?" + c.urlParams_.Encode()
  2424. req, _ := http.NewRequest("GET", urls, body)
  2425. req.Header = reqHeaders
  2426. googleapi.Expand(req.URL, map[string]string{
  2427. "accountId": c.accountId,
  2428. })
  2429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2430. }
  2431. // Download fetches the API endpoint's "media" value, instead of the normal
  2432. // API response value. If the returned error is nil, the Response is guaranteed to
  2433. // have a 2xx status code. Callers must close the Response.Body as usual.
  2434. func (c *AccountsReportsGenerateCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  2435. gensupport.SetOptions(c.urlParams_, opts...)
  2436. res, err := c.doRequest("media")
  2437. if err != nil {
  2438. return nil, err
  2439. }
  2440. if err := googleapi.CheckMediaResponse(res); err != nil {
  2441. res.Body.Close()
  2442. return nil, err
  2443. }
  2444. return res, nil
  2445. }
  2446. // Do executes the "adexchangeseller.accounts.reports.generate" call.
  2447. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  2448. // code is an error. Response headers are in either
  2449. // *Report.ServerResponse.Header or (if a response was returned at all)
  2450. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2451. // check whether the returned error was because http.StatusNotModified
  2452. // was returned.
  2453. func (c *AccountsReportsGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  2454. gensupport.SetOptions(c.urlParams_, opts...)
  2455. res, err := c.doRequest("json")
  2456. if res != nil && res.StatusCode == http.StatusNotModified {
  2457. if res.Body != nil {
  2458. res.Body.Close()
  2459. }
  2460. return nil, &googleapi.Error{
  2461. Code: res.StatusCode,
  2462. Header: res.Header,
  2463. }
  2464. }
  2465. if err != nil {
  2466. return nil, err
  2467. }
  2468. defer googleapi.CloseBody(res)
  2469. if err := googleapi.CheckResponse(res); err != nil {
  2470. return nil, err
  2471. }
  2472. ret := &Report{
  2473. ServerResponse: googleapi.ServerResponse{
  2474. Header: res.Header,
  2475. HTTPStatusCode: res.StatusCode,
  2476. },
  2477. }
  2478. target := &ret
  2479. if err := gensupport.DecodeResponse(target, res); err != nil {
  2480. return nil, err
  2481. }
  2482. return ret, nil
  2483. // {
  2484. // "description": "Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify \"alt=csv\" as a query parameter.",
  2485. // "httpMethod": "GET",
  2486. // "id": "adexchangeseller.accounts.reports.generate",
  2487. // "parameterOrder": [
  2488. // "accountId",
  2489. // "startDate",
  2490. // "endDate"
  2491. // ],
  2492. // "parameters": {
  2493. // "accountId": {
  2494. // "description": "Account which owns the generated report.",
  2495. // "location": "path",
  2496. // "required": true,
  2497. // "type": "string"
  2498. // },
  2499. // "dimension": {
  2500. // "description": "Dimensions to base the report on.",
  2501. // "location": "query",
  2502. // "pattern": "[a-zA-Z_]+",
  2503. // "repeated": true,
  2504. // "type": "string"
  2505. // },
  2506. // "endDate": {
  2507. // "description": "End of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  2508. // "location": "query",
  2509. // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  2510. // "required": true,
  2511. // "type": "string"
  2512. // },
  2513. // "filter": {
  2514. // "description": "Filters to be run on the report.",
  2515. // "location": "query",
  2516. // "pattern": "[a-zA-Z_]+(==|=@).+",
  2517. // "repeated": true,
  2518. // "type": "string"
  2519. // },
  2520. // "locale": {
  2521. // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  2522. // "location": "query",
  2523. // "pattern": "[a-zA-Z_]+",
  2524. // "type": "string"
  2525. // },
  2526. // "maxResults": {
  2527. // "description": "The maximum number of rows of report data to return.",
  2528. // "format": "uint32",
  2529. // "location": "query",
  2530. // "maximum": "50000",
  2531. // "minimum": "0",
  2532. // "type": "integer"
  2533. // },
  2534. // "metric": {
  2535. // "description": "Numeric columns to include in the report.",
  2536. // "location": "query",
  2537. // "pattern": "[a-zA-Z_]+",
  2538. // "repeated": true,
  2539. // "type": "string"
  2540. // },
  2541. // "sort": {
  2542. // "description": "The name of a dimension or metric to sort the resulting report on, optionally prefixed with \"+\" to sort ascending or \"-\" to sort descending. If no prefix is specified, the column is sorted ascending.",
  2543. // "location": "query",
  2544. // "pattern": "(\\+|-)?[a-zA-Z_]+",
  2545. // "repeated": true,
  2546. // "type": "string"
  2547. // },
  2548. // "startDate": {
  2549. // "description": "Start of the date range to report on in \"YYYY-MM-DD\" format, inclusive.",
  2550. // "location": "query",
  2551. // "pattern": "\\d{4}-\\d{2}-\\d{2}|(today|startOfMonth|startOfYear)(([\\-\\+]\\d+[dwmy]){0,3}?)",
  2552. // "required": true,
  2553. // "type": "string"
  2554. // },
  2555. // "startIndex": {
  2556. // "description": "Index of the first row of report data to return.",
  2557. // "format": "uint32",
  2558. // "location": "query",
  2559. // "maximum": "5000",
  2560. // "minimum": "0",
  2561. // "type": "integer"
  2562. // }
  2563. // },
  2564. // "path": "accounts/{accountId}/reports",
  2565. // "response": {
  2566. // "$ref": "Report"
  2567. // },
  2568. // "scopes": [
  2569. // "https://www.googleapis.com/auth/adexchange.seller",
  2570. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2571. // ],
  2572. // "supportsMediaDownload": true
  2573. // }
  2574. }
  2575. // method id "adexchangeseller.accounts.reports.saved.generate":
  2576. type AccountsReportsSavedGenerateCall struct {
  2577. s *Service
  2578. accountId string
  2579. savedReportId string
  2580. urlParams_ gensupport.URLParams
  2581. ifNoneMatch_ string
  2582. ctx_ context.Context
  2583. header_ http.Header
  2584. }
  2585. // Generate: Generate an Ad Exchange report based on the saved report ID
  2586. // sent in the query parameters.
  2587. func (r *AccountsReportsSavedService) Generate(accountId string, savedReportId string) *AccountsReportsSavedGenerateCall {
  2588. c := &AccountsReportsSavedGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2589. c.accountId = accountId
  2590. c.savedReportId = savedReportId
  2591. return c
  2592. }
  2593. // Locale sets the optional parameter "locale": Optional locale to use
  2594. // for translating report output to a local language. Defaults to
  2595. // "en_US" if not specified.
  2596. func (c *AccountsReportsSavedGenerateCall) Locale(locale string) *AccountsReportsSavedGenerateCall {
  2597. c.urlParams_.Set("locale", locale)
  2598. return c
  2599. }
  2600. // MaxResults sets the optional parameter "maxResults": The maximum
  2601. // number of rows of report data to return.
  2602. func (c *AccountsReportsSavedGenerateCall) MaxResults(maxResults int64) *AccountsReportsSavedGenerateCall {
  2603. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2604. return c
  2605. }
  2606. // StartIndex sets the optional parameter "startIndex": Index of the
  2607. // first row of report data to return.
  2608. func (c *AccountsReportsSavedGenerateCall) StartIndex(startIndex int64) *AccountsReportsSavedGenerateCall {
  2609. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  2610. return c
  2611. }
  2612. // Fields allows partial responses to be retrieved. See
  2613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2614. // for more information.
  2615. func (c *AccountsReportsSavedGenerateCall) Fields(s ...googleapi.Field) *AccountsReportsSavedGenerateCall {
  2616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2617. return c
  2618. }
  2619. // IfNoneMatch sets the optional parameter which makes the operation
  2620. // fail if the object's ETag matches the given value. This is useful for
  2621. // getting updates only after the object has changed since the last
  2622. // request. Use googleapi.IsNotModified to check whether the response
  2623. // error from Do is the result of In-None-Match.
  2624. func (c *AccountsReportsSavedGenerateCall) IfNoneMatch(entityTag string) *AccountsReportsSavedGenerateCall {
  2625. c.ifNoneMatch_ = entityTag
  2626. return c
  2627. }
  2628. // Context sets the context to be used in this call's Do method. Any
  2629. // pending HTTP request will be aborted if the provided context is
  2630. // canceled.
  2631. func (c *AccountsReportsSavedGenerateCall) Context(ctx context.Context) *AccountsReportsSavedGenerateCall {
  2632. c.ctx_ = ctx
  2633. return c
  2634. }
  2635. // Header returns an http.Header that can be modified by the caller to
  2636. // add HTTP headers to the request.
  2637. func (c *AccountsReportsSavedGenerateCall) Header() http.Header {
  2638. if c.header_ == nil {
  2639. c.header_ = make(http.Header)
  2640. }
  2641. return c.header_
  2642. }
  2643. func (c *AccountsReportsSavedGenerateCall) doRequest(alt string) (*http.Response, error) {
  2644. reqHeaders := make(http.Header)
  2645. for k, v := range c.header_ {
  2646. reqHeaders[k] = v
  2647. }
  2648. reqHeaders.Set("User-Agent", c.s.userAgent())
  2649. if c.ifNoneMatch_ != "" {
  2650. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2651. }
  2652. var body io.Reader = nil
  2653. c.urlParams_.Set("alt", alt)
  2654. c.urlParams_.Set("prettyPrint", "false")
  2655. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/{savedReportId}")
  2656. urls += "?" + c.urlParams_.Encode()
  2657. req, _ := http.NewRequest("GET", urls, body)
  2658. req.Header = reqHeaders
  2659. googleapi.Expand(req.URL, map[string]string{
  2660. "accountId": c.accountId,
  2661. "savedReportId": c.savedReportId,
  2662. })
  2663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2664. }
  2665. // Do executes the "adexchangeseller.accounts.reports.saved.generate" call.
  2666. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  2667. // code is an error. Response headers are in either
  2668. // *Report.ServerResponse.Header or (if a response was returned at all)
  2669. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2670. // check whether the returned error was because http.StatusNotModified
  2671. // was returned.
  2672. func (c *AccountsReportsSavedGenerateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  2673. gensupport.SetOptions(c.urlParams_, opts...)
  2674. res, err := c.doRequest("json")
  2675. if res != nil && res.StatusCode == http.StatusNotModified {
  2676. if res.Body != nil {
  2677. res.Body.Close()
  2678. }
  2679. return nil, &googleapi.Error{
  2680. Code: res.StatusCode,
  2681. Header: res.Header,
  2682. }
  2683. }
  2684. if err != nil {
  2685. return nil, err
  2686. }
  2687. defer googleapi.CloseBody(res)
  2688. if err := googleapi.CheckResponse(res); err != nil {
  2689. return nil, err
  2690. }
  2691. ret := &Report{
  2692. ServerResponse: googleapi.ServerResponse{
  2693. Header: res.Header,
  2694. HTTPStatusCode: res.StatusCode,
  2695. },
  2696. }
  2697. target := &ret
  2698. if err := gensupport.DecodeResponse(target, res); err != nil {
  2699. return nil, err
  2700. }
  2701. return ret, nil
  2702. // {
  2703. // "description": "Generate an Ad Exchange report based on the saved report ID sent in the query parameters.",
  2704. // "httpMethod": "GET",
  2705. // "id": "adexchangeseller.accounts.reports.saved.generate",
  2706. // "parameterOrder": [
  2707. // "accountId",
  2708. // "savedReportId"
  2709. // ],
  2710. // "parameters": {
  2711. // "accountId": {
  2712. // "description": "Account owning the saved report.",
  2713. // "location": "path",
  2714. // "required": true,
  2715. // "type": "string"
  2716. // },
  2717. // "locale": {
  2718. // "description": "Optional locale to use for translating report output to a local language. Defaults to \"en_US\" if not specified.",
  2719. // "location": "query",
  2720. // "pattern": "[a-zA-Z_]+",
  2721. // "type": "string"
  2722. // },
  2723. // "maxResults": {
  2724. // "description": "The maximum number of rows of report data to return.",
  2725. // "format": "int32",
  2726. // "location": "query",
  2727. // "maximum": "50000",
  2728. // "minimum": "0",
  2729. // "type": "integer"
  2730. // },
  2731. // "savedReportId": {
  2732. // "description": "The saved report to retrieve.",
  2733. // "location": "path",
  2734. // "required": true,
  2735. // "type": "string"
  2736. // },
  2737. // "startIndex": {
  2738. // "description": "Index of the first row of report data to return.",
  2739. // "format": "int32",
  2740. // "location": "query",
  2741. // "maximum": "5000",
  2742. // "minimum": "0",
  2743. // "type": "integer"
  2744. // }
  2745. // },
  2746. // "path": "accounts/{accountId}/reports/{savedReportId}",
  2747. // "response": {
  2748. // "$ref": "Report"
  2749. // },
  2750. // "scopes": [
  2751. // "https://www.googleapis.com/auth/adexchange.seller",
  2752. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2753. // ]
  2754. // }
  2755. }
  2756. // method id "adexchangeseller.accounts.reports.saved.list":
  2757. type AccountsReportsSavedListCall struct {
  2758. s *Service
  2759. accountId string
  2760. urlParams_ gensupport.URLParams
  2761. ifNoneMatch_ string
  2762. ctx_ context.Context
  2763. header_ http.Header
  2764. }
  2765. // List: List all saved reports in this Ad Exchange account.
  2766. func (r *AccountsReportsSavedService) List(accountId string) *AccountsReportsSavedListCall {
  2767. c := &AccountsReportsSavedListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2768. c.accountId = accountId
  2769. return c
  2770. }
  2771. // MaxResults sets the optional parameter "maxResults": The maximum
  2772. // number of saved reports to include in the response, used for paging.
  2773. func (c *AccountsReportsSavedListCall) MaxResults(maxResults int64) *AccountsReportsSavedListCall {
  2774. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2775. return c
  2776. }
  2777. // PageToken sets the optional parameter "pageToken": A continuation
  2778. // token, used to page through saved reports. To retrieve the next page,
  2779. // set this parameter to the value of "nextPageToken" from the previous
  2780. // response.
  2781. func (c *AccountsReportsSavedListCall) PageToken(pageToken string) *AccountsReportsSavedListCall {
  2782. c.urlParams_.Set("pageToken", pageToken)
  2783. return c
  2784. }
  2785. // Fields allows partial responses to be retrieved. See
  2786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2787. // for more information.
  2788. func (c *AccountsReportsSavedListCall) Fields(s ...googleapi.Field) *AccountsReportsSavedListCall {
  2789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2790. return c
  2791. }
  2792. // IfNoneMatch sets the optional parameter which makes the operation
  2793. // fail if the object's ETag matches the given value. This is useful for
  2794. // getting updates only after the object has changed since the last
  2795. // request. Use googleapi.IsNotModified to check whether the response
  2796. // error from Do is the result of In-None-Match.
  2797. func (c *AccountsReportsSavedListCall) IfNoneMatch(entityTag string) *AccountsReportsSavedListCall {
  2798. c.ifNoneMatch_ = entityTag
  2799. return c
  2800. }
  2801. // Context sets the context to be used in this call's Do method. Any
  2802. // pending HTTP request will be aborted if the provided context is
  2803. // canceled.
  2804. func (c *AccountsReportsSavedListCall) Context(ctx context.Context) *AccountsReportsSavedListCall {
  2805. c.ctx_ = ctx
  2806. return c
  2807. }
  2808. // Header returns an http.Header that can be modified by the caller to
  2809. // add HTTP headers to the request.
  2810. func (c *AccountsReportsSavedListCall) Header() http.Header {
  2811. if c.header_ == nil {
  2812. c.header_ = make(http.Header)
  2813. }
  2814. return c.header_
  2815. }
  2816. func (c *AccountsReportsSavedListCall) doRequest(alt string) (*http.Response, error) {
  2817. reqHeaders := make(http.Header)
  2818. for k, v := range c.header_ {
  2819. reqHeaders[k] = v
  2820. }
  2821. reqHeaders.Set("User-Agent", c.s.userAgent())
  2822. if c.ifNoneMatch_ != "" {
  2823. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2824. }
  2825. var body io.Reader = nil
  2826. c.urlParams_.Set("alt", alt)
  2827. c.urlParams_.Set("prettyPrint", "false")
  2828. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/reports/saved")
  2829. urls += "?" + c.urlParams_.Encode()
  2830. req, _ := http.NewRequest("GET", urls, body)
  2831. req.Header = reqHeaders
  2832. googleapi.Expand(req.URL, map[string]string{
  2833. "accountId": c.accountId,
  2834. })
  2835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2836. }
  2837. // Do executes the "adexchangeseller.accounts.reports.saved.list" call.
  2838. // Exactly one of *SavedReports or error will be non-nil. Any non-2xx
  2839. // status code is an error. Response headers are in either
  2840. // *SavedReports.ServerResponse.Header or (if a response was returned at
  2841. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2842. // to check whether the returned error was because
  2843. // http.StatusNotModified was returned.
  2844. func (c *AccountsReportsSavedListCall) Do(opts ...googleapi.CallOption) (*SavedReports, error) {
  2845. gensupport.SetOptions(c.urlParams_, opts...)
  2846. res, err := c.doRequest("json")
  2847. if res != nil && res.StatusCode == http.StatusNotModified {
  2848. if res.Body != nil {
  2849. res.Body.Close()
  2850. }
  2851. return nil, &googleapi.Error{
  2852. Code: res.StatusCode,
  2853. Header: res.Header,
  2854. }
  2855. }
  2856. if err != nil {
  2857. return nil, err
  2858. }
  2859. defer googleapi.CloseBody(res)
  2860. if err := googleapi.CheckResponse(res); err != nil {
  2861. return nil, err
  2862. }
  2863. ret := &SavedReports{
  2864. ServerResponse: googleapi.ServerResponse{
  2865. Header: res.Header,
  2866. HTTPStatusCode: res.StatusCode,
  2867. },
  2868. }
  2869. target := &ret
  2870. if err := gensupport.DecodeResponse(target, res); err != nil {
  2871. return nil, err
  2872. }
  2873. return ret, nil
  2874. // {
  2875. // "description": "List all saved reports in this Ad Exchange account.",
  2876. // "httpMethod": "GET",
  2877. // "id": "adexchangeseller.accounts.reports.saved.list",
  2878. // "parameterOrder": [
  2879. // "accountId"
  2880. // ],
  2881. // "parameters": {
  2882. // "accountId": {
  2883. // "description": "Account owning the saved reports.",
  2884. // "location": "path",
  2885. // "required": true,
  2886. // "type": "string"
  2887. // },
  2888. // "maxResults": {
  2889. // "description": "The maximum number of saved reports to include in the response, used for paging.",
  2890. // "format": "int32",
  2891. // "location": "query",
  2892. // "maximum": "100",
  2893. // "minimum": "0",
  2894. // "type": "integer"
  2895. // },
  2896. // "pageToken": {
  2897. // "description": "A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  2898. // "location": "query",
  2899. // "type": "string"
  2900. // }
  2901. // },
  2902. // "path": "accounts/{accountId}/reports/saved",
  2903. // "response": {
  2904. // "$ref": "SavedReports"
  2905. // },
  2906. // "scopes": [
  2907. // "https://www.googleapis.com/auth/adexchange.seller",
  2908. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  2909. // ]
  2910. // }
  2911. }
  2912. // Pages invokes f for each page of results.
  2913. // A non-nil error returned from f will halt the iteration.
  2914. // The provided context supersedes any context provided to the Context method.
  2915. func (c *AccountsReportsSavedListCall) Pages(ctx context.Context, f func(*SavedReports) error) error {
  2916. c.ctx_ = ctx
  2917. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2918. for {
  2919. x, err := c.Do()
  2920. if err != nil {
  2921. return err
  2922. }
  2923. if err := f(x); err != nil {
  2924. return err
  2925. }
  2926. if x.NextPageToken == "" {
  2927. return nil
  2928. }
  2929. c.PageToken(x.NextPageToken)
  2930. }
  2931. }
  2932. // method id "adexchangeseller.accounts.urlchannels.list":
  2933. type AccountsUrlchannelsListCall struct {
  2934. s *Service
  2935. accountId string
  2936. adClientId string
  2937. urlParams_ gensupport.URLParams
  2938. ifNoneMatch_ string
  2939. ctx_ context.Context
  2940. header_ http.Header
  2941. }
  2942. // List: List all URL channels in the specified ad client for this Ad
  2943. // Exchange account.
  2944. func (r *AccountsUrlchannelsService) List(accountId string, adClientId string) *AccountsUrlchannelsListCall {
  2945. c := &AccountsUrlchannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2946. c.accountId = accountId
  2947. c.adClientId = adClientId
  2948. return c
  2949. }
  2950. // MaxResults sets the optional parameter "maxResults": The maximum
  2951. // number of URL channels to include in the response, used for paging.
  2952. func (c *AccountsUrlchannelsListCall) MaxResults(maxResults int64) *AccountsUrlchannelsListCall {
  2953. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2954. return c
  2955. }
  2956. // PageToken sets the optional parameter "pageToken": A continuation
  2957. // token, used to page through URL channels. To retrieve the next page,
  2958. // set this parameter to the value of "nextPageToken" from the previous
  2959. // response.
  2960. func (c *AccountsUrlchannelsListCall) PageToken(pageToken string) *AccountsUrlchannelsListCall {
  2961. c.urlParams_.Set("pageToken", pageToken)
  2962. return c
  2963. }
  2964. // Fields allows partial responses to be retrieved. See
  2965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2966. // for more information.
  2967. func (c *AccountsUrlchannelsListCall) Fields(s ...googleapi.Field) *AccountsUrlchannelsListCall {
  2968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2969. return c
  2970. }
  2971. // IfNoneMatch sets the optional parameter which makes the operation
  2972. // fail if the object's ETag matches the given value. This is useful for
  2973. // getting updates only after the object has changed since the last
  2974. // request. Use googleapi.IsNotModified to check whether the response
  2975. // error from Do is the result of In-None-Match.
  2976. func (c *AccountsUrlchannelsListCall) IfNoneMatch(entityTag string) *AccountsUrlchannelsListCall {
  2977. c.ifNoneMatch_ = entityTag
  2978. return c
  2979. }
  2980. // Context sets the context to be used in this call's Do method. Any
  2981. // pending HTTP request will be aborted if the provided context is
  2982. // canceled.
  2983. func (c *AccountsUrlchannelsListCall) Context(ctx context.Context) *AccountsUrlchannelsListCall {
  2984. c.ctx_ = ctx
  2985. return c
  2986. }
  2987. // Header returns an http.Header that can be modified by the caller to
  2988. // add HTTP headers to the request.
  2989. func (c *AccountsUrlchannelsListCall) Header() http.Header {
  2990. if c.header_ == nil {
  2991. c.header_ = make(http.Header)
  2992. }
  2993. return c.header_
  2994. }
  2995. func (c *AccountsUrlchannelsListCall) doRequest(alt string) (*http.Response, error) {
  2996. reqHeaders := make(http.Header)
  2997. for k, v := range c.header_ {
  2998. reqHeaders[k] = v
  2999. }
  3000. reqHeaders.Set("User-Agent", c.s.userAgent())
  3001. if c.ifNoneMatch_ != "" {
  3002. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3003. }
  3004. var body io.Reader = nil
  3005. c.urlParams_.Set("alt", alt)
  3006. c.urlParams_.Set("prettyPrint", "false")
  3007. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{accountId}/adclients/{adClientId}/urlchannels")
  3008. urls += "?" + c.urlParams_.Encode()
  3009. req, _ := http.NewRequest("GET", urls, body)
  3010. req.Header = reqHeaders
  3011. googleapi.Expand(req.URL, map[string]string{
  3012. "accountId": c.accountId,
  3013. "adClientId": c.adClientId,
  3014. })
  3015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3016. }
  3017. // Do executes the "adexchangeseller.accounts.urlchannels.list" call.
  3018. // Exactly one of *UrlChannels or error will be non-nil. Any non-2xx
  3019. // status code is an error. Response headers are in either
  3020. // *UrlChannels.ServerResponse.Header or (if a response was returned at
  3021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3022. // to check whether the returned error was because
  3023. // http.StatusNotModified was returned.
  3024. func (c *AccountsUrlchannelsListCall) Do(opts ...googleapi.CallOption) (*UrlChannels, error) {
  3025. gensupport.SetOptions(c.urlParams_, opts...)
  3026. res, err := c.doRequest("json")
  3027. if res != nil && res.StatusCode == http.StatusNotModified {
  3028. if res.Body != nil {
  3029. res.Body.Close()
  3030. }
  3031. return nil, &googleapi.Error{
  3032. Code: res.StatusCode,
  3033. Header: res.Header,
  3034. }
  3035. }
  3036. if err != nil {
  3037. return nil, err
  3038. }
  3039. defer googleapi.CloseBody(res)
  3040. if err := googleapi.CheckResponse(res); err != nil {
  3041. return nil, err
  3042. }
  3043. ret := &UrlChannels{
  3044. ServerResponse: googleapi.ServerResponse{
  3045. Header: res.Header,
  3046. HTTPStatusCode: res.StatusCode,
  3047. },
  3048. }
  3049. target := &ret
  3050. if err := gensupport.DecodeResponse(target, res); err != nil {
  3051. return nil, err
  3052. }
  3053. return ret, nil
  3054. // {
  3055. // "description": "List all URL channels in the specified ad client for this Ad Exchange account.",
  3056. // "httpMethod": "GET",
  3057. // "id": "adexchangeseller.accounts.urlchannels.list",
  3058. // "parameterOrder": [
  3059. // "accountId",
  3060. // "adClientId"
  3061. // ],
  3062. // "parameters": {
  3063. // "accountId": {
  3064. // "description": "Account to which the ad client belongs.",
  3065. // "location": "path",
  3066. // "required": true,
  3067. // "type": "string"
  3068. // },
  3069. // "adClientId": {
  3070. // "description": "Ad client for which to list URL channels.",
  3071. // "location": "path",
  3072. // "required": true,
  3073. // "type": "string"
  3074. // },
  3075. // "maxResults": {
  3076. // "description": "The maximum number of URL channels to include in the response, used for paging.",
  3077. // "format": "uint32",
  3078. // "location": "query",
  3079. // "maximum": "10000",
  3080. // "minimum": "0",
  3081. // "type": "integer"
  3082. // },
  3083. // "pageToken": {
  3084. // "description": "A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response.",
  3085. // "location": "query",
  3086. // "type": "string"
  3087. // }
  3088. // },
  3089. // "path": "accounts/{accountId}/adclients/{adClientId}/urlchannels",
  3090. // "response": {
  3091. // "$ref": "UrlChannels"
  3092. // },
  3093. // "scopes": [
  3094. // "https://www.googleapis.com/auth/adexchange.seller",
  3095. // "https://www.googleapis.com/auth/adexchange.seller.readonly"
  3096. // ]
  3097. // }
  3098. }
  3099. // Pages invokes f for each page of results.
  3100. // A non-nil error returned from f will halt the iteration.
  3101. // The provided context supersedes any context provided to the Context method.
  3102. func (c *AccountsUrlchannelsListCall) Pages(ctx context.Context, f func(*UrlChannels) error) error {
  3103. c.ctx_ = ctx
  3104. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3105. for {
  3106. x, err := c.Do()
  3107. if err != nil {
  3108. return err
  3109. }
  3110. if err := f(x); err != nil {
  3111. return err
  3112. }
  3113. if x.NextPageToken == "" {
  3114. return nil
  3115. }
  3116. c.PageToken(x.NextPageToken)
  3117. }
  3118. }