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.
 
 
 

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