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.
 
 
 

3982 lines
133 KiB

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