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.
 
 
 

11724 lines
436 KiB

  1. // Package adexchangebuyer2 provides access to the Ad Exchange Buyer API II.
  2. //
  3. // See https://developers.google.com/ad-exchange/buyer-rest/reference/rest/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/adexchangebuyer2/v2beta1"
  8. // ...
  9. // adexchangebuyer2Service, err := adexchangebuyer2.New(oauthHttpClient)
  10. package adexchangebuyer2 // import "google.golang.org/api/adexchangebuyer2/v2beta1"
  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 = "adexchangebuyer2:v2beta1"
  41. const apiName = "adexchangebuyer2"
  42. const apiVersion = "v2beta1"
  43. const basePath = "https://adexchangebuyer.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your Ad Exchange buyer account configuration
  47. AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Accounts = NewAccountsService(s)
  55. s.Bidders = NewBiddersService(s)
  56. return s, nil
  57. }
  58. type Service struct {
  59. client *http.Client
  60. BasePath string // API endpoint base URL
  61. UserAgent string // optional additional User-Agent fragment
  62. Accounts *AccountsService
  63. Bidders *BiddersService
  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.Clients = NewAccountsClientsService(s)
  74. rs.Creatives = NewAccountsCreativesService(s)
  75. return rs
  76. }
  77. type AccountsService struct {
  78. s *Service
  79. Clients *AccountsClientsService
  80. Creatives *AccountsCreativesService
  81. }
  82. func NewAccountsClientsService(s *Service) *AccountsClientsService {
  83. rs := &AccountsClientsService{s: s}
  84. rs.Invitations = NewAccountsClientsInvitationsService(s)
  85. rs.Users = NewAccountsClientsUsersService(s)
  86. return rs
  87. }
  88. type AccountsClientsService struct {
  89. s *Service
  90. Invitations *AccountsClientsInvitationsService
  91. Users *AccountsClientsUsersService
  92. }
  93. func NewAccountsClientsInvitationsService(s *Service) *AccountsClientsInvitationsService {
  94. rs := &AccountsClientsInvitationsService{s: s}
  95. return rs
  96. }
  97. type AccountsClientsInvitationsService struct {
  98. s *Service
  99. }
  100. func NewAccountsClientsUsersService(s *Service) *AccountsClientsUsersService {
  101. rs := &AccountsClientsUsersService{s: s}
  102. return rs
  103. }
  104. type AccountsClientsUsersService struct {
  105. s *Service
  106. }
  107. func NewAccountsCreativesService(s *Service) *AccountsCreativesService {
  108. rs := &AccountsCreativesService{s: s}
  109. rs.DealAssociations = NewAccountsCreativesDealAssociationsService(s)
  110. return rs
  111. }
  112. type AccountsCreativesService struct {
  113. s *Service
  114. DealAssociations *AccountsCreativesDealAssociationsService
  115. }
  116. func NewAccountsCreativesDealAssociationsService(s *Service) *AccountsCreativesDealAssociationsService {
  117. rs := &AccountsCreativesDealAssociationsService{s: s}
  118. return rs
  119. }
  120. type AccountsCreativesDealAssociationsService struct {
  121. s *Service
  122. }
  123. func NewBiddersService(s *Service) *BiddersService {
  124. rs := &BiddersService{s: s}
  125. rs.Accounts = NewBiddersAccountsService(s)
  126. rs.FilterSets = NewBiddersFilterSetsService(s)
  127. return rs
  128. }
  129. type BiddersService struct {
  130. s *Service
  131. Accounts *BiddersAccountsService
  132. FilterSets *BiddersFilterSetsService
  133. }
  134. func NewBiddersAccountsService(s *Service) *BiddersAccountsService {
  135. rs := &BiddersAccountsService{s: s}
  136. rs.FilterSets = NewBiddersAccountsFilterSetsService(s)
  137. return rs
  138. }
  139. type BiddersAccountsService struct {
  140. s *Service
  141. FilterSets *BiddersAccountsFilterSetsService
  142. }
  143. func NewBiddersAccountsFilterSetsService(s *Service) *BiddersAccountsFilterSetsService {
  144. rs := &BiddersAccountsFilterSetsService{s: s}
  145. rs.BidMetrics = NewBiddersAccountsFilterSetsBidMetricsService(s)
  146. rs.BidResponseErrors = NewBiddersAccountsFilterSetsBidResponseErrorsService(s)
  147. rs.BidResponsesWithoutBids = NewBiddersAccountsFilterSetsBidResponsesWithoutBidsService(s)
  148. rs.FilteredBidRequests = NewBiddersAccountsFilterSetsFilteredBidRequestsService(s)
  149. rs.FilteredBids = NewBiddersAccountsFilterSetsFilteredBidsService(s)
  150. rs.ImpressionMetrics = NewBiddersAccountsFilterSetsImpressionMetricsService(s)
  151. rs.LosingBids = NewBiddersAccountsFilterSetsLosingBidsService(s)
  152. rs.NonBillableWinningBids = NewBiddersAccountsFilterSetsNonBillableWinningBidsService(s)
  153. return rs
  154. }
  155. type BiddersAccountsFilterSetsService struct {
  156. s *Service
  157. BidMetrics *BiddersAccountsFilterSetsBidMetricsService
  158. BidResponseErrors *BiddersAccountsFilterSetsBidResponseErrorsService
  159. BidResponsesWithoutBids *BiddersAccountsFilterSetsBidResponsesWithoutBidsService
  160. FilteredBidRequests *BiddersAccountsFilterSetsFilteredBidRequestsService
  161. FilteredBids *BiddersAccountsFilterSetsFilteredBidsService
  162. ImpressionMetrics *BiddersAccountsFilterSetsImpressionMetricsService
  163. LosingBids *BiddersAccountsFilterSetsLosingBidsService
  164. NonBillableWinningBids *BiddersAccountsFilterSetsNonBillableWinningBidsService
  165. }
  166. func NewBiddersAccountsFilterSetsBidMetricsService(s *Service) *BiddersAccountsFilterSetsBidMetricsService {
  167. rs := &BiddersAccountsFilterSetsBidMetricsService{s: s}
  168. return rs
  169. }
  170. type BiddersAccountsFilterSetsBidMetricsService struct {
  171. s *Service
  172. }
  173. func NewBiddersAccountsFilterSetsBidResponseErrorsService(s *Service) *BiddersAccountsFilterSetsBidResponseErrorsService {
  174. rs := &BiddersAccountsFilterSetsBidResponseErrorsService{s: s}
  175. return rs
  176. }
  177. type BiddersAccountsFilterSetsBidResponseErrorsService struct {
  178. s *Service
  179. }
  180. func NewBiddersAccountsFilterSetsBidResponsesWithoutBidsService(s *Service) *BiddersAccountsFilterSetsBidResponsesWithoutBidsService {
  181. rs := &BiddersAccountsFilterSetsBidResponsesWithoutBidsService{s: s}
  182. return rs
  183. }
  184. type BiddersAccountsFilterSetsBidResponsesWithoutBidsService struct {
  185. s *Service
  186. }
  187. func NewBiddersAccountsFilterSetsFilteredBidRequestsService(s *Service) *BiddersAccountsFilterSetsFilteredBidRequestsService {
  188. rs := &BiddersAccountsFilterSetsFilteredBidRequestsService{s: s}
  189. return rs
  190. }
  191. type BiddersAccountsFilterSetsFilteredBidRequestsService struct {
  192. s *Service
  193. }
  194. func NewBiddersAccountsFilterSetsFilteredBidsService(s *Service) *BiddersAccountsFilterSetsFilteredBidsService {
  195. rs := &BiddersAccountsFilterSetsFilteredBidsService{s: s}
  196. rs.Creatives = NewBiddersAccountsFilterSetsFilteredBidsCreativesService(s)
  197. rs.Details = NewBiddersAccountsFilterSetsFilteredBidsDetailsService(s)
  198. return rs
  199. }
  200. type BiddersAccountsFilterSetsFilteredBidsService struct {
  201. s *Service
  202. Creatives *BiddersAccountsFilterSetsFilteredBidsCreativesService
  203. Details *BiddersAccountsFilterSetsFilteredBidsDetailsService
  204. }
  205. func NewBiddersAccountsFilterSetsFilteredBidsCreativesService(s *Service) *BiddersAccountsFilterSetsFilteredBidsCreativesService {
  206. rs := &BiddersAccountsFilterSetsFilteredBidsCreativesService{s: s}
  207. return rs
  208. }
  209. type BiddersAccountsFilterSetsFilteredBidsCreativesService struct {
  210. s *Service
  211. }
  212. func NewBiddersAccountsFilterSetsFilteredBidsDetailsService(s *Service) *BiddersAccountsFilterSetsFilteredBidsDetailsService {
  213. rs := &BiddersAccountsFilterSetsFilteredBidsDetailsService{s: s}
  214. return rs
  215. }
  216. type BiddersAccountsFilterSetsFilteredBidsDetailsService struct {
  217. s *Service
  218. }
  219. func NewBiddersAccountsFilterSetsImpressionMetricsService(s *Service) *BiddersAccountsFilterSetsImpressionMetricsService {
  220. rs := &BiddersAccountsFilterSetsImpressionMetricsService{s: s}
  221. return rs
  222. }
  223. type BiddersAccountsFilterSetsImpressionMetricsService struct {
  224. s *Service
  225. }
  226. func NewBiddersAccountsFilterSetsLosingBidsService(s *Service) *BiddersAccountsFilterSetsLosingBidsService {
  227. rs := &BiddersAccountsFilterSetsLosingBidsService{s: s}
  228. return rs
  229. }
  230. type BiddersAccountsFilterSetsLosingBidsService struct {
  231. s *Service
  232. }
  233. func NewBiddersAccountsFilterSetsNonBillableWinningBidsService(s *Service) *BiddersAccountsFilterSetsNonBillableWinningBidsService {
  234. rs := &BiddersAccountsFilterSetsNonBillableWinningBidsService{s: s}
  235. return rs
  236. }
  237. type BiddersAccountsFilterSetsNonBillableWinningBidsService struct {
  238. s *Service
  239. }
  240. func NewBiddersFilterSetsService(s *Service) *BiddersFilterSetsService {
  241. rs := &BiddersFilterSetsService{s: s}
  242. rs.BidMetrics = NewBiddersFilterSetsBidMetricsService(s)
  243. rs.BidResponseErrors = NewBiddersFilterSetsBidResponseErrorsService(s)
  244. rs.BidResponsesWithoutBids = NewBiddersFilterSetsBidResponsesWithoutBidsService(s)
  245. rs.FilteredBidRequests = NewBiddersFilterSetsFilteredBidRequestsService(s)
  246. rs.FilteredBids = NewBiddersFilterSetsFilteredBidsService(s)
  247. rs.ImpressionMetrics = NewBiddersFilterSetsImpressionMetricsService(s)
  248. rs.LosingBids = NewBiddersFilterSetsLosingBidsService(s)
  249. rs.NonBillableWinningBids = NewBiddersFilterSetsNonBillableWinningBidsService(s)
  250. return rs
  251. }
  252. type BiddersFilterSetsService struct {
  253. s *Service
  254. BidMetrics *BiddersFilterSetsBidMetricsService
  255. BidResponseErrors *BiddersFilterSetsBidResponseErrorsService
  256. BidResponsesWithoutBids *BiddersFilterSetsBidResponsesWithoutBidsService
  257. FilteredBidRequests *BiddersFilterSetsFilteredBidRequestsService
  258. FilteredBids *BiddersFilterSetsFilteredBidsService
  259. ImpressionMetrics *BiddersFilterSetsImpressionMetricsService
  260. LosingBids *BiddersFilterSetsLosingBidsService
  261. NonBillableWinningBids *BiddersFilterSetsNonBillableWinningBidsService
  262. }
  263. func NewBiddersFilterSetsBidMetricsService(s *Service) *BiddersFilterSetsBidMetricsService {
  264. rs := &BiddersFilterSetsBidMetricsService{s: s}
  265. return rs
  266. }
  267. type BiddersFilterSetsBidMetricsService struct {
  268. s *Service
  269. }
  270. func NewBiddersFilterSetsBidResponseErrorsService(s *Service) *BiddersFilterSetsBidResponseErrorsService {
  271. rs := &BiddersFilterSetsBidResponseErrorsService{s: s}
  272. return rs
  273. }
  274. type BiddersFilterSetsBidResponseErrorsService struct {
  275. s *Service
  276. }
  277. func NewBiddersFilterSetsBidResponsesWithoutBidsService(s *Service) *BiddersFilterSetsBidResponsesWithoutBidsService {
  278. rs := &BiddersFilterSetsBidResponsesWithoutBidsService{s: s}
  279. return rs
  280. }
  281. type BiddersFilterSetsBidResponsesWithoutBidsService struct {
  282. s *Service
  283. }
  284. func NewBiddersFilterSetsFilteredBidRequestsService(s *Service) *BiddersFilterSetsFilteredBidRequestsService {
  285. rs := &BiddersFilterSetsFilteredBidRequestsService{s: s}
  286. return rs
  287. }
  288. type BiddersFilterSetsFilteredBidRequestsService struct {
  289. s *Service
  290. }
  291. func NewBiddersFilterSetsFilteredBidsService(s *Service) *BiddersFilterSetsFilteredBidsService {
  292. rs := &BiddersFilterSetsFilteredBidsService{s: s}
  293. rs.Creatives = NewBiddersFilterSetsFilteredBidsCreativesService(s)
  294. rs.Details = NewBiddersFilterSetsFilteredBidsDetailsService(s)
  295. return rs
  296. }
  297. type BiddersFilterSetsFilteredBidsService struct {
  298. s *Service
  299. Creatives *BiddersFilterSetsFilteredBidsCreativesService
  300. Details *BiddersFilterSetsFilteredBidsDetailsService
  301. }
  302. func NewBiddersFilterSetsFilteredBidsCreativesService(s *Service) *BiddersFilterSetsFilteredBidsCreativesService {
  303. rs := &BiddersFilterSetsFilteredBidsCreativesService{s: s}
  304. return rs
  305. }
  306. type BiddersFilterSetsFilteredBidsCreativesService struct {
  307. s *Service
  308. }
  309. func NewBiddersFilterSetsFilteredBidsDetailsService(s *Service) *BiddersFilterSetsFilteredBidsDetailsService {
  310. rs := &BiddersFilterSetsFilteredBidsDetailsService{s: s}
  311. return rs
  312. }
  313. type BiddersFilterSetsFilteredBidsDetailsService struct {
  314. s *Service
  315. }
  316. func NewBiddersFilterSetsImpressionMetricsService(s *Service) *BiddersFilterSetsImpressionMetricsService {
  317. rs := &BiddersFilterSetsImpressionMetricsService{s: s}
  318. return rs
  319. }
  320. type BiddersFilterSetsImpressionMetricsService struct {
  321. s *Service
  322. }
  323. func NewBiddersFilterSetsLosingBidsService(s *Service) *BiddersFilterSetsLosingBidsService {
  324. rs := &BiddersFilterSetsLosingBidsService{s: s}
  325. return rs
  326. }
  327. type BiddersFilterSetsLosingBidsService struct {
  328. s *Service
  329. }
  330. func NewBiddersFilterSetsNonBillableWinningBidsService(s *Service) *BiddersFilterSetsNonBillableWinningBidsService {
  331. rs := &BiddersFilterSetsNonBillableWinningBidsService{s: s}
  332. return rs
  333. }
  334. type BiddersFilterSetsNonBillableWinningBidsService struct {
  335. s *Service
  336. }
  337. // AbsoluteDateRange: An absolute date range, specified by its start
  338. // date and end date.
  339. // The supported range of dates begins 30 days before today and ends
  340. // today.
  341. // Validity checked upon filter set creation. If a filter set with an
  342. // absolute
  343. // date range is run at a later date more than 30 days after start_date,
  344. // it will
  345. // fail.
  346. type AbsoluteDateRange struct {
  347. // EndDate: The end date of the range (inclusive).
  348. // Must be within the 30 days leading up to current date, and must be
  349. // equal to
  350. // or after start_date.
  351. EndDate *Date `json:"endDate,omitempty"`
  352. // StartDate: The start date of the range (inclusive).
  353. // Must be within the 30 days leading up to current date, and must be
  354. // equal to
  355. // or before end_date.
  356. StartDate *Date `json:"startDate,omitempty"`
  357. // ForceSendFields is a list of field names (e.g. "EndDate") to
  358. // unconditionally include in API requests. By default, fields with
  359. // empty values are omitted from API requests. However, any non-pointer,
  360. // non-interface field appearing in ForceSendFields will be sent to the
  361. // server regardless of whether the field is empty or not. This may be
  362. // used to include empty fields in Patch requests.
  363. ForceSendFields []string `json:"-"`
  364. // NullFields is a list of field names (e.g. "EndDate") to include in
  365. // API requests with the JSON null value. By default, fields with empty
  366. // values are omitted from API requests. However, any field with an
  367. // empty value appearing in NullFields will be sent to the server as
  368. // null. It is an error if a field in this list has a non-empty value.
  369. // This may be used to include null fields in Patch requests.
  370. NullFields []string `json:"-"`
  371. }
  372. func (s *AbsoluteDateRange) MarshalJSON() ([]byte, error) {
  373. type NoMethod AbsoluteDateRange
  374. raw := NoMethod(*s)
  375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  376. }
  377. // AddDealAssociationRequest: A request for associating a deal and a
  378. // creative.
  379. type AddDealAssociationRequest struct {
  380. // Association: The association between a creative and a deal that
  381. // should be added.
  382. Association *CreativeDealAssociation `json:"association,omitempty"`
  383. // ForceSendFields is a list of field names (e.g. "Association") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "Association") to include
  391. // in API requests with the JSON null value. By default, fields with
  392. // empty values are omitted from API requests. However, any field with
  393. // an empty value appearing in NullFields will be sent to the server as
  394. // null. It is an error if a field in this list has a non-empty value.
  395. // This may be used to include null fields in Patch requests.
  396. NullFields []string `json:"-"`
  397. }
  398. func (s *AddDealAssociationRequest) MarshalJSON() ([]byte, error) {
  399. type NoMethod AddDealAssociationRequest
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // AppContext: @OutputOnly The app type the restriction applies to for
  404. // mobile device.
  405. type AppContext struct {
  406. // AppTypes: The app types this restriction applies to.
  407. //
  408. // Possible values:
  409. // "NATIVE" - Native app context.
  410. // "WEB" - Mobile web app context.
  411. AppTypes []string `json:"appTypes,omitempty"`
  412. // ForceSendFields is a list of field names (e.g. "AppTypes") to
  413. // unconditionally include in API requests. By default, fields with
  414. // empty values are omitted from API requests. However, any non-pointer,
  415. // non-interface field appearing in ForceSendFields will be sent to the
  416. // server regardless of whether the field is empty or not. This may be
  417. // used to include empty fields in Patch requests.
  418. ForceSendFields []string `json:"-"`
  419. // NullFields is a list of field names (e.g. "AppTypes") to include in
  420. // API requests with the JSON null value. By default, fields with empty
  421. // values are omitted from API requests. However, any field with an
  422. // empty value appearing in NullFields will be sent to the server as
  423. // null. It is an error if a field in this list has a non-empty value.
  424. // This may be used to include null fields in Patch requests.
  425. NullFields []string `json:"-"`
  426. }
  427. func (s *AppContext) MarshalJSON() ([]byte, error) {
  428. type NoMethod AppContext
  429. raw := NoMethod(*s)
  430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  431. }
  432. // AuctionContext: @OutputOnly The auction type the restriction applies
  433. // to.
  434. type AuctionContext struct {
  435. // AuctionTypes: The auction types this restriction applies to.
  436. //
  437. // Possible values:
  438. // "OPEN_AUCTION" - The restriction applies to open auction.
  439. // "DIRECT_DEALS" - The restriction applies to direct deals.
  440. AuctionTypes []string `json:"auctionTypes,omitempty"`
  441. // ForceSendFields is a list of field names (e.g. "AuctionTypes") to
  442. // unconditionally include in API requests. By default, fields with
  443. // empty values are omitted from API requests. However, any non-pointer,
  444. // non-interface field appearing in ForceSendFields will be sent to the
  445. // server regardless of whether the field is empty or not. This may be
  446. // used to include empty fields in Patch requests.
  447. ForceSendFields []string `json:"-"`
  448. // NullFields is a list of field names (e.g. "AuctionTypes") to include
  449. // in API requests with the JSON null value. By default, fields with
  450. // empty values are omitted from API requests. However, any field with
  451. // an empty value appearing in NullFields will be sent to the server as
  452. // null. It is an error if a field in this list has a non-empty value.
  453. // This may be used to include null fields in Patch requests.
  454. NullFields []string `json:"-"`
  455. }
  456. func (s *AuctionContext) MarshalJSON() ([]byte, error) {
  457. type NoMethod AuctionContext
  458. raw := NoMethod(*s)
  459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  460. }
  461. // BidMetricsRow: The set of metrics that are measured in numbers of
  462. // bids, representing how
  463. // many bids with the specified dimension values were considered
  464. // eligible at
  465. // each stage of the bidding funnel;
  466. type BidMetricsRow struct {
  467. // Bids: The number of bids that Ad Exchange received from the buyer.
  468. Bids *MetricValue `json:"bids,omitempty"`
  469. // BidsInAuction: The number of bids that were permitted to compete in
  470. // the auction.
  471. BidsInAuction *MetricValue `json:"bidsInAuction,omitempty"`
  472. // BilledImpressions: The number of bids for which the buyer was billed.
  473. BilledImpressions *MetricValue `json:"billedImpressions,omitempty"`
  474. // ImpressionsWon: The number of bids that won an impression.
  475. ImpressionsWon *MetricValue `json:"impressionsWon,omitempty"`
  476. // MeasurableImpressions: The number of bids for which the corresponding
  477. // impression was measurable
  478. // for viewability (as defined by Active View).
  479. MeasurableImpressions *MetricValue `json:"measurableImpressions,omitempty"`
  480. // RowDimensions: The values of all dimensions associated with metric
  481. // values in this row.
  482. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  483. // ViewableImpressions: The number of bids for which the corresponding
  484. // impression was viewable (as
  485. // defined by Active View).
  486. ViewableImpressions *MetricValue `json:"viewableImpressions,omitempty"`
  487. // ForceSendFields is a list of field names (e.g. "Bids") to
  488. // unconditionally include in API requests. By default, fields with
  489. // empty values are omitted from API requests. However, any non-pointer,
  490. // non-interface field appearing in ForceSendFields will be sent to the
  491. // server regardless of whether the field is empty or not. This may be
  492. // used to include empty fields in Patch requests.
  493. ForceSendFields []string `json:"-"`
  494. // NullFields is a list of field names (e.g. "Bids") to include in API
  495. // requests with the JSON null value. By default, fields with empty
  496. // values are omitted from API requests. However, any field with an
  497. // empty value appearing in NullFields will be sent to the server as
  498. // null. It is an error if a field in this list has a non-empty value.
  499. // This may be used to include null fields in Patch requests.
  500. NullFields []string `json:"-"`
  501. }
  502. func (s *BidMetricsRow) MarshalJSON() ([]byte, error) {
  503. type NoMethod BidMetricsRow
  504. raw := NoMethod(*s)
  505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  506. }
  507. // BidResponseWithoutBidsStatusRow: The number of impressions with the
  508. // specified dimension values that were
  509. // considered to have no applicable bids, as described by the specified
  510. // status.
  511. type BidResponseWithoutBidsStatusRow struct {
  512. // ImpressionCount: The number of impressions for which there was a bid
  513. // response with the
  514. // specified status.
  515. ImpressionCount *MetricValue `json:"impressionCount,omitempty"`
  516. // RowDimensions: The values of all dimensions associated with metric
  517. // values in this row.
  518. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  519. // Status: The status specifying why the bid responses were considered
  520. // to have no
  521. // applicable bids.
  522. //
  523. // Possible values:
  524. // "STATUS_UNSPECIFIED" - A placeholder for an undefined status.
  525. // This value will never be returned in responses.
  526. // "RESPONSES_WITHOUT_BIDS" - The response had no bids.
  527. // "RESPONSES_WITHOUT_BIDS_FOR_ACCOUNT" - The response had no bids for
  528. // the specified account, though it may have
  529. // included bids on behalf of other accounts.
  530. // "RESPONSES_WITHOUT_BIDS_FOR_DEAL" - The response had no bids for
  531. // the specified deal, though it may have
  532. // included bids on other deals on behalf of the account to which the
  533. // deal
  534. // belongs.
  535. Status string `json:"status,omitempty"`
  536. // ForceSendFields is a list of field names (e.g. "ImpressionCount") to
  537. // unconditionally include in API requests. By default, fields with
  538. // empty values are omitted from API requests. However, any non-pointer,
  539. // non-interface field appearing in ForceSendFields will be sent to the
  540. // server regardless of whether the field is empty or not. This may be
  541. // used to include empty fields in Patch requests.
  542. ForceSendFields []string `json:"-"`
  543. // NullFields is a list of field names (e.g. "ImpressionCount") to
  544. // include in API requests with the JSON null value. By default, fields
  545. // with empty values are omitted from API requests. However, any field
  546. // with an empty value appearing in NullFields will be sent to the
  547. // server as null. It is an error if a field in this list has a
  548. // non-empty value. This may be used to include null fields in Patch
  549. // requests.
  550. NullFields []string `json:"-"`
  551. }
  552. func (s *BidResponseWithoutBidsStatusRow) MarshalJSON() ([]byte, error) {
  553. type NoMethod BidResponseWithoutBidsStatusRow
  554. raw := NoMethod(*s)
  555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  556. }
  557. // CalloutStatusRow: The number of impressions with the specified
  558. // dimension values where the
  559. // corresponding bid request or bid response was not successful, as
  560. // described by
  561. // the specified callout status.
  562. type CalloutStatusRow struct {
  563. // CalloutStatusId: The ID of the callout status.
  564. // See
  565. // [callout-status-codes](https://developers.google.com/ad-exchange/rtb/d
  566. // ownloads/callout-status-codes).
  567. CalloutStatusId int64 `json:"calloutStatusId,omitempty"`
  568. // ImpressionCount: The number of impressions for which there was a bid
  569. // request or bid response
  570. // with the specified callout status.
  571. ImpressionCount *MetricValue `json:"impressionCount,omitempty"`
  572. // RowDimensions: The values of all dimensions associated with metric
  573. // values in this row.
  574. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  575. // ForceSendFields is a list of field names (e.g. "CalloutStatusId") to
  576. // unconditionally include in API requests. By default, fields with
  577. // empty values are omitted from API requests. However, any non-pointer,
  578. // non-interface field appearing in ForceSendFields will be sent to the
  579. // server regardless of whether the field is empty or not. This may be
  580. // used to include empty fields in Patch requests.
  581. ForceSendFields []string `json:"-"`
  582. // NullFields is a list of field names (e.g. "CalloutStatusId") to
  583. // include in API requests with the JSON null value. By default, fields
  584. // with empty values are omitted from API requests. However, any field
  585. // with an empty value appearing in NullFields will be sent to the
  586. // server as null. It is an error if a field in this list has a
  587. // non-empty value. This may be used to include null fields in Patch
  588. // requests.
  589. NullFields []string `json:"-"`
  590. }
  591. func (s *CalloutStatusRow) MarshalJSON() ([]byte, error) {
  592. type NoMethod CalloutStatusRow
  593. raw := NoMethod(*s)
  594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  595. }
  596. // Client: A client resource represents a client buyer—an
  597. // agency,
  598. // a brand, or an advertiser customer of the sponsor buyer.
  599. // Users associated with the client buyer have restricted access to
  600. // the Ad Exchange Marketplace and certain other sections
  601. // of the Ad Exchange Buyer UI based on the role
  602. // granted to the client buyer.
  603. // All fields are required unless otherwise specified.
  604. type Client struct {
  605. // ClientAccountId: The globally-unique numerical ID of the client.
  606. // The value of this field is ignored in create and update operations.
  607. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  608. // ClientName: Name used to represent this client to publishers.
  609. // You may have multiple clients that map to the same entity,
  610. // but for each client the combination of `clientName` and entity
  611. // must be unique.
  612. // You can specify this field as empty.
  613. ClientName string `json:"clientName,omitempty"`
  614. // EntityId: Numerical identifier of the client entity.
  615. // The entity can be an advertiser, a brand, or an agency.
  616. // This identifier is unique among all the entities with the same
  617. // type.
  618. //
  619. // A list of all known advertisers with their identifiers is available
  620. // in
  621. // the
  622. // [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionar
  623. // ies/advertisers.txt)
  624. // file.
  625. //
  626. // A list of all known brands with their identifiers is available in
  627. // the
  628. // [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/b
  629. // rands.txt)
  630. // file.
  631. //
  632. // A list of all known agencies with their identifiers is available in
  633. // the
  634. // [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries
  635. // /agencies.txt)
  636. // file.
  637. EntityId int64 `json:"entityId,omitempty,string"`
  638. // EntityName: The name of the entity. This field is automatically
  639. // fetched based on
  640. // the type and ID.
  641. // The value of this field is ignored in create and update operations.
  642. EntityName string `json:"entityName,omitempty"`
  643. // EntityType: The type of the client entity: `ADVERTISER`, `BRAND`, or
  644. // `AGENCY`.
  645. //
  646. // Possible values:
  647. // "ENTITY_TYPE_UNSPECIFIED" - A placeholder for an undefined client
  648. // entity type. Should not be used.
  649. // "ADVERTISER" - An advertiser.
  650. // "BRAND" - A brand.
  651. // "AGENCY" - An advertising agency.
  652. EntityType string `json:"entityType,omitempty"`
  653. // PartnerClientId: Optional arbitrary unique identifier of this client
  654. // buyer from the
  655. // standpoint of its Ad Exchange sponsor buyer.
  656. //
  657. // This field can be used to associate a client buyer with the
  658. // identifier
  659. // in the namespace of its sponsor buyer, lookup client buyers by
  660. // that
  661. // identifier and verify whether an Ad Exchange counterpart of a given
  662. // client
  663. // buyer already exists.
  664. //
  665. // If present, must be unique among all the client buyers for its
  666. // Ad Exchange sponsor buyer.
  667. PartnerClientId string `json:"partnerClientId,omitempty"`
  668. // Role: The role which is assigned to the client buyer. Each role
  669. // implies a set of
  670. // permissions granted to the client. Must be one of
  671. // `CLIENT_DEAL_VIEWER`,
  672. // `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`.
  673. //
  674. // Possible values:
  675. // "CLIENT_ROLE_UNSPECIFIED" - A placeholder for an undefined client
  676. // role.
  677. // "CLIENT_DEAL_VIEWER" - Users associated with this client can see
  678. // publisher deal offers
  679. // in the Marketplace.
  680. // They can neither negotiate proposals nor approve deals.
  681. // If this client is visible to publishers, they can send deal
  682. // proposals
  683. // to this client.
  684. // "CLIENT_DEAL_NEGOTIATOR" - Users associated with this client can
  685. // respond to deal proposals
  686. // sent to them by publishers. They can also initiate deal proposals
  687. // of their own.
  688. // "CLIENT_DEAL_APPROVER" - Users associated with this client can
  689. // approve eligible deals
  690. // on your behalf. Some deals may still explicitly require
  691. // publisher
  692. // finalization. If this role is not selected, the sponsor buyer
  693. // will need to manually approve each of their deals.
  694. Role string `json:"role,omitempty"`
  695. // Status: The status of the client buyer.
  696. //
  697. // Possible values:
  698. // "CLIENT_STATUS_UNSPECIFIED" - A placeholder for an undefined client
  699. // status.
  700. // "DISABLED" - A client that is currently disabled.
  701. // "ACTIVE" - A client that is currently active.
  702. Status string `json:"status,omitempty"`
  703. // VisibleToSeller: Whether the client buyer will be visible to sellers.
  704. VisibleToSeller bool `json:"visibleToSeller,omitempty"`
  705. // ServerResponse contains the HTTP response code and headers from the
  706. // server.
  707. googleapi.ServerResponse `json:"-"`
  708. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  709. // unconditionally include in API requests. By default, fields with
  710. // empty values are omitted from API requests. However, any non-pointer,
  711. // non-interface field appearing in ForceSendFields will be sent to the
  712. // server regardless of whether the field is empty or not. This may be
  713. // used to include empty fields in Patch requests.
  714. ForceSendFields []string `json:"-"`
  715. // NullFields is a list of field names (e.g. "ClientAccountId") to
  716. // include in API requests with the JSON null value. By default, fields
  717. // with empty values are omitted from API requests. However, any field
  718. // with an empty value appearing in NullFields will be sent to the
  719. // server as null. It is an error if a field in this list has a
  720. // non-empty value. This may be used to include null fields in Patch
  721. // requests.
  722. NullFields []string `json:"-"`
  723. }
  724. func (s *Client) MarshalJSON() ([]byte, error) {
  725. type NoMethod Client
  726. raw := NoMethod(*s)
  727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  728. }
  729. // ClientUser: A client user is created under a client buyer and has
  730. // restricted access to
  731. // the Ad Exchange Marketplace and certain other sections
  732. // of the Ad Exchange Buyer UI based on the role
  733. // granted to the associated client buyer.
  734. //
  735. // The only way a new client user can be created is via accepting
  736. // an
  737. // email invitation
  738. // (see the
  739. // accounts.clients.invitations.create
  740. // method).
  741. //
  742. // All fields are required unless otherwise specified.
  743. type ClientUser struct {
  744. // ClientAccountId: Numerical account ID of the client buyer
  745. // with which the user is associated; the
  746. // buyer must be a client of the current sponsor buyer.
  747. // The value of this field is ignored in an update operation.
  748. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  749. // Email: User's email address. The value of this field
  750. // is ignored in an update operation.
  751. Email string `json:"email,omitempty"`
  752. // Status: The status of the client user.
  753. //
  754. // Possible values:
  755. // "USER_STATUS_UNSPECIFIED" - A placeholder for an undefined user
  756. // status.
  757. // "PENDING" - A user who was already created but hasn't accepted the
  758. // invitation yet.
  759. // "ACTIVE" - A user that is currently active.
  760. // "DISABLED" - A user that is currently disabled.
  761. Status string `json:"status,omitempty"`
  762. // UserId: The unique numerical ID of the client user
  763. // that has accepted an invitation.
  764. // The value of this field is ignored in an update operation.
  765. UserId int64 `json:"userId,omitempty,string"`
  766. // ServerResponse contains the HTTP response code and headers from the
  767. // server.
  768. googleapi.ServerResponse `json:"-"`
  769. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  770. // unconditionally include in API requests. By default, fields with
  771. // empty values are omitted from API requests. However, any non-pointer,
  772. // non-interface field appearing in ForceSendFields will be sent to the
  773. // server regardless of whether the field is empty or not. This may be
  774. // used to include empty fields in Patch requests.
  775. ForceSendFields []string `json:"-"`
  776. // NullFields is a list of field names (e.g. "ClientAccountId") to
  777. // include in API requests with the JSON null value. By default, fields
  778. // with empty values are omitted from API requests. However, any field
  779. // with an empty value appearing in NullFields will be sent to the
  780. // server as null. It is an error if a field in this list has a
  781. // non-empty value. This may be used to include null fields in Patch
  782. // requests.
  783. NullFields []string `json:"-"`
  784. }
  785. func (s *ClientUser) MarshalJSON() ([]byte, error) {
  786. type NoMethod ClientUser
  787. raw := NoMethod(*s)
  788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  789. }
  790. // ClientUserInvitation: An invitation for a new client user to get
  791. // access to the Ad Exchange
  792. // Buyer UI.
  793. // All fields are required unless otherwise specified.
  794. type ClientUserInvitation struct {
  795. // ClientAccountId: Numerical account ID of the client buyer
  796. // that the invited user is associated with.
  797. // The value of this field is ignored in create operations.
  798. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  799. // Email: The email address to which the invitation is sent.
  800. // Email
  801. // addresses should be unique among all client users under each
  802. // sponsor
  803. // buyer.
  804. Email string `json:"email,omitempty"`
  805. // InvitationId: The unique numerical ID of the invitation that is sent
  806. // to the user.
  807. // The value of this field is ignored in create operations.
  808. InvitationId int64 `json:"invitationId,omitempty,string"`
  809. // ServerResponse contains the HTTP response code and headers from the
  810. // server.
  811. googleapi.ServerResponse `json:"-"`
  812. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  813. // unconditionally include in API requests. By default, fields with
  814. // empty values are omitted from API requests. However, any non-pointer,
  815. // non-interface field appearing in ForceSendFields will be sent to the
  816. // server regardless of whether the field is empty or not. This may be
  817. // used to include empty fields in Patch requests.
  818. ForceSendFields []string `json:"-"`
  819. // NullFields is a list of field names (e.g. "ClientAccountId") to
  820. // include in API requests with the JSON null value. By default, fields
  821. // with empty values are omitted from API requests. However, any field
  822. // with an empty value appearing in NullFields will be sent to the
  823. // server as null. It is an error if a field in this list has a
  824. // non-empty value. This may be used to include null fields in Patch
  825. // requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *ClientUserInvitation) MarshalJSON() ([]byte, error) {
  829. type NoMethod ClientUserInvitation
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // Correction: @OutputOnly Shows any corrections that were applied to
  834. // this creative.
  835. type Correction struct {
  836. // Contexts: The contexts for the correction.
  837. Contexts []*ServingContext `json:"contexts,omitempty"`
  838. // Details: Additional details about what was corrected.
  839. Details []string `json:"details,omitempty"`
  840. // Type: The type of correction that was applied to the creative.
  841. //
  842. // Possible values:
  843. // "CORRECTION_TYPE_UNSPECIFIED" - The correction type is unknown.
  844. // Refer to the details for more information.
  845. // "VENDOR_IDS_ADDED" - The ad's declared vendors did not match the
  846. // vendors that were detected.
  847. // The detected vendors were added.
  848. // "SSL_ATTRIBUTE_REMOVED" - The ad had the SSL attribute declared but
  849. // was not SSL-compliant.
  850. // The SSL attribute was removed.
  851. // "FLASH_FREE_ATTRIBUTE_REMOVED" - The ad was declared as Flash-free
  852. // but contained Flash, so the Flash-free
  853. // attribute was removed.
  854. // "FLASH_FREE_ATTRIBUTE_ADDED" - The ad was not declared as
  855. // Flash-free but it did not reference any flash
  856. // content, so the Flash-free attribute was added.
  857. // "REQUIRED_ATTRIBUTE_ADDED" - The ad did not declare a required
  858. // creative attribute.
  859. // The attribute was added.
  860. // "REQUIRED_VENDOR_ADDED" - The ad did not declare a required
  861. // technology vendor.
  862. // The technology vendor was added.
  863. // "SSL_ATTRIBUTE_ADDED" - The ad did not declare the SSL attribute
  864. // but was SSL-compliant, so the
  865. // SSL attribute was added.
  866. // "IN_BANNER_VIDEO_ATTRIBUTE_ADDED" - Properties consistent with
  867. // In-banner video were found, so an
  868. // In-Banner Video attribute was added.
  869. // "MRAID_ATTRIBUTE_ADDED" - The ad makes calls to the MRAID API so
  870. // the MRAID attribute was added.
  871. // "FLASH_ATTRIBUTE_REMOVED" - The ad unnecessarily declared the Flash
  872. // attribute, so the Flash attribute
  873. // was removed.
  874. // "VIDEO_IN_SNIPPET_ATTRIBUTE_ADDED" - The ad contains video content.
  875. Type string `json:"type,omitempty"`
  876. // ForceSendFields is a list of field names (e.g. "Contexts") to
  877. // unconditionally include in API requests. By default, fields with
  878. // empty values are omitted from API requests. However, any non-pointer,
  879. // non-interface field appearing in ForceSendFields will be sent to the
  880. // server regardless of whether the field is empty or not. This may be
  881. // used to include empty fields in Patch requests.
  882. ForceSendFields []string `json:"-"`
  883. // NullFields is a list of field names (e.g. "Contexts") to include in
  884. // API requests with the JSON null value. By default, fields with empty
  885. // values are omitted from API requests. However, any field with an
  886. // empty value appearing in NullFields will be sent to the server as
  887. // null. It is an error if a field in this list has a non-empty value.
  888. // This may be used to include null fields in Patch requests.
  889. NullFields []string `json:"-"`
  890. }
  891. func (s *Correction) MarshalJSON() ([]byte, error) {
  892. type NoMethod Correction
  893. raw := NoMethod(*s)
  894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  895. }
  896. // Creative: A creative and its classification data.
  897. //
  898. // Next ID: 35
  899. type Creative struct {
  900. // AccountId: The account that this creative belongs to.
  901. // Can be used to filter the response of the
  902. // creatives.list
  903. // method.
  904. AccountId string `json:"accountId,omitempty"`
  905. // AdChoicesDestinationUrl: The link to AdChoices destination page.
  906. AdChoicesDestinationUrl string `json:"adChoicesDestinationUrl,omitempty"`
  907. // AdvertiserName: The name of the company being advertised in the
  908. // creative.
  909. AdvertiserName string `json:"advertiserName,omitempty"`
  910. // AgencyId: The agency ID for this creative.
  911. AgencyId int64 `json:"agencyId,omitempty,string"`
  912. // ApiUpdateTime: @OutputOnly The last update timestamp of the creative
  913. // via API.
  914. ApiUpdateTime string `json:"apiUpdateTime,omitempty"`
  915. // Attributes: All attributes for the ads that may be shown from this
  916. // creative.
  917. // Can be used to filter the response of the
  918. // creatives.list
  919. // method.
  920. //
  921. // Possible values:
  922. // "ATTRIBUTE_UNSPECIFIED" - Do not use. This is a placeholder value
  923. // only.
  924. // "IS_TAGGED" - The creative is tagged.
  925. // "IS_COOKIE_TARGETED" - The creative is cookie targeted.
  926. // "IS_USER_INTEREST_TARGETED" - The creative is user interest
  927. // targeted.
  928. // "EXPANDING_DIRECTION_NONE" - The creative does not expand.
  929. // "EXPANDING_DIRECTION_UP" - The creative expands up.
  930. // "EXPANDING_DIRECTION_DOWN" - The creative expands down.
  931. // "EXPANDING_DIRECTION_LEFT" - The creative expands left.
  932. // "EXPANDING_DIRECTION_RIGHT" - The creative expands right.
  933. // "EXPANDING_DIRECTION_UP_LEFT" - The creative expands up and left.
  934. // "EXPANDING_DIRECTION_UP_RIGHT" - The creative expands up and right.
  935. // "EXPANDING_DIRECTION_DOWN_LEFT" - The creative expands down and
  936. // left.
  937. // "EXPANDING_DIRECTION_DOWN_RIGHT" - The creative expands down and
  938. // right.
  939. // "EXPANDING_DIRECTION_UP_OR_DOWN" - The creative expands up or down.
  940. // "EXPANDING_DIRECTION_LEFT_OR_RIGHT" - The creative expands left or
  941. // right.
  942. // "EXPANDING_DIRECTION_ANY_DIAGONAL" - The creative expands on any
  943. // diagonal.
  944. // "EXPANDING_ACTION_ROLLOVER_TO_EXPAND" - The creative expands when
  945. // rolled over.
  946. // "INSTREAM_VAST_VIDEO_TYPE_VPAID_FLASH" - The instream vast video
  947. // type is vpaid flash.
  948. // "RICH_MEDIA_CAPABILITY_TYPE_MRAID" - The creative is MRAID
  949. // "RICH_MEDIA_CAPABILITY_TYPE_SSL" - The creative is SSL.
  950. // "RICH_MEDIA_CAPABILITY_TYPE_INTERSTITIAL" - The creative is an
  951. // interstitial.
  952. // "NATIVE_ELIGIBILITY_ELIGIBLE" - The creative is eligible for
  953. // native.
  954. // "NATIVE_ELIGIBILITY_NOT_ELIGIBLE" - The creative is not eligible
  955. // for native.
  956. // "RENDERING_SIZELESS_ADX" - The creative can dynamically resize to
  957. // fill a variety of slot sizes.
  958. Attributes []string `json:"attributes,omitempty"`
  959. // ClickThroughUrls: The set of destination URLs for the creative.
  960. ClickThroughUrls []string `json:"clickThroughUrls,omitempty"`
  961. // Corrections: @OutputOnly Shows any corrections that were applied to
  962. // this creative.
  963. Corrections []*Correction `json:"corrections,omitempty"`
  964. // CreativeId: The buyer-defined creative ID of this creative.
  965. // Can be used to filter the response of the
  966. // creatives.list
  967. // method.
  968. CreativeId string `json:"creativeId,omitempty"`
  969. // DealsStatus: @OutputOnly The top-level deals status of this
  970. // creative.
  971. // If disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL')
  972. // in
  973. // serving_restrictions will also exist. Note
  974. // that this may be nuanced with other contextual restrictions, in which
  975. // case,
  976. // it may be preferable to read from serving_restrictions directly.
  977. // Can be used to filter the response of the
  978. // creatives.list
  979. // method.
  980. //
  981. // Possible values:
  982. // "STATUS_UNSPECIFIED" - The status is unknown.
  983. // "NOT_CHECKED" - The creative has not been checked.
  984. // "CONDITIONALLY_APPROVED" - The creative has been conditionally
  985. // approved.
  986. // See serving_restrictions for details.
  987. // "APPROVED" - The creative has been approved.
  988. // "DISAPPROVED" - The creative has been disapproved.
  989. DealsStatus string `json:"dealsStatus,omitempty"`
  990. // DetectedAdvertiserIds: @OutputOnly Detected advertiser IDs, if any.
  991. DetectedAdvertiserIds googleapi.Int64s `json:"detectedAdvertiserIds,omitempty"`
  992. // DetectedDomains: @OutputOnly
  993. // The detected domains for this creative.
  994. DetectedDomains []string `json:"detectedDomains,omitempty"`
  995. // DetectedLanguages: @OutputOnly
  996. // The detected languages for this creative. The order is arbitrary. The
  997. // codes
  998. // are 2 or 5 characters and are documented
  999. // at
  1000. // https://developers.google.com/adwords/api/docs/appendix/languagecod
  1001. // es.
  1002. DetectedLanguages []string `json:"detectedLanguages,omitempty"`
  1003. // DetectedProductCategories: @OutputOnly Detected product categories,
  1004. // if any.
  1005. // See the ad-product-categories.txt file in the technical
  1006. // documentation
  1007. // for a list of IDs.
  1008. DetectedProductCategories []int64 `json:"detectedProductCategories,omitempty"`
  1009. // DetectedSensitiveCategories: @OutputOnly Detected sensitive
  1010. // categories, if any.
  1011. // See the ad-sensitive-categories.txt file in the technical
  1012. // documentation for
  1013. // a list of IDs. You should use these IDs along with
  1014. // the
  1015. // excluded-sensitive-category field in the bid request to filter your
  1016. // bids.
  1017. DetectedSensitiveCategories []int64 `json:"detectedSensitiveCategories,omitempty"`
  1018. // FilteringStats: @OutputOnly The filtering stats for this creative.
  1019. FilteringStats *FilteringStats `json:"filteringStats,omitempty"`
  1020. // Html: An HTML creative.
  1021. Html *HtmlContent `json:"html,omitempty"`
  1022. // ImpressionTrackingUrls: The set of URLs to be called to record an
  1023. // impression.
  1024. ImpressionTrackingUrls []string `json:"impressionTrackingUrls,omitempty"`
  1025. // Native: A native creative.
  1026. Native *NativeContent `json:"native,omitempty"`
  1027. // OpenAuctionStatus: @OutputOnly The top-level open auction status of
  1028. // this creative.
  1029. // If disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL')
  1030. // in
  1031. // serving_restrictions will also exist. Note
  1032. // that this may be nuanced with other contextual restrictions, in which
  1033. // case,
  1034. // it may be preferable to read from serving_restrictions directly.
  1035. // Can be used to filter the response of the
  1036. // creatives.list
  1037. // method.
  1038. //
  1039. // Possible values:
  1040. // "STATUS_UNSPECIFIED" - The status is unknown.
  1041. // "NOT_CHECKED" - The creative has not been checked.
  1042. // "CONDITIONALLY_APPROVED" - The creative has been conditionally
  1043. // approved.
  1044. // See serving_restrictions for details.
  1045. // "APPROVED" - The creative has been approved.
  1046. // "DISAPPROVED" - The creative has been disapproved.
  1047. OpenAuctionStatus string `json:"openAuctionStatus,omitempty"`
  1048. // RestrictedCategories: All restricted categories for the ads that may
  1049. // be shown from this creative.
  1050. //
  1051. // Possible values:
  1052. // "NO_RESTRICTED_CATEGORIES" - The ad has no restricted categories
  1053. // "ALCOHOL" - The alcohol restricted category.
  1054. RestrictedCategories []string `json:"restrictedCategories,omitempty"`
  1055. // ServingRestrictions: @OutputOnly The granular status of this ad in
  1056. // specific contexts.
  1057. // A context here relates to where something ultimately serves (for
  1058. // example,
  1059. // a physical location, a platform, an HTTPS vs HTTP request, or the
  1060. // type
  1061. // of auction).
  1062. ServingRestrictions []*ServingRestriction `json:"servingRestrictions,omitempty"`
  1063. // VendorIds: All vendor IDs for the ads that may be shown from this
  1064. // creative.
  1065. // See
  1066. // https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt
  1067. // for possible values.
  1068. VendorIds []int64 `json:"vendorIds,omitempty"`
  1069. // Version: @OutputOnly The version of this creative.
  1070. Version int64 `json:"version,omitempty"`
  1071. // Video: A video creative.
  1072. Video *VideoContent `json:"video,omitempty"`
  1073. // ServerResponse contains the HTTP response code and headers from the
  1074. // server.
  1075. googleapi.ServerResponse `json:"-"`
  1076. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1077. // unconditionally include in API requests. By default, fields with
  1078. // empty values are omitted from API requests. However, any non-pointer,
  1079. // non-interface field appearing in ForceSendFields will be sent to the
  1080. // server regardless of whether the field is empty or not. This may be
  1081. // used to include empty fields in Patch requests.
  1082. ForceSendFields []string `json:"-"`
  1083. // NullFields is a list of field names (e.g. "AccountId") to include in
  1084. // API requests with the JSON null value. By default, fields with empty
  1085. // values are omitted from API requests. However, any field with an
  1086. // empty value appearing in NullFields will be sent to the server as
  1087. // null. It is an error if a field in this list has a non-empty value.
  1088. // This may be used to include null fields in Patch requests.
  1089. NullFields []string `json:"-"`
  1090. }
  1091. func (s *Creative) MarshalJSON() ([]byte, error) {
  1092. type NoMethod Creative
  1093. raw := NoMethod(*s)
  1094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1095. }
  1096. // CreativeDealAssociation: The association between a creative and a
  1097. // deal.
  1098. type CreativeDealAssociation struct {
  1099. // AccountId: The account the creative belongs to.
  1100. AccountId string `json:"accountId,omitempty"`
  1101. // CreativeId: The ID of the creative associated with the deal.
  1102. CreativeId string `json:"creativeId,omitempty"`
  1103. // DealsId: The externalDealId for the deal associated with the
  1104. // creative.
  1105. DealsId string `json:"dealsId,omitempty"`
  1106. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1107. // unconditionally include in API requests. By default, fields with
  1108. // empty values are omitted from API requests. However, any non-pointer,
  1109. // non-interface field appearing in ForceSendFields will be sent to the
  1110. // server regardless of whether the field is empty or not. This may be
  1111. // used to include empty fields in Patch requests.
  1112. ForceSendFields []string `json:"-"`
  1113. // NullFields is a list of field names (e.g. "AccountId") to include in
  1114. // API requests with the JSON null value. By default, fields with empty
  1115. // values are omitted from API requests. However, any field with an
  1116. // empty value appearing in NullFields will be sent to the server as
  1117. // null. It is an error if a field in this list has a non-empty value.
  1118. // This may be used to include null fields in Patch requests.
  1119. NullFields []string `json:"-"`
  1120. }
  1121. func (s *CreativeDealAssociation) MarshalJSON() ([]byte, error) {
  1122. type NoMethod CreativeDealAssociation
  1123. raw := NoMethod(*s)
  1124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1125. }
  1126. // CreativeStatusRow: The number of bids with the specified dimension
  1127. // values that did not win the
  1128. // auction (either were filtered pre-auction or lost the auction), as
  1129. // described
  1130. // by the specified creative status.
  1131. type CreativeStatusRow struct {
  1132. // BidCount: The number of bids with the specified status.
  1133. BidCount *MetricValue `json:"bidCount,omitempty"`
  1134. // CreativeStatusId: The ID of the creative status.
  1135. // See
  1136. // [creative-status-codes](https://developers.google.com/ad-exchange/rtb/
  1137. // downloads/creative-status-codes).
  1138. CreativeStatusId int64 `json:"creativeStatusId,omitempty"`
  1139. // RowDimensions: The values of all dimensions associated with metric
  1140. // values in this row.
  1141. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  1142. // ForceSendFields is a list of field names (e.g. "BidCount") to
  1143. // unconditionally include in API requests. By default, fields with
  1144. // empty values are omitted from API requests. However, any non-pointer,
  1145. // non-interface field appearing in ForceSendFields will be sent to the
  1146. // server regardless of whether the field is empty or not. This may be
  1147. // used to include empty fields in Patch requests.
  1148. ForceSendFields []string `json:"-"`
  1149. // NullFields is a list of field names (e.g. "BidCount") to include in
  1150. // API requests with the JSON null value. By default, fields with empty
  1151. // values are omitted from API requests. However, any field with an
  1152. // empty value appearing in NullFields will be sent to the server as
  1153. // null. It is an error if a field in this list has a non-empty value.
  1154. // This may be used to include null fields in Patch requests.
  1155. NullFields []string `json:"-"`
  1156. }
  1157. func (s *CreativeStatusRow) MarshalJSON() ([]byte, error) {
  1158. type NoMethod CreativeStatusRow
  1159. raw := NoMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1161. }
  1162. // Date: Represents a whole calendar date, e.g. date of birth. The time
  1163. // of day and
  1164. // time zone are either specified elsewhere or are not significant. The
  1165. // date
  1166. // is relative to the Proleptic Gregorian Calendar. The day may be 0
  1167. // to
  1168. // represent a year and month where the day is not significant, e.g.
  1169. // credit card
  1170. // expiration date. The year may be 0 to represent a month and day
  1171. // independent
  1172. // of year, e.g. anniversary date. Related types are
  1173. // google.type.TimeOfDay
  1174. // and `google.protobuf.Timestamp`.
  1175. type Date struct {
  1176. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  1177. // month, or 0
  1178. // if specifying a year/month where the day is not significant.
  1179. Day int64 `json:"day,omitempty"`
  1180. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a date
  1181. // without a
  1182. // month.
  1183. Month int64 `json:"month,omitempty"`
  1184. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  1185. // without
  1186. // a year.
  1187. Year int64 `json:"year,omitempty"`
  1188. // ForceSendFields is a list of field names (e.g. "Day") to
  1189. // unconditionally include in API requests. By default, fields with
  1190. // empty values are omitted from API requests. However, any non-pointer,
  1191. // non-interface field appearing in ForceSendFields will be sent to the
  1192. // server regardless of whether the field is empty or not. This may be
  1193. // used to include empty fields in Patch requests.
  1194. ForceSendFields []string `json:"-"`
  1195. // NullFields is a list of field names (e.g. "Day") to include in API
  1196. // requests with the JSON null value. By default, fields with empty
  1197. // values are omitted from API requests. However, any field with an
  1198. // empty value appearing in NullFields will be sent to the server as
  1199. // null. It is an error if a field in this list has a non-empty value.
  1200. // This may be used to include null fields in Patch requests.
  1201. NullFields []string `json:"-"`
  1202. }
  1203. func (s *Date) MarshalJSON() ([]byte, error) {
  1204. type NoMethod Date
  1205. raw := NoMethod(*s)
  1206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1207. }
  1208. // Disapproval: @OutputOnly The reason and details for a disapproval.
  1209. type Disapproval struct {
  1210. // Details: Additional details about the reason for disapproval.
  1211. Details []string `json:"details,omitempty"`
  1212. // Reason: The categorized reason for disapproval.
  1213. //
  1214. // Possible values:
  1215. // "LENGTH_OF_IMAGE_ANIMATION" - The length of the image animation is
  1216. // longer than allowed.
  1217. // "BROKEN_URL" - The click through URL doesn't work properly.
  1218. // "MEDIA_NOT_FUNCTIONAL" - Something is wrong with the creative
  1219. // itself.
  1220. // "INVALID_FOURTH_PARTY_CALL" - The ad makes a fourth party call to
  1221. // an unapproved vendor.
  1222. // "INCORRECT_REMARKETING_DECLARATION" - The ad targets consumers
  1223. // using remarketing lists and/or collects
  1224. // data for subsequent use in retargeting, but does not correctly
  1225. // declare
  1226. // that use.
  1227. // "LANDING_PAGE_ERROR" - Clicking on the ad leads to an error page.
  1228. // "AD_SIZE_DOES_NOT_MATCH_AD_SLOT" - The ad size when rendered does
  1229. // not match the declaration.
  1230. // "NO_BORDER" - Ads with a white background require a border, which
  1231. // was missing.
  1232. // "FOURTH_PARTY_BROWSER_COOKIES" - The creative attempts to set
  1233. // cookies from a fourth party that is not
  1234. // certified.
  1235. // "LSO_OBJECTS" - The creative sets an LSO object.
  1236. // "BLANK_CREATIVE" - The ad serves a blank.
  1237. // "DESTINATION_URLS_UNDECLARED" - The ad uses rotation, but not all
  1238. // destination URLs were declared.
  1239. // "PROBLEM_WITH_CLICK_MACRO" - There is a problem with the way the
  1240. // click macro is used.
  1241. // "INCORRECT_AD_TECHNOLOGY_DECLARATION" - The ad technology
  1242. // declaration is not accurate.
  1243. // "INCORRECT_DESTINATION_URL_DECLARATION" - The actual destination
  1244. // URL does not match the declared destination URL.
  1245. // "EXPANDABLE_INCORRECT_DIRECTION" - The declared expanding direction
  1246. // does not match the actual direction.
  1247. // "EXPANDABLE_DIRECTION_NOT_SUPPORTED" - The ad does not expand in a
  1248. // supported direction.
  1249. // "EXPANDABLE_INVALID_VENDOR" - The ad uses an expandable vendor that
  1250. // is not supported.
  1251. // "EXPANDABLE_FUNCTIONALITY" - There was an issue with the expandable
  1252. // ad.
  1253. // "VIDEO_INVALID_VENDOR" - The ad uses a video vendor that is not
  1254. // supported.
  1255. // "VIDEO_UNSUPPORTED_LENGTH" - The length of the video ad is not
  1256. // supported.
  1257. // "VIDEO_UNSUPPORTED_FORMAT" - The format of the video ad is not
  1258. // supported.
  1259. // "VIDEO_FUNCTIONALITY" - There was an issue with the video ad.
  1260. // "LANDING_PAGE_DISABLED" - The landing page does not conform to Ad
  1261. // Exchange policy.
  1262. // "MALWARE_SUSPECTED" - The ad or the landing page may contain
  1263. // malware.
  1264. // "ADULT_IMAGE_OR_VIDEO" - The ad contains adult images or video
  1265. // content.
  1266. // "INACCURATE_AD_TEXT" - The ad contains text that is unclear or
  1267. // inaccurate.
  1268. // "COUNTERFEIT_DESIGNER_GOODS" - The ad promotes counterfeit designer
  1269. // goods.
  1270. // "POP_UP" - The ad causes a popup window to appear.
  1271. // "INVALID_RTB_PROTOCOL_USAGE" - The creative does not follow
  1272. // policies set for the RTB protocol.
  1273. // "RAW_IP_ADDRESS_IN_SNIPPET" - The ad contains a URL that uses a
  1274. // numeric IP address for the domain.
  1275. // "UNACCEPTABLE_CONTENT_SOFTWARE" - The ad or landing page contains
  1276. // unacceptable content because it initiated
  1277. // a software or executable download.
  1278. // "UNAUTHORIZED_COOKIE_ON_GOOGLE_DOMAIN" - The ad set an unauthorized
  1279. // cookie on a Google domain.
  1280. // "UNDECLARED_FLASH_OBJECTS" - Flash content found when no flash was
  1281. // declared.
  1282. // "INVALID_SSL_DECLARATION" - SSL support declared but not working
  1283. // correctly.
  1284. // "DIRECT_DOWNLOAD_IN_AD" - Rich Media - Direct Download in Ad (ex.
  1285. // PDF download).
  1286. // "MAXIMUM_DOWNLOAD_SIZE_EXCEEDED" - Maximum download size exceeded.
  1287. // "DESTINATION_URL_SITE_NOT_CRAWLABLE" - Bad Destination URL: Site
  1288. // Not Crawlable.
  1289. // "BAD_URL_LEGAL_DISAPPROVAL" - Bad URL: Legal disapproval.
  1290. // "PHARMA_GAMBLING_ALCOHOL_NOT_ALLOWED" - Pharmaceuticals, Gambling,
  1291. // Alcohol not allowed and at least one was
  1292. // detected.
  1293. // "DYNAMIC_DNS_AT_DESTINATION_URL" - Dynamic DNS at Destination URL.
  1294. // "POOR_IMAGE_OR_VIDEO_QUALITY" - Poor Image / Video Quality.
  1295. // "UNACCEPTABLE_IMAGE_CONTENT" - For example, Image Trick to Click.
  1296. // "INCORRECT_IMAGE_LAYOUT" - Incorrect Image Layout.
  1297. // "IRRELEVANT_IMAGE_OR_VIDEO" - Irrelevant Image / Video.
  1298. // "DESTINATION_SITE_DOES_NOT_ALLOW_GOING_BACK" - Broken back button.
  1299. // "MISLEADING_CLAIMS_IN_AD" - Misleading/Inaccurate claims in ads.
  1300. // "RESTRICTED_PRODUCTS" - Restricted Products.
  1301. // "UNACCEPTABLE_CONTENT" - Unacceptable content. For example,
  1302. // malware.
  1303. // "AUTOMATED_AD_CLICKING" - The ad automatically redirects to the
  1304. // destination site without a click,
  1305. // or reports a click when none were made.
  1306. // "INVALID_URL_PROTOCOL" - The ad uses URL protocols that do not
  1307. // exist or are not allowed on AdX.
  1308. // "UNDECLARED_RESTRICTED_CONTENT" - Restricted content (for example,
  1309. // alcohol) was found in the ad but not
  1310. // declared.
  1311. // "INVALID_REMARKETING_LIST_USAGE" - Violation of the remarketing
  1312. // list policy.
  1313. // "DESTINATION_SITE_NOT_CRAWLABLE_ROBOTS_TXT" - The destination
  1314. // site's robot.txt file prevents it from being crawled.
  1315. // "CLICK_TO_DOWNLOAD_NOT_AN_APP" - Click to download must link to an
  1316. // app.
  1317. // "INACCURATE_REVIEW_EXTENSION" - A review extension must be an
  1318. // accurate review.
  1319. // "SEXUALLY_EXPLICIT_CONTENT" - Sexually explicit content.
  1320. // "GAINING_AN_UNFAIR_ADVANTAGE" - The ad tries to gain an unfair
  1321. // traffic advantage.
  1322. // "GAMING_THE_GOOGLE_NETWORK" - The ad tries to circumvent Google's
  1323. // advertising systems.
  1324. // "DANGEROUS_PRODUCTS_KNIVES" - The ad promotes dangerous knives.
  1325. // "DANGEROUS_PRODUCTS_EXPLOSIVES" - The ad promotes explosives.
  1326. // "DANGEROUS_PRODUCTS_GUNS" - The ad promotes guns & parts.
  1327. // "DANGEROUS_PRODUCTS_DRUGS" - The ad promotes recreational
  1328. // drugs/services & related equipment.
  1329. // "DANGEROUS_PRODUCTS_TOBACCO" - The ad promotes tobacco
  1330. // products/services & related equipment.
  1331. // "DANGEROUS_PRODUCTS_WEAPONS" - The ad promotes weapons.
  1332. // "UNCLEAR_OR_IRRELEVANT_AD" - The ad is unclear or irrelevant to the
  1333. // destination site.
  1334. // "PROFESSIONAL_STANDARDS" - The ad does not meet professional
  1335. // standards.
  1336. // "DYSFUNCTIONAL_PROMOTION" - The promotion is unnecessarily
  1337. // difficult to navigate.
  1338. // "INVALID_INTEREST_BASED_AD" - Violation of Google's policy for
  1339. // interest-based ads.
  1340. // "MISUSE_OF_PERSONAL_INFORMATION" - Misuse of personal information.
  1341. // "OMISSION_OF_RELEVANT_INFORMATION" - Omission of relevant
  1342. // information.
  1343. // "UNAVAILABLE_PROMOTIONS" - Unavailable promotions.
  1344. // "MISLEADING_PROMOTIONS" - Misleading or unrealistic promotions.
  1345. // "INAPPROPRIATE_CONTENT" - Offensive or inappropriate content.
  1346. // "SENSITIVE_EVENTS" - Capitalizing on sensitive events.
  1347. // "SHOCKING_CONTENT" - Shocking content.
  1348. // "ENABLING_DISHONEST_BEHAVIOR" - Products & Services that enable
  1349. // dishonest behavior.
  1350. // "TECHNICAL_REQUIREMENTS" - The ad does not meet technical
  1351. // requirements.
  1352. // "RESTRICTED_POLITICAL_CONTENT" - Restricted political content.
  1353. // "UNSUPPORTED_CONTENT" - Unsupported content.
  1354. // "INVALID_BIDDING_METHOD" - Invalid bidding method.
  1355. // "VIDEO_TOO_LONG" - Video length exceeds limits.
  1356. // "VIOLATES_JAPANESE_PHARMACY_LAW" - Unacceptable content: Japanese
  1357. // healthcare.
  1358. // "UNACCREDITED_PET_PHARMACY" - Online pharmacy ID required.
  1359. // "ABORTION" - Unacceptable content: Abortion.
  1360. // "CONTRACEPTIVES" - Unacceptable content: Birth control.
  1361. // "NEED_CERTIFICATES_TO_ADVERTISE_IN_CHINA" - Restricted in China.
  1362. // "KCDSP_REGISTRATION" - Unacceptable content: Korean healthcare.
  1363. // "NOT_FAMILY_SAFE" - Non-family safe or adult content.
  1364. // "CLINICAL_TRIAL_RECRUITMENT" - Clinical trial recruitment.
  1365. // "MAXIMUM_NUMBER_OF_HTTP_CALLS_EXCEEDED" - Maximum number of HTTP
  1366. // calls exceeded.
  1367. // "MAXIMUM_NUMBER_OF_COOKIES_EXCEEDED" - Maximum number of cookies
  1368. // exceeded.
  1369. // "PERSONAL_LOANS" - Financial service ad does not adhere to
  1370. // specifications.
  1371. // "UNSUPPORTED_FLASH_CONTENT" - Flash content was found in an
  1372. // unsupported context.
  1373. // "MISUSE_BY_OMID_SCRIPT" - Misuse by an Open Measurement SDK script.
  1374. // "NON_WHITELISTED_OMID_VENDOR" - Use of an Open Measurement SDK
  1375. // vendor not on approved whitelist.
  1376. // "DESTINATION_EXPERIENCE" - Unacceptable landing page.
  1377. // "UNSUPPORTED_LANGUAGE" - Unsupported language.
  1378. // "NON_SSL_COMPLIANT" - Non-SSL compliant.
  1379. Reason string `json:"reason,omitempty"`
  1380. // ForceSendFields is a list of field names (e.g. "Details") to
  1381. // unconditionally include in API requests. By default, fields with
  1382. // empty values are omitted from API requests. However, any non-pointer,
  1383. // non-interface field appearing in ForceSendFields will be sent to the
  1384. // server regardless of whether the field is empty or not. This may be
  1385. // used to include empty fields in Patch requests.
  1386. ForceSendFields []string `json:"-"`
  1387. // NullFields is a list of field names (e.g. "Details") to include in
  1388. // API requests with the JSON null value. By default, fields with empty
  1389. // values are omitted from API requests. However, any field with an
  1390. // empty value appearing in NullFields will be sent to the server as
  1391. // null. It is an error if a field in this list has a non-empty value.
  1392. // This may be used to include null fields in Patch requests.
  1393. NullFields []string `json:"-"`
  1394. }
  1395. func (s *Disapproval) MarshalJSON() ([]byte, error) {
  1396. type NoMethod Disapproval
  1397. raw := NoMethod(*s)
  1398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1399. }
  1400. // Empty: A generic empty message that you can re-use to avoid defining
  1401. // duplicated
  1402. // empty messages in your APIs. A typical example is to use it as the
  1403. // request
  1404. // or the response type of an API method. For instance:
  1405. //
  1406. // service Foo {
  1407. // rpc Bar(google.protobuf.Empty) returns
  1408. // (google.protobuf.Empty);
  1409. // }
  1410. //
  1411. // The JSON representation for `Empty` is empty JSON object `{}`.
  1412. type Empty struct {
  1413. // ServerResponse contains the HTTP response code and headers from the
  1414. // server.
  1415. googleapi.ServerResponse `json:"-"`
  1416. }
  1417. // FilterSet: A set of filters that is applied to a request for
  1418. // data.
  1419. // Within a filter set, an AND operation is performed across the
  1420. // filters
  1421. // represented by each field. An OR operation is performed across the
  1422. // filters
  1423. // represented by the multiple values of a repeated field.
  1424. // E.g.
  1425. // "format=VIDEO AND deal_id=12 AND (seller_network_id=34
  1426. // OR
  1427. // seller_network_id=56)"
  1428. type FilterSet struct {
  1429. // AbsoluteDateRange: An absolute date range, defined by a start date
  1430. // and an end date.
  1431. // Interpreted relative to Pacific time zone.
  1432. AbsoluteDateRange *AbsoluteDateRange `json:"absoluteDateRange,omitempty"`
  1433. // CreativeId: The ID of the creative on which to filter; optional. This
  1434. // field may be set
  1435. // only for a filter set that accesses account-level troubleshooting
  1436. // data,
  1437. // i.e. one whose name matches the
  1438. // `bidders/*/accounts/*/filterSets/*`
  1439. // pattern.
  1440. CreativeId string `json:"creativeId,omitempty"`
  1441. // DealId: The ID of the deal on which to filter; optional. This field
  1442. // may be set
  1443. // only for a filter set that accesses account-level troubleshooting
  1444. // data,
  1445. // i.e. one whose name matches the
  1446. // `bidders/*/accounts/*/filterSets/*`
  1447. // pattern.
  1448. DealId int64 `json:"dealId,omitempty,string"`
  1449. // Environment: The environment on which to filter; optional.
  1450. //
  1451. // Possible values:
  1452. // "ENVIRONMENT_UNSPECIFIED" - A placeholder for an undefined
  1453. // environment; indicates that no environment
  1454. // filter will be applied.
  1455. // "WEB" - The ad impression appears on the web.
  1456. // "APP" - The ad impression appears in an app.
  1457. Environment string `json:"environment,omitempty"`
  1458. // Formats: The list of formats on which to filter; may be empty. The
  1459. // filters
  1460. // represented by multiple formats are ORed together (i.e. if
  1461. // non-empty,
  1462. // results must match any one of the formats).
  1463. //
  1464. // Possible values:
  1465. // "FORMAT_UNSPECIFIED" - A placeholder for an undefined format;
  1466. // indicates that no format filter
  1467. // will be applied.
  1468. // "NATIVE_DISPLAY" - The ad impression is a native ad, and display
  1469. // (i.e. image) format.
  1470. // "NATIVE_VIDEO" - The ad impression is a native ad, and video
  1471. // format.
  1472. // "NON_NATIVE_DISPLAY" - The ad impression is not a native ad, and
  1473. // display (i.e. image) format.
  1474. // "NON_NATIVE_VIDEO" - The ad impression is not a native ad, and
  1475. // video format.
  1476. Formats []string `json:"formats,omitempty"`
  1477. // Name: A user-defined name of the filter set. Filter set names must be
  1478. // unique
  1479. // globally and match one of the patterns:
  1480. //
  1481. // - `bidders/*/filterSets/*` (for accessing bidder-level
  1482. // troubleshooting
  1483. // data)
  1484. // - `bidders/*/accounts/*/filterSets/*` (for accessing
  1485. // account-level
  1486. // troubleshooting data)
  1487. //
  1488. // This field is required in create operations.
  1489. Name string `json:"name,omitempty"`
  1490. // Platforms: The list of platforms on which to filter; may be empty.
  1491. // The filters
  1492. // represented by multiple platforms are ORed together (i.e. if
  1493. // non-empty,
  1494. // results must match any one of the platforms).
  1495. //
  1496. // Possible values:
  1497. // "PLATFORM_UNSPECIFIED" - A placeholder for an undefined platform;
  1498. // indicates that no platform
  1499. // filter will be applied.
  1500. // "DESKTOP" - The ad impression appears on a desktop.
  1501. // "TABLET" - The ad impression appears on a tablet.
  1502. // "MOBILE" - The ad impression appears on a mobile device.
  1503. Platforms []string `json:"platforms,omitempty"`
  1504. // PublisherIdentifiers: For Exchange Bidding buyers only.
  1505. // The list of publisher identifiers on which to filter; may be
  1506. // empty.
  1507. // The filters represented by multiple publisher identifiers are
  1508. // ORed
  1509. // together.
  1510. PublisherIdentifiers []string `json:"publisherIdentifiers,omitempty"`
  1511. // RealtimeTimeRange: An open-ended realtime time range, defined by the
  1512. // aggregation start
  1513. // timestamp.
  1514. RealtimeTimeRange *RealtimeTimeRange `json:"realtimeTimeRange,omitempty"`
  1515. // RelativeDateRange: A relative date range, defined by an offset from
  1516. // today and a duration.
  1517. // Interpreted relative to Pacific time zone.
  1518. RelativeDateRange *RelativeDateRange `json:"relativeDateRange,omitempty"`
  1519. // SellerNetworkIds: For Ad Exchange buyers only.
  1520. // The list of IDs of the seller (publisher) networks on which to
  1521. // filter;
  1522. // may be empty. The filters represented by multiple seller network IDs
  1523. // are
  1524. // ORed together (i.e. if non-empty, results must match any one of
  1525. // the
  1526. // publisher networks).
  1527. // See
  1528. // [seller-network-ids](https://developers.google.com/ad-exchange/rtb/dow
  1529. // nloads/seller-network-ids)
  1530. // file for the set of existing seller network IDs.
  1531. SellerNetworkIds []int64 `json:"sellerNetworkIds,omitempty"`
  1532. // TimeSeriesGranularity: The granularity of time intervals if a time
  1533. // series breakdown is desired;
  1534. // optional.
  1535. //
  1536. // Possible values:
  1537. // "TIME_SERIES_GRANULARITY_UNSPECIFIED" - A placeholder for an
  1538. // unspecified interval; no time series is applied.
  1539. // All rows in response will contain data for the entire requested time
  1540. // range.
  1541. // "HOURLY" - Indicates that data will be broken down by the hour.
  1542. // "DAILY" - Indicates that data will be broken down by the day.
  1543. TimeSeriesGranularity string `json:"timeSeriesGranularity,omitempty"`
  1544. // ServerResponse contains the HTTP response code and headers from the
  1545. // server.
  1546. googleapi.ServerResponse `json:"-"`
  1547. // ForceSendFields is a list of field names (e.g. "AbsoluteDateRange")
  1548. // to unconditionally include in API requests. By default, fields with
  1549. // empty values are omitted from API requests. However, any non-pointer,
  1550. // non-interface field appearing in ForceSendFields will be sent to the
  1551. // server regardless of whether the field is empty or not. This may be
  1552. // used to include empty fields in Patch requests.
  1553. ForceSendFields []string `json:"-"`
  1554. // NullFields is a list of field names (e.g. "AbsoluteDateRange") to
  1555. // include in API requests with the JSON null value. By default, fields
  1556. // with empty values are omitted from API requests. However, any field
  1557. // with an empty value appearing in NullFields will be sent to the
  1558. // server as null. It is an error if a field in this list has a
  1559. // non-empty value. This may be used to include null fields in Patch
  1560. // requests.
  1561. NullFields []string `json:"-"`
  1562. }
  1563. func (s *FilterSet) MarshalJSON() ([]byte, error) {
  1564. type NoMethod FilterSet
  1565. raw := NoMethod(*s)
  1566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1567. }
  1568. // FilteredBidCreativeRow: The number of filtered bids with the
  1569. // specified dimension values that have the
  1570. // specified creative.
  1571. type FilteredBidCreativeRow struct {
  1572. // BidCount: The number of bids with the specified creative.
  1573. BidCount *MetricValue `json:"bidCount,omitempty"`
  1574. // CreativeId: The ID of the creative.
  1575. CreativeId string `json:"creativeId,omitempty"`
  1576. // RowDimensions: The values of all dimensions associated with metric
  1577. // values in this row.
  1578. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  1579. // ForceSendFields is a list of field names (e.g. "BidCount") to
  1580. // unconditionally include in API requests. By default, fields with
  1581. // empty values are omitted from API requests. However, any non-pointer,
  1582. // non-interface field appearing in ForceSendFields will be sent to the
  1583. // server regardless of whether the field is empty or not. This may be
  1584. // used to include empty fields in Patch requests.
  1585. ForceSendFields []string `json:"-"`
  1586. // NullFields is a list of field names (e.g. "BidCount") to include in
  1587. // API requests with the JSON null value. By default, fields with empty
  1588. // values are omitted from API requests. However, any field with an
  1589. // empty value appearing in NullFields will be sent to the server as
  1590. // null. It is an error if a field in this list has a non-empty value.
  1591. // This may be used to include null fields in Patch requests.
  1592. NullFields []string `json:"-"`
  1593. }
  1594. func (s *FilteredBidCreativeRow) MarshalJSON() ([]byte, error) {
  1595. type NoMethod FilteredBidCreativeRow
  1596. raw := NoMethod(*s)
  1597. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1598. }
  1599. // FilteredBidDetailRow: The number of filtered bids with the specified
  1600. // dimension values, among those
  1601. // filtered due to the requested filtering reason (i.e. creative
  1602. // status), that
  1603. // have the specified detail.
  1604. type FilteredBidDetailRow struct {
  1605. // BidCount: The number of bids with the specified detail.
  1606. BidCount *MetricValue `json:"bidCount,omitempty"`
  1607. // DetailId: The ID of the detail. The associated value can be looked up
  1608. // in the
  1609. // dictionary file corresponding to the DetailType in the response
  1610. // message.
  1611. DetailId int64 `json:"detailId,omitempty"`
  1612. // RowDimensions: The values of all dimensions associated with metric
  1613. // values in this row.
  1614. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  1615. // ForceSendFields is a list of field names (e.g. "BidCount") to
  1616. // unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "BidCount") to include in
  1623. // API requests with the JSON null value. By default, fields with empty
  1624. // values are omitted from API requests. However, any field with an
  1625. // empty value appearing in NullFields will be sent to the server as
  1626. // null. It is an error if a field in this list has a non-empty value.
  1627. // This may be used to include null fields in Patch requests.
  1628. NullFields []string `json:"-"`
  1629. }
  1630. func (s *FilteredBidDetailRow) MarshalJSON() ([]byte, error) {
  1631. type NoMethod FilteredBidDetailRow
  1632. raw := NoMethod(*s)
  1633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1634. }
  1635. // FilteringStats: @OutputOnly Filtering reasons for this creative
  1636. // during a period of a single
  1637. // day (from midnight to midnight Pacific).
  1638. type FilteringStats struct {
  1639. // Date: The day during which the data was collected.
  1640. // The data is collected from 00:00:00 to 23:59:59 PT.
  1641. // During switches from PST to PDT and back, the day may
  1642. // contain 23 or 25 hours of data instead of the usual 24.
  1643. Date *Date `json:"date,omitempty"`
  1644. // Reasons: The set of filtering reasons for this date.
  1645. Reasons []*Reason `json:"reasons,omitempty"`
  1646. // ForceSendFields is a list of field names (e.g. "Date") to
  1647. // unconditionally include in API requests. By default, fields with
  1648. // empty values are omitted from API requests. However, any non-pointer,
  1649. // non-interface field appearing in ForceSendFields will be sent to the
  1650. // server regardless of whether the field is empty or not. This may be
  1651. // used to include empty fields in Patch requests.
  1652. ForceSendFields []string `json:"-"`
  1653. // NullFields is a list of field names (e.g. "Date") to include in API
  1654. // requests with the JSON null value. By default, fields with empty
  1655. // values are omitted from API requests. However, any field with an
  1656. // empty value appearing in NullFields will be sent to the server as
  1657. // null. It is an error if a field in this list has a non-empty value.
  1658. // This may be used to include null fields in Patch requests.
  1659. NullFields []string `json:"-"`
  1660. }
  1661. func (s *FilteringStats) MarshalJSON() ([]byte, error) {
  1662. type NoMethod FilteringStats
  1663. raw := NoMethod(*s)
  1664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1665. }
  1666. // HtmlContent: HTML content for a creative.
  1667. type HtmlContent struct {
  1668. // Height: The height of the HTML snippet in pixels.
  1669. Height int64 `json:"height,omitempty"`
  1670. // Snippet: The HTML snippet that displays the ad when inserted in the
  1671. // web page.
  1672. Snippet string `json:"snippet,omitempty"`
  1673. // Width: The width of the HTML snippet in pixels.
  1674. Width int64 `json:"width,omitempty"`
  1675. // ForceSendFields is a list of field names (e.g. "Height") to
  1676. // unconditionally include in API requests. By default, fields with
  1677. // empty values are omitted from API requests. However, any non-pointer,
  1678. // non-interface field appearing in ForceSendFields will be sent to the
  1679. // server regardless of whether the field is empty or not. This may be
  1680. // used to include empty fields in Patch requests.
  1681. ForceSendFields []string `json:"-"`
  1682. // NullFields is a list of field names (e.g. "Height") to include in API
  1683. // requests with the JSON null value. By default, fields with empty
  1684. // values are omitted from API requests. However, any field with an
  1685. // empty value appearing in NullFields will be sent to the server as
  1686. // null. It is an error if a field in this list has a non-empty value.
  1687. // This may be used to include null fields in Patch requests.
  1688. NullFields []string `json:"-"`
  1689. }
  1690. func (s *HtmlContent) MarshalJSON() ([]byte, error) {
  1691. type NoMethod HtmlContent
  1692. raw := NoMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1694. }
  1695. // Image: An image resource. You may provide a larger image than was
  1696. // requested,
  1697. // so long as the aspect ratio is preserved.
  1698. type Image struct {
  1699. // Height: Image height in pixels.
  1700. Height int64 `json:"height,omitempty"`
  1701. // Url: The URL of the image.
  1702. Url string `json:"url,omitempty"`
  1703. // Width: Image width in pixels.
  1704. Width int64 `json:"width,omitempty"`
  1705. // ForceSendFields is a list of field names (e.g. "Height") to
  1706. // unconditionally include in API requests. By default, fields with
  1707. // empty values are omitted from API requests. However, any non-pointer,
  1708. // non-interface field appearing in ForceSendFields will be sent to the
  1709. // server regardless of whether the field is empty or not. This may be
  1710. // used to include empty fields in Patch requests.
  1711. ForceSendFields []string `json:"-"`
  1712. // NullFields is a list of field names (e.g. "Height") to include in API
  1713. // requests with the JSON null value. By default, fields with empty
  1714. // values are omitted from API requests. However, any field with an
  1715. // empty value appearing in NullFields will be sent to the server as
  1716. // null. It is an error if a field in this list has a non-empty value.
  1717. // This may be used to include null fields in Patch requests.
  1718. NullFields []string `json:"-"`
  1719. }
  1720. func (s *Image) MarshalJSON() ([]byte, error) {
  1721. type NoMethod Image
  1722. raw := NoMethod(*s)
  1723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1724. }
  1725. // ImpressionMetricsRow: The set of metrics that are measured in numbers
  1726. // of impressions, representing
  1727. // how many impressions with the specified dimension values were
  1728. // considered
  1729. // eligible at each stage of the bidding funnel.
  1730. type ImpressionMetricsRow struct {
  1731. // AvailableImpressions: The number of impressions available to the
  1732. // buyer on Ad Exchange.
  1733. // In some cases this value may be unavailable.
  1734. AvailableImpressions *MetricValue `json:"availableImpressions,omitempty"`
  1735. // BidRequests: The number of impressions for which Ad Exchange sent the
  1736. // buyer a bid
  1737. // request.
  1738. BidRequests *MetricValue `json:"bidRequests,omitempty"`
  1739. // InventoryMatches: The number of impressions that match the buyer's
  1740. // inventory pretargeting.
  1741. InventoryMatches *MetricValue `json:"inventoryMatches,omitempty"`
  1742. // ResponsesWithBids: The number of impressions for which Ad Exchange
  1743. // received a response from
  1744. // the buyer that contained at least one applicable bid.
  1745. ResponsesWithBids *MetricValue `json:"responsesWithBids,omitempty"`
  1746. // RowDimensions: The values of all dimensions associated with metric
  1747. // values in this row.
  1748. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  1749. // SuccessfulResponses: The number of impressions for which the buyer
  1750. // successfully sent a response
  1751. // to Ad Exchange.
  1752. SuccessfulResponses *MetricValue `json:"successfulResponses,omitempty"`
  1753. // ForceSendFields is a list of field names (e.g.
  1754. // "AvailableImpressions") to unconditionally include in API requests.
  1755. // By default, fields with empty values are omitted from API requests.
  1756. // However, any non-pointer, non-interface field appearing in
  1757. // ForceSendFields will be sent to the server regardless of whether the
  1758. // field is empty or not. This may be used to include empty fields in
  1759. // Patch requests.
  1760. ForceSendFields []string `json:"-"`
  1761. // NullFields is a list of field names (e.g. "AvailableImpressions") to
  1762. // include in API requests with the JSON null value. By default, fields
  1763. // with empty values are omitted from API requests. However, any field
  1764. // with an empty value appearing in NullFields will be sent to the
  1765. // server as null. It is an error if a field in this list has a
  1766. // non-empty value. This may be used to include null fields in Patch
  1767. // requests.
  1768. NullFields []string `json:"-"`
  1769. }
  1770. func (s *ImpressionMetricsRow) MarshalJSON() ([]byte, error) {
  1771. type NoMethod ImpressionMetricsRow
  1772. raw := NoMethod(*s)
  1773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1774. }
  1775. // ListBidMetricsResponse: Response message for listing the metrics that
  1776. // are measured in number of bids.
  1777. type ListBidMetricsResponse struct {
  1778. // BidMetricsRows: List of rows, each containing a set of bid metrics.
  1779. BidMetricsRows []*BidMetricsRow `json:"bidMetricsRows,omitempty"`
  1780. // NextPageToken: A token to retrieve the next page of results.
  1781. // Pass this value in the
  1782. // ListBidMetricsRequest.pageToken
  1783. // field in the subsequent call to the bidMetrics.list
  1784. // method to retrieve the next page of results.
  1785. NextPageToken string `json:"nextPageToken,omitempty"`
  1786. // ServerResponse contains the HTTP response code and headers from the
  1787. // server.
  1788. googleapi.ServerResponse `json:"-"`
  1789. // ForceSendFields is a list of field names (e.g. "BidMetricsRows") to
  1790. // unconditionally include in API requests. By default, fields with
  1791. // empty values are omitted from API requests. However, any non-pointer,
  1792. // non-interface field appearing in ForceSendFields will be sent to the
  1793. // server regardless of whether the field is empty or not. This may be
  1794. // used to include empty fields in Patch requests.
  1795. ForceSendFields []string `json:"-"`
  1796. // NullFields is a list of field names (e.g. "BidMetricsRows") to
  1797. // include in API requests with the JSON null value. By default, fields
  1798. // with empty values are omitted from API requests. However, any field
  1799. // with an empty value appearing in NullFields will be sent to the
  1800. // server as null. It is an error if a field in this list has a
  1801. // non-empty value. This may be used to include null fields in Patch
  1802. // requests.
  1803. NullFields []string `json:"-"`
  1804. }
  1805. func (s *ListBidMetricsResponse) MarshalJSON() ([]byte, error) {
  1806. type NoMethod ListBidMetricsResponse
  1807. raw := NoMethod(*s)
  1808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1809. }
  1810. // ListBidResponseErrorsResponse: Response message for listing all
  1811. // reasons that bid responses resulted in an
  1812. // error.
  1813. type ListBidResponseErrorsResponse struct {
  1814. // CalloutStatusRows: List of rows, with counts of bid responses
  1815. // aggregated by callout status.
  1816. CalloutStatusRows []*CalloutStatusRow `json:"calloutStatusRows,omitempty"`
  1817. // NextPageToken: A token to retrieve the next page of results.
  1818. // Pass this value in the
  1819. // ListBidResponseErrorsRequest.pageToken
  1820. // field in the subsequent call to the bidResponseErrors.list
  1821. // method to retrieve the next page of results.
  1822. NextPageToken string `json:"nextPageToken,omitempty"`
  1823. // ServerResponse contains the HTTP response code and headers from the
  1824. // server.
  1825. googleapi.ServerResponse `json:"-"`
  1826. // ForceSendFields is a list of field names (e.g. "CalloutStatusRows")
  1827. // to unconditionally include in API requests. By default, fields with
  1828. // empty values are omitted from API requests. However, any non-pointer,
  1829. // non-interface field appearing in ForceSendFields will be sent to the
  1830. // server regardless of whether the field is empty or not. This may be
  1831. // used to include empty fields in Patch requests.
  1832. ForceSendFields []string `json:"-"`
  1833. // NullFields is a list of field names (e.g. "CalloutStatusRows") to
  1834. // include in API requests with the JSON null value. By default, fields
  1835. // with empty values are omitted from API requests. However, any field
  1836. // with an empty value appearing in NullFields will be sent to the
  1837. // server as null. It is an error if a field in this list has a
  1838. // non-empty value. This may be used to include null fields in Patch
  1839. // requests.
  1840. NullFields []string `json:"-"`
  1841. }
  1842. func (s *ListBidResponseErrorsResponse) MarshalJSON() ([]byte, error) {
  1843. type NoMethod ListBidResponseErrorsResponse
  1844. raw := NoMethod(*s)
  1845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1846. }
  1847. // ListBidResponsesWithoutBidsResponse: Response message for listing all
  1848. // reasons that bid responses were considered
  1849. // to have no applicable bids.
  1850. type ListBidResponsesWithoutBidsResponse struct {
  1851. // BidResponseWithoutBidsStatusRows: List of rows, with counts of bid
  1852. // responses without bids aggregated by
  1853. // status.
  1854. BidResponseWithoutBidsStatusRows []*BidResponseWithoutBidsStatusRow `json:"bidResponseWithoutBidsStatusRows,omitempty"`
  1855. // NextPageToken: A token to retrieve the next page of results.
  1856. // Pass this value in
  1857. // the
  1858. // ListBidResponsesWithoutBidsRequest.pageToken
  1859. // field in the subsequent call to the
  1860. // bidResponsesWithoutBids.list
  1861. // method to retrieve the next page of results.
  1862. NextPageToken string `json:"nextPageToken,omitempty"`
  1863. // ServerResponse contains the HTTP response code and headers from the
  1864. // server.
  1865. googleapi.ServerResponse `json:"-"`
  1866. // ForceSendFields is a list of field names (e.g.
  1867. // "BidResponseWithoutBidsStatusRows") to unconditionally include in API
  1868. // requests. By default, fields with empty values are omitted from API
  1869. // requests. However, any non-pointer, non-interface field appearing in
  1870. // ForceSendFields will be sent to the server regardless of whether the
  1871. // field is empty or not. This may be used to include empty fields in
  1872. // Patch requests.
  1873. ForceSendFields []string `json:"-"`
  1874. // NullFields is a list of field names (e.g.
  1875. // "BidResponseWithoutBidsStatusRows") to include in API requests with
  1876. // the JSON null value. By default, fields with empty values are omitted
  1877. // from API requests. However, any field with an empty value appearing
  1878. // in NullFields will be sent to the server as null. It is an error if a
  1879. // field in this list has a non-empty value. This may be used to include
  1880. // null fields in Patch requests.
  1881. NullFields []string `json:"-"`
  1882. }
  1883. func (s *ListBidResponsesWithoutBidsResponse) MarshalJSON() ([]byte, error) {
  1884. type NoMethod ListBidResponsesWithoutBidsResponse
  1885. raw := NoMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1887. }
  1888. type ListClientUserInvitationsResponse struct {
  1889. // Invitations: The returned list of client users.
  1890. Invitations []*ClientUserInvitation `json:"invitations,omitempty"`
  1891. // NextPageToken: A token to retrieve the next page of results.
  1892. // Pass this value in
  1893. // the
  1894. // ListClientUserInvitationsRequest.pageToken
  1895. // field in the subsequent call to the
  1896. // clients.invitations.list
  1897. // method to retrieve the next
  1898. // page of results.
  1899. NextPageToken string `json:"nextPageToken,omitempty"`
  1900. // ServerResponse contains the HTTP response code and headers from the
  1901. // server.
  1902. googleapi.ServerResponse `json:"-"`
  1903. // ForceSendFields is a list of field names (e.g. "Invitations") to
  1904. // unconditionally include in API requests. By default, fields with
  1905. // empty values are omitted from API requests. However, any non-pointer,
  1906. // non-interface field appearing in ForceSendFields will be sent to the
  1907. // server regardless of whether the field is empty or not. This may be
  1908. // used to include empty fields in Patch requests.
  1909. ForceSendFields []string `json:"-"`
  1910. // NullFields is a list of field names (e.g. "Invitations") to include
  1911. // in API requests with the JSON null value. By default, fields with
  1912. // empty values are omitted from API requests. However, any field with
  1913. // an empty value appearing in NullFields will be sent to the server as
  1914. // null. It is an error if a field in this list has a non-empty value.
  1915. // This may be used to include null fields in Patch requests.
  1916. NullFields []string `json:"-"`
  1917. }
  1918. func (s *ListClientUserInvitationsResponse) MarshalJSON() ([]byte, error) {
  1919. type NoMethod ListClientUserInvitationsResponse
  1920. raw := NoMethod(*s)
  1921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1922. }
  1923. type ListClientUsersResponse struct {
  1924. // NextPageToken: A token to retrieve the next page of results.
  1925. // Pass this value in the
  1926. // ListClientUsersRequest.pageToken
  1927. // field in the subsequent call to the
  1928. // clients.invitations.list
  1929. // method to retrieve the next
  1930. // page of results.
  1931. NextPageToken string `json:"nextPageToken,omitempty"`
  1932. // Users: The returned list of client users.
  1933. Users []*ClientUser `json:"users,omitempty"`
  1934. // ServerResponse contains the HTTP response code and headers from the
  1935. // server.
  1936. googleapi.ServerResponse `json:"-"`
  1937. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1938. // unconditionally include in API requests. By default, fields with
  1939. // empty values are omitted from API requests. However, any non-pointer,
  1940. // non-interface field appearing in ForceSendFields will be sent to the
  1941. // server regardless of whether the field is empty or not. This may be
  1942. // used to include empty fields in Patch requests.
  1943. ForceSendFields []string `json:"-"`
  1944. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1945. // in API requests with the JSON null value. By default, fields with
  1946. // empty values are omitted from API requests. However, any field with
  1947. // an empty value appearing in NullFields will be sent to the server as
  1948. // null. It is an error if a field in this list has a non-empty value.
  1949. // This may be used to include null fields in Patch requests.
  1950. NullFields []string `json:"-"`
  1951. }
  1952. func (s *ListClientUsersResponse) MarshalJSON() ([]byte, error) {
  1953. type NoMethod ListClientUsersResponse
  1954. raw := NoMethod(*s)
  1955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1956. }
  1957. type ListClientsResponse struct {
  1958. // Clients: The returned list of clients.
  1959. Clients []*Client `json:"clients,omitempty"`
  1960. // NextPageToken: A token to retrieve the next page of results.
  1961. // Pass this value in the
  1962. // ListClientsRequest.pageToken
  1963. // field in the subsequent call to the
  1964. // accounts.clients.list method
  1965. // to retrieve the next page of results.
  1966. NextPageToken string `json:"nextPageToken,omitempty"`
  1967. // ServerResponse contains the HTTP response code and headers from the
  1968. // server.
  1969. googleapi.ServerResponse `json:"-"`
  1970. // ForceSendFields is a list of field names (e.g. "Clients") to
  1971. // unconditionally include in API requests. By default, fields with
  1972. // empty values are omitted from API requests. However, any non-pointer,
  1973. // non-interface field appearing in ForceSendFields will be sent to the
  1974. // server regardless of whether the field is empty or not. This may be
  1975. // used to include empty fields in Patch requests.
  1976. ForceSendFields []string `json:"-"`
  1977. // NullFields is a list of field names (e.g. "Clients") to include in
  1978. // API requests with the JSON null value. By default, fields with empty
  1979. // values are omitted from API requests. However, any field with an
  1980. // empty value appearing in NullFields will be sent to the server as
  1981. // null. It is an error if a field in this list has a non-empty value.
  1982. // This may be used to include null fields in Patch requests.
  1983. NullFields []string `json:"-"`
  1984. }
  1985. func (s *ListClientsResponse) MarshalJSON() ([]byte, error) {
  1986. type NoMethod ListClientsResponse
  1987. raw := NoMethod(*s)
  1988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1989. }
  1990. // ListCreativeStatusBreakdownByCreativeResponse: Response message for
  1991. // listing all creatives associated with a given filtered
  1992. // bid reason.
  1993. type ListCreativeStatusBreakdownByCreativeResponse struct {
  1994. // FilteredBidCreativeRows: List of rows, with counts of bids with a
  1995. // given creative status aggregated
  1996. // by creative.
  1997. FilteredBidCreativeRows []*FilteredBidCreativeRow `json:"filteredBidCreativeRows,omitempty"`
  1998. // NextPageToken: A token to retrieve the next page of results.
  1999. // Pass this value in
  2000. // the
  2001. // ListCreativeStatusBreakdownByCreativeRequest.pageToken
  2002. // field in the subsequent call to the
  2003. // filteredBids.creatives.list
  2004. // method to retrieve the next page of results.
  2005. NextPageToken string `json:"nextPageToken,omitempty"`
  2006. // ServerResponse contains the HTTP response code and headers from the
  2007. // server.
  2008. googleapi.ServerResponse `json:"-"`
  2009. // ForceSendFields is a list of field names (e.g.
  2010. // "FilteredBidCreativeRows") to unconditionally include in API
  2011. // requests. By default, fields with empty values are omitted from API
  2012. // requests. However, any non-pointer, non-interface field appearing in
  2013. // ForceSendFields will be sent to the server regardless of whether the
  2014. // field is empty or not. This may be used to include empty fields in
  2015. // Patch requests.
  2016. ForceSendFields []string `json:"-"`
  2017. // NullFields is a list of field names (e.g. "FilteredBidCreativeRows")
  2018. // to include in API requests with the JSON null value. By default,
  2019. // fields with empty values are omitted from API requests. However, any
  2020. // field with an empty value appearing in NullFields will be sent to the
  2021. // server as null. It is an error if a field in this list has a
  2022. // non-empty value. This may be used to include null fields in Patch
  2023. // requests.
  2024. NullFields []string `json:"-"`
  2025. }
  2026. func (s *ListCreativeStatusBreakdownByCreativeResponse) MarshalJSON() ([]byte, error) {
  2027. type NoMethod ListCreativeStatusBreakdownByCreativeResponse
  2028. raw := NoMethod(*s)
  2029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2030. }
  2031. // ListCreativeStatusBreakdownByDetailResponse: Response message for
  2032. // listing all details associated with a given filtered bid
  2033. // reason.
  2034. type ListCreativeStatusBreakdownByDetailResponse struct {
  2035. // DetailType: The type of detail that the detail IDs represent.
  2036. //
  2037. // Possible values:
  2038. // "DETAIL_TYPE_UNSPECIFIED" - A placeholder for an undefined
  2039. // status.
  2040. // This value will never be returned in responses.
  2041. // "CREATIVE_ATTRIBUTE" - Indicates that the detail ID refers to a
  2042. // creative attribute;
  2043. // see
  2044. // [publisher-excludable-creative-attributes](https://developers.goog
  2045. // le.com/ad-exchange/rtb/downloads/publisher-excludable-creative-attribu
  2046. // tes).
  2047. // "VENDOR" - Indicates that the detail ID refers to a vendor;
  2048. // see
  2049. // [vendors](https://developers.google.com/ad-exchange/rtb/downloads/
  2050. // vendors).
  2051. // "SENSITIVE_CATEGORY" - Indicates that the detail ID refers to a
  2052. // sensitive category;
  2053. // see
  2054. // [ad-sensitive-categories](https://developers.google.com/ad-exchang
  2055. // e/rtb/downloads/ad-sensitive-categories).
  2056. // "PRODUCT_CATEGORY" - Indicates that the detail ID refers to a
  2057. // product category;
  2058. // see
  2059. // [ad-product-categories](https://developers.google.com/ad-exchange/
  2060. // rtb/downloads/ad-product-categories).
  2061. // "DISAPPROVAL_REASON" - Indicates that the detail ID refers to a
  2062. // disapproval reason; see
  2063. // DisapprovalReason enum in
  2064. // [snippet-status-report-proto](https://developers.google.com/ad-exchang
  2065. // e/rtb/downloads/snippet-status-report-proto).
  2066. DetailType string `json:"detailType,omitempty"`
  2067. // FilteredBidDetailRows: List of rows, with counts of bids with a given
  2068. // creative status aggregated
  2069. // by detail.
  2070. FilteredBidDetailRows []*FilteredBidDetailRow `json:"filteredBidDetailRows,omitempty"`
  2071. // NextPageToken: A token to retrieve the next page of results.
  2072. // Pass this value in
  2073. // the
  2074. // ListCreativeStatusBreakdownByDetailRequest.pageToken
  2075. // field in the subsequent call to the filteredBids.details.list
  2076. // method to retrieve the next page of results.
  2077. NextPageToken string `json:"nextPageToken,omitempty"`
  2078. // ServerResponse contains the HTTP response code and headers from the
  2079. // server.
  2080. googleapi.ServerResponse `json:"-"`
  2081. // ForceSendFields is a list of field names (e.g. "DetailType") to
  2082. // unconditionally include in API requests. By default, fields with
  2083. // empty values are omitted from API requests. However, any non-pointer,
  2084. // non-interface field appearing in ForceSendFields will be sent to the
  2085. // server regardless of whether the field is empty or not. This may be
  2086. // used to include empty fields in Patch requests.
  2087. ForceSendFields []string `json:"-"`
  2088. // NullFields is a list of field names (e.g. "DetailType") to include in
  2089. // API requests with the JSON null value. By default, fields with empty
  2090. // values are omitted from API requests. However, any field with an
  2091. // empty value appearing in NullFields will be sent to the server as
  2092. // null. It is an error if a field in this list has a non-empty value.
  2093. // This may be used to include null fields in Patch requests.
  2094. NullFields []string `json:"-"`
  2095. }
  2096. func (s *ListCreativeStatusBreakdownByDetailResponse) MarshalJSON() ([]byte, error) {
  2097. type NoMethod ListCreativeStatusBreakdownByDetailResponse
  2098. raw := NoMethod(*s)
  2099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2100. }
  2101. // ListCreativesResponse: A response for listing creatives.
  2102. type ListCreativesResponse struct {
  2103. // Creatives: The list of creatives.
  2104. Creatives []*Creative `json:"creatives,omitempty"`
  2105. // NextPageToken: A token to retrieve the next page of results.
  2106. // Pass this value in the
  2107. // ListCreativesRequest.page_token
  2108. // field in the subsequent call to `ListCreatives` method to retrieve
  2109. // the next
  2110. // page of results.
  2111. NextPageToken string `json:"nextPageToken,omitempty"`
  2112. // ServerResponse contains the HTTP response code and headers from the
  2113. // server.
  2114. googleapi.ServerResponse `json:"-"`
  2115. // ForceSendFields is a list of field names (e.g. "Creatives") to
  2116. // unconditionally include in API requests. By default, fields with
  2117. // empty values are omitted from API requests. However, any non-pointer,
  2118. // non-interface field appearing in ForceSendFields will be sent to the
  2119. // server regardless of whether the field is empty or not. This may be
  2120. // used to include empty fields in Patch requests.
  2121. ForceSendFields []string `json:"-"`
  2122. // NullFields is a list of field names (e.g. "Creatives") to include in
  2123. // API requests with the JSON null value. By default, fields with empty
  2124. // values are omitted from API requests. However, any field with an
  2125. // empty value appearing in NullFields will be sent to the server as
  2126. // null. It is an error if a field in this list has a non-empty value.
  2127. // This may be used to include null fields in Patch requests.
  2128. NullFields []string `json:"-"`
  2129. }
  2130. func (s *ListCreativesResponse) MarshalJSON() ([]byte, error) {
  2131. type NoMethod ListCreativesResponse
  2132. raw := NoMethod(*s)
  2133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2134. }
  2135. // ListDealAssociationsResponse: A response for listing creative and
  2136. // deal associations
  2137. type ListDealAssociationsResponse struct {
  2138. // Associations: The list of associations.
  2139. Associations []*CreativeDealAssociation `json:"associations,omitempty"`
  2140. // NextPageToken: A token to retrieve the next page of results.
  2141. // Pass this value in the
  2142. // ListDealAssociationsRequest.page_token
  2143. // field in the subsequent call to 'ListDealAssociation' method to
  2144. // retrieve
  2145. // the next page of results.
  2146. NextPageToken string `json:"nextPageToken,omitempty"`
  2147. // ServerResponse contains the HTTP response code and headers from the
  2148. // server.
  2149. googleapi.ServerResponse `json:"-"`
  2150. // ForceSendFields is a list of field names (e.g. "Associations") to
  2151. // unconditionally include in API requests. By default, fields with
  2152. // empty values are omitted from API requests. However, any non-pointer,
  2153. // non-interface field appearing in ForceSendFields will be sent to the
  2154. // server regardless of whether the field is empty or not. This may be
  2155. // used to include empty fields in Patch requests.
  2156. ForceSendFields []string `json:"-"`
  2157. // NullFields is a list of field names (e.g. "Associations") to include
  2158. // in API requests with the JSON null value. By default, fields with
  2159. // empty values are omitted from API requests. However, any field with
  2160. // an empty value appearing in NullFields will be sent to the server as
  2161. // null. It is an error if a field in this list has a non-empty value.
  2162. // This may be used to include null fields in Patch requests.
  2163. NullFields []string `json:"-"`
  2164. }
  2165. func (s *ListDealAssociationsResponse) MarshalJSON() ([]byte, error) {
  2166. type NoMethod ListDealAssociationsResponse
  2167. raw := NoMethod(*s)
  2168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2169. }
  2170. // ListFilterSetsResponse: Response message for listing filter sets.
  2171. type ListFilterSetsResponse struct {
  2172. // FilterSets: The filter sets belonging to the buyer.
  2173. FilterSets []*FilterSet `json:"filterSets,omitempty"`
  2174. // NextPageToken: A token to retrieve the next page of results.
  2175. // Pass this value in the
  2176. // ListFilterSetsRequest.pageToken
  2177. // field in the subsequent call to the
  2178. // accounts.filterSets.list
  2179. // method to retrieve the next page of results.
  2180. NextPageToken string `json:"nextPageToken,omitempty"`
  2181. // ServerResponse contains the HTTP response code and headers from the
  2182. // server.
  2183. googleapi.ServerResponse `json:"-"`
  2184. // ForceSendFields is a list of field names (e.g. "FilterSets") to
  2185. // unconditionally include in API requests. By default, fields with
  2186. // empty values are omitted from API requests. However, any non-pointer,
  2187. // non-interface field appearing in ForceSendFields will be sent to the
  2188. // server regardless of whether the field is empty or not. This may be
  2189. // used to include empty fields in Patch requests.
  2190. ForceSendFields []string `json:"-"`
  2191. // NullFields is a list of field names (e.g. "FilterSets") to include in
  2192. // API requests with the JSON null value. By default, fields with empty
  2193. // values are omitted from API requests. However, any field with an
  2194. // empty value appearing in NullFields will be sent to the server as
  2195. // null. It is an error if a field in this list has a non-empty value.
  2196. // This may be used to include null fields in Patch requests.
  2197. NullFields []string `json:"-"`
  2198. }
  2199. func (s *ListFilterSetsResponse) MarshalJSON() ([]byte, error) {
  2200. type NoMethod ListFilterSetsResponse
  2201. raw := NoMethod(*s)
  2202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2203. }
  2204. // ListFilteredBidRequestsResponse: Response message for listing all
  2205. // reasons that bid requests were filtered and
  2206. // not sent to the buyer.
  2207. type ListFilteredBidRequestsResponse struct {
  2208. // CalloutStatusRows: List of rows, with counts of filtered bid requests
  2209. // aggregated by callout
  2210. // status.
  2211. CalloutStatusRows []*CalloutStatusRow `json:"calloutStatusRows,omitempty"`
  2212. // NextPageToken: A token to retrieve the next page of results.
  2213. // Pass this value in the
  2214. // ListFilteredBidRequestsRequest.pageToken
  2215. // field in the subsequent call to the filteredBidRequests.list
  2216. // method to retrieve the next page of results.
  2217. NextPageToken string `json:"nextPageToken,omitempty"`
  2218. // ServerResponse contains the HTTP response code and headers from the
  2219. // server.
  2220. googleapi.ServerResponse `json:"-"`
  2221. // ForceSendFields is a list of field names (e.g. "CalloutStatusRows")
  2222. // to unconditionally include in API requests. By default, fields with
  2223. // empty values are omitted from API requests. However, any non-pointer,
  2224. // non-interface field appearing in ForceSendFields will be sent to the
  2225. // server regardless of whether the field is empty or not. This may be
  2226. // used to include empty fields in Patch requests.
  2227. ForceSendFields []string `json:"-"`
  2228. // NullFields is a list of field names (e.g. "CalloutStatusRows") to
  2229. // include in API requests with the JSON null value. By default, fields
  2230. // with empty values are omitted from API requests. However, any field
  2231. // with an empty value appearing in NullFields will be sent to the
  2232. // server as null. It is an error if a field in this list has a
  2233. // non-empty value. This may be used to include null fields in Patch
  2234. // requests.
  2235. NullFields []string `json:"-"`
  2236. }
  2237. func (s *ListFilteredBidRequestsResponse) MarshalJSON() ([]byte, error) {
  2238. type NoMethod ListFilteredBidRequestsResponse
  2239. raw := NoMethod(*s)
  2240. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2241. }
  2242. // ListFilteredBidsResponse: Response message for listing all reasons
  2243. // that bids were filtered from the
  2244. // auction.
  2245. type ListFilteredBidsResponse struct {
  2246. // CreativeStatusRows: List of rows, with counts of filtered bids
  2247. // aggregated by filtering reason
  2248. // (i.e. creative status).
  2249. CreativeStatusRows []*CreativeStatusRow `json:"creativeStatusRows,omitempty"`
  2250. // NextPageToken: A token to retrieve the next page of results.
  2251. // Pass this value in the
  2252. // ListFilteredBidsRequest.pageToken
  2253. // field in the subsequent call to the filteredBids.list
  2254. // method to retrieve the next page of results.
  2255. NextPageToken string `json:"nextPageToken,omitempty"`
  2256. // ServerResponse contains the HTTP response code and headers from the
  2257. // server.
  2258. googleapi.ServerResponse `json:"-"`
  2259. // ForceSendFields is a list of field names (e.g. "CreativeStatusRows")
  2260. // to unconditionally include in API requests. By default, fields with
  2261. // empty values are omitted from API requests. However, any non-pointer,
  2262. // non-interface field appearing in ForceSendFields will be sent to the
  2263. // server regardless of whether the field is empty or not. This may be
  2264. // used to include empty fields in Patch requests.
  2265. ForceSendFields []string `json:"-"`
  2266. // NullFields is a list of field names (e.g. "CreativeStatusRows") to
  2267. // include in API requests with the JSON null value. By default, fields
  2268. // with empty values are omitted from API requests. However, any field
  2269. // with an empty value appearing in NullFields will be sent to the
  2270. // server as null. It is an error if a field in this list has a
  2271. // non-empty value. This may be used to include null fields in Patch
  2272. // requests.
  2273. NullFields []string `json:"-"`
  2274. }
  2275. func (s *ListFilteredBidsResponse) MarshalJSON() ([]byte, error) {
  2276. type NoMethod ListFilteredBidsResponse
  2277. raw := NoMethod(*s)
  2278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2279. }
  2280. // ListImpressionMetricsResponse: Response message for listing the
  2281. // metrics that are measured in number of
  2282. // impressions.
  2283. type ListImpressionMetricsResponse struct {
  2284. // ImpressionMetricsRows: List of rows, each containing a set of
  2285. // impression metrics.
  2286. ImpressionMetricsRows []*ImpressionMetricsRow `json:"impressionMetricsRows,omitempty"`
  2287. // NextPageToken: A token to retrieve the next page of results.
  2288. // Pass this value in the
  2289. // ListImpressionMetricsRequest.pageToken
  2290. // field in the subsequent call to the impressionMetrics.list
  2291. // method to retrieve the next page of results.
  2292. NextPageToken string `json:"nextPageToken,omitempty"`
  2293. // ServerResponse contains the HTTP response code and headers from the
  2294. // server.
  2295. googleapi.ServerResponse `json:"-"`
  2296. // ForceSendFields is a list of field names (e.g.
  2297. // "ImpressionMetricsRows") to unconditionally include in API requests.
  2298. // By default, fields with empty values are omitted from API requests.
  2299. // However, any non-pointer, non-interface field appearing in
  2300. // ForceSendFields will be sent to the server regardless of whether the
  2301. // field is empty or not. This may be used to include empty fields in
  2302. // Patch requests.
  2303. ForceSendFields []string `json:"-"`
  2304. // NullFields is a list of field names (e.g. "ImpressionMetricsRows") to
  2305. // include in API requests with the JSON null value. By default, fields
  2306. // with empty values are omitted from API requests. However, any field
  2307. // with an empty value appearing in NullFields will be sent to the
  2308. // server as null. It is an error if a field in this list has a
  2309. // non-empty value. This may be used to include null fields in Patch
  2310. // requests.
  2311. NullFields []string `json:"-"`
  2312. }
  2313. func (s *ListImpressionMetricsResponse) MarshalJSON() ([]byte, error) {
  2314. type NoMethod ListImpressionMetricsResponse
  2315. raw := NoMethod(*s)
  2316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2317. }
  2318. // ListLosingBidsResponse: Response message for listing all reasons that
  2319. // bids lost in the auction.
  2320. type ListLosingBidsResponse struct {
  2321. // CreativeStatusRows: List of rows, with counts of losing bids
  2322. // aggregated by loss reason (i.e.
  2323. // creative status).
  2324. CreativeStatusRows []*CreativeStatusRow `json:"creativeStatusRows,omitempty"`
  2325. // NextPageToken: A token to retrieve the next page of results.
  2326. // Pass this value in the
  2327. // ListLosingBidsRequest.pageToken
  2328. // field in the subsequent call to the losingBids.list
  2329. // method to retrieve the next page of results.
  2330. NextPageToken string `json:"nextPageToken,omitempty"`
  2331. // ServerResponse contains the HTTP response code and headers from the
  2332. // server.
  2333. googleapi.ServerResponse `json:"-"`
  2334. // ForceSendFields is a list of field names (e.g. "CreativeStatusRows")
  2335. // to unconditionally include in API requests. By default, fields with
  2336. // empty values are omitted from API requests. However, any non-pointer,
  2337. // non-interface field appearing in ForceSendFields will be sent to the
  2338. // server regardless of whether the field is empty or not. This may be
  2339. // used to include empty fields in Patch requests.
  2340. ForceSendFields []string `json:"-"`
  2341. // NullFields is a list of field names (e.g. "CreativeStatusRows") to
  2342. // include in API requests with the JSON null value. By default, fields
  2343. // with empty values are omitted from API requests. However, any field
  2344. // with an empty value appearing in NullFields will be sent to the
  2345. // server as null. It is an error if a field in this list has a
  2346. // non-empty value. This may be used to include null fields in Patch
  2347. // requests.
  2348. NullFields []string `json:"-"`
  2349. }
  2350. func (s *ListLosingBidsResponse) MarshalJSON() ([]byte, error) {
  2351. type NoMethod ListLosingBidsResponse
  2352. raw := NoMethod(*s)
  2353. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2354. }
  2355. // ListNonBillableWinningBidsResponse: Response message for listing all
  2356. // reasons for which a buyer was not billed for
  2357. // a winning bid.
  2358. type ListNonBillableWinningBidsResponse struct {
  2359. // NextPageToken: A token to retrieve the next page of results.
  2360. // Pass this value in
  2361. // the
  2362. // ListNonBillableWinningBidsRequest.pageToken
  2363. // field in the subsequent call to the
  2364. // nonBillableWinningBids.list
  2365. // method to retrieve the next page of results.
  2366. NextPageToken string `json:"nextPageToken,omitempty"`
  2367. // NonBillableWinningBidStatusRows: List of rows, with counts of bids
  2368. // not billed aggregated by reason.
  2369. NonBillableWinningBidStatusRows []*NonBillableWinningBidStatusRow `json:"nonBillableWinningBidStatusRows,omitempty"`
  2370. // ServerResponse contains the HTTP response code and headers from the
  2371. // server.
  2372. googleapi.ServerResponse `json:"-"`
  2373. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2374. // unconditionally include in API requests. By default, fields with
  2375. // empty values are omitted from API requests. However, any non-pointer,
  2376. // non-interface field appearing in ForceSendFields will be sent to the
  2377. // server regardless of whether the field is empty or not. This may be
  2378. // used to include empty fields in Patch requests.
  2379. ForceSendFields []string `json:"-"`
  2380. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2381. // in API requests with the JSON null value. By default, fields with
  2382. // empty values are omitted from API requests. However, any field with
  2383. // an empty value appearing in NullFields will be sent to the server as
  2384. // null. It is an error if a field in this list has a non-empty value.
  2385. // This may be used to include null fields in Patch requests.
  2386. NullFields []string `json:"-"`
  2387. }
  2388. func (s *ListNonBillableWinningBidsResponse) MarshalJSON() ([]byte, error) {
  2389. type NoMethod ListNonBillableWinningBidsResponse
  2390. raw := NoMethod(*s)
  2391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2392. }
  2393. // LocationContext: @OutputOnly The Geo criteria the restriction applies
  2394. // to.
  2395. type LocationContext struct {
  2396. // GeoCriteriaIds: IDs representing the geo location for this
  2397. // context.
  2398. // Please refer to
  2399. // the
  2400. // [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionarie
  2401. // s/geo-table.csv)
  2402. // file for different geo criteria IDs.
  2403. GeoCriteriaIds []int64 `json:"geoCriteriaIds,omitempty"`
  2404. // ForceSendFields is a list of field names (e.g. "GeoCriteriaIds") to
  2405. // unconditionally include in API requests. By default, fields with
  2406. // empty values are omitted from API requests. However, any non-pointer,
  2407. // non-interface field appearing in ForceSendFields will be sent to the
  2408. // server regardless of whether the field is empty or not. This may be
  2409. // used to include empty fields in Patch requests.
  2410. ForceSendFields []string `json:"-"`
  2411. // NullFields is a list of field names (e.g. "GeoCriteriaIds") to
  2412. // include in API requests with the JSON null value. By default, fields
  2413. // with empty values are omitted from API requests. However, any field
  2414. // with an empty value appearing in NullFields will be sent to the
  2415. // server as null. It is an error if a field in this list has a
  2416. // non-empty value. This may be used to include null fields in Patch
  2417. // requests.
  2418. NullFields []string `json:"-"`
  2419. }
  2420. func (s *LocationContext) MarshalJSON() ([]byte, error) {
  2421. type NoMethod LocationContext
  2422. raw := NoMethod(*s)
  2423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2424. }
  2425. // MetricValue: A metric value, with an expected value and a variance;
  2426. // represents a count
  2427. // that may be either exact or estimated (i.e. when sampled).
  2428. type MetricValue struct {
  2429. // Value: The expected value of the metric.
  2430. Value int64 `json:"value,omitempty,string"`
  2431. // Variance: The variance (i.e. square of the standard deviation) of the
  2432. // metric value.
  2433. // If value is exact, variance is 0.
  2434. // Can be used to calculate margin of error as a percentage of value,
  2435. // using
  2436. // the following formula, where Z is the standard constant that depends
  2437. // on the
  2438. // desired size of the confidence interval (e.g. for 90% confidence
  2439. // interval,
  2440. // use Z = 1.645):
  2441. //
  2442. // marginOfError = 100 * Z * sqrt(variance) / value
  2443. Variance int64 `json:"variance,omitempty,string"`
  2444. // ForceSendFields is a list of field names (e.g. "Value") to
  2445. // unconditionally include in API requests. By default, fields with
  2446. // empty values are omitted from API requests. However, any non-pointer,
  2447. // non-interface field appearing in ForceSendFields will be sent to the
  2448. // server regardless of whether the field is empty or not. This may be
  2449. // used to include empty fields in Patch requests.
  2450. ForceSendFields []string `json:"-"`
  2451. // NullFields is a list of field names (e.g. "Value") to include in API
  2452. // requests with the JSON null value. By default, fields with empty
  2453. // values are omitted from API requests. However, any field with an
  2454. // empty value appearing in NullFields will be sent to the server as
  2455. // null. It is an error if a field in this list has a non-empty value.
  2456. // This may be used to include null fields in Patch requests.
  2457. NullFields []string `json:"-"`
  2458. }
  2459. func (s *MetricValue) MarshalJSON() ([]byte, error) {
  2460. type NoMethod MetricValue
  2461. raw := NoMethod(*s)
  2462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2463. }
  2464. // NativeContent: Native content for a creative.
  2465. type NativeContent struct {
  2466. // AdvertiserName: The name of the advertiser or sponsor, to be
  2467. // displayed in the ad creative.
  2468. AdvertiserName string `json:"advertiserName,omitempty"`
  2469. // AppIcon: The app icon, for app download ads.
  2470. AppIcon *Image `json:"appIcon,omitempty"`
  2471. // Body: A long description of the ad.
  2472. Body string `json:"body,omitempty"`
  2473. // CallToAction: A label for the button that the user is supposed to
  2474. // click.
  2475. CallToAction string `json:"callToAction,omitempty"`
  2476. // ClickLinkUrl: The URL that the browser/SDK will load when the user
  2477. // clicks the ad.
  2478. ClickLinkUrl string `json:"clickLinkUrl,omitempty"`
  2479. // ClickTrackingUrl: The URL to use for click tracking.
  2480. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  2481. // Headline: A short title for the ad.
  2482. Headline string `json:"headline,omitempty"`
  2483. // Image: A large image.
  2484. Image *Image `json:"image,omitempty"`
  2485. // Logo: A smaller image, for the advertiser's logo.
  2486. Logo *Image `json:"logo,omitempty"`
  2487. // PriceDisplayText: The price of the promoted app including currency
  2488. // info.
  2489. PriceDisplayText string `json:"priceDisplayText,omitempty"`
  2490. // StarRating: The app rating in the app store. Must be in the range
  2491. // [0-5].
  2492. StarRating float64 `json:"starRating,omitempty"`
  2493. // StoreUrl: The URL to the app store to purchase/download the promoted
  2494. // app.
  2495. StoreUrl string `json:"storeUrl,omitempty"`
  2496. // VideoUrl: The URL to fetch a native video ad.
  2497. VideoUrl string `json:"videoUrl,omitempty"`
  2498. // ForceSendFields is a list of field names (e.g. "AdvertiserName") to
  2499. // unconditionally include in API requests. By default, fields with
  2500. // empty values are omitted from API requests. However, any non-pointer,
  2501. // non-interface field appearing in ForceSendFields will be sent to the
  2502. // server regardless of whether the field is empty or not. This may be
  2503. // used to include empty fields in Patch requests.
  2504. ForceSendFields []string `json:"-"`
  2505. // NullFields is a list of field names (e.g. "AdvertiserName") to
  2506. // include in API requests with the JSON null value. By default, fields
  2507. // with empty values are omitted from API requests. However, any field
  2508. // with an empty value appearing in NullFields will be sent to the
  2509. // server as null. It is an error if a field in this list has a
  2510. // non-empty value. This may be used to include null fields in Patch
  2511. // requests.
  2512. NullFields []string `json:"-"`
  2513. }
  2514. func (s *NativeContent) MarshalJSON() ([]byte, error) {
  2515. type NoMethod NativeContent
  2516. raw := NoMethod(*s)
  2517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2518. }
  2519. func (s *NativeContent) UnmarshalJSON(data []byte) error {
  2520. type NoMethod NativeContent
  2521. var s1 struct {
  2522. StarRating gensupport.JSONFloat64 `json:"starRating"`
  2523. *NoMethod
  2524. }
  2525. s1.NoMethod = (*NoMethod)(s)
  2526. if err := json.Unmarshal(data, &s1); err != nil {
  2527. return err
  2528. }
  2529. s.StarRating = float64(s1.StarRating)
  2530. return nil
  2531. }
  2532. // NonBillableWinningBidStatusRow: The number of winning bids with the
  2533. // specified dimension values for which the
  2534. // buyer was not billed, as described by the specified status.
  2535. type NonBillableWinningBidStatusRow struct {
  2536. // BidCount: The number of bids with the specified status.
  2537. BidCount *MetricValue `json:"bidCount,omitempty"`
  2538. // RowDimensions: The values of all dimensions associated with metric
  2539. // values in this row.
  2540. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  2541. // Status: The status specifying why the winning bids were not billed.
  2542. //
  2543. // Possible values:
  2544. // "STATUS_UNSPECIFIED" - A placeholder for an undefined status.
  2545. // This value will never be returned in responses.
  2546. // "AD_NOT_RENDERED" - The buyer was not billed because the ad was not
  2547. // rendered by the
  2548. // publisher.
  2549. // "INVALID_IMPRESSION" - The buyer was not billed because the
  2550. // impression won by the bid was
  2551. // determined to be invalid.
  2552. Status string `json:"status,omitempty"`
  2553. // ForceSendFields is a list of field names (e.g. "BidCount") to
  2554. // unconditionally include in API requests. By default, fields with
  2555. // empty values are omitted from API requests. However, any non-pointer,
  2556. // non-interface field appearing in ForceSendFields will be sent to the
  2557. // server regardless of whether the field is empty or not. This may be
  2558. // used to include empty fields in Patch requests.
  2559. ForceSendFields []string `json:"-"`
  2560. // NullFields is a list of field names (e.g. "BidCount") to include in
  2561. // API requests with the JSON null value. By default, fields with empty
  2562. // values are omitted from API requests. However, any field with an
  2563. // empty value appearing in NullFields will be sent to the server as
  2564. // null. It is an error if a field in this list has a non-empty value.
  2565. // This may be used to include null fields in Patch requests.
  2566. NullFields []string `json:"-"`
  2567. }
  2568. func (s *NonBillableWinningBidStatusRow) MarshalJSON() ([]byte, error) {
  2569. type NoMethod NonBillableWinningBidStatusRow
  2570. raw := NoMethod(*s)
  2571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2572. }
  2573. // PlatformContext: @OutputOnly The type of platform the restriction
  2574. // applies to.
  2575. type PlatformContext struct {
  2576. // Platforms: The platforms this restriction applies to.
  2577. //
  2578. // Possible values:
  2579. // "DESKTOP" - Desktop platform.
  2580. // "ANDROID" - Android platform.
  2581. // "IOS" - iOS platform.
  2582. Platforms []string `json:"platforms,omitempty"`
  2583. // ForceSendFields is a list of field names (e.g. "Platforms") to
  2584. // unconditionally include in API requests. By default, fields with
  2585. // empty values are omitted from API requests. However, any non-pointer,
  2586. // non-interface field appearing in ForceSendFields will be sent to the
  2587. // server regardless of whether the field is empty or not. This may be
  2588. // used to include empty fields in Patch requests.
  2589. ForceSendFields []string `json:"-"`
  2590. // NullFields is a list of field names (e.g. "Platforms") to include in
  2591. // API requests with the JSON null value. By default, fields with empty
  2592. // values are omitted from API requests. However, any field with an
  2593. // empty value appearing in NullFields will be sent to the server as
  2594. // null. It is an error if a field in this list has a non-empty value.
  2595. // This may be used to include null fields in Patch requests.
  2596. NullFields []string `json:"-"`
  2597. }
  2598. func (s *PlatformContext) MarshalJSON() ([]byte, error) {
  2599. type NoMethod PlatformContext
  2600. raw := NoMethod(*s)
  2601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2602. }
  2603. // RealtimeTimeRange: An open-ended realtime time range specified by the
  2604. // start timestamp.
  2605. // For filter sets that specify a realtime time range RTB metrics
  2606. // continue to
  2607. // be aggregated throughout the lifetime of the filter set.
  2608. type RealtimeTimeRange struct {
  2609. // StartTimestamp: The start timestamp of the real-time RTB metrics
  2610. // aggregation.
  2611. StartTimestamp string `json:"startTimestamp,omitempty"`
  2612. // ForceSendFields is a list of field names (e.g. "StartTimestamp") to
  2613. // unconditionally include in API requests. By default, fields with
  2614. // empty values are omitted from API requests. However, any non-pointer,
  2615. // non-interface field appearing in ForceSendFields will be sent to the
  2616. // server regardless of whether the field is empty or not. This may be
  2617. // used to include empty fields in Patch requests.
  2618. ForceSendFields []string `json:"-"`
  2619. // NullFields is a list of field names (e.g. "StartTimestamp") to
  2620. // include in API requests with the JSON null value. By default, fields
  2621. // with empty values are omitted from API requests. However, any field
  2622. // with an empty value appearing in NullFields will be sent to the
  2623. // server as null. It is an error if a field in this list has a
  2624. // non-empty value. This may be used to include null fields in Patch
  2625. // requests.
  2626. NullFields []string `json:"-"`
  2627. }
  2628. func (s *RealtimeTimeRange) MarshalJSON() ([]byte, error) {
  2629. type NoMethod RealtimeTimeRange
  2630. raw := NoMethod(*s)
  2631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2632. }
  2633. // Reason: A specific filtering status and how many times it occurred.
  2634. type Reason struct {
  2635. // Count: The number of times the creative was filtered for the status.
  2636. // The
  2637. // count is aggregated across all publishers on the exchange.
  2638. Count int64 `json:"count,omitempty,string"`
  2639. // Status: The filtering status code. Please refer to
  2640. // the
  2641. // [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb
  2642. // -dictionaries/creative-status-codes.txt)
  2643. // file for different statuses.
  2644. Status int64 `json:"status,omitempty"`
  2645. // ForceSendFields is a list of field names (e.g. "Count") to
  2646. // unconditionally include in API requests. By default, fields with
  2647. // empty values are omitted from API requests. However, any non-pointer,
  2648. // non-interface field appearing in ForceSendFields will be sent to the
  2649. // server regardless of whether the field is empty or not. This may be
  2650. // used to include empty fields in Patch requests.
  2651. ForceSendFields []string `json:"-"`
  2652. // NullFields is a list of field names (e.g. "Count") to include in API
  2653. // requests with the JSON null value. By default, fields with empty
  2654. // values are omitted from API requests. However, any field with an
  2655. // empty value appearing in NullFields will be sent to the server as
  2656. // null. It is an error if a field in this list has a non-empty value.
  2657. // This may be used to include null fields in Patch requests.
  2658. NullFields []string `json:"-"`
  2659. }
  2660. func (s *Reason) MarshalJSON() ([]byte, error) {
  2661. type NoMethod Reason
  2662. raw := NoMethod(*s)
  2663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2664. }
  2665. // RelativeDateRange: A relative date range, specified by an offset and
  2666. // a duration.
  2667. // The supported range of dates begins 30 days before today and ends
  2668. // today.
  2669. // I.e. the limits for these values are:
  2670. // offset_days >= 0
  2671. // duration_days >= 1
  2672. // offset_days + duration_days <= 30
  2673. type RelativeDateRange struct {
  2674. // DurationDays: The number of days in the requested date range. E.g.
  2675. // for a range spanning
  2676. // today, 1. For a range spanning the last 7 days, 7.
  2677. DurationDays int64 `json:"durationDays,omitempty"`
  2678. // OffsetDays: The end date of the filter set, specified as the number
  2679. // of days before
  2680. // today. E.g. for a range where the last date is today, 0.
  2681. OffsetDays int64 `json:"offsetDays,omitempty"`
  2682. // ForceSendFields is a list of field names (e.g. "DurationDays") to
  2683. // unconditionally include in API requests. By default, fields with
  2684. // empty values are omitted from API requests. However, any non-pointer,
  2685. // non-interface field appearing in ForceSendFields will be sent to the
  2686. // server regardless of whether the field is empty or not. This may be
  2687. // used to include empty fields in Patch requests.
  2688. ForceSendFields []string `json:"-"`
  2689. // NullFields is a list of field names (e.g. "DurationDays") to include
  2690. // in API requests with the JSON null value. By default, fields with
  2691. // empty values are omitted from API requests. However, any field with
  2692. // an empty value appearing in NullFields will be sent to the server as
  2693. // null. It is an error if a field in this list has a non-empty value.
  2694. // This may be used to include null fields in Patch requests.
  2695. NullFields []string `json:"-"`
  2696. }
  2697. func (s *RelativeDateRange) MarshalJSON() ([]byte, error) {
  2698. type NoMethod RelativeDateRange
  2699. raw := NoMethod(*s)
  2700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2701. }
  2702. // RemoveDealAssociationRequest: A request for removing the association
  2703. // between a deal and a creative.
  2704. type RemoveDealAssociationRequest struct {
  2705. // Association: The association between a creative and a deal that
  2706. // should be removed.
  2707. Association *CreativeDealAssociation `json:"association,omitempty"`
  2708. // ForceSendFields is a list of field names (e.g. "Association") to
  2709. // unconditionally include in API requests. By default, fields with
  2710. // empty values are omitted from API requests. However, any non-pointer,
  2711. // non-interface field appearing in ForceSendFields will be sent to the
  2712. // server regardless of whether the field is empty or not. This may be
  2713. // used to include empty fields in Patch requests.
  2714. ForceSendFields []string `json:"-"`
  2715. // NullFields is a list of field names (e.g. "Association") to include
  2716. // in API requests with the JSON null value. By default, fields with
  2717. // empty values are omitted from API requests. However, any field with
  2718. // an empty value appearing in NullFields will be sent to the server as
  2719. // null. It is an error if a field in this list has a non-empty value.
  2720. // This may be used to include null fields in Patch requests.
  2721. NullFields []string `json:"-"`
  2722. }
  2723. func (s *RemoveDealAssociationRequest) MarshalJSON() ([]byte, error) {
  2724. type NoMethod RemoveDealAssociationRequest
  2725. raw := NoMethod(*s)
  2726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2727. }
  2728. // RowDimensions: A response may include multiple rows, breaking down
  2729. // along various dimensions.
  2730. // Encapsulates the values of all dimensions for a given row.
  2731. type RowDimensions struct {
  2732. // TimeInterval: The time interval that this row represents.
  2733. TimeInterval *TimeInterval `json:"timeInterval,omitempty"`
  2734. // ForceSendFields is a list of field names (e.g. "TimeInterval") to
  2735. // unconditionally include in API requests. By default, fields with
  2736. // empty values are omitted from API requests. However, any non-pointer,
  2737. // non-interface field appearing in ForceSendFields will be sent to the
  2738. // server regardless of whether the field is empty or not. This may be
  2739. // used to include empty fields in Patch requests.
  2740. ForceSendFields []string `json:"-"`
  2741. // NullFields is a list of field names (e.g. "TimeInterval") to include
  2742. // in API requests with the JSON null value. By default, fields with
  2743. // empty values are omitted from API requests. However, any field with
  2744. // an empty value appearing in NullFields will be sent to the server as
  2745. // null. It is an error if a field in this list has a non-empty value.
  2746. // This may be used to include null fields in Patch requests.
  2747. NullFields []string `json:"-"`
  2748. }
  2749. func (s *RowDimensions) MarshalJSON() ([]byte, error) {
  2750. type NoMethod RowDimensions
  2751. raw := NoMethod(*s)
  2752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2753. }
  2754. // SecurityContext: @OutputOnly A security context.
  2755. type SecurityContext struct {
  2756. // Securities: The security types in this context.
  2757. //
  2758. // Possible values:
  2759. // "INSECURE" - Matches impressions that require insecure
  2760. // compatibility.
  2761. // "SSL" - Matches impressions that require SSL compatibility.
  2762. Securities []string `json:"securities,omitempty"`
  2763. // ForceSendFields is a list of field names (e.g. "Securities") to
  2764. // unconditionally include in API requests. By default, fields with
  2765. // empty values are omitted from API requests. However, any non-pointer,
  2766. // non-interface field appearing in ForceSendFields will be sent to the
  2767. // server regardless of whether the field is empty or not. This may be
  2768. // used to include empty fields in Patch requests.
  2769. ForceSendFields []string `json:"-"`
  2770. // NullFields is a list of field names (e.g. "Securities") to include in
  2771. // API requests with the JSON null value. By default, fields with empty
  2772. // values are omitted from API requests. However, any field with an
  2773. // empty value appearing in NullFields will be sent to the server as
  2774. // null. It is an error if a field in this list has a non-empty value.
  2775. // This may be used to include null fields in Patch requests.
  2776. NullFields []string `json:"-"`
  2777. }
  2778. func (s *SecurityContext) MarshalJSON() ([]byte, error) {
  2779. type NoMethod SecurityContext
  2780. raw := NoMethod(*s)
  2781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2782. }
  2783. // ServingContext: The serving context for this restriction.
  2784. type ServingContext struct {
  2785. // All: Matches all contexts.
  2786. //
  2787. // Possible values:
  2788. // "SIMPLE_CONTEXT" - A simple context.
  2789. All string `json:"all,omitempty"`
  2790. // AppType: Matches impressions for a particular app type.
  2791. AppType *AppContext `json:"appType,omitempty"`
  2792. // AuctionType: Matches impressions for a particular auction type.
  2793. AuctionType *AuctionContext `json:"auctionType,omitempty"`
  2794. // Location: Matches impressions coming from users *or* publishers in a
  2795. // specific
  2796. // location.
  2797. Location *LocationContext `json:"location,omitempty"`
  2798. // Platform: Matches impressions coming from a particular platform.
  2799. Platform *PlatformContext `json:"platform,omitempty"`
  2800. // SecurityType: Matches impressions for a particular security type.
  2801. SecurityType *SecurityContext `json:"securityType,omitempty"`
  2802. // ForceSendFields is a list of field names (e.g. "All") to
  2803. // unconditionally include in API requests. By default, fields with
  2804. // empty values are omitted from API requests. However, any non-pointer,
  2805. // non-interface field appearing in ForceSendFields will be sent to the
  2806. // server regardless of whether the field is empty or not. This may be
  2807. // used to include empty fields in Patch requests.
  2808. ForceSendFields []string `json:"-"`
  2809. // NullFields is a list of field names (e.g. "All") to include in API
  2810. // requests with the JSON null value. By default, fields with empty
  2811. // values are omitted from API requests. However, any field with an
  2812. // empty value appearing in NullFields will be sent to the server as
  2813. // null. It is an error if a field in this list has a non-empty value.
  2814. // This may be used to include null fields in Patch requests.
  2815. NullFields []string `json:"-"`
  2816. }
  2817. func (s *ServingContext) MarshalJSON() ([]byte, error) {
  2818. type NoMethod ServingContext
  2819. raw := NoMethod(*s)
  2820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2821. }
  2822. // ServingRestriction: @OutputOnly A representation of the status of an
  2823. // ad in a
  2824. // specific context. A context here relates to where something
  2825. // ultimately serves
  2826. // (for example, a user or publisher geo, a platform, an HTTPS vs HTTP
  2827. // request,
  2828. // or the type of auction).
  2829. type ServingRestriction struct {
  2830. // Contexts: The contexts for the restriction.
  2831. Contexts []*ServingContext `json:"contexts,omitempty"`
  2832. // DisapprovalReasons: Any disapprovals bound to this restriction.
  2833. // Only present if status=DISAPPROVED.
  2834. // Can be used to filter the response of the
  2835. // creatives.list
  2836. // method.
  2837. DisapprovalReasons []*Disapproval `json:"disapprovalReasons,omitempty"`
  2838. // Status: The status of the creative in this context (for example, it
  2839. // has been
  2840. // explicitly disapproved or is pending review).
  2841. //
  2842. // Possible values:
  2843. // "STATUS_UNSPECIFIED" - The status is not known.
  2844. // "DISAPPROVAL" - The ad was disapproved in this context.
  2845. // "PENDING_REVIEW" - The ad is pending review in this context.
  2846. Status string `json:"status,omitempty"`
  2847. // ForceSendFields is a list of field names (e.g. "Contexts") to
  2848. // unconditionally include in API requests. By default, fields with
  2849. // empty values are omitted from API requests. However, any non-pointer,
  2850. // non-interface field appearing in ForceSendFields will be sent to the
  2851. // server regardless of whether the field is empty or not. This may be
  2852. // used to include empty fields in Patch requests.
  2853. ForceSendFields []string `json:"-"`
  2854. // NullFields is a list of field names (e.g. "Contexts") to include in
  2855. // API requests with the JSON null value. By default, fields with empty
  2856. // values are omitted from API requests. However, any field with an
  2857. // empty value appearing in NullFields will be sent to the server as
  2858. // null. It is an error if a field in this list has a non-empty value.
  2859. // This may be used to include null fields in Patch requests.
  2860. NullFields []string `json:"-"`
  2861. }
  2862. func (s *ServingRestriction) MarshalJSON() ([]byte, error) {
  2863. type NoMethod ServingRestriction
  2864. raw := NoMethod(*s)
  2865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2866. }
  2867. // StopWatchingCreativeRequest: A request for stopping notifications for
  2868. // changes to creative Status.
  2869. type StopWatchingCreativeRequest struct {
  2870. }
  2871. // TimeInterval: An interval of time, with an absolute start and end.
  2872. type TimeInterval struct {
  2873. // EndTime: The timestamp marking the end of the range (exclusive) for
  2874. // which data is
  2875. // included.
  2876. EndTime string `json:"endTime,omitempty"`
  2877. // StartTime: The timestamp marking the start of the range (inclusive)
  2878. // for which data is
  2879. // included.
  2880. StartTime string `json:"startTime,omitempty"`
  2881. // ForceSendFields is a list of field names (e.g. "EndTime") to
  2882. // unconditionally include in API requests. By default, fields with
  2883. // empty values are omitted from API requests. However, any non-pointer,
  2884. // non-interface field appearing in ForceSendFields will be sent to the
  2885. // server regardless of whether the field is empty or not. This may be
  2886. // used to include empty fields in Patch requests.
  2887. ForceSendFields []string `json:"-"`
  2888. // NullFields is a list of field names (e.g. "EndTime") to include in
  2889. // API requests with the JSON null value. By default, fields with empty
  2890. // values are omitted from API requests. However, any field with an
  2891. // empty value appearing in NullFields will be sent to the server as
  2892. // null. It is an error if a field in this list has a non-empty value.
  2893. // This may be used to include null fields in Patch requests.
  2894. NullFields []string `json:"-"`
  2895. }
  2896. func (s *TimeInterval) MarshalJSON() ([]byte, error) {
  2897. type NoMethod TimeInterval
  2898. raw := NoMethod(*s)
  2899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2900. }
  2901. // VideoContent: Video content for a creative.
  2902. type VideoContent struct {
  2903. // VideoUrl: The URL to fetch a video ad.
  2904. VideoUrl string `json:"videoUrl,omitempty"`
  2905. // VideoVastXml: The contents of a VAST document for a video ad.
  2906. // This document should conform to the VAST 2.0 or 3.0 standard.
  2907. VideoVastXml string `json:"videoVastXml,omitempty"`
  2908. // ForceSendFields is a list of field names (e.g. "VideoUrl") to
  2909. // unconditionally include in API requests. By default, fields with
  2910. // empty values are omitted from API requests. However, any non-pointer,
  2911. // non-interface field appearing in ForceSendFields will be sent to the
  2912. // server regardless of whether the field is empty or not. This may be
  2913. // used to include empty fields in Patch requests.
  2914. ForceSendFields []string `json:"-"`
  2915. // NullFields is a list of field names (e.g. "VideoUrl") to include in
  2916. // API requests with the JSON null value. By default, fields with empty
  2917. // values are omitted from API requests. However, any field with an
  2918. // empty value appearing in NullFields will be sent to the server as
  2919. // null. It is an error if a field in this list has a non-empty value.
  2920. // This may be used to include null fields in Patch requests.
  2921. NullFields []string `json:"-"`
  2922. }
  2923. func (s *VideoContent) MarshalJSON() ([]byte, error) {
  2924. type NoMethod VideoContent
  2925. raw := NoMethod(*s)
  2926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2927. }
  2928. // WatchCreativeRequest: A request for watching changes to creative
  2929. // Status.
  2930. type WatchCreativeRequest struct {
  2931. // Topic: The Pub/Sub topic to publish notifications to.
  2932. // This topic must already exist and must give permission
  2933. // to
  2934. // ad-exchange-buyside-reports@google.com to write to the topic.
  2935. // This should be the full resource name
  2936. // in
  2937. // "projects/{project_id}/topics/{topic_id}" format.
  2938. Topic string `json:"topic,omitempty"`
  2939. // ForceSendFields is a list of field names (e.g. "Topic") to
  2940. // unconditionally include in API requests. By default, fields with
  2941. // empty values are omitted from API requests. However, any non-pointer,
  2942. // non-interface field appearing in ForceSendFields will be sent to the
  2943. // server regardless of whether the field is empty or not. This may be
  2944. // used to include empty fields in Patch requests.
  2945. ForceSendFields []string `json:"-"`
  2946. // NullFields is a list of field names (e.g. "Topic") to include in API
  2947. // requests with the JSON null value. By default, fields with empty
  2948. // values are omitted from API requests. However, any field with an
  2949. // empty value appearing in NullFields will be sent to the server as
  2950. // null. It is an error if a field in this list has a non-empty value.
  2951. // This may be used to include null fields in Patch requests.
  2952. NullFields []string `json:"-"`
  2953. }
  2954. func (s *WatchCreativeRequest) MarshalJSON() ([]byte, error) {
  2955. type NoMethod WatchCreativeRequest
  2956. raw := NoMethod(*s)
  2957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2958. }
  2959. // method id "adexchangebuyer2.accounts.clients.create":
  2960. type AccountsClientsCreateCall struct {
  2961. s *Service
  2962. accountId int64
  2963. client *Client
  2964. urlParams_ gensupport.URLParams
  2965. ctx_ context.Context
  2966. header_ http.Header
  2967. }
  2968. // Create: Creates a new client buyer.
  2969. func (r *AccountsClientsService) Create(accountId int64, client *Client) *AccountsClientsCreateCall {
  2970. c := &AccountsClientsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2971. c.accountId = accountId
  2972. c.client = client
  2973. return c
  2974. }
  2975. // Fields allows partial responses to be retrieved. See
  2976. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2977. // for more information.
  2978. func (c *AccountsClientsCreateCall) Fields(s ...googleapi.Field) *AccountsClientsCreateCall {
  2979. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2980. return c
  2981. }
  2982. // Context sets the context to be used in this call's Do method. Any
  2983. // pending HTTP request will be aborted if the provided context is
  2984. // canceled.
  2985. func (c *AccountsClientsCreateCall) Context(ctx context.Context) *AccountsClientsCreateCall {
  2986. c.ctx_ = ctx
  2987. return c
  2988. }
  2989. // Header returns an http.Header that can be modified by the caller to
  2990. // add HTTP headers to the request.
  2991. func (c *AccountsClientsCreateCall) Header() http.Header {
  2992. if c.header_ == nil {
  2993. c.header_ = make(http.Header)
  2994. }
  2995. return c.header_
  2996. }
  2997. func (c *AccountsClientsCreateCall) doRequest(alt string) (*http.Response, error) {
  2998. reqHeaders := make(http.Header)
  2999. for k, v := range c.header_ {
  3000. reqHeaders[k] = v
  3001. }
  3002. reqHeaders.Set("User-Agent", c.s.userAgent())
  3003. var body io.Reader = nil
  3004. body, err := googleapi.WithoutDataWrapper.JSONReader(c.client)
  3005. if err != nil {
  3006. return nil, err
  3007. }
  3008. reqHeaders.Set("Content-Type", "application/json")
  3009. c.urlParams_.Set("alt", alt)
  3010. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients")
  3011. urls += "?" + c.urlParams_.Encode()
  3012. req, _ := http.NewRequest("POST", urls, body)
  3013. req.Header = reqHeaders
  3014. googleapi.Expand(req.URL, map[string]string{
  3015. "accountId": strconv.FormatInt(c.accountId, 10),
  3016. })
  3017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3018. }
  3019. // Do executes the "adexchangebuyer2.accounts.clients.create" call.
  3020. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  3021. // code is an error. Response headers are in either
  3022. // *Client.ServerResponse.Header or (if a response was returned at all)
  3023. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3024. // check whether the returned error was because http.StatusNotModified
  3025. // was returned.
  3026. func (c *AccountsClientsCreateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  3027. gensupport.SetOptions(c.urlParams_, opts...)
  3028. res, err := c.doRequest("json")
  3029. if res != nil && res.StatusCode == http.StatusNotModified {
  3030. if res.Body != nil {
  3031. res.Body.Close()
  3032. }
  3033. return nil, &googleapi.Error{
  3034. Code: res.StatusCode,
  3035. Header: res.Header,
  3036. }
  3037. }
  3038. if err != nil {
  3039. return nil, err
  3040. }
  3041. defer googleapi.CloseBody(res)
  3042. if err := googleapi.CheckResponse(res); err != nil {
  3043. return nil, err
  3044. }
  3045. ret := &Client{
  3046. ServerResponse: googleapi.ServerResponse{
  3047. Header: res.Header,
  3048. HTTPStatusCode: res.StatusCode,
  3049. },
  3050. }
  3051. target := &ret
  3052. if err := gensupport.DecodeResponse(target, res); err != nil {
  3053. return nil, err
  3054. }
  3055. return ret, nil
  3056. // {
  3057. // "description": "Creates a new client buyer.",
  3058. // "flatPath": "v2beta1/accounts/{accountId}/clients",
  3059. // "httpMethod": "POST",
  3060. // "id": "adexchangebuyer2.accounts.clients.create",
  3061. // "parameterOrder": [
  3062. // "accountId"
  3063. // ],
  3064. // "parameters": {
  3065. // "accountId": {
  3066. // "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to create a client for. (required)",
  3067. // "format": "int64",
  3068. // "location": "path",
  3069. // "required": true,
  3070. // "type": "string"
  3071. // }
  3072. // },
  3073. // "path": "v2beta1/accounts/{accountId}/clients",
  3074. // "request": {
  3075. // "$ref": "Client"
  3076. // },
  3077. // "response": {
  3078. // "$ref": "Client"
  3079. // },
  3080. // "scopes": [
  3081. // "https://www.googleapis.com/auth/adexchange.buyer"
  3082. // ]
  3083. // }
  3084. }
  3085. // method id "adexchangebuyer2.accounts.clients.get":
  3086. type AccountsClientsGetCall struct {
  3087. s *Service
  3088. accountId int64
  3089. clientAccountId int64
  3090. urlParams_ gensupport.URLParams
  3091. ifNoneMatch_ string
  3092. ctx_ context.Context
  3093. header_ http.Header
  3094. }
  3095. // Get: Gets a client buyer with a given client account ID.
  3096. func (r *AccountsClientsService) Get(accountId int64, clientAccountId int64) *AccountsClientsGetCall {
  3097. c := &AccountsClientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3098. c.accountId = accountId
  3099. c.clientAccountId = clientAccountId
  3100. return c
  3101. }
  3102. // Fields allows partial responses to be retrieved. See
  3103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3104. // for more information.
  3105. func (c *AccountsClientsGetCall) Fields(s ...googleapi.Field) *AccountsClientsGetCall {
  3106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3107. return c
  3108. }
  3109. // IfNoneMatch sets the optional parameter which makes the operation
  3110. // fail if the object's ETag matches the given value. This is useful for
  3111. // getting updates only after the object has changed since the last
  3112. // request. Use googleapi.IsNotModified to check whether the response
  3113. // error from Do is the result of In-None-Match.
  3114. func (c *AccountsClientsGetCall) IfNoneMatch(entityTag string) *AccountsClientsGetCall {
  3115. c.ifNoneMatch_ = entityTag
  3116. return c
  3117. }
  3118. // Context sets the context to be used in this call's Do method. Any
  3119. // pending HTTP request will be aborted if the provided context is
  3120. // canceled.
  3121. func (c *AccountsClientsGetCall) Context(ctx context.Context) *AccountsClientsGetCall {
  3122. c.ctx_ = ctx
  3123. return c
  3124. }
  3125. // Header returns an http.Header that can be modified by the caller to
  3126. // add HTTP headers to the request.
  3127. func (c *AccountsClientsGetCall) Header() http.Header {
  3128. if c.header_ == nil {
  3129. c.header_ = make(http.Header)
  3130. }
  3131. return c.header_
  3132. }
  3133. func (c *AccountsClientsGetCall) doRequest(alt string) (*http.Response, error) {
  3134. reqHeaders := make(http.Header)
  3135. for k, v := range c.header_ {
  3136. reqHeaders[k] = v
  3137. }
  3138. reqHeaders.Set("User-Agent", c.s.userAgent())
  3139. if c.ifNoneMatch_ != "" {
  3140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3141. }
  3142. var body io.Reader = nil
  3143. c.urlParams_.Set("alt", alt)
  3144. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}")
  3145. urls += "?" + c.urlParams_.Encode()
  3146. req, _ := http.NewRequest("GET", urls, body)
  3147. req.Header = reqHeaders
  3148. googleapi.Expand(req.URL, map[string]string{
  3149. "accountId": strconv.FormatInt(c.accountId, 10),
  3150. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  3151. })
  3152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3153. }
  3154. // Do executes the "adexchangebuyer2.accounts.clients.get" call.
  3155. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  3156. // code is an error. Response headers are in either
  3157. // *Client.ServerResponse.Header or (if a response was returned at all)
  3158. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3159. // check whether the returned error was because http.StatusNotModified
  3160. // was returned.
  3161. func (c *AccountsClientsGetCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  3162. gensupport.SetOptions(c.urlParams_, opts...)
  3163. res, err := c.doRequest("json")
  3164. if res != nil && res.StatusCode == http.StatusNotModified {
  3165. if res.Body != nil {
  3166. res.Body.Close()
  3167. }
  3168. return nil, &googleapi.Error{
  3169. Code: res.StatusCode,
  3170. Header: res.Header,
  3171. }
  3172. }
  3173. if err != nil {
  3174. return nil, err
  3175. }
  3176. defer googleapi.CloseBody(res)
  3177. if err := googleapi.CheckResponse(res); err != nil {
  3178. return nil, err
  3179. }
  3180. ret := &Client{
  3181. ServerResponse: googleapi.ServerResponse{
  3182. Header: res.Header,
  3183. HTTPStatusCode: res.StatusCode,
  3184. },
  3185. }
  3186. target := &ret
  3187. if err := gensupport.DecodeResponse(target, res); err != nil {
  3188. return nil, err
  3189. }
  3190. return ret, nil
  3191. // {
  3192. // "description": "Gets a client buyer with a given client account ID.",
  3193. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  3194. // "httpMethod": "GET",
  3195. // "id": "adexchangebuyer2.accounts.clients.get",
  3196. // "parameterOrder": [
  3197. // "accountId",
  3198. // "clientAccountId"
  3199. // ],
  3200. // "parameters": {
  3201. // "accountId": {
  3202. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  3203. // "format": "int64",
  3204. // "location": "path",
  3205. // "required": true,
  3206. // "type": "string"
  3207. // },
  3208. // "clientAccountId": {
  3209. // "description": "Numerical account ID of the client buyer to retrieve. (required)",
  3210. // "format": "int64",
  3211. // "location": "path",
  3212. // "required": true,
  3213. // "type": "string"
  3214. // }
  3215. // },
  3216. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  3217. // "response": {
  3218. // "$ref": "Client"
  3219. // },
  3220. // "scopes": [
  3221. // "https://www.googleapis.com/auth/adexchange.buyer"
  3222. // ]
  3223. // }
  3224. }
  3225. // method id "adexchangebuyer2.accounts.clients.list":
  3226. type AccountsClientsListCall struct {
  3227. s *Service
  3228. accountId int64
  3229. urlParams_ gensupport.URLParams
  3230. ifNoneMatch_ string
  3231. ctx_ context.Context
  3232. header_ http.Header
  3233. }
  3234. // List: Lists all the clients for the current sponsor buyer.
  3235. func (r *AccountsClientsService) List(accountId int64) *AccountsClientsListCall {
  3236. c := &AccountsClientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3237. c.accountId = accountId
  3238. return c
  3239. }
  3240. // PageSize sets the optional parameter "pageSize": Requested page size.
  3241. // The server may return fewer clients than requested.
  3242. // If unspecified, the server will pick an appropriate default.
  3243. func (c *AccountsClientsListCall) PageSize(pageSize int64) *AccountsClientsListCall {
  3244. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3245. return c
  3246. }
  3247. // PageToken sets the optional parameter "pageToken": A token
  3248. // identifying a page of results the server should return.
  3249. // Typically, this is the value
  3250. // of
  3251. // ListClientsResponse.nextPageToken
  3252. // returned from the previous call to the
  3253. // accounts.clients.list method.
  3254. func (c *AccountsClientsListCall) PageToken(pageToken string) *AccountsClientsListCall {
  3255. c.urlParams_.Set("pageToken", pageToken)
  3256. return c
  3257. }
  3258. // PartnerClientId sets the optional parameter "partnerClientId":
  3259. // Optional unique identifier (from the standpoint of an Ad Exchange
  3260. // sponsor
  3261. // buyer partner) of the client to return.
  3262. // If specified, at most one client will be returned in the response.
  3263. func (c *AccountsClientsListCall) PartnerClientId(partnerClientId string) *AccountsClientsListCall {
  3264. c.urlParams_.Set("partnerClientId", partnerClientId)
  3265. return c
  3266. }
  3267. // Fields allows partial responses to be retrieved. See
  3268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3269. // for more information.
  3270. func (c *AccountsClientsListCall) Fields(s ...googleapi.Field) *AccountsClientsListCall {
  3271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3272. return c
  3273. }
  3274. // IfNoneMatch sets the optional parameter which makes the operation
  3275. // fail if the object's ETag matches the given value. This is useful for
  3276. // getting updates only after the object has changed since the last
  3277. // request. Use googleapi.IsNotModified to check whether the response
  3278. // error from Do is the result of In-None-Match.
  3279. func (c *AccountsClientsListCall) IfNoneMatch(entityTag string) *AccountsClientsListCall {
  3280. c.ifNoneMatch_ = entityTag
  3281. return c
  3282. }
  3283. // Context sets the context to be used in this call's Do method. Any
  3284. // pending HTTP request will be aborted if the provided context is
  3285. // canceled.
  3286. func (c *AccountsClientsListCall) Context(ctx context.Context) *AccountsClientsListCall {
  3287. c.ctx_ = ctx
  3288. return c
  3289. }
  3290. // Header returns an http.Header that can be modified by the caller to
  3291. // add HTTP headers to the request.
  3292. func (c *AccountsClientsListCall) Header() http.Header {
  3293. if c.header_ == nil {
  3294. c.header_ = make(http.Header)
  3295. }
  3296. return c.header_
  3297. }
  3298. func (c *AccountsClientsListCall) doRequest(alt string) (*http.Response, error) {
  3299. reqHeaders := make(http.Header)
  3300. for k, v := range c.header_ {
  3301. reqHeaders[k] = v
  3302. }
  3303. reqHeaders.Set("User-Agent", c.s.userAgent())
  3304. if c.ifNoneMatch_ != "" {
  3305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3306. }
  3307. var body io.Reader = nil
  3308. c.urlParams_.Set("alt", alt)
  3309. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients")
  3310. urls += "?" + c.urlParams_.Encode()
  3311. req, _ := http.NewRequest("GET", urls, body)
  3312. req.Header = reqHeaders
  3313. googleapi.Expand(req.URL, map[string]string{
  3314. "accountId": strconv.FormatInt(c.accountId, 10),
  3315. })
  3316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3317. }
  3318. // Do executes the "adexchangebuyer2.accounts.clients.list" call.
  3319. // Exactly one of *ListClientsResponse or error will be non-nil. Any
  3320. // non-2xx status code is an error. Response headers are in either
  3321. // *ListClientsResponse.ServerResponse.Header or (if a response was
  3322. // returned at all) in error.(*googleapi.Error).Header. Use
  3323. // googleapi.IsNotModified to check whether the returned error was
  3324. // because http.StatusNotModified was returned.
  3325. func (c *AccountsClientsListCall) Do(opts ...googleapi.CallOption) (*ListClientsResponse, error) {
  3326. gensupport.SetOptions(c.urlParams_, opts...)
  3327. res, err := c.doRequest("json")
  3328. if res != nil && res.StatusCode == http.StatusNotModified {
  3329. if res.Body != nil {
  3330. res.Body.Close()
  3331. }
  3332. return nil, &googleapi.Error{
  3333. Code: res.StatusCode,
  3334. Header: res.Header,
  3335. }
  3336. }
  3337. if err != nil {
  3338. return nil, err
  3339. }
  3340. defer googleapi.CloseBody(res)
  3341. if err := googleapi.CheckResponse(res); err != nil {
  3342. return nil, err
  3343. }
  3344. ret := &ListClientsResponse{
  3345. ServerResponse: googleapi.ServerResponse{
  3346. Header: res.Header,
  3347. HTTPStatusCode: res.StatusCode,
  3348. },
  3349. }
  3350. target := &ret
  3351. if err := gensupport.DecodeResponse(target, res); err != nil {
  3352. return nil, err
  3353. }
  3354. return ret, nil
  3355. // {
  3356. // "description": "Lists all the clients for the current sponsor buyer.",
  3357. // "flatPath": "v2beta1/accounts/{accountId}/clients",
  3358. // "httpMethod": "GET",
  3359. // "id": "adexchangebuyer2.accounts.clients.list",
  3360. // "parameterOrder": [
  3361. // "accountId"
  3362. // ],
  3363. // "parameters": {
  3364. // "accountId": {
  3365. // "description": "Unique numerical account ID of the sponsor buyer to list the clients for.",
  3366. // "format": "int64",
  3367. // "location": "path",
  3368. // "required": true,
  3369. // "type": "string"
  3370. // },
  3371. // "pageSize": {
  3372. // "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.",
  3373. // "format": "int32",
  3374. // "location": "query",
  3375. // "type": "integer"
  3376. // },
  3377. // "pageToken": {
  3378. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientsResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.list method.",
  3379. // "location": "query",
  3380. // "type": "string"
  3381. // },
  3382. // "partnerClientId": {
  3383. // "description": "Optional unique identifier (from the standpoint of an Ad Exchange sponsor\nbuyer partner) of the client to return.\nIf specified, at most one client will be returned in the response.",
  3384. // "location": "query",
  3385. // "type": "string"
  3386. // }
  3387. // },
  3388. // "path": "v2beta1/accounts/{accountId}/clients",
  3389. // "response": {
  3390. // "$ref": "ListClientsResponse"
  3391. // },
  3392. // "scopes": [
  3393. // "https://www.googleapis.com/auth/adexchange.buyer"
  3394. // ]
  3395. // }
  3396. }
  3397. // Pages invokes f for each page of results.
  3398. // A non-nil error returned from f will halt the iteration.
  3399. // The provided context supersedes any context provided to the Context method.
  3400. func (c *AccountsClientsListCall) Pages(ctx context.Context, f func(*ListClientsResponse) error) error {
  3401. c.ctx_ = ctx
  3402. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3403. for {
  3404. x, err := c.Do()
  3405. if err != nil {
  3406. return err
  3407. }
  3408. if err := f(x); err != nil {
  3409. return err
  3410. }
  3411. if x.NextPageToken == "" {
  3412. return nil
  3413. }
  3414. c.PageToken(x.NextPageToken)
  3415. }
  3416. }
  3417. // method id "adexchangebuyer2.accounts.clients.update":
  3418. type AccountsClientsUpdateCall struct {
  3419. s *Service
  3420. accountId int64
  3421. clientAccountId int64
  3422. client *Client
  3423. urlParams_ gensupport.URLParams
  3424. ctx_ context.Context
  3425. header_ http.Header
  3426. }
  3427. // Update: Updates an existing client buyer.
  3428. func (r *AccountsClientsService) Update(accountId int64, clientAccountId int64, client *Client) *AccountsClientsUpdateCall {
  3429. c := &AccountsClientsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3430. c.accountId = accountId
  3431. c.clientAccountId = clientAccountId
  3432. c.client = client
  3433. return c
  3434. }
  3435. // Fields allows partial responses to be retrieved. See
  3436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3437. // for more information.
  3438. func (c *AccountsClientsUpdateCall) Fields(s ...googleapi.Field) *AccountsClientsUpdateCall {
  3439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3440. return c
  3441. }
  3442. // Context sets the context to be used in this call's Do method. Any
  3443. // pending HTTP request will be aborted if the provided context is
  3444. // canceled.
  3445. func (c *AccountsClientsUpdateCall) Context(ctx context.Context) *AccountsClientsUpdateCall {
  3446. c.ctx_ = ctx
  3447. return c
  3448. }
  3449. // Header returns an http.Header that can be modified by the caller to
  3450. // add HTTP headers to the request.
  3451. func (c *AccountsClientsUpdateCall) Header() http.Header {
  3452. if c.header_ == nil {
  3453. c.header_ = make(http.Header)
  3454. }
  3455. return c.header_
  3456. }
  3457. func (c *AccountsClientsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3458. reqHeaders := make(http.Header)
  3459. for k, v := range c.header_ {
  3460. reqHeaders[k] = v
  3461. }
  3462. reqHeaders.Set("User-Agent", c.s.userAgent())
  3463. var body io.Reader = nil
  3464. body, err := googleapi.WithoutDataWrapper.JSONReader(c.client)
  3465. if err != nil {
  3466. return nil, err
  3467. }
  3468. reqHeaders.Set("Content-Type", "application/json")
  3469. c.urlParams_.Set("alt", alt)
  3470. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}")
  3471. urls += "?" + c.urlParams_.Encode()
  3472. req, _ := http.NewRequest("PUT", urls, body)
  3473. req.Header = reqHeaders
  3474. googleapi.Expand(req.URL, map[string]string{
  3475. "accountId": strconv.FormatInt(c.accountId, 10),
  3476. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  3477. })
  3478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3479. }
  3480. // Do executes the "adexchangebuyer2.accounts.clients.update" call.
  3481. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  3482. // code is an error. Response headers are in either
  3483. // *Client.ServerResponse.Header or (if a response was returned at all)
  3484. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3485. // check whether the returned error was because http.StatusNotModified
  3486. // was returned.
  3487. func (c *AccountsClientsUpdateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  3488. gensupport.SetOptions(c.urlParams_, opts...)
  3489. res, err := c.doRequest("json")
  3490. if res != nil && res.StatusCode == http.StatusNotModified {
  3491. if res.Body != nil {
  3492. res.Body.Close()
  3493. }
  3494. return nil, &googleapi.Error{
  3495. Code: res.StatusCode,
  3496. Header: res.Header,
  3497. }
  3498. }
  3499. if err != nil {
  3500. return nil, err
  3501. }
  3502. defer googleapi.CloseBody(res)
  3503. if err := googleapi.CheckResponse(res); err != nil {
  3504. return nil, err
  3505. }
  3506. ret := &Client{
  3507. ServerResponse: googleapi.ServerResponse{
  3508. Header: res.Header,
  3509. HTTPStatusCode: res.StatusCode,
  3510. },
  3511. }
  3512. target := &ret
  3513. if err := gensupport.DecodeResponse(target, res); err != nil {
  3514. return nil, err
  3515. }
  3516. return ret, nil
  3517. // {
  3518. // "description": "Updates an existing client buyer.",
  3519. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  3520. // "httpMethod": "PUT",
  3521. // "id": "adexchangebuyer2.accounts.clients.update",
  3522. // "parameterOrder": [
  3523. // "accountId",
  3524. // "clientAccountId"
  3525. // ],
  3526. // "parameters": {
  3527. // "accountId": {
  3528. // "description": "Unique numerical account ID for the buyer of which the client buyer\nis a customer; the sponsor buyer to update a client for. (required)",
  3529. // "format": "int64",
  3530. // "location": "path",
  3531. // "required": true,
  3532. // "type": "string"
  3533. // },
  3534. // "clientAccountId": {
  3535. // "description": "Unique numerical account ID of the client to update. (required)",
  3536. // "format": "int64",
  3537. // "location": "path",
  3538. // "required": true,
  3539. // "type": "string"
  3540. // }
  3541. // },
  3542. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  3543. // "request": {
  3544. // "$ref": "Client"
  3545. // },
  3546. // "response": {
  3547. // "$ref": "Client"
  3548. // },
  3549. // "scopes": [
  3550. // "https://www.googleapis.com/auth/adexchange.buyer"
  3551. // ]
  3552. // }
  3553. }
  3554. // method id "adexchangebuyer2.accounts.clients.invitations.create":
  3555. type AccountsClientsInvitationsCreateCall struct {
  3556. s *Service
  3557. accountId int64
  3558. clientAccountId int64
  3559. clientuserinvitation *ClientUserInvitation
  3560. urlParams_ gensupport.URLParams
  3561. ctx_ context.Context
  3562. header_ http.Header
  3563. }
  3564. // Create: Creates and sends out an email invitation to access
  3565. // an Ad Exchange client buyer account.
  3566. func (r *AccountsClientsInvitationsService) Create(accountId int64, clientAccountId int64, clientuserinvitation *ClientUserInvitation) *AccountsClientsInvitationsCreateCall {
  3567. c := &AccountsClientsInvitationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3568. c.accountId = accountId
  3569. c.clientAccountId = clientAccountId
  3570. c.clientuserinvitation = clientuserinvitation
  3571. return c
  3572. }
  3573. // Fields allows partial responses to be retrieved. See
  3574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3575. // for more information.
  3576. func (c *AccountsClientsInvitationsCreateCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsCreateCall {
  3577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3578. return c
  3579. }
  3580. // Context sets the context to be used in this call's Do method. Any
  3581. // pending HTTP request will be aborted if the provided context is
  3582. // canceled.
  3583. func (c *AccountsClientsInvitationsCreateCall) Context(ctx context.Context) *AccountsClientsInvitationsCreateCall {
  3584. c.ctx_ = ctx
  3585. return c
  3586. }
  3587. // Header returns an http.Header that can be modified by the caller to
  3588. // add HTTP headers to the request.
  3589. func (c *AccountsClientsInvitationsCreateCall) Header() http.Header {
  3590. if c.header_ == nil {
  3591. c.header_ = make(http.Header)
  3592. }
  3593. return c.header_
  3594. }
  3595. func (c *AccountsClientsInvitationsCreateCall) doRequest(alt string) (*http.Response, error) {
  3596. reqHeaders := make(http.Header)
  3597. for k, v := range c.header_ {
  3598. reqHeaders[k] = v
  3599. }
  3600. reqHeaders.Set("User-Agent", c.s.userAgent())
  3601. var body io.Reader = nil
  3602. body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuserinvitation)
  3603. if err != nil {
  3604. return nil, err
  3605. }
  3606. reqHeaders.Set("Content-Type", "application/json")
  3607. c.urlParams_.Set("alt", alt)
  3608. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations")
  3609. urls += "?" + c.urlParams_.Encode()
  3610. req, _ := http.NewRequest("POST", urls, body)
  3611. req.Header = reqHeaders
  3612. googleapi.Expand(req.URL, map[string]string{
  3613. "accountId": strconv.FormatInt(c.accountId, 10),
  3614. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  3615. })
  3616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3617. }
  3618. // Do executes the "adexchangebuyer2.accounts.clients.invitations.create" call.
  3619. // Exactly one of *ClientUserInvitation or error will be non-nil. Any
  3620. // non-2xx status code is an error. Response headers are in either
  3621. // *ClientUserInvitation.ServerResponse.Header or (if a response was
  3622. // returned at all) in error.(*googleapi.Error).Header. Use
  3623. // googleapi.IsNotModified to check whether the returned error was
  3624. // because http.StatusNotModified was returned.
  3625. func (c *AccountsClientsInvitationsCreateCall) Do(opts ...googleapi.CallOption) (*ClientUserInvitation, error) {
  3626. gensupport.SetOptions(c.urlParams_, opts...)
  3627. res, err := c.doRequest("json")
  3628. if res != nil && res.StatusCode == http.StatusNotModified {
  3629. if res.Body != nil {
  3630. res.Body.Close()
  3631. }
  3632. return nil, &googleapi.Error{
  3633. Code: res.StatusCode,
  3634. Header: res.Header,
  3635. }
  3636. }
  3637. if err != nil {
  3638. return nil, err
  3639. }
  3640. defer googleapi.CloseBody(res)
  3641. if err := googleapi.CheckResponse(res); err != nil {
  3642. return nil, err
  3643. }
  3644. ret := &ClientUserInvitation{
  3645. ServerResponse: googleapi.ServerResponse{
  3646. Header: res.Header,
  3647. HTTPStatusCode: res.StatusCode,
  3648. },
  3649. }
  3650. target := &ret
  3651. if err := gensupport.DecodeResponse(target, res); err != nil {
  3652. return nil, err
  3653. }
  3654. return ret, nil
  3655. // {
  3656. // "description": "Creates and sends out an email invitation to access\nan Ad Exchange client buyer account.",
  3657. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  3658. // "httpMethod": "POST",
  3659. // "id": "adexchangebuyer2.accounts.clients.invitations.create",
  3660. // "parameterOrder": [
  3661. // "accountId",
  3662. // "clientAccountId"
  3663. // ],
  3664. // "parameters": {
  3665. // "accountId": {
  3666. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  3667. // "format": "int64",
  3668. // "location": "path",
  3669. // "required": true,
  3670. // "type": "string"
  3671. // },
  3672. // "clientAccountId": {
  3673. // "description": "Numerical account ID of the client buyer that the user\nshould be associated with. (required)",
  3674. // "format": "int64",
  3675. // "location": "path",
  3676. // "required": true,
  3677. // "type": "string"
  3678. // }
  3679. // },
  3680. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  3681. // "request": {
  3682. // "$ref": "ClientUserInvitation"
  3683. // },
  3684. // "response": {
  3685. // "$ref": "ClientUserInvitation"
  3686. // },
  3687. // "scopes": [
  3688. // "https://www.googleapis.com/auth/adexchange.buyer"
  3689. // ]
  3690. // }
  3691. }
  3692. // method id "adexchangebuyer2.accounts.clients.invitations.get":
  3693. type AccountsClientsInvitationsGetCall struct {
  3694. s *Service
  3695. accountId int64
  3696. clientAccountId int64
  3697. invitationId int64
  3698. urlParams_ gensupport.URLParams
  3699. ifNoneMatch_ string
  3700. ctx_ context.Context
  3701. header_ http.Header
  3702. }
  3703. // Get: Retrieves an existing client user invitation.
  3704. func (r *AccountsClientsInvitationsService) Get(accountId int64, clientAccountId int64, invitationId int64) *AccountsClientsInvitationsGetCall {
  3705. c := &AccountsClientsInvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3706. c.accountId = accountId
  3707. c.clientAccountId = clientAccountId
  3708. c.invitationId = invitationId
  3709. return c
  3710. }
  3711. // Fields allows partial responses to be retrieved. See
  3712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3713. // for more information.
  3714. func (c *AccountsClientsInvitationsGetCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsGetCall {
  3715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3716. return c
  3717. }
  3718. // IfNoneMatch sets the optional parameter which makes the operation
  3719. // fail if the object's ETag matches the given value. This is useful for
  3720. // getting updates only after the object has changed since the last
  3721. // request. Use googleapi.IsNotModified to check whether the response
  3722. // error from Do is the result of In-None-Match.
  3723. func (c *AccountsClientsInvitationsGetCall) IfNoneMatch(entityTag string) *AccountsClientsInvitationsGetCall {
  3724. c.ifNoneMatch_ = entityTag
  3725. return c
  3726. }
  3727. // Context sets the context to be used in this call's Do method. Any
  3728. // pending HTTP request will be aborted if the provided context is
  3729. // canceled.
  3730. func (c *AccountsClientsInvitationsGetCall) Context(ctx context.Context) *AccountsClientsInvitationsGetCall {
  3731. c.ctx_ = ctx
  3732. return c
  3733. }
  3734. // Header returns an http.Header that can be modified by the caller to
  3735. // add HTTP headers to the request.
  3736. func (c *AccountsClientsInvitationsGetCall) Header() http.Header {
  3737. if c.header_ == nil {
  3738. c.header_ = make(http.Header)
  3739. }
  3740. return c.header_
  3741. }
  3742. func (c *AccountsClientsInvitationsGetCall) doRequest(alt string) (*http.Response, error) {
  3743. reqHeaders := make(http.Header)
  3744. for k, v := range c.header_ {
  3745. reqHeaders[k] = v
  3746. }
  3747. reqHeaders.Set("User-Agent", c.s.userAgent())
  3748. if c.ifNoneMatch_ != "" {
  3749. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3750. }
  3751. var body io.Reader = nil
  3752. c.urlParams_.Set("alt", alt)
  3753. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}")
  3754. urls += "?" + c.urlParams_.Encode()
  3755. req, _ := http.NewRequest("GET", urls, body)
  3756. req.Header = reqHeaders
  3757. googleapi.Expand(req.URL, map[string]string{
  3758. "accountId": strconv.FormatInt(c.accountId, 10),
  3759. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  3760. "invitationId": strconv.FormatInt(c.invitationId, 10),
  3761. })
  3762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3763. }
  3764. // Do executes the "adexchangebuyer2.accounts.clients.invitations.get" call.
  3765. // Exactly one of *ClientUserInvitation or error will be non-nil. Any
  3766. // non-2xx status code is an error. Response headers are in either
  3767. // *ClientUserInvitation.ServerResponse.Header or (if a response was
  3768. // returned at all) in error.(*googleapi.Error).Header. Use
  3769. // googleapi.IsNotModified to check whether the returned error was
  3770. // because http.StatusNotModified was returned.
  3771. func (c *AccountsClientsInvitationsGetCall) Do(opts ...googleapi.CallOption) (*ClientUserInvitation, error) {
  3772. gensupport.SetOptions(c.urlParams_, opts...)
  3773. res, err := c.doRequest("json")
  3774. if res != nil && res.StatusCode == http.StatusNotModified {
  3775. if res.Body != nil {
  3776. res.Body.Close()
  3777. }
  3778. return nil, &googleapi.Error{
  3779. Code: res.StatusCode,
  3780. Header: res.Header,
  3781. }
  3782. }
  3783. if err != nil {
  3784. return nil, err
  3785. }
  3786. defer googleapi.CloseBody(res)
  3787. if err := googleapi.CheckResponse(res); err != nil {
  3788. return nil, err
  3789. }
  3790. ret := &ClientUserInvitation{
  3791. ServerResponse: googleapi.ServerResponse{
  3792. Header: res.Header,
  3793. HTTPStatusCode: res.StatusCode,
  3794. },
  3795. }
  3796. target := &ret
  3797. if err := gensupport.DecodeResponse(target, res); err != nil {
  3798. return nil, err
  3799. }
  3800. return ret, nil
  3801. // {
  3802. // "description": "Retrieves an existing client user invitation.",
  3803. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}",
  3804. // "httpMethod": "GET",
  3805. // "id": "adexchangebuyer2.accounts.clients.invitations.get",
  3806. // "parameterOrder": [
  3807. // "accountId",
  3808. // "clientAccountId",
  3809. // "invitationId"
  3810. // ],
  3811. // "parameters": {
  3812. // "accountId": {
  3813. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  3814. // "format": "int64",
  3815. // "location": "path",
  3816. // "required": true,
  3817. // "type": "string"
  3818. // },
  3819. // "clientAccountId": {
  3820. // "description": "Numerical account ID of the client buyer that the user invitation\nto be retrieved is associated with. (required)",
  3821. // "format": "int64",
  3822. // "location": "path",
  3823. // "required": true,
  3824. // "type": "string"
  3825. // },
  3826. // "invitationId": {
  3827. // "description": "Numerical identifier of the user invitation to retrieve. (required)",
  3828. // "format": "int64",
  3829. // "location": "path",
  3830. // "required": true,
  3831. // "type": "string"
  3832. // }
  3833. // },
  3834. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}",
  3835. // "response": {
  3836. // "$ref": "ClientUserInvitation"
  3837. // },
  3838. // "scopes": [
  3839. // "https://www.googleapis.com/auth/adexchange.buyer"
  3840. // ]
  3841. // }
  3842. }
  3843. // method id "adexchangebuyer2.accounts.clients.invitations.list":
  3844. type AccountsClientsInvitationsListCall struct {
  3845. s *Service
  3846. accountId int64
  3847. clientAccountId string
  3848. urlParams_ gensupport.URLParams
  3849. ifNoneMatch_ string
  3850. ctx_ context.Context
  3851. header_ http.Header
  3852. }
  3853. // List: Lists all the client users invitations for a client
  3854. // with a given account ID.
  3855. func (r *AccountsClientsInvitationsService) List(accountId int64, clientAccountId string) *AccountsClientsInvitationsListCall {
  3856. c := &AccountsClientsInvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3857. c.accountId = accountId
  3858. c.clientAccountId = clientAccountId
  3859. return c
  3860. }
  3861. // PageSize sets the optional parameter "pageSize": Requested page size.
  3862. // Server may return fewer clients than requested.
  3863. // If unspecified, server will pick an appropriate default.
  3864. func (c *AccountsClientsInvitationsListCall) PageSize(pageSize int64) *AccountsClientsInvitationsListCall {
  3865. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3866. return c
  3867. }
  3868. // PageToken sets the optional parameter "pageToken": A token
  3869. // identifying a page of results the server should return.
  3870. // Typically, this is the value
  3871. // of
  3872. // ListClientUserInvitationsResponse.nextPageToken
  3873. // returned from the previous call to
  3874. // the
  3875. // clients.invitations.list
  3876. // method.
  3877. func (c *AccountsClientsInvitationsListCall) PageToken(pageToken string) *AccountsClientsInvitationsListCall {
  3878. c.urlParams_.Set("pageToken", pageToken)
  3879. return c
  3880. }
  3881. // Fields allows partial responses to be retrieved. See
  3882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3883. // for more information.
  3884. func (c *AccountsClientsInvitationsListCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsListCall {
  3885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3886. return c
  3887. }
  3888. // IfNoneMatch sets the optional parameter which makes the operation
  3889. // fail if the object's ETag matches the given value. This is useful for
  3890. // getting updates only after the object has changed since the last
  3891. // request. Use googleapi.IsNotModified to check whether the response
  3892. // error from Do is the result of In-None-Match.
  3893. func (c *AccountsClientsInvitationsListCall) IfNoneMatch(entityTag string) *AccountsClientsInvitationsListCall {
  3894. c.ifNoneMatch_ = entityTag
  3895. return c
  3896. }
  3897. // Context sets the context to be used in this call's Do method. Any
  3898. // pending HTTP request will be aborted if the provided context is
  3899. // canceled.
  3900. func (c *AccountsClientsInvitationsListCall) Context(ctx context.Context) *AccountsClientsInvitationsListCall {
  3901. c.ctx_ = ctx
  3902. return c
  3903. }
  3904. // Header returns an http.Header that can be modified by the caller to
  3905. // add HTTP headers to the request.
  3906. func (c *AccountsClientsInvitationsListCall) Header() http.Header {
  3907. if c.header_ == nil {
  3908. c.header_ = make(http.Header)
  3909. }
  3910. return c.header_
  3911. }
  3912. func (c *AccountsClientsInvitationsListCall) doRequest(alt string) (*http.Response, error) {
  3913. reqHeaders := make(http.Header)
  3914. for k, v := range c.header_ {
  3915. reqHeaders[k] = v
  3916. }
  3917. reqHeaders.Set("User-Agent", c.s.userAgent())
  3918. if c.ifNoneMatch_ != "" {
  3919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3920. }
  3921. var body io.Reader = nil
  3922. c.urlParams_.Set("alt", alt)
  3923. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations")
  3924. urls += "?" + c.urlParams_.Encode()
  3925. req, _ := http.NewRequest("GET", urls, body)
  3926. req.Header = reqHeaders
  3927. googleapi.Expand(req.URL, map[string]string{
  3928. "accountId": strconv.FormatInt(c.accountId, 10),
  3929. "clientAccountId": c.clientAccountId,
  3930. })
  3931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3932. }
  3933. // Do executes the "adexchangebuyer2.accounts.clients.invitations.list" call.
  3934. // Exactly one of *ListClientUserInvitationsResponse or error will be
  3935. // non-nil. Any non-2xx status code is an error. Response headers are in
  3936. // either *ListClientUserInvitationsResponse.ServerResponse.Header or
  3937. // (if a response was returned at all) in
  3938. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3939. // whether the returned error was because http.StatusNotModified was
  3940. // returned.
  3941. func (c *AccountsClientsInvitationsListCall) Do(opts ...googleapi.CallOption) (*ListClientUserInvitationsResponse, error) {
  3942. gensupport.SetOptions(c.urlParams_, opts...)
  3943. res, err := c.doRequest("json")
  3944. if res != nil && res.StatusCode == http.StatusNotModified {
  3945. if res.Body != nil {
  3946. res.Body.Close()
  3947. }
  3948. return nil, &googleapi.Error{
  3949. Code: res.StatusCode,
  3950. Header: res.Header,
  3951. }
  3952. }
  3953. if err != nil {
  3954. return nil, err
  3955. }
  3956. defer googleapi.CloseBody(res)
  3957. if err := googleapi.CheckResponse(res); err != nil {
  3958. return nil, err
  3959. }
  3960. ret := &ListClientUserInvitationsResponse{
  3961. ServerResponse: googleapi.ServerResponse{
  3962. Header: res.Header,
  3963. HTTPStatusCode: res.StatusCode,
  3964. },
  3965. }
  3966. target := &ret
  3967. if err := gensupport.DecodeResponse(target, res); err != nil {
  3968. return nil, err
  3969. }
  3970. return ret, nil
  3971. // {
  3972. // "description": "Lists all the client users invitations for a client\nwith a given account ID.",
  3973. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  3974. // "httpMethod": "GET",
  3975. // "id": "adexchangebuyer2.accounts.clients.invitations.list",
  3976. // "parameterOrder": [
  3977. // "accountId",
  3978. // "clientAccountId"
  3979. // ],
  3980. // "parameters": {
  3981. // "accountId": {
  3982. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  3983. // "format": "int64",
  3984. // "location": "path",
  3985. // "required": true,
  3986. // "type": "string"
  3987. // },
  3988. // "clientAccountId": {
  3989. // "description": "Numerical account ID of the client buyer to list invitations for.\n(required)\nYou must either specify a string representation of a\nnumerical account identifier or the `-` character\nto list all the invitations for all the clients\nof a given sponsor buyer.",
  3990. // "location": "path",
  3991. // "required": true,
  3992. // "type": "string"
  3993. // },
  3994. // "pageSize": {
  3995. // "description": "Requested page size. Server may return fewer clients than requested.\nIf unspecified, server will pick an appropriate default.",
  3996. // "format": "int32",
  3997. // "location": "query",
  3998. // "type": "integer"
  3999. // },
  4000. // "pageToken": {
  4001. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUserInvitationsResponse.nextPageToken\nreturned from the previous call to the\nclients.invitations.list\nmethod.",
  4002. // "location": "query",
  4003. // "type": "string"
  4004. // }
  4005. // },
  4006. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  4007. // "response": {
  4008. // "$ref": "ListClientUserInvitationsResponse"
  4009. // },
  4010. // "scopes": [
  4011. // "https://www.googleapis.com/auth/adexchange.buyer"
  4012. // ]
  4013. // }
  4014. }
  4015. // Pages invokes f for each page of results.
  4016. // A non-nil error returned from f will halt the iteration.
  4017. // The provided context supersedes any context provided to the Context method.
  4018. func (c *AccountsClientsInvitationsListCall) Pages(ctx context.Context, f func(*ListClientUserInvitationsResponse) error) error {
  4019. c.ctx_ = ctx
  4020. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4021. for {
  4022. x, err := c.Do()
  4023. if err != nil {
  4024. return err
  4025. }
  4026. if err := f(x); err != nil {
  4027. return err
  4028. }
  4029. if x.NextPageToken == "" {
  4030. return nil
  4031. }
  4032. c.PageToken(x.NextPageToken)
  4033. }
  4034. }
  4035. // method id "adexchangebuyer2.accounts.clients.users.get":
  4036. type AccountsClientsUsersGetCall struct {
  4037. s *Service
  4038. accountId int64
  4039. clientAccountId int64
  4040. userId int64
  4041. urlParams_ gensupport.URLParams
  4042. ifNoneMatch_ string
  4043. ctx_ context.Context
  4044. header_ http.Header
  4045. }
  4046. // Get: Retrieves an existing client user.
  4047. func (r *AccountsClientsUsersService) Get(accountId int64, clientAccountId int64, userId int64) *AccountsClientsUsersGetCall {
  4048. c := &AccountsClientsUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4049. c.accountId = accountId
  4050. c.clientAccountId = clientAccountId
  4051. c.userId = userId
  4052. return c
  4053. }
  4054. // Fields allows partial responses to be retrieved. See
  4055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4056. // for more information.
  4057. func (c *AccountsClientsUsersGetCall) Fields(s ...googleapi.Field) *AccountsClientsUsersGetCall {
  4058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4059. return c
  4060. }
  4061. // IfNoneMatch sets the optional parameter which makes the operation
  4062. // fail if the object's ETag matches the given value. This is useful for
  4063. // getting updates only after the object has changed since the last
  4064. // request. Use googleapi.IsNotModified to check whether the response
  4065. // error from Do is the result of In-None-Match.
  4066. func (c *AccountsClientsUsersGetCall) IfNoneMatch(entityTag string) *AccountsClientsUsersGetCall {
  4067. c.ifNoneMatch_ = entityTag
  4068. return c
  4069. }
  4070. // Context sets the context to be used in this call's Do method. Any
  4071. // pending HTTP request will be aborted if the provided context is
  4072. // canceled.
  4073. func (c *AccountsClientsUsersGetCall) Context(ctx context.Context) *AccountsClientsUsersGetCall {
  4074. c.ctx_ = ctx
  4075. return c
  4076. }
  4077. // Header returns an http.Header that can be modified by the caller to
  4078. // add HTTP headers to the request.
  4079. func (c *AccountsClientsUsersGetCall) Header() http.Header {
  4080. if c.header_ == nil {
  4081. c.header_ = make(http.Header)
  4082. }
  4083. return c.header_
  4084. }
  4085. func (c *AccountsClientsUsersGetCall) doRequest(alt string) (*http.Response, error) {
  4086. reqHeaders := make(http.Header)
  4087. for k, v := range c.header_ {
  4088. reqHeaders[k] = v
  4089. }
  4090. reqHeaders.Set("User-Agent", c.s.userAgent())
  4091. if c.ifNoneMatch_ != "" {
  4092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4093. }
  4094. var body io.Reader = nil
  4095. c.urlParams_.Set("alt", alt)
  4096. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}")
  4097. urls += "?" + c.urlParams_.Encode()
  4098. req, _ := http.NewRequest("GET", urls, body)
  4099. req.Header = reqHeaders
  4100. googleapi.Expand(req.URL, map[string]string{
  4101. "accountId": strconv.FormatInt(c.accountId, 10),
  4102. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  4103. "userId": strconv.FormatInt(c.userId, 10),
  4104. })
  4105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4106. }
  4107. // Do executes the "adexchangebuyer2.accounts.clients.users.get" call.
  4108. // Exactly one of *ClientUser or error will be non-nil. Any non-2xx
  4109. // status code is an error. Response headers are in either
  4110. // *ClientUser.ServerResponse.Header or (if a response was returned at
  4111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4112. // to check whether the returned error was because
  4113. // http.StatusNotModified was returned.
  4114. func (c *AccountsClientsUsersGetCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
  4115. gensupport.SetOptions(c.urlParams_, opts...)
  4116. res, err := c.doRequest("json")
  4117. if res != nil && res.StatusCode == http.StatusNotModified {
  4118. if res.Body != nil {
  4119. res.Body.Close()
  4120. }
  4121. return nil, &googleapi.Error{
  4122. Code: res.StatusCode,
  4123. Header: res.Header,
  4124. }
  4125. }
  4126. if err != nil {
  4127. return nil, err
  4128. }
  4129. defer googleapi.CloseBody(res)
  4130. if err := googleapi.CheckResponse(res); err != nil {
  4131. return nil, err
  4132. }
  4133. ret := &ClientUser{
  4134. ServerResponse: googleapi.ServerResponse{
  4135. Header: res.Header,
  4136. HTTPStatusCode: res.StatusCode,
  4137. },
  4138. }
  4139. target := &ret
  4140. if err := gensupport.DecodeResponse(target, res); err != nil {
  4141. return nil, err
  4142. }
  4143. return ret, nil
  4144. // {
  4145. // "description": "Retrieves an existing client user.",
  4146. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  4147. // "httpMethod": "GET",
  4148. // "id": "adexchangebuyer2.accounts.clients.users.get",
  4149. // "parameterOrder": [
  4150. // "accountId",
  4151. // "clientAccountId",
  4152. // "userId"
  4153. // ],
  4154. // "parameters": {
  4155. // "accountId": {
  4156. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  4157. // "format": "int64",
  4158. // "location": "path",
  4159. // "required": true,
  4160. // "type": "string"
  4161. // },
  4162. // "clientAccountId": {
  4163. // "description": "Numerical account ID of the client buyer\nthat the user to be retrieved is associated with. (required)",
  4164. // "format": "int64",
  4165. // "location": "path",
  4166. // "required": true,
  4167. // "type": "string"
  4168. // },
  4169. // "userId": {
  4170. // "description": "Numerical identifier of the user to retrieve. (required)",
  4171. // "format": "int64",
  4172. // "location": "path",
  4173. // "required": true,
  4174. // "type": "string"
  4175. // }
  4176. // },
  4177. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  4178. // "response": {
  4179. // "$ref": "ClientUser"
  4180. // },
  4181. // "scopes": [
  4182. // "https://www.googleapis.com/auth/adexchange.buyer"
  4183. // ]
  4184. // }
  4185. }
  4186. // method id "adexchangebuyer2.accounts.clients.users.list":
  4187. type AccountsClientsUsersListCall struct {
  4188. s *Service
  4189. accountId int64
  4190. clientAccountId string
  4191. urlParams_ gensupport.URLParams
  4192. ifNoneMatch_ string
  4193. ctx_ context.Context
  4194. header_ http.Header
  4195. }
  4196. // List: Lists all the known client users for a specified
  4197. // sponsor buyer account ID.
  4198. func (r *AccountsClientsUsersService) List(accountId int64, clientAccountId string) *AccountsClientsUsersListCall {
  4199. c := &AccountsClientsUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4200. c.accountId = accountId
  4201. c.clientAccountId = clientAccountId
  4202. return c
  4203. }
  4204. // PageSize sets the optional parameter "pageSize": Requested page size.
  4205. // The server may return fewer clients than requested.
  4206. // If unspecified, the server will pick an appropriate default.
  4207. func (c *AccountsClientsUsersListCall) PageSize(pageSize int64) *AccountsClientsUsersListCall {
  4208. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4209. return c
  4210. }
  4211. // PageToken sets the optional parameter "pageToken": A token
  4212. // identifying a page of results the server should return.
  4213. // Typically, this is the value
  4214. // of
  4215. // ListClientUsersResponse.nextPageToken
  4216. // returned from the previous call to the
  4217. // accounts.clients.users.list method.
  4218. func (c *AccountsClientsUsersListCall) PageToken(pageToken string) *AccountsClientsUsersListCall {
  4219. c.urlParams_.Set("pageToken", pageToken)
  4220. return c
  4221. }
  4222. // Fields allows partial responses to be retrieved. See
  4223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4224. // for more information.
  4225. func (c *AccountsClientsUsersListCall) Fields(s ...googleapi.Field) *AccountsClientsUsersListCall {
  4226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4227. return c
  4228. }
  4229. // IfNoneMatch sets the optional parameter which makes the operation
  4230. // fail if the object's ETag matches the given value. This is useful for
  4231. // getting updates only after the object has changed since the last
  4232. // request. Use googleapi.IsNotModified to check whether the response
  4233. // error from Do is the result of In-None-Match.
  4234. func (c *AccountsClientsUsersListCall) IfNoneMatch(entityTag string) *AccountsClientsUsersListCall {
  4235. c.ifNoneMatch_ = entityTag
  4236. return c
  4237. }
  4238. // Context sets the context to be used in this call's Do method. Any
  4239. // pending HTTP request will be aborted if the provided context is
  4240. // canceled.
  4241. func (c *AccountsClientsUsersListCall) Context(ctx context.Context) *AccountsClientsUsersListCall {
  4242. c.ctx_ = ctx
  4243. return c
  4244. }
  4245. // Header returns an http.Header that can be modified by the caller to
  4246. // add HTTP headers to the request.
  4247. func (c *AccountsClientsUsersListCall) Header() http.Header {
  4248. if c.header_ == nil {
  4249. c.header_ = make(http.Header)
  4250. }
  4251. return c.header_
  4252. }
  4253. func (c *AccountsClientsUsersListCall) doRequest(alt string) (*http.Response, error) {
  4254. reqHeaders := make(http.Header)
  4255. for k, v := range c.header_ {
  4256. reqHeaders[k] = v
  4257. }
  4258. reqHeaders.Set("User-Agent", c.s.userAgent())
  4259. if c.ifNoneMatch_ != "" {
  4260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4261. }
  4262. var body io.Reader = nil
  4263. c.urlParams_.Set("alt", alt)
  4264. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users")
  4265. urls += "?" + c.urlParams_.Encode()
  4266. req, _ := http.NewRequest("GET", urls, body)
  4267. req.Header = reqHeaders
  4268. googleapi.Expand(req.URL, map[string]string{
  4269. "accountId": strconv.FormatInt(c.accountId, 10),
  4270. "clientAccountId": c.clientAccountId,
  4271. })
  4272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4273. }
  4274. // Do executes the "adexchangebuyer2.accounts.clients.users.list" call.
  4275. // Exactly one of *ListClientUsersResponse or error will be non-nil. Any
  4276. // non-2xx status code is an error. Response headers are in either
  4277. // *ListClientUsersResponse.ServerResponse.Header or (if a response was
  4278. // returned at all) in error.(*googleapi.Error).Header. Use
  4279. // googleapi.IsNotModified to check whether the returned error was
  4280. // because http.StatusNotModified was returned.
  4281. func (c *AccountsClientsUsersListCall) Do(opts ...googleapi.CallOption) (*ListClientUsersResponse, error) {
  4282. gensupport.SetOptions(c.urlParams_, opts...)
  4283. res, err := c.doRequest("json")
  4284. if res != nil && res.StatusCode == http.StatusNotModified {
  4285. if res.Body != nil {
  4286. res.Body.Close()
  4287. }
  4288. return nil, &googleapi.Error{
  4289. Code: res.StatusCode,
  4290. Header: res.Header,
  4291. }
  4292. }
  4293. if err != nil {
  4294. return nil, err
  4295. }
  4296. defer googleapi.CloseBody(res)
  4297. if err := googleapi.CheckResponse(res); err != nil {
  4298. return nil, err
  4299. }
  4300. ret := &ListClientUsersResponse{
  4301. ServerResponse: googleapi.ServerResponse{
  4302. Header: res.Header,
  4303. HTTPStatusCode: res.StatusCode,
  4304. },
  4305. }
  4306. target := &ret
  4307. if err := gensupport.DecodeResponse(target, res); err != nil {
  4308. return nil, err
  4309. }
  4310. return ret, nil
  4311. // {
  4312. // "description": "Lists all the known client users for a specified\nsponsor buyer account ID.",
  4313. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users",
  4314. // "httpMethod": "GET",
  4315. // "id": "adexchangebuyer2.accounts.clients.users.list",
  4316. // "parameterOrder": [
  4317. // "accountId",
  4318. // "clientAccountId"
  4319. // ],
  4320. // "parameters": {
  4321. // "accountId": {
  4322. // "description": "Numerical account ID of the sponsor buyer of the client to list users for.\n(required)",
  4323. // "format": "int64",
  4324. // "location": "path",
  4325. // "required": true,
  4326. // "type": "string"
  4327. // },
  4328. // "clientAccountId": {
  4329. // "description": "The account ID of the client buyer to list users for. (required)\nYou must specify either a string representation of a\nnumerical account identifier or the `-` character\nto list all the client users for all the clients\nof a given sponsor buyer.",
  4330. // "location": "path",
  4331. // "required": true,
  4332. // "type": "string"
  4333. // },
  4334. // "pageSize": {
  4335. // "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.",
  4336. // "format": "int32",
  4337. // "location": "query",
  4338. // "type": "integer"
  4339. // },
  4340. // "pageToken": {
  4341. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListClientUsersResponse.nextPageToken\nreturned from the previous call to the\naccounts.clients.users.list method.",
  4342. // "location": "query",
  4343. // "type": "string"
  4344. // }
  4345. // },
  4346. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users",
  4347. // "response": {
  4348. // "$ref": "ListClientUsersResponse"
  4349. // },
  4350. // "scopes": [
  4351. // "https://www.googleapis.com/auth/adexchange.buyer"
  4352. // ]
  4353. // }
  4354. }
  4355. // Pages invokes f for each page of results.
  4356. // A non-nil error returned from f will halt the iteration.
  4357. // The provided context supersedes any context provided to the Context method.
  4358. func (c *AccountsClientsUsersListCall) Pages(ctx context.Context, f func(*ListClientUsersResponse) error) error {
  4359. c.ctx_ = ctx
  4360. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4361. for {
  4362. x, err := c.Do()
  4363. if err != nil {
  4364. return err
  4365. }
  4366. if err := f(x); err != nil {
  4367. return err
  4368. }
  4369. if x.NextPageToken == "" {
  4370. return nil
  4371. }
  4372. c.PageToken(x.NextPageToken)
  4373. }
  4374. }
  4375. // method id "adexchangebuyer2.accounts.clients.users.update":
  4376. type AccountsClientsUsersUpdateCall struct {
  4377. s *Service
  4378. accountId int64
  4379. clientAccountId int64
  4380. userId int64
  4381. clientuser *ClientUser
  4382. urlParams_ gensupport.URLParams
  4383. ctx_ context.Context
  4384. header_ http.Header
  4385. }
  4386. // Update: Updates an existing client user.
  4387. // Only the user status can be changed on update.
  4388. func (r *AccountsClientsUsersService) Update(accountId int64, clientAccountId int64, userId int64, clientuser *ClientUser) *AccountsClientsUsersUpdateCall {
  4389. c := &AccountsClientsUsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4390. c.accountId = accountId
  4391. c.clientAccountId = clientAccountId
  4392. c.userId = userId
  4393. c.clientuser = clientuser
  4394. return c
  4395. }
  4396. // Fields allows partial responses to be retrieved. See
  4397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4398. // for more information.
  4399. func (c *AccountsClientsUsersUpdateCall) Fields(s ...googleapi.Field) *AccountsClientsUsersUpdateCall {
  4400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4401. return c
  4402. }
  4403. // Context sets the context to be used in this call's Do method. Any
  4404. // pending HTTP request will be aborted if the provided context is
  4405. // canceled.
  4406. func (c *AccountsClientsUsersUpdateCall) Context(ctx context.Context) *AccountsClientsUsersUpdateCall {
  4407. c.ctx_ = ctx
  4408. return c
  4409. }
  4410. // Header returns an http.Header that can be modified by the caller to
  4411. // add HTTP headers to the request.
  4412. func (c *AccountsClientsUsersUpdateCall) Header() http.Header {
  4413. if c.header_ == nil {
  4414. c.header_ = make(http.Header)
  4415. }
  4416. return c.header_
  4417. }
  4418. func (c *AccountsClientsUsersUpdateCall) doRequest(alt string) (*http.Response, error) {
  4419. reqHeaders := make(http.Header)
  4420. for k, v := range c.header_ {
  4421. reqHeaders[k] = v
  4422. }
  4423. reqHeaders.Set("User-Agent", c.s.userAgent())
  4424. var body io.Reader = nil
  4425. body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuser)
  4426. if err != nil {
  4427. return nil, err
  4428. }
  4429. reqHeaders.Set("Content-Type", "application/json")
  4430. c.urlParams_.Set("alt", alt)
  4431. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}")
  4432. urls += "?" + c.urlParams_.Encode()
  4433. req, _ := http.NewRequest("PUT", urls, body)
  4434. req.Header = reqHeaders
  4435. googleapi.Expand(req.URL, map[string]string{
  4436. "accountId": strconv.FormatInt(c.accountId, 10),
  4437. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  4438. "userId": strconv.FormatInt(c.userId, 10),
  4439. })
  4440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4441. }
  4442. // Do executes the "adexchangebuyer2.accounts.clients.users.update" call.
  4443. // Exactly one of *ClientUser or error will be non-nil. Any non-2xx
  4444. // status code is an error. Response headers are in either
  4445. // *ClientUser.ServerResponse.Header or (if a response was returned at
  4446. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4447. // to check whether the returned error was because
  4448. // http.StatusNotModified was returned.
  4449. func (c *AccountsClientsUsersUpdateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
  4450. gensupport.SetOptions(c.urlParams_, opts...)
  4451. res, err := c.doRequest("json")
  4452. if res != nil && res.StatusCode == http.StatusNotModified {
  4453. if res.Body != nil {
  4454. res.Body.Close()
  4455. }
  4456. return nil, &googleapi.Error{
  4457. Code: res.StatusCode,
  4458. Header: res.Header,
  4459. }
  4460. }
  4461. if err != nil {
  4462. return nil, err
  4463. }
  4464. defer googleapi.CloseBody(res)
  4465. if err := googleapi.CheckResponse(res); err != nil {
  4466. return nil, err
  4467. }
  4468. ret := &ClientUser{
  4469. ServerResponse: googleapi.ServerResponse{
  4470. Header: res.Header,
  4471. HTTPStatusCode: res.StatusCode,
  4472. },
  4473. }
  4474. target := &ret
  4475. if err := gensupport.DecodeResponse(target, res); err != nil {
  4476. return nil, err
  4477. }
  4478. return ret, nil
  4479. // {
  4480. // "description": "Updates an existing client user.\nOnly the user status can be changed on update.",
  4481. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  4482. // "httpMethod": "PUT",
  4483. // "id": "adexchangebuyer2.accounts.clients.users.update",
  4484. // "parameterOrder": [
  4485. // "accountId",
  4486. // "clientAccountId",
  4487. // "userId"
  4488. // ],
  4489. // "parameters": {
  4490. // "accountId": {
  4491. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  4492. // "format": "int64",
  4493. // "location": "path",
  4494. // "required": true,
  4495. // "type": "string"
  4496. // },
  4497. // "clientAccountId": {
  4498. // "description": "Numerical account ID of the client buyer that the user to be retrieved\nis associated with. (required)",
  4499. // "format": "int64",
  4500. // "location": "path",
  4501. // "required": true,
  4502. // "type": "string"
  4503. // },
  4504. // "userId": {
  4505. // "description": "Numerical identifier of the user to retrieve. (required)",
  4506. // "format": "int64",
  4507. // "location": "path",
  4508. // "required": true,
  4509. // "type": "string"
  4510. // }
  4511. // },
  4512. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  4513. // "request": {
  4514. // "$ref": "ClientUser"
  4515. // },
  4516. // "response": {
  4517. // "$ref": "ClientUser"
  4518. // },
  4519. // "scopes": [
  4520. // "https://www.googleapis.com/auth/adexchange.buyer"
  4521. // ]
  4522. // }
  4523. }
  4524. // method id "adexchangebuyer2.accounts.creatives.create":
  4525. type AccountsCreativesCreateCall struct {
  4526. s *Service
  4527. accountId string
  4528. creative *Creative
  4529. urlParams_ gensupport.URLParams
  4530. ctx_ context.Context
  4531. header_ http.Header
  4532. }
  4533. // Create: Creates a creative.
  4534. func (r *AccountsCreativesService) Create(accountId string, creative *Creative) *AccountsCreativesCreateCall {
  4535. c := &AccountsCreativesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4536. c.accountId = accountId
  4537. c.creative = creative
  4538. return c
  4539. }
  4540. // DuplicateIdMode sets the optional parameter "duplicateIdMode":
  4541. // Indicates if multiple creatives can share an ID or not. Default
  4542. // is
  4543. // NO_DUPLICATES (one ID per creative).
  4544. //
  4545. // Possible values:
  4546. // "NO_DUPLICATES"
  4547. // "FORCE_ENABLE_DUPLICATE_IDS"
  4548. func (c *AccountsCreativesCreateCall) DuplicateIdMode(duplicateIdMode string) *AccountsCreativesCreateCall {
  4549. c.urlParams_.Set("duplicateIdMode", duplicateIdMode)
  4550. return c
  4551. }
  4552. // Fields allows partial responses to be retrieved. See
  4553. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4554. // for more information.
  4555. func (c *AccountsCreativesCreateCall) Fields(s ...googleapi.Field) *AccountsCreativesCreateCall {
  4556. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4557. return c
  4558. }
  4559. // Context sets the context to be used in this call's Do method. Any
  4560. // pending HTTP request will be aborted if the provided context is
  4561. // canceled.
  4562. func (c *AccountsCreativesCreateCall) Context(ctx context.Context) *AccountsCreativesCreateCall {
  4563. c.ctx_ = ctx
  4564. return c
  4565. }
  4566. // Header returns an http.Header that can be modified by the caller to
  4567. // add HTTP headers to the request.
  4568. func (c *AccountsCreativesCreateCall) Header() http.Header {
  4569. if c.header_ == nil {
  4570. c.header_ = make(http.Header)
  4571. }
  4572. return c.header_
  4573. }
  4574. func (c *AccountsCreativesCreateCall) doRequest(alt string) (*http.Response, error) {
  4575. reqHeaders := make(http.Header)
  4576. for k, v := range c.header_ {
  4577. reqHeaders[k] = v
  4578. }
  4579. reqHeaders.Set("User-Agent", c.s.userAgent())
  4580. var body io.Reader = nil
  4581. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  4582. if err != nil {
  4583. return nil, err
  4584. }
  4585. reqHeaders.Set("Content-Type", "application/json")
  4586. c.urlParams_.Set("alt", alt)
  4587. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives")
  4588. urls += "?" + c.urlParams_.Encode()
  4589. req, _ := http.NewRequest("POST", urls, body)
  4590. req.Header = reqHeaders
  4591. googleapi.Expand(req.URL, map[string]string{
  4592. "accountId": c.accountId,
  4593. })
  4594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4595. }
  4596. // Do executes the "adexchangebuyer2.accounts.creatives.create" call.
  4597. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  4598. // code is an error. Response headers are in either
  4599. // *Creative.ServerResponse.Header or (if a response was returned at
  4600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4601. // to check whether the returned error was because
  4602. // http.StatusNotModified was returned.
  4603. func (c *AccountsCreativesCreateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  4604. gensupport.SetOptions(c.urlParams_, opts...)
  4605. res, err := c.doRequest("json")
  4606. if res != nil && res.StatusCode == http.StatusNotModified {
  4607. if res.Body != nil {
  4608. res.Body.Close()
  4609. }
  4610. return nil, &googleapi.Error{
  4611. Code: res.StatusCode,
  4612. Header: res.Header,
  4613. }
  4614. }
  4615. if err != nil {
  4616. return nil, err
  4617. }
  4618. defer googleapi.CloseBody(res)
  4619. if err := googleapi.CheckResponse(res); err != nil {
  4620. return nil, err
  4621. }
  4622. ret := &Creative{
  4623. ServerResponse: googleapi.ServerResponse{
  4624. Header: res.Header,
  4625. HTTPStatusCode: res.StatusCode,
  4626. },
  4627. }
  4628. target := &ret
  4629. if err := gensupport.DecodeResponse(target, res); err != nil {
  4630. return nil, err
  4631. }
  4632. return ret, nil
  4633. // {
  4634. // "description": "Creates a creative.",
  4635. // "flatPath": "v2beta1/accounts/{accountId}/creatives",
  4636. // "httpMethod": "POST",
  4637. // "id": "adexchangebuyer2.accounts.creatives.create",
  4638. // "parameterOrder": [
  4639. // "accountId"
  4640. // ],
  4641. // "parameters": {
  4642. // "accountId": {
  4643. // "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  4644. // "location": "path",
  4645. // "required": true,
  4646. // "type": "string"
  4647. // },
  4648. // "duplicateIdMode": {
  4649. // "description": "Indicates if multiple creatives can share an ID or not. Default is\nNO_DUPLICATES (one ID per creative).",
  4650. // "enum": [
  4651. // "NO_DUPLICATES",
  4652. // "FORCE_ENABLE_DUPLICATE_IDS"
  4653. // ],
  4654. // "location": "query",
  4655. // "type": "string"
  4656. // }
  4657. // },
  4658. // "path": "v2beta1/accounts/{accountId}/creatives",
  4659. // "request": {
  4660. // "$ref": "Creative"
  4661. // },
  4662. // "response": {
  4663. // "$ref": "Creative"
  4664. // },
  4665. // "scopes": [
  4666. // "https://www.googleapis.com/auth/adexchange.buyer"
  4667. // ]
  4668. // }
  4669. }
  4670. // method id "adexchangebuyer2.accounts.creatives.get":
  4671. type AccountsCreativesGetCall struct {
  4672. s *Service
  4673. accountId string
  4674. creativeId string
  4675. urlParams_ gensupport.URLParams
  4676. ifNoneMatch_ string
  4677. ctx_ context.Context
  4678. header_ http.Header
  4679. }
  4680. // Get: Gets a creative.
  4681. func (r *AccountsCreativesService) Get(accountId string, creativeId string) *AccountsCreativesGetCall {
  4682. c := &AccountsCreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4683. c.accountId = accountId
  4684. c.creativeId = creativeId
  4685. return c
  4686. }
  4687. // Fields allows partial responses to be retrieved. See
  4688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4689. // for more information.
  4690. func (c *AccountsCreativesGetCall) Fields(s ...googleapi.Field) *AccountsCreativesGetCall {
  4691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4692. return c
  4693. }
  4694. // IfNoneMatch sets the optional parameter which makes the operation
  4695. // fail if the object's ETag matches the given value. This is useful for
  4696. // getting updates only after the object has changed since the last
  4697. // request. Use googleapi.IsNotModified to check whether the response
  4698. // error from Do is the result of In-None-Match.
  4699. func (c *AccountsCreativesGetCall) IfNoneMatch(entityTag string) *AccountsCreativesGetCall {
  4700. c.ifNoneMatch_ = entityTag
  4701. return c
  4702. }
  4703. // Context sets the context to be used in this call's Do method. Any
  4704. // pending HTTP request will be aborted if the provided context is
  4705. // canceled.
  4706. func (c *AccountsCreativesGetCall) Context(ctx context.Context) *AccountsCreativesGetCall {
  4707. c.ctx_ = ctx
  4708. return c
  4709. }
  4710. // Header returns an http.Header that can be modified by the caller to
  4711. // add HTTP headers to the request.
  4712. func (c *AccountsCreativesGetCall) Header() http.Header {
  4713. if c.header_ == nil {
  4714. c.header_ = make(http.Header)
  4715. }
  4716. return c.header_
  4717. }
  4718. func (c *AccountsCreativesGetCall) doRequest(alt string) (*http.Response, error) {
  4719. reqHeaders := make(http.Header)
  4720. for k, v := range c.header_ {
  4721. reqHeaders[k] = v
  4722. }
  4723. reqHeaders.Set("User-Agent", c.s.userAgent())
  4724. if c.ifNoneMatch_ != "" {
  4725. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4726. }
  4727. var body io.Reader = nil
  4728. c.urlParams_.Set("alt", alt)
  4729. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}")
  4730. urls += "?" + c.urlParams_.Encode()
  4731. req, _ := http.NewRequest("GET", urls, body)
  4732. req.Header = reqHeaders
  4733. googleapi.Expand(req.URL, map[string]string{
  4734. "accountId": c.accountId,
  4735. "creativeId": c.creativeId,
  4736. })
  4737. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4738. }
  4739. // Do executes the "adexchangebuyer2.accounts.creatives.get" call.
  4740. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  4741. // code is an error. Response headers are in either
  4742. // *Creative.ServerResponse.Header or (if a response was returned at
  4743. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4744. // to check whether the returned error was because
  4745. // http.StatusNotModified was returned.
  4746. func (c *AccountsCreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  4747. gensupport.SetOptions(c.urlParams_, opts...)
  4748. res, err := c.doRequest("json")
  4749. if res != nil && res.StatusCode == http.StatusNotModified {
  4750. if res.Body != nil {
  4751. res.Body.Close()
  4752. }
  4753. return nil, &googleapi.Error{
  4754. Code: res.StatusCode,
  4755. Header: res.Header,
  4756. }
  4757. }
  4758. if err != nil {
  4759. return nil, err
  4760. }
  4761. defer googleapi.CloseBody(res)
  4762. if err := googleapi.CheckResponse(res); err != nil {
  4763. return nil, err
  4764. }
  4765. ret := &Creative{
  4766. ServerResponse: googleapi.ServerResponse{
  4767. Header: res.Header,
  4768. HTTPStatusCode: res.StatusCode,
  4769. },
  4770. }
  4771. target := &ret
  4772. if err := gensupport.DecodeResponse(target, res); err != nil {
  4773. return nil, err
  4774. }
  4775. return ret, nil
  4776. // {
  4777. // "description": "Gets a creative.",
  4778. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  4779. // "httpMethod": "GET",
  4780. // "id": "adexchangebuyer2.accounts.creatives.get",
  4781. // "parameterOrder": [
  4782. // "accountId",
  4783. // "creativeId"
  4784. // ],
  4785. // "parameters": {
  4786. // "accountId": {
  4787. // "description": "The account the creative belongs to.",
  4788. // "location": "path",
  4789. // "required": true,
  4790. // "type": "string"
  4791. // },
  4792. // "creativeId": {
  4793. // "description": "The ID of the creative to retrieve.",
  4794. // "location": "path",
  4795. // "required": true,
  4796. // "type": "string"
  4797. // }
  4798. // },
  4799. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  4800. // "response": {
  4801. // "$ref": "Creative"
  4802. // },
  4803. // "scopes": [
  4804. // "https://www.googleapis.com/auth/adexchange.buyer"
  4805. // ]
  4806. // }
  4807. }
  4808. // method id "adexchangebuyer2.accounts.creatives.list":
  4809. type AccountsCreativesListCall struct {
  4810. s *Service
  4811. accountId string
  4812. urlParams_ gensupport.URLParams
  4813. ifNoneMatch_ string
  4814. ctx_ context.Context
  4815. header_ http.Header
  4816. }
  4817. // List: Lists creatives.
  4818. func (r *AccountsCreativesService) List(accountId string) *AccountsCreativesListCall {
  4819. c := &AccountsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4820. c.accountId = accountId
  4821. return c
  4822. }
  4823. // PageSize sets the optional parameter "pageSize": Requested page size.
  4824. // The server may return fewer creatives than requested
  4825. // (due to timeout constraint) even if more are available via another
  4826. // call.
  4827. // If unspecified, server will pick an appropriate default.
  4828. // Acceptable values are 1 to 1000, inclusive.
  4829. func (c *AccountsCreativesListCall) PageSize(pageSize int64) *AccountsCreativesListCall {
  4830. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4831. return c
  4832. }
  4833. // PageToken sets the optional parameter "pageToken": A token
  4834. // identifying a page of results the server should return.
  4835. // Typically, this is the value
  4836. // of
  4837. // ListCreativesResponse.next_page_token
  4838. // returned from the previous call to 'ListCreatives' method.
  4839. func (c *AccountsCreativesListCall) PageToken(pageToken string) *AccountsCreativesListCall {
  4840. c.urlParams_.Set("pageToken", pageToken)
  4841. return c
  4842. }
  4843. // Query sets the optional parameter "query": An optional query string
  4844. // to filter creatives. If no filter is specified,
  4845. // all active creatives will be returned.
  4846. // <p>Supported queries
  4847. // are:
  4848. // <ul>
  4849. // <li>accountId=<i>account_id_string</i>
  4850. // <li>creativeId=<i>cre
  4851. // ative_id_string</i>
  4852. // <li>dealsStatus: {approved, conditionally_approved, disapproved,
  4853. // not_checked}
  4854. // <li>openAuctionStatus: {approved, conditionally_approved,
  4855. // disapproved,
  4856. // not_checked}
  4857. // <li>attribute: {a numeric attribute from the list of
  4858. // attributes}
  4859. // <li>disapprovalReason: {a reason
  4860. // from
  4861. // DisapprovalReason}
  4862. // </ul>
  4863. // Example: 'accountId=12345 AND (dealsStatus:disapproved
  4864. // AND
  4865. // disapprovalReason:unacceptable_content) OR attribute:47'
  4866. func (c *AccountsCreativesListCall) Query(query string) *AccountsCreativesListCall {
  4867. c.urlParams_.Set("query", query)
  4868. return c
  4869. }
  4870. // Fields allows partial responses to be retrieved. See
  4871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4872. // for more information.
  4873. func (c *AccountsCreativesListCall) Fields(s ...googleapi.Field) *AccountsCreativesListCall {
  4874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4875. return c
  4876. }
  4877. // IfNoneMatch sets the optional parameter which makes the operation
  4878. // fail if the object's ETag matches the given value. This is useful for
  4879. // getting updates only after the object has changed since the last
  4880. // request. Use googleapi.IsNotModified to check whether the response
  4881. // error from Do is the result of In-None-Match.
  4882. func (c *AccountsCreativesListCall) IfNoneMatch(entityTag string) *AccountsCreativesListCall {
  4883. c.ifNoneMatch_ = entityTag
  4884. return c
  4885. }
  4886. // Context sets the context to be used in this call's Do method. Any
  4887. // pending HTTP request will be aborted if the provided context is
  4888. // canceled.
  4889. func (c *AccountsCreativesListCall) Context(ctx context.Context) *AccountsCreativesListCall {
  4890. c.ctx_ = ctx
  4891. return c
  4892. }
  4893. // Header returns an http.Header that can be modified by the caller to
  4894. // add HTTP headers to the request.
  4895. func (c *AccountsCreativesListCall) Header() http.Header {
  4896. if c.header_ == nil {
  4897. c.header_ = make(http.Header)
  4898. }
  4899. return c.header_
  4900. }
  4901. func (c *AccountsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  4902. reqHeaders := make(http.Header)
  4903. for k, v := range c.header_ {
  4904. reqHeaders[k] = v
  4905. }
  4906. reqHeaders.Set("User-Agent", c.s.userAgent())
  4907. if c.ifNoneMatch_ != "" {
  4908. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4909. }
  4910. var body io.Reader = nil
  4911. c.urlParams_.Set("alt", alt)
  4912. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives")
  4913. urls += "?" + c.urlParams_.Encode()
  4914. req, _ := http.NewRequest("GET", urls, body)
  4915. req.Header = reqHeaders
  4916. googleapi.Expand(req.URL, map[string]string{
  4917. "accountId": c.accountId,
  4918. })
  4919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4920. }
  4921. // Do executes the "adexchangebuyer2.accounts.creatives.list" call.
  4922. // Exactly one of *ListCreativesResponse or error will be non-nil. Any
  4923. // non-2xx status code is an error. Response headers are in either
  4924. // *ListCreativesResponse.ServerResponse.Header or (if a response was
  4925. // returned at all) in error.(*googleapi.Error).Header. Use
  4926. // googleapi.IsNotModified to check whether the returned error was
  4927. // because http.StatusNotModified was returned.
  4928. func (c *AccountsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativesResponse, error) {
  4929. gensupport.SetOptions(c.urlParams_, opts...)
  4930. res, err := c.doRequest("json")
  4931. if res != nil && res.StatusCode == http.StatusNotModified {
  4932. if res.Body != nil {
  4933. res.Body.Close()
  4934. }
  4935. return nil, &googleapi.Error{
  4936. Code: res.StatusCode,
  4937. Header: res.Header,
  4938. }
  4939. }
  4940. if err != nil {
  4941. return nil, err
  4942. }
  4943. defer googleapi.CloseBody(res)
  4944. if err := googleapi.CheckResponse(res); err != nil {
  4945. return nil, err
  4946. }
  4947. ret := &ListCreativesResponse{
  4948. ServerResponse: googleapi.ServerResponse{
  4949. Header: res.Header,
  4950. HTTPStatusCode: res.StatusCode,
  4951. },
  4952. }
  4953. target := &ret
  4954. if err := gensupport.DecodeResponse(target, res); err != nil {
  4955. return nil, err
  4956. }
  4957. return ret, nil
  4958. // {
  4959. // "description": "Lists creatives.",
  4960. // "flatPath": "v2beta1/accounts/{accountId}/creatives",
  4961. // "httpMethod": "GET",
  4962. // "id": "adexchangebuyer2.accounts.creatives.list",
  4963. // "parameterOrder": [
  4964. // "accountId"
  4965. // ],
  4966. // "parameters": {
  4967. // "accountId": {
  4968. // "description": "The account to list the creatives from.\nSpecify \"-\" to list all creatives the current user has access to.",
  4969. // "location": "path",
  4970. // "required": true,
  4971. // "type": "string"
  4972. // },
  4973. // "pageSize": {
  4974. // "description": "Requested page size. The server may return fewer creatives than requested\n(due to timeout constraint) even if more are available via another call.\nIf unspecified, server will pick an appropriate default.\nAcceptable values are 1 to 1000, inclusive.",
  4975. // "format": "int32",
  4976. // "location": "query",
  4977. // "type": "integer"
  4978. // },
  4979. // "pageToken": {
  4980. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativesResponse.next_page_token\nreturned from the previous call to 'ListCreatives' method.",
  4981. // "location": "query",
  4982. // "type": "string"
  4983. // },
  4984. // "query": {
  4985. // "description": "An optional query string to filter creatives. If no filter is specified,\nall active creatives will be returned.\n\u003cp\u003eSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus: {approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eattribute: {a numeric attribute from the list of attributes}\n\u003cli\u003edisapprovalReason: {a reason from\nDisapprovalReason}\n\u003c/ul\u003e\nExample: 'accountId=12345 AND (dealsStatus:disapproved AND\ndisapprovalReason:unacceptable_content) OR attribute:47'",
  4986. // "location": "query",
  4987. // "type": "string"
  4988. // }
  4989. // },
  4990. // "path": "v2beta1/accounts/{accountId}/creatives",
  4991. // "response": {
  4992. // "$ref": "ListCreativesResponse"
  4993. // },
  4994. // "scopes": [
  4995. // "https://www.googleapis.com/auth/adexchange.buyer"
  4996. // ]
  4997. // }
  4998. }
  4999. // Pages invokes f for each page of results.
  5000. // A non-nil error returned from f will halt the iteration.
  5001. // The provided context supersedes any context provided to the Context method.
  5002. func (c *AccountsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativesResponse) error) error {
  5003. c.ctx_ = ctx
  5004. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5005. for {
  5006. x, err := c.Do()
  5007. if err != nil {
  5008. return err
  5009. }
  5010. if err := f(x); err != nil {
  5011. return err
  5012. }
  5013. if x.NextPageToken == "" {
  5014. return nil
  5015. }
  5016. c.PageToken(x.NextPageToken)
  5017. }
  5018. }
  5019. // method id "adexchangebuyer2.accounts.creatives.stopWatching":
  5020. type AccountsCreativesStopWatchingCall struct {
  5021. s *Service
  5022. accountId string
  5023. creativeId string
  5024. stopwatchingcreativerequest *StopWatchingCreativeRequest
  5025. urlParams_ gensupport.URLParams
  5026. ctx_ context.Context
  5027. header_ http.Header
  5028. }
  5029. // StopWatching: Stops watching a creative. Will stop push notifications
  5030. // being sent to the
  5031. // topics when the creative changes status.
  5032. func (r *AccountsCreativesService) StopWatching(accountId string, creativeId string, stopwatchingcreativerequest *StopWatchingCreativeRequest) *AccountsCreativesStopWatchingCall {
  5033. c := &AccountsCreativesStopWatchingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5034. c.accountId = accountId
  5035. c.creativeId = creativeId
  5036. c.stopwatchingcreativerequest = stopwatchingcreativerequest
  5037. return c
  5038. }
  5039. // Fields allows partial responses to be retrieved. See
  5040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5041. // for more information.
  5042. func (c *AccountsCreativesStopWatchingCall) Fields(s ...googleapi.Field) *AccountsCreativesStopWatchingCall {
  5043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5044. return c
  5045. }
  5046. // Context sets the context to be used in this call's Do method. Any
  5047. // pending HTTP request will be aborted if the provided context is
  5048. // canceled.
  5049. func (c *AccountsCreativesStopWatchingCall) Context(ctx context.Context) *AccountsCreativesStopWatchingCall {
  5050. c.ctx_ = ctx
  5051. return c
  5052. }
  5053. // Header returns an http.Header that can be modified by the caller to
  5054. // add HTTP headers to the request.
  5055. func (c *AccountsCreativesStopWatchingCall) Header() http.Header {
  5056. if c.header_ == nil {
  5057. c.header_ = make(http.Header)
  5058. }
  5059. return c.header_
  5060. }
  5061. func (c *AccountsCreativesStopWatchingCall) doRequest(alt string) (*http.Response, error) {
  5062. reqHeaders := make(http.Header)
  5063. for k, v := range c.header_ {
  5064. reqHeaders[k] = v
  5065. }
  5066. reqHeaders.Set("User-Agent", c.s.userAgent())
  5067. var body io.Reader = nil
  5068. body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopwatchingcreativerequest)
  5069. if err != nil {
  5070. return nil, err
  5071. }
  5072. reqHeaders.Set("Content-Type", "application/json")
  5073. c.urlParams_.Set("alt", alt)
  5074. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching")
  5075. urls += "?" + c.urlParams_.Encode()
  5076. req, _ := http.NewRequest("POST", urls, body)
  5077. req.Header = reqHeaders
  5078. googleapi.Expand(req.URL, map[string]string{
  5079. "accountId": c.accountId,
  5080. "creativeId": c.creativeId,
  5081. })
  5082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5083. }
  5084. // Do executes the "adexchangebuyer2.accounts.creatives.stopWatching" call.
  5085. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5086. // code is an error. Response headers are in either
  5087. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5088. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5089. // check whether the returned error was because http.StatusNotModified
  5090. // was returned.
  5091. func (c *AccountsCreativesStopWatchingCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5092. gensupport.SetOptions(c.urlParams_, opts...)
  5093. res, err := c.doRequest("json")
  5094. if res != nil && res.StatusCode == http.StatusNotModified {
  5095. if res.Body != nil {
  5096. res.Body.Close()
  5097. }
  5098. return nil, &googleapi.Error{
  5099. Code: res.StatusCode,
  5100. Header: res.Header,
  5101. }
  5102. }
  5103. if err != nil {
  5104. return nil, err
  5105. }
  5106. defer googleapi.CloseBody(res)
  5107. if err := googleapi.CheckResponse(res); err != nil {
  5108. return nil, err
  5109. }
  5110. ret := &Empty{
  5111. ServerResponse: googleapi.ServerResponse{
  5112. Header: res.Header,
  5113. HTTPStatusCode: res.StatusCode,
  5114. },
  5115. }
  5116. target := &ret
  5117. if err := gensupport.DecodeResponse(target, res); err != nil {
  5118. return nil, err
  5119. }
  5120. return ret, nil
  5121. // {
  5122. // "description": "Stops watching a creative. Will stop push notifications being sent to the\ntopics when the creative changes status.",
  5123. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching",
  5124. // "httpMethod": "POST",
  5125. // "id": "adexchangebuyer2.accounts.creatives.stopWatching",
  5126. // "parameterOrder": [
  5127. // "accountId",
  5128. // "creativeId"
  5129. // ],
  5130. // "parameters": {
  5131. // "accountId": {
  5132. // "description": "The account of the creative to stop notifications for.",
  5133. // "location": "path",
  5134. // "required": true,
  5135. // "type": "string"
  5136. // },
  5137. // "creativeId": {
  5138. // "description": "The creative ID of the creative to stop notifications for.\nSpecify \"-\" to specify stopping account level notifications.",
  5139. // "location": "path",
  5140. // "required": true,
  5141. // "type": "string"
  5142. // }
  5143. // },
  5144. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching",
  5145. // "request": {
  5146. // "$ref": "StopWatchingCreativeRequest"
  5147. // },
  5148. // "response": {
  5149. // "$ref": "Empty"
  5150. // },
  5151. // "scopes": [
  5152. // "https://www.googleapis.com/auth/adexchange.buyer"
  5153. // ]
  5154. // }
  5155. }
  5156. // method id "adexchangebuyer2.accounts.creatives.update":
  5157. type AccountsCreativesUpdateCall struct {
  5158. s *Service
  5159. accountId string
  5160. creativeId string
  5161. creative *Creative
  5162. urlParams_ gensupport.URLParams
  5163. ctx_ context.Context
  5164. header_ http.Header
  5165. }
  5166. // Update: Updates a creative.
  5167. func (r *AccountsCreativesService) Update(accountId string, creativeId string, creative *Creative) *AccountsCreativesUpdateCall {
  5168. c := &AccountsCreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5169. c.accountId = accountId
  5170. c.creativeId = creativeId
  5171. c.creative = creative
  5172. return c
  5173. }
  5174. // Fields allows partial responses to be retrieved. See
  5175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5176. // for more information.
  5177. func (c *AccountsCreativesUpdateCall) Fields(s ...googleapi.Field) *AccountsCreativesUpdateCall {
  5178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5179. return c
  5180. }
  5181. // Context sets the context to be used in this call's Do method. Any
  5182. // pending HTTP request will be aborted if the provided context is
  5183. // canceled.
  5184. func (c *AccountsCreativesUpdateCall) Context(ctx context.Context) *AccountsCreativesUpdateCall {
  5185. c.ctx_ = ctx
  5186. return c
  5187. }
  5188. // Header returns an http.Header that can be modified by the caller to
  5189. // add HTTP headers to the request.
  5190. func (c *AccountsCreativesUpdateCall) Header() http.Header {
  5191. if c.header_ == nil {
  5192. c.header_ = make(http.Header)
  5193. }
  5194. return c.header_
  5195. }
  5196. func (c *AccountsCreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  5197. reqHeaders := make(http.Header)
  5198. for k, v := range c.header_ {
  5199. reqHeaders[k] = v
  5200. }
  5201. reqHeaders.Set("User-Agent", c.s.userAgent())
  5202. var body io.Reader = nil
  5203. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  5204. if err != nil {
  5205. return nil, err
  5206. }
  5207. reqHeaders.Set("Content-Type", "application/json")
  5208. c.urlParams_.Set("alt", alt)
  5209. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}")
  5210. urls += "?" + c.urlParams_.Encode()
  5211. req, _ := http.NewRequest("PUT", urls, body)
  5212. req.Header = reqHeaders
  5213. googleapi.Expand(req.URL, map[string]string{
  5214. "accountId": c.accountId,
  5215. "creativeId": c.creativeId,
  5216. })
  5217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5218. }
  5219. // Do executes the "adexchangebuyer2.accounts.creatives.update" call.
  5220. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  5221. // code is an error. Response headers are in either
  5222. // *Creative.ServerResponse.Header or (if a response was returned at
  5223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5224. // to check whether the returned error was because
  5225. // http.StatusNotModified was returned.
  5226. func (c *AccountsCreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  5227. gensupport.SetOptions(c.urlParams_, opts...)
  5228. res, err := c.doRequest("json")
  5229. if res != nil && res.StatusCode == http.StatusNotModified {
  5230. if res.Body != nil {
  5231. res.Body.Close()
  5232. }
  5233. return nil, &googleapi.Error{
  5234. Code: res.StatusCode,
  5235. Header: res.Header,
  5236. }
  5237. }
  5238. if err != nil {
  5239. return nil, err
  5240. }
  5241. defer googleapi.CloseBody(res)
  5242. if err := googleapi.CheckResponse(res); err != nil {
  5243. return nil, err
  5244. }
  5245. ret := &Creative{
  5246. ServerResponse: googleapi.ServerResponse{
  5247. Header: res.Header,
  5248. HTTPStatusCode: res.StatusCode,
  5249. },
  5250. }
  5251. target := &ret
  5252. if err := gensupport.DecodeResponse(target, res); err != nil {
  5253. return nil, err
  5254. }
  5255. return ret, nil
  5256. // {
  5257. // "description": "Updates a creative.",
  5258. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  5259. // "httpMethod": "PUT",
  5260. // "id": "adexchangebuyer2.accounts.creatives.update",
  5261. // "parameterOrder": [
  5262. // "accountId",
  5263. // "creativeId"
  5264. // ],
  5265. // "parameters": {
  5266. // "accountId": {
  5267. // "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  5268. // "location": "path",
  5269. // "required": true,
  5270. // "type": "string"
  5271. // },
  5272. // "creativeId": {
  5273. // "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  5274. // "location": "path",
  5275. // "required": true,
  5276. // "type": "string"
  5277. // }
  5278. // },
  5279. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  5280. // "request": {
  5281. // "$ref": "Creative"
  5282. // },
  5283. // "response": {
  5284. // "$ref": "Creative"
  5285. // },
  5286. // "scopes": [
  5287. // "https://www.googleapis.com/auth/adexchange.buyer"
  5288. // ]
  5289. // }
  5290. }
  5291. // method id "adexchangebuyer2.accounts.creatives.watch":
  5292. type AccountsCreativesWatchCall struct {
  5293. s *Service
  5294. accountId string
  5295. creativeId string
  5296. watchcreativerequest *WatchCreativeRequest
  5297. urlParams_ gensupport.URLParams
  5298. ctx_ context.Context
  5299. header_ http.Header
  5300. }
  5301. // Watch: Watches a creative. Will result in push notifications being
  5302. // sent to the
  5303. // topic when the creative changes status.
  5304. func (r *AccountsCreativesService) Watch(accountId string, creativeId string, watchcreativerequest *WatchCreativeRequest) *AccountsCreativesWatchCall {
  5305. c := &AccountsCreativesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5306. c.accountId = accountId
  5307. c.creativeId = creativeId
  5308. c.watchcreativerequest = watchcreativerequest
  5309. return c
  5310. }
  5311. // Fields allows partial responses to be retrieved. See
  5312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5313. // for more information.
  5314. func (c *AccountsCreativesWatchCall) Fields(s ...googleapi.Field) *AccountsCreativesWatchCall {
  5315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5316. return c
  5317. }
  5318. // Context sets the context to be used in this call's Do method. Any
  5319. // pending HTTP request will be aborted if the provided context is
  5320. // canceled.
  5321. func (c *AccountsCreativesWatchCall) Context(ctx context.Context) *AccountsCreativesWatchCall {
  5322. c.ctx_ = ctx
  5323. return c
  5324. }
  5325. // Header returns an http.Header that can be modified by the caller to
  5326. // add HTTP headers to the request.
  5327. func (c *AccountsCreativesWatchCall) Header() http.Header {
  5328. if c.header_ == nil {
  5329. c.header_ = make(http.Header)
  5330. }
  5331. return c.header_
  5332. }
  5333. func (c *AccountsCreativesWatchCall) doRequest(alt string) (*http.Response, error) {
  5334. reqHeaders := make(http.Header)
  5335. for k, v := range c.header_ {
  5336. reqHeaders[k] = v
  5337. }
  5338. reqHeaders.Set("User-Agent", c.s.userAgent())
  5339. var body io.Reader = nil
  5340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchcreativerequest)
  5341. if err != nil {
  5342. return nil, err
  5343. }
  5344. reqHeaders.Set("Content-Type", "application/json")
  5345. c.urlParams_.Set("alt", alt)
  5346. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch")
  5347. urls += "?" + c.urlParams_.Encode()
  5348. req, _ := http.NewRequest("POST", urls, body)
  5349. req.Header = reqHeaders
  5350. googleapi.Expand(req.URL, map[string]string{
  5351. "accountId": c.accountId,
  5352. "creativeId": c.creativeId,
  5353. })
  5354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5355. }
  5356. // Do executes the "adexchangebuyer2.accounts.creatives.watch" call.
  5357. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5358. // code is an error. Response headers are in either
  5359. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5360. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5361. // check whether the returned error was because http.StatusNotModified
  5362. // was returned.
  5363. func (c *AccountsCreativesWatchCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5364. gensupport.SetOptions(c.urlParams_, opts...)
  5365. res, err := c.doRequest("json")
  5366. if res != nil && res.StatusCode == http.StatusNotModified {
  5367. if res.Body != nil {
  5368. res.Body.Close()
  5369. }
  5370. return nil, &googleapi.Error{
  5371. Code: res.StatusCode,
  5372. Header: res.Header,
  5373. }
  5374. }
  5375. if err != nil {
  5376. return nil, err
  5377. }
  5378. defer googleapi.CloseBody(res)
  5379. if err := googleapi.CheckResponse(res); err != nil {
  5380. return nil, err
  5381. }
  5382. ret := &Empty{
  5383. ServerResponse: googleapi.ServerResponse{
  5384. Header: res.Header,
  5385. HTTPStatusCode: res.StatusCode,
  5386. },
  5387. }
  5388. target := &ret
  5389. if err := gensupport.DecodeResponse(target, res); err != nil {
  5390. return nil, err
  5391. }
  5392. return ret, nil
  5393. // {
  5394. // "description": "Watches a creative. Will result in push notifications being sent to the\ntopic when the creative changes status.",
  5395. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch",
  5396. // "httpMethod": "POST",
  5397. // "id": "adexchangebuyer2.accounts.creatives.watch",
  5398. // "parameterOrder": [
  5399. // "accountId",
  5400. // "creativeId"
  5401. // ],
  5402. // "parameters": {
  5403. // "accountId": {
  5404. // "description": "The account of the creative to watch.",
  5405. // "location": "path",
  5406. // "required": true,
  5407. // "type": "string"
  5408. // },
  5409. // "creativeId": {
  5410. // "description": "The creative ID to watch for status changes.\nSpecify \"-\" to watch all creatives under the above account.\nIf both creative-level and account-level notifications are\nsent, only a single notification will be sent to the\ncreative-level notification topic.",
  5411. // "location": "path",
  5412. // "required": true,
  5413. // "type": "string"
  5414. // }
  5415. // },
  5416. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch",
  5417. // "request": {
  5418. // "$ref": "WatchCreativeRequest"
  5419. // },
  5420. // "response": {
  5421. // "$ref": "Empty"
  5422. // },
  5423. // "scopes": [
  5424. // "https://www.googleapis.com/auth/adexchange.buyer"
  5425. // ]
  5426. // }
  5427. }
  5428. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.add":
  5429. type AccountsCreativesDealAssociationsAddCall struct {
  5430. s *Service
  5431. accountId string
  5432. creativeId string
  5433. adddealassociationrequest *AddDealAssociationRequest
  5434. urlParams_ gensupport.URLParams
  5435. ctx_ context.Context
  5436. header_ http.Header
  5437. }
  5438. // Add: Associate an existing deal with a creative.
  5439. func (r *AccountsCreativesDealAssociationsService) Add(accountId string, creativeId string, adddealassociationrequest *AddDealAssociationRequest) *AccountsCreativesDealAssociationsAddCall {
  5440. c := &AccountsCreativesDealAssociationsAddCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5441. c.accountId = accountId
  5442. c.creativeId = creativeId
  5443. c.adddealassociationrequest = adddealassociationrequest
  5444. return c
  5445. }
  5446. // Fields allows partial responses to be retrieved. See
  5447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5448. // for more information.
  5449. func (c *AccountsCreativesDealAssociationsAddCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsAddCall {
  5450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5451. return c
  5452. }
  5453. // Context sets the context to be used in this call's Do method. Any
  5454. // pending HTTP request will be aborted if the provided context is
  5455. // canceled.
  5456. func (c *AccountsCreativesDealAssociationsAddCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsAddCall {
  5457. c.ctx_ = ctx
  5458. return c
  5459. }
  5460. // Header returns an http.Header that can be modified by the caller to
  5461. // add HTTP headers to the request.
  5462. func (c *AccountsCreativesDealAssociationsAddCall) Header() http.Header {
  5463. if c.header_ == nil {
  5464. c.header_ = make(http.Header)
  5465. }
  5466. return c.header_
  5467. }
  5468. func (c *AccountsCreativesDealAssociationsAddCall) doRequest(alt string) (*http.Response, error) {
  5469. reqHeaders := make(http.Header)
  5470. for k, v := range c.header_ {
  5471. reqHeaders[k] = v
  5472. }
  5473. reqHeaders.Set("User-Agent", c.s.userAgent())
  5474. var body io.Reader = nil
  5475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.adddealassociationrequest)
  5476. if err != nil {
  5477. return nil, err
  5478. }
  5479. reqHeaders.Set("Content-Type", "application/json")
  5480. c.urlParams_.Set("alt", alt)
  5481. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add")
  5482. urls += "?" + c.urlParams_.Encode()
  5483. req, _ := http.NewRequest("POST", urls, body)
  5484. req.Header = reqHeaders
  5485. googleapi.Expand(req.URL, map[string]string{
  5486. "accountId": c.accountId,
  5487. "creativeId": c.creativeId,
  5488. })
  5489. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5490. }
  5491. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.add" call.
  5492. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5493. // code is an error. Response headers are in either
  5494. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5495. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5496. // check whether the returned error was because http.StatusNotModified
  5497. // was returned.
  5498. func (c *AccountsCreativesDealAssociationsAddCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5499. gensupport.SetOptions(c.urlParams_, opts...)
  5500. res, err := c.doRequest("json")
  5501. if res != nil && res.StatusCode == http.StatusNotModified {
  5502. if res.Body != nil {
  5503. res.Body.Close()
  5504. }
  5505. return nil, &googleapi.Error{
  5506. Code: res.StatusCode,
  5507. Header: res.Header,
  5508. }
  5509. }
  5510. if err != nil {
  5511. return nil, err
  5512. }
  5513. defer googleapi.CloseBody(res)
  5514. if err := googleapi.CheckResponse(res); err != nil {
  5515. return nil, err
  5516. }
  5517. ret := &Empty{
  5518. ServerResponse: googleapi.ServerResponse{
  5519. Header: res.Header,
  5520. HTTPStatusCode: res.StatusCode,
  5521. },
  5522. }
  5523. target := &ret
  5524. if err := gensupport.DecodeResponse(target, res); err != nil {
  5525. return nil, err
  5526. }
  5527. return ret, nil
  5528. // {
  5529. // "description": "Associate an existing deal with a creative.",
  5530. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add",
  5531. // "httpMethod": "POST",
  5532. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.add",
  5533. // "parameterOrder": [
  5534. // "accountId",
  5535. // "creativeId"
  5536. // ],
  5537. // "parameters": {
  5538. // "accountId": {
  5539. // "description": "The account the creative belongs to.",
  5540. // "location": "path",
  5541. // "required": true,
  5542. // "type": "string"
  5543. // },
  5544. // "creativeId": {
  5545. // "description": "The ID of the creative associated with the deal.",
  5546. // "location": "path",
  5547. // "required": true,
  5548. // "type": "string"
  5549. // }
  5550. // },
  5551. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add",
  5552. // "request": {
  5553. // "$ref": "AddDealAssociationRequest"
  5554. // },
  5555. // "response": {
  5556. // "$ref": "Empty"
  5557. // },
  5558. // "scopes": [
  5559. // "https://www.googleapis.com/auth/adexchange.buyer"
  5560. // ]
  5561. // }
  5562. }
  5563. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.list":
  5564. type AccountsCreativesDealAssociationsListCall struct {
  5565. s *Service
  5566. accountId string
  5567. creativeId string
  5568. urlParams_ gensupport.URLParams
  5569. ifNoneMatch_ string
  5570. ctx_ context.Context
  5571. header_ http.Header
  5572. }
  5573. // List: List all creative-deal associations.
  5574. func (r *AccountsCreativesDealAssociationsService) List(accountId string, creativeId string) *AccountsCreativesDealAssociationsListCall {
  5575. c := &AccountsCreativesDealAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5576. c.accountId = accountId
  5577. c.creativeId = creativeId
  5578. return c
  5579. }
  5580. // PageSize sets the optional parameter "pageSize": Requested page size.
  5581. // Server may return fewer associations than requested.
  5582. // If unspecified, server will pick an appropriate default.
  5583. func (c *AccountsCreativesDealAssociationsListCall) PageSize(pageSize int64) *AccountsCreativesDealAssociationsListCall {
  5584. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5585. return c
  5586. }
  5587. // PageToken sets the optional parameter "pageToken": A token
  5588. // identifying a page of results the server should return.
  5589. // Typically, this is the value
  5590. // of
  5591. // ListDealAssociationsResponse.next_page_token
  5592. // returned from the previous call to 'ListDealAssociations' method.
  5593. func (c *AccountsCreativesDealAssociationsListCall) PageToken(pageToken string) *AccountsCreativesDealAssociationsListCall {
  5594. c.urlParams_.Set("pageToken", pageToken)
  5595. return c
  5596. }
  5597. // Query sets the optional parameter "query": An optional query string
  5598. // to filter deal associations. If no filter is
  5599. // specified, all associations will be returned.
  5600. // Supported queries
  5601. // are:
  5602. // <ul>
  5603. // <li>accountId=<i>account_id_string</i>
  5604. // <li>creativeId=<i>cre
  5605. // ative_id_string</i>
  5606. // <li>dealsId=<i>deals_id_string</i>
  5607. // <li>dealsStatus
  5608. // :{approved, conditionally_approved, disapproved,
  5609. // not_checked}
  5610. // <li>openAuctionStatus:{approved, conditionally_approved,
  5611. // disapproved,
  5612. // not_checked}
  5613. // </ul>
  5614. // Example: 'dealsId=12345 AND dealsStatus:disapproved'
  5615. func (c *AccountsCreativesDealAssociationsListCall) Query(query string) *AccountsCreativesDealAssociationsListCall {
  5616. c.urlParams_.Set("query", query)
  5617. return c
  5618. }
  5619. // Fields allows partial responses to be retrieved. See
  5620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5621. // for more information.
  5622. func (c *AccountsCreativesDealAssociationsListCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsListCall {
  5623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5624. return c
  5625. }
  5626. // IfNoneMatch sets the optional parameter which makes the operation
  5627. // fail if the object's ETag matches the given value. This is useful for
  5628. // getting updates only after the object has changed since the last
  5629. // request. Use googleapi.IsNotModified to check whether the response
  5630. // error from Do is the result of In-None-Match.
  5631. func (c *AccountsCreativesDealAssociationsListCall) IfNoneMatch(entityTag string) *AccountsCreativesDealAssociationsListCall {
  5632. c.ifNoneMatch_ = entityTag
  5633. return c
  5634. }
  5635. // Context sets the context to be used in this call's Do method. Any
  5636. // pending HTTP request will be aborted if the provided context is
  5637. // canceled.
  5638. func (c *AccountsCreativesDealAssociationsListCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsListCall {
  5639. c.ctx_ = ctx
  5640. return c
  5641. }
  5642. // Header returns an http.Header that can be modified by the caller to
  5643. // add HTTP headers to the request.
  5644. func (c *AccountsCreativesDealAssociationsListCall) Header() http.Header {
  5645. if c.header_ == nil {
  5646. c.header_ = make(http.Header)
  5647. }
  5648. return c.header_
  5649. }
  5650. func (c *AccountsCreativesDealAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  5651. reqHeaders := make(http.Header)
  5652. for k, v := range c.header_ {
  5653. reqHeaders[k] = v
  5654. }
  5655. reqHeaders.Set("User-Agent", c.s.userAgent())
  5656. if c.ifNoneMatch_ != "" {
  5657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5658. }
  5659. var body io.Reader = nil
  5660. c.urlParams_.Set("alt", alt)
  5661. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations")
  5662. urls += "?" + c.urlParams_.Encode()
  5663. req, _ := http.NewRequest("GET", urls, body)
  5664. req.Header = reqHeaders
  5665. googleapi.Expand(req.URL, map[string]string{
  5666. "accountId": c.accountId,
  5667. "creativeId": c.creativeId,
  5668. })
  5669. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5670. }
  5671. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.list" call.
  5672. // Exactly one of *ListDealAssociationsResponse or error will be
  5673. // non-nil. Any non-2xx status code is an error. Response headers are in
  5674. // either *ListDealAssociationsResponse.ServerResponse.Header or (if a
  5675. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5676. // googleapi.IsNotModified to check whether the returned error was
  5677. // because http.StatusNotModified was returned.
  5678. func (c *AccountsCreativesDealAssociationsListCall) Do(opts ...googleapi.CallOption) (*ListDealAssociationsResponse, error) {
  5679. gensupport.SetOptions(c.urlParams_, opts...)
  5680. res, err := c.doRequest("json")
  5681. if res != nil && res.StatusCode == http.StatusNotModified {
  5682. if res.Body != nil {
  5683. res.Body.Close()
  5684. }
  5685. return nil, &googleapi.Error{
  5686. Code: res.StatusCode,
  5687. Header: res.Header,
  5688. }
  5689. }
  5690. if err != nil {
  5691. return nil, err
  5692. }
  5693. defer googleapi.CloseBody(res)
  5694. if err := googleapi.CheckResponse(res); err != nil {
  5695. return nil, err
  5696. }
  5697. ret := &ListDealAssociationsResponse{
  5698. ServerResponse: googleapi.ServerResponse{
  5699. Header: res.Header,
  5700. HTTPStatusCode: res.StatusCode,
  5701. },
  5702. }
  5703. target := &ret
  5704. if err := gensupport.DecodeResponse(target, res); err != nil {
  5705. return nil, err
  5706. }
  5707. return ret, nil
  5708. // {
  5709. // "description": "List all creative-deal associations.",
  5710. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations",
  5711. // "httpMethod": "GET",
  5712. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.list",
  5713. // "parameterOrder": [
  5714. // "accountId",
  5715. // "creativeId"
  5716. // ],
  5717. // "parameters": {
  5718. // "accountId": {
  5719. // "description": "The account to list the associations from.\nSpecify \"-\" to list all creatives the current user has access to.",
  5720. // "location": "path",
  5721. // "required": true,
  5722. // "type": "string"
  5723. // },
  5724. // "creativeId": {
  5725. // "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account.",
  5726. // "location": "path",
  5727. // "required": true,
  5728. // "type": "string"
  5729. // },
  5730. // "pageSize": {
  5731. // "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.",
  5732. // "format": "int32",
  5733. // "location": "query",
  5734. // "type": "integer"
  5735. // },
  5736. // "pageToken": {
  5737. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListDealAssociationsResponse.next_page_token\nreturned from the previous call to 'ListDealAssociations' method.",
  5738. // "location": "query",
  5739. // "type": "string"
  5740. // },
  5741. // "query": {
  5742. // "description": "An optional query string to filter deal associations. If no filter is\nspecified, all associations will be returned.\nSupported queries are:\n\u003cul\u003e\n\u003cli\u003eaccountId=\u003ci\u003eaccount_id_string\u003c/i\u003e\n\u003cli\u003ecreativeId=\u003ci\u003ecreative_id_string\u003c/i\u003e\n\u003cli\u003edealsId=\u003ci\u003edeals_id_string\u003c/i\u003e\n\u003cli\u003edealsStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003cli\u003eopenAuctionStatus:{approved, conditionally_approved, disapproved,\n not_checked}\n\u003c/ul\u003e\nExample: 'dealsId=12345 AND dealsStatus:disapproved'",
  5743. // "location": "query",
  5744. // "type": "string"
  5745. // }
  5746. // },
  5747. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations",
  5748. // "response": {
  5749. // "$ref": "ListDealAssociationsResponse"
  5750. // },
  5751. // "scopes": [
  5752. // "https://www.googleapis.com/auth/adexchange.buyer"
  5753. // ]
  5754. // }
  5755. }
  5756. // Pages invokes f for each page of results.
  5757. // A non-nil error returned from f will halt the iteration.
  5758. // The provided context supersedes any context provided to the Context method.
  5759. func (c *AccountsCreativesDealAssociationsListCall) Pages(ctx context.Context, f func(*ListDealAssociationsResponse) error) error {
  5760. c.ctx_ = ctx
  5761. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5762. for {
  5763. x, err := c.Do()
  5764. if err != nil {
  5765. return err
  5766. }
  5767. if err := f(x); err != nil {
  5768. return err
  5769. }
  5770. if x.NextPageToken == "" {
  5771. return nil
  5772. }
  5773. c.PageToken(x.NextPageToken)
  5774. }
  5775. }
  5776. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.remove":
  5777. type AccountsCreativesDealAssociationsRemoveCall struct {
  5778. s *Service
  5779. accountId string
  5780. creativeId string
  5781. removedealassociationrequest *RemoveDealAssociationRequest
  5782. urlParams_ gensupport.URLParams
  5783. ctx_ context.Context
  5784. header_ http.Header
  5785. }
  5786. // Remove: Remove the association between a deal and a creative.
  5787. func (r *AccountsCreativesDealAssociationsService) Remove(accountId string, creativeId string, removedealassociationrequest *RemoveDealAssociationRequest) *AccountsCreativesDealAssociationsRemoveCall {
  5788. c := &AccountsCreativesDealAssociationsRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5789. c.accountId = accountId
  5790. c.creativeId = creativeId
  5791. c.removedealassociationrequest = removedealassociationrequest
  5792. return c
  5793. }
  5794. // Fields allows partial responses to be retrieved. See
  5795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5796. // for more information.
  5797. func (c *AccountsCreativesDealAssociationsRemoveCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsRemoveCall {
  5798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5799. return c
  5800. }
  5801. // Context sets the context to be used in this call's Do method. Any
  5802. // pending HTTP request will be aborted if the provided context is
  5803. // canceled.
  5804. func (c *AccountsCreativesDealAssociationsRemoveCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsRemoveCall {
  5805. c.ctx_ = ctx
  5806. return c
  5807. }
  5808. // Header returns an http.Header that can be modified by the caller to
  5809. // add HTTP headers to the request.
  5810. func (c *AccountsCreativesDealAssociationsRemoveCall) Header() http.Header {
  5811. if c.header_ == nil {
  5812. c.header_ = make(http.Header)
  5813. }
  5814. return c.header_
  5815. }
  5816. func (c *AccountsCreativesDealAssociationsRemoveCall) doRequest(alt string) (*http.Response, error) {
  5817. reqHeaders := make(http.Header)
  5818. for k, v := range c.header_ {
  5819. reqHeaders[k] = v
  5820. }
  5821. reqHeaders.Set("User-Agent", c.s.userAgent())
  5822. var body io.Reader = nil
  5823. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removedealassociationrequest)
  5824. if err != nil {
  5825. return nil, err
  5826. }
  5827. reqHeaders.Set("Content-Type", "application/json")
  5828. c.urlParams_.Set("alt", alt)
  5829. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove")
  5830. urls += "?" + c.urlParams_.Encode()
  5831. req, _ := http.NewRequest("POST", urls, body)
  5832. req.Header = reqHeaders
  5833. googleapi.Expand(req.URL, map[string]string{
  5834. "accountId": c.accountId,
  5835. "creativeId": c.creativeId,
  5836. })
  5837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5838. }
  5839. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.remove" call.
  5840. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5841. // code is an error. Response headers are in either
  5842. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5843. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5844. // check whether the returned error was because http.StatusNotModified
  5845. // was returned.
  5846. func (c *AccountsCreativesDealAssociationsRemoveCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5847. gensupport.SetOptions(c.urlParams_, opts...)
  5848. res, err := c.doRequest("json")
  5849. if res != nil && res.StatusCode == http.StatusNotModified {
  5850. if res.Body != nil {
  5851. res.Body.Close()
  5852. }
  5853. return nil, &googleapi.Error{
  5854. Code: res.StatusCode,
  5855. Header: res.Header,
  5856. }
  5857. }
  5858. if err != nil {
  5859. return nil, err
  5860. }
  5861. defer googleapi.CloseBody(res)
  5862. if err := googleapi.CheckResponse(res); err != nil {
  5863. return nil, err
  5864. }
  5865. ret := &Empty{
  5866. ServerResponse: googleapi.ServerResponse{
  5867. Header: res.Header,
  5868. HTTPStatusCode: res.StatusCode,
  5869. },
  5870. }
  5871. target := &ret
  5872. if err := gensupport.DecodeResponse(target, res); err != nil {
  5873. return nil, err
  5874. }
  5875. return ret, nil
  5876. // {
  5877. // "description": "Remove the association between a deal and a creative.",
  5878. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove",
  5879. // "httpMethod": "POST",
  5880. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.remove",
  5881. // "parameterOrder": [
  5882. // "accountId",
  5883. // "creativeId"
  5884. // ],
  5885. // "parameters": {
  5886. // "accountId": {
  5887. // "description": "The account the creative belongs to.",
  5888. // "location": "path",
  5889. // "required": true,
  5890. // "type": "string"
  5891. // },
  5892. // "creativeId": {
  5893. // "description": "The ID of the creative associated with the deal.",
  5894. // "location": "path",
  5895. // "required": true,
  5896. // "type": "string"
  5897. // }
  5898. // },
  5899. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove",
  5900. // "request": {
  5901. // "$ref": "RemoveDealAssociationRequest"
  5902. // },
  5903. // "response": {
  5904. // "$ref": "Empty"
  5905. // },
  5906. // "scopes": [
  5907. // "https://www.googleapis.com/auth/adexchange.buyer"
  5908. // ]
  5909. // }
  5910. }
  5911. // method id "adexchangebuyer2.bidders.accounts.filterSets.create":
  5912. type BiddersAccountsFilterSetsCreateCall struct {
  5913. s *Service
  5914. ownerName string
  5915. filterset *FilterSet
  5916. urlParams_ gensupport.URLParams
  5917. ctx_ context.Context
  5918. header_ http.Header
  5919. }
  5920. // Create: Creates the specified filter set for the account with the
  5921. // given account ID.
  5922. func (r *BiddersAccountsFilterSetsService) Create(ownerName string, filterset *FilterSet) *BiddersAccountsFilterSetsCreateCall {
  5923. c := &BiddersAccountsFilterSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5924. c.ownerName = ownerName
  5925. c.filterset = filterset
  5926. return c
  5927. }
  5928. // IsTransient sets the optional parameter "isTransient": Whether the
  5929. // filter set is transient, or should be persisted indefinitely.
  5930. // By default, filter sets are not transient.
  5931. // If transient, it will be available for at least 1 hour after
  5932. // creation.
  5933. func (c *BiddersAccountsFilterSetsCreateCall) IsTransient(isTransient bool) *BiddersAccountsFilterSetsCreateCall {
  5934. c.urlParams_.Set("isTransient", fmt.Sprint(isTransient))
  5935. return c
  5936. }
  5937. // Fields allows partial responses to be retrieved. See
  5938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5939. // for more information.
  5940. func (c *BiddersAccountsFilterSetsCreateCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsCreateCall {
  5941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5942. return c
  5943. }
  5944. // Context sets the context to be used in this call's Do method. Any
  5945. // pending HTTP request will be aborted if the provided context is
  5946. // canceled.
  5947. func (c *BiddersAccountsFilterSetsCreateCall) Context(ctx context.Context) *BiddersAccountsFilterSetsCreateCall {
  5948. c.ctx_ = ctx
  5949. return c
  5950. }
  5951. // Header returns an http.Header that can be modified by the caller to
  5952. // add HTTP headers to the request.
  5953. func (c *BiddersAccountsFilterSetsCreateCall) Header() http.Header {
  5954. if c.header_ == nil {
  5955. c.header_ = make(http.Header)
  5956. }
  5957. return c.header_
  5958. }
  5959. func (c *BiddersAccountsFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) {
  5960. reqHeaders := make(http.Header)
  5961. for k, v := range c.header_ {
  5962. reqHeaders[k] = v
  5963. }
  5964. reqHeaders.Set("User-Agent", c.s.userAgent())
  5965. var body io.Reader = nil
  5966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset)
  5967. if err != nil {
  5968. return nil, err
  5969. }
  5970. reqHeaders.Set("Content-Type", "application/json")
  5971. c.urlParams_.Set("alt", alt)
  5972. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  5973. urls += "?" + c.urlParams_.Encode()
  5974. req, _ := http.NewRequest("POST", urls, body)
  5975. req.Header = reqHeaders
  5976. googleapi.Expand(req.URL, map[string]string{
  5977. "ownerName": c.ownerName,
  5978. })
  5979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5980. }
  5981. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.create" call.
  5982. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  5983. // status code is an error. Response headers are in either
  5984. // *FilterSet.ServerResponse.Header or (if a response was returned at
  5985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5986. // to check whether the returned error was because
  5987. // http.StatusNotModified was returned.
  5988. func (c *BiddersAccountsFilterSetsCreateCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  5989. gensupport.SetOptions(c.urlParams_, opts...)
  5990. res, err := c.doRequest("json")
  5991. if res != nil && res.StatusCode == http.StatusNotModified {
  5992. if res.Body != nil {
  5993. res.Body.Close()
  5994. }
  5995. return nil, &googleapi.Error{
  5996. Code: res.StatusCode,
  5997. Header: res.Header,
  5998. }
  5999. }
  6000. if err != nil {
  6001. return nil, err
  6002. }
  6003. defer googleapi.CloseBody(res)
  6004. if err := googleapi.CheckResponse(res); err != nil {
  6005. return nil, err
  6006. }
  6007. ret := &FilterSet{
  6008. ServerResponse: googleapi.ServerResponse{
  6009. Header: res.Header,
  6010. HTTPStatusCode: res.StatusCode,
  6011. },
  6012. }
  6013. target := &ret
  6014. if err := gensupport.DecodeResponse(target, res); err != nil {
  6015. return nil, err
  6016. }
  6017. return ret, nil
  6018. // {
  6019. // "description": "Creates the specified filter set for the account with the given account ID.",
  6020. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets",
  6021. // "httpMethod": "POST",
  6022. // "id": "adexchangebuyer2.bidders.accounts.filterSets.create",
  6023. // "parameterOrder": [
  6024. // "ownerName"
  6025. // ],
  6026. // "parameters": {
  6027. // "isTransient": {
  6028. // "description": "Whether the filter set is transient, or should be persisted indefinitely.\nBy default, filter sets are not transient.\nIf transient, it will be available for at least 1 hour after creation.",
  6029. // "location": "query",
  6030. // "type": "boolean"
  6031. // },
  6032. // "ownerName": {
  6033. // "description": "Name of the owner (bidder or account) of the filter set to be created.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`",
  6034. // "location": "path",
  6035. // "pattern": "^bidders/[^/]+/accounts/[^/]+$",
  6036. // "required": true,
  6037. // "type": "string"
  6038. // }
  6039. // },
  6040. // "path": "v2beta1/{+ownerName}/filterSets",
  6041. // "request": {
  6042. // "$ref": "FilterSet"
  6043. // },
  6044. // "response": {
  6045. // "$ref": "FilterSet"
  6046. // },
  6047. // "scopes": [
  6048. // "https://www.googleapis.com/auth/adexchange.buyer"
  6049. // ]
  6050. // }
  6051. }
  6052. // method id "adexchangebuyer2.bidders.accounts.filterSets.delete":
  6053. type BiddersAccountsFilterSetsDeleteCall struct {
  6054. s *Service
  6055. name string
  6056. urlParams_ gensupport.URLParams
  6057. ctx_ context.Context
  6058. header_ http.Header
  6059. }
  6060. // Delete: Deletes the requested filter set from the account with the
  6061. // given account
  6062. // ID.
  6063. func (r *BiddersAccountsFilterSetsService) Delete(name string) *BiddersAccountsFilterSetsDeleteCall {
  6064. c := &BiddersAccountsFilterSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6065. c.name = name
  6066. return c
  6067. }
  6068. // Fields allows partial responses to be retrieved. See
  6069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6070. // for more information.
  6071. func (c *BiddersAccountsFilterSetsDeleteCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsDeleteCall {
  6072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6073. return c
  6074. }
  6075. // Context sets the context to be used in this call's Do method. Any
  6076. // pending HTTP request will be aborted if the provided context is
  6077. // canceled.
  6078. func (c *BiddersAccountsFilterSetsDeleteCall) Context(ctx context.Context) *BiddersAccountsFilterSetsDeleteCall {
  6079. c.ctx_ = ctx
  6080. return c
  6081. }
  6082. // Header returns an http.Header that can be modified by the caller to
  6083. // add HTTP headers to the request.
  6084. func (c *BiddersAccountsFilterSetsDeleteCall) Header() http.Header {
  6085. if c.header_ == nil {
  6086. c.header_ = make(http.Header)
  6087. }
  6088. return c.header_
  6089. }
  6090. func (c *BiddersAccountsFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6091. reqHeaders := make(http.Header)
  6092. for k, v := range c.header_ {
  6093. reqHeaders[k] = v
  6094. }
  6095. reqHeaders.Set("User-Agent", c.s.userAgent())
  6096. var body io.Reader = nil
  6097. c.urlParams_.Set("alt", alt)
  6098. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  6099. urls += "?" + c.urlParams_.Encode()
  6100. req, _ := http.NewRequest("DELETE", urls, body)
  6101. req.Header = reqHeaders
  6102. googleapi.Expand(req.URL, map[string]string{
  6103. "name": c.name,
  6104. })
  6105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6106. }
  6107. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.delete" call.
  6108. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6109. // code is an error. Response headers are in either
  6110. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6111. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6112. // check whether the returned error was because http.StatusNotModified
  6113. // was returned.
  6114. func (c *BiddersAccountsFilterSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6115. gensupport.SetOptions(c.urlParams_, opts...)
  6116. res, err := c.doRequest("json")
  6117. if res != nil && res.StatusCode == http.StatusNotModified {
  6118. if res.Body != nil {
  6119. res.Body.Close()
  6120. }
  6121. return nil, &googleapi.Error{
  6122. Code: res.StatusCode,
  6123. Header: res.Header,
  6124. }
  6125. }
  6126. if err != nil {
  6127. return nil, err
  6128. }
  6129. defer googleapi.CloseBody(res)
  6130. if err := googleapi.CheckResponse(res); err != nil {
  6131. return nil, err
  6132. }
  6133. ret := &Empty{
  6134. ServerResponse: googleapi.ServerResponse{
  6135. Header: res.Header,
  6136. HTTPStatusCode: res.StatusCode,
  6137. },
  6138. }
  6139. target := &ret
  6140. if err := gensupport.DecodeResponse(target, res); err != nil {
  6141. return nil, err
  6142. }
  6143. return ret, nil
  6144. // {
  6145. // "description": "Deletes the requested filter set from the account with the given account\nID.",
  6146. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}",
  6147. // "httpMethod": "DELETE",
  6148. // "id": "adexchangebuyer2.bidders.accounts.filterSets.delete",
  6149. // "parameterOrder": [
  6150. // "name"
  6151. // ],
  6152. // "parameters": {
  6153. // "name": {
  6154. // "description": "Full name of the resource to delete.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  6155. // "location": "path",
  6156. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  6157. // "required": true,
  6158. // "type": "string"
  6159. // }
  6160. // },
  6161. // "path": "v2beta1/{+name}",
  6162. // "response": {
  6163. // "$ref": "Empty"
  6164. // },
  6165. // "scopes": [
  6166. // "https://www.googleapis.com/auth/adexchange.buyer"
  6167. // ]
  6168. // }
  6169. }
  6170. // method id "adexchangebuyer2.bidders.accounts.filterSets.get":
  6171. type BiddersAccountsFilterSetsGetCall struct {
  6172. s *Service
  6173. name string
  6174. urlParams_ gensupport.URLParams
  6175. ifNoneMatch_ string
  6176. ctx_ context.Context
  6177. header_ http.Header
  6178. }
  6179. // Get: Retrieves the requested filter set for the account with the
  6180. // given account
  6181. // ID.
  6182. func (r *BiddersAccountsFilterSetsService) Get(name string) *BiddersAccountsFilterSetsGetCall {
  6183. c := &BiddersAccountsFilterSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6184. c.name = name
  6185. return c
  6186. }
  6187. // Fields allows partial responses to be retrieved. See
  6188. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6189. // for more information.
  6190. func (c *BiddersAccountsFilterSetsGetCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsGetCall {
  6191. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6192. return c
  6193. }
  6194. // IfNoneMatch sets the optional parameter which makes the operation
  6195. // fail if the object's ETag matches the given value. This is useful for
  6196. // getting updates only after the object has changed since the last
  6197. // request. Use googleapi.IsNotModified to check whether the response
  6198. // error from Do is the result of In-None-Match.
  6199. func (c *BiddersAccountsFilterSetsGetCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsGetCall {
  6200. c.ifNoneMatch_ = entityTag
  6201. return c
  6202. }
  6203. // Context sets the context to be used in this call's Do method. Any
  6204. // pending HTTP request will be aborted if the provided context is
  6205. // canceled.
  6206. func (c *BiddersAccountsFilterSetsGetCall) Context(ctx context.Context) *BiddersAccountsFilterSetsGetCall {
  6207. c.ctx_ = ctx
  6208. return c
  6209. }
  6210. // Header returns an http.Header that can be modified by the caller to
  6211. // add HTTP headers to the request.
  6212. func (c *BiddersAccountsFilterSetsGetCall) Header() http.Header {
  6213. if c.header_ == nil {
  6214. c.header_ = make(http.Header)
  6215. }
  6216. return c.header_
  6217. }
  6218. func (c *BiddersAccountsFilterSetsGetCall) doRequest(alt string) (*http.Response, error) {
  6219. reqHeaders := make(http.Header)
  6220. for k, v := range c.header_ {
  6221. reqHeaders[k] = v
  6222. }
  6223. reqHeaders.Set("User-Agent", c.s.userAgent())
  6224. if c.ifNoneMatch_ != "" {
  6225. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6226. }
  6227. var body io.Reader = nil
  6228. c.urlParams_.Set("alt", alt)
  6229. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  6230. urls += "?" + c.urlParams_.Encode()
  6231. req, _ := http.NewRequest("GET", urls, body)
  6232. req.Header = reqHeaders
  6233. googleapi.Expand(req.URL, map[string]string{
  6234. "name": c.name,
  6235. })
  6236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6237. }
  6238. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.get" call.
  6239. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  6240. // status code is an error. Response headers are in either
  6241. // *FilterSet.ServerResponse.Header or (if a response was returned at
  6242. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6243. // to check whether the returned error was because
  6244. // http.StatusNotModified was returned.
  6245. func (c *BiddersAccountsFilterSetsGetCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  6246. gensupport.SetOptions(c.urlParams_, opts...)
  6247. res, err := c.doRequest("json")
  6248. if res != nil && res.StatusCode == http.StatusNotModified {
  6249. if res.Body != nil {
  6250. res.Body.Close()
  6251. }
  6252. return nil, &googleapi.Error{
  6253. Code: res.StatusCode,
  6254. Header: res.Header,
  6255. }
  6256. }
  6257. if err != nil {
  6258. return nil, err
  6259. }
  6260. defer googleapi.CloseBody(res)
  6261. if err := googleapi.CheckResponse(res); err != nil {
  6262. return nil, err
  6263. }
  6264. ret := &FilterSet{
  6265. ServerResponse: googleapi.ServerResponse{
  6266. Header: res.Header,
  6267. HTTPStatusCode: res.StatusCode,
  6268. },
  6269. }
  6270. target := &ret
  6271. if err := gensupport.DecodeResponse(target, res); err != nil {
  6272. return nil, err
  6273. }
  6274. return ret, nil
  6275. // {
  6276. // "description": "Retrieves the requested filter set for the account with the given account\nID.",
  6277. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}",
  6278. // "httpMethod": "GET",
  6279. // "id": "adexchangebuyer2.bidders.accounts.filterSets.get",
  6280. // "parameterOrder": [
  6281. // "name"
  6282. // ],
  6283. // "parameters": {
  6284. // "name": {
  6285. // "description": "Full name of the resource being requested.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  6286. // "location": "path",
  6287. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  6288. // "required": true,
  6289. // "type": "string"
  6290. // }
  6291. // },
  6292. // "path": "v2beta1/{+name}",
  6293. // "response": {
  6294. // "$ref": "FilterSet"
  6295. // },
  6296. // "scopes": [
  6297. // "https://www.googleapis.com/auth/adexchange.buyer"
  6298. // ]
  6299. // }
  6300. }
  6301. // method id "adexchangebuyer2.bidders.accounts.filterSets.list":
  6302. type BiddersAccountsFilterSetsListCall struct {
  6303. s *Service
  6304. ownerName string
  6305. urlParams_ gensupport.URLParams
  6306. ifNoneMatch_ string
  6307. ctx_ context.Context
  6308. header_ http.Header
  6309. }
  6310. // List: Lists all filter sets for the account with the given account
  6311. // ID.
  6312. func (r *BiddersAccountsFilterSetsService) List(ownerName string) *BiddersAccountsFilterSetsListCall {
  6313. c := &BiddersAccountsFilterSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6314. c.ownerName = ownerName
  6315. return c
  6316. }
  6317. // PageSize sets the optional parameter "pageSize": Requested page size.
  6318. // The server may return fewer results than requested.
  6319. // If unspecified, the server will pick an appropriate default.
  6320. func (c *BiddersAccountsFilterSetsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsListCall {
  6321. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6322. return c
  6323. }
  6324. // PageToken sets the optional parameter "pageToken": A token
  6325. // identifying a page of results the server should return.
  6326. // Typically, this is the value
  6327. // of
  6328. // ListFilterSetsResponse.nextPageToken
  6329. // returned from the previous call to
  6330. // the
  6331. // accounts.filterSets.list
  6332. // method.
  6333. func (c *BiddersAccountsFilterSetsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsListCall {
  6334. c.urlParams_.Set("pageToken", pageToken)
  6335. return c
  6336. }
  6337. // Fields allows partial responses to be retrieved. See
  6338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6339. // for more information.
  6340. func (c *BiddersAccountsFilterSetsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsListCall {
  6341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6342. return c
  6343. }
  6344. // IfNoneMatch sets the optional parameter which makes the operation
  6345. // fail if the object's ETag matches the given value. This is useful for
  6346. // getting updates only after the object has changed since the last
  6347. // request. Use googleapi.IsNotModified to check whether the response
  6348. // error from Do is the result of In-None-Match.
  6349. func (c *BiddersAccountsFilterSetsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsListCall {
  6350. c.ifNoneMatch_ = entityTag
  6351. return c
  6352. }
  6353. // Context sets the context to be used in this call's Do method. Any
  6354. // pending HTTP request will be aborted if the provided context is
  6355. // canceled.
  6356. func (c *BiddersAccountsFilterSetsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsListCall {
  6357. c.ctx_ = ctx
  6358. return c
  6359. }
  6360. // Header returns an http.Header that can be modified by the caller to
  6361. // add HTTP headers to the request.
  6362. func (c *BiddersAccountsFilterSetsListCall) Header() http.Header {
  6363. if c.header_ == nil {
  6364. c.header_ = make(http.Header)
  6365. }
  6366. return c.header_
  6367. }
  6368. func (c *BiddersAccountsFilterSetsListCall) doRequest(alt string) (*http.Response, error) {
  6369. reqHeaders := make(http.Header)
  6370. for k, v := range c.header_ {
  6371. reqHeaders[k] = v
  6372. }
  6373. reqHeaders.Set("User-Agent", c.s.userAgent())
  6374. if c.ifNoneMatch_ != "" {
  6375. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6376. }
  6377. var body io.Reader = nil
  6378. c.urlParams_.Set("alt", alt)
  6379. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  6380. urls += "?" + c.urlParams_.Encode()
  6381. req, _ := http.NewRequest("GET", urls, body)
  6382. req.Header = reqHeaders
  6383. googleapi.Expand(req.URL, map[string]string{
  6384. "ownerName": c.ownerName,
  6385. })
  6386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6387. }
  6388. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.list" call.
  6389. // Exactly one of *ListFilterSetsResponse or error will be non-nil. Any
  6390. // non-2xx status code is an error. Response headers are in either
  6391. // *ListFilterSetsResponse.ServerResponse.Header or (if a response was
  6392. // returned at all) in error.(*googleapi.Error).Header. Use
  6393. // googleapi.IsNotModified to check whether the returned error was
  6394. // because http.StatusNotModified was returned.
  6395. func (c *BiddersAccountsFilterSetsListCall) Do(opts ...googleapi.CallOption) (*ListFilterSetsResponse, error) {
  6396. gensupport.SetOptions(c.urlParams_, opts...)
  6397. res, err := c.doRequest("json")
  6398. if res != nil && res.StatusCode == http.StatusNotModified {
  6399. if res.Body != nil {
  6400. res.Body.Close()
  6401. }
  6402. return nil, &googleapi.Error{
  6403. Code: res.StatusCode,
  6404. Header: res.Header,
  6405. }
  6406. }
  6407. if err != nil {
  6408. return nil, err
  6409. }
  6410. defer googleapi.CloseBody(res)
  6411. if err := googleapi.CheckResponse(res); err != nil {
  6412. return nil, err
  6413. }
  6414. ret := &ListFilterSetsResponse{
  6415. ServerResponse: googleapi.ServerResponse{
  6416. Header: res.Header,
  6417. HTTPStatusCode: res.StatusCode,
  6418. },
  6419. }
  6420. target := &ret
  6421. if err := gensupport.DecodeResponse(target, res); err != nil {
  6422. return nil, err
  6423. }
  6424. return ret, nil
  6425. // {
  6426. // "description": "Lists all filter sets for the account with the given account ID.",
  6427. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets",
  6428. // "httpMethod": "GET",
  6429. // "id": "adexchangebuyer2.bidders.accounts.filterSets.list",
  6430. // "parameterOrder": [
  6431. // "ownerName"
  6432. // ],
  6433. // "parameters": {
  6434. // "ownerName": {
  6435. // "description": "Name of the owner (bidder or account) of the filter sets to be listed.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`",
  6436. // "location": "path",
  6437. // "pattern": "^bidders/[^/]+/accounts/[^/]+$",
  6438. // "required": true,
  6439. // "type": "string"
  6440. // },
  6441. // "pageSize": {
  6442. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  6443. // "format": "int32",
  6444. // "location": "query",
  6445. // "type": "integer"
  6446. // },
  6447. // "pageToken": {
  6448. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilterSetsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.list\nmethod.",
  6449. // "location": "query",
  6450. // "type": "string"
  6451. // }
  6452. // },
  6453. // "path": "v2beta1/{+ownerName}/filterSets",
  6454. // "response": {
  6455. // "$ref": "ListFilterSetsResponse"
  6456. // },
  6457. // "scopes": [
  6458. // "https://www.googleapis.com/auth/adexchange.buyer"
  6459. // ]
  6460. // }
  6461. }
  6462. // Pages invokes f for each page of results.
  6463. // A non-nil error returned from f will halt the iteration.
  6464. // The provided context supersedes any context provided to the Context method.
  6465. func (c *BiddersAccountsFilterSetsListCall) Pages(ctx context.Context, f func(*ListFilterSetsResponse) error) error {
  6466. c.ctx_ = ctx
  6467. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6468. for {
  6469. x, err := c.Do()
  6470. if err != nil {
  6471. return err
  6472. }
  6473. if err := f(x); err != nil {
  6474. return err
  6475. }
  6476. if x.NextPageToken == "" {
  6477. return nil
  6478. }
  6479. c.PageToken(x.NextPageToken)
  6480. }
  6481. }
  6482. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list":
  6483. type BiddersAccountsFilterSetsBidMetricsListCall struct {
  6484. s *Service
  6485. filterSetName string
  6486. urlParams_ gensupport.URLParams
  6487. ifNoneMatch_ string
  6488. ctx_ context.Context
  6489. header_ http.Header
  6490. }
  6491. // List: Lists all metrics that are measured in terms of number of bids.
  6492. func (r *BiddersAccountsFilterSetsBidMetricsService) List(filterSetName string) *BiddersAccountsFilterSetsBidMetricsListCall {
  6493. c := &BiddersAccountsFilterSetsBidMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6494. c.filterSetName = filterSetName
  6495. return c
  6496. }
  6497. // PageSize sets the optional parameter "pageSize": Requested page size.
  6498. // The server may return fewer results than requested.
  6499. // If unspecified, the server will pick an appropriate default.
  6500. func (c *BiddersAccountsFilterSetsBidMetricsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidMetricsListCall {
  6501. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6502. return c
  6503. }
  6504. // PageToken sets the optional parameter "pageToken": A token
  6505. // identifying a page of results the server should return.
  6506. // Typically, this is the value
  6507. // of
  6508. // ListBidMetricsResponse.nextPageToken
  6509. // returned from the previous call to the bidMetrics.list
  6510. // method.
  6511. func (c *BiddersAccountsFilterSetsBidMetricsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidMetricsListCall {
  6512. c.urlParams_.Set("pageToken", pageToken)
  6513. return c
  6514. }
  6515. // Fields allows partial responses to be retrieved. See
  6516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6517. // for more information.
  6518. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidMetricsListCall {
  6519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6520. return c
  6521. }
  6522. // IfNoneMatch sets the optional parameter which makes the operation
  6523. // fail if the object's ETag matches the given value. This is useful for
  6524. // getting updates only after the object has changed since the last
  6525. // request. Use googleapi.IsNotModified to check whether the response
  6526. // error from Do is the result of In-None-Match.
  6527. func (c *BiddersAccountsFilterSetsBidMetricsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidMetricsListCall {
  6528. c.ifNoneMatch_ = entityTag
  6529. return c
  6530. }
  6531. // Context sets the context to be used in this call's Do method. Any
  6532. // pending HTTP request will be aborted if the provided context is
  6533. // canceled.
  6534. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidMetricsListCall {
  6535. c.ctx_ = ctx
  6536. return c
  6537. }
  6538. // Header returns an http.Header that can be modified by the caller to
  6539. // add HTTP headers to the request.
  6540. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Header() http.Header {
  6541. if c.header_ == nil {
  6542. c.header_ = make(http.Header)
  6543. }
  6544. return c.header_
  6545. }
  6546. func (c *BiddersAccountsFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Response, error) {
  6547. reqHeaders := make(http.Header)
  6548. for k, v := range c.header_ {
  6549. reqHeaders[k] = v
  6550. }
  6551. reqHeaders.Set("User-Agent", c.s.userAgent())
  6552. if c.ifNoneMatch_ != "" {
  6553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6554. }
  6555. var body io.Reader = nil
  6556. c.urlParams_.Set("alt", alt)
  6557. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics")
  6558. urls += "?" + c.urlParams_.Encode()
  6559. req, _ := http.NewRequest("GET", urls, body)
  6560. req.Header = reqHeaders
  6561. googleapi.Expand(req.URL, map[string]string{
  6562. "filterSetName": c.filterSetName,
  6563. })
  6564. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6565. }
  6566. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list" call.
  6567. // Exactly one of *ListBidMetricsResponse or error will be non-nil. Any
  6568. // non-2xx status code is an error. Response headers are in either
  6569. // *ListBidMetricsResponse.ServerResponse.Header or (if a response was
  6570. // returned at all) in error.(*googleapi.Error).Header. Use
  6571. // googleapi.IsNotModified to check whether the returned error was
  6572. // because http.StatusNotModified was returned.
  6573. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Do(opts ...googleapi.CallOption) (*ListBidMetricsResponse, error) {
  6574. gensupport.SetOptions(c.urlParams_, opts...)
  6575. res, err := c.doRequest("json")
  6576. if res != nil && res.StatusCode == http.StatusNotModified {
  6577. if res.Body != nil {
  6578. res.Body.Close()
  6579. }
  6580. return nil, &googleapi.Error{
  6581. Code: res.StatusCode,
  6582. Header: res.Header,
  6583. }
  6584. }
  6585. if err != nil {
  6586. return nil, err
  6587. }
  6588. defer googleapi.CloseBody(res)
  6589. if err := googleapi.CheckResponse(res); err != nil {
  6590. return nil, err
  6591. }
  6592. ret := &ListBidMetricsResponse{
  6593. ServerResponse: googleapi.ServerResponse{
  6594. Header: res.Header,
  6595. HTTPStatusCode: res.StatusCode,
  6596. },
  6597. }
  6598. target := &ret
  6599. if err := gensupport.DecodeResponse(target, res); err != nil {
  6600. return nil, err
  6601. }
  6602. return ret, nil
  6603. // {
  6604. // "description": "Lists all metrics that are measured in terms of number of bids.",
  6605. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidMetrics",
  6606. // "httpMethod": "GET",
  6607. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list",
  6608. // "parameterOrder": [
  6609. // "filterSetName"
  6610. // ],
  6611. // "parameters": {
  6612. // "filterSetName": {
  6613. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  6614. // "location": "path",
  6615. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  6616. // "required": true,
  6617. // "type": "string"
  6618. // },
  6619. // "pageSize": {
  6620. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  6621. // "format": "int32",
  6622. // "location": "query",
  6623. // "type": "integer"
  6624. // },
  6625. // "pageToken": {
  6626. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidMetricsResponse.nextPageToken\nreturned from the previous call to the bidMetrics.list\nmethod.",
  6627. // "location": "query",
  6628. // "type": "string"
  6629. // }
  6630. // },
  6631. // "path": "v2beta1/{+filterSetName}/bidMetrics",
  6632. // "response": {
  6633. // "$ref": "ListBidMetricsResponse"
  6634. // },
  6635. // "scopes": [
  6636. // "https://www.googleapis.com/auth/adexchange.buyer"
  6637. // ]
  6638. // }
  6639. }
  6640. // Pages invokes f for each page of results.
  6641. // A non-nil error returned from f will halt the iteration.
  6642. // The provided context supersedes any context provided to the Context method.
  6643. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Pages(ctx context.Context, f func(*ListBidMetricsResponse) error) error {
  6644. c.ctx_ = ctx
  6645. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6646. for {
  6647. x, err := c.Do()
  6648. if err != nil {
  6649. return err
  6650. }
  6651. if err := f(x); err != nil {
  6652. return err
  6653. }
  6654. if x.NextPageToken == "" {
  6655. return nil
  6656. }
  6657. c.PageToken(x.NextPageToken)
  6658. }
  6659. }
  6660. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list":
  6661. type BiddersAccountsFilterSetsBidResponseErrorsListCall struct {
  6662. s *Service
  6663. filterSetName string
  6664. urlParams_ gensupport.URLParams
  6665. ifNoneMatch_ string
  6666. ctx_ context.Context
  6667. header_ http.Header
  6668. }
  6669. // List: List all errors that occurred in bid responses, with the number
  6670. // of bid
  6671. // responses affected for each reason.
  6672. func (r *BiddersAccountsFilterSetsBidResponseErrorsService) List(filterSetName string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6673. c := &BiddersAccountsFilterSetsBidResponseErrorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6674. c.filterSetName = filterSetName
  6675. return c
  6676. }
  6677. // PageSize sets the optional parameter "pageSize": Requested page size.
  6678. // The server may return fewer results than requested.
  6679. // If unspecified, the server will pick an appropriate default.
  6680. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6681. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6682. return c
  6683. }
  6684. // PageToken sets the optional parameter "pageToken": A token
  6685. // identifying a page of results the server should return.
  6686. // Typically, this is the value
  6687. // of
  6688. // ListBidResponseErrorsResponse.nextPageToken
  6689. // returned from the previous call to the bidResponseErrors.list
  6690. // method.
  6691. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6692. c.urlParams_.Set("pageToken", pageToken)
  6693. return c
  6694. }
  6695. // Fields allows partial responses to be retrieved. See
  6696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6697. // for more information.
  6698. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6700. return c
  6701. }
  6702. // IfNoneMatch sets the optional parameter which makes the operation
  6703. // fail if the object's ETag matches the given value. This is useful for
  6704. // getting updates only after the object has changed since the last
  6705. // request. Use googleapi.IsNotModified to check whether the response
  6706. // error from Do is the result of In-None-Match.
  6707. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6708. c.ifNoneMatch_ = entityTag
  6709. return c
  6710. }
  6711. // Context sets the context to be used in this call's Do method. Any
  6712. // pending HTTP request will be aborted if the provided context is
  6713. // canceled.
  6714. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  6715. c.ctx_ = ctx
  6716. return c
  6717. }
  6718. // Header returns an http.Header that can be modified by the caller to
  6719. // add HTTP headers to the request.
  6720. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Header() http.Header {
  6721. if c.header_ == nil {
  6722. c.header_ = make(http.Header)
  6723. }
  6724. return c.header_
  6725. }
  6726. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*http.Response, error) {
  6727. reqHeaders := make(http.Header)
  6728. for k, v := range c.header_ {
  6729. reqHeaders[k] = v
  6730. }
  6731. reqHeaders.Set("User-Agent", c.s.userAgent())
  6732. if c.ifNoneMatch_ != "" {
  6733. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6734. }
  6735. var body io.Reader = nil
  6736. c.urlParams_.Set("alt", alt)
  6737. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors")
  6738. urls += "?" + c.urlParams_.Encode()
  6739. req, _ := http.NewRequest("GET", urls, body)
  6740. req.Header = reqHeaders
  6741. googleapi.Expand(req.URL, map[string]string{
  6742. "filterSetName": c.filterSetName,
  6743. })
  6744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6745. }
  6746. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list" call.
  6747. // Exactly one of *ListBidResponseErrorsResponse or error will be
  6748. // non-nil. Any non-2xx status code is an error. Response headers are in
  6749. // either *ListBidResponseErrorsResponse.ServerResponse.Header or (if a
  6750. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6751. // googleapi.IsNotModified to check whether the returned error was
  6752. // because http.StatusNotModified was returned.
  6753. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponseErrorsResponse, error) {
  6754. gensupport.SetOptions(c.urlParams_, opts...)
  6755. res, err := c.doRequest("json")
  6756. if res != nil && res.StatusCode == http.StatusNotModified {
  6757. if res.Body != nil {
  6758. res.Body.Close()
  6759. }
  6760. return nil, &googleapi.Error{
  6761. Code: res.StatusCode,
  6762. Header: res.Header,
  6763. }
  6764. }
  6765. if err != nil {
  6766. return nil, err
  6767. }
  6768. defer googleapi.CloseBody(res)
  6769. if err := googleapi.CheckResponse(res); err != nil {
  6770. return nil, err
  6771. }
  6772. ret := &ListBidResponseErrorsResponse{
  6773. ServerResponse: googleapi.ServerResponse{
  6774. Header: res.Header,
  6775. HTTPStatusCode: res.StatusCode,
  6776. },
  6777. }
  6778. target := &ret
  6779. if err := gensupport.DecodeResponse(target, res); err != nil {
  6780. return nil, err
  6781. }
  6782. return ret, nil
  6783. // {
  6784. // "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason.",
  6785. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponseErrors",
  6786. // "httpMethod": "GET",
  6787. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list",
  6788. // "parameterOrder": [
  6789. // "filterSetName"
  6790. // ],
  6791. // "parameters": {
  6792. // "filterSetName": {
  6793. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  6794. // "location": "path",
  6795. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  6796. // "required": true,
  6797. // "type": "string"
  6798. // },
  6799. // "pageSize": {
  6800. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  6801. // "format": "int32",
  6802. // "location": "query",
  6803. // "type": "integer"
  6804. // },
  6805. // "pageToken": {
  6806. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponseErrorsResponse.nextPageToken\nreturned from the previous call to the bidResponseErrors.list\nmethod.",
  6807. // "location": "query",
  6808. // "type": "string"
  6809. // }
  6810. // },
  6811. // "path": "v2beta1/{+filterSetName}/bidResponseErrors",
  6812. // "response": {
  6813. // "$ref": "ListBidResponseErrorsResponse"
  6814. // },
  6815. // "scopes": [
  6816. // "https://www.googleapis.com/auth/adexchange.buyer"
  6817. // ]
  6818. // }
  6819. }
  6820. // Pages invokes f for each page of results.
  6821. // A non-nil error returned from f will halt the iteration.
  6822. // The provided context supersedes any context provided to the Context method.
  6823. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Pages(ctx context.Context, f func(*ListBidResponseErrorsResponse) error) error {
  6824. c.ctx_ = ctx
  6825. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6826. for {
  6827. x, err := c.Do()
  6828. if err != nil {
  6829. return err
  6830. }
  6831. if err := f(x); err != nil {
  6832. return err
  6833. }
  6834. if x.NextPageToken == "" {
  6835. return nil
  6836. }
  6837. c.PageToken(x.NextPageToken)
  6838. }
  6839. }
  6840. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list":
  6841. type BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall struct {
  6842. s *Service
  6843. filterSetName string
  6844. urlParams_ gensupport.URLParams
  6845. ifNoneMatch_ string
  6846. ctx_ context.Context
  6847. header_ http.Header
  6848. }
  6849. // List: List all reasons for which bid responses were considered to
  6850. // have no
  6851. // applicable bids, with the number of bid responses affected for each
  6852. // reason.
  6853. func (r *BiddersAccountsFilterSetsBidResponsesWithoutBidsService) List(filterSetName string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6854. c := &BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6855. c.filterSetName = filterSetName
  6856. return c
  6857. }
  6858. // PageSize sets the optional parameter "pageSize": Requested page size.
  6859. // The server may return fewer results than requested.
  6860. // If unspecified, the server will pick an appropriate default.
  6861. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6862. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6863. return c
  6864. }
  6865. // PageToken sets the optional parameter "pageToken": A token
  6866. // identifying a page of results the server should return.
  6867. // Typically, this is the value
  6868. // of
  6869. // ListBidResponsesWithoutBidsResponse.nextPageToken
  6870. // returned from the previous call to the
  6871. // bidResponsesWithoutBids.list
  6872. // method.
  6873. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6874. c.urlParams_.Set("pageToken", pageToken)
  6875. return c
  6876. }
  6877. // Fields allows partial responses to be retrieved. See
  6878. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6879. // for more information.
  6880. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6881. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6882. return c
  6883. }
  6884. // IfNoneMatch sets the optional parameter which makes the operation
  6885. // fail if the object's ETag matches the given value. This is useful for
  6886. // getting updates only after the object has changed since the last
  6887. // request. Use googleapi.IsNotModified to check whether the response
  6888. // error from Do is the result of In-None-Match.
  6889. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6890. c.ifNoneMatch_ = entityTag
  6891. return c
  6892. }
  6893. // Context sets the context to be used in this call's Do method. Any
  6894. // pending HTTP request will be aborted if the provided context is
  6895. // canceled.
  6896. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  6897. c.ctx_ = ctx
  6898. return c
  6899. }
  6900. // Header returns an http.Header that can be modified by the caller to
  6901. // add HTTP headers to the request.
  6902. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Header() http.Header {
  6903. if c.header_ == nil {
  6904. c.header_ = make(http.Header)
  6905. }
  6906. return c.header_
  6907. }
  6908. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) (*http.Response, error) {
  6909. reqHeaders := make(http.Header)
  6910. for k, v := range c.header_ {
  6911. reqHeaders[k] = v
  6912. }
  6913. reqHeaders.Set("User-Agent", c.s.userAgent())
  6914. if c.ifNoneMatch_ != "" {
  6915. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6916. }
  6917. var body io.Reader = nil
  6918. c.urlParams_.Set("alt", alt)
  6919. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids")
  6920. urls += "?" + c.urlParams_.Encode()
  6921. req, _ := http.NewRequest("GET", urls, body)
  6922. req.Header = reqHeaders
  6923. googleapi.Expand(req.URL, map[string]string{
  6924. "filterSetName": c.filterSetName,
  6925. })
  6926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6927. }
  6928. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list" call.
  6929. // Exactly one of *ListBidResponsesWithoutBidsResponse or error will be
  6930. // non-nil. Any non-2xx status code is an error. Response headers are in
  6931. // either *ListBidResponsesWithoutBidsResponse.ServerResponse.Header or
  6932. // (if a response was returned at all) in
  6933. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6934. // whether the returned error was because http.StatusNotModified was
  6935. // returned.
  6936. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponsesWithoutBidsResponse, error) {
  6937. gensupport.SetOptions(c.urlParams_, opts...)
  6938. res, err := c.doRequest("json")
  6939. if res != nil && res.StatusCode == http.StatusNotModified {
  6940. if res.Body != nil {
  6941. res.Body.Close()
  6942. }
  6943. return nil, &googleapi.Error{
  6944. Code: res.StatusCode,
  6945. Header: res.Header,
  6946. }
  6947. }
  6948. if err != nil {
  6949. return nil, err
  6950. }
  6951. defer googleapi.CloseBody(res)
  6952. if err := googleapi.CheckResponse(res); err != nil {
  6953. return nil, err
  6954. }
  6955. ret := &ListBidResponsesWithoutBidsResponse{
  6956. ServerResponse: googleapi.ServerResponse{
  6957. Header: res.Header,
  6958. HTTPStatusCode: res.StatusCode,
  6959. },
  6960. }
  6961. target := &ret
  6962. if err := gensupport.DecodeResponse(target, res); err != nil {
  6963. return nil, err
  6964. }
  6965. return ret, nil
  6966. // {
  6967. // "description": "List all reasons for which bid responses were considered to have no\napplicable bids, with the number of bid responses affected for each reason.",
  6968. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponsesWithoutBids",
  6969. // "httpMethod": "GET",
  6970. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list",
  6971. // "parameterOrder": [
  6972. // "filterSetName"
  6973. // ],
  6974. // "parameters": {
  6975. // "filterSetName": {
  6976. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  6977. // "location": "path",
  6978. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  6979. // "required": true,
  6980. // "type": "string"
  6981. // },
  6982. // "pageSize": {
  6983. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  6984. // "format": "int32",
  6985. // "location": "query",
  6986. // "type": "integer"
  6987. // },
  6988. // "pageToken": {
  6989. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponsesWithoutBidsResponse.nextPageToken\nreturned from the previous call to the bidResponsesWithoutBids.list\nmethod.",
  6990. // "location": "query",
  6991. // "type": "string"
  6992. // }
  6993. // },
  6994. // "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids",
  6995. // "response": {
  6996. // "$ref": "ListBidResponsesWithoutBidsResponse"
  6997. // },
  6998. // "scopes": [
  6999. // "https://www.googleapis.com/auth/adexchange.buyer"
  7000. // ]
  7001. // }
  7002. }
  7003. // Pages invokes f for each page of results.
  7004. // A non-nil error returned from f will halt the iteration.
  7005. // The provided context supersedes any context provided to the Context method.
  7006. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Pages(ctx context.Context, f func(*ListBidResponsesWithoutBidsResponse) error) error {
  7007. c.ctx_ = ctx
  7008. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7009. for {
  7010. x, err := c.Do()
  7011. if err != nil {
  7012. return err
  7013. }
  7014. if err := f(x); err != nil {
  7015. return err
  7016. }
  7017. if x.NextPageToken == "" {
  7018. return nil
  7019. }
  7020. c.PageToken(x.NextPageToken)
  7021. }
  7022. }
  7023. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list":
  7024. type BiddersAccountsFilterSetsFilteredBidRequestsListCall struct {
  7025. s *Service
  7026. filterSetName string
  7027. urlParams_ gensupport.URLParams
  7028. ifNoneMatch_ string
  7029. ctx_ context.Context
  7030. header_ http.Header
  7031. }
  7032. // List: List all reasons that caused a bid request not to be sent for
  7033. // an
  7034. // impression, with the number of bid requests not sent for each reason.
  7035. func (r *BiddersAccountsFilterSetsFilteredBidRequestsService) List(filterSetName string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7036. c := &BiddersAccountsFilterSetsFilteredBidRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7037. c.filterSetName = filterSetName
  7038. return c
  7039. }
  7040. // PageSize sets the optional parameter "pageSize": Requested page size.
  7041. // The server may return fewer results than requested.
  7042. // If unspecified, the server will pick an appropriate default.
  7043. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7044. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7045. return c
  7046. }
  7047. // PageToken sets the optional parameter "pageToken": A token
  7048. // identifying a page of results the server should return.
  7049. // Typically, this is the value
  7050. // of
  7051. // ListFilteredBidRequestsResponse.nextPageToken
  7052. // returned from the previous call to the
  7053. // filteredBidRequests.list
  7054. // method.
  7055. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7056. c.urlParams_.Set("pageToken", pageToken)
  7057. return c
  7058. }
  7059. // Fields allows partial responses to be retrieved. See
  7060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7061. // for more information.
  7062. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7064. return c
  7065. }
  7066. // IfNoneMatch sets the optional parameter which makes the operation
  7067. // fail if the object's ETag matches the given value. This is useful for
  7068. // getting updates only after the object has changed since the last
  7069. // request. Use googleapi.IsNotModified to check whether the response
  7070. // error from Do is the result of In-None-Match.
  7071. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7072. c.ifNoneMatch_ = entityTag
  7073. return c
  7074. }
  7075. // Context sets the context to be used in this call's Do method. Any
  7076. // pending HTTP request will be aborted if the provided context is
  7077. // canceled.
  7078. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  7079. c.ctx_ = ctx
  7080. return c
  7081. }
  7082. // Header returns an http.Header that can be modified by the caller to
  7083. // add HTTP headers to the request.
  7084. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Header() http.Header {
  7085. if c.header_ == nil {
  7086. c.header_ = make(http.Header)
  7087. }
  7088. return c.header_
  7089. }
  7090. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*http.Response, error) {
  7091. reqHeaders := make(http.Header)
  7092. for k, v := range c.header_ {
  7093. reqHeaders[k] = v
  7094. }
  7095. reqHeaders.Set("User-Agent", c.s.userAgent())
  7096. if c.ifNoneMatch_ != "" {
  7097. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7098. }
  7099. var body io.Reader = nil
  7100. c.urlParams_.Set("alt", alt)
  7101. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests")
  7102. urls += "?" + c.urlParams_.Encode()
  7103. req, _ := http.NewRequest("GET", urls, body)
  7104. req.Header = reqHeaders
  7105. googleapi.Expand(req.URL, map[string]string{
  7106. "filterSetName": c.filterSetName,
  7107. })
  7108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7109. }
  7110. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list" call.
  7111. // Exactly one of *ListFilteredBidRequestsResponse or error will be
  7112. // non-nil. Any non-2xx status code is an error. Response headers are in
  7113. // either *ListFilteredBidRequestsResponse.ServerResponse.Header or (if
  7114. // a response was returned at all) in error.(*googleapi.Error).Header.
  7115. // Use googleapi.IsNotModified to check whether the returned error was
  7116. // because http.StatusNotModified was returned.
  7117. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidRequestsResponse, error) {
  7118. gensupport.SetOptions(c.urlParams_, opts...)
  7119. res, err := c.doRequest("json")
  7120. if res != nil && res.StatusCode == http.StatusNotModified {
  7121. if res.Body != nil {
  7122. res.Body.Close()
  7123. }
  7124. return nil, &googleapi.Error{
  7125. Code: res.StatusCode,
  7126. Header: res.Header,
  7127. }
  7128. }
  7129. if err != nil {
  7130. return nil, err
  7131. }
  7132. defer googleapi.CloseBody(res)
  7133. if err := googleapi.CheckResponse(res); err != nil {
  7134. return nil, err
  7135. }
  7136. ret := &ListFilteredBidRequestsResponse{
  7137. ServerResponse: googleapi.ServerResponse{
  7138. Header: res.Header,
  7139. HTTPStatusCode: res.StatusCode,
  7140. },
  7141. }
  7142. target := &ret
  7143. if err := gensupport.DecodeResponse(target, res); err != nil {
  7144. return nil, err
  7145. }
  7146. return ret, nil
  7147. // {
  7148. // "description": "List all reasons that caused a bid request not to be sent for an\nimpression, with the number of bid requests not sent for each reason.",
  7149. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBidRequests",
  7150. // "httpMethod": "GET",
  7151. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list",
  7152. // "parameterOrder": [
  7153. // "filterSetName"
  7154. // ],
  7155. // "parameters": {
  7156. // "filterSetName": {
  7157. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  7158. // "location": "path",
  7159. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  7160. // "required": true,
  7161. // "type": "string"
  7162. // },
  7163. // "pageSize": {
  7164. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  7165. // "format": "int32",
  7166. // "location": "query",
  7167. // "type": "integer"
  7168. // },
  7169. // "pageToken": {
  7170. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidRequestsResponse.nextPageToken\nreturned from the previous call to the filteredBidRequests.list\nmethod.",
  7171. // "location": "query",
  7172. // "type": "string"
  7173. // }
  7174. // },
  7175. // "path": "v2beta1/{+filterSetName}/filteredBidRequests",
  7176. // "response": {
  7177. // "$ref": "ListFilteredBidRequestsResponse"
  7178. // },
  7179. // "scopes": [
  7180. // "https://www.googleapis.com/auth/adexchange.buyer"
  7181. // ]
  7182. // }
  7183. }
  7184. // Pages invokes f for each page of results.
  7185. // A non-nil error returned from f will halt the iteration.
  7186. // The provided context supersedes any context provided to the Context method.
  7187. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Pages(ctx context.Context, f func(*ListFilteredBidRequestsResponse) error) error {
  7188. c.ctx_ = ctx
  7189. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7190. for {
  7191. x, err := c.Do()
  7192. if err != nil {
  7193. return err
  7194. }
  7195. if err := f(x); err != nil {
  7196. return err
  7197. }
  7198. if x.NextPageToken == "" {
  7199. return nil
  7200. }
  7201. c.PageToken(x.NextPageToken)
  7202. }
  7203. }
  7204. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list":
  7205. type BiddersAccountsFilterSetsFilteredBidsListCall struct {
  7206. s *Service
  7207. filterSetName string
  7208. urlParams_ gensupport.URLParams
  7209. ifNoneMatch_ string
  7210. ctx_ context.Context
  7211. header_ http.Header
  7212. }
  7213. // List: List all reasons for which bids were filtered, with the number
  7214. // of bids
  7215. // filtered for each reason.
  7216. func (r *BiddersAccountsFilterSetsFilteredBidsService) List(filterSetName string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7217. c := &BiddersAccountsFilterSetsFilteredBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7218. c.filterSetName = filterSetName
  7219. return c
  7220. }
  7221. // PageSize sets the optional parameter "pageSize": Requested page size.
  7222. // The server may return fewer results than requested.
  7223. // If unspecified, the server will pick an appropriate default.
  7224. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7225. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7226. return c
  7227. }
  7228. // PageToken sets the optional parameter "pageToken": A token
  7229. // identifying a page of results the server should return.
  7230. // Typically, this is the value
  7231. // of
  7232. // ListFilteredBidsResponse.nextPageToken
  7233. // returned from the previous call to the filteredBids.list
  7234. // method.
  7235. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7236. c.urlParams_.Set("pageToken", pageToken)
  7237. return c
  7238. }
  7239. // Fields allows partial responses to be retrieved. See
  7240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7241. // for more information.
  7242. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7244. return c
  7245. }
  7246. // IfNoneMatch sets the optional parameter which makes the operation
  7247. // fail if the object's ETag matches the given value. This is useful for
  7248. // getting updates only after the object has changed since the last
  7249. // request. Use googleapi.IsNotModified to check whether the response
  7250. // error from Do is the result of In-None-Match.
  7251. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7252. c.ifNoneMatch_ = entityTag
  7253. return c
  7254. }
  7255. // Context sets the context to be used in this call's Do method. Any
  7256. // pending HTTP request will be aborted if the provided context is
  7257. // canceled.
  7258. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsListCall {
  7259. c.ctx_ = ctx
  7260. return c
  7261. }
  7262. // Header returns an http.Header that can be modified by the caller to
  7263. // add HTTP headers to the request.
  7264. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Header() http.Header {
  7265. if c.header_ == nil {
  7266. c.header_ = make(http.Header)
  7267. }
  7268. return c.header_
  7269. }
  7270. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Response, error) {
  7271. reqHeaders := make(http.Header)
  7272. for k, v := range c.header_ {
  7273. reqHeaders[k] = v
  7274. }
  7275. reqHeaders.Set("User-Agent", c.s.userAgent())
  7276. if c.ifNoneMatch_ != "" {
  7277. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7278. }
  7279. var body io.Reader = nil
  7280. c.urlParams_.Set("alt", alt)
  7281. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids")
  7282. urls += "?" + c.urlParams_.Encode()
  7283. req, _ := http.NewRequest("GET", urls, body)
  7284. req.Header = reqHeaders
  7285. googleapi.Expand(req.URL, map[string]string{
  7286. "filterSetName": c.filterSetName,
  7287. })
  7288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7289. }
  7290. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list" call.
  7291. // Exactly one of *ListFilteredBidsResponse or error will be non-nil.
  7292. // Any non-2xx status code is an error. Response headers are in either
  7293. // *ListFilteredBidsResponse.ServerResponse.Header or (if a response was
  7294. // returned at all) in error.(*googleapi.Error).Header. Use
  7295. // googleapi.IsNotModified to check whether the returned error was
  7296. // because http.StatusNotModified was returned.
  7297. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidsResponse, error) {
  7298. gensupport.SetOptions(c.urlParams_, opts...)
  7299. res, err := c.doRequest("json")
  7300. if res != nil && res.StatusCode == http.StatusNotModified {
  7301. if res.Body != nil {
  7302. res.Body.Close()
  7303. }
  7304. return nil, &googleapi.Error{
  7305. Code: res.StatusCode,
  7306. Header: res.Header,
  7307. }
  7308. }
  7309. if err != nil {
  7310. return nil, err
  7311. }
  7312. defer googleapi.CloseBody(res)
  7313. if err := googleapi.CheckResponse(res); err != nil {
  7314. return nil, err
  7315. }
  7316. ret := &ListFilteredBidsResponse{
  7317. ServerResponse: googleapi.ServerResponse{
  7318. Header: res.Header,
  7319. HTTPStatusCode: res.StatusCode,
  7320. },
  7321. }
  7322. target := &ret
  7323. if err := gensupport.DecodeResponse(target, res); err != nil {
  7324. return nil, err
  7325. }
  7326. return ret, nil
  7327. // {
  7328. // "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.",
  7329. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids",
  7330. // "httpMethod": "GET",
  7331. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list",
  7332. // "parameterOrder": [
  7333. // "filterSetName"
  7334. // ],
  7335. // "parameters": {
  7336. // "filterSetName": {
  7337. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  7338. // "location": "path",
  7339. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  7340. // "required": true,
  7341. // "type": "string"
  7342. // },
  7343. // "pageSize": {
  7344. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  7345. // "format": "int32",
  7346. // "location": "query",
  7347. // "type": "integer"
  7348. // },
  7349. // "pageToken": {
  7350. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidsResponse.nextPageToken\nreturned from the previous call to the filteredBids.list\nmethod.",
  7351. // "location": "query",
  7352. // "type": "string"
  7353. // }
  7354. // },
  7355. // "path": "v2beta1/{+filterSetName}/filteredBids",
  7356. // "response": {
  7357. // "$ref": "ListFilteredBidsResponse"
  7358. // },
  7359. // "scopes": [
  7360. // "https://www.googleapis.com/auth/adexchange.buyer"
  7361. // ]
  7362. // }
  7363. }
  7364. // Pages invokes f for each page of results.
  7365. // A non-nil error returned from f will halt the iteration.
  7366. // The provided context supersedes any context provided to the Context method.
  7367. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Pages(ctx context.Context, f func(*ListFilteredBidsResponse) error) error {
  7368. c.ctx_ = ctx
  7369. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7370. for {
  7371. x, err := c.Do()
  7372. if err != nil {
  7373. return err
  7374. }
  7375. if err := f(x); err != nil {
  7376. return err
  7377. }
  7378. if x.NextPageToken == "" {
  7379. return nil
  7380. }
  7381. c.PageToken(x.NextPageToken)
  7382. }
  7383. }
  7384. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list":
  7385. type BiddersAccountsFilterSetsFilteredBidsCreativesListCall struct {
  7386. s *Service
  7387. filterSetName string
  7388. creativeStatusId int64
  7389. urlParams_ gensupport.URLParams
  7390. ifNoneMatch_ string
  7391. ctx_ context.Context
  7392. header_ http.Header
  7393. }
  7394. // List: List all creatives associated with a specific reason for which
  7395. // bids were
  7396. // filtered, with the number of bids filtered for each creative.
  7397. func (r *BiddersAccountsFilterSetsFilteredBidsCreativesService) List(filterSetName string, creativeStatusId int64) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7398. c := &BiddersAccountsFilterSetsFilteredBidsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7399. c.filterSetName = filterSetName
  7400. c.creativeStatusId = creativeStatusId
  7401. return c
  7402. }
  7403. // PageSize sets the optional parameter "pageSize": Requested page size.
  7404. // The server may return fewer results than requested.
  7405. // If unspecified, the server will pick an appropriate default.
  7406. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7407. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7408. return c
  7409. }
  7410. // PageToken sets the optional parameter "pageToken": A token
  7411. // identifying a page of results the server should return.
  7412. // Typically, this is the value
  7413. // of
  7414. // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken
  7415. // returne
  7416. // d from the previous call to the filteredBids.creatives.list
  7417. // method.
  7418. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7419. c.urlParams_.Set("pageToken", pageToken)
  7420. return c
  7421. }
  7422. // Fields allows partial responses to be retrieved. See
  7423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7424. // for more information.
  7425. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7427. return c
  7428. }
  7429. // IfNoneMatch sets the optional parameter which makes the operation
  7430. // fail if the object's ETag matches the given value. This is useful for
  7431. // getting updates only after the object has changed since the last
  7432. // request. Use googleapi.IsNotModified to check whether the response
  7433. // error from Do is the result of In-None-Match.
  7434. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7435. c.ifNoneMatch_ = entityTag
  7436. return c
  7437. }
  7438. // Context sets the context to be used in this call's Do method. Any
  7439. // pending HTTP request will be aborted if the provided context is
  7440. // canceled.
  7441. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  7442. c.ctx_ = ctx
  7443. return c
  7444. }
  7445. // Header returns an http.Header that can be modified by the caller to
  7446. // add HTTP headers to the request.
  7447. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Header() http.Header {
  7448. if c.header_ == nil {
  7449. c.header_ = make(http.Header)
  7450. }
  7451. return c.header_
  7452. }
  7453. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  7454. reqHeaders := make(http.Header)
  7455. for k, v := range c.header_ {
  7456. reqHeaders[k] = v
  7457. }
  7458. reqHeaders.Set("User-Agent", c.s.userAgent())
  7459. if c.ifNoneMatch_ != "" {
  7460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7461. }
  7462. var body io.Reader = nil
  7463. c.urlParams_.Set("alt", alt)
  7464. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives")
  7465. urls += "?" + c.urlParams_.Encode()
  7466. req, _ := http.NewRequest("GET", urls, body)
  7467. req.Header = reqHeaders
  7468. googleapi.Expand(req.URL, map[string]string{
  7469. "filterSetName": c.filterSetName,
  7470. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  7471. })
  7472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7473. }
  7474. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list" call.
  7475. // Exactly one of *ListCreativeStatusBreakdownByCreativeResponse or
  7476. // error will be non-nil. Any non-2xx status code is an error. Response
  7477. // headers are in either
  7478. // *ListCreativeStatusBreakdownByCreativeResponse.ServerResponse.Header
  7479. // or (if a response was returned at all) in
  7480. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7481. // whether the returned error was because http.StatusNotModified was
  7482. // returned.
  7483. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByCreativeResponse, error) {
  7484. gensupport.SetOptions(c.urlParams_, opts...)
  7485. res, err := c.doRequest("json")
  7486. if res != nil && res.StatusCode == http.StatusNotModified {
  7487. if res.Body != nil {
  7488. res.Body.Close()
  7489. }
  7490. return nil, &googleapi.Error{
  7491. Code: res.StatusCode,
  7492. Header: res.Header,
  7493. }
  7494. }
  7495. if err != nil {
  7496. return nil, err
  7497. }
  7498. defer googleapi.CloseBody(res)
  7499. if err := googleapi.CheckResponse(res); err != nil {
  7500. return nil, err
  7501. }
  7502. ret := &ListCreativeStatusBreakdownByCreativeResponse{
  7503. ServerResponse: googleapi.ServerResponse{
  7504. Header: res.Header,
  7505. HTTPStatusCode: res.StatusCode,
  7506. },
  7507. }
  7508. target := &ret
  7509. if err := gensupport.DecodeResponse(target, res); err != nil {
  7510. return nil, err
  7511. }
  7512. return ret, nil
  7513. // {
  7514. // "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.",
  7515. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives",
  7516. // "httpMethod": "GET",
  7517. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list",
  7518. // "parameterOrder": [
  7519. // "filterSetName",
  7520. // "creativeStatusId"
  7521. // ],
  7522. // "parameters": {
  7523. // "creativeStatusId": {
  7524. // "description": "The ID of the creative status for which to retrieve a breakdown by\ncreative.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).",
  7525. // "format": "int32",
  7526. // "location": "path",
  7527. // "required": true,
  7528. // "type": "integer"
  7529. // },
  7530. // "filterSetName": {
  7531. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  7532. // "location": "path",
  7533. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  7534. // "required": true,
  7535. // "type": "string"
  7536. // },
  7537. // "pageSize": {
  7538. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  7539. // "format": "int32",
  7540. // "location": "query",
  7541. // "type": "integer"
  7542. // },
  7543. // "pageToken": {
  7544. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByCreativeResponse.nextPageToken\nreturned from the previous call to the filteredBids.creatives.list\nmethod.",
  7545. // "location": "query",
  7546. // "type": "string"
  7547. // }
  7548. // },
  7549. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives",
  7550. // "response": {
  7551. // "$ref": "ListCreativeStatusBreakdownByCreativeResponse"
  7552. // },
  7553. // "scopes": [
  7554. // "https://www.googleapis.com/auth/adexchange.buyer"
  7555. // ]
  7556. // }
  7557. }
  7558. // Pages invokes f for each page of results.
  7559. // A non-nil error returned from f will halt the iteration.
  7560. // The provided context supersedes any context provided to the Context method.
  7561. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByCreativeResponse) error) error {
  7562. c.ctx_ = ctx
  7563. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7564. for {
  7565. x, err := c.Do()
  7566. if err != nil {
  7567. return err
  7568. }
  7569. if err := f(x); err != nil {
  7570. return err
  7571. }
  7572. if x.NextPageToken == "" {
  7573. return nil
  7574. }
  7575. c.PageToken(x.NextPageToken)
  7576. }
  7577. }
  7578. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list":
  7579. type BiddersAccountsFilterSetsFilteredBidsDetailsListCall struct {
  7580. s *Service
  7581. filterSetName string
  7582. creativeStatusId int64
  7583. urlParams_ gensupport.URLParams
  7584. ifNoneMatch_ string
  7585. ctx_ context.Context
  7586. header_ http.Header
  7587. }
  7588. // List: List all details associated with a specific reason for which
  7589. // bids were
  7590. // filtered, with the number of bids filtered for each detail.
  7591. func (r *BiddersAccountsFilterSetsFilteredBidsDetailsService) List(filterSetName string, creativeStatusId int64) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7592. c := &BiddersAccountsFilterSetsFilteredBidsDetailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7593. c.filterSetName = filterSetName
  7594. c.creativeStatusId = creativeStatusId
  7595. return c
  7596. }
  7597. // PageSize sets the optional parameter "pageSize": Requested page size.
  7598. // The server may return fewer results than requested.
  7599. // If unspecified, the server will pick an appropriate default.
  7600. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7601. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7602. return c
  7603. }
  7604. // PageToken sets the optional parameter "pageToken": A token
  7605. // identifying a page of results the server should return.
  7606. // Typically, this is the value
  7607. // of
  7608. // ListCreativeStatusBreakdownByDetailResponse.nextPageToken
  7609. // returned from the previous call to the
  7610. // filteredBids.details.list
  7611. // method.
  7612. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7613. c.urlParams_.Set("pageToken", pageToken)
  7614. return c
  7615. }
  7616. // Fields allows partial responses to be retrieved. See
  7617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7618. // for more information.
  7619. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7621. return c
  7622. }
  7623. // IfNoneMatch sets the optional parameter which makes the operation
  7624. // fail if the object's ETag matches the given value. This is useful for
  7625. // getting updates only after the object has changed since the last
  7626. // request. Use googleapi.IsNotModified to check whether the response
  7627. // error from Do is the result of In-None-Match.
  7628. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7629. c.ifNoneMatch_ = entityTag
  7630. return c
  7631. }
  7632. // Context sets the context to be used in this call's Do method. Any
  7633. // pending HTTP request will be aborted if the provided context is
  7634. // canceled.
  7635. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  7636. c.ctx_ = ctx
  7637. return c
  7638. }
  7639. // Header returns an http.Header that can be modified by the caller to
  7640. // add HTTP headers to the request.
  7641. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Header() http.Header {
  7642. if c.header_ == nil {
  7643. c.header_ = make(http.Header)
  7644. }
  7645. return c.header_
  7646. }
  7647. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*http.Response, error) {
  7648. reqHeaders := make(http.Header)
  7649. for k, v := range c.header_ {
  7650. reqHeaders[k] = v
  7651. }
  7652. reqHeaders.Set("User-Agent", c.s.userAgent())
  7653. if c.ifNoneMatch_ != "" {
  7654. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7655. }
  7656. var body io.Reader = nil
  7657. c.urlParams_.Set("alt", alt)
  7658. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details")
  7659. urls += "?" + c.urlParams_.Encode()
  7660. req, _ := http.NewRequest("GET", urls, body)
  7661. req.Header = reqHeaders
  7662. googleapi.Expand(req.URL, map[string]string{
  7663. "filterSetName": c.filterSetName,
  7664. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  7665. })
  7666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7667. }
  7668. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list" call.
  7669. // Exactly one of *ListCreativeStatusBreakdownByDetailResponse or error
  7670. // will be non-nil. Any non-2xx status code is an error. Response
  7671. // headers are in either
  7672. // *ListCreativeStatusBreakdownByDetailResponse.ServerResponse.Header or
  7673. // (if a response was returned at all) in
  7674. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7675. // whether the returned error was because http.StatusNotModified was
  7676. // returned.
  7677. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByDetailResponse, error) {
  7678. gensupport.SetOptions(c.urlParams_, opts...)
  7679. res, err := c.doRequest("json")
  7680. if res != nil && res.StatusCode == http.StatusNotModified {
  7681. if res.Body != nil {
  7682. res.Body.Close()
  7683. }
  7684. return nil, &googleapi.Error{
  7685. Code: res.StatusCode,
  7686. Header: res.Header,
  7687. }
  7688. }
  7689. if err != nil {
  7690. return nil, err
  7691. }
  7692. defer googleapi.CloseBody(res)
  7693. if err := googleapi.CheckResponse(res); err != nil {
  7694. return nil, err
  7695. }
  7696. ret := &ListCreativeStatusBreakdownByDetailResponse{
  7697. ServerResponse: googleapi.ServerResponse{
  7698. Header: res.Header,
  7699. HTTPStatusCode: res.StatusCode,
  7700. },
  7701. }
  7702. target := &ret
  7703. if err := gensupport.DecodeResponse(target, res); err != nil {
  7704. return nil, err
  7705. }
  7706. return ret, nil
  7707. // {
  7708. // "description": "List all details associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each detail.",
  7709. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details",
  7710. // "httpMethod": "GET",
  7711. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list",
  7712. // "parameterOrder": [
  7713. // "filterSetName",
  7714. // "creativeStatusId"
  7715. // ],
  7716. // "parameters": {
  7717. // "creativeStatusId": {
  7718. // "description": "The ID of the creative status for which to retrieve a breakdown by detail.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).\nDetails are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87.",
  7719. // "format": "int32",
  7720. // "location": "path",
  7721. // "required": true,
  7722. // "type": "integer"
  7723. // },
  7724. // "filterSetName": {
  7725. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  7726. // "location": "path",
  7727. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  7728. // "required": true,
  7729. // "type": "string"
  7730. // },
  7731. // "pageSize": {
  7732. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  7733. // "format": "int32",
  7734. // "location": "query",
  7735. // "type": "integer"
  7736. // },
  7737. // "pageToken": {
  7738. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByDetailResponse.nextPageToken\nreturned from the previous call to the filteredBids.details.list\nmethod.",
  7739. // "location": "query",
  7740. // "type": "string"
  7741. // }
  7742. // },
  7743. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details",
  7744. // "response": {
  7745. // "$ref": "ListCreativeStatusBreakdownByDetailResponse"
  7746. // },
  7747. // "scopes": [
  7748. // "https://www.googleapis.com/auth/adexchange.buyer"
  7749. // ]
  7750. // }
  7751. }
  7752. // Pages invokes f for each page of results.
  7753. // A non-nil error returned from f will halt the iteration.
  7754. // The provided context supersedes any context provided to the Context method.
  7755. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByDetailResponse) error) error {
  7756. c.ctx_ = ctx
  7757. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7758. for {
  7759. x, err := c.Do()
  7760. if err != nil {
  7761. return err
  7762. }
  7763. if err := f(x); err != nil {
  7764. return err
  7765. }
  7766. if x.NextPageToken == "" {
  7767. return nil
  7768. }
  7769. c.PageToken(x.NextPageToken)
  7770. }
  7771. }
  7772. // method id "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list":
  7773. type BiddersAccountsFilterSetsImpressionMetricsListCall struct {
  7774. s *Service
  7775. filterSetName string
  7776. urlParams_ gensupport.URLParams
  7777. ifNoneMatch_ string
  7778. ctx_ context.Context
  7779. header_ http.Header
  7780. }
  7781. // List: Lists all metrics that are measured in terms of number of
  7782. // impressions.
  7783. func (r *BiddersAccountsFilterSetsImpressionMetricsService) List(filterSetName string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7784. c := &BiddersAccountsFilterSetsImpressionMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7785. c.filterSetName = filterSetName
  7786. return c
  7787. }
  7788. // PageSize sets the optional parameter "pageSize": Requested page size.
  7789. // The server may return fewer results than requested.
  7790. // If unspecified, the server will pick an appropriate default.
  7791. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7792. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7793. return c
  7794. }
  7795. // PageToken sets the optional parameter "pageToken": A token
  7796. // identifying a page of results the server should return.
  7797. // Typically, this is the value
  7798. // of
  7799. // ListImpressionMetricsResponse.nextPageToken
  7800. // returned from the previous call to the impressionMetrics.list
  7801. // method.
  7802. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7803. c.urlParams_.Set("pageToken", pageToken)
  7804. return c
  7805. }
  7806. // Fields allows partial responses to be retrieved. See
  7807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7808. // for more information.
  7809. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7811. return c
  7812. }
  7813. // IfNoneMatch sets the optional parameter which makes the operation
  7814. // fail if the object's ETag matches the given value. This is useful for
  7815. // getting updates only after the object has changed since the last
  7816. // request. Use googleapi.IsNotModified to check whether the response
  7817. // error from Do is the result of In-None-Match.
  7818. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7819. c.ifNoneMatch_ = entityTag
  7820. return c
  7821. }
  7822. // Context sets the context to be used in this call's Do method. Any
  7823. // pending HTTP request will be aborted if the provided context is
  7824. // canceled.
  7825. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  7826. c.ctx_ = ctx
  7827. return c
  7828. }
  7829. // Header returns an http.Header that can be modified by the caller to
  7830. // add HTTP headers to the request.
  7831. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Header() http.Header {
  7832. if c.header_ == nil {
  7833. c.header_ = make(http.Header)
  7834. }
  7835. return c.header_
  7836. }
  7837. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) doRequest(alt string) (*http.Response, error) {
  7838. reqHeaders := make(http.Header)
  7839. for k, v := range c.header_ {
  7840. reqHeaders[k] = v
  7841. }
  7842. reqHeaders.Set("User-Agent", c.s.userAgent())
  7843. if c.ifNoneMatch_ != "" {
  7844. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7845. }
  7846. var body io.Reader = nil
  7847. c.urlParams_.Set("alt", alt)
  7848. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics")
  7849. urls += "?" + c.urlParams_.Encode()
  7850. req, _ := http.NewRequest("GET", urls, body)
  7851. req.Header = reqHeaders
  7852. googleapi.Expand(req.URL, map[string]string{
  7853. "filterSetName": c.filterSetName,
  7854. })
  7855. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7856. }
  7857. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list" call.
  7858. // Exactly one of *ListImpressionMetricsResponse or error will be
  7859. // non-nil. Any non-2xx status code is an error. Response headers are in
  7860. // either *ListImpressionMetricsResponse.ServerResponse.Header or (if a
  7861. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7862. // googleapi.IsNotModified to check whether the returned error was
  7863. // because http.StatusNotModified was returned.
  7864. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Do(opts ...googleapi.CallOption) (*ListImpressionMetricsResponse, error) {
  7865. gensupport.SetOptions(c.urlParams_, opts...)
  7866. res, err := c.doRequest("json")
  7867. if res != nil && res.StatusCode == http.StatusNotModified {
  7868. if res.Body != nil {
  7869. res.Body.Close()
  7870. }
  7871. return nil, &googleapi.Error{
  7872. Code: res.StatusCode,
  7873. Header: res.Header,
  7874. }
  7875. }
  7876. if err != nil {
  7877. return nil, err
  7878. }
  7879. defer googleapi.CloseBody(res)
  7880. if err := googleapi.CheckResponse(res); err != nil {
  7881. return nil, err
  7882. }
  7883. ret := &ListImpressionMetricsResponse{
  7884. ServerResponse: googleapi.ServerResponse{
  7885. Header: res.Header,
  7886. HTTPStatusCode: res.StatusCode,
  7887. },
  7888. }
  7889. target := &ret
  7890. if err := gensupport.DecodeResponse(target, res); err != nil {
  7891. return nil, err
  7892. }
  7893. return ret, nil
  7894. // {
  7895. // "description": "Lists all metrics that are measured in terms of number of impressions.",
  7896. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/impressionMetrics",
  7897. // "httpMethod": "GET",
  7898. // "id": "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list",
  7899. // "parameterOrder": [
  7900. // "filterSetName"
  7901. // ],
  7902. // "parameters": {
  7903. // "filterSetName": {
  7904. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  7905. // "location": "path",
  7906. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  7907. // "required": true,
  7908. // "type": "string"
  7909. // },
  7910. // "pageSize": {
  7911. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  7912. // "format": "int32",
  7913. // "location": "query",
  7914. // "type": "integer"
  7915. // },
  7916. // "pageToken": {
  7917. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListImpressionMetricsResponse.nextPageToken\nreturned from the previous call to the impressionMetrics.list\nmethod.",
  7918. // "location": "query",
  7919. // "type": "string"
  7920. // }
  7921. // },
  7922. // "path": "v2beta1/{+filterSetName}/impressionMetrics",
  7923. // "response": {
  7924. // "$ref": "ListImpressionMetricsResponse"
  7925. // },
  7926. // "scopes": [
  7927. // "https://www.googleapis.com/auth/adexchange.buyer"
  7928. // ]
  7929. // }
  7930. }
  7931. // Pages invokes f for each page of results.
  7932. // A non-nil error returned from f will halt the iteration.
  7933. // The provided context supersedes any context provided to the Context method.
  7934. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Pages(ctx context.Context, f func(*ListImpressionMetricsResponse) error) error {
  7935. c.ctx_ = ctx
  7936. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7937. for {
  7938. x, err := c.Do()
  7939. if err != nil {
  7940. return err
  7941. }
  7942. if err := f(x); err != nil {
  7943. return err
  7944. }
  7945. if x.NextPageToken == "" {
  7946. return nil
  7947. }
  7948. c.PageToken(x.NextPageToken)
  7949. }
  7950. }
  7951. // method id "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list":
  7952. type BiddersAccountsFilterSetsLosingBidsListCall struct {
  7953. s *Service
  7954. filterSetName string
  7955. urlParams_ gensupport.URLParams
  7956. ifNoneMatch_ string
  7957. ctx_ context.Context
  7958. header_ http.Header
  7959. }
  7960. // List: List all reasons for which bids lost in the auction, with the
  7961. // number of
  7962. // bids that lost for each reason.
  7963. func (r *BiddersAccountsFilterSetsLosingBidsService) List(filterSetName string) *BiddersAccountsFilterSetsLosingBidsListCall {
  7964. c := &BiddersAccountsFilterSetsLosingBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7965. c.filterSetName = filterSetName
  7966. return c
  7967. }
  7968. // PageSize sets the optional parameter "pageSize": Requested page size.
  7969. // The server may return fewer results than requested.
  7970. // If unspecified, the server will pick an appropriate default.
  7971. func (c *BiddersAccountsFilterSetsLosingBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsLosingBidsListCall {
  7972. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7973. return c
  7974. }
  7975. // PageToken sets the optional parameter "pageToken": A token
  7976. // identifying a page of results the server should return.
  7977. // Typically, this is the value
  7978. // of
  7979. // ListLosingBidsResponse.nextPageToken
  7980. // returned from the previous call to the losingBids.list
  7981. // method.
  7982. func (c *BiddersAccountsFilterSetsLosingBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsLosingBidsListCall {
  7983. c.urlParams_.Set("pageToken", pageToken)
  7984. return c
  7985. }
  7986. // Fields allows partial responses to be retrieved. See
  7987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7988. // for more information.
  7989. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsLosingBidsListCall {
  7990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7991. return c
  7992. }
  7993. // IfNoneMatch sets the optional parameter which makes the operation
  7994. // fail if the object's ETag matches the given value. This is useful for
  7995. // getting updates only after the object has changed since the last
  7996. // request. Use googleapi.IsNotModified to check whether the response
  7997. // error from Do is the result of In-None-Match.
  7998. func (c *BiddersAccountsFilterSetsLosingBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsLosingBidsListCall {
  7999. c.ifNoneMatch_ = entityTag
  8000. return c
  8001. }
  8002. // Context sets the context to be used in this call's Do method. Any
  8003. // pending HTTP request will be aborted if the provided context is
  8004. // canceled.
  8005. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsLosingBidsListCall {
  8006. c.ctx_ = ctx
  8007. return c
  8008. }
  8009. // Header returns an http.Header that can be modified by the caller to
  8010. // add HTTP headers to the request.
  8011. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Header() http.Header {
  8012. if c.header_ == nil {
  8013. c.header_ = make(http.Header)
  8014. }
  8015. return c.header_
  8016. }
  8017. func (c *BiddersAccountsFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Response, error) {
  8018. reqHeaders := make(http.Header)
  8019. for k, v := range c.header_ {
  8020. reqHeaders[k] = v
  8021. }
  8022. reqHeaders.Set("User-Agent", c.s.userAgent())
  8023. if c.ifNoneMatch_ != "" {
  8024. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8025. }
  8026. var body io.Reader = nil
  8027. c.urlParams_.Set("alt", alt)
  8028. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids")
  8029. urls += "?" + c.urlParams_.Encode()
  8030. req, _ := http.NewRequest("GET", urls, body)
  8031. req.Header = reqHeaders
  8032. googleapi.Expand(req.URL, map[string]string{
  8033. "filterSetName": c.filterSetName,
  8034. })
  8035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8036. }
  8037. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list" call.
  8038. // Exactly one of *ListLosingBidsResponse or error will be non-nil. Any
  8039. // non-2xx status code is an error. Response headers are in either
  8040. // *ListLosingBidsResponse.ServerResponse.Header or (if a response was
  8041. // returned at all) in error.(*googleapi.Error).Header. Use
  8042. // googleapi.IsNotModified to check whether the returned error was
  8043. // because http.StatusNotModified was returned.
  8044. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Do(opts ...googleapi.CallOption) (*ListLosingBidsResponse, error) {
  8045. gensupport.SetOptions(c.urlParams_, opts...)
  8046. res, err := c.doRequest("json")
  8047. if res != nil && res.StatusCode == http.StatusNotModified {
  8048. if res.Body != nil {
  8049. res.Body.Close()
  8050. }
  8051. return nil, &googleapi.Error{
  8052. Code: res.StatusCode,
  8053. Header: res.Header,
  8054. }
  8055. }
  8056. if err != nil {
  8057. return nil, err
  8058. }
  8059. defer googleapi.CloseBody(res)
  8060. if err := googleapi.CheckResponse(res); err != nil {
  8061. return nil, err
  8062. }
  8063. ret := &ListLosingBidsResponse{
  8064. ServerResponse: googleapi.ServerResponse{
  8065. Header: res.Header,
  8066. HTTPStatusCode: res.StatusCode,
  8067. },
  8068. }
  8069. target := &ret
  8070. if err := gensupport.DecodeResponse(target, res); err != nil {
  8071. return nil, err
  8072. }
  8073. return ret, nil
  8074. // {
  8075. // "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.",
  8076. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/losingBids",
  8077. // "httpMethod": "GET",
  8078. // "id": "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list",
  8079. // "parameterOrder": [
  8080. // "filterSetName"
  8081. // ],
  8082. // "parameters": {
  8083. // "filterSetName": {
  8084. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  8085. // "location": "path",
  8086. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  8087. // "required": true,
  8088. // "type": "string"
  8089. // },
  8090. // "pageSize": {
  8091. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  8092. // "format": "int32",
  8093. // "location": "query",
  8094. // "type": "integer"
  8095. // },
  8096. // "pageToken": {
  8097. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListLosingBidsResponse.nextPageToken\nreturned from the previous call to the losingBids.list\nmethod.",
  8098. // "location": "query",
  8099. // "type": "string"
  8100. // }
  8101. // },
  8102. // "path": "v2beta1/{+filterSetName}/losingBids",
  8103. // "response": {
  8104. // "$ref": "ListLosingBidsResponse"
  8105. // },
  8106. // "scopes": [
  8107. // "https://www.googleapis.com/auth/adexchange.buyer"
  8108. // ]
  8109. // }
  8110. }
  8111. // Pages invokes f for each page of results.
  8112. // A non-nil error returned from f will halt the iteration.
  8113. // The provided context supersedes any context provided to the Context method.
  8114. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Pages(ctx context.Context, f func(*ListLosingBidsResponse) error) error {
  8115. c.ctx_ = ctx
  8116. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8117. for {
  8118. x, err := c.Do()
  8119. if err != nil {
  8120. return err
  8121. }
  8122. if err := f(x); err != nil {
  8123. return err
  8124. }
  8125. if x.NextPageToken == "" {
  8126. return nil
  8127. }
  8128. c.PageToken(x.NextPageToken)
  8129. }
  8130. }
  8131. // method id "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list":
  8132. type BiddersAccountsFilterSetsNonBillableWinningBidsListCall struct {
  8133. s *Service
  8134. filterSetName string
  8135. urlParams_ gensupport.URLParams
  8136. ifNoneMatch_ string
  8137. ctx_ context.Context
  8138. header_ http.Header
  8139. }
  8140. // List: List all reasons for which winning bids were not billable, with
  8141. // the number
  8142. // of bids not billed for each reason.
  8143. func (r *BiddersAccountsFilterSetsNonBillableWinningBidsService) List(filterSetName string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8144. c := &BiddersAccountsFilterSetsNonBillableWinningBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8145. c.filterSetName = filterSetName
  8146. return c
  8147. }
  8148. // PageSize sets the optional parameter "pageSize": Requested page size.
  8149. // The server may return fewer results than requested.
  8150. // If unspecified, the server will pick an appropriate default.
  8151. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8152. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8153. return c
  8154. }
  8155. // PageToken sets the optional parameter "pageToken": A token
  8156. // identifying a page of results the server should return.
  8157. // Typically, this is the value
  8158. // of
  8159. // ListNonBillableWinningBidsResponse.nextPageToken
  8160. // returned from the previous call to the
  8161. // nonBillableWinningBids.list
  8162. // method.
  8163. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8164. c.urlParams_.Set("pageToken", pageToken)
  8165. return c
  8166. }
  8167. // Fields allows partial responses to be retrieved. See
  8168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8169. // for more information.
  8170. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8172. return c
  8173. }
  8174. // IfNoneMatch sets the optional parameter which makes the operation
  8175. // fail if the object's ETag matches the given value. This is useful for
  8176. // getting updates only after the object has changed since the last
  8177. // request. Use googleapi.IsNotModified to check whether the response
  8178. // error from Do is the result of In-None-Match.
  8179. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8180. c.ifNoneMatch_ = entityTag
  8181. return c
  8182. }
  8183. // Context sets the context to be used in this call's Do method. Any
  8184. // pending HTTP request will be aborted if the provided context is
  8185. // canceled.
  8186. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  8187. c.ctx_ = ctx
  8188. return c
  8189. }
  8190. // Header returns an http.Header that can be modified by the caller to
  8191. // add HTTP headers to the request.
  8192. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Header() http.Header {
  8193. if c.header_ == nil {
  8194. c.header_ = make(http.Header)
  8195. }
  8196. return c.header_
  8197. }
  8198. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) (*http.Response, error) {
  8199. reqHeaders := make(http.Header)
  8200. for k, v := range c.header_ {
  8201. reqHeaders[k] = v
  8202. }
  8203. reqHeaders.Set("User-Agent", c.s.userAgent())
  8204. if c.ifNoneMatch_ != "" {
  8205. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8206. }
  8207. var body io.Reader = nil
  8208. c.urlParams_.Set("alt", alt)
  8209. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids")
  8210. urls += "?" + c.urlParams_.Encode()
  8211. req, _ := http.NewRequest("GET", urls, body)
  8212. req.Header = reqHeaders
  8213. googleapi.Expand(req.URL, map[string]string{
  8214. "filterSetName": c.filterSetName,
  8215. })
  8216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8217. }
  8218. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list" call.
  8219. // Exactly one of *ListNonBillableWinningBidsResponse or error will be
  8220. // non-nil. Any non-2xx status code is an error. Response headers are in
  8221. // either *ListNonBillableWinningBidsResponse.ServerResponse.Header or
  8222. // (if a response was returned at all) in
  8223. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8224. // whether the returned error was because http.StatusNotModified was
  8225. // returned.
  8226. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Do(opts ...googleapi.CallOption) (*ListNonBillableWinningBidsResponse, error) {
  8227. gensupport.SetOptions(c.urlParams_, opts...)
  8228. res, err := c.doRequest("json")
  8229. if res != nil && res.StatusCode == http.StatusNotModified {
  8230. if res.Body != nil {
  8231. res.Body.Close()
  8232. }
  8233. return nil, &googleapi.Error{
  8234. Code: res.StatusCode,
  8235. Header: res.Header,
  8236. }
  8237. }
  8238. if err != nil {
  8239. return nil, err
  8240. }
  8241. defer googleapi.CloseBody(res)
  8242. if err := googleapi.CheckResponse(res); err != nil {
  8243. return nil, err
  8244. }
  8245. ret := &ListNonBillableWinningBidsResponse{
  8246. ServerResponse: googleapi.ServerResponse{
  8247. Header: res.Header,
  8248. HTTPStatusCode: res.StatusCode,
  8249. },
  8250. }
  8251. target := &ret
  8252. if err := gensupport.DecodeResponse(target, res); err != nil {
  8253. return nil, err
  8254. }
  8255. return ret, nil
  8256. // {
  8257. // "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.",
  8258. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/nonBillableWinningBids",
  8259. // "httpMethod": "GET",
  8260. // "id": "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list",
  8261. // "parameterOrder": [
  8262. // "filterSetName"
  8263. // ],
  8264. // "parameters": {
  8265. // "filterSetName": {
  8266. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  8267. // "location": "path",
  8268. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  8269. // "required": true,
  8270. // "type": "string"
  8271. // },
  8272. // "pageSize": {
  8273. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  8274. // "format": "int32",
  8275. // "location": "query",
  8276. // "type": "integer"
  8277. // },
  8278. // "pageToken": {
  8279. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListNonBillableWinningBidsResponse.nextPageToken\nreturned from the previous call to the nonBillableWinningBids.list\nmethod.",
  8280. // "location": "query",
  8281. // "type": "string"
  8282. // }
  8283. // },
  8284. // "path": "v2beta1/{+filterSetName}/nonBillableWinningBids",
  8285. // "response": {
  8286. // "$ref": "ListNonBillableWinningBidsResponse"
  8287. // },
  8288. // "scopes": [
  8289. // "https://www.googleapis.com/auth/adexchange.buyer"
  8290. // ]
  8291. // }
  8292. }
  8293. // Pages invokes f for each page of results.
  8294. // A non-nil error returned from f will halt the iteration.
  8295. // The provided context supersedes any context provided to the Context method.
  8296. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Pages(ctx context.Context, f func(*ListNonBillableWinningBidsResponse) error) error {
  8297. c.ctx_ = ctx
  8298. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8299. for {
  8300. x, err := c.Do()
  8301. if err != nil {
  8302. return err
  8303. }
  8304. if err := f(x); err != nil {
  8305. return err
  8306. }
  8307. if x.NextPageToken == "" {
  8308. return nil
  8309. }
  8310. c.PageToken(x.NextPageToken)
  8311. }
  8312. }
  8313. // method id "adexchangebuyer2.bidders.filterSets.create":
  8314. type BiddersFilterSetsCreateCall struct {
  8315. s *Service
  8316. ownerName string
  8317. filterset *FilterSet
  8318. urlParams_ gensupport.URLParams
  8319. ctx_ context.Context
  8320. header_ http.Header
  8321. }
  8322. // Create: Creates the specified filter set for the account with the
  8323. // given account ID.
  8324. func (r *BiddersFilterSetsService) Create(ownerName string, filterset *FilterSet) *BiddersFilterSetsCreateCall {
  8325. c := &BiddersFilterSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8326. c.ownerName = ownerName
  8327. c.filterset = filterset
  8328. return c
  8329. }
  8330. // IsTransient sets the optional parameter "isTransient": Whether the
  8331. // filter set is transient, or should be persisted indefinitely.
  8332. // By default, filter sets are not transient.
  8333. // If transient, it will be available for at least 1 hour after
  8334. // creation.
  8335. func (c *BiddersFilterSetsCreateCall) IsTransient(isTransient bool) *BiddersFilterSetsCreateCall {
  8336. c.urlParams_.Set("isTransient", fmt.Sprint(isTransient))
  8337. return c
  8338. }
  8339. // Fields allows partial responses to be retrieved. See
  8340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8341. // for more information.
  8342. func (c *BiddersFilterSetsCreateCall) Fields(s ...googleapi.Field) *BiddersFilterSetsCreateCall {
  8343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8344. return c
  8345. }
  8346. // Context sets the context to be used in this call's Do method. Any
  8347. // pending HTTP request will be aborted if the provided context is
  8348. // canceled.
  8349. func (c *BiddersFilterSetsCreateCall) Context(ctx context.Context) *BiddersFilterSetsCreateCall {
  8350. c.ctx_ = ctx
  8351. return c
  8352. }
  8353. // Header returns an http.Header that can be modified by the caller to
  8354. // add HTTP headers to the request.
  8355. func (c *BiddersFilterSetsCreateCall) Header() http.Header {
  8356. if c.header_ == nil {
  8357. c.header_ = make(http.Header)
  8358. }
  8359. return c.header_
  8360. }
  8361. func (c *BiddersFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) {
  8362. reqHeaders := make(http.Header)
  8363. for k, v := range c.header_ {
  8364. reqHeaders[k] = v
  8365. }
  8366. reqHeaders.Set("User-Agent", c.s.userAgent())
  8367. var body io.Reader = nil
  8368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset)
  8369. if err != nil {
  8370. return nil, err
  8371. }
  8372. reqHeaders.Set("Content-Type", "application/json")
  8373. c.urlParams_.Set("alt", alt)
  8374. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  8375. urls += "?" + c.urlParams_.Encode()
  8376. req, _ := http.NewRequest("POST", urls, body)
  8377. req.Header = reqHeaders
  8378. googleapi.Expand(req.URL, map[string]string{
  8379. "ownerName": c.ownerName,
  8380. })
  8381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8382. }
  8383. // Do executes the "adexchangebuyer2.bidders.filterSets.create" call.
  8384. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  8385. // status code is an error. Response headers are in either
  8386. // *FilterSet.ServerResponse.Header or (if a response was returned at
  8387. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8388. // to check whether the returned error was because
  8389. // http.StatusNotModified was returned.
  8390. func (c *BiddersFilterSetsCreateCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  8391. gensupport.SetOptions(c.urlParams_, opts...)
  8392. res, err := c.doRequest("json")
  8393. if res != nil && res.StatusCode == http.StatusNotModified {
  8394. if res.Body != nil {
  8395. res.Body.Close()
  8396. }
  8397. return nil, &googleapi.Error{
  8398. Code: res.StatusCode,
  8399. Header: res.Header,
  8400. }
  8401. }
  8402. if err != nil {
  8403. return nil, err
  8404. }
  8405. defer googleapi.CloseBody(res)
  8406. if err := googleapi.CheckResponse(res); err != nil {
  8407. return nil, err
  8408. }
  8409. ret := &FilterSet{
  8410. ServerResponse: googleapi.ServerResponse{
  8411. Header: res.Header,
  8412. HTTPStatusCode: res.StatusCode,
  8413. },
  8414. }
  8415. target := &ret
  8416. if err := gensupport.DecodeResponse(target, res); err != nil {
  8417. return nil, err
  8418. }
  8419. return ret, nil
  8420. // {
  8421. // "description": "Creates the specified filter set for the account with the given account ID.",
  8422. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets",
  8423. // "httpMethod": "POST",
  8424. // "id": "adexchangebuyer2.bidders.filterSets.create",
  8425. // "parameterOrder": [
  8426. // "ownerName"
  8427. // ],
  8428. // "parameters": {
  8429. // "isTransient": {
  8430. // "description": "Whether the filter set is transient, or should be persisted indefinitely.\nBy default, filter sets are not transient.\nIf transient, it will be available for at least 1 hour after creation.",
  8431. // "location": "query",
  8432. // "type": "boolean"
  8433. // },
  8434. // "ownerName": {
  8435. // "description": "Name of the owner (bidder or account) of the filter set to be created.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`",
  8436. // "location": "path",
  8437. // "pattern": "^bidders/[^/]+$",
  8438. // "required": true,
  8439. // "type": "string"
  8440. // }
  8441. // },
  8442. // "path": "v2beta1/{+ownerName}/filterSets",
  8443. // "request": {
  8444. // "$ref": "FilterSet"
  8445. // },
  8446. // "response": {
  8447. // "$ref": "FilterSet"
  8448. // },
  8449. // "scopes": [
  8450. // "https://www.googleapis.com/auth/adexchange.buyer"
  8451. // ]
  8452. // }
  8453. }
  8454. // method id "adexchangebuyer2.bidders.filterSets.delete":
  8455. type BiddersFilterSetsDeleteCall struct {
  8456. s *Service
  8457. name string
  8458. urlParams_ gensupport.URLParams
  8459. ctx_ context.Context
  8460. header_ http.Header
  8461. }
  8462. // Delete: Deletes the requested filter set from the account with the
  8463. // given account
  8464. // ID.
  8465. func (r *BiddersFilterSetsService) Delete(name string) *BiddersFilterSetsDeleteCall {
  8466. c := &BiddersFilterSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8467. c.name = name
  8468. return c
  8469. }
  8470. // Fields allows partial responses to be retrieved. See
  8471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8472. // for more information.
  8473. func (c *BiddersFilterSetsDeleteCall) Fields(s ...googleapi.Field) *BiddersFilterSetsDeleteCall {
  8474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8475. return c
  8476. }
  8477. // Context sets the context to be used in this call's Do method. Any
  8478. // pending HTTP request will be aborted if the provided context is
  8479. // canceled.
  8480. func (c *BiddersFilterSetsDeleteCall) Context(ctx context.Context) *BiddersFilterSetsDeleteCall {
  8481. c.ctx_ = ctx
  8482. return c
  8483. }
  8484. // Header returns an http.Header that can be modified by the caller to
  8485. // add HTTP headers to the request.
  8486. func (c *BiddersFilterSetsDeleteCall) Header() http.Header {
  8487. if c.header_ == nil {
  8488. c.header_ = make(http.Header)
  8489. }
  8490. return c.header_
  8491. }
  8492. func (c *BiddersFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8493. reqHeaders := make(http.Header)
  8494. for k, v := range c.header_ {
  8495. reqHeaders[k] = v
  8496. }
  8497. reqHeaders.Set("User-Agent", c.s.userAgent())
  8498. var body io.Reader = nil
  8499. c.urlParams_.Set("alt", alt)
  8500. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8501. urls += "?" + c.urlParams_.Encode()
  8502. req, _ := http.NewRequest("DELETE", urls, body)
  8503. req.Header = reqHeaders
  8504. googleapi.Expand(req.URL, map[string]string{
  8505. "name": c.name,
  8506. })
  8507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8508. }
  8509. // Do executes the "adexchangebuyer2.bidders.filterSets.delete" call.
  8510. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  8511. // code is an error. Response headers are in either
  8512. // *Empty.ServerResponse.Header or (if a response was returned at all)
  8513. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8514. // check whether the returned error was because http.StatusNotModified
  8515. // was returned.
  8516. func (c *BiddersFilterSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8517. gensupport.SetOptions(c.urlParams_, opts...)
  8518. res, err := c.doRequest("json")
  8519. if res != nil && res.StatusCode == http.StatusNotModified {
  8520. if res.Body != nil {
  8521. res.Body.Close()
  8522. }
  8523. return nil, &googleapi.Error{
  8524. Code: res.StatusCode,
  8525. Header: res.Header,
  8526. }
  8527. }
  8528. if err != nil {
  8529. return nil, err
  8530. }
  8531. defer googleapi.CloseBody(res)
  8532. if err := googleapi.CheckResponse(res); err != nil {
  8533. return nil, err
  8534. }
  8535. ret := &Empty{
  8536. ServerResponse: googleapi.ServerResponse{
  8537. Header: res.Header,
  8538. HTTPStatusCode: res.StatusCode,
  8539. },
  8540. }
  8541. target := &ret
  8542. if err := gensupport.DecodeResponse(target, res); err != nil {
  8543. return nil, err
  8544. }
  8545. return ret, nil
  8546. // {
  8547. // "description": "Deletes the requested filter set from the account with the given account\nID.",
  8548. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}",
  8549. // "httpMethod": "DELETE",
  8550. // "id": "adexchangebuyer2.bidders.filterSets.delete",
  8551. // "parameterOrder": [
  8552. // "name"
  8553. // ],
  8554. // "parameters": {
  8555. // "name": {
  8556. // "description": "Full name of the resource to delete.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  8557. // "location": "path",
  8558. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  8559. // "required": true,
  8560. // "type": "string"
  8561. // }
  8562. // },
  8563. // "path": "v2beta1/{+name}",
  8564. // "response": {
  8565. // "$ref": "Empty"
  8566. // },
  8567. // "scopes": [
  8568. // "https://www.googleapis.com/auth/adexchange.buyer"
  8569. // ]
  8570. // }
  8571. }
  8572. // method id "adexchangebuyer2.bidders.filterSets.get":
  8573. type BiddersFilterSetsGetCall struct {
  8574. s *Service
  8575. name string
  8576. urlParams_ gensupport.URLParams
  8577. ifNoneMatch_ string
  8578. ctx_ context.Context
  8579. header_ http.Header
  8580. }
  8581. // Get: Retrieves the requested filter set for the account with the
  8582. // given account
  8583. // ID.
  8584. func (r *BiddersFilterSetsService) Get(name string) *BiddersFilterSetsGetCall {
  8585. c := &BiddersFilterSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8586. c.name = name
  8587. return c
  8588. }
  8589. // Fields allows partial responses to be retrieved. See
  8590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8591. // for more information.
  8592. func (c *BiddersFilterSetsGetCall) Fields(s ...googleapi.Field) *BiddersFilterSetsGetCall {
  8593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8594. return c
  8595. }
  8596. // IfNoneMatch sets the optional parameter which makes the operation
  8597. // fail if the object's ETag matches the given value. This is useful for
  8598. // getting updates only after the object has changed since the last
  8599. // request. Use googleapi.IsNotModified to check whether the response
  8600. // error from Do is the result of In-None-Match.
  8601. func (c *BiddersFilterSetsGetCall) IfNoneMatch(entityTag string) *BiddersFilterSetsGetCall {
  8602. c.ifNoneMatch_ = entityTag
  8603. return c
  8604. }
  8605. // Context sets the context to be used in this call's Do method. Any
  8606. // pending HTTP request will be aborted if the provided context is
  8607. // canceled.
  8608. func (c *BiddersFilterSetsGetCall) Context(ctx context.Context) *BiddersFilterSetsGetCall {
  8609. c.ctx_ = ctx
  8610. return c
  8611. }
  8612. // Header returns an http.Header that can be modified by the caller to
  8613. // add HTTP headers to the request.
  8614. func (c *BiddersFilterSetsGetCall) Header() http.Header {
  8615. if c.header_ == nil {
  8616. c.header_ = make(http.Header)
  8617. }
  8618. return c.header_
  8619. }
  8620. func (c *BiddersFilterSetsGetCall) doRequest(alt string) (*http.Response, error) {
  8621. reqHeaders := make(http.Header)
  8622. for k, v := range c.header_ {
  8623. reqHeaders[k] = v
  8624. }
  8625. reqHeaders.Set("User-Agent", c.s.userAgent())
  8626. if c.ifNoneMatch_ != "" {
  8627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8628. }
  8629. var body io.Reader = nil
  8630. c.urlParams_.Set("alt", alt)
  8631. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  8632. urls += "?" + c.urlParams_.Encode()
  8633. req, _ := http.NewRequest("GET", urls, body)
  8634. req.Header = reqHeaders
  8635. googleapi.Expand(req.URL, map[string]string{
  8636. "name": c.name,
  8637. })
  8638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8639. }
  8640. // Do executes the "adexchangebuyer2.bidders.filterSets.get" call.
  8641. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  8642. // status code is an error. Response headers are in either
  8643. // *FilterSet.ServerResponse.Header or (if a response was returned at
  8644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8645. // to check whether the returned error was because
  8646. // http.StatusNotModified was returned.
  8647. func (c *BiddersFilterSetsGetCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  8648. gensupport.SetOptions(c.urlParams_, opts...)
  8649. res, err := c.doRequest("json")
  8650. if res != nil && res.StatusCode == http.StatusNotModified {
  8651. if res.Body != nil {
  8652. res.Body.Close()
  8653. }
  8654. return nil, &googleapi.Error{
  8655. Code: res.StatusCode,
  8656. Header: res.Header,
  8657. }
  8658. }
  8659. if err != nil {
  8660. return nil, err
  8661. }
  8662. defer googleapi.CloseBody(res)
  8663. if err := googleapi.CheckResponse(res); err != nil {
  8664. return nil, err
  8665. }
  8666. ret := &FilterSet{
  8667. ServerResponse: googleapi.ServerResponse{
  8668. Header: res.Header,
  8669. HTTPStatusCode: res.StatusCode,
  8670. },
  8671. }
  8672. target := &ret
  8673. if err := gensupport.DecodeResponse(target, res); err != nil {
  8674. return nil, err
  8675. }
  8676. return ret, nil
  8677. // {
  8678. // "description": "Retrieves the requested filter set for the account with the given account\nID.",
  8679. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}",
  8680. // "httpMethod": "GET",
  8681. // "id": "adexchangebuyer2.bidders.filterSets.get",
  8682. // "parameterOrder": [
  8683. // "name"
  8684. // ],
  8685. // "parameters": {
  8686. // "name": {
  8687. // "description": "Full name of the resource being requested.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  8688. // "location": "path",
  8689. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  8690. // "required": true,
  8691. // "type": "string"
  8692. // }
  8693. // },
  8694. // "path": "v2beta1/{+name}",
  8695. // "response": {
  8696. // "$ref": "FilterSet"
  8697. // },
  8698. // "scopes": [
  8699. // "https://www.googleapis.com/auth/adexchange.buyer"
  8700. // ]
  8701. // }
  8702. }
  8703. // method id "adexchangebuyer2.bidders.filterSets.list":
  8704. type BiddersFilterSetsListCall struct {
  8705. s *Service
  8706. ownerName string
  8707. urlParams_ gensupport.URLParams
  8708. ifNoneMatch_ string
  8709. ctx_ context.Context
  8710. header_ http.Header
  8711. }
  8712. // List: Lists all filter sets for the account with the given account
  8713. // ID.
  8714. func (r *BiddersFilterSetsService) List(ownerName string) *BiddersFilterSetsListCall {
  8715. c := &BiddersFilterSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8716. c.ownerName = ownerName
  8717. return c
  8718. }
  8719. // PageSize sets the optional parameter "pageSize": Requested page size.
  8720. // The server may return fewer results than requested.
  8721. // If unspecified, the server will pick an appropriate default.
  8722. func (c *BiddersFilterSetsListCall) PageSize(pageSize int64) *BiddersFilterSetsListCall {
  8723. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8724. return c
  8725. }
  8726. // PageToken sets the optional parameter "pageToken": A token
  8727. // identifying a page of results the server should return.
  8728. // Typically, this is the value
  8729. // of
  8730. // ListFilterSetsResponse.nextPageToken
  8731. // returned from the previous call to
  8732. // the
  8733. // accounts.filterSets.list
  8734. // method.
  8735. func (c *BiddersFilterSetsListCall) PageToken(pageToken string) *BiddersFilterSetsListCall {
  8736. c.urlParams_.Set("pageToken", pageToken)
  8737. return c
  8738. }
  8739. // Fields allows partial responses to be retrieved. See
  8740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8741. // for more information.
  8742. func (c *BiddersFilterSetsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsListCall {
  8743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8744. return c
  8745. }
  8746. // IfNoneMatch sets the optional parameter which makes the operation
  8747. // fail if the object's ETag matches the given value. This is useful for
  8748. // getting updates only after the object has changed since the last
  8749. // request. Use googleapi.IsNotModified to check whether the response
  8750. // error from Do is the result of In-None-Match.
  8751. func (c *BiddersFilterSetsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsListCall {
  8752. c.ifNoneMatch_ = entityTag
  8753. return c
  8754. }
  8755. // Context sets the context to be used in this call's Do method. Any
  8756. // pending HTTP request will be aborted if the provided context is
  8757. // canceled.
  8758. func (c *BiddersFilterSetsListCall) Context(ctx context.Context) *BiddersFilterSetsListCall {
  8759. c.ctx_ = ctx
  8760. return c
  8761. }
  8762. // Header returns an http.Header that can be modified by the caller to
  8763. // add HTTP headers to the request.
  8764. func (c *BiddersFilterSetsListCall) Header() http.Header {
  8765. if c.header_ == nil {
  8766. c.header_ = make(http.Header)
  8767. }
  8768. return c.header_
  8769. }
  8770. func (c *BiddersFilterSetsListCall) doRequest(alt string) (*http.Response, error) {
  8771. reqHeaders := make(http.Header)
  8772. for k, v := range c.header_ {
  8773. reqHeaders[k] = v
  8774. }
  8775. reqHeaders.Set("User-Agent", c.s.userAgent())
  8776. if c.ifNoneMatch_ != "" {
  8777. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8778. }
  8779. var body io.Reader = nil
  8780. c.urlParams_.Set("alt", alt)
  8781. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  8782. urls += "?" + c.urlParams_.Encode()
  8783. req, _ := http.NewRequest("GET", urls, body)
  8784. req.Header = reqHeaders
  8785. googleapi.Expand(req.URL, map[string]string{
  8786. "ownerName": c.ownerName,
  8787. })
  8788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8789. }
  8790. // Do executes the "adexchangebuyer2.bidders.filterSets.list" call.
  8791. // Exactly one of *ListFilterSetsResponse or error will be non-nil. Any
  8792. // non-2xx status code is an error. Response headers are in either
  8793. // *ListFilterSetsResponse.ServerResponse.Header or (if a response was
  8794. // returned at all) in error.(*googleapi.Error).Header. Use
  8795. // googleapi.IsNotModified to check whether the returned error was
  8796. // because http.StatusNotModified was returned.
  8797. func (c *BiddersFilterSetsListCall) Do(opts ...googleapi.CallOption) (*ListFilterSetsResponse, error) {
  8798. gensupport.SetOptions(c.urlParams_, opts...)
  8799. res, err := c.doRequest("json")
  8800. if res != nil && res.StatusCode == http.StatusNotModified {
  8801. if res.Body != nil {
  8802. res.Body.Close()
  8803. }
  8804. return nil, &googleapi.Error{
  8805. Code: res.StatusCode,
  8806. Header: res.Header,
  8807. }
  8808. }
  8809. if err != nil {
  8810. return nil, err
  8811. }
  8812. defer googleapi.CloseBody(res)
  8813. if err := googleapi.CheckResponse(res); err != nil {
  8814. return nil, err
  8815. }
  8816. ret := &ListFilterSetsResponse{
  8817. ServerResponse: googleapi.ServerResponse{
  8818. Header: res.Header,
  8819. HTTPStatusCode: res.StatusCode,
  8820. },
  8821. }
  8822. target := &ret
  8823. if err := gensupport.DecodeResponse(target, res); err != nil {
  8824. return nil, err
  8825. }
  8826. return ret, nil
  8827. // {
  8828. // "description": "Lists all filter sets for the account with the given account ID.",
  8829. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets",
  8830. // "httpMethod": "GET",
  8831. // "id": "adexchangebuyer2.bidders.filterSets.list",
  8832. // "parameterOrder": [
  8833. // "ownerName"
  8834. // ],
  8835. // "parameters": {
  8836. // "ownerName": {
  8837. // "description": "Name of the owner (bidder or account) of the filter sets to be listed.\nFor example:\n\n- For a bidder-level filter set for bidder 123: `bidders/123`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`",
  8838. // "location": "path",
  8839. // "pattern": "^bidders/[^/]+$",
  8840. // "required": true,
  8841. // "type": "string"
  8842. // },
  8843. // "pageSize": {
  8844. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  8845. // "format": "int32",
  8846. // "location": "query",
  8847. // "type": "integer"
  8848. // },
  8849. // "pageToken": {
  8850. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilterSetsResponse.nextPageToken\nreturned from the previous call to the\naccounts.filterSets.list\nmethod.",
  8851. // "location": "query",
  8852. // "type": "string"
  8853. // }
  8854. // },
  8855. // "path": "v2beta1/{+ownerName}/filterSets",
  8856. // "response": {
  8857. // "$ref": "ListFilterSetsResponse"
  8858. // },
  8859. // "scopes": [
  8860. // "https://www.googleapis.com/auth/adexchange.buyer"
  8861. // ]
  8862. // }
  8863. }
  8864. // Pages invokes f for each page of results.
  8865. // A non-nil error returned from f will halt the iteration.
  8866. // The provided context supersedes any context provided to the Context method.
  8867. func (c *BiddersFilterSetsListCall) Pages(ctx context.Context, f func(*ListFilterSetsResponse) error) error {
  8868. c.ctx_ = ctx
  8869. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8870. for {
  8871. x, err := c.Do()
  8872. if err != nil {
  8873. return err
  8874. }
  8875. if err := f(x); err != nil {
  8876. return err
  8877. }
  8878. if x.NextPageToken == "" {
  8879. return nil
  8880. }
  8881. c.PageToken(x.NextPageToken)
  8882. }
  8883. }
  8884. // method id "adexchangebuyer2.bidders.filterSets.bidMetrics.list":
  8885. type BiddersFilterSetsBidMetricsListCall struct {
  8886. s *Service
  8887. filterSetName string
  8888. urlParams_ gensupport.URLParams
  8889. ifNoneMatch_ string
  8890. ctx_ context.Context
  8891. header_ http.Header
  8892. }
  8893. // List: Lists all metrics that are measured in terms of number of bids.
  8894. func (r *BiddersFilterSetsBidMetricsService) List(filterSetName string) *BiddersFilterSetsBidMetricsListCall {
  8895. c := &BiddersFilterSetsBidMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8896. c.filterSetName = filterSetName
  8897. return c
  8898. }
  8899. // PageSize sets the optional parameter "pageSize": Requested page size.
  8900. // The server may return fewer results than requested.
  8901. // If unspecified, the server will pick an appropriate default.
  8902. func (c *BiddersFilterSetsBidMetricsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidMetricsListCall {
  8903. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8904. return c
  8905. }
  8906. // PageToken sets the optional parameter "pageToken": A token
  8907. // identifying a page of results the server should return.
  8908. // Typically, this is the value
  8909. // of
  8910. // ListBidMetricsResponse.nextPageToken
  8911. // returned from the previous call to the bidMetrics.list
  8912. // method.
  8913. func (c *BiddersFilterSetsBidMetricsListCall) PageToken(pageToken string) *BiddersFilterSetsBidMetricsListCall {
  8914. c.urlParams_.Set("pageToken", pageToken)
  8915. return c
  8916. }
  8917. // Fields allows partial responses to be retrieved. See
  8918. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8919. // for more information.
  8920. func (c *BiddersFilterSetsBidMetricsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidMetricsListCall {
  8921. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8922. return c
  8923. }
  8924. // IfNoneMatch sets the optional parameter which makes the operation
  8925. // fail if the object's ETag matches the given value. This is useful for
  8926. // getting updates only after the object has changed since the last
  8927. // request. Use googleapi.IsNotModified to check whether the response
  8928. // error from Do is the result of In-None-Match.
  8929. func (c *BiddersFilterSetsBidMetricsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidMetricsListCall {
  8930. c.ifNoneMatch_ = entityTag
  8931. return c
  8932. }
  8933. // Context sets the context to be used in this call's Do method. Any
  8934. // pending HTTP request will be aborted if the provided context is
  8935. // canceled.
  8936. func (c *BiddersFilterSetsBidMetricsListCall) Context(ctx context.Context) *BiddersFilterSetsBidMetricsListCall {
  8937. c.ctx_ = ctx
  8938. return c
  8939. }
  8940. // Header returns an http.Header that can be modified by the caller to
  8941. // add HTTP headers to the request.
  8942. func (c *BiddersFilterSetsBidMetricsListCall) Header() http.Header {
  8943. if c.header_ == nil {
  8944. c.header_ = make(http.Header)
  8945. }
  8946. return c.header_
  8947. }
  8948. func (c *BiddersFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Response, error) {
  8949. reqHeaders := make(http.Header)
  8950. for k, v := range c.header_ {
  8951. reqHeaders[k] = v
  8952. }
  8953. reqHeaders.Set("User-Agent", c.s.userAgent())
  8954. if c.ifNoneMatch_ != "" {
  8955. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8956. }
  8957. var body io.Reader = nil
  8958. c.urlParams_.Set("alt", alt)
  8959. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics")
  8960. urls += "?" + c.urlParams_.Encode()
  8961. req, _ := http.NewRequest("GET", urls, body)
  8962. req.Header = reqHeaders
  8963. googleapi.Expand(req.URL, map[string]string{
  8964. "filterSetName": c.filterSetName,
  8965. })
  8966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8967. }
  8968. // Do executes the "adexchangebuyer2.bidders.filterSets.bidMetrics.list" call.
  8969. // Exactly one of *ListBidMetricsResponse or error will be non-nil. Any
  8970. // non-2xx status code is an error. Response headers are in either
  8971. // *ListBidMetricsResponse.ServerResponse.Header or (if a response was
  8972. // returned at all) in error.(*googleapi.Error).Header. Use
  8973. // googleapi.IsNotModified to check whether the returned error was
  8974. // because http.StatusNotModified was returned.
  8975. func (c *BiddersFilterSetsBidMetricsListCall) Do(opts ...googleapi.CallOption) (*ListBidMetricsResponse, error) {
  8976. gensupport.SetOptions(c.urlParams_, opts...)
  8977. res, err := c.doRequest("json")
  8978. if res != nil && res.StatusCode == http.StatusNotModified {
  8979. if res.Body != nil {
  8980. res.Body.Close()
  8981. }
  8982. return nil, &googleapi.Error{
  8983. Code: res.StatusCode,
  8984. Header: res.Header,
  8985. }
  8986. }
  8987. if err != nil {
  8988. return nil, err
  8989. }
  8990. defer googleapi.CloseBody(res)
  8991. if err := googleapi.CheckResponse(res); err != nil {
  8992. return nil, err
  8993. }
  8994. ret := &ListBidMetricsResponse{
  8995. ServerResponse: googleapi.ServerResponse{
  8996. Header: res.Header,
  8997. HTTPStatusCode: res.StatusCode,
  8998. },
  8999. }
  9000. target := &ret
  9001. if err := gensupport.DecodeResponse(target, res); err != nil {
  9002. return nil, err
  9003. }
  9004. return ret, nil
  9005. // {
  9006. // "description": "Lists all metrics that are measured in terms of number of bids.",
  9007. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidMetrics",
  9008. // "httpMethod": "GET",
  9009. // "id": "adexchangebuyer2.bidders.filterSets.bidMetrics.list",
  9010. // "parameterOrder": [
  9011. // "filterSetName"
  9012. // ],
  9013. // "parameters": {
  9014. // "filterSetName": {
  9015. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9016. // "location": "path",
  9017. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9018. // "required": true,
  9019. // "type": "string"
  9020. // },
  9021. // "pageSize": {
  9022. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9023. // "format": "int32",
  9024. // "location": "query",
  9025. // "type": "integer"
  9026. // },
  9027. // "pageToken": {
  9028. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidMetricsResponse.nextPageToken\nreturned from the previous call to the bidMetrics.list\nmethod.",
  9029. // "location": "query",
  9030. // "type": "string"
  9031. // }
  9032. // },
  9033. // "path": "v2beta1/{+filterSetName}/bidMetrics",
  9034. // "response": {
  9035. // "$ref": "ListBidMetricsResponse"
  9036. // },
  9037. // "scopes": [
  9038. // "https://www.googleapis.com/auth/adexchange.buyer"
  9039. // ]
  9040. // }
  9041. }
  9042. // Pages invokes f for each page of results.
  9043. // A non-nil error returned from f will halt the iteration.
  9044. // The provided context supersedes any context provided to the Context method.
  9045. func (c *BiddersFilterSetsBidMetricsListCall) Pages(ctx context.Context, f func(*ListBidMetricsResponse) error) error {
  9046. c.ctx_ = ctx
  9047. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9048. for {
  9049. x, err := c.Do()
  9050. if err != nil {
  9051. return err
  9052. }
  9053. if err := f(x); err != nil {
  9054. return err
  9055. }
  9056. if x.NextPageToken == "" {
  9057. return nil
  9058. }
  9059. c.PageToken(x.NextPageToken)
  9060. }
  9061. }
  9062. // method id "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list":
  9063. type BiddersFilterSetsBidResponseErrorsListCall struct {
  9064. s *Service
  9065. filterSetName string
  9066. urlParams_ gensupport.URLParams
  9067. ifNoneMatch_ string
  9068. ctx_ context.Context
  9069. header_ http.Header
  9070. }
  9071. // List: List all errors that occurred in bid responses, with the number
  9072. // of bid
  9073. // responses affected for each reason.
  9074. func (r *BiddersFilterSetsBidResponseErrorsService) List(filterSetName string) *BiddersFilterSetsBidResponseErrorsListCall {
  9075. c := &BiddersFilterSetsBidResponseErrorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9076. c.filterSetName = filterSetName
  9077. return c
  9078. }
  9079. // PageSize sets the optional parameter "pageSize": Requested page size.
  9080. // The server may return fewer results than requested.
  9081. // If unspecified, the server will pick an appropriate default.
  9082. func (c *BiddersFilterSetsBidResponseErrorsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidResponseErrorsListCall {
  9083. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9084. return c
  9085. }
  9086. // PageToken sets the optional parameter "pageToken": A token
  9087. // identifying a page of results the server should return.
  9088. // Typically, this is the value
  9089. // of
  9090. // ListBidResponseErrorsResponse.nextPageToken
  9091. // returned from the previous call to the bidResponseErrors.list
  9092. // method.
  9093. func (c *BiddersFilterSetsBidResponseErrorsListCall) PageToken(pageToken string) *BiddersFilterSetsBidResponseErrorsListCall {
  9094. c.urlParams_.Set("pageToken", pageToken)
  9095. return c
  9096. }
  9097. // Fields allows partial responses to be retrieved. See
  9098. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9099. // for more information.
  9100. func (c *BiddersFilterSetsBidResponseErrorsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidResponseErrorsListCall {
  9101. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9102. return c
  9103. }
  9104. // IfNoneMatch sets the optional parameter which makes the operation
  9105. // fail if the object's ETag matches the given value. This is useful for
  9106. // getting updates only after the object has changed since the last
  9107. // request. Use googleapi.IsNotModified to check whether the response
  9108. // error from Do is the result of In-None-Match.
  9109. func (c *BiddersFilterSetsBidResponseErrorsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidResponseErrorsListCall {
  9110. c.ifNoneMatch_ = entityTag
  9111. return c
  9112. }
  9113. // Context sets the context to be used in this call's Do method. Any
  9114. // pending HTTP request will be aborted if the provided context is
  9115. // canceled.
  9116. func (c *BiddersFilterSetsBidResponseErrorsListCall) Context(ctx context.Context) *BiddersFilterSetsBidResponseErrorsListCall {
  9117. c.ctx_ = ctx
  9118. return c
  9119. }
  9120. // Header returns an http.Header that can be modified by the caller to
  9121. // add HTTP headers to the request.
  9122. func (c *BiddersFilterSetsBidResponseErrorsListCall) Header() http.Header {
  9123. if c.header_ == nil {
  9124. c.header_ = make(http.Header)
  9125. }
  9126. return c.header_
  9127. }
  9128. func (c *BiddersFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*http.Response, error) {
  9129. reqHeaders := make(http.Header)
  9130. for k, v := range c.header_ {
  9131. reqHeaders[k] = v
  9132. }
  9133. reqHeaders.Set("User-Agent", c.s.userAgent())
  9134. if c.ifNoneMatch_ != "" {
  9135. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9136. }
  9137. var body io.Reader = nil
  9138. c.urlParams_.Set("alt", alt)
  9139. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors")
  9140. urls += "?" + c.urlParams_.Encode()
  9141. req, _ := http.NewRequest("GET", urls, body)
  9142. req.Header = reqHeaders
  9143. googleapi.Expand(req.URL, map[string]string{
  9144. "filterSetName": c.filterSetName,
  9145. })
  9146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9147. }
  9148. // Do executes the "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list" call.
  9149. // Exactly one of *ListBidResponseErrorsResponse or error will be
  9150. // non-nil. Any non-2xx status code is an error. Response headers are in
  9151. // either *ListBidResponseErrorsResponse.ServerResponse.Header or (if a
  9152. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9153. // googleapi.IsNotModified to check whether the returned error was
  9154. // because http.StatusNotModified was returned.
  9155. func (c *BiddersFilterSetsBidResponseErrorsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponseErrorsResponse, error) {
  9156. gensupport.SetOptions(c.urlParams_, opts...)
  9157. res, err := c.doRequest("json")
  9158. if res != nil && res.StatusCode == http.StatusNotModified {
  9159. if res.Body != nil {
  9160. res.Body.Close()
  9161. }
  9162. return nil, &googleapi.Error{
  9163. Code: res.StatusCode,
  9164. Header: res.Header,
  9165. }
  9166. }
  9167. if err != nil {
  9168. return nil, err
  9169. }
  9170. defer googleapi.CloseBody(res)
  9171. if err := googleapi.CheckResponse(res); err != nil {
  9172. return nil, err
  9173. }
  9174. ret := &ListBidResponseErrorsResponse{
  9175. ServerResponse: googleapi.ServerResponse{
  9176. Header: res.Header,
  9177. HTTPStatusCode: res.StatusCode,
  9178. },
  9179. }
  9180. target := &ret
  9181. if err := gensupport.DecodeResponse(target, res); err != nil {
  9182. return nil, err
  9183. }
  9184. return ret, nil
  9185. // {
  9186. // "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason.",
  9187. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponseErrors",
  9188. // "httpMethod": "GET",
  9189. // "id": "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list",
  9190. // "parameterOrder": [
  9191. // "filterSetName"
  9192. // ],
  9193. // "parameters": {
  9194. // "filterSetName": {
  9195. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9196. // "location": "path",
  9197. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9198. // "required": true,
  9199. // "type": "string"
  9200. // },
  9201. // "pageSize": {
  9202. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9203. // "format": "int32",
  9204. // "location": "query",
  9205. // "type": "integer"
  9206. // },
  9207. // "pageToken": {
  9208. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponseErrorsResponse.nextPageToken\nreturned from the previous call to the bidResponseErrors.list\nmethod.",
  9209. // "location": "query",
  9210. // "type": "string"
  9211. // }
  9212. // },
  9213. // "path": "v2beta1/{+filterSetName}/bidResponseErrors",
  9214. // "response": {
  9215. // "$ref": "ListBidResponseErrorsResponse"
  9216. // },
  9217. // "scopes": [
  9218. // "https://www.googleapis.com/auth/adexchange.buyer"
  9219. // ]
  9220. // }
  9221. }
  9222. // Pages invokes f for each page of results.
  9223. // A non-nil error returned from f will halt the iteration.
  9224. // The provided context supersedes any context provided to the Context method.
  9225. func (c *BiddersFilterSetsBidResponseErrorsListCall) Pages(ctx context.Context, f func(*ListBidResponseErrorsResponse) error) error {
  9226. c.ctx_ = ctx
  9227. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9228. for {
  9229. x, err := c.Do()
  9230. if err != nil {
  9231. return err
  9232. }
  9233. if err := f(x); err != nil {
  9234. return err
  9235. }
  9236. if x.NextPageToken == "" {
  9237. return nil
  9238. }
  9239. c.PageToken(x.NextPageToken)
  9240. }
  9241. }
  9242. // method id "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list":
  9243. type BiddersFilterSetsBidResponsesWithoutBidsListCall struct {
  9244. s *Service
  9245. filterSetName string
  9246. urlParams_ gensupport.URLParams
  9247. ifNoneMatch_ string
  9248. ctx_ context.Context
  9249. header_ http.Header
  9250. }
  9251. // List: List all reasons for which bid responses were considered to
  9252. // have no
  9253. // applicable bids, with the number of bid responses affected for each
  9254. // reason.
  9255. func (r *BiddersFilterSetsBidResponsesWithoutBidsService) List(filterSetName string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9256. c := &BiddersFilterSetsBidResponsesWithoutBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9257. c.filterSetName = filterSetName
  9258. return c
  9259. }
  9260. // PageSize sets the optional parameter "pageSize": Requested page size.
  9261. // The server may return fewer results than requested.
  9262. // If unspecified, the server will pick an appropriate default.
  9263. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9264. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9265. return c
  9266. }
  9267. // PageToken sets the optional parameter "pageToken": A token
  9268. // identifying a page of results the server should return.
  9269. // Typically, this is the value
  9270. // of
  9271. // ListBidResponsesWithoutBidsResponse.nextPageToken
  9272. // returned from the previous call to the
  9273. // bidResponsesWithoutBids.list
  9274. // method.
  9275. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) PageToken(pageToken string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9276. c.urlParams_.Set("pageToken", pageToken)
  9277. return c
  9278. }
  9279. // Fields allows partial responses to be retrieved. See
  9280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9281. // for more information.
  9282. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9284. return c
  9285. }
  9286. // IfNoneMatch sets the optional parameter which makes the operation
  9287. // fail if the object's ETag matches the given value. This is useful for
  9288. // getting updates only after the object has changed since the last
  9289. // request. Use googleapi.IsNotModified to check whether the response
  9290. // error from Do is the result of In-None-Match.
  9291. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9292. c.ifNoneMatch_ = entityTag
  9293. return c
  9294. }
  9295. // Context sets the context to be used in this call's Do method. Any
  9296. // pending HTTP request will be aborted if the provided context is
  9297. // canceled.
  9298. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Context(ctx context.Context) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  9299. c.ctx_ = ctx
  9300. return c
  9301. }
  9302. // Header returns an http.Header that can be modified by the caller to
  9303. // add HTTP headers to the request.
  9304. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Header() http.Header {
  9305. if c.header_ == nil {
  9306. c.header_ = make(http.Header)
  9307. }
  9308. return c.header_
  9309. }
  9310. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) (*http.Response, error) {
  9311. reqHeaders := make(http.Header)
  9312. for k, v := range c.header_ {
  9313. reqHeaders[k] = v
  9314. }
  9315. reqHeaders.Set("User-Agent", c.s.userAgent())
  9316. if c.ifNoneMatch_ != "" {
  9317. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9318. }
  9319. var body io.Reader = nil
  9320. c.urlParams_.Set("alt", alt)
  9321. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids")
  9322. urls += "?" + c.urlParams_.Encode()
  9323. req, _ := http.NewRequest("GET", urls, body)
  9324. req.Header = reqHeaders
  9325. googleapi.Expand(req.URL, map[string]string{
  9326. "filterSetName": c.filterSetName,
  9327. })
  9328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9329. }
  9330. // Do executes the "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list" call.
  9331. // Exactly one of *ListBidResponsesWithoutBidsResponse or error will be
  9332. // non-nil. Any non-2xx status code is an error. Response headers are in
  9333. // either *ListBidResponsesWithoutBidsResponse.ServerResponse.Header or
  9334. // (if a response was returned at all) in
  9335. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9336. // whether the returned error was because http.StatusNotModified was
  9337. // returned.
  9338. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponsesWithoutBidsResponse, error) {
  9339. gensupport.SetOptions(c.urlParams_, opts...)
  9340. res, err := c.doRequest("json")
  9341. if res != nil && res.StatusCode == http.StatusNotModified {
  9342. if res.Body != nil {
  9343. res.Body.Close()
  9344. }
  9345. return nil, &googleapi.Error{
  9346. Code: res.StatusCode,
  9347. Header: res.Header,
  9348. }
  9349. }
  9350. if err != nil {
  9351. return nil, err
  9352. }
  9353. defer googleapi.CloseBody(res)
  9354. if err := googleapi.CheckResponse(res); err != nil {
  9355. return nil, err
  9356. }
  9357. ret := &ListBidResponsesWithoutBidsResponse{
  9358. ServerResponse: googleapi.ServerResponse{
  9359. Header: res.Header,
  9360. HTTPStatusCode: res.StatusCode,
  9361. },
  9362. }
  9363. target := &ret
  9364. if err := gensupport.DecodeResponse(target, res); err != nil {
  9365. return nil, err
  9366. }
  9367. return ret, nil
  9368. // {
  9369. // "description": "List all reasons for which bid responses were considered to have no\napplicable bids, with the number of bid responses affected for each reason.",
  9370. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponsesWithoutBids",
  9371. // "httpMethod": "GET",
  9372. // "id": "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list",
  9373. // "parameterOrder": [
  9374. // "filterSetName"
  9375. // ],
  9376. // "parameters": {
  9377. // "filterSetName": {
  9378. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9379. // "location": "path",
  9380. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9381. // "required": true,
  9382. // "type": "string"
  9383. // },
  9384. // "pageSize": {
  9385. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9386. // "format": "int32",
  9387. // "location": "query",
  9388. // "type": "integer"
  9389. // },
  9390. // "pageToken": {
  9391. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListBidResponsesWithoutBidsResponse.nextPageToken\nreturned from the previous call to the bidResponsesWithoutBids.list\nmethod.",
  9392. // "location": "query",
  9393. // "type": "string"
  9394. // }
  9395. // },
  9396. // "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids",
  9397. // "response": {
  9398. // "$ref": "ListBidResponsesWithoutBidsResponse"
  9399. // },
  9400. // "scopes": [
  9401. // "https://www.googleapis.com/auth/adexchange.buyer"
  9402. // ]
  9403. // }
  9404. }
  9405. // Pages invokes f for each page of results.
  9406. // A non-nil error returned from f will halt the iteration.
  9407. // The provided context supersedes any context provided to the Context method.
  9408. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Pages(ctx context.Context, f func(*ListBidResponsesWithoutBidsResponse) error) error {
  9409. c.ctx_ = ctx
  9410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9411. for {
  9412. x, err := c.Do()
  9413. if err != nil {
  9414. return err
  9415. }
  9416. if err := f(x); err != nil {
  9417. return err
  9418. }
  9419. if x.NextPageToken == "" {
  9420. return nil
  9421. }
  9422. c.PageToken(x.NextPageToken)
  9423. }
  9424. }
  9425. // method id "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list":
  9426. type BiddersFilterSetsFilteredBidRequestsListCall struct {
  9427. s *Service
  9428. filterSetName string
  9429. urlParams_ gensupport.URLParams
  9430. ifNoneMatch_ string
  9431. ctx_ context.Context
  9432. header_ http.Header
  9433. }
  9434. // List: List all reasons that caused a bid request not to be sent for
  9435. // an
  9436. // impression, with the number of bid requests not sent for each reason.
  9437. func (r *BiddersFilterSetsFilteredBidRequestsService) List(filterSetName string) *BiddersFilterSetsFilteredBidRequestsListCall {
  9438. c := &BiddersFilterSetsFilteredBidRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9439. c.filterSetName = filterSetName
  9440. return c
  9441. }
  9442. // PageSize sets the optional parameter "pageSize": Requested page size.
  9443. // The server may return fewer results than requested.
  9444. // If unspecified, the server will pick an appropriate default.
  9445. func (c *BiddersFilterSetsFilteredBidRequestsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidRequestsListCall {
  9446. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9447. return c
  9448. }
  9449. // PageToken sets the optional parameter "pageToken": A token
  9450. // identifying a page of results the server should return.
  9451. // Typically, this is the value
  9452. // of
  9453. // ListFilteredBidRequestsResponse.nextPageToken
  9454. // returned from the previous call to the
  9455. // filteredBidRequests.list
  9456. // method.
  9457. func (c *BiddersFilterSetsFilteredBidRequestsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidRequestsListCall {
  9458. c.urlParams_.Set("pageToken", pageToken)
  9459. return c
  9460. }
  9461. // Fields allows partial responses to be retrieved. See
  9462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9463. // for more information.
  9464. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidRequestsListCall {
  9465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9466. return c
  9467. }
  9468. // IfNoneMatch sets the optional parameter which makes the operation
  9469. // fail if the object's ETag matches the given value. This is useful for
  9470. // getting updates only after the object has changed since the last
  9471. // request. Use googleapi.IsNotModified to check whether the response
  9472. // error from Do is the result of In-None-Match.
  9473. func (c *BiddersFilterSetsFilteredBidRequestsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidRequestsListCall {
  9474. c.ifNoneMatch_ = entityTag
  9475. return c
  9476. }
  9477. // Context sets the context to be used in this call's Do method. Any
  9478. // pending HTTP request will be aborted if the provided context is
  9479. // canceled.
  9480. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidRequestsListCall {
  9481. c.ctx_ = ctx
  9482. return c
  9483. }
  9484. // Header returns an http.Header that can be modified by the caller to
  9485. // add HTTP headers to the request.
  9486. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Header() http.Header {
  9487. if c.header_ == nil {
  9488. c.header_ = make(http.Header)
  9489. }
  9490. return c.header_
  9491. }
  9492. func (c *BiddersFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*http.Response, error) {
  9493. reqHeaders := make(http.Header)
  9494. for k, v := range c.header_ {
  9495. reqHeaders[k] = v
  9496. }
  9497. reqHeaders.Set("User-Agent", c.s.userAgent())
  9498. if c.ifNoneMatch_ != "" {
  9499. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9500. }
  9501. var body io.Reader = nil
  9502. c.urlParams_.Set("alt", alt)
  9503. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests")
  9504. urls += "?" + c.urlParams_.Encode()
  9505. req, _ := http.NewRequest("GET", urls, body)
  9506. req.Header = reqHeaders
  9507. googleapi.Expand(req.URL, map[string]string{
  9508. "filterSetName": c.filterSetName,
  9509. })
  9510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9511. }
  9512. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list" call.
  9513. // Exactly one of *ListFilteredBidRequestsResponse or error will be
  9514. // non-nil. Any non-2xx status code is an error. Response headers are in
  9515. // either *ListFilteredBidRequestsResponse.ServerResponse.Header or (if
  9516. // a response was returned at all) in error.(*googleapi.Error).Header.
  9517. // Use googleapi.IsNotModified to check whether the returned error was
  9518. // because http.StatusNotModified was returned.
  9519. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidRequestsResponse, error) {
  9520. gensupport.SetOptions(c.urlParams_, opts...)
  9521. res, err := c.doRequest("json")
  9522. if res != nil && res.StatusCode == http.StatusNotModified {
  9523. if res.Body != nil {
  9524. res.Body.Close()
  9525. }
  9526. return nil, &googleapi.Error{
  9527. Code: res.StatusCode,
  9528. Header: res.Header,
  9529. }
  9530. }
  9531. if err != nil {
  9532. return nil, err
  9533. }
  9534. defer googleapi.CloseBody(res)
  9535. if err := googleapi.CheckResponse(res); err != nil {
  9536. return nil, err
  9537. }
  9538. ret := &ListFilteredBidRequestsResponse{
  9539. ServerResponse: googleapi.ServerResponse{
  9540. Header: res.Header,
  9541. HTTPStatusCode: res.StatusCode,
  9542. },
  9543. }
  9544. target := &ret
  9545. if err := gensupport.DecodeResponse(target, res); err != nil {
  9546. return nil, err
  9547. }
  9548. return ret, nil
  9549. // {
  9550. // "description": "List all reasons that caused a bid request not to be sent for an\nimpression, with the number of bid requests not sent for each reason.",
  9551. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBidRequests",
  9552. // "httpMethod": "GET",
  9553. // "id": "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list",
  9554. // "parameterOrder": [
  9555. // "filterSetName"
  9556. // ],
  9557. // "parameters": {
  9558. // "filterSetName": {
  9559. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9560. // "location": "path",
  9561. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9562. // "required": true,
  9563. // "type": "string"
  9564. // },
  9565. // "pageSize": {
  9566. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9567. // "format": "int32",
  9568. // "location": "query",
  9569. // "type": "integer"
  9570. // },
  9571. // "pageToken": {
  9572. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidRequestsResponse.nextPageToken\nreturned from the previous call to the filteredBidRequests.list\nmethod.",
  9573. // "location": "query",
  9574. // "type": "string"
  9575. // }
  9576. // },
  9577. // "path": "v2beta1/{+filterSetName}/filteredBidRequests",
  9578. // "response": {
  9579. // "$ref": "ListFilteredBidRequestsResponse"
  9580. // },
  9581. // "scopes": [
  9582. // "https://www.googleapis.com/auth/adexchange.buyer"
  9583. // ]
  9584. // }
  9585. }
  9586. // Pages invokes f for each page of results.
  9587. // A non-nil error returned from f will halt the iteration.
  9588. // The provided context supersedes any context provided to the Context method.
  9589. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Pages(ctx context.Context, f func(*ListFilteredBidRequestsResponse) error) error {
  9590. c.ctx_ = ctx
  9591. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9592. for {
  9593. x, err := c.Do()
  9594. if err != nil {
  9595. return err
  9596. }
  9597. if err := f(x); err != nil {
  9598. return err
  9599. }
  9600. if x.NextPageToken == "" {
  9601. return nil
  9602. }
  9603. c.PageToken(x.NextPageToken)
  9604. }
  9605. }
  9606. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.list":
  9607. type BiddersFilterSetsFilteredBidsListCall struct {
  9608. s *Service
  9609. filterSetName string
  9610. urlParams_ gensupport.URLParams
  9611. ifNoneMatch_ string
  9612. ctx_ context.Context
  9613. header_ http.Header
  9614. }
  9615. // List: List all reasons for which bids were filtered, with the number
  9616. // of bids
  9617. // filtered for each reason.
  9618. func (r *BiddersFilterSetsFilteredBidsService) List(filterSetName string) *BiddersFilterSetsFilteredBidsListCall {
  9619. c := &BiddersFilterSetsFilteredBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9620. c.filterSetName = filterSetName
  9621. return c
  9622. }
  9623. // PageSize sets the optional parameter "pageSize": Requested page size.
  9624. // The server may return fewer results than requested.
  9625. // If unspecified, the server will pick an appropriate default.
  9626. func (c *BiddersFilterSetsFilteredBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsListCall {
  9627. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9628. return c
  9629. }
  9630. // PageToken sets the optional parameter "pageToken": A token
  9631. // identifying a page of results the server should return.
  9632. // Typically, this is the value
  9633. // of
  9634. // ListFilteredBidsResponse.nextPageToken
  9635. // returned from the previous call to the filteredBids.list
  9636. // method.
  9637. func (c *BiddersFilterSetsFilteredBidsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsListCall {
  9638. c.urlParams_.Set("pageToken", pageToken)
  9639. return c
  9640. }
  9641. // Fields allows partial responses to be retrieved. See
  9642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9643. // for more information.
  9644. func (c *BiddersFilterSetsFilteredBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsListCall {
  9645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9646. return c
  9647. }
  9648. // IfNoneMatch sets the optional parameter which makes the operation
  9649. // fail if the object's ETag matches the given value. This is useful for
  9650. // getting updates only after the object has changed since the last
  9651. // request. Use googleapi.IsNotModified to check whether the response
  9652. // error from Do is the result of In-None-Match.
  9653. func (c *BiddersFilterSetsFilteredBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsListCall {
  9654. c.ifNoneMatch_ = entityTag
  9655. return c
  9656. }
  9657. // Context sets the context to be used in this call's Do method. Any
  9658. // pending HTTP request will be aborted if the provided context is
  9659. // canceled.
  9660. func (c *BiddersFilterSetsFilteredBidsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsListCall {
  9661. c.ctx_ = ctx
  9662. return c
  9663. }
  9664. // Header returns an http.Header that can be modified by the caller to
  9665. // add HTTP headers to the request.
  9666. func (c *BiddersFilterSetsFilteredBidsListCall) Header() http.Header {
  9667. if c.header_ == nil {
  9668. c.header_ = make(http.Header)
  9669. }
  9670. return c.header_
  9671. }
  9672. func (c *BiddersFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Response, error) {
  9673. reqHeaders := make(http.Header)
  9674. for k, v := range c.header_ {
  9675. reqHeaders[k] = v
  9676. }
  9677. reqHeaders.Set("User-Agent", c.s.userAgent())
  9678. if c.ifNoneMatch_ != "" {
  9679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9680. }
  9681. var body io.Reader = nil
  9682. c.urlParams_.Set("alt", alt)
  9683. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids")
  9684. urls += "?" + c.urlParams_.Encode()
  9685. req, _ := http.NewRequest("GET", urls, body)
  9686. req.Header = reqHeaders
  9687. googleapi.Expand(req.URL, map[string]string{
  9688. "filterSetName": c.filterSetName,
  9689. })
  9690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9691. }
  9692. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.list" call.
  9693. // Exactly one of *ListFilteredBidsResponse or error will be non-nil.
  9694. // Any non-2xx status code is an error. Response headers are in either
  9695. // *ListFilteredBidsResponse.ServerResponse.Header or (if a response was
  9696. // returned at all) in error.(*googleapi.Error).Header. Use
  9697. // googleapi.IsNotModified to check whether the returned error was
  9698. // because http.StatusNotModified was returned.
  9699. func (c *BiddersFilterSetsFilteredBidsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidsResponse, error) {
  9700. gensupport.SetOptions(c.urlParams_, opts...)
  9701. res, err := c.doRequest("json")
  9702. if res != nil && res.StatusCode == http.StatusNotModified {
  9703. if res.Body != nil {
  9704. res.Body.Close()
  9705. }
  9706. return nil, &googleapi.Error{
  9707. Code: res.StatusCode,
  9708. Header: res.Header,
  9709. }
  9710. }
  9711. if err != nil {
  9712. return nil, err
  9713. }
  9714. defer googleapi.CloseBody(res)
  9715. if err := googleapi.CheckResponse(res); err != nil {
  9716. return nil, err
  9717. }
  9718. ret := &ListFilteredBidsResponse{
  9719. ServerResponse: googleapi.ServerResponse{
  9720. Header: res.Header,
  9721. HTTPStatusCode: res.StatusCode,
  9722. },
  9723. }
  9724. target := &ret
  9725. if err := gensupport.DecodeResponse(target, res); err != nil {
  9726. return nil, err
  9727. }
  9728. return ret, nil
  9729. // {
  9730. // "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.",
  9731. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids",
  9732. // "httpMethod": "GET",
  9733. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.list",
  9734. // "parameterOrder": [
  9735. // "filterSetName"
  9736. // ],
  9737. // "parameters": {
  9738. // "filterSetName": {
  9739. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9740. // "location": "path",
  9741. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9742. // "required": true,
  9743. // "type": "string"
  9744. // },
  9745. // "pageSize": {
  9746. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9747. // "format": "int32",
  9748. // "location": "query",
  9749. // "type": "integer"
  9750. // },
  9751. // "pageToken": {
  9752. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListFilteredBidsResponse.nextPageToken\nreturned from the previous call to the filteredBids.list\nmethod.",
  9753. // "location": "query",
  9754. // "type": "string"
  9755. // }
  9756. // },
  9757. // "path": "v2beta1/{+filterSetName}/filteredBids",
  9758. // "response": {
  9759. // "$ref": "ListFilteredBidsResponse"
  9760. // },
  9761. // "scopes": [
  9762. // "https://www.googleapis.com/auth/adexchange.buyer"
  9763. // ]
  9764. // }
  9765. }
  9766. // Pages invokes f for each page of results.
  9767. // A non-nil error returned from f will halt the iteration.
  9768. // The provided context supersedes any context provided to the Context method.
  9769. func (c *BiddersFilterSetsFilteredBidsListCall) Pages(ctx context.Context, f func(*ListFilteredBidsResponse) error) error {
  9770. c.ctx_ = ctx
  9771. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9772. for {
  9773. x, err := c.Do()
  9774. if err != nil {
  9775. return err
  9776. }
  9777. if err := f(x); err != nil {
  9778. return err
  9779. }
  9780. if x.NextPageToken == "" {
  9781. return nil
  9782. }
  9783. c.PageToken(x.NextPageToken)
  9784. }
  9785. }
  9786. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list":
  9787. type BiddersFilterSetsFilteredBidsCreativesListCall struct {
  9788. s *Service
  9789. filterSetName string
  9790. creativeStatusId int64
  9791. urlParams_ gensupport.URLParams
  9792. ifNoneMatch_ string
  9793. ctx_ context.Context
  9794. header_ http.Header
  9795. }
  9796. // List: List all creatives associated with a specific reason for which
  9797. // bids were
  9798. // filtered, with the number of bids filtered for each creative.
  9799. func (r *BiddersFilterSetsFilteredBidsCreativesService) List(filterSetName string, creativeStatusId int64) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9800. c := &BiddersFilterSetsFilteredBidsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9801. c.filterSetName = filterSetName
  9802. c.creativeStatusId = creativeStatusId
  9803. return c
  9804. }
  9805. // PageSize sets the optional parameter "pageSize": Requested page size.
  9806. // The server may return fewer results than requested.
  9807. // If unspecified, the server will pick an appropriate default.
  9808. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9809. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9810. return c
  9811. }
  9812. // PageToken sets the optional parameter "pageToken": A token
  9813. // identifying a page of results the server should return.
  9814. // Typically, this is the value
  9815. // of
  9816. // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken
  9817. // returne
  9818. // d from the previous call to the filteredBids.creatives.list
  9819. // method.
  9820. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9821. c.urlParams_.Set("pageToken", pageToken)
  9822. return c
  9823. }
  9824. // Fields allows partial responses to be retrieved. See
  9825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9826. // for more information.
  9827. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9829. return c
  9830. }
  9831. // IfNoneMatch sets the optional parameter which makes the operation
  9832. // fail if the object's ETag matches the given value. This is useful for
  9833. // getting updates only after the object has changed since the last
  9834. // request. Use googleapi.IsNotModified to check whether the response
  9835. // error from Do is the result of In-None-Match.
  9836. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9837. c.ifNoneMatch_ = entityTag
  9838. return c
  9839. }
  9840. // Context sets the context to be used in this call's Do method. Any
  9841. // pending HTTP request will be aborted if the provided context is
  9842. // canceled.
  9843. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsCreativesListCall {
  9844. c.ctx_ = ctx
  9845. return c
  9846. }
  9847. // Header returns an http.Header that can be modified by the caller to
  9848. // add HTTP headers to the request.
  9849. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Header() http.Header {
  9850. if c.header_ == nil {
  9851. c.header_ = make(http.Header)
  9852. }
  9853. return c.header_
  9854. }
  9855. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  9856. reqHeaders := make(http.Header)
  9857. for k, v := range c.header_ {
  9858. reqHeaders[k] = v
  9859. }
  9860. reqHeaders.Set("User-Agent", c.s.userAgent())
  9861. if c.ifNoneMatch_ != "" {
  9862. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9863. }
  9864. var body io.Reader = nil
  9865. c.urlParams_.Set("alt", alt)
  9866. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives")
  9867. urls += "?" + c.urlParams_.Encode()
  9868. req, _ := http.NewRequest("GET", urls, body)
  9869. req.Header = reqHeaders
  9870. googleapi.Expand(req.URL, map[string]string{
  9871. "filterSetName": c.filterSetName,
  9872. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  9873. })
  9874. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9875. }
  9876. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list" call.
  9877. // Exactly one of *ListCreativeStatusBreakdownByCreativeResponse or
  9878. // error will be non-nil. Any non-2xx status code is an error. Response
  9879. // headers are in either
  9880. // *ListCreativeStatusBreakdownByCreativeResponse.ServerResponse.Header
  9881. // or (if a response was returned at all) in
  9882. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9883. // whether the returned error was because http.StatusNotModified was
  9884. // returned.
  9885. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByCreativeResponse, error) {
  9886. gensupport.SetOptions(c.urlParams_, opts...)
  9887. res, err := c.doRequest("json")
  9888. if res != nil && res.StatusCode == http.StatusNotModified {
  9889. if res.Body != nil {
  9890. res.Body.Close()
  9891. }
  9892. return nil, &googleapi.Error{
  9893. Code: res.StatusCode,
  9894. Header: res.Header,
  9895. }
  9896. }
  9897. if err != nil {
  9898. return nil, err
  9899. }
  9900. defer googleapi.CloseBody(res)
  9901. if err := googleapi.CheckResponse(res); err != nil {
  9902. return nil, err
  9903. }
  9904. ret := &ListCreativeStatusBreakdownByCreativeResponse{
  9905. ServerResponse: googleapi.ServerResponse{
  9906. Header: res.Header,
  9907. HTTPStatusCode: res.StatusCode,
  9908. },
  9909. }
  9910. target := &ret
  9911. if err := gensupport.DecodeResponse(target, res); err != nil {
  9912. return nil, err
  9913. }
  9914. return ret, nil
  9915. // {
  9916. // "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.",
  9917. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives",
  9918. // "httpMethod": "GET",
  9919. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list",
  9920. // "parameterOrder": [
  9921. // "filterSetName",
  9922. // "creativeStatusId"
  9923. // ],
  9924. // "parameters": {
  9925. // "creativeStatusId": {
  9926. // "description": "The ID of the creative status for which to retrieve a breakdown by\ncreative.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).",
  9927. // "format": "int32",
  9928. // "location": "path",
  9929. // "required": true,
  9930. // "type": "integer"
  9931. // },
  9932. // "filterSetName": {
  9933. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  9934. // "location": "path",
  9935. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  9936. // "required": true,
  9937. // "type": "string"
  9938. // },
  9939. // "pageSize": {
  9940. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9941. // "format": "int32",
  9942. // "location": "query",
  9943. // "type": "integer"
  9944. // },
  9945. // "pageToken": {
  9946. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByCreativeResponse.nextPageToken\nreturned from the previous call to the filteredBids.creatives.list\nmethod.",
  9947. // "location": "query",
  9948. // "type": "string"
  9949. // }
  9950. // },
  9951. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives",
  9952. // "response": {
  9953. // "$ref": "ListCreativeStatusBreakdownByCreativeResponse"
  9954. // },
  9955. // "scopes": [
  9956. // "https://www.googleapis.com/auth/adexchange.buyer"
  9957. // ]
  9958. // }
  9959. }
  9960. // Pages invokes f for each page of results.
  9961. // A non-nil error returned from f will halt the iteration.
  9962. // The provided context supersedes any context provided to the Context method.
  9963. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByCreativeResponse) error) error {
  9964. c.ctx_ = ctx
  9965. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9966. for {
  9967. x, err := c.Do()
  9968. if err != nil {
  9969. return err
  9970. }
  9971. if err := f(x); err != nil {
  9972. return err
  9973. }
  9974. if x.NextPageToken == "" {
  9975. return nil
  9976. }
  9977. c.PageToken(x.NextPageToken)
  9978. }
  9979. }
  9980. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.details.list":
  9981. type BiddersFilterSetsFilteredBidsDetailsListCall struct {
  9982. s *Service
  9983. filterSetName string
  9984. creativeStatusId int64
  9985. urlParams_ gensupport.URLParams
  9986. ifNoneMatch_ string
  9987. ctx_ context.Context
  9988. header_ http.Header
  9989. }
  9990. // List: List all details associated with a specific reason for which
  9991. // bids were
  9992. // filtered, with the number of bids filtered for each detail.
  9993. func (r *BiddersFilterSetsFilteredBidsDetailsService) List(filterSetName string, creativeStatusId int64) *BiddersFilterSetsFilteredBidsDetailsListCall {
  9994. c := &BiddersFilterSetsFilteredBidsDetailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9995. c.filterSetName = filterSetName
  9996. c.creativeStatusId = creativeStatusId
  9997. return c
  9998. }
  9999. // PageSize sets the optional parameter "pageSize": Requested page size.
  10000. // The server may return fewer results than requested.
  10001. // If unspecified, the server will pick an appropriate default.
  10002. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsDetailsListCall {
  10003. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10004. return c
  10005. }
  10006. // PageToken sets the optional parameter "pageToken": A token
  10007. // identifying a page of results the server should return.
  10008. // Typically, this is the value
  10009. // of
  10010. // ListCreativeStatusBreakdownByDetailResponse.nextPageToken
  10011. // returned from the previous call to the
  10012. // filteredBids.details.list
  10013. // method.
  10014. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsDetailsListCall {
  10015. c.urlParams_.Set("pageToken", pageToken)
  10016. return c
  10017. }
  10018. // Fields allows partial responses to be retrieved. See
  10019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10020. // for more information.
  10021. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsDetailsListCall {
  10022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10023. return c
  10024. }
  10025. // IfNoneMatch sets the optional parameter which makes the operation
  10026. // fail if the object's ETag matches the given value. This is useful for
  10027. // getting updates only after the object has changed since the last
  10028. // request. Use googleapi.IsNotModified to check whether the response
  10029. // error from Do is the result of In-None-Match.
  10030. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsDetailsListCall {
  10031. c.ifNoneMatch_ = entityTag
  10032. return c
  10033. }
  10034. // Context sets the context to be used in this call's Do method. Any
  10035. // pending HTTP request will be aborted if the provided context is
  10036. // canceled.
  10037. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsDetailsListCall {
  10038. c.ctx_ = ctx
  10039. return c
  10040. }
  10041. // Header returns an http.Header that can be modified by the caller to
  10042. // add HTTP headers to the request.
  10043. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Header() http.Header {
  10044. if c.header_ == nil {
  10045. c.header_ = make(http.Header)
  10046. }
  10047. return c.header_
  10048. }
  10049. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*http.Response, error) {
  10050. reqHeaders := make(http.Header)
  10051. for k, v := range c.header_ {
  10052. reqHeaders[k] = v
  10053. }
  10054. reqHeaders.Set("User-Agent", c.s.userAgent())
  10055. if c.ifNoneMatch_ != "" {
  10056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10057. }
  10058. var body io.Reader = nil
  10059. c.urlParams_.Set("alt", alt)
  10060. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details")
  10061. urls += "?" + c.urlParams_.Encode()
  10062. req, _ := http.NewRequest("GET", urls, body)
  10063. req.Header = reqHeaders
  10064. googleapi.Expand(req.URL, map[string]string{
  10065. "filterSetName": c.filterSetName,
  10066. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  10067. })
  10068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10069. }
  10070. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.details.list" call.
  10071. // Exactly one of *ListCreativeStatusBreakdownByDetailResponse or error
  10072. // will be non-nil. Any non-2xx status code is an error. Response
  10073. // headers are in either
  10074. // *ListCreativeStatusBreakdownByDetailResponse.ServerResponse.Header or
  10075. // (if a response was returned at all) in
  10076. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10077. // whether the returned error was because http.StatusNotModified was
  10078. // returned.
  10079. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByDetailResponse, error) {
  10080. gensupport.SetOptions(c.urlParams_, opts...)
  10081. res, err := c.doRequest("json")
  10082. if res != nil && res.StatusCode == http.StatusNotModified {
  10083. if res.Body != nil {
  10084. res.Body.Close()
  10085. }
  10086. return nil, &googleapi.Error{
  10087. Code: res.StatusCode,
  10088. Header: res.Header,
  10089. }
  10090. }
  10091. if err != nil {
  10092. return nil, err
  10093. }
  10094. defer googleapi.CloseBody(res)
  10095. if err := googleapi.CheckResponse(res); err != nil {
  10096. return nil, err
  10097. }
  10098. ret := &ListCreativeStatusBreakdownByDetailResponse{
  10099. ServerResponse: googleapi.ServerResponse{
  10100. Header: res.Header,
  10101. HTTPStatusCode: res.StatusCode,
  10102. },
  10103. }
  10104. target := &ret
  10105. if err := gensupport.DecodeResponse(target, res); err != nil {
  10106. return nil, err
  10107. }
  10108. return ret, nil
  10109. // {
  10110. // "description": "List all details associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each detail.",
  10111. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details",
  10112. // "httpMethod": "GET",
  10113. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.details.list",
  10114. // "parameterOrder": [
  10115. // "filterSetName",
  10116. // "creativeStatusId"
  10117. // ],
  10118. // "parameters": {
  10119. // "creativeStatusId": {
  10120. // "description": "The ID of the creative status for which to retrieve a breakdown by detail.\nSee\n[creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes).\nDetails are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87.",
  10121. // "format": "int32",
  10122. // "location": "path",
  10123. // "required": true,
  10124. // "type": "integer"
  10125. // },
  10126. // "filterSetName": {
  10127. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  10128. // "location": "path",
  10129. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  10130. // "required": true,
  10131. // "type": "string"
  10132. // },
  10133. // "pageSize": {
  10134. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  10135. // "format": "int32",
  10136. // "location": "query",
  10137. // "type": "integer"
  10138. // },
  10139. // "pageToken": {
  10140. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListCreativeStatusBreakdownByDetailResponse.nextPageToken\nreturned from the previous call to the filteredBids.details.list\nmethod.",
  10141. // "location": "query",
  10142. // "type": "string"
  10143. // }
  10144. // },
  10145. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details",
  10146. // "response": {
  10147. // "$ref": "ListCreativeStatusBreakdownByDetailResponse"
  10148. // },
  10149. // "scopes": [
  10150. // "https://www.googleapis.com/auth/adexchange.buyer"
  10151. // ]
  10152. // }
  10153. }
  10154. // Pages invokes f for each page of results.
  10155. // A non-nil error returned from f will halt the iteration.
  10156. // The provided context supersedes any context provided to the Context method.
  10157. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByDetailResponse) error) error {
  10158. c.ctx_ = ctx
  10159. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10160. for {
  10161. x, err := c.Do()
  10162. if err != nil {
  10163. return err
  10164. }
  10165. if err := f(x); err != nil {
  10166. return err
  10167. }
  10168. if x.NextPageToken == "" {
  10169. return nil
  10170. }
  10171. c.PageToken(x.NextPageToken)
  10172. }
  10173. }
  10174. // method id "adexchangebuyer2.bidders.filterSets.impressionMetrics.list":
  10175. type BiddersFilterSetsImpressionMetricsListCall struct {
  10176. s *Service
  10177. filterSetName string
  10178. urlParams_ gensupport.URLParams
  10179. ifNoneMatch_ string
  10180. ctx_ context.Context
  10181. header_ http.Header
  10182. }
  10183. // List: Lists all metrics that are measured in terms of number of
  10184. // impressions.
  10185. func (r *BiddersFilterSetsImpressionMetricsService) List(filterSetName string) *BiddersFilterSetsImpressionMetricsListCall {
  10186. c := &BiddersFilterSetsImpressionMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10187. c.filterSetName = filterSetName
  10188. return c
  10189. }
  10190. // PageSize sets the optional parameter "pageSize": Requested page size.
  10191. // The server may return fewer results than requested.
  10192. // If unspecified, the server will pick an appropriate default.
  10193. func (c *BiddersFilterSetsImpressionMetricsListCall) PageSize(pageSize int64) *BiddersFilterSetsImpressionMetricsListCall {
  10194. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10195. return c
  10196. }
  10197. // PageToken sets the optional parameter "pageToken": A token
  10198. // identifying a page of results the server should return.
  10199. // Typically, this is the value
  10200. // of
  10201. // ListImpressionMetricsResponse.nextPageToken
  10202. // returned from the previous call to the impressionMetrics.list
  10203. // method.
  10204. func (c *BiddersFilterSetsImpressionMetricsListCall) PageToken(pageToken string) *BiddersFilterSetsImpressionMetricsListCall {
  10205. c.urlParams_.Set("pageToken", pageToken)
  10206. return c
  10207. }
  10208. // Fields allows partial responses to be retrieved. See
  10209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10210. // for more information.
  10211. func (c *BiddersFilterSetsImpressionMetricsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsImpressionMetricsListCall {
  10212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10213. return c
  10214. }
  10215. // IfNoneMatch sets the optional parameter which makes the operation
  10216. // fail if the object's ETag matches the given value. This is useful for
  10217. // getting updates only after the object has changed since the last
  10218. // request. Use googleapi.IsNotModified to check whether the response
  10219. // error from Do is the result of In-None-Match.
  10220. func (c *BiddersFilterSetsImpressionMetricsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsImpressionMetricsListCall {
  10221. c.ifNoneMatch_ = entityTag
  10222. return c
  10223. }
  10224. // Context sets the context to be used in this call's Do method. Any
  10225. // pending HTTP request will be aborted if the provided context is
  10226. // canceled.
  10227. func (c *BiddersFilterSetsImpressionMetricsListCall) Context(ctx context.Context) *BiddersFilterSetsImpressionMetricsListCall {
  10228. c.ctx_ = ctx
  10229. return c
  10230. }
  10231. // Header returns an http.Header that can be modified by the caller to
  10232. // add HTTP headers to the request.
  10233. func (c *BiddersFilterSetsImpressionMetricsListCall) Header() http.Header {
  10234. if c.header_ == nil {
  10235. c.header_ = make(http.Header)
  10236. }
  10237. return c.header_
  10238. }
  10239. func (c *BiddersFilterSetsImpressionMetricsListCall) doRequest(alt string) (*http.Response, error) {
  10240. reqHeaders := make(http.Header)
  10241. for k, v := range c.header_ {
  10242. reqHeaders[k] = v
  10243. }
  10244. reqHeaders.Set("User-Agent", c.s.userAgent())
  10245. if c.ifNoneMatch_ != "" {
  10246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10247. }
  10248. var body io.Reader = nil
  10249. c.urlParams_.Set("alt", alt)
  10250. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics")
  10251. urls += "?" + c.urlParams_.Encode()
  10252. req, _ := http.NewRequest("GET", urls, body)
  10253. req.Header = reqHeaders
  10254. googleapi.Expand(req.URL, map[string]string{
  10255. "filterSetName": c.filterSetName,
  10256. })
  10257. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10258. }
  10259. // Do executes the "adexchangebuyer2.bidders.filterSets.impressionMetrics.list" call.
  10260. // Exactly one of *ListImpressionMetricsResponse or error will be
  10261. // non-nil. Any non-2xx status code is an error. Response headers are in
  10262. // either *ListImpressionMetricsResponse.ServerResponse.Header or (if a
  10263. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10264. // googleapi.IsNotModified to check whether the returned error was
  10265. // because http.StatusNotModified was returned.
  10266. func (c *BiddersFilterSetsImpressionMetricsListCall) Do(opts ...googleapi.CallOption) (*ListImpressionMetricsResponse, error) {
  10267. gensupport.SetOptions(c.urlParams_, opts...)
  10268. res, err := c.doRequest("json")
  10269. if res != nil && res.StatusCode == http.StatusNotModified {
  10270. if res.Body != nil {
  10271. res.Body.Close()
  10272. }
  10273. return nil, &googleapi.Error{
  10274. Code: res.StatusCode,
  10275. Header: res.Header,
  10276. }
  10277. }
  10278. if err != nil {
  10279. return nil, err
  10280. }
  10281. defer googleapi.CloseBody(res)
  10282. if err := googleapi.CheckResponse(res); err != nil {
  10283. return nil, err
  10284. }
  10285. ret := &ListImpressionMetricsResponse{
  10286. ServerResponse: googleapi.ServerResponse{
  10287. Header: res.Header,
  10288. HTTPStatusCode: res.StatusCode,
  10289. },
  10290. }
  10291. target := &ret
  10292. if err := gensupport.DecodeResponse(target, res); err != nil {
  10293. return nil, err
  10294. }
  10295. return ret, nil
  10296. // {
  10297. // "description": "Lists all metrics that are measured in terms of number of impressions.",
  10298. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/impressionMetrics",
  10299. // "httpMethod": "GET",
  10300. // "id": "adexchangebuyer2.bidders.filterSets.impressionMetrics.list",
  10301. // "parameterOrder": [
  10302. // "filterSetName"
  10303. // ],
  10304. // "parameters": {
  10305. // "filterSetName": {
  10306. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  10307. // "location": "path",
  10308. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  10309. // "required": true,
  10310. // "type": "string"
  10311. // },
  10312. // "pageSize": {
  10313. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  10314. // "format": "int32",
  10315. // "location": "query",
  10316. // "type": "integer"
  10317. // },
  10318. // "pageToken": {
  10319. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListImpressionMetricsResponse.nextPageToken\nreturned from the previous call to the impressionMetrics.list\nmethod.",
  10320. // "location": "query",
  10321. // "type": "string"
  10322. // }
  10323. // },
  10324. // "path": "v2beta1/{+filterSetName}/impressionMetrics",
  10325. // "response": {
  10326. // "$ref": "ListImpressionMetricsResponse"
  10327. // },
  10328. // "scopes": [
  10329. // "https://www.googleapis.com/auth/adexchange.buyer"
  10330. // ]
  10331. // }
  10332. }
  10333. // Pages invokes f for each page of results.
  10334. // A non-nil error returned from f will halt the iteration.
  10335. // The provided context supersedes any context provided to the Context method.
  10336. func (c *BiddersFilterSetsImpressionMetricsListCall) Pages(ctx context.Context, f func(*ListImpressionMetricsResponse) error) error {
  10337. c.ctx_ = ctx
  10338. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10339. for {
  10340. x, err := c.Do()
  10341. if err != nil {
  10342. return err
  10343. }
  10344. if err := f(x); err != nil {
  10345. return err
  10346. }
  10347. if x.NextPageToken == "" {
  10348. return nil
  10349. }
  10350. c.PageToken(x.NextPageToken)
  10351. }
  10352. }
  10353. // method id "adexchangebuyer2.bidders.filterSets.losingBids.list":
  10354. type BiddersFilterSetsLosingBidsListCall struct {
  10355. s *Service
  10356. filterSetName string
  10357. urlParams_ gensupport.URLParams
  10358. ifNoneMatch_ string
  10359. ctx_ context.Context
  10360. header_ http.Header
  10361. }
  10362. // List: List all reasons for which bids lost in the auction, with the
  10363. // number of
  10364. // bids that lost for each reason.
  10365. func (r *BiddersFilterSetsLosingBidsService) List(filterSetName string) *BiddersFilterSetsLosingBidsListCall {
  10366. c := &BiddersFilterSetsLosingBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10367. c.filterSetName = filterSetName
  10368. return c
  10369. }
  10370. // PageSize sets the optional parameter "pageSize": Requested page size.
  10371. // The server may return fewer results than requested.
  10372. // If unspecified, the server will pick an appropriate default.
  10373. func (c *BiddersFilterSetsLosingBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsLosingBidsListCall {
  10374. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10375. return c
  10376. }
  10377. // PageToken sets the optional parameter "pageToken": A token
  10378. // identifying a page of results the server should return.
  10379. // Typically, this is the value
  10380. // of
  10381. // ListLosingBidsResponse.nextPageToken
  10382. // returned from the previous call to the losingBids.list
  10383. // method.
  10384. func (c *BiddersFilterSetsLosingBidsListCall) PageToken(pageToken string) *BiddersFilterSetsLosingBidsListCall {
  10385. c.urlParams_.Set("pageToken", pageToken)
  10386. return c
  10387. }
  10388. // Fields allows partial responses to be retrieved. See
  10389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10390. // for more information.
  10391. func (c *BiddersFilterSetsLosingBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsLosingBidsListCall {
  10392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10393. return c
  10394. }
  10395. // IfNoneMatch sets the optional parameter which makes the operation
  10396. // fail if the object's ETag matches the given value. This is useful for
  10397. // getting updates only after the object has changed since the last
  10398. // request. Use googleapi.IsNotModified to check whether the response
  10399. // error from Do is the result of In-None-Match.
  10400. func (c *BiddersFilterSetsLosingBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsLosingBidsListCall {
  10401. c.ifNoneMatch_ = entityTag
  10402. return c
  10403. }
  10404. // Context sets the context to be used in this call's Do method. Any
  10405. // pending HTTP request will be aborted if the provided context is
  10406. // canceled.
  10407. func (c *BiddersFilterSetsLosingBidsListCall) Context(ctx context.Context) *BiddersFilterSetsLosingBidsListCall {
  10408. c.ctx_ = ctx
  10409. return c
  10410. }
  10411. // Header returns an http.Header that can be modified by the caller to
  10412. // add HTTP headers to the request.
  10413. func (c *BiddersFilterSetsLosingBidsListCall) Header() http.Header {
  10414. if c.header_ == nil {
  10415. c.header_ = make(http.Header)
  10416. }
  10417. return c.header_
  10418. }
  10419. func (c *BiddersFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Response, error) {
  10420. reqHeaders := make(http.Header)
  10421. for k, v := range c.header_ {
  10422. reqHeaders[k] = v
  10423. }
  10424. reqHeaders.Set("User-Agent", c.s.userAgent())
  10425. if c.ifNoneMatch_ != "" {
  10426. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10427. }
  10428. var body io.Reader = nil
  10429. c.urlParams_.Set("alt", alt)
  10430. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids")
  10431. urls += "?" + c.urlParams_.Encode()
  10432. req, _ := http.NewRequest("GET", urls, body)
  10433. req.Header = reqHeaders
  10434. googleapi.Expand(req.URL, map[string]string{
  10435. "filterSetName": c.filterSetName,
  10436. })
  10437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10438. }
  10439. // Do executes the "adexchangebuyer2.bidders.filterSets.losingBids.list" call.
  10440. // Exactly one of *ListLosingBidsResponse or error will be non-nil. Any
  10441. // non-2xx status code is an error. Response headers are in either
  10442. // *ListLosingBidsResponse.ServerResponse.Header or (if a response was
  10443. // returned at all) in error.(*googleapi.Error).Header. Use
  10444. // googleapi.IsNotModified to check whether the returned error was
  10445. // because http.StatusNotModified was returned.
  10446. func (c *BiddersFilterSetsLosingBidsListCall) Do(opts ...googleapi.CallOption) (*ListLosingBidsResponse, error) {
  10447. gensupport.SetOptions(c.urlParams_, opts...)
  10448. res, err := c.doRequest("json")
  10449. if res != nil && res.StatusCode == http.StatusNotModified {
  10450. if res.Body != nil {
  10451. res.Body.Close()
  10452. }
  10453. return nil, &googleapi.Error{
  10454. Code: res.StatusCode,
  10455. Header: res.Header,
  10456. }
  10457. }
  10458. if err != nil {
  10459. return nil, err
  10460. }
  10461. defer googleapi.CloseBody(res)
  10462. if err := googleapi.CheckResponse(res); err != nil {
  10463. return nil, err
  10464. }
  10465. ret := &ListLosingBidsResponse{
  10466. ServerResponse: googleapi.ServerResponse{
  10467. Header: res.Header,
  10468. HTTPStatusCode: res.StatusCode,
  10469. },
  10470. }
  10471. target := &ret
  10472. if err := gensupport.DecodeResponse(target, res); err != nil {
  10473. return nil, err
  10474. }
  10475. return ret, nil
  10476. // {
  10477. // "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.",
  10478. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/losingBids",
  10479. // "httpMethod": "GET",
  10480. // "id": "adexchangebuyer2.bidders.filterSets.losingBids.list",
  10481. // "parameterOrder": [
  10482. // "filterSetName"
  10483. // ],
  10484. // "parameters": {
  10485. // "filterSetName": {
  10486. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  10487. // "location": "path",
  10488. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  10489. // "required": true,
  10490. // "type": "string"
  10491. // },
  10492. // "pageSize": {
  10493. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  10494. // "format": "int32",
  10495. // "location": "query",
  10496. // "type": "integer"
  10497. // },
  10498. // "pageToken": {
  10499. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListLosingBidsResponse.nextPageToken\nreturned from the previous call to the losingBids.list\nmethod.",
  10500. // "location": "query",
  10501. // "type": "string"
  10502. // }
  10503. // },
  10504. // "path": "v2beta1/{+filterSetName}/losingBids",
  10505. // "response": {
  10506. // "$ref": "ListLosingBidsResponse"
  10507. // },
  10508. // "scopes": [
  10509. // "https://www.googleapis.com/auth/adexchange.buyer"
  10510. // ]
  10511. // }
  10512. }
  10513. // Pages invokes f for each page of results.
  10514. // A non-nil error returned from f will halt the iteration.
  10515. // The provided context supersedes any context provided to the Context method.
  10516. func (c *BiddersFilterSetsLosingBidsListCall) Pages(ctx context.Context, f func(*ListLosingBidsResponse) error) error {
  10517. c.ctx_ = ctx
  10518. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10519. for {
  10520. x, err := c.Do()
  10521. if err != nil {
  10522. return err
  10523. }
  10524. if err := f(x); err != nil {
  10525. return err
  10526. }
  10527. if x.NextPageToken == "" {
  10528. return nil
  10529. }
  10530. c.PageToken(x.NextPageToken)
  10531. }
  10532. }
  10533. // method id "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list":
  10534. type BiddersFilterSetsNonBillableWinningBidsListCall struct {
  10535. s *Service
  10536. filterSetName string
  10537. urlParams_ gensupport.URLParams
  10538. ifNoneMatch_ string
  10539. ctx_ context.Context
  10540. header_ http.Header
  10541. }
  10542. // List: List all reasons for which winning bids were not billable, with
  10543. // the number
  10544. // of bids not billed for each reason.
  10545. func (r *BiddersFilterSetsNonBillableWinningBidsService) List(filterSetName string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10546. c := &BiddersFilterSetsNonBillableWinningBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10547. c.filterSetName = filterSetName
  10548. return c
  10549. }
  10550. // PageSize sets the optional parameter "pageSize": Requested page size.
  10551. // The server may return fewer results than requested.
  10552. // If unspecified, the server will pick an appropriate default.
  10553. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10554. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10555. return c
  10556. }
  10557. // PageToken sets the optional parameter "pageToken": A token
  10558. // identifying a page of results the server should return.
  10559. // Typically, this is the value
  10560. // of
  10561. // ListNonBillableWinningBidsResponse.nextPageToken
  10562. // returned from the previous call to the
  10563. // nonBillableWinningBids.list
  10564. // method.
  10565. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) PageToken(pageToken string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10566. c.urlParams_.Set("pageToken", pageToken)
  10567. return c
  10568. }
  10569. // Fields allows partial responses to be retrieved. See
  10570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10571. // for more information.
  10572. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10574. return c
  10575. }
  10576. // IfNoneMatch sets the optional parameter which makes the operation
  10577. // fail if the object's ETag matches the given value. This is useful for
  10578. // getting updates only after the object has changed since the last
  10579. // request. Use googleapi.IsNotModified to check whether the response
  10580. // error from Do is the result of In-None-Match.
  10581. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10582. c.ifNoneMatch_ = entityTag
  10583. return c
  10584. }
  10585. // Context sets the context to be used in this call's Do method. Any
  10586. // pending HTTP request will be aborted if the provided context is
  10587. // canceled.
  10588. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Context(ctx context.Context) *BiddersFilterSetsNonBillableWinningBidsListCall {
  10589. c.ctx_ = ctx
  10590. return c
  10591. }
  10592. // Header returns an http.Header that can be modified by the caller to
  10593. // add HTTP headers to the request.
  10594. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Header() http.Header {
  10595. if c.header_ == nil {
  10596. c.header_ = make(http.Header)
  10597. }
  10598. return c.header_
  10599. }
  10600. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) (*http.Response, error) {
  10601. reqHeaders := make(http.Header)
  10602. for k, v := range c.header_ {
  10603. reqHeaders[k] = v
  10604. }
  10605. reqHeaders.Set("User-Agent", c.s.userAgent())
  10606. if c.ifNoneMatch_ != "" {
  10607. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10608. }
  10609. var body io.Reader = nil
  10610. c.urlParams_.Set("alt", alt)
  10611. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids")
  10612. urls += "?" + c.urlParams_.Encode()
  10613. req, _ := http.NewRequest("GET", urls, body)
  10614. req.Header = reqHeaders
  10615. googleapi.Expand(req.URL, map[string]string{
  10616. "filterSetName": c.filterSetName,
  10617. })
  10618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10619. }
  10620. // Do executes the "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list" call.
  10621. // Exactly one of *ListNonBillableWinningBidsResponse or error will be
  10622. // non-nil. Any non-2xx status code is an error. Response headers are in
  10623. // either *ListNonBillableWinningBidsResponse.ServerResponse.Header or
  10624. // (if a response was returned at all) in
  10625. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10626. // whether the returned error was because http.StatusNotModified was
  10627. // returned.
  10628. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Do(opts ...googleapi.CallOption) (*ListNonBillableWinningBidsResponse, error) {
  10629. gensupport.SetOptions(c.urlParams_, opts...)
  10630. res, err := c.doRequest("json")
  10631. if res != nil && res.StatusCode == http.StatusNotModified {
  10632. if res.Body != nil {
  10633. res.Body.Close()
  10634. }
  10635. return nil, &googleapi.Error{
  10636. Code: res.StatusCode,
  10637. Header: res.Header,
  10638. }
  10639. }
  10640. if err != nil {
  10641. return nil, err
  10642. }
  10643. defer googleapi.CloseBody(res)
  10644. if err := googleapi.CheckResponse(res); err != nil {
  10645. return nil, err
  10646. }
  10647. ret := &ListNonBillableWinningBidsResponse{
  10648. ServerResponse: googleapi.ServerResponse{
  10649. Header: res.Header,
  10650. HTTPStatusCode: res.StatusCode,
  10651. },
  10652. }
  10653. target := &ret
  10654. if err := gensupport.DecodeResponse(target, res); err != nil {
  10655. return nil, err
  10656. }
  10657. return ret, nil
  10658. // {
  10659. // "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.",
  10660. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/nonBillableWinningBids",
  10661. // "httpMethod": "GET",
  10662. // "id": "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list",
  10663. // "parameterOrder": [
  10664. // "filterSetName"
  10665. // ],
  10666. // "parameters": {
  10667. // "filterSetName": {
  10668. // "description": "Name of the filter set that should be applied to the requested metrics.\nFor example:\n\n- For a bidder-level filter set for bidder 123:\n `bidders/123/filterSets/abc`\n\n- For an account-level filter set for the buyer account representing bidder\n 123: `bidders/123/accounts/123/filterSets/abc`\n\n- For an account-level filter set for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456/filterSets/abc`",
  10669. // "location": "path",
  10670. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  10671. // "required": true,
  10672. // "type": "string"
  10673. // },
  10674. // "pageSize": {
  10675. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  10676. // "format": "int32",
  10677. // "location": "query",
  10678. // "type": "integer"
  10679. // },
  10680. // "pageToken": {
  10681. // "description": "A token identifying a page of results the server should return.\nTypically, this is the value of\nListNonBillableWinningBidsResponse.nextPageToken\nreturned from the previous call to the nonBillableWinningBids.list\nmethod.",
  10682. // "location": "query",
  10683. // "type": "string"
  10684. // }
  10685. // },
  10686. // "path": "v2beta1/{+filterSetName}/nonBillableWinningBids",
  10687. // "response": {
  10688. // "$ref": "ListNonBillableWinningBidsResponse"
  10689. // },
  10690. // "scopes": [
  10691. // "https://www.googleapis.com/auth/adexchange.buyer"
  10692. // ]
  10693. // }
  10694. }
  10695. // Pages invokes f for each page of results.
  10696. // A non-nil error returned from f will halt the iteration.
  10697. // The provided context supersedes any context provided to the Context method.
  10698. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Pages(ctx context.Context, f func(*ListNonBillableWinningBidsResponse) error) error {
  10699. c.ctx_ = ctx
  10700. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10701. for {
  10702. x, err := c.Do()
  10703. if err != nil {
  10704. return err
  10705. }
  10706. if err := f(x); err != nil {
  10707. return err
  10708. }
  10709. if x.NextPageToken == "" {
  10710. return nil
  10711. }
  10712. c.PageToken(x.NextPageToken)
  10713. }
  10714. }