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.

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