Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

17172 lignes
633 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package adexchangebuyer2 provides access to the Ad Exchange Buyer API II.
  6. //
  7. // For product documentation, see: https://developers.google.com/authorized-buyers/apis/reference/rest/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/adexchangebuyer2/v2beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // adexchangebuyer2Service, err := adexchangebuyer2.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // adexchangebuyer2Service, err := adexchangebuyer2.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // adexchangebuyer2Service, err := adexchangebuyer2.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package adexchangebuyer2 // import "google.golang.org/api/adexchangebuyer2/v2beta1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "adexchangebuyer2:v2beta1"
  67. const apiName = "adexchangebuyer2"
  68. const apiVersion = "v2beta1"
  69. const basePath = "https://adexchangebuyer.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // Manage your Ad Exchange buyer account configuration
  73. AdexchangeBuyerScope = "https://www.googleapis.com/auth/adexchange.buyer"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/adexchange.buyer",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Accounts = NewAccountsService(s)
  106. s.Bidders = NewBiddersService(s)
  107. return s, nil
  108. }
  109. type Service struct {
  110. client *http.Client
  111. BasePath string // API endpoint base URL
  112. UserAgent string // optional additional User-Agent fragment
  113. Accounts *AccountsService
  114. Bidders *BiddersService
  115. }
  116. func (s *Service) userAgent() string {
  117. if s.UserAgent == "" {
  118. return googleapi.UserAgent
  119. }
  120. return googleapi.UserAgent + " " + s.UserAgent
  121. }
  122. func NewAccountsService(s *Service) *AccountsService {
  123. rs := &AccountsService{s: s}
  124. rs.Clients = NewAccountsClientsService(s)
  125. rs.Creatives = NewAccountsCreativesService(s)
  126. rs.FinalizedProposals = NewAccountsFinalizedProposalsService(s)
  127. rs.Products = NewAccountsProductsService(s)
  128. rs.Proposals = NewAccountsProposalsService(s)
  129. rs.PublisherProfiles = NewAccountsPublisherProfilesService(s)
  130. return rs
  131. }
  132. type AccountsService struct {
  133. s *Service
  134. Clients *AccountsClientsService
  135. Creatives *AccountsCreativesService
  136. FinalizedProposals *AccountsFinalizedProposalsService
  137. Products *AccountsProductsService
  138. Proposals *AccountsProposalsService
  139. PublisherProfiles *AccountsPublisherProfilesService
  140. }
  141. func NewAccountsClientsService(s *Service) *AccountsClientsService {
  142. rs := &AccountsClientsService{s: s}
  143. rs.Invitations = NewAccountsClientsInvitationsService(s)
  144. rs.Users = NewAccountsClientsUsersService(s)
  145. return rs
  146. }
  147. type AccountsClientsService struct {
  148. s *Service
  149. Invitations *AccountsClientsInvitationsService
  150. Users *AccountsClientsUsersService
  151. }
  152. func NewAccountsClientsInvitationsService(s *Service) *AccountsClientsInvitationsService {
  153. rs := &AccountsClientsInvitationsService{s: s}
  154. return rs
  155. }
  156. type AccountsClientsInvitationsService struct {
  157. s *Service
  158. }
  159. func NewAccountsClientsUsersService(s *Service) *AccountsClientsUsersService {
  160. rs := &AccountsClientsUsersService{s: s}
  161. return rs
  162. }
  163. type AccountsClientsUsersService struct {
  164. s *Service
  165. }
  166. func NewAccountsCreativesService(s *Service) *AccountsCreativesService {
  167. rs := &AccountsCreativesService{s: s}
  168. rs.DealAssociations = NewAccountsCreativesDealAssociationsService(s)
  169. return rs
  170. }
  171. type AccountsCreativesService struct {
  172. s *Service
  173. DealAssociations *AccountsCreativesDealAssociationsService
  174. }
  175. func NewAccountsCreativesDealAssociationsService(s *Service) *AccountsCreativesDealAssociationsService {
  176. rs := &AccountsCreativesDealAssociationsService{s: s}
  177. return rs
  178. }
  179. type AccountsCreativesDealAssociationsService struct {
  180. s *Service
  181. }
  182. func NewAccountsFinalizedProposalsService(s *Service) *AccountsFinalizedProposalsService {
  183. rs := &AccountsFinalizedProposalsService{s: s}
  184. return rs
  185. }
  186. type AccountsFinalizedProposalsService struct {
  187. s *Service
  188. }
  189. func NewAccountsProductsService(s *Service) *AccountsProductsService {
  190. rs := &AccountsProductsService{s: s}
  191. return rs
  192. }
  193. type AccountsProductsService struct {
  194. s *Service
  195. }
  196. func NewAccountsProposalsService(s *Service) *AccountsProposalsService {
  197. rs := &AccountsProposalsService{s: s}
  198. return rs
  199. }
  200. type AccountsProposalsService struct {
  201. s *Service
  202. }
  203. func NewAccountsPublisherProfilesService(s *Service) *AccountsPublisherProfilesService {
  204. rs := &AccountsPublisherProfilesService{s: s}
  205. return rs
  206. }
  207. type AccountsPublisherProfilesService struct {
  208. s *Service
  209. }
  210. func NewBiddersService(s *Service) *BiddersService {
  211. rs := &BiddersService{s: s}
  212. rs.Accounts = NewBiddersAccountsService(s)
  213. rs.FilterSets = NewBiddersFilterSetsService(s)
  214. return rs
  215. }
  216. type BiddersService struct {
  217. s *Service
  218. Accounts *BiddersAccountsService
  219. FilterSets *BiddersFilterSetsService
  220. }
  221. func NewBiddersAccountsService(s *Service) *BiddersAccountsService {
  222. rs := &BiddersAccountsService{s: s}
  223. rs.Creatives = NewBiddersAccountsCreativesService(s)
  224. rs.FilterSets = NewBiddersAccountsFilterSetsService(s)
  225. return rs
  226. }
  227. type BiddersAccountsService struct {
  228. s *Service
  229. Creatives *BiddersAccountsCreativesService
  230. FilterSets *BiddersAccountsFilterSetsService
  231. }
  232. func NewBiddersAccountsCreativesService(s *Service) *BiddersAccountsCreativesService {
  233. rs := &BiddersAccountsCreativesService{s: s}
  234. return rs
  235. }
  236. type BiddersAccountsCreativesService struct {
  237. s *Service
  238. }
  239. func NewBiddersAccountsFilterSetsService(s *Service) *BiddersAccountsFilterSetsService {
  240. rs := &BiddersAccountsFilterSetsService{s: s}
  241. rs.BidMetrics = NewBiddersAccountsFilterSetsBidMetricsService(s)
  242. rs.BidResponseErrors = NewBiddersAccountsFilterSetsBidResponseErrorsService(s)
  243. rs.BidResponsesWithoutBids = NewBiddersAccountsFilterSetsBidResponsesWithoutBidsService(s)
  244. rs.FilteredBidRequests = NewBiddersAccountsFilterSetsFilteredBidRequestsService(s)
  245. rs.FilteredBids = NewBiddersAccountsFilterSetsFilteredBidsService(s)
  246. rs.ImpressionMetrics = NewBiddersAccountsFilterSetsImpressionMetricsService(s)
  247. rs.LosingBids = NewBiddersAccountsFilterSetsLosingBidsService(s)
  248. rs.NonBillableWinningBids = NewBiddersAccountsFilterSetsNonBillableWinningBidsService(s)
  249. return rs
  250. }
  251. type BiddersAccountsFilterSetsService struct {
  252. s *Service
  253. BidMetrics *BiddersAccountsFilterSetsBidMetricsService
  254. BidResponseErrors *BiddersAccountsFilterSetsBidResponseErrorsService
  255. BidResponsesWithoutBids *BiddersAccountsFilterSetsBidResponsesWithoutBidsService
  256. FilteredBidRequests *BiddersAccountsFilterSetsFilteredBidRequestsService
  257. FilteredBids *BiddersAccountsFilterSetsFilteredBidsService
  258. ImpressionMetrics *BiddersAccountsFilterSetsImpressionMetricsService
  259. LosingBids *BiddersAccountsFilterSetsLosingBidsService
  260. NonBillableWinningBids *BiddersAccountsFilterSetsNonBillableWinningBidsService
  261. }
  262. func NewBiddersAccountsFilterSetsBidMetricsService(s *Service) *BiddersAccountsFilterSetsBidMetricsService {
  263. rs := &BiddersAccountsFilterSetsBidMetricsService{s: s}
  264. return rs
  265. }
  266. type BiddersAccountsFilterSetsBidMetricsService struct {
  267. s *Service
  268. }
  269. func NewBiddersAccountsFilterSetsBidResponseErrorsService(s *Service) *BiddersAccountsFilterSetsBidResponseErrorsService {
  270. rs := &BiddersAccountsFilterSetsBidResponseErrorsService{s: s}
  271. return rs
  272. }
  273. type BiddersAccountsFilterSetsBidResponseErrorsService struct {
  274. s *Service
  275. }
  276. func NewBiddersAccountsFilterSetsBidResponsesWithoutBidsService(s *Service) *BiddersAccountsFilterSetsBidResponsesWithoutBidsService {
  277. rs := &BiddersAccountsFilterSetsBidResponsesWithoutBidsService{s: s}
  278. return rs
  279. }
  280. type BiddersAccountsFilterSetsBidResponsesWithoutBidsService struct {
  281. s *Service
  282. }
  283. func NewBiddersAccountsFilterSetsFilteredBidRequestsService(s *Service) *BiddersAccountsFilterSetsFilteredBidRequestsService {
  284. rs := &BiddersAccountsFilterSetsFilteredBidRequestsService{s: s}
  285. return rs
  286. }
  287. type BiddersAccountsFilterSetsFilteredBidRequestsService struct {
  288. s *Service
  289. }
  290. func NewBiddersAccountsFilterSetsFilteredBidsService(s *Service) *BiddersAccountsFilterSetsFilteredBidsService {
  291. rs := &BiddersAccountsFilterSetsFilteredBidsService{s: s}
  292. rs.Creatives = NewBiddersAccountsFilterSetsFilteredBidsCreativesService(s)
  293. rs.Details = NewBiddersAccountsFilterSetsFilteredBidsDetailsService(s)
  294. return rs
  295. }
  296. type BiddersAccountsFilterSetsFilteredBidsService struct {
  297. s *Service
  298. Creatives *BiddersAccountsFilterSetsFilteredBidsCreativesService
  299. Details *BiddersAccountsFilterSetsFilteredBidsDetailsService
  300. }
  301. func NewBiddersAccountsFilterSetsFilteredBidsCreativesService(s *Service) *BiddersAccountsFilterSetsFilteredBidsCreativesService {
  302. rs := &BiddersAccountsFilterSetsFilteredBidsCreativesService{s: s}
  303. return rs
  304. }
  305. type BiddersAccountsFilterSetsFilteredBidsCreativesService struct {
  306. s *Service
  307. }
  308. func NewBiddersAccountsFilterSetsFilteredBidsDetailsService(s *Service) *BiddersAccountsFilterSetsFilteredBidsDetailsService {
  309. rs := &BiddersAccountsFilterSetsFilteredBidsDetailsService{s: s}
  310. return rs
  311. }
  312. type BiddersAccountsFilterSetsFilteredBidsDetailsService struct {
  313. s *Service
  314. }
  315. func NewBiddersAccountsFilterSetsImpressionMetricsService(s *Service) *BiddersAccountsFilterSetsImpressionMetricsService {
  316. rs := &BiddersAccountsFilterSetsImpressionMetricsService{s: s}
  317. return rs
  318. }
  319. type BiddersAccountsFilterSetsImpressionMetricsService struct {
  320. s *Service
  321. }
  322. func NewBiddersAccountsFilterSetsLosingBidsService(s *Service) *BiddersAccountsFilterSetsLosingBidsService {
  323. rs := &BiddersAccountsFilterSetsLosingBidsService{s: s}
  324. return rs
  325. }
  326. type BiddersAccountsFilterSetsLosingBidsService struct {
  327. s *Service
  328. }
  329. func NewBiddersAccountsFilterSetsNonBillableWinningBidsService(s *Service) *BiddersAccountsFilterSetsNonBillableWinningBidsService {
  330. rs := &BiddersAccountsFilterSetsNonBillableWinningBidsService{s: s}
  331. return rs
  332. }
  333. type BiddersAccountsFilterSetsNonBillableWinningBidsService struct {
  334. s *Service
  335. }
  336. func NewBiddersFilterSetsService(s *Service) *BiddersFilterSetsService {
  337. rs := &BiddersFilterSetsService{s: s}
  338. rs.BidMetrics = NewBiddersFilterSetsBidMetricsService(s)
  339. rs.BidResponseErrors = NewBiddersFilterSetsBidResponseErrorsService(s)
  340. rs.BidResponsesWithoutBids = NewBiddersFilterSetsBidResponsesWithoutBidsService(s)
  341. rs.FilteredBidRequests = NewBiddersFilterSetsFilteredBidRequestsService(s)
  342. rs.FilteredBids = NewBiddersFilterSetsFilteredBidsService(s)
  343. rs.ImpressionMetrics = NewBiddersFilterSetsImpressionMetricsService(s)
  344. rs.LosingBids = NewBiddersFilterSetsLosingBidsService(s)
  345. rs.NonBillableWinningBids = NewBiddersFilterSetsNonBillableWinningBidsService(s)
  346. return rs
  347. }
  348. type BiddersFilterSetsService struct {
  349. s *Service
  350. BidMetrics *BiddersFilterSetsBidMetricsService
  351. BidResponseErrors *BiddersFilterSetsBidResponseErrorsService
  352. BidResponsesWithoutBids *BiddersFilterSetsBidResponsesWithoutBidsService
  353. FilteredBidRequests *BiddersFilterSetsFilteredBidRequestsService
  354. FilteredBids *BiddersFilterSetsFilteredBidsService
  355. ImpressionMetrics *BiddersFilterSetsImpressionMetricsService
  356. LosingBids *BiddersFilterSetsLosingBidsService
  357. NonBillableWinningBids *BiddersFilterSetsNonBillableWinningBidsService
  358. }
  359. func NewBiddersFilterSetsBidMetricsService(s *Service) *BiddersFilterSetsBidMetricsService {
  360. rs := &BiddersFilterSetsBidMetricsService{s: s}
  361. return rs
  362. }
  363. type BiddersFilterSetsBidMetricsService struct {
  364. s *Service
  365. }
  366. func NewBiddersFilterSetsBidResponseErrorsService(s *Service) *BiddersFilterSetsBidResponseErrorsService {
  367. rs := &BiddersFilterSetsBidResponseErrorsService{s: s}
  368. return rs
  369. }
  370. type BiddersFilterSetsBidResponseErrorsService struct {
  371. s *Service
  372. }
  373. func NewBiddersFilterSetsBidResponsesWithoutBidsService(s *Service) *BiddersFilterSetsBidResponsesWithoutBidsService {
  374. rs := &BiddersFilterSetsBidResponsesWithoutBidsService{s: s}
  375. return rs
  376. }
  377. type BiddersFilterSetsBidResponsesWithoutBidsService struct {
  378. s *Service
  379. }
  380. func NewBiddersFilterSetsFilteredBidRequestsService(s *Service) *BiddersFilterSetsFilteredBidRequestsService {
  381. rs := &BiddersFilterSetsFilteredBidRequestsService{s: s}
  382. return rs
  383. }
  384. type BiddersFilterSetsFilteredBidRequestsService struct {
  385. s *Service
  386. }
  387. func NewBiddersFilterSetsFilteredBidsService(s *Service) *BiddersFilterSetsFilteredBidsService {
  388. rs := &BiddersFilterSetsFilteredBidsService{s: s}
  389. rs.Creatives = NewBiddersFilterSetsFilteredBidsCreativesService(s)
  390. rs.Details = NewBiddersFilterSetsFilteredBidsDetailsService(s)
  391. return rs
  392. }
  393. type BiddersFilterSetsFilteredBidsService struct {
  394. s *Service
  395. Creatives *BiddersFilterSetsFilteredBidsCreativesService
  396. Details *BiddersFilterSetsFilteredBidsDetailsService
  397. }
  398. func NewBiddersFilterSetsFilteredBidsCreativesService(s *Service) *BiddersFilterSetsFilteredBidsCreativesService {
  399. rs := &BiddersFilterSetsFilteredBidsCreativesService{s: s}
  400. return rs
  401. }
  402. type BiddersFilterSetsFilteredBidsCreativesService struct {
  403. s *Service
  404. }
  405. func NewBiddersFilterSetsFilteredBidsDetailsService(s *Service) *BiddersFilterSetsFilteredBidsDetailsService {
  406. rs := &BiddersFilterSetsFilteredBidsDetailsService{s: s}
  407. return rs
  408. }
  409. type BiddersFilterSetsFilteredBidsDetailsService struct {
  410. s *Service
  411. }
  412. func NewBiddersFilterSetsImpressionMetricsService(s *Service) *BiddersFilterSetsImpressionMetricsService {
  413. rs := &BiddersFilterSetsImpressionMetricsService{s: s}
  414. return rs
  415. }
  416. type BiddersFilterSetsImpressionMetricsService struct {
  417. s *Service
  418. }
  419. func NewBiddersFilterSetsLosingBidsService(s *Service) *BiddersFilterSetsLosingBidsService {
  420. rs := &BiddersFilterSetsLosingBidsService{s: s}
  421. return rs
  422. }
  423. type BiddersFilterSetsLosingBidsService struct {
  424. s *Service
  425. }
  426. func NewBiddersFilterSetsNonBillableWinningBidsService(s *Service) *BiddersFilterSetsNonBillableWinningBidsService {
  427. rs := &BiddersFilterSetsNonBillableWinningBidsService{s: s}
  428. return rs
  429. }
  430. type BiddersFilterSetsNonBillableWinningBidsService struct {
  431. s *Service
  432. }
  433. // AbsoluteDateRange: An absolute date range, specified by its start
  434. // date and end date.
  435. // The supported range of dates begins 30 days before today and ends
  436. // today.
  437. // Validity checked upon filter set creation. If a filter set with an
  438. // absolute
  439. // date range is run at a later date more than 30 days after start_date,
  440. // it will
  441. // fail.
  442. type AbsoluteDateRange struct {
  443. // EndDate: The end date of the range (inclusive).
  444. // Must be within the 30 days leading up to current date, and must be
  445. // equal to
  446. // or after start_date.
  447. EndDate *Date `json:"endDate,omitempty"`
  448. // StartDate: The start date of the range (inclusive).
  449. // Must be within the 30 days leading up to current date, and must be
  450. // equal to
  451. // or before end_date.
  452. StartDate *Date `json:"startDate,omitempty"`
  453. // ForceSendFields is a list of field names (e.g. "EndDate") to
  454. // unconditionally include in API requests. By default, fields with
  455. // empty values are omitted from API requests. However, any non-pointer,
  456. // non-interface field appearing in ForceSendFields will be sent to the
  457. // server regardless of whether the field is empty or not. This may be
  458. // used to include empty fields in Patch requests.
  459. ForceSendFields []string `json:"-"`
  460. // NullFields is a list of field names (e.g. "EndDate") to include in
  461. // API requests with the JSON null value. By default, fields with empty
  462. // values are omitted from API requests. However, any field with an
  463. // empty value appearing in NullFields will be sent to the server as
  464. // null. It is an error if a field in this list has a non-empty value.
  465. // This may be used to include null fields in Patch requests.
  466. NullFields []string `json:"-"`
  467. }
  468. func (s *AbsoluteDateRange) MarshalJSON() ([]byte, error) {
  469. type NoMethod AbsoluteDateRange
  470. raw := NoMethod(*s)
  471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  472. }
  473. // AcceptProposalRequest: Request to accept a proposal.
  474. type AcceptProposalRequest struct {
  475. // ProposalRevision: The last known client revision number of the
  476. // proposal.
  477. ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
  478. // ForceSendFields is a list of field names (e.g. "ProposalRevision") to
  479. // unconditionally include in API requests. By default, fields with
  480. // empty values are omitted from API requests. However, any non-pointer,
  481. // non-interface field appearing in ForceSendFields will be sent to the
  482. // server regardless of whether the field is empty or not. This may be
  483. // used to include empty fields in Patch requests.
  484. ForceSendFields []string `json:"-"`
  485. // NullFields is a list of field names (e.g. "ProposalRevision") to
  486. // include in API requests with the JSON null value. By default, fields
  487. // with empty values are omitted from API requests. However, any field
  488. // with an empty value appearing in NullFields will be sent to the
  489. // server as null. It is an error if a field in this list has a
  490. // non-empty value. This may be used to include null fields in Patch
  491. // requests.
  492. NullFields []string `json:"-"`
  493. }
  494. func (s *AcceptProposalRequest) MarshalJSON() ([]byte, error) {
  495. type NoMethod AcceptProposalRequest
  496. raw := NoMethod(*s)
  497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  498. }
  499. // AdSize: Represents size of a single ad slot, or a creative.
  500. type AdSize struct {
  501. // Height: The height of the ad slot in pixels.
  502. // This field will be present only when size type is `PIXEL`.
  503. Height int64 `json:"height,omitempty,string"`
  504. // SizeType: The size type of the ad slot.
  505. //
  506. // Possible values:
  507. // "SIZE_TYPE_UNSPECIFIED" - A placeholder for an undefined size type.
  508. // "PIXEL" - Ad slot with size specified by height and width in
  509. // pixels.
  510. // "INTERSTITIAL" - Special size to describe an interstitial ad slot.
  511. // "NATIVE" - Native (mobile) ads rendered by the publisher.
  512. // "FLUID" - Fluid size (i.e., responsive size) can be resized
  513. // automatically with the
  514. // change of outside environment.
  515. SizeType string `json:"sizeType,omitempty"`
  516. // Width: The width of the ad slot in pixels.
  517. // This field will be present only when size type is `PIXEL`.
  518. Width int64 `json:"width,omitempty,string"`
  519. // ForceSendFields is a list of field names (e.g. "Height") to
  520. // unconditionally include in API requests. By default, fields with
  521. // empty values are omitted from API requests. However, any non-pointer,
  522. // non-interface field appearing in ForceSendFields will be sent to the
  523. // server regardless of whether the field is empty or not. This may be
  524. // used to include empty fields in Patch requests.
  525. ForceSendFields []string `json:"-"`
  526. // NullFields is a list of field names (e.g. "Height") to include in API
  527. // requests with the JSON null value. By default, fields with empty
  528. // values are omitted from API requests. However, any field with an
  529. // empty value appearing in NullFields will be sent to the server as
  530. // null. It is an error if a field in this list has a non-empty value.
  531. // This may be used to include null fields in Patch requests.
  532. NullFields []string `json:"-"`
  533. }
  534. func (s *AdSize) MarshalJSON() ([]byte, error) {
  535. type NoMethod AdSize
  536. raw := NoMethod(*s)
  537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  538. }
  539. // AddDealAssociationRequest: A request for associating a deal and a
  540. // creative.
  541. type AddDealAssociationRequest struct {
  542. // Association: The association between a creative and a deal that
  543. // should be added.
  544. Association *CreativeDealAssociation `json:"association,omitempty"`
  545. // ForceSendFields is a list of field names (e.g. "Association") to
  546. // unconditionally include in API requests. By default, fields with
  547. // empty values are omitted from API requests. However, any non-pointer,
  548. // non-interface field appearing in ForceSendFields will be sent to the
  549. // server regardless of whether the field is empty or not. This may be
  550. // used to include empty fields in Patch requests.
  551. ForceSendFields []string `json:"-"`
  552. // NullFields is a list of field names (e.g. "Association") to include
  553. // in API requests with the JSON null value. By default, fields with
  554. // empty values are omitted from API requests. However, any field with
  555. // an empty value appearing in NullFields will be sent to the server as
  556. // null. It is an error if a field in this list has a non-empty value.
  557. // This may be used to include null fields in Patch requests.
  558. NullFields []string `json:"-"`
  559. }
  560. func (s *AddDealAssociationRequest) MarshalJSON() ([]byte, error) {
  561. type NoMethod AddDealAssociationRequest
  562. raw := NoMethod(*s)
  563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  564. }
  565. // AddNoteRequest: Request message for adding a note to a given
  566. // proposal.
  567. type AddNoteRequest struct {
  568. // Note: Details of the note to add.
  569. Note *Note `json:"note,omitempty"`
  570. // ForceSendFields is a list of field names (e.g. "Note") to
  571. // unconditionally include in API requests. By default, fields with
  572. // empty values are omitted from API requests. However, any non-pointer,
  573. // non-interface field appearing in ForceSendFields will be sent to the
  574. // server regardless of whether the field is empty or not. This may be
  575. // used to include empty fields in Patch requests.
  576. ForceSendFields []string `json:"-"`
  577. // NullFields is a list of field names (e.g. "Note") to include in API
  578. // requests with the JSON null value. By default, fields with empty
  579. // values are omitted from API requests. However, any field with an
  580. // empty value appearing in NullFields will be sent to the server as
  581. // null. It is an error if a field in this list has a non-empty value.
  582. // This may be used to include null fields in Patch requests.
  583. NullFields []string `json:"-"`
  584. }
  585. func (s *AddNoteRequest) MarshalJSON() ([]byte, error) {
  586. type NoMethod AddNoteRequest
  587. raw := NoMethod(*s)
  588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  589. }
  590. // AppContext: @OutputOnly The app type the restriction applies to for
  591. // mobile device.
  592. type AppContext struct {
  593. // AppTypes: The app types this restriction applies to.
  594. //
  595. // Possible values:
  596. // "NATIVE" - Native app context.
  597. // "WEB" - Mobile web app context.
  598. AppTypes []string `json:"appTypes,omitempty"`
  599. // ForceSendFields is a list of field names (e.g. "AppTypes") to
  600. // unconditionally include in API requests. By default, fields with
  601. // empty values are omitted from API requests. However, any non-pointer,
  602. // non-interface field appearing in ForceSendFields will be sent to the
  603. // server regardless of whether the field is empty or not. This may be
  604. // used to include empty fields in Patch requests.
  605. ForceSendFields []string `json:"-"`
  606. // NullFields is a list of field names (e.g. "AppTypes") to include in
  607. // API requests with the JSON null value. By default, fields with empty
  608. // values are omitted from API requests. However, any field with an
  609. // empty value appearing in NullFields will be sent to the server as
  610. // null. It is an error if a field in this list has a non-empty value.
  611. // This may be used to include null fields in Patch requests.
  612. NullFields []string `json:"-"`
  613. }
  614. func (s *AppContext) MarshalJSON() ([]byte, error) {
  615. type NoMethod AppContext
  616. raw := NoMethod(*s)
  617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  618. }
  619. // AuctionContext: @OutputOnly The auction type the restriction applies
  620. // to.
  621. type AuctionContext struct {
  622. // AuctionTypes: The auction types this restriction applies to.
  623. //
  624. // Possible values:
  625. // "OPEN_AUCTION" - The restriction applies to open auction.
  626. // "DIRECT_DEALS" - The restriction applies to direct deals.
  627. AuctionTypes []string `json:"auctionTypes,omitempty"`
  628. // ForceSendFields is a list of field names (e.g. "AuctionTypes") to
  629. // unconditionally include in API requests. By default, fields with
  630. // empty values are omitted from API requests. However, any non-pointer,
  631. // non-interface field appearing in ForceSendFields will be sent to the
  632. // server regardless of whether the field is empty or not. This may be
  633. // used to include empty fields in Patch requests.
  634. ForceSendFields []string `json:"-"`
  635. // NullFields is a list of field names (e.g. "AuctionTypes") to include
  636. // in API requests with the JSON null value. By default, fields with
  637. // empty values are omitted from API requests. However, any field with
  638. // an empty value appearing in NullFields will be sent to the server as
  639. // null. It is an error if a field in this list has a non-empty value.
  640. // This may be used to include null fields in Patch requests.
  641. NullFields []string `json:"-"`
  642. }
  643. func (s *AuctionContext) MarshalJSON() ([]byte, error) {
  644. type NoMethod AuctionContext
  645. raw := NoMethod(*s)
  646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  647. }
  648. // BidMetricsRow: The set of metrics that are measured in numbers of
  649. // bids, representing how
  650. // many bids with the specified dimension values were considered
  651. // eligible at
  652. // each stage of the bidding funnel;
  653. type BidMetricsRow struct {
  654. // Bids: The number of bids that Ad Exchange received from the buyer.
  655. Bids *MetricValue `json:"bids,omitempty"`
  656. // BidsInAuction: The number of bids that were permitted to compete in
  657. // the auction.
  658. BidsInAuction *MetricValue `json:"bidsInAuction,omitempty"`
  659. // BilledImpressions: The number of bids for which the buyer was billed.
  660. BilledImpressions *MetricValue `json:"billedImpressions,omitempty"`
  661. // ImpressionsWon: The number of bids that won an impression.
  662. ImpressionsWon *MetricValue `json:"impressionsWon,omitempty"`
  663. // MeasurableImpressions: The number of bids for which the corresponding
  664. // impression was measurable
  665. // for viewability (as defined by Active View).
  666. MeasurableImpressions *MetricValue `json:"measurableImpressions,omitempty"`
  667. // RowDimensions: The values of all dimensions associated with metric
  668. // values in this row.
  669. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  670. // ViewableImpressions: The number of bids for which the corresponding
  671. // impression was viewable (as
  672. // defined by Active View).
  673. ViewableImpressions *MetricValue `json:"viewableImpressions,omitempty"`
  674. // ForceSendFields is a list of field names (e.g. "Bids") to
  675. // unconditionally include in API requests. By default, fields with
  676. // empty values are omitted from API requests. However, any non-pointer,
  677. // non-interface field appearing in ForceSendFields will be sent to the
  678. // server regardless of whether the field is empty or not. This may be
  679. // used to include empty fields in Patch requests.
  680. ForceSendFields []string `json:"-"`
  681. // NullFields is a list of field names (e.g. "Bids") to include in API
  682. // requests with the JSON null value. By default, fields with empty
  683. // values are omitted from API requests. However, any field with an
  684. // empty value appearing in NullFields will be sent to the server as
  685. // null. It is an error if a field in this list has a non-empty value.
  686. // This may be used to include null fields in Patch requests.
  687. NullFields []string `json:"-"`
  688. }
  689. func (s *BidMetricsRow) MarshalJSON() ([]byte, error) {
  690. type NoMethod BidMetricsRow
  691. raw := NoMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  693. }
  694. // BidResponseWithoutBidsStatusRow: The number of impressions with the
  695. // specified dimension values that were
  696. // considered to have no applicable bids, as described by the specified
  697. // status.
  698. type BidResponseWithoutBidsStatusRow struct {
  699. // ImpressionCount: The number of impressions for which there was a bid
  700. // response with the
  701. // specified status.
  702. ImpressionCount *MetricValue `json:"impressionCount,omitempty"`
  703. // RowDimensions: The values of all dimensions associated with metric
  704. // values in this row.
  705. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  706. // Status: The status specifying why the bid responses were considered
  707. // to have no
  708. // applicable bids.
  709. //
  710. // Possible values:
  711. // "STATUS_UNSPECIFIED" - A placeholder for an undefined status.
  712. // This value will never be returned in responses.
  713. // "RESPONSES_WITHOUT_BIDS" - The response had no bids.
  714. // "RESPONSES_WITHOUT_BIDS_FOR_ACCOUNT" - The response had no bids for
  715. // the specified account, though it may have
  716. // included bids on behalf of other accounts.
  717. // "RESPONSES_WITHOUT_BIDS_FOR_DEAL" - The response had no bids for
  718. // the specified deal, though it may have
  719. // included bids on other deals on behalf of the account to which the
  720. // deal
  721. // belongs.
  722. Status string `json:"status,omitempty"`
  723. // ForceSendFields is a list of field names (e.g. "ImpressionCount") to
  724. // unconditionally include in API requests. By default, fields with
  725. // empty values are omitted from API requests. However, any non-pointer,
  726. // non-interface field appearing in ForceSendFields will be sent to the
  727. // server regardless of whether the field is empty or not. This may be
  728. // used to include empty fields in Patch requests.
  729. ForceSendFields []string `json:"-"`
  730. // NullFields is a list of field names (e.g. "ImpressionCount") to
  731. // include in API requests with the JSON null value. By default, fields
  732. // with empty values are omitted from API requests. However, any field
  733. // with an empty value appearing in NullFields will be sent to the
  734. // server as null. It is an error if a field in this list has a
  735. // non-empty value. This may be used to include null fields in Patch
  736. // requests.
  737. NullFields []string `json:"-"`
  738. }
  739. func (s *BidResponseWithoutBidsStatusRow) MarshalJSON() ([]byte, error) {
  740. type NoMethod BidResponseWithoutBidsStatusRow
  741. raw := NoMethod(*s)
  742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  743. }
  744. // Buyer: Represents a buyer of inventory. Each buyer is identified by a
  745. // unique
  746. // Authorized Buyers account ID.
  747. type Buyer struct {
  748. // AccountId: Authorized Buyers account ID of the buyer.
  749. AccountId string `json:"accountId,omitempty"`
  750. // ForceSendFields is a list of field names (e.g. "AccountId") to
  751. // unconditionally include in API requests. By default, fields with
  752. // empty values are omitted from API requests. However, any non-pointer,
  753. // non-interface field appearing in ForceSendFields will be sent to the
  754. // server regardless of whether the field is empty or not. This may be
  755. // used to include empty fields in Patch requests.
  756. ForceSendFields []string `json:"-"`
  757. // NullFields is a list of field names (e.g. "AccountId") to include in
  758. // API requests with the JSON null value. By default, fields with empty
  759. // values are omitted from API requests. However, any field with an
  760. // empty value appearing in NullFields will be sent to the server as
  761. // null. It is an error if a field in this list has a non-empty value.
  762. // This may be used to include null fields in Patch requests.
  763. NullFields []string `json:"-"`
  764. }
  765. func (s *Buyer) MarshalJSON() ([]byte, error) {
  766. type NoMethod Buyer
  767. raw := NoMethod(*s)
  768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  769. }
  770. // CalloutStatusRow: The number of impressions with the specified
  771. // dimension values where the
  772. // corresponding bid request or bid response was not successful, as
  773. // described by
  774. // the specified callout status.
  775. type CalloutStatusRow struct {
  776. // CalloutStatusId: The ID of the callout status.
  777. // See
  778. // [callout-status-codes](https://developers.google.com/authorized-buyers
  779. // /rtb/downloads/callout-status-codes).
  780. CalloutStatusId int64 `json:"calloutStatusId,omitempty"`
  781. // ImpressionCount: The number of impressions for which there was a bid
  782. // request or bid response
  783. // with the specified callout status.
  784. ImpressionCount *MetricValue `json:"impressionCount,omitempty"`
  785. // RowDimensions: The values of all dimensions associated with metric
  786. // values in this row.
  787. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  788. // ForceSendFields is a list of field names (e.g. "CalloutStatusId") to
  789. // unconditionally include in API requests. By default, fields with
  790. // empty values are omitted from API requests. However, any non-pointer,
  791. // non-interface field appearing in ForceSendFields will be sent to the
  792. // server regardless of whether the field is empty or not. This may be
  793. // used to include empty fields in Patch requests.
  794. ForceSendFields []string `json:"-"`
  795. // NullFields is a list of field names (e.g. "CalloutStatusId") to
  796. // include in API requests with the JSON null value. By default, fields
  797. // with empty values are omitted from API requests. However, any field
  798. // with an empty value appearing in NullFields will be sent to the
  799. // server as null. It is an error if a field in this list has a
  800. // non-empty value. This may be used to include null fields in Patch
  801. // requests.
  802. NullFields []string `json:"-"`
  803. }
  804. func (s *CalloutStatusRow) MarshalJSON() ([]byte, error) {
  805. type NoMethod CalloutStatusRow
  806. raw := NoMethod(*s)
  807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  808. }
  809. // CancelNegotiationRequest: Request to cancel an ongoing negotiation.
  810. type CancelNegotiationRequest struct {
  811. }
  812. // Client: A client resource represents a client buyer—an agency,
  813. // a brand, or an
  814. // advertiser customer of the sponsor buyer. Users associated with the
  815. // client
  816. // buyer have restricted access to the Marketplace and certain other
  817. // sections of
  818. // the Authorized Buyers UI based on the role granted to the client
  819. // buyer. All
  820. // fields are required unless otherwise specified.
  821. type Client struct {
  822. // ClientAccountId: The globally-unique numerical ID of the client.
  823. // The value of this field is ignored in create and update operations.
  824. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  825. // ClientName: Name used to represent this client to publishers.
  826. // You may have multiple clients that map to the same entity,
  827. // but for each client the combination of `clientName` and entity
  828. // must be unique.
  829. // You can specify this field as empty.
  830. ClientName string `json:"clientName,omitempty"`
  831. // EntityId: Numerical identifier of the client entity.
  832. // The entity can be an advertiser, a brand, or an agency.
  833. // This identifier is unique among all the entities with the same
  834. // type.
  835. //
  836. // A list of all known advertisers with their identifiers is available
  837. // in
  838. // the
  839. // [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionar
  840. // ies/advertisers.txt)
  841. // file.
  842. //
  843. // A list of all known brands with their identifiers is available in
  844. // the
  845. // [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/b
  846. // rands.txt)
  847. // file.
  848. //
  849. // A list of all known agencies with their identifiers is available in
  850. // the
  851. // [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries
  852. // /agencies.txt)
  853. // file.
  854. EntityId int64 `json:"entityId,omitempty,string"`
  855. // EntityName: The name of the entity. This field is automatically
  856. // fetched based on
  857. // the type and ID.
  858. // The value of this field is ignored in create and update operations.
  859. EntityName string `json:"entityName,omitempty"`
  860. // EntityType: The type of the client entity: `ADVERTISER`, `BRAND`, or
  861. // `AGENCY`.
  862. //
  863. // Possible values:
  864. // "ENTITY_TYPE_UNSPECIFIED" - A placeholder for an undefined client
  865. // entity type. Should not be used.
  866. // "ADVERTISER" - An advertiser.
  867. // "BRAND" - A brand.
  868. // "AGENCY" - An advertising agency.
  869. EntityType string `json:"entityType,omitempty"`
  870. // PartnerClientId: Optional arbitrary unique identifier of this client
  871. // buyer from the
  872. // standpoint of its Ad Exchange sponsor buyer.
  873. //
  874. // This field can be used to associate a client buyer with the
  875. // identifier
  876. // in the namespace of its sponsor buyer, lookup client buyers by
  877. // that
  878. // identifier and verify whether an Ad Exchange counterpart of a given
  879. // client
  880. // buyer already exists.
  881. //
  882. // If present, must be unique among all the client buyers for its
  883. // Ad Exchange sponsor buyer.
  884. PartnerClientId string `json:"partnerClientId,omitempty"`
  885. // Role: The role which is assigned to the client buyer. Each role
  886. // implies a set of
  887. // permissions granted to the client. Must be one of
  888. // `CLIENT_DEAL_VIEWER`,
  889. // `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`.
  890. //
  891. // Possible values:
  892. // "CLIENT_ROLE_UNSPECIFIED" - A placeholder for an undefined client
  893. // role.
  894. // "CLIENT_DEAL_VIEWER" - Users associated with this client can see
  895. // publisher deal offers
  896. // in the Marketplace.
  897. // They can neither negotiate proposals nor approve deals.
  898. // If this client is visible to publishers, they can send deal
  899. // proposals
  900. // to this client.
  901. // "CLIENT_DEAL_NEGOTIATOR" - Users associated with this client can
  902. // respond to deal proposals
  903. // sent to them by publishers. They can also initiate deal proposals
  904. // of their own.
  905. // "CLIENT_DEAL_APPROVER" - Users associated with this client can
  906. // approve eligible deals
  907. // on your behalf. Some deals may still explicitly require
  908. // publisher
  909. // finalization. If this role is not selected, the sponsor buyer
  910. // will need to manually approve each of their deals.
  911. Role string `json:"role,omitempty"`
  912. // Status: The status of the client buyer.
  913. //
  914. // Possible values:
  915. // "CLIENT_STATUS_UNSPECIFIED" - A placeholder for an undefined client
  916. // status.
  917. // "DISABLED" - A client that is currently disabled.
  918. // "ACTIVE" - A client that is currently active.
  919. Status string `json:"status,omitempty"`
  920. // VisibleToSeller: Whether the client buyer will be visible to sellers.
  921. VisibleToSeller bool `json:"visibleToSeller,omitempty"`
  922. // ServerResponse contains the HTTP response code and headers from the
  923. // server.
  924. googleapi.ServerResponse `json:"-"`
  925. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  926. // unconditionally include in API requests. By default, fields with
  927. // empty values are omitted from API requests. However, any non-pointer,
  928. // non-interface field appearing in ForceSendFields will be sent to the
  929. // server regardless of whether the field is empty or not. This may be
  930. // used to include empty fields in Patch requests.
  931. ForceSendFields []string `json:"-"`
  932. // NullFields is a list of field names (e.g. "ClientAccountId") to
  933. // include in API requests with the JSON null value. By default, fields
  934. // with empty values are omitted from API requests. However, any field
  935. // with an empty value appearing in NullFields will be sent to the
  936. // server as null. It is an error if a field in this list has a
  937. // non-empty value. This may be used to include null fields in Patch
  938. // requests.
  939. NullFields []string `json:"-"`
  940. }
  941. func (s *Client) MarshalJSON() ([]byte, error) {
  942. type NoMethod Client
  943. raw := NoMethod(*s)
  944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  945. }
  946. // ClientUser: A client user is created under a client buyer and has
  947. // restricted access to
  948. // the Marketplace and certain other sections of the Authorized Buyers
  949. // UI based
  950. // on the role granted to the associated client buyer.
  951. //
  952. // The only way a new client user can be created is via accepting
  953. // an
  954. // email invitation
  955. // (see the
  956. // accounts.clients.invitations.create
  957. // method).
  958. //
  959. // All fields are required unless otherwise specified.
  960. type ClientUser struct {
  961. // ClientAccountId: Numerical account ID of the client buyer
  962. // with which the user is associated; the
  963. // buyer must be a client of the current sponsor buyer.
  964. // The value of this field is ignored in an update operation.
  965. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  966. // Email: User's email address. The value of this field
  967. // is ignored in an update operation.
  968. Email string `json:"email,omitempty"`
  969. // Status: The status of the client user.
  970. //
  971. // Possible values:
  972. // "USER_STATUS_UNSPECIFIED" - A placeholder for an undefined user
  973. // status.
  974. // "PENDING" - A user who was already created but hasn't accepted the
  975. // invitation yet.
  976. // "ACTIVE" - A user that is currently active.
  977. // "DISABLED" - A user that is currently disabled.
  978. Status string `json:"status,omitempty"`
  979. // UserId: The unique numerical ID of the client user
  980. // that has accepted an invitation.
  981. // The value of this field is ignored in an update operation.
  982. UserId int64 `json:"userId,omitempty,string"`
  983. // ServerResponse contains the HTTP response code and headers from the
  984. // server.
  985. googleapi.ServerResponse `json:"-"`
  986. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  987. // unconditionally include in API requests. By default, fields with
  988. // empty values are omitted from API requests. However, any non-pointer,
  989. // non-interface field appearing in ForceSendFields will be sent to the
  990. // server regardless of whether the field is empty or not. This may be
  991. // used to include empty fields in Patch requests.
  992. ForceSendFields []string `json:"-"`
  993. // NullFields is a list of field names (e.g. "ClientAccountId") to
  994. // include in API requests with the JSON null value. By default, fields
  995. // with empty values are omitted from API requests. However, any field
  996. // with an empty value appearing in NullFields will be sent to the
  997. // server as null. It is an error if a field in this list has a
  998. // non-empty value. This may be used to include null fields in Patch
  999. // requests.
  1000. NullFields []string `json:"-"`
  1001. }
  1002. func (s *ClientUser) MarshalJSON() ([]byte, error) {
  1003. type NoMethod ClientUser
  1004. raw := NoMethod(*s)
  1005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1006. }
  1007. // ClientUserInvitation: An invitation for a new client user to get
  1008. // access to the Authorized Buyers
  1009. // UI. All fields are required unless otherwise specified.
  1010. type ClientUserInvitation struct {
  1011. // ClientAccountId: Numerical account ID of the client buyer
  1012. // that the invited user is associated with.
  1013. // The value of this field is ignored in create operations.
  1014. ClientAccountId int64 `json:"clientAccountId,omitempty,string"`
  1015. // Email: The email address to which the invitation is sent.
  1016. // Email
  1017. // addresses should be unique among all client users under each
  1018. // sponsor
  1019. // buyer.
  1020. Email string `json:"email,omitempty"`
  1021. // InvitationId: The unique numerical ID of the invitation that is sent
  1022. // to the user.
  1023. // The value of this field is ignored in create operations.
  1024. InvitationId int64 `json:"invitationId,omitempty,string"`
  1025. // ServerResponse contains the HTTP response code and headers from the
  1026. // server.
  1027. googleapi.ServerResponse `json:"-"`
  1028. // ForceSendFields is a list of field names (e.g. "ClientAccountId") to
  1029. // unconditionally include in API requests. By default, fields with
  1030. // empty values are omitted from API requests. However, any non-pointer,
  1031. // non-interface field appearing in ForceSendFields will be sent to the
  1032. // server regardless of whether the field is empty or not. This may be
  1033. // used to include empty fields in Patch requests.
  1034. ForceSendFields []string `json:"-"`
  1035. // NullFields is a list of field names (e.g. "ClientAccountId") to
  1036. // include in API requests with the JSON null value. By default, fields
  1037. // with empty values are omitted from API requests. However, any field
  1038. // with an empty value appearing in NullFields will be sent to the
  1039. // server as null. It is an error if a field in this list has a
  1040. // non-empty value. This may be used to include null fields in Patch
  1041. // requests.
  1042. NullFields []string `json:"-"`
  1043. }
  1044. func (s *ClientUserInvitation) MarshalJSON() ([]byte, error) {
  1045. type NoMethod ClientUserInvitation
  1046. raw := NoMethod(*s)
  1047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1048. }
  1049. // CompleteSetupRequest: Request message for indicating that the
  1050. // proposal's setup step is complete.
  1051. type CompleteSetupRequest struct {
  1052. }
  1053. // ContactInformation: Contains information on how a buyer or seller can
  1054. // be reached.
  1055. type ContactInformation struct {
  1056. // Email: Email address for the contact.
  1057. Email string `json:"email,omitempty"`
  1058. // Name: The name of the contact.
  1059. Name string `json:"name,omitempty"`
  1060. // ForceSendFields is a list of field names (e.g. "Email") to
  1061. // unconditionally include in API requests. By default, fields with
  1062. // empty values are omitted from API requests. However, any non-pointer,
  1063. // non-interface field appearing in ForceSendFields will be sent to the
  1064. // server regardless of whether the field is empty or not. This may be
  1065. // used to include empty fields in Patch requests.
  1066. ForceSendFields []string `json:"-"`
  1067. // NullFields is a list of field names (e.g. "Email") to include in API
  1068. // requests with the JSON null value. By default, fields with empty
  1069. // values are omitted from API requests. However, any field with an
  1070. // empty value appearing in NullFields will be sent to the server as
  1071. // null. It is an error if a field in this list has a non-empty value.
  1072. // This may be used to include null fields in Patch requests.
  1073. NullFields []string `json:"-"`
  1074. }
  1075. func (s *ContactInformation) MarshalJSON() ([]byte, error) {
  1076. type NoMethod ContactInformation
  1077. raw := NoMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1079. }
  1080. // Correction: @OutputOnly Shows any corrections that were applied to
  1081. // this creative.
  1082. type Correction struct {
  1083. // Contexts: The contexts for the correction.
  1084. Contexts []*ServingContext `json:"contexts,omitempty"`
  1085. // Details: Additional details about what was corrected.
  1086. Details []string `json:"details,omitempty"`
  1087. // Type: The type of correction that was applied to the creative.
  1088. //
  1089. // Possible values:
  1090. // "CORRECTION_TYPE_UNSPECIFIED" - The correction type is unknown.
  1091. // Refer to the details for more information.
  1092. // "VENDOR_IDS_ADDED" - The ad's declared vendors did not match the
  1093. // vendors that were detected.
  1094. // The detected vendors were added.
  1095. // "SSL_ATTRIBUTE_REMOVED" - The ad had the SSL attribute declared but
  1096. // was not SSL-compliant.
  1097. // The SSL attribute was removed.
  1098. // "FLASH_FREE_ATTRIBUTE_REMOVED" - The ad was declared as Flash-free
  1099. // but contained Flash, so the Flash-free
  1100. // attribute was removed.
  1101. // "FLASH_FREE_ATTRIBUTE_ADDED" - The ad was not declared as
  1102. // Flash-free but it did not reference any flash
  1103. // content, so the Flash-free attribute was added.
  1104. // "REQUIRED_ATTRIBUTE_ADDED" - The ad did not declare a required
  1105. // creative attribute.
  1106. // The attribute was added.
  1107. // "REQUIRED_VENDOR_ADDED" - The ad did not declare a required
  1108. // technology vendor.
  1109. // The technology vendor was added.
  1110. // "SSL_ATTRIBUTE_ADDED" - The ad did not declare the SSL attribute
  1111. // but was SSL-compliant, so the
  1112. // SSL attribute was added.
  1113. // "IN_BANNER_VIDEO_ATTRIBUTE_ADDED" - Properties consistent with
  1114. // In-banner video were found, so an
  1115. // In-Banner Video attribute was added.
  1116. // "MRAID_ATTRIBUTE_ADDED" - The ad makes calls to the MRAID API so
  1117. // the MRAID attribute was added.
  1118. // "FLASH_ATTRIBUTE_REMOVED" - The ad unnecessarily declared the Flash
  1119. // attribute, so the Flash attribute
  1120. // was removed.
  1121. // "VIDEO_IN_SNIPPET_ATTRIBUTE_ADDED" - The ad contains video content.
  1122. Type string `json:"type,omitempty"`
  1123. // ForceSendFields is a list of field names (e.g. "Contexts") to
  1124. // unconditionally include in API requests. By default, fields with
  1125. // empty values are omitted from API requests. However, any non-pointer,
  1126. // non-interface field appearing in ForceSendFields will be sent to the
  1127. // server regardless of whether the field is empty or not. This may be
  1128. // used to include empty fields in Patch requests.
  1129. ForceSendFields []string `json:"-"`
  1130. // NullFields is a list of field names (e.g. "Contexts") to include in
  1131. // API requests with the JSON null value. By default, fields with empty
  1132. // values are omitted from API requests. However, any field with an
  1133. // empty value appearing in NullFields will be sent to the server as
  1134. // null. It is an error if a field in this list has a non-empty value.
  1135. // This may be used to include null fields in Patch requests.
  1136. NullFields []string `json:"-"`
  1137. }
  1138. func (s *Correction) MarshalJSON() ([]byte, error) {
  1139. type NoMethod Correction
  1140. raw := NoMethod(*s)
  1141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1142. }
  1143. // Creative: A creative and its classification data.
  1144. //
  1145. // Next ID: 42
  1146. type Creative struct {
  1147. // AccountId: The account that this creative belongs to.
  1148. // Can be used to filter the response of the
  1149. // creatives.list
  1150. // method.
  1151. AccountId string `json:"accountId,omitempty"`
  1152. // AdChoicesDestinationUrl: The link to AdChoices destination page.
  1153. AdChoicesDestinationUrl string `json:"adChoicesDestinationUrl,omitempty"`
  1154. // AdvertiserName: The name of the company being advertised in the
  1155. // creative.
  1156. AdvertiserName string `json:"advertiserName,omitempty"`
  1157. // AgencyId: The agency ID for this creative.
  1158. AgencyId int64 `json:"agencyId,omitempty,string"`
  1159. // ApiUpdateTime: @OutputOnly The last update timestamp of the creative
  1160. // via API.
  1161. ApiUpdateTime string `json:"apiUpdateTime,omitempty"`
  1162. // Attributes: All attributes for the ads that may be shown from this
  1163. // creative.
  1164. // Can be used to filter the response of the
  1165. // creatives.list
  1166. // method.
  1167. //
  1168. // Possible values:
  1169. // "ATTRIBUTE_UNSPECIFIED" - Do not use. This is a placeholder value
  1170. // only.
  1171. // "IS_TAGGED" - The creative is tagged.
  1172. // "IS_COOKIE_TARGETED" - The creative is cookie targeted.
  1173. // "IS_USER_INTEREST_TARGETED" - The creative is user interest
  1174. // targeted.
  1175. // "EXPANDING_DIRECTION_NONE" - The creative does not expand.
  1176. // "EXPANDING_DIRECTION_UP" - The creative expands up.
  1177. // "EXPANDING_DIRECTION_DOWN" - The creative expands down.
  1178. // "EXPANDING_DIRECTION_LEFT" - The creative expands left.
  1179. // "EXPANDING_DIRECTION_RIGHT" - The creative expands right.
  1180. // "EXPANDING_DIRECTION_UP_LEFT" - The creative expands up and left.
  1181. // "EXPANDING_DIRECTION_UP_RIGHT" - The creative expands up and right.
  1182. // "EXPANDING_DIRECTION_DOWN_LEFT" - The creative expands down and
  1183. // left.
  1184. // "EXPANDING_DIRECTION_DOWN_RIGHT" - The creative expands down and
  1185. // right.
  1186. // "CREATIVE_TYPE_HTML" - The creative type is HTML.
  1187. // "CREATIVE_TYPE_VAST_VIDEO" - The creative type is VAST video.
  1188. // "EXPANDING_DIRECTION_UP_OR_DOWN" - The creative expands up or down.
  1189. // "EXPANDING_DIRECTION_LEFT_OR_RIGHT" - The creative expands left or
  1190. // right.
  1191. // "EXPANDING_DIRECTION_ANY_DIAGONAL" - The creative expands on any
  1192. // diagonal.
  1193. // "EXPANDING_ACTION_ROLLOVER_TO_EXPAND" - The creative expands when
  1194. // rolled over.
  1195. // "INSTREAM_VAST_VIDEO_TYPE_VPAID_FLASH" - The instream vast video
  1196. // type is vpaid flash.
  1197. // "RICH_MEDIA_CAPABILITY_TYPE_MRAID" - The creative is MRAID.
  1198. // "RICH_MEDIA_CAPABILITY_TYPE_FLASH" - The creative is Flash.
  1199. // "RICH_MEDIA_CAPABILITY_TYPE_HTML5" - The creative is HTML5.
  1200. // "RICH_MEDIA_CAPABILITY_TYPE_SSL" - The creative is SSL.
  1201. // "RICH_MEDIA_CAPABILITY_TYPE_NON_SSL" - The creative is non-SSL.
  1202. // "RICH_MEDIA_CAPABILITY_TYPE_INTERSTITIAL" - The creative is an
  1203. // interstitial.
  1204. // "NATIVE_ELIGIBILITY_ELIGIBLE" - The creative is eligible for
  1205. // native.
  1206. // "NATIVE_ELIGIBILITY_NOT_ELIGIBLE" - The creative is not eligible
  1207. // for native.
  1208. // "IN_BANNER_VIDEO" - The video type is in-banner video.
  1209. // "RENDERING_SIZELESS_ADX" - The creative can dynamically resize to
  1210. // fill a variety of slot sizes.
  1211. // "OMSDK_1_0" - The open measurement SDK is supported.
  1212. Attributes []string `json:"attributes,omitempty"`
  1213. // ClickThroughUrls: The set of destination URLs for the creative.
  1214. ClickThroughUrls []string `json:"clickThroughUrls,omitempty"`
  1215. // Corrections: @OutputOnly Shows any corrections that were applied to
  1216. // this creative.
  1217. Corrections []*Correction `json:"corrections,omitempty"`
  1218. // CreativeId: The buyer-defined creative ID of this creative.
  1219. // Can be used to filter the response of the
  1220. // creatives.list
  1221. // method.
  1222. CreativeId string `json:"creativeId,omitempty"`
  1223. // DealsStatus: @OutputOnly The top-level deals status of this
  1224. // creative.
  1225. // If disapproved, an entry for 'auctionType=DIRECT_DEALS' (or 'ALL')
  1226. // in
  1227. // serving_restrictions will also exist. Note
  1228. // that this may be nuanced with other contextual restrictions, in which
  1229. // case,
  1230. // it may be preferable to read from serving_restrictions directly.
  1231. // Can be used to filter the response of the
  1232. // creatives.list
  1233. // method.
  1234. //
  1235. // Possible values:
  1236. // "STATUS_UNSPECIFIED" - The status is unknown.
  1237. // "NOT_CHECKED" - The creative has not been checked.
  1238. // "CONDITIONALLY_APPROVED" - The creative has been conditionally
  1239. // approved.
  1240. // See serving_restrictions for details.
  1241. // "APPROVED" - The creative has been approved.
  1242. // "DISAPPROVED" - The creative has been disapproved.
  1243. DealsStatus string `json:"dealsStatus,omitempty"`
  1244. // DeclaredClickThroughUrls: The set of declared destination URLs for
  1245. // the creative.
  1246. DeclaredClickThroughUrls []string `json:"declaredClickThroughUrls,omitempty"`
  1247. // DetectedAdvertiserIds: @OutputOnly Detected advertiser IDs, if any.
  1248. DetectedAdvertiserIds googleapi.Int64s `json:"detectedAdvertiserIds,omitempty"`
  1249. // DetectedDomains: @OutputOnly
  1250. // The detected domains for this creative.
  1251. DetectedDomains []string `json:"detectedDomains,omitempty"`
  1252. // DetectedLanguages: @OutputOnly
  1253. // The detected languages for this creative. The order is arbitrary. The
  1254. // codes
  1255. // are 2 or 5 characters and are documented
  1256. // at
  1257. // https://developers.google.com/adwords/api/docs/appendix/languagecod
  1258. // es.
  1259. DetectedLanguages []string `json:"detectedLanguages,omitempty"`
  1260. // DetectedProductCategories: @OutputOnly Detected product categories,
  1261. // if any.
  1262. // See the ad-product-categories.txt file in the technical
  1263. // documentation
  1264. // for a list of IDs.
  1265. DetectedProductCategories []int64 `json:"detectedProductCategories,omitempty"`
  1266. // DetectedSensitiveCategories: @OutputOnly Detected sensitive
  1267. // categories, if any.
  1268. // See the ad-sensitive-categories.txt file in the technical
  1269. // documentation for
  1270. // a list of IDs. You should use these IDs along with
  1271. // the
  1272. // excluded-sensitive-category field in the bid request to filter your
  1273. // bids.
  1274. DetectedSensitiveCategories []int64 `json:"detectedSensitiveCategories,omitempty"`
  1275. // FilteringStats: @OutputOnly The filtering stats for this creative.
  1276. FilteringStats *FilteringStats `json:"filteringStats,omitempty"`
  1277. // Html: An HTML creative.
  1278. Html *HtmlContent `json:"html,omitempty"`
  1279. // ImpressionTrackingUrls: The set of URLs to be called to record an
  1280. // impression.
  1281. ImpressionTrackingUrls []string `json:"impressionTrackingUrls,omitempty"`
  1282. // Native: A native creative.
  1283. Native *NativeContent `json:"native,omitempty"`
  1284. // OpenAuctionStatus: @OutputOnly The top-level open auction status of
  1285. // this creative.
  1286. // If disapproved, an entry for 'auctionType = OPEN_AUCTION' (or 'ALL')
  1287. // in
  1288. // serving_restrictions will also exist. Note
  1289. // that this may be nuanced with other contextual restrictions, in which
  1290. // case,
  1291. // it may be preferable to read from serving_restrictions directly.
  1292. // Can be used to filter the response of the
  1293. // creatives.list
  1294. // method.
  1295. //
  1296. // Possible values:
  1297. // "STATUS_UNSPECIFIED" - The status is unknown.
  1298. // "NOT_CHECKED" - The creative has not been checked.
  1299. // "CONDITIONALLY_APPROVED" - The creative has been conditionally
  1300. // approved.
  1301. // See serving_restrictions for details.
  1302. // "APPROVED" - The creative has been approved.
  1303. // "DISAPPROVED" - The creative has been disapproved.
  1304. OpenAuctionStatus string `json:"openAuctionStatus,omitempty"`
  1305. // RestrictedCategories: All restricted categories for the ads that may
  1306. // be shown from this creative.
  1307. //
  1308. // Possible values:
  1309. // "NO_RESTRICTED_CATEGORIES" - The ad has no restricted categories
  1310. // "ALCOHOL" - The alcohol restricted category.
  1311. RestrictedCategories []string `json:"restrictedCategories,omitempty"`
  1312. // ServingRestrictions: @OutputOnly The granular status of this ad in
  1313. // specific contexts.
  1314. // A context here relates to where something ultimately serves (for
  1315. // example,
  1316. // a physical location, a platform, an HTTPS vs HTTP request, or the
  1317. // type
  1318. // of auction).
  1319. ServingRestrictions []*ServingRestriction `json:"servingRestrictions,omitempty"`
  1320. // VendorIds: All vendor IDs for the ads that may be shown from this
  1321. // creative.
  1322. // See
  1323. // https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt
  1324. // for possible values.
  1325. VendorIds []int64 `json:"vendorIds,omitempty"`
  1326. // Version: @OutputOnly The version of this creative.
  1327. Version int64 `json:"version,omitempty"`
  1328. // Video: A video creative.
  1329. Video *VideoContent `json:"video,omitempty"`
  1330. // ServerResponse contains the HTTP response code and headers from the
  1331. // server.
  1332. googleapi.ServerResponse `json:"-"`
  1333. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1334. // unconditionally include in API requests. By default, fields with
  1335. // empty values are omitted from API requests. However, any non-pointer,
  1336. // non-interface field appearing in ForceSendFields will be sent to the
  1337. // server regardless of whether the field is empty or not. This may be
  1338. // used to include empty fields in Patch requests.
  1339. ForceSendFields []string `json:"-"`
  1340. // NullFields is a list of field names (e.g. "AccountId") to include in
  1341. // API requests with the JSON null value. By default, fields with empty
  1342. // values are omitted from API requests. However, any field with an
  1343. // empty value appearing in NullFields will be sent to the server as
  1344. // null. It is an error if a field in this list has a non-empty value.
  1345. // This may be used to include null fields in Patch requests.
  1346. NullFields []string `json:"-"`
  1347. }
  1348. func (s *Creative) MarshalJSON() ([]byte, error) {
  1349. type NoMethod Creative
  1350. raw := NoMethod(*s)
  1351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1352. }
  1353. // CreativeDealAssociation: The association between a creative and a
  1354. // deal.
  1355. type CreativeDealAssociation struct {
  1356. // AccountId: The account the creative belongs to.
  1357. AccountId string `json:"accountId,omitempty"`
  1358. // CreativeId: The ID of the creative associated with the deal.
  1359. CreativeId string `json:"creativeId,omitempty"`
  1360. // DealsId: The externalDealId for the deal associated with the
  1361. // creative.
  1362. DealsId string `json:"dealsId,omitempty"`
  1363. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1364. // unconditionally include in API requests. By default, fields with
  1365. // empty values are omitted from API requests. However, any non-pointer,
  1366. // non-interface field appearing in ForceSendFields will be sent to the
  1367. // server regardless of whether the field is empty or not. This may be
  1368. // used to include empty fields in Patch requests.
  1369. ForceSendFields []string `json:"-"`
  1370. // NullFields is a list of field names (e.g. "AccountId") to include in
  1371. // API requests with the JSON null value. By default, fields with empty
  1372. // values are omitted from API requests. However, any field with an
  1373. // empty value appearing in NullFields will be sent to the server as
  1374. // null. It is an error if a field in this list has a non-empty value.
  1375. // This may be used to include null fields in Patch requests.
  1376. NullFields []string `json:"-"`
  1377. }
  1378. func (s *CreativeDealAssociation) MarshalJSON() ([]byte, error) {
  1379. type NoMethod CreativeDealAssociation
  1380. raw := NoMethod(*s)
  1381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1382. }
  1383. // CreativeRestrictions: Represents creative restrictions associated to
  1384. // Programmatic Guaranteed/
  1385. // Preferred Deal in Ad Manager.
  1386. // This doesn't apply to Private Auction and AdX Preferred Deals.
  1387. type CreativeRestrictions struct {
  1388. // CreativeFormat: The format of the environment that the creatives will
  1389. // be displayed in.
  1390. //
  1391. // Possible values:
  1392. // "CREATIVE_FORMAT_UNSPECIFIED" - A placeholder for an undefined
  1393. // creative format.
  1394. // "DISPLAY" - A creative that will be displayed in environments such
  1395. // as a browser.
  1396. // "VIDEO" - A video creative that will be displayed in environments
  1397. // such as a video
  1398. // player.
  1399. CreativeFormat string `json:"creativeFormat,omitempty"`
  1400. CreativeSpecifications []*CreativeSpecification `json:"creativeSpecifications,omitempty"`
  1401. // SkippableAdType: Skippable video ads allow viewers to skip ads after
  1402. // 5 seconds.
  1403. //
  1404. // Possible values:
  1405. // "SKIPPABLE_AD_TYPE_UNSPECIFIED" - A placeholder for an undefined
  1406. // skippable ad type.
  1407. // "SKIPPABLE" - This video ad can be skipped after 5 seconds.
  1408. // "INSTREAM_SELECT" - This video ad can be skipped after 5 seconds,
  1409. // and is counted as
  1410. // engaged view after 30 seconds. The creative is hosted on
  1411. // YouTube only, and viewcount of the YouTube video increments
  1412. // after the engaged view.
  1413. // "NOT_SKIPPABLE" - This video ad is not skippable.
  1414. SkippableAdType string `json:"skippableAdType,omitempty"`
  1415. // ForceSendFields is a list of field names (e.g. "CreativeFormat") to
  1416. // unconditionally include in API requests. By default, fields with
  1417. // empty values are omitted from API requests. However, any non-pointer,
  1418. // non-interface field appearing in ForceSendFields will be sent to the
  1419. // server regardless of whether the field is empty or not. This may be
  1420. // used to include empty fields in Patch requests.
  1421. ForceSendFields []string `json:"-"`
  1422. // NullFields is a list of field names (e.g. "CreativeFormat") to
  1423. // include in API requests with the JSON null value. By default, fields
  1424. // with empty values are omitted from API requests. However, any field
  1425. // with an empty value appearing in NullFields will be sent to the
  1426. // server as null. It is an error if a field in this list has a
  1427. // non-empty value. This may be used to include null fields in Patch
  1428. // requests.
  1429. NullFields []string `json:"-"`
  1430. }
  1431. func (s *CreativeRestrictions) MarshalJSON() ([]byte, error) {
  1432. type NoMethod CreativeRestrictions
  1433. raw := NoMethod(*s)
  1434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1435. }
  1436. // CreativeSize: Specifies the size of the creative.
  1437. type CreativeSize struct {
  1438. // AllowedFormats: What formats are allowed by the publisher.
  1439. // If this repeated field is empty then all formats are allowed.
  1440. // For example, if this field contains AllowedFormatType.AUDIO then
  1441. // the
  1442. // publisher only allows an audio ad (without any video).
  1443. //
  1444. // Possible values:
  1445. // "UNKNOWN" - A placeholder for an undefined allowed format.
  1446. // "AUDIO" - An audio-only ad (without any video).
  1447. AllowedFormats []string `json:"allowedFormats,omitempty"`
  1448. // CompanionSizes: For video creatives specifies the sizes of companion
  1449. // ads (if present).
  1450. // Companion sizes may be filled in only when creative_size_type = VIDEO
  1451. CompanionSizes []*Size `json:"companionSizes,omitempty"`
  1452. // CreativeSizeType: The creative size type.
  1453. //
  1454. // Possible values:
  1455. // "CREATIVE_SIZE_TYPE_UNSPECIFIED" - A placeholder for an undefined
  1456. // creative size type.
  1457. // "REGULAR" - The creative is a regular desktop creative.
  1458. // "INTERSTITIAL" - The creative is an interstitial creative.
  1459. // "VIDEO" - The creative is a video creative.
  1460. // "NATIVE" - The creative is a native (mobile) creative.
  1461. CreativeSizeType string `json:"creativeSizeType,omitempty"`
  1462. // NativeTemplate: The native template for this creative. It will have a
  1463. // value only if
  1464. // creative_size_type = CreativeSizeType.NATIVE.
  1465. // @OutputOnly
  1466. //
  1467. // Possible values:
  1468. // "UNKNOWN_NATIVE_TEMPLATE" - A placeholder for an undefined native
  1469. // template.
  1470. // "NATIVE_CONTENT_AD" - The creative is linked to native content ad.
  1471. // "NATIVE_APP_INSTALL_AD" - The creative is linked to native app
  1472. // install ad.
  1473. // "NATIVE_VIDEO_CONTENT_AD" - The creative is linked to native video
  1474. // content ad.
  1475. // "NATIVE_VIDEO_APP_INSTALL_AD" - The creative is linked to native
  1476. // video app install ad.
  1477. NativeTemplate string `json:"nativeTemplate,omitempty"`
  1478. // Size: For regular or video creative size type, specifies the size
  1479. // of the creative
  1480. Size *Size `json:"size,omitempty"`
  1481. // SkippableAdType: The type of skippable ad for this creative. It will
  1482. // have a value only if
  1483. // creative_size_type = CreativeSizeType.VIDEO.
  1484. //
  1485. // Possible values:
  1486. // "SKIPPABLE_AD_TYPE_UNSPECIFIED" - A placeholder for an undefined
  1487. // skippable ad type.
  1488. // "GENERIC" - This video ad can be skipped after 5 seconds.
  1489. // "INSTREAM_SELECT" - This video ad can be skipped after 5 seconds,
  1490. // and count as
  1491. // engaged view after 30 seconds. The creative is hosted on
  1492. // YouTube only, and viewcount of the YouTube video increments
  1493. // after the engaged view.
  1494. // "NOT_SKIPPABLE" - This video ad is not skippable.
  1495. SkippableAdType string `json:"skippableAdType,omitempty"`
  1496. // ForceSendFields is a list of field names (e.g. "AllowedFormats") to
  1497. // unconditionally include in API requests. By default, fields with
  1498. // empty values are omitted from API requests. However, any non-pointer,
  1499. // non-interface field appearing in ForceSendFields will be sent to the
  1500. // server regardless of whether the field is empty or not. This may be
  1501. // used to include empty fields in Patch requests.
  1502. ForceSendFields []string `json:"-"`
  1503. // NullFields is a list of field names (e.g. "AllowedFormats") to
  1504. // include in API requests with the JSON null value. By default, fields
  1505. // with empty values are omitted from API requests. However, any field
  1506. // with an empty value appearing in NullFields will be sent to the
  1507. // server as null. It is an error if a field in this list has a
  1508. // non-empty value. This may be used to include null fields in Patch
  1509. // requests.
  1510. NullFields []string `json:"-"`
  1511. }
  1512. func (s *CreativeSize) MarshalJSON() ([]byte, error) {
  1513. type NoMethod CreativeSize
  1514. raw := NoMethod(*s)
  1515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1516. }
  1517. // CreativeSpecification: Represents information for a creative that is
  1518. // associated with a Programmatic
  1519. // Guaranteed/Preferred Deal in Ad Manager.
  1520. type CreativeSpecification struct {
  1521. // CreativeCompanionSizes: Companion sizes may be filled in only when
  1522. // this is a video creative.
  1523. CreativeCompanionSizes []*AdSize `json:"creativeCompanionSizes,omitempty"`
  1524. // CreativeSize: The size of the creative.
  1525. CreativeSize *AdSize `json:"creativeSize,omitempty"`
  1526. // ForceSendFields is a list of field names (e.g.
  1527. // "CreativeCompanionSizes") to unconditionally include in API requests.
  1528. // By default, fields with empty values are omitted from API requests.
  1529. // However, any non-pointer, non-interface field appearing in
  1530. // ForceSendFields will be sent to the server regardless of whether the
  1531. // field is empty or not. This may be used to include empty fields in
  1532. // Patch requests.
  1533. ForceSendFields []string `json:"-"`
  1534. // NullFields is a list of field names (e.g. "CreativeCompanionSizes")
  1535. // to include in API requests with the JSON null value. By default,
  1536. // fields with empty values are omitted from API requests. However, any
  1537. // field with an empty value appearing in NullFields will be sent to the
  1538. // server as null. It is an error if a field in this list has a
  1539. // non-empty value. This may be used to include null fields in Patch
  1540. // requests.
  1541. NullFields []string `json:"-"`
  1542. }
  1543. func (s *CreativeSpecification) MarshalJSON() ([]byte, error) {
  1544. type NoMethod CreativeSpecification
  1545. raw := NoMethod(*s)
  1546. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1547. }
  1548. // CreativeStatusRow: The number of bids with the specified dimension
  1549. // values that did not win the
  1550. // auction (either were filtered pre-auction or lost the auction), as
  1551. // described
  1552. // by the specified creative status.
  1553. type CreativeStatusRow struct {
  1554. // BidCount: The number of bids with the specified status.
  1555. BidCount *MetricValue `json:"bidCount,omitempty"`
  1556. // CreativeStatusId: The ID of the creative status.
  1557. // See
  1558. // [creative-status-codes](https://developers.google.com/authorized-buyer
  1559. // s/rtb/downloads/creative-status-codes).
  1560. CreativeStatusId int64 `json:"creativeStatusId,omitempty"`
  1561. // RowDimensions: The values of all dimensions associated with metric
  1562. // values in this row.
  1563. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  1564. // ForceSendFields is a list of field names (e.g. "BidCount") to
  1565. // unconditionally include in API requests. By default, fields with
  1566. // empty values are omitted from API requests. However, any non-pointer,
  1567. // non-interface field appearing in ForceSendFields will be sent to the
  1568. // server regardless of whether the field is empty or not. This may be
  1569. // used to include empty fields in Patch requests.
  1570. ForceSendFields []string `json:"-"`
  1571. // NullFields is a list of field names (e.g. "BidCount") to include in
  1572. // API requests with the JSON null value. By default, fields with empty
  1573. // values are omitted from API requests. However, any field with an
  1574. // empty value appearing in NullFields will be sent to the server as
  1575. // null. It is an error if a field in this list has a non-empty value.
  1576. // This may be used to include null fields in Patch requests.
  1577. NullFields []string `json:"-"`
  1578. }
  1579. func (s *CreativeStatusRow) MarshalJSON() ([]byte, error) {
  1580. type NoMethod CreativeStatusRow
  1581. raw := NoMethod(*s)
  1582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1583. }
  1584. // CriteriaTargeting: Generic targeting used for targeting dimensions
  1585. // that contains a list of
  1586. // included and excluded numeric IDs.
  1587. type CriteriaTargeting struct {
  1588. // ExcludedCriteriaIds: A list of numeric IDs to be excluded.
  1589. ExcludedCriteriaIds googleapi.Int64s `json:"excludedCriteriaIds,omitempty"`
  1590. // TargetedCriteriaIds: A list of numeric IDs to be included.
  1591. TargetedCriteriaIds googleapi.Int64s `json:"targetedCriteriaIds,omitempty"`
  1592. // ForceSendFields is a list of field names (e.g. "ExcludedCriteriaIds")
  1593. // to unconditionally include in API requests. By default, fields with
  1594. // empty values are omitted from API requests. However, any non-pointer,
  1595. // non-interface field appearing in ForceSendFields will be sent to the
  1596. // server regardless of whether the field is empty or not. This may be
  1597. // used to include empty fields in Patch requests.
  1598. ForceSendFields []string `json:"-"`
  1599. // NullFields is a list of field names (e.g. "ExcludedCriteriaIds") to
  1600. // include in API requests with the JSON null value. By default, fields
  1601. // with empty values are omitted from API requests. However, any field
  1602. // with an empty value appearing in NullFields will be sent to the
  1603. // server as null. It is an error if a field in this list has a
  1604. // non-empty value. This may be used to include null fields in Patch
  1605. // requests.
  1606. NullFields []string `json:"-"`
  1607. }
  1608. func (s *CriteriaTargeting) MarshalJSON() ([]byte, error) {
  1609. type NoMethod CriteriaTargeting
  1610. raw := NoMethod(*s)
  1611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1612. }
  1613. // Date: Represents a whole or partial calendar date, e.g. a birthday.
  1614. // The time of day
  1615. // and time zone are either specified elsewhere or are not significant.
  1616. // The date
  1617. // is relative to the Proleptic Gregorian Calendar. This can
  1618. // represent:
  1619. //
  1620. // * A full date, with non-zero year, month and day values
  1621. // * A month and day value, with a zero year, e.g. an anniversary
  1622. // * A year on its own, with zero month and day values
  1623. // * A year and month value, with a zero day, e.g. a credit card
  1624. // expiration date
  1625. //
  1626. // Related types are google.type.TimeOfDay and
  1627. // `google.protobuf.Timestamp`.
  1628. type Date struct {
  1629. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  1630. // month, or 0
  1631. // if specifying a year by itself or a year and month where the day is
  1632. // not
  1633. // significant.
  1634. Day int64 `json:"day,omitempty"`
  1635. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year
  1636. // without a
  1637. // month and day.
  1638. Month int64 `json:"month,omitempty"`
  1639. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  1640. // without
  1641. // a year.
  1642. Year int64 `json:"year,omitempty"`
  1643. // ForceSendFields is a list of field names (e.g. "Day") to
  1644. // unconditionally include in API requests. By default, fields with
  1645. // empty values are omitted from API requests. However, any non-pointer,
  1646. // non-interface field appearing in ForceSendFields will be sent to the
  1647. // server regardless of whether the field is empty or not. This may be
  1648. // used to include empty fields in Patch requests.
  1649. ForceSendFields []string `json:"-"`
  1650. // NullFields is a list of field names (e.g. "Day") to include in API
  1651. // requests with the JSON null value. By default, fields with empty
  1652. // values are omitted from API requests. However, any field with an
  1653. // empty value appearing in NullFields will be sent to the server as
  1654. // null. It is an error if a field in this list has a non-empty value.
  1655. // This may be used to include null fields in Patch requests.
  1656. NullFields []string `json:"-"`
  1657. }
  1658. func (s *Date) MarshalJSON() ([]byte, error) {
  1659. type NoMethod Date
  1660. raw := NoMethod(*s)
  1661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1662. }
  1663. // DayPart: Daypart targeting message that specifies if the ad can be
  1664. // shown
  1665. // only during certain parts of a day/week.
  1666. type DayPart struct {
  1667. // DayOfWeek: The day of the week to target. If unspecified, applicable
  1668. // to all days.
  1669. //
  1670. // Possible values:
  1671. // "DAY_OF_WEEK_UNSPECIFIED" - A placeholder for when the day of the
  1672. // week is not specified.
  1673. // "MONDAY" - Monday
  1674. // "TUESDAY" - Tuesday
  1675. // "WEDNESDAY" - Wednesday
  1676. // "THURSDAY" - Thursday
  1677. // "FRIDAY" - Friday
  1678. // "SATURDAY" - Saturday
  1679. // "SUNDAY" - Sunday
  1680. DayOfWeek string `json:"dayOfWeek,omitempty"`
  1681. // EndTime: The ending time of the day for the ad to show (minute level
  1682. // granularity).
  1683. // The end time is exclusive.
  1684. // This field is not available for filtering in PQL queries.
  1685. EndTime *TimeOfDay `json:"endTime,omitempty"`
  1686. // StartTime: The starting time of day for the ad to show (minute level
  1687. // granularity).
  1688. // The start time is inclusive.
  1689. // This field is not available for filtering in PQL queries.
  1690. StartTime *TimeOfDay `json:"startTime,omitempty"`
  1691. // ForceSendFields is a list of field names (e.g. "DayOfWeek") to
  1692. // unconditionally include in API requests. By default, fields with
  1693. // empty values are omitted from API requests. However, any non-pointer,
  1694. // non-interface field appearing in ForceSendFields will be sent to the
  1695. // server regardless of whether the field is empty or not. This may be
  1696. // used to include empty fields in Patch requests.
  1697. ForceSendFields []string `json:"-"`
  1698. // NullFields is a list of field names (e.g. "DayOfWeek") to include in
  1699. // API requests with the JSON null value. By default, fields with empty
  1700. // values are omitted from API requests. However, any field with an
  1701. // empty value appearing in NullFields will be sent to the server as
  1702. // null. It is an error if a field in this list has a non-empty value.
  1703. // This may be used to include null fields in Patch requests.
  1704. NullFields []string `json:"-"`
  1705. }
  1706. func (s *DayPart) MarshalJSON() ([]byte, error) {
  1707. type NoMethod DayPart
  1708. raw := NoMethod(*s)
  1709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1710. }
  1711. // DayPartTargeting: Specifies the day part targeting criteria.
  1712. type DayPartTargeting struct {
  1713. // DayParts: A list of day part targeting criterion.
  1714. DayParts []*DayPart `json:"dayParts,omitempty"`
  1715. // TimeZoneType: The timezone to use for interpreting the day part
  1716. // targeting.
  1717. //
  1718. // Possible values:
  1719. // "TIME_ZONE_SOURCE_UNSPECIFIED" - A placeholder for an undefined
  1720. // time zone source.
  1721. // "PUBLISHER" - Use publisher's time zone setting.
  1722. // "USER" - Use the user's time zone setting.
  1723. TimeZoneType string `json:"timeZoneType,omitempty"`
  1724. // ForceSendFields is a list of field names (e.g. "DayParts") to
  1725. // unconditionally include in API requests. By default, fields with
  1726. // empty values are omitted from API requests. However, any non-pointer,
  1727. // non-interface field appearing in ForceSendFields will be sent to the
  1728. // server regardless of whether the field is empty or not. This may be
  1729. // used to include empty fields in Patch requests.
  1730. ForceSendFields []string `json:"-"`
  1731. // NullFields is a list of field names (e.g. "DayParts") to include in
  1732. // API requests with the JSON null value. By default, fields with empty
  1733. // values are omitted from API requests. However, any field with an
  1734. // empty value appearing in NullFields will be sent to the server as
  1735. // null. It is an error if a field in this list has a non-empty value.
  1736. // This may be used to include null fields in Patch requests.
  1737. NullFields []string `json:"-"`
  1738. }
  1739. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  1740. type NoMethod DayPartTargeting
  1741. raw := NoMethod(*s)
  1742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1743. }
  1744. // Deal: A deal represents a segment of inventory for displaying ads
  1745. // on.
  1746. // A proposal can contain multiple deals. A deal contains the terms and
  1747. // targeting information that
  1748. // is used for serving.
  1749. type Deal struct {
  1750. // AvailableEndTime: Proposed flight end time of the deal.
  1751. // This will generally be stored in a granularity of a second.
  1752. // A value is not required for Private Auction deals or Preferred Deals.
  1753. AvailableEndTime string `json:"availableEndTime,omitempty"`
  1754. // AvailableStartTime: Optional proposed flight start time of the
  1755. // deal.
  1756. // This will generally be stored in the granularity of one second since
  1757. // deal serving
  1758. // starts at seconds boundary. Any time specified with more
  1759. // granularity
  1760. // (e.g., in milliseconds) will be truncated towards the start of time
  1761. // in seconds.
  1762. AvailableStartTime string `json:"availableStartTime,omitempty"`
  1763. // BuyerPrivateData: Buyer private data (hidden from seller).
  1764. BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
  1765. // CreateProductId: The product ID from which this deal was
  1766. // created.
  1767. //
  1768. // Note: This field may be set only when creating the resource.
  1769. // Modifying
  1770. // this field while updating the resource will result in an error.
  1771. CreateProductId string `json:"createProductId,omitempty"`
  1772. // CreateProductRevision: Optional revision number of the product that
  1773. // the deal was created from.
  1774. // If present on create, and the server `product_revision` has advanced
  1775. // sinced
  1776. // the passed-in `create_product_revision`, an `ABORTED` error will
  1777. // be
  1778. // returned.
  1779. //
  1780. // Note: This field may be set only when creating the resource.
  1781. // Modifying
  1782. // this field while updating the resource will result in an error.
  1783. CreateProductRevision int64 `json:"createProductRevision,omitempty,string"`
  1784. // CreateTime: The time of the deal creation.
  1785. // @OutputOnly
  1786. CreateTime string `json:"createTime,omitempty"`
  1787. // CreativePreApprovalPolicy: Specifies the creative pre-approval
  1788. // policy.
  1789. // @OutputOnly
  1790. //
  1791. // Possible values:
  1792. // "CREATIVE_PRE_APPROVAL_POLICY_UNSPECIFIED" - A placeholder for an
  1793. // undefined creative pre-approval policy.
  1794. // "SELLER_PRE_APPROVAL_REQUIRED" - The seller needs to approve each
  1795. // creative before it can serve.
  1796. // "SELLER_PRE_APPROVAL_NOT_REQUIRED" - The seller does not need to
  1797. // approve each creative before it can serve.
  1798. CreativePreApprovalPolicy string `json:"creativePreApprovalPolicy,omitempty"`
  1799. // CreativeRestrictions: Restricitions about the creatives associated
  1800. // with the deal (i.e., size)
  1801. // This is available for Programmatic Guaranteed/Preferred Deals in Ad
  1802. // Manager.
  1803. // @OutputOnly
  1804. CreativeRestrictions *CreativeRestrictions `json:"creativeRestrictions,omitempty"`
  1805. // CreativeSafeFrameCompatibility: Specifies whether the creative is
  1806. // safeFrame compatible.
  1807. // @OutputOnly
  1808. //
  1809. // Possible values:
  1810. // "CREATIVE_SAFE_FRAME_COMPATIBILITY_UNSPECIFIED" - A placeholder for
  1811. // an undefined creative safe-frame compatibility.
  1812. // "COMPATIBLE" - The creatives need to be compatible with the safe
  1813. // frame option.
  1814. // "INCOMPATIBLE" - The creatives can be incompatible with the safe
  1815. // frame option.
  1816. CreativeSafeFrameCompatibility string `json:"creativeSafeFrameCompatibility,omitempty"`
  1817. // DealId: A unique deal ID for the deal (server-assigned).
  1818. // @OutputOnly
  1819. DealId string `json:"dealId,omitempty"`
  1820. // DealServingMetadata: Metadata about the serving status of this
  1821. // deal.
  1822. // @OutputOnly
  1823. DealServingMetadata *DealServingMetadata `json:"dealServingMetadata,omitempty"`
  1824. // DealTerms: The negotiable terms of the deal.
  1825. DealTerms *DealTerms `json:"dealTerms,omitempty"`
  1826. // DeliveryControl: The set of fields around delivery control that are
  1827. // interesting for a buyer
  1828. // to see but are non-negotiable. These are set by the publisher.
  1829. DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
  1830. // Description: Description for the deal terms.
  1831. Description string `json:"description,omitempty"`
  1832. // DisplayName: The name of the deal.
  1833. DisplayName string `json:"displayName,omitempty"`
  1834. // ExternalDealId: The external deal ID assigned to this deal once the
  1835. // deal is finalized.
  1836. // This is the deal ID that shows up in serving/reporting
  1837. // etc.
  1838. // @OutputOnly
  1839. ExternalDealId string `json:"externalDealId,omitempty"`
  1840. // IsSetupComplete: True, if the buyside inventory setup is complete for
  1841. // this deal.
  1842. // @OutputOnly
  1843. IsSetupComplete bool `json:"isSetupComplete,omitempty"`
  1844. // ProgrammaticCreativeSource: Specifies the creative source for
  1845. // programmatic deals. PUBLISHER means
  1846. // creative is provided by seller and ADVERTISER means creative
  1847. // is
  1848. // provided by buyer.
  1849. // @OutputOnly
  1850. //
  1851. // Possible values:
  1852. // "PROGRAMMATIC_CREATIVE_SOURCE_UNSPECIFIED" - A placeholder for an
  1853. // undefined programmatic creative source.
  1854. // "ADVERTISER" - The advertiser provides the creatives.
  1855. // "PUBLISHER" - The publisher provides the creatives to be served.
  1856. ProgrammaticCreativeSource string `json:"programmaticCreativeSource,omitempty"`
  1857. // ProposalId: ID of the proposal that this deal is part of.
  1858. // @OutputOnly
  1859. ProposalId string `json:"proposalId,omitempty"`
  1860. // SellerContacts: Seller contact information for the deal.
  1861. // @OutputOnly
  1862. SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
  1863. // SyndicationProduct: The syndication product associated with the
  1864. // deal.
  1865. //
  1866. // Note: This field may be set only when creating the resource.
  1867. // Modifying
  1868. // this field while updating the resource will result in an error.
  1869. //
  1870. // Possible values:
  1871. // "SYNDICATION_PRODUCT_UNSPECIFIED" - A placeholder for an undefined
  1872. // syndication product.
  1873. // "CONTENT" - This typically represents a web page.
  1874. // "MOBILE" - This represents a mobile property.
  1875. // "VIDEO" - This represents video ad formats.
  1876. // "GAMES" - This represents ads shown within games.
  1877. SyndicationProduct string `json:"syndicationProduct,omitempty"`
  1878. // Targeting: Specifies the subset of inventory targeted by the
  1879. // deal.
  1880. // @OutputOnly
  1881. Targeting *MarketplaceTargeting `json:"targeting,omitempty"`
  1882. // TargetingCriterion: The shared targeting visible to buyers and
  1883. // sellers. Each shared
  1884. // targeting entity is AND'd together.
  1885. TargetingCriterion []*TargetingCriteria `json:"targetingCriterion,omitempty"`
  1886. // UpdateTime: The time when the deal was last updated.
  1887. // @OutputOnly
  1888. UpdateTime string `json:"updateTime,omitempty"`
  1889. // WebPropertyCode: The web property code for the seller copied over
  1890. // from the product.
  1891. WebPropertyCode string `json:"webPropertyCode,omitempty"`
  1892. // ForceSendFields is a list of field names (e.g. "AvailableEndTime") to
  1893. // unconditionally include in API requests. By default, fields with
  1894. // empty values are omitted from API requests. However, any non-pointer,
  1895. // non-interface field appearing in ForceSendFields will be sent to the
  1896. // server regardless of whether the field is empty or not. This may be
  1897. // used to include empty fields in Patch requests.
  1898. ForceSendFields []string `json:"-"`
  1899. // NullFields is a list of field names (e.g. "AvailableEndTime") to
  1900. // include in API requests with the JSON null value. By default, fields
  1901. // with empty values are omitted from API requests. However, any field
  1902. // with an empty value appearing in NullFields will be sent to the
  1903. // server as null. It is an error if a field in this list has a
  1904. // non-empty value. This may be used to include null fields in Patch
  1905. // requests.
  1906. NullFields []string `json:"-"`
  1907. }
  1908. func (s *Deal) MarshalJSON() ([]byte, error) {
  1909. type NoMethod Deal
  1910. raw := NoMethod(*s)
  1911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1912. }
  1913. // DealPauseStatus: Tracks which parties (if any) have paused a
  1914. // deal.
  1915. // The deal is considered paused if either hasBuyerPaused
  1916. // or
  1917. // hasSellPaused is true.
  1918. type DealPauseStatus struct {
  1919. // BuyerPauseReason: The buyer's reason for pausing, if the buyer paused
  1920. // the deal.
  1921. BuyerPauseReason string `json:"buyerPauseReason,omitempty"`
  1922. // FirstPausedBy: The role of the person who first paused this deal.
  1923. //
  1924. // Possible values:
  1925. // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
  1926. // buyer/seller role.
  1927. // "BUYER" - Specifies the role as buyer.
  1928. // "SELLER" - Specifies the role as seller.
  1929. FirstPausedBy string `json:"firstPausedBy,omitempty"`
  1930. // HasBuyerPaused: True, if the buyer has paused the deal unilaterally.
  1931. HasBuyerPaused bool `json:"hasBuyerPaused,omitempty"`
  1932. // HasSellerPaused: True, if the seller has paused the deal
  1933. // unilaterally.
  1934. HasSellerPaused bool `json:"hasSellerPaused,omitempty"`
  1935. // SellerPauseReason: The seller's reason for pausing, if the seller
  1936. // paused the deal.
  1937. SellerPauseReason string `json:"sellerPauseReason,omitempty"`
  1938. // ForceSendFields is a list of field names (e.g. "BuyerPauseReason") to
  1939. // unconditionally include in API requests. By default, fields with
  1940. // empty values are omitted from API requests. However, any non-pointer,
  1941. // non-interface field appearing in ForceSendFields will be sent to the
  1942. // server regardless of whether the field is empty or not. This may be
  1943. // used to include empty fields in Patch requests.
  1944. ForceSendFields []string `json:"-"`
  1945. // NullFields is a list of field names (e.g. "BuyerPauseReason") to
  1946. // include in API requests with the JSON null value. By default, fields
  1947. // with empty values are omitted from API requests. However, any field
  1948. // with an empty value appearing in NullFields will be sent to the
  1949. // server as null. It is an error if a field in this list has a
  1950. // non-empty value. This may be used to include null fields in Patch
  1951. // requests.
  1952. NullFields []string `json:"-"`
  1953. }
  1954. func (s *DealPauseStatus) MarshalJSON() ([]byte, error) {
  1955. type NoMethod DealPauseStatus
  1956. raw := NoMethod(*s)
  1957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1958. }
  1959. // DealServingMetadata: Message captures metadata about the serving
  1960. // status of a deal.
  1961. type DealServingMetadata struct {
  1962. // DealPauseStatus: Tracks which parties (if any) have paused a
  1963. // deal.
  1964. // @OutputOnly
  1965. DealPauseStatus *DealPauseStatus `json:"dealPauseStatus,omitempty"`
  1966. // ForceSendFields is a list of field names (e.g. "DealPauseStatus") to
  1967. // unconditionally include in API requests. By default, fields with
  1968. // empty values are omitted from API requests. However, any non-pointer,
  1969. // non-interface field appearing in ForceSendFields will be sent to the
  1970. // server regardless of whether the field is empty or not. This may be
  1971. // used to include empty fields in Patch requests.
  1972. ForceSendFields []string `json:"-"`
  1973. // NullFields is a list of field names (e.g. "DealPauseStatus") to
  1974. // include in API requests with the JSON null value. By default, fields
  1975. // with empty values are omitted from API requests. However, any field
  1976. // with an empty value appearing in NullFields will be sent to the
  1977. // server as null. It is an error if a field in this list has a
  1978. // non-empty value. This may be used to include null fields in Patch
  1979. // requests.
  1980. NullFields []string `json:"-"`
  1981. }
  1982. func (s *DealServingMetadata) MarshalJSON() ([]byte, error) {
  1983. type NoMethod DealServingMetadata
  1984. raw := NoMethod(*s)
  1985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1986. }
  1987. // DealTerms: The deal terms specify the details of a Product/deal. They
  1988. // specify things
  1989. // like price per buyer, the type of pricing model (e.g., fixed price,
  1990. // auction)
  1991. // and expected impressions from the publisher.
  1992. type DealTerms struct {
  1993. // BrandingType: Visibility of the URL in bid requests. (default:
  1994. // BRANDED)
  1995. //
  1996. // Possible values:
  1997. // "BRANDING_TYPE_UNSPECIFIED" - A placeholder for an undefined
  1998. // branding type.
  1999. // "BRANDED" - Full URL is included in bid requests.
  2000. // "SEMI_TRANSPARENT" - A TopLevelDomain or masked URL is sent in bid
  2001. // requests
  2002. // rather than the full one.
  2003. BrandingType string `json:"brandingType,omitempty"`
  2004. // Description: Publisher provided description for the terms.
  2005. Description string `json:"description,omitempty"`
  2006. // EstimatedGrossSpend: Non-binding estimate of the estimated gross
  2007. // spend for this deal.
  2008. // Can be set by buyer or seller.
  2009. EstimatedGrossSpend *Price `json:"estimatedGrossSpend,omitempty"`
  2010. // EstimatedImpressionsPerDay: Non-binding estimate of the impressions
  2011. // served per day.
  2012. // Can be set by buyer or seller.
  2013. EstimatedImpressionsPerDay int64 `json:"estimatedImpressionsPerDay,omitempty,string"`
  2014. // GuaranteedFixedPriceTerms: The terms for guaranteed fixed price
  2015. // deals.
  2016. GuaranteedFixedPriceTerms *GuaranteedFixedPriceTerms `json:"guaranteedFixedPriceTerms,omitempty"`
  2017. // NonGuaranteedAuctionTerms: The terms for non-guaranteed auction
  2018. // deals.
  2019. NonGuaranteedAuctionTerms *NonGuaranteedAuctionTerms `json:"nonGuaranteedAuctionTerms,omitempty"`
  2020. // NonGuaranteedFixedPriceTerms: The terms for non-guaranteed fixed
  2021. // price deals.
  2022. NonGuaranteedFixedPriceTerms *NonGuaranteedFixedPriceTerms `json:"nonGuaranteedFixedPriceTerms,omitempty"`
  2023. // SellerTimeZone: The time zone name. For deals with Cost Per Day
  2024. // billing, defines the
  2025. // time zone used to mark the boundaries of a day. It should be an
  2026. // IANA TZ name, such as "America/Los_Angeles". For more
  2027. // information,
  2028. // see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
  2029. SellerTimeZone string `json:"sellerTimeZone,omitempty"`
  2030. // ForceSendFields is a list of field names (e.g. "BrandingType") to
  2031. // unconditionally include in API requests. By default, fields with
  2032. // empty values are omitted from API requests. However, any non-pointer,
  2033. // non-interface field appearing in ForceSendFields will be sent to the
  2034. // server regardless of whether the field is empty or not. This may be
  2035. // used to include empty fields in Patch requests.
  2036. ForceSendFields []string `json:"-"`
  2037. // NullFields is a list of field names (e.g. "BrandingType") to include
  2038. // in API requests with the JSON null value. By default, fields with
  2039. // empty values are omitted from API requests. However, any field with
  2040. // an empty value appearing in NullFields will be sent to the server as
  2041. // null. It is an error if a field in this list has a non-empty value.
  2042. // This may be used to include null fields in Patch requests.
  2043. NullFields []string `json:"-"`
  2044. }
  2045. func (s *DealTerms) MarshalJSON() ([]byte, error) {
  2046. type NoMethod DealTerms
  2047. raw := NoMethod(*s)
  2048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2049. }
  2050. // DeliveryControl: Message contains details about how the deals will be
  2051. // paced.
  2052. type DeliveryControl struct {
  2053. // CreativeBlockingLevel: Specified the creative blocking levels to be
  2054. // applied.
  2055. // @OutputOnly
  2056. //
  2057. // Possible values:
  2058. // "CREATIVE_BLOCKING_LEVEL_UNSPECIFIED" - A placeholder for an
  2059. // undefined creative blocking level.
  2060. // "PUBLISHER_BLOCKING_RULES" - Publisher blocking rules will be
  2061. // applied.
  2062. // "ADX_POLICY_BLOCKING_ONLY" - The Ad Exchange policy blocking rules
  2063. // will be applied.
  2064. CreativeBlockingLevel string `json:"creativeBlockingLevel,omitempty"`
  2065. // DeliveryRateType: Specifies how the impression delivery will be
  2066. // paced.
  2067. // @OutputOnly
  2068. //
  2069. // Possible values:
  2070. // "DELIVERY_RATE_TYPE_UNSPECIFIED" - A placeholder for an undefined
  2071. // delivery rate type.
  2072. // "EVENLY" - Impressions are served uniformly over the life of the
  2073. // deal.
  2074. // "FRONT_LOADED" - Impressions are served front-loaded.
  2075. // "AS_FAST_AS_POSSIBLE" - Impressions are served as fast as possible.
  2076. DeliveryRateType string `json:"deliveryRateType,omitempty"`
  2077. // FrequencyCaps: Specifies any frequency caps.
  2078. // @OutputOnly
  2079. FrequencyCaps []*FrequencyCap `json:"frequencyCaps,omitempty"`
  2080. // ForceSendFields is a list of field names (e.g.
  2081. // "CreativeBlockingLevel") to unconditionally include in API requests.
  2082. // By default, fields with empty values are omitted from API requests.
  2083. // However, any non-pointer, non-interface field appearing in
  2084. // ForceSendFields will be sent to the server regardless of whether the
  2085. // field is empty or not. This may be used to include empty fields in
  2086. // Patch requests.
  2087. ForceSendFields []string `json:"-"`
  2088. // NullFields is a list of field names (e.g. "CreativeBlockingLevel") to
  2089. // include in API requests with the JSON null value. By default, fields
  2090. // with empty values are omitted from API requests. However, any field
  2091. // with an empty value appearing in NullFields will be sent to the
  2092. // server as null. It is an error if a field in this list has a
  2093. // non-empty value. This may be used to include null fields in Patch
  2094. // requests.
  2095. NullFields []string `json:"-"`
  2096. }
  2097. func (s *DeliveryControl) MarshalJSON() ([]byte, error) {
  2098. type NoMethod DeliveryControl
  2099. raw := NoMethod(*s)
  2100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2101. }
  2102. // Disapproval: @OutputOnly The reason and details for a disapproval.
  2103. type Disapproval struct {
  2104. // Details: Additional details about the reason for disapproval.
  2105. Details []string `json:"details,omitempty"`
  2106. // Reason: The categorized reason for disapproval.
  2107. //
  2108. // Possible values:
  2109. // "LENGTH_OF_IMAGE_ANIMATION" - The length of the image animation is
  2110. // longer than allowed.
  2111. // "BROKEN_URL" - The click through URL doesn't work properly.
  2112. // "MEDIA_NOT_FUNCTIONAL" - Something is wrong with the creative
  2113. // itself.
  2114. // "INVALID_FOURTH_PARTY_CALL" - The ad makes a fourth party call to
  2115. // an unapproved vendor.
  2116. // "INCORRECT_REMARKETING_DECLARATION" - The ad targets consumers
  2117. // using remarketing lists and/or collects
  2118. // data for subsequent use in retargeting, but does not correctly
  2119. // declare
  2120. // that use.
  2121. // "LANDING_PAGE_ERROR" - Clicking on the ad leads to an error page.
  2122. // "AD_SIZE_DOES_NOT_MATCH_AD_SLOT" - The ad size when rendered does
  2123. // not match the declaration.
  2124. // "NO_BORDER" - Ads with a white background require a border, which
  2125. // was missing.
  2126. // "FOURTH_PARTY_BROWSER_COOKIES" - The creative attempts to set
  2127. // cookies from a fourth party that is not
  2128. // certified.
  2129. // "LSO_OBJECTS" - The creative sets an LSO object.
  2130. // "BLANK_CREATIVE" - The ad serves a blank.
  2131. // "DESTINATION_URLS_UNDECLARED" - The ad uses rotation, but not all
  2132. // destination URLs were declared.
  2133. // "PROBLEM_WITH_CLICK_MACRO" - There is a problem with the way the
  2134. // click macro is used.
  2135. // "INCORRECT_AD_TECHNOLOGY_DECLARATION" - The ad technology
  2136. // declaration is not accurate.
  2137. // "INCORRECT_DESTINATION_URL_DECLARATION" - The actual destination
  2138. // URL does not match the declared destination URL.
  2139. // "EXPANDABLE_INCORRECT_DIRECTION" - The declared expanding direction
  2140. // does not match the actual direction.
  2141. // "EXPANDABLE_DIRECTION_NOT_SUPPORTED" - The ad does not expand in a
  2142. // supported direction.
  2143. // "EXPANDABLE_INVALID_VENDOR" - The ad uses an expandable vendor that
  2144. // is not supported.
  2145. // "EXPANDABLE_FUNCTIONALITY" - There was an issue with the expandable
  2146. // ad.
  2147. // "VIDEO_INVALID_VENDOR" - The ad uses a video vendor that is not
  2148. // supported.
  2149. // "VIDEO_UNSUPPORTED_LENGTH" - The length of the video ad is not
  2150. // supported.
  2151. // "VIDEO_UNSUPPORTED_FORMAT" - The format of the video ad is not
  2152. // supported.
  2153. // "VIDEO_FUNCTIONALITY" - There was an issue with the video ad.
  2154. // "LANDING_PAGE_DISABLED" - The landing page does not conform to Ad
  2155. // Exchange policy.
  2156. // "MALWARE_SUSPECTED" - The ad or the landing page may contain
  2157. // malware.
  2158. // "ADULT_IMAGE_OR_VIDEO" - The ad contains adult images or video
  2159. // content.
  2160. // "INACCURATE_AD_TEXT" - The ad contains text that is unclear or
  2161. // inaccurate.
  2162. // "COUNTERFEIT_DESIGNER_GOODS" - The ad promotes counterfeit designer
  2163. // goods.
  2164. // "POP_UP" - The ad causes a popup window to appear.
  2165. // "INVALID_RTB_PROTOCOL_USAGE" - The creative does not follow
  2166. // policies set for the RTB protocol.
  2167. // "RAW_IP_ADDRESS_IN_SNIPPET" - The ad contains a URL that uses a
  2168. // numeric IP address for the domain.
  2169. // "UNACCEPTABLE_CONTENT_SOFTWARE" - The ad or landing page contains
  2170. // unacceptable content because it initiated
  2171. // a software or executable download.
  2172. // "UNAUTHORIZED_COOKIE_ON_GOOGLE_DOMAIN" - The ad set an unauthorized
  2173. // cookie on a Google domain.
  2174. // "UNDECLARED_FLASH_OBJECTS" - Flash content found when no flash was
  2175. // declared.
  2176. // "INVALID_SSL_DECLARATION" - SSL support declared but not working
  2177. // correctly.
  2178. // "DIRECT_DOWNLOAD_IN_AD" - Rich Media - Direct Download in Ad (ex.
  2179. // PDF download).
  2180. // "MAXIMUM_DOWNLOAD_SIZE_EXCEEDED" - Maximum download size exceeded.
  2181. // "DESTINATION_URL_SITE_NOT_CRAWLABLE" - Bad Destination URL: Site
  2182. // Not Crawlable.
  2183. // "BAD_URL_LEGAL_DISAPPROVAL" - Bad URL: Legal disapproval.
  2184. // "PHARMA_GAMBLING_ALCOHOL_NOT_ALLOWED" - Pharmaceuticals, Gambling,
  2185. // Alcohol not allowed and at least one was
  2186. // detected.
  2187. // "DYNAMIC_DNS_AT_DESTINATION_URL" - Dynamic DNS at Destination URL.
  2188. // "POOR_IMAGE_OR_VIDEO_QUALITY" - Poor Image / Video Quality.
  2189. // "UNACCEPTABLE_IMAGE_CONTENT" - For example, Image Trick to Click.
  2190. // "INCORRECT_IMAGE_LAYOUT" - Incorrect Image Layout.
  2191. // "IRRELEVANT_IMAGE_OR_VIDEO" - Irrelevant Image / Video.
  2192. // "DESTINATION_SITE_DOES_NOT_ALLOW_GOING_BACK" - Broken back button.
  2193. // "MISLEADING_CLAIMS_IN_AD" - Misleading/Inaccurate claims in ads.
  2194. // "RESTRICTED_PRODUCTS" - Restricted Products.
  2195. // "UNACCEPTABLE_CONTENT" - Unacceptable content. For example,
  2196. // malware.
  2197. // "AUTOMATED_AD_CLICKING" - The ad automatically redirects to the
  2198. // destination site without a click,
  2199. // or reports a click when none were made.
  2200. // "INVALID_URL_PROTOCOL" - The ad uses URL protocols that do not
  2201. // exist or are not allowed on AdX.
  2202. // "UNDECLARED_RESTRICTED_CONTENT" - Restricted content (for example,
  2203. // alcohol) was found in the ad but not
  2204. // declared.
  2205. // "INVALID_REMARKETING_LIST_USAGE" - Violation of the remarketing
  2206. // list policy.
  2207. // "DESTINATION_SITE_NOT_CRAWLABLE_ROBOTS_TXT" - The destination
  2208. // site's robot.txt file prevents it from being crawled.
  2209. // "CLICK_TO_DOWNLOAD_NOT_AN_APP" - Click to download must link to an
  2210. // app.
  2211. // "INACCURATE_REVIEW_EXTENSION" - A review extension must be an
  2212. // accurate review.
  2213. // "SEXUALLY_EXPLICIT_CONTENT" - Sexually explicit content.
  2214. // "GAINING_AN_UNFAIR_ADVANTAGE" - The ad tries to gain an unfair
  2215. // traffic advantage.
  2216. // "GAMING_THE_GOOGLE_NETWORK" - The ad tries to circumvent Google's
  2217. // advertising systems.
  2218. // "DANGEROUS_PRODUCTS_KNIVES" - The ad promotes dangerous knives.
  2219. // "DANGEROUS_PRODUCTS_EXPLOSIVES" - The ad promotes explosives.
  2220. // "DANGEROUS_PRODUCTS_GUNS" - The ad promotes guns & parts.
  2221. // "DANGEROUS_PRODUCTS_DRUGS" - The ad promotes recreational
  2222. // drugs/services & related equipment.
  2223. // "DANGEROUS_PRODUCTS_TOBACCO" - The ad promotes tobacco
  2224. // products/services & related equipment.
  2225. // "DANGEROUS_PRODUCTS_WEAPONS" - The ad promotes weapons.
  2226. // "UNCLEAR_OR_IRRELEVANT_AD" - The ad is unclear or irrelevant to the
  2227. // destination site.
  2228. // "PROFESSIONAL_STANDARDS" - The ad does not meet professional
  2229. // standards.
  2230. // "DYSFUNCTIONAL_PROMOTION" - The promotion is unnecessarily
  2231. // difficult to navigate.
  2232. // "INVALID_INTEREST_BASED_AD" - Violation of Google's policy for
  2233. // interest-based ads.
  2234. // "MISUSE_OF_PERSONAL_INFORMATION" - Misuse of personal information.
  2235. // "OMISSION_OF_RELEVANT_INFORMATION" - Omission of relevant
  2236. // information.
  2237. // "UNAVAILABLE_PROMOTIONS" - Unavailable promotions.
  2238. // "MISLEADING_PROMOTIONS" - Misleading or unrealistic promotions.
  2239. // "INAPPROPRIATE_CONTENT" - Offensive or inappropriate content.
  2240. // "SENSITIVE_EVENTS" - Capitalizing on sensitive events.
  2241. // "SHOCKING_CONTENT" - Shocking content.
  2242. // "ENABLING_DISHONEST_BEHAVIOR" - Products & Services that enable
  2243. // dishonest behavior.
  2244. // "TECHNICAL_REQUIREMENTS" - The ad does not meet technical
  2245. // requirements.
  2246. // "RESTRICTED_POLITICAL_CONTENT" - Restricted political content.
  2247. // "UNSUPPORTED_CONTENT" - Unsupported content.
  2248. // "INVALID_BIDDING_METHOD" - Invalid bidding method.
  2249. // "VIDEO_TOO_LONG" - Video length exceeds limits.
  2250. // "VIOLATES_JAPANESE_PHARMACY_LAW" - Unacceptable content: Japanese
  2251. // healthcare.
  2252. // "UNACCREDITED_PET_PHARMACY" - Online pharmacy ID required.
  2253. // "ABORTION" - Unacceptable content: Abortion.
  2254. // "CONTRACEPTIVES" - Unacceptable content: Birth control.
  2255. // "NEED_CERTIFICATES_TO_ADVERTISE_IN_CHINA" - Restricted in China.
  2256. // "KCDSP_REGISTRATION" - Unacceptable content: Korean healthcare.
  2257. // "NOT_FAMILY_SAFE" - Non-family safe or adult content.
  2258. // "CLINICAL_TRIAL_RECRUITMENT" - Clinical trial recruitment.
  2259. // "MAXIMUM_NUMBER_OF_HTTP_CALLS_EXCEEDED" - Maximum number of HTTP
  2260. // calls exceeded.
  2261. // "MAXIMUM_NUMBER_OF_COOKIES_EXCEEDED" - Maximum number of cookies
  2262. // exceeded.
  2263. // "PERSONAL_LOANS" - Financial service ad does not adhere to
  2264. // specifications.
  2265. // "UNSUPPORTED_FLASH_CONTENT" - Flash content was found in an
  2266. // unsupported context.
  2267. // "MISUSE_BY_OMID_SCRIPT" - Misuse by an Open Measurement SDK script.
  2268. // "NON_WHITELISTED_OMID_VENDOR" - Use of an Open Measurement SDK
  2269. // vendor not on approved whitelist.
  2270. // "DESTINATION_EXPERIENCE" - Unacceptable landing page.
  2271. // "UNSUPPORTED_LANGUAGE" - Unsupported language.
  2272. // "NON_SSL_COMPLIANT" - Non-SSL compliant.
  2273. // "TEMPORARY_PAUSE" - Temporary pausing of creative.
  2274. // "BAIL_BONDS" - Promotes services related to bail bonds.
  2275. Reason string `json:"reason,omitempty"`
  2276. // ForceSendFields is a list of field names (e.g. "Details") to
  2277. // unconditionally include in API requests. By default, fields with
  2278. // empty values are omitted from API requests. However, any non-pointer,
  2279. // non-interface field appearing in ForceSendFields will be sent to the
  2280. // server regardless of whether the field is empty or not. This may be
  2281. // used to include empty fields in Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "Details") to include in
  2284. // API requests with the JSON null value. By default, fields with empty
  2285. // values are omitted from API requests. However, any field with an
  2286. // empty value appearing in NullFields will be sent to the server as
  2287. // null. It is an error if a field in this list has a non-empty value.
  2288. // This may be used to include null fields in Patch requests.
  2289. NullFields []string `json:"-"`
  2290. }
  2291. func (s *Disapproval) MarshalJSON() ([]byte, error) {
  2292. type NoMethod Disapproval
  2293. raw := NoMethod(*s)
  2294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2295. }
  2296. // Empty: A generic empty message that you can re-use to avoid defining
  2297. // duplicated
  2298. // empty messages in your APIs. A typical example is to use it as the
  2299. // request
  2300. // or the response type of an API method. For instance:
  2301. //
  2302. // service Foo {
  2303. // rpc Bar(google.protobuf.Empty) returns
  2304. // (google.protobuf.Empty);
  2305. // }
  2306. //
  2307. // The JSON representation for `Empty` is empty JSON object `{}`.
  2308. type Empty struct {
  2309. // ServerResponse contains the HTTP response code and headers from the
  2310. // server.
  2311. googleapi.ServerResponse `json:"-"`
  2312. }
  2313. // FilterSet: A set of filters that is applied to a request for
  2314. // data.
  2315. // Within a filter set, an AND operation is performed across the
  2316. // filters
  2317. // represented by each field. An OR operation is performed across the
  2318. // filters
  2319. // represented by the multiple values of a repeated field,
  2320. // e.g.,
  2321. // "format=VIDEO AND deal_id=12 AND (seller_network_id=34
  2322. // OR
  2323. // seller_network_id=56)".
  2324. type FilterSet struct {
  2325. // AbsoluteDateRange: An absolute date range, defined by a start date
  2326. // and an end date.
  2327. // Interpreted relative to Pacific time zone.
  2328. AbsoluteDateRange *AbsoluteDateRange `json:"absoluteDateRange,omitempty"`
  2329. // BreakdownDimensions: The set of dimensions along which to break down
  2330. // the response; may be empty.
  2331. // If multiple dimensions are requested, the breakdown is along the
  2332. // Cartesian
  2333. // product of the requested dimensions.
  2334. //
  2335. // Possible values:
  2336. // "BREAKDOWN_DIMENSION_UNSPECIFIED" - A placeholder for an
  2337. // unspecified dimension; should not be used.
  2338. // "PUBLISHER_IDENTIFIER" - The response should be broken down by
  2339. // publisher identifier.
  2340. // This option is available only for Open Bidding buyers.
  2341. BreakdownDimensions []string `json:"breakdownDimensions,omitempty"`
  2342. // CreativeId: The ID of the creative on which to filter; optional. This
  2343. // field may be set
  2344. // only for a filter set that accesses account-level troubleshooting
  2345. // data,
  2346. // i.e., one whose name matches the
  2347. // `bidders/*/accounts/*/filterSets/*`
  2348. // pattern.
  2349. CreativeId string `json:"creativeId,omitempty"`
  2350. // DealId: The ID of the deal on which to filter; optional. This field
  2351. // may be set
  2352. // only for a filter set that accesses account-level troubleshooting
  2353. // data,
  2354. // i.e., one whose name matches the
  2355. // `bidders/*/accounts/*/filterSets/*`
  2356. // pattern.
  2357. DealId int64 `json:"dealId,omitempty,string"`
  2358. // Environment: The environment on which to filter; optional.
  2359. //
  2360. // Possible values:
  2361. // "ENVIRONMENT_UNSPECIFIED" - A placeholder for an undefined
  2362. // environment; indicates that no environment
  2363. // filter will be applied.
  2364. // "WEB" - The ad impression appears on the web.
  2365. // "APP" - The ad impression appears in an app.
  2366. Environment string `json:"environment,omitempty"`
  2367. // Formats: The list of formats on which to filter; may be empty. The
  2368. // filters
  2369. // represented by multiple formats are ORed together (i.e., if
  2370. // non-empty,
  2371. // results must match any one of the formats).
  2372. //
  2373. // Possible values:
  2374. // "FORMAT_UNSPECIFIED" - A placeholder for an undefined format;
  2375. // indicates that no format filter
  2376. // will be applied.
  2377. // "NATIVE_DISPLAY" - The ad impression is a native ad, and display
  2378. // (i.e., image) format.
  2379. // "NATIVE_VIDEO" - The ad impression is a native ad, and video
  2380. // format.
  2381. // "NON_NATIVE_DISPLAY" - The ad impression is not a native ad, and
  2382. // display (i.e., image) format.
  2383. // "NON_NATIVE_VIDEO" - The ad impression is not a native ad, and
  2384. // video format.
  2385. Formats []string `json:"formats,omitempty"`
  2386. // Name: A user-defined name of the filter set. Filter set names must be
  2387. // unique
  2388. // globally and match one of the patterns:
  2389. //
  2390. // - `bidders/*/filterSets/*` (for accessing bidder-level
  2391. // troubleshooting
  2392. // data)
  2393. // - `bidders/*/accounts/*/filterSets/*` (for accessing
  2394. // account-level
  2395. // troubleshooting data)
  2396. //
  2397. // This field is required in create operations.
  2398. Name string `json:"name,omitempty"`
  2399. // Platforms: The list of platforms on which to filter; may be empty.
  2400. // The filters
  2401. // represented by multiple platforms are ORed together (i.e., if
  2402. // non-empty,
  2403. // results must match any one of the platforms).
  2404. //
  2405. // Possible values:
  2406. // "PLATFORM_UNSPECIFIED" - A placeholder for an undefined platform;
  2407. // indicates that no platform
  2408. // filter will be applied.
  2409. // "DESKTOP" - The ad impression appears on a desktop.
  2410. // "TABLET" - The ad impression appears on a tablet.
  2411. // "MOBILE" - The ad impression appears on a mobile device.
  2412. Platforms []string `json:"platforms,omitempty"`
  2413. // PublisherIdentifiers: For Open Bidding partners only.
  2414. // The list of publisher identifiers on which to filter; may be
  2415. // empty.
  2416. // The filters represented by multiple publisher identifiers are
  2417. // ORed
  2418. // together.
  2419. PublisherIdentifiers []string `json:"publisherIdentifiers,omitempty"`
  2420. // RealtimeTimeRange: An open-ended realtime time range, defined by the
  2421. // aggregation start
  2422. // timestamp.
  2423. RealtimeTimeRange *RealtimeTimeRange `json:"realtimeTimeRange,omitempty"`
  2424. // RelativeDateRange: A relative date range, defined by an offset from
  2425. // today and a duration.
  2426. // Interpreted relative to Pacific time zone.
  2427. RelativeDateRange *RelativeDateRange `json:"relativeDateRange,omitempty"`
  2428. // SellerNetworkIds: For Authorized Buyers only.
  2429. // The list of IDs of the seller (publisher) networks on which to
  2430. // filter;
  2431. // may be empty. The filters represented by multiple seller network IDs
  2432. // are
  2433. // ORed together (i.e., if non-empty, results must match any one of
  2434. // the
  2435. // publisher networks).
  2436. // See
  2437. // [seller-network-ids](https://developers.google.com/authorized-buye
  2438. // rs/rtb/downloads/seller-network-ids)
  2439. // file for the set of existing seller network IDs.
  2440. SellerNetworkIds []int64 `json:"sellerNetworkIds,omitempty"`
  2441. // TimeSeriesGranularity: The granularity of time intervals if a time
  2442. // series breakdown is desired;
  2443. // optional.
  2444. //
  2445. // Possible values:
  2446. // "TIME_SERIES_GRANULARITY_UNSPECIFIED" - A placeholder for an
  2447. // unspecified interval; no time series is applied.
  2448. // All rows in response will contain data for the entire requested time
  2449. // range.
  2450. // "HOURLY" - Indicates that data will be broken down by the hour.
  2451. // "DAILY" - Indicates that data will be broken down by the day.
  2452. TimeSeriesGranularity string `json:"timeSeriesGranularity,omitempty"`
  2453. // ServerResponse contains the HTTP response code and headers from the
  2454. // server.
  2455. googleapi.ServerResponse `json:"-"`
  2456. // ForceSendFields is a list of field names (e.g. "AbsoluteDateRange")
  2457. // to unconditionally include in API requests. By default, fields with
  2458. // empty values are omitted from API requests. However, any non-pointer,
  2459. // non-interface field appearing in ForceSendFields will be sent to the
  2460. // server regardless of whether the field is empty or not. This may be
  2461. // used to include empty fields in Patch requests.
  2462. ForceSendFields []string `json:"-"`
  2463. // NullFields is a list of field names (e.g. "AbsoluteDateRange") to
  2464. // include in API requests with the JSON null value. By default, fields
  2465. // with empty values are omitted from API requests. However, any field
  2466. // with an empty value appearing in NullFields will be sent to the
  2467. // server as null. It is an error if a field in this list has a
  2468. // non-empty value. This may be used to include null fields in Patch
  2469. // requests.
  2470. NullFields []string `json:"-"`
  2471. }
  2472. func (s *FilterSet) MarshalJSON() ([]byte, error) {
  2473. type NoMethod FilterSet
  2474. raw := NoMethod(*s)
  2475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2476. }
  2477. // FilteredBidCreativeRow: The number of filtered bids with the
  2478. // specified dimension values that have the
  2479. // specified creative.
  2480. type FilteredBidCreativeRow struct {
  2481. // BidCount: The number of bids with the specified creative.
  2482. BidCount *MetricValue `json:"bidCount,omitempty"`
  2483. // CreativeId: The ID of the creative.
  2484. CreativeId string `json:"creativeId,omitempty"`
  2485. // RowDimensions: The values of all dimensions associated with metric
  2486. // values in this row.
  2487. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  2488. // ForceSendFields is a list of field names (e.g. "BidCount") to
  2489. // unconditionally include in API requests. By default, fields with
  2490. // empty values are omitted from API requests. However, any non-pointer,
  2491. // non-interface field appearing in ForceSendFields will be sent to the
  2492. // server regardless of whether the field is empty or not. This may be
  2493. // used to include empty fields in Patch requests.
  2494. ForceSendFields []string `json:"-"`
  2495. // NullFields is a list of field names (e.g. "BidCount") to include in
  2496. // API requests with the JSON null value. By default, fields with empty
  2497. // values are omitted from API requests. However, any field with an
  2498. // empty value appearing in NullFields will be sent to the server as
  2499. // null. It is an error if a field in this list has a non-empty value.
  2500. // This may be used to include null fields in Patch requests.
  2501. NullFields []string `json:"-"`
  2502. }
  2503. func (s *FilteredBidCreativeRow) MarshalJSON() ([]byte, error) {
  2504. type NoMethod FilteredBidCreativeRow
  2505. raw := NoMethod(*s)
  2506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2507. }
  2508. // FilteredBidDetailRow: The number of filtered bids with the specified
  2509. // dimension values, among those
  2510. // filtered due to the requested filtering reason (i.e. creative
  2511. // status), that
  2512. // have the specified detail.
  2513. type FilteredBidDetailRow struct {
  2514. // BidCount: The number of bids with the specified detail.
  2515. BidCount *MetricValue `json:"bidCount,omitempty"`
  2516. // DetailId: The ID of the detail. The associated value can be looked up
  2517. // in the
  2518. // dictionary file corresponding to the DetailType in the response
  2519. // message.
  2520. DetailId int64 `json:"detailId,omitempty"`
  2521. // RowDimensions: The values of all dimensions associated with metric
  2522. // values in this row.
  2523. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  2524. // ForceSendFields is a list of field names (e.g. "BidCount") to
  2525. // unconditionally include in API requests. By default, fields with
  2526. // empty values are omitted from API requests. However, any non-pointer,
  2527. // non-interface field appearing in ForceSendFields will be sent to the
  2528. // server regardless of whether the field is empty or not. This may be
  2529. // used to include empty fields in Patch requests.
  2530. ForceSendFields []string `json:"-"`
  2531. // NullFields is a list of field names (e.g. "BidCount") to include in
  2532. // API requests with the JSON null value. By default, fields with empty
  2533. // values are omitted from API requests. However, any field with an
  2534. // empty value appearing in NullFields will be sent to the server as
  2535. // null. It is an error if a field in this list has a non-empty value.
  2536. // This may be used to include null fields in Patch requests.
  2537. NullFields []string `json:"-"`
  2538. }
  2539. func (s *FilteredBidDetailRow) MarshalJSON() ([]byte, error) {
  2540. type NoMethod FilteredBidDetailRow
  2541. raw := NoMethod(*s)
  2542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2543. }
  2544. // FilteringStats: @OutputOnly Filtering reasons for this creative
  2545. // during a period of a single
  2546. // day (from midnight to midnight Pacific).
  2547. type FilteringStats struct {
  2548. // Date: The day during which the data was collected.
  2549. // The data is collected from 00:00:00 to 23:59:59 PT.
  2550. // During switches from PST to PDT and back, the day may
  2551. // contain 23 or 25 hours of data instead of the usual 24.
  2552. Date *Date `json:"date,omitempty"`
  2553. // Reasons: The set of filtering reasons for this date.
  2554. Reasons []*Reason `json:"reasons,omitempty"`
  2555. // ForceSendFields is a list of field names (e.g. "Date") to
  2556. // unconditionally include in API requests. By default, fields with
  2557. // empty values are omitted from API requests. However, any non-pointer,
  2558. // non-interface field appearing in ForceSendFields will be sent to the
  2559. // server regardless of whether the field is empty or not. This may be
  2560. // used to include empty fields in Patch requests.
  2561. ForceSendFields []string `json:"-"`
  2562. // NullFields is a list of field names (e.g. "Date") to include in API
  2563. // requests with the JSON null value. By default, fields with empty
  2564. // values are omitted from API requests. However, any field with an
  2565. // empty value appearing in NullFields will be sent to the server as
  2566. // null. It is an error if a field in this list has a non-empty value.
  2567. // This may be used to include null fields in Patch requests.
  2568. NullFields []string `json:"-"`
  2569. }
  2570. func (s *FilteringStats) MarshalJSON() ([]byte, error) {
  2571. type NoMethod FilteringStats
  2572. raw := NoMethod(*s)
  2573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2574. }
  2575. // FirstPartyMobileApplicationTargeting: Represents a list of targeted
  2576. // and excluded mobile application IDs that
  2577. // publishers own.
  2578. // Mobile application IDs are from App Store and Google Play
  2579. // Store.
  2580. // Android App ID, for example, com.google.android.apps.maps, can be
  2581. // found in
  2582. // Google Play Store URL.
  2583. // iOS App ID (which is a number) can be found at the end of iTunes
  2584. // store URL.
  2585. // First party mobile applications is either included or excluded.
  2586. type FirstPartyMobileApplicationTargeting struct {
  2587. // ExcludedAppIds: A list of application IDs to be excluded.
  2588. ExcludedAppIds []string `json:"excludedAppIds,omitempty"`
  2589. // TargetedAppIds: A list of application IDs to be included.
  2590. TargetedAppIds []string `json:"targetedAppIds,omitempty"`
  2591. // ForceSendFields is a list of field names (e.g. "ExcludedAppIds") to
  2592. // unconditionally include in API requests. By default, fields with
  2593. // empty values are omitted from API requests. However, any non-pointer,
  2594. // non-interface field appearing in ForceSendFields will be sent to the
  2595. // server regardless of whether the field is empty or not. This may be
  2596. // used to include empty fields in Patch requests.
  2597. ForceSendFields []string `json:"-"`
  2598. // NullFields is a list of field names (e.g. "ExcludedAppIds") to
  2599. // include in API requests with the JSON null value. By default, fields
  2600. // with empty values are omitted from API requests. However, any field
  2601. // with an empty value appearing in NullFields will be sent to the
  2602. // server as null. It is an error if a field in this list has a
  2603. // non-empty value. This may be used to include null fields in Patch
  2604. // requests.
  2605. NullFields []string `json:"-"`
  2606. }
  2607. func (s *FirstPartyMobileApplicationTargeting) MarshalJSON() ([]byte, error) {
  2608. type NoMethod FirstPartyMobileApplicationTargeting
  2609. raw := NoMethod(*s)
  2610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2611. }
  2612. // FrequencyCap: Frequency cap.
  2613. type FrequencyCap struct {
  2614. // MaxImpressions: The maximum number of impressions that can be served
  2615. // to a user within the
  2616. // specified time period.
  2617. MaxImpressions int64 `json:"maxImpressions,omitempty"`
  2618. // NumTimeUnits: The amount of time, in the units specified by
  2619. // time_unit_type. Defines the
  2620. // amount of time over which impressions per user are counted and
  2621. // capped.
  2622. NumTimeUnits int64 `json:"numTimeUnits,omitempty"`
  2623. // TimeUnitType: The time unit. Along with num_time_units defines the
  2624. // amount of time over
  2625. // which impressions per user are counted and capped.
  2626. //
  2627. // Possible values:
  2628. // "TIME_UNIT_TYPE_UNSPECIFIED" - A placeholder for an undefined time
  2629. // unit type. This just indicates the
  2630. // variable with this value hasn't been initialized.
  2631. // "MINUTE" - Minute
  2632. // "HOUR" - Hour
  2633. // "DAY" - Day
  2634. // "WEEK" - Week
  2635. // "MONTH" - Month
  2636. // "LIFETIME" - Lifetime
  2637. TimeUnitType string `json:"timeUnitType,omitempty"`
  2638. // ForceSendFields is a list of field names (e.g. "MaxImpressions") to
  2639. // unconditionally include in API requests. By default, fields with
  2640. // empty values are omitted from API requests. However, any non-pointer,
  2641. // non-interface field appearing in ForceSendFields will be sent to the
  2642. // server regardless of whether the field is empty or not. This may be
  2643. // used to include empty fields in Patch requests.
  2644. ForceSendFields []string `json:"-"`
  2645. // NullFields is a list of field names (e.g. "MaxImpressions") to
  2646. // include in API requests with the JSON null value. By default, fields
  2647. // with empty values are omitted from API requests. However, any field
  2648. // with an empty value appearing in NullFields will be sent to the
  2649. // server as null. It is an error if a field in this list has a
  2650. // non-empty value. This may be used to include null fields in Patch
  2651. // requests.
  2652. NullFields []string `json:"-"`
  2653. }
  2654. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  2655. type NoMethod FrequencyCap
  2656. raw := NoMethod(*s)
  2657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2658. }
  2659. // GuaranteedFixedPriceTerms: Terms for Programmatic Guaranteed Deals.
  2660. type GuaranteedFixedPriceTerms struct {
  2661. // FixedPrices: Fixed price for the specified buyer.
  2662. FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
  2663. // GuaranteedImpressions: Guaranteed impressions as a percentage. This
  2664. // is the percentage
  2665. // of guaranteed looks that the buyer is guaranteeing to buy.
  2666. GuaranteedImpressions int64 `json:"guaranteedImpressions,omitempty,string"`
  2667. // GuaranteedLooks: Count of guaranteed looks. Required for deal,
  2668. // optional for product.
  2669. GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"`
  2670. // MinimumDailyLooks: Daily minimum looks for CPD deal types.
  2671. MinimumDailyLooks int64 `json:"minimumDailyLooks,omitempty,string"`
  2672. // ForceSendFields is a list of field names (e.g. "FixedPrices") to
  2673. // unconditionally include in API requests. By default, fields with
  2674. // empty values are omitted from API requests. However, any non-pointer,
  2675. // non-interface field appearing in ForceSendFields will be sent to the
  2676. // server regardless of whether the field is empty or not. This may be
  2677. // used to include empty fields in Patch requests.
  2678. ForceSendFields []string `json:"-"`
  2679. // NullFields is a list of field names (e.g. "FixedPrices") to include
  2680. // in API requests with the JSON null value. By default, fields with
  2681. // empty values are omitted from API requests. However, any field with
  2682. // an empty value appearing in NullFields will be sent to the server as
  2683. // null. It is an error if a field in this list has a non-empty value.
  2684. // This may be used to include null fields in Patch requests.
  2685. NullFields []string `json:"-"`
  2686. }
  2687. func (s *GuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
  2688. type NoMethod GuaranteedFixedPriceTerms
  2689. raw := NoMethod(*s)
  2690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2691. }
  2692. // HtmlContent: HTML content for a creative.
  2693. type HtmlContent struct {
  2694. // Height: The height of the HTML snippet in pixels.
  2695. Height int64 `json:"height,omitempty"`
  2696. // Snippet: The HTML snippet that displays the ad when inserted in the
  2697. // web page.
  2698. Snippet string `json:"snippet,omitempty"`
  2699. // Width: The width of the HTML snippet in pixels.
  2700. Width int64 `json:"width,omitempty"`
  2701. // ForceSendFields is a list of field names (e.g. "Height") to
  2702. // unconditionally include in API requests. By default, fields with
  2703. // empty values are omitted from API requests. However, any non-pointer,
  2704. // non-interface field appearing in ForceSendFields will be sent to the
  2705. // server regardless of whether the field is empty or not. This may be
  2706. // used to include empty fields in Patch requests.
  2707. ForceSendFields []string `json:"-"`
  2708. // NullFields is a list of field names (e.g. "Height") to include in API
  2709. // requests with the JSON null value. By default, fields with empty
  2710. // values are omitted from API requests. However, any field with an
  2711. // empty value appearing in NullFields will be sent to the server as
  2712. // null. It is an error if a field in this list has a non-empty value.
  2713. // This may be used to include null fields in Patch requests.
  2714. NullFields []string `json:"-"`
  2715. }
  2716. func (s *HtmlContent) MarshalJSON() ([]byte, error) {
  2717. type NoMethod HtmlContent
  2718. raw := NoMethod(*s)
  2719. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2720. }
  2721. // Image: An image resource. You may provide a larger image than was
  2722. // requested,
  2723. // so long as the aspect ratio is preserved.
  2724. type Image struct {
  2725. // Height: Image height in pixels.
  2726. Height int64 `json:"height,omitempty"`
  2727. // Url: The URL of the image.
  2728. Url string `json:"url,omitempty"`
  2729. // Width: Image width in pixels.
  2730. Width int64 `json:"width,omitempty"`
  2731. // ForceSendFields is a list of field names (e.g. "Height") to
  2732. // unconditionally include in API requests. By default, fields with
  2733. // empty values are omitted from API requests. However, any non-pointer,
  2734. // non-interface field appearing in ForceSendFields will be sent to the
  2735. // server regardless of whether the field is empty or not. This may be
  2736. // used to include empty fields in Patch requests.
  2737. ForceSendFields []string `json:"-"`
  2738. // NullFields is a list of field names (e.g. "Height") to include in API
  2739. // requests with the JSON null value. By default, fields with empty
  2740. // values are omitted from API requests. However, any field with an
  2741. // empty value appearing in NullFields will be sent to the server as
  2742. // null. It is an error if a field in this list has a non-empty value.
  2743. // This may be used to include null fields in Patch requests.
  2744. NullFields []string `json:"-"`
  2745. }
  2746. func (s *Image) MarshalJSON() ([]byte, error) {
  2747. type NoMethod Image
  2748. raw := NoMethod(*s)
  2749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2750. }
  2751. // ImpressionMetricsRow: The set of metrics that are measured in numbers
  2752. // of impressions, representing
  2753. // how many impressions with the specified dimension values were
  2754. // considered
  2755. // eligible at each stage of the bidding funnel.
  2756. type ImpressionMetricsRow struct {
  2757. // AvailableImpressions: The number of impressions available to the
  2758. // buyer on Ad Exchange.
  2759. // In some cases this value may be unavailable.
  2760. AvailableImpressions *MetricValue `json:"availableImpressions,omitempty"`
  2761. // BidRequests: The number of impressions for which Ad Exchange sent the
  2762. // buyer a bid
  2763. // request.
  2764. BidRequests *MetricValue `json:"bidRequests,omitempty"`
  2765. // InventoryMatches: The number of impressions that match the buyer's
  2766. // inventory pretargeting.
  2767. InventoryMatches *MetricValue `json:"inventoryMatches,omitempty"`
  2768. // ResponsesWithBids: The number of impressions for which Ad Exchange
  2769. // received a response from
  2770. // the buyer that contained at least one applicable bid.
  2771. ResponsesWithBids *MetricValue `json:"responsesWithBids,omitempty"`
  2772. // RowDimensions: The values of all dimensions associated with metric
  2773. // values in this row.
  2774. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  2775. // SuccessfulResponses: The number of impressions for which the buyer
  2776. // successfully sent a response
  2777. // to Ad Exchange.
  2778. SuccessfulResponses *MetricValue `json:"successfulResponses,omitempty"`
  2779. // ForceSendFields is a list of field names (e.g.
  2780. // "AvailableImpressions") to unconditionally include in API requests.
  2781. // By default, fields with empty values are omitted from API requests.
  2782. // However, any non-pointer, non-interface field appearing in
  2783. // ForceSendFields will be sent to the server regardless of whether the
  2784. // field is empty or not. This may be used to include empty fields in
  2785. // Patch requests.
  2786. ForceSendFields []string `json:"-"`
  2787. // NullFields is a list of field names (e.g. "AvailableImpressions") to
  2788. // include in API requests with the JSON null value. By default, fields
  2789. // with empty values are omitted from API requests. However, any field
  2790. // with an empty value appearing in NullFields will be sent to the
  2791. // server as null. It is an error if a field in this list has a
  2792. // non-empty value. This may be used to include null fields in Patch
  2793. // requests.
  2794. NullFields []string `json:"-"`
  2795. }
  2796. func (s *ImpressionMetricsRow) MarshalJSON() ([]byte, error) {
  2797. type NoMethod ImpressionMetricsRow
  2798. raw := NoMethod(*s)
  2799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2800. }
  2801. // InventorySizeTargeting: Represents the size of an ad unit that can be
  2802. // targeted on an ad
  2803. // request. It only applies to Private Auction, AdX Preferred Deals
  2804. // and
  2805. // Auction Packages. This targeting does not apply to Programmatic
  2806. // Guaranteed
  2807. // and Preferred Deals in Ad Manager.
  2808. type InventorySizeTargeting struct {
  2809. // ExcludedInventorySizes: A list of inventory sizes to be excluded.
  2810. ExcludedInventorySizes []*AdSize `json:"excludedInventorySizes,omitempty"`
  2811. // TargetedInventorySizes: A list of inventory sizes to be included.
  2812. TargetedInventorySizes []*AdSize `json:"targetedInventorySizes,omitempty"`
  2813. // ForceSendFields is a list of field names (e.g.
  2814. // "ExcludedInventorySizes") to unconditionally include in API requests.
  2815. // By default, fields with empty values are omitted from API requests.
  2816. // However, any non-pointer, non-interface field appearing in
  2817. // ForceSendFields will be sent to the server regardless of whether the
  2818. // field is empty or not. This may be used to include empty fields in
  2819. // Patch requests.
  2820. ForceSendFields []string `json:"-"`
  2821. // NullFields is a list of field names (e.g. "ExcludedInventorySizes")
  2822. // to include in API requests with the JSON null value. By default,
  2823. // fields with empty values are omitted from API requests. However, any
  2824. // field with an empty value appearing in NullFields will be sent to the
  2825. // server as null. It is an error if a field in this list has a
  2826. // non-empty value. This may be used to include null fields in Patch
  2827. // requests.
  2828. NullFields []string `json:"-"`
  2829. }
  2830. func (s *InventorySizeTargeting) MarshalJSON() ([]byte, error) {
  2831. type NoMethod InventorySizeTargeting
  2832. raw := NoMethod(*s)
  2833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2834. }
  2835. // ListBidMetricsResponse: Response message for listing the metrics that
  2836. // are measured in number of bids.
  2837. type ListBidMetricsResponse struct {
  2838. // BidMetricsRows: List of rows, each containing a set of bid metrics.
  2839. BidMetricsRows []*BidMetricsRow `json:"bidMetricsRows,omitempty"`
  2840. // NextPageToken: A token to retrieve the next page of results.
  2841. // Pass this value in the
  2842. // ListBidMetricsRequest.pageToken
  2843. // field in the subsequent call to the bidMetrics.list
  2844. // method to retrieve the next page of results.
  2845. NextPageToken string `json:"nextPageToken,omitempty"`
  2846. // ServerResponse contains the HTTP response code and headers from the
  2847. // server.
  2848. googleapi.ServerResponse `json:"-"`
  2849. // ForceSendFields is a list of field names (e.g. "BidMetricsRows") to
  2850. // unconditionally include in API requests. By default, fields with
  2851. // empty values are omitted from API requests. However, any non-pointer,
  2852. // non-interface field appearing in ForceSendFields will be sent to the
  2853. // server regardless of whether the field is empty or not. This may be
  2854. // used to include empty fields in Patch requests.
  2855. ForceSendFields []string `json:"-"`
  2856. // NullFields is a list of field names (e.g. "BidMetricsRows") to
  2857. // include in API requests with the JSON null value. By default, fields
  2858. // with empty values are omitted from API requests. However, any field
  2859. // with an empty value appearing in NullFields will be sent to the
  2860. // server as null. It is an error if a field in this list has a
  2861. // non-empty value. This may be used to include null fields in Patch
  2862. // requests.
  2863. NullFields []string `json:"-"`
  2864. }
  2865. func (s *ListBidMetricsResponse) MarshalJSON() ([]byte, error) {
  2866. type NoMethod ListBidMetricsResponse
  2867. raw := NoMethod(*s)
  2868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2869. }
  2870. // ListBidResponseErrorsResponse: Response message for listing all
  2871. // reasons that bid responses resulted in an
  2872. // error.
  2873. type ListBidResponseErrorsResponse struct {
  2874. // CalloutStatusRows: List of rows, with counts of bid responses
  2875. // aggregated by callout status.
  2876. CalloutStatusRows []*CalloutStatusRow `json:"calloutStatusRows,omitempty"`
  2877. // NextPageToken: A token to retrieve the next page of results.
  2878. // Pass this value in the
  2879. // ListBidResponseErrorsRequest.pageToken
  2880. // field in the subsequent call to the bidResponseErrors.list
  2881. // method to retrieve the next page of results.
  2882. NextPageToken string `json:"nextPageToken,omitempty"`
  2883. // ServerResponse contains the HTTP response code and headers from the
  2884. // server.
  2885. googleapi.ServerResponse `json:"-"`
  2886. // ForceSendFields is a list of field names (e.g. "CalloutStatusRows")
  2887. // to unconditionally include in API requests. By default, fields with
  2888. // empty values are omitted from API requests. However, any non-pointer,
  2889. // non-interface field appearing in ForceSendFields will be sent to the
  2890. // server regardless of whether the field is empty or not. This may be
  2891. // used to include empty fields in Patch requests.
  2892. ForceSendFields []string `json:"-"`
  2893. // NullFields is a list of field names (e.g. "CalloutStatusRows") to
  2894. // include in API requests with the JSON null value. By default, fields
  2895. // with empty values are omitted from API requests. However, any field
  2896. // with an empty value appearing in NullFields will be sent to the
  2897. // server as null. It is an error if a field in this list has a
  2898. // non-empty value. This may be used to include null fields in Patch
  2899. // requests.
  2900. NullFields []string `json:"-"`
  2901. }
  2902. func (s *ListBidResponseErrorsResponse) MarshalJSON() ([]byte, error) {
  2903. type NoMethod ListBidResponseErrorsResponse
  2904. raw := NoMethod(*s)
  2905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2906. }
  2907. // ListBidResponsesWithoutBidsResponse: Response message for listing all
  2908. // reasons that bid responses were considered
  2909. // to have no applicable bids.
  2910. type ListBidResponsesWithoutBidsResponse struct {
  2911. // BidResponseWithoutBidsStatusRows: List of rows, with counts of bid
  2912. // responses without bids aggregated by
  2913. // status.
  2914. BidResponseWithoutBidsStatusRows []*BidResponseWithoutBidsStatusRow `json:"bidResponseWithoutBidsStatusRows,omitempty"`
  2915. // NextPageToken: A token to retrieve the next page of results.
  2916. // Pass this value in
  2917. // the
  2918. // ListBidResponsesWithoutBidsRequest.pageToken
  2919. // field in the subsequent call to the
  2920. // bidResponsesWithoutBids.list
  2921. // method to retrieve the next page of results.
  2922. NextPageToken string `json:"nextPageToken,omitempty"`
  2923. // ServerResponse contains the HTTP response code and headers from the
  2924. // server.
  2925. googleapi.ServerResponse `json:"-"`
  2926. // ForceSendFields is a list of field names (e.g.
  2927. // "BidResponseWithoutBidsStatusRows") to unconditionally include in API
  2928. // requests. By default, fields with empty values are omitted from API
  2929. // requests. However, any non-pointer, non-interface field appearing in
  2930. // ForceSendFields will be sent to the server regardless of whether the
  2931. // field is empty or not. This may be used to include empty fields in
  2932. // Patch requests.
  2933. ForceSendFields []string `json:"-"`
  2934. // NullFields is a list of field names (e.g.
  2935. // "BidResponseWithoutBidsStatusRows") to include in API requests with
  2936. // the JSON null value. By default, fields with empty values are omitted
  2937. // from API requests. However, any field with an empty value appearing
  2938. // in NullFields will be sent to the server as null. It is an error if a
  2939. // field in this list has a non-empty value. This may be used to include
  2940. // null fields in Patch requests.
  2941. NullFields []string `json:"-"`
  2942. }
  2943. func (s *ListBidResponsesWithoutBidsResponse) MarshalJSON() ([]byte, error) {
  2944. type NoMethod ListBidResponsesWithoutBidsResponse
  2945. raw := NoMethod(*s)
  2946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2947. }
  2948. type ListClientUserInvitationsResponse struct {
  2949. // Invitations: The returned list of client users.
  2950. Invitations []*ClientUserInvitation `json:"invitations,omitempty"`
  2951. // NextPageToken: A token to retrieve the next page of results.
  2952. // Pass this value in
  2953. // the
  2954. // ListClientUserInvitationsRequest.pageToken
  2955. // field in the subsequent call to the
  2956. // clients.invitations.list
  2957. // method to retrieve the next
  2958. // page of results.
  2959. NextPageToken string `json:"nextPageToken,omitempty"`
  2960. // ServerResponse contains the HTTP response code and headers from the
  2961. // server.
  2962. googleapi.ServerResponse `json:"-"`
  2963. // ForceSendFields is a list of field names (e.g. "Invitations") to
  2964. // unconditionally include in API requests. By default, fields with
  2965. // empty values are omitted from API requests. However, any non-pointer,
  2966. // non-interface field appearing in ForceSendFields will be sent to the
  2967. // server regardless of whether the field is empty or not. This may be
  2968. // used to include empty fields in Patch requests.
  2969. ForceSendFields []string `json:"-"`
  2970. // NullFields is a list of field names (e.g. "Invitations") to include
  2971. // in API requests with the JSON null value. By default, fields with
  2972. // empty values are omitted from API requests. However, any field with
  2973. // an empty value appearing in NullFields will be sent to the server as
  2974. // null. It is an error if a field in this list has a non-empty value.
  2975. // This may be used to include null fields in Patch requests.
  2976. NullFields []string `json:"-"`
  2977. }
  2978. func (s *ListClientUserInvitationsResponse) MarshalJSON() ([]byte, error) {
  2979. type NoMethod ListClientUserInvitationsResponse
  2980. raw := NoMethod(*s)
  2981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2982. }
  2983. type ListClientUsersResponse struct {
  2984. // NextPageToken: A token to retrieve the next page of results.
  2985. // Pass this value in the
  2986. // ListClientUsersRequest.pageToken
  2987. // field in the subsequent call to the
  2988. // clients.invitations.list
  2989. // method to retrieve the next
  2990. // page of results.
  2991. NextPageToken string `json:"nextPageToken,omitempty"`
  2992. // Users: The returned list of client users.
  2993. Users []*ClientUser `json:"users,omitempty"`
  2994. // ServerResponse contains the HTTP response code and headers from the
  2995. // server.
  2996. googleapi.ServerResponse `json:"-"`
  2997. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2998. // unconditionally include in API requests. By default, fields with
  2999. // empty values are omitted from API requests. However, any non-pointer,
  3000. // non-interface field appearing in ForceSendFields will be sent to the
  3001. // server regardless of whether the field is empty or not. This may be
  3002. // used to include empty fields in Patch requests.
  3003. ForceSendFields []string `json:"-"`
  3004. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3005. // in API requests with the JSON null value. By default, fields with
  3006. // empty values are omitted from API requests. However, any field with
  3007. // an empty value appearing in NullFields will be sent to the server as
  3008. // null. It is an error if a field in this list has a non-empty value.
  3009. // This may be used to include null fields in Patch requests.
  3010. NullFields []string `json:"-"`
  3011. }
  3012. func (s *ListClientUsersResponse) MarshalJSON() ([]byte, error) {
  3013. type NoMethod ListClientUsersResponse
  3014. raw := NoMethod(*s)
  3015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3016. }
  3017. type ListClientsResponse struct {
  3018. // Clients: The returned list of clients.
  3019. Clients []*Client `json:"clients,omitempty"`
  3020. // NextPageToken: A token to retrieve the next page of results.
  3021. // Pass this value in the
  3022. // ListClientsRequest.pageToken
  3023. // field in the subsequent call to the
  3024. // accounts.clients.list
  3025. // method to retrieve the next page of results.
  3026. NextPageToken string `json:"nextPageToken,omitempty"`
  3027. // ServerResponse contains the HTTP response code and headers from the
  3028. // server.
  3029. googleapi.ServerResponse `json:"-"`
  3030. // ForceSendFields is a list of field names (e.g. "Clients") to
  3031. // unconditionally include in API requests. By default, fields with
  3032. // empty values are omitted from API requests. However, any non-pointer,
  3033. // non-interface field appearing in ForceSendFields will be sent to the
  3034. // server regardless of whether the field is empty or not. This may be
  3035. // used to include empty fields in Patch requests.
  3036. ForceSendFields []string `json:"-"`
  3037. // NullFields is a list of field names (e.g. "Clients") to include in
  3038. // API requests with the JSON null value. By default, fields with empty
  3039. // values are omitted from API requests. However, any field with an
  3040. // empty value appearing in NullFields will be sent to the server as
  3041. // null. It is an error if a field in this list has a non-empty value.
  3042. // This may be used to include null fields in Patch requests.
  3043. NullFields []string `json:"-"`
  3044. }
  3045. func (s *ListClientsResponse) MarshalJSON() ([]byte, error) {
  3046. type NoMethod ListClientsResponse
  3047. raw := NoMethod(*s)
  3048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3049. }
  3050. // ListCreativeStatusBreakdownByCreativeResponse: Response message for
  3051. // listing all creatives associated with a given filtered
  3052. // bid reason.
  3053. type ListCreativeStatusBreakdownByCreativeResponse struct {
  3054. // FilteredBidCreativeRows: List of rows, with counts of bids with a
  3055. // given creative status aggregated
  3056. // by creative.
  3057. FilteredBidCreativeRows []*FilteredBidCreativeRow `json:"filteredBidCreativeRows,omitempty"`
  3058. // NextPageToken: A token to retrieve the next page of results.
  3059. // Pass this value in
  3060. // the
  3061. // ListCreativeStatusBreakdownByCreativeRequest.pageToken
  3062. // field in the subsequent call to the
  3063. // filteredBids.creatives.list
  3064. // method to retrieve the next page of results.
  3065. NextPageToken string `json:"nextPageToken,omitempty"`
  3066. // ServerResponse contains the HTTP response code and headers from the
  3067. // server.
  3068. googleapi.ServerResponse `json:"-"`
  3069. // ForceSendFields is a list of field names (e.g.
  3070. // "FilteredBidCreativeRows") to unconditionally include in API
  3071. // requests. By default, fields with empty values are omitted from API
  3072. // requests. However, any non-pointer, non-interface field appearing in
  3073. // ForceSendFields will be sent to the server regardless of whether the
  3074. // field is empty or not. This may be used to include empty fields in
  3075. // Patch requests.
  3076. ForceSendFields []string `json:"-"`
  3077. // NullFields is a list of field names (e.g. "FilteredBidCreativeRows")
  3078. // to include in API requests with the JSON null value. By default,
  3079. // fields with empty values are omitted from API requests. However, any
  3080. // field with an empty value appearing in NullFields will be sent to the
  3081. // server as null. It is an error if a field in this list has a
  3082. // non-empty value. This may be used to include null fields in Patch
  3083. // requests.
  3084. NullFields []string `json:"-"`
  3085. }
  3086. func (s *ListCreativeStatusBreakdownByCreativeResponse) MarshalJSON() ([]byte, error) {
  3087. type NoMethod ListCreativeStatusBreakdownByCreativeResponse
  3088. raw := NoMethod(*s)
  3089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3090. }
  3091. // ListCreativeStatusBreakdownByDetailResponse: Response message for
  3092. // listing all details associated with a given filtered bid
  3093. // reason.
  3094. type ListCreativeStatusBreakdownByDetailResponse struct {
  3095. // DetailType: The type of detail that the detail IDs represent.
  3096. //
  3097. // Possible values:
  3098. // "DETAIL_TYPE_UNSPECIFIED" - A placeholder for an undefined
  3099. // status.
  3100. // This value will never be returned in responses.
  3101. // "CREATIVE_ATTRIBUTE" - Indicates that the detail ID refers to a
  3102. // creative attribute;
  3103. // see
  3104. // [publisher-excludable-creative-attributes](https://developers.goog
  3105. // le.com/authorized-buyers/rtb/downloads/publisher-excludable-creative-a
  3106. // ttributes).
  3107. // "VENDOR" - Indicates that the detail ID refers to a vendor;
  3108. // see
  3109. // [vendors](https://developers.google.com/authorized-buyers/rtb/down
  3110. // loads/vendors).
  3111. // "SENSITIVE_CATEGORY" - Indicates that the detail ID refers to a
  3112. // sensitive category;
  3113. // see
  3114. // [ad-sensitive-categories](https://developers.google.com/authorized
  3115. // -buyers/rtb/downloads/ad-sensitive-categories).
  3116. // "PRODUCT_CATEGORY" - Indicates that the detail ID refers to a
  3117. // product category;
  3118. // see
  3119. // [ad-product-categories](https://developers.google.com/authorized-b
  3120. // uyers/rtb/downloads/ad-product-categories).
  3121. // "DISAPPROVAL_REASON" - Indicates that the detail ID refers to a
  3122. // disapproval reason; see
  3123. // DisapprovalReason enum in
  3124. // [snippet-status-report-proto](https://developers.google.com/authorized
  3125. // -buyers/rtb/downloads/snippet-status-report-proto).
  3126. DetailType string `json:"detailType,omitempty"`
  3127. // FilteredBidDetailRows: List of rows, with counts of bids with a given
  3128. // creative status aggregated
  3129. // by detail.
  3130. FilteredBidDetailRows []*FilteredBidDetailRow `json:"filteredBidDetailRows,omitempty"`
  3131. // NextPageToken: A token to retrieve the next page of results.
  3132. // Pass this value in
  3133. // the
  3134. // ListCreativeStatusBreakdownByDetailRequest.pageToken
  3135. // field in the subsequent call to the filteredBids.details.list
  3136. // method to retrieve the next page of results.
  3137. NextPageToken string `json:"nextPageToken,omitempty"`
  3138. // ServerResponse contains the HTTP response code and headers from the
  3139. // server.
  3140. googleapi.ServerResponse `json:"-"`
  3141. // ForceSendFields is a list of field names (e.g. "DetailType") to
  3142. // unconditionally include in API requests. By default, fields with
  3143. // empty values are omitted from API requests. However, any non-pointer,
  3144. // non-interface field appearing in ForceSendFields will be sent to the
  3145. // server regardless of whether the field is empty or not. This may be
  3146. // used to include empty fields in Patch requests.
  3147. ForceSendFields []string `json:"-"`
  3148. // NullFields is a list of field names (e.g. "DetailType") to include in
  3149. // API requests with the JSON null value. By default, fields with empty
  3150. // values are omitted from API requests. However, any field with an
  3151. // empty value appearing in NullFields will be sent to the server as
  3152. // null. It is an error if a field in this list has a non-empty value.
  3153. // This may be used to include null fields in Patch requests.
  3154. NullFields []string `json:"-"`
  3155. }
  3156. func (s *ListCreativeStatusBreakdownByDetailResponse) MarshalJSON() ([]byte, error) {
  3157. type NoMethod ListCreativeStatusBreakdownByDetailResponse
  3158. raw := NoMethod(*s)
  3159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3160. }
  3161. // ListCreativesResponse: A response for listing creatives.
  3162. type ListCreativesResponse struct {
  3163. // Creatives: The list of creatives.
  3164. Creatives []*Creative `json:"creatives,omitempty"`
  3165. // NextPageToken: A token to retrieve the next page of results.
  3166. // Pass this value in the
  3167. // ListCreativesRequest.page_token
  3168. // field in the subsequent call to `ListCreatives` method to retrieve
  3169. // the next
  3170. // page of results.
  3171. NextPageToken string `json:"nextPageToken,omitempty"`
  3172. // ServerResponse contains the HTTP response code and headers from the
  3173. // server.
  3174. googleapi.ServerResponse `json:"-"`
  3175. // ForceSendFields is a list of field names (e.g. "Creatives") to
  3176. // unconditionally include in API requests. By default, fields with
  3177. // empty values are omitted from API requests. However, any non-pointer,
  3178. // non-interface field appearing in ForceSendFields will be sent to the
  3179. // server regardless of whether the field is empty or not. This may be
  3180. // used to include empty fields in Patch requests.
  3181. ForceSendFields []string `json:"-"`
  3182. // NullFields is a list of field names (e.g. "Creatives") to include in
  3183. // API requests with the JSON null value. By default, fields with empty
  3184. // values are omitted from API requests. However, any field with an
  3185. // empty value appearing in NullFields will be sent to the server as
  3186. // null. It is an error if a field in this list has a non-empty value.
  3187. // This may be used to include null fields in Patch requests.
  3188. NullFields []string `json:"-"`
  3189. }
  3190. func (s *ListCreativesResponse) MarshalJSON() ([]byte, error) {
  3191. type NoMethod ListCreativesResponse
  3192. raw := NoMethod(*s)
  3193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3194. }
  3195. // ListDealAssociationsResponse: A response for listing creative and
  3196. // deal associations
  3197. type ListDealAssociationsResponse struct {
  3198. // Associations: The list of associations.
  3199. Associations []*CreativeDealAssociation `json:"associations,omitempty"`
  3200. // NextPageToken: A token to retrieve the next page of results.
  3201. // Pass this value in the
  3202. // ListDealAssociationsRequest.page_token
  3203. // field in the subsequent call to 'ListDealAssociation' method to
  3204. // retrieve
  3205. // the next page of results.
  3206. NextPageToken string `json:"nextPageToken,omitempty"`
  3207. // ServerResponse contains the HTTP response code and headers from the
  3208. // server.
  3209. googleapi.ServerResponse `json:"-"`
  3210. // ForceSendFields is a list of field names (e.g. "Associations") to
  3211. // unconditionally include in API requests. By default, fields with
  3212. // empty values are omitted from API requests. However, any non-pointer,
  3213. // non-interface field appearing in ForceSendFields will be sent to the
  3214. // server regardless of whether the field is empty or not. This may be
  3215. // used to include empty fields in Patch requests.
  3216. ForceSendFields []string `json:"-"`
  3217. // NullFields is a list of field names (e.g. "Associations") to include
  3218. // in API requests with the JSON null value. By default, fields with
  3219. // empty values are omitted from API requests. However, any field with
  3220. // an empty value appearing in NullFields will be sent to the server as
  3221. // null. It is an error if a field in this list has a non-empty value.
  3222. // This may be used to include null fields in Patch requests.
  3223. NullFields []string `json:"-"`
  3224. }
  3225. func (s *ListDealAssociationsResponse) MarshalJSON() ([]byte, error) {
  3226. type NoMethod ListDealAssociationsResponse
  3227. raw := NoMethod(*s)
  3228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3229. }
  3230. // ListFilterSetsResponse: Response message for listing filter sets.
  3231. type ListFilterSetsResponse struct {
  3232. // FilterSets: The filter sets belonging to the buyer.
  3233. FilterSets []*FilterSet `json:"filterSets,omitempty"`
  3234. // NextPageToken: A token to retrieve the next page of results.
  3235. // Pass this value in the
  3236. // ListFilterSetsRequest.pageToken
  3237. // field in the subsequent call to the
  3238. // accounts.filterSets.list
  3239. // method to retrieve the next page of results.
  3240. NextPageToken string `json:"nextPageToken,omitempty"`
  3241. // ServerResponse contains the HTTP response code and headers from the
  3242. // server.
  3243. googleapi.ServerResponse `json:"-"`
  3244. // ForceSendFields is a list of field names (e.g. "FilterSets") to
  3245. // unconditionally include in API requests. By default, fields with
  3246. // empty values are omitted from API requests. However, any non-pointer,
  3247. // non-interface field appearing in ForceSendFields will be sent to the
  3248. // server regardless of whether the field is empty or not. This may be
  3249. // used to include empty fields in Patch requests.
  3250. ForceSendFields []string `json:"-"`
  3251. // NullFields is a list of field names (e.g. "FilterSets") to include in
  3252. // API requests with the JSON null value. By default, fields with empty
  3253. // values are omitted from API requests. However, any field with an
  3254. // empty value appearing in NullFields will be sent to the server as
  3255. // null. It is an error if a field in this list has a non-empty value.
  3256. // This may be used to include null fields in Patch requests.
  3257. NullFields []string `json:"-"`
  3258. }
  3259. func (s *ListFilterSetsResponse) MarshalJSON() ([]byte, error) {
  3260. type NoMethod ListFilterSetsResponse
  3261. raw := NoMethod(*s)
  3262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3263. }
  3264. // ListFilteredBidRequestsResponse: Response message for listing all
  3265. // reasons that bid requests were filtered and
  3266. // not sent to the buyer.
  3267. type ListFilteredBidRequestsResponse struct {
  3268. // CalloutStatusRows: List of rows, with counts of filtered bid requests
  3269. // aggregated by callout
  3270. // status.
  3271. CalloutStatusRows []*CalloutStatusRow `json:"calloutStatusRows,omitempty"`
  3272. // NextPageToken: A token to retrieve the next page of results.
  3273. // Pass this value in the
  3274. // ListFilteredBidRequestsRequest.pageToken
  3275. // field in the subsequent call to the filteredBidRequests.list
  3276. // method to retrieve the next page of results.
  3277. NextPageToken string `json:"nextPageToken,omitempty"`
  3278. // ServerResponse contains the HTTP response code and headers from the
  3279. // server.
  3280. googleapi.ServerResponse `json:"-"`
  3281. // ForceSendFields is a list of field names (e.g. "CalloutStatusRows")
  3282. // to unconditionally include in API requests. By default, fields with
  3283. // empty values are omitted from API requests. However, any non-pointer,
  3284. // non-interface field appearing in ForceSendFields will be sent to the
  3285. // server regardless of whether the field is empty or not. This may be
  3286. // used to include empty fields in Patch requests.
  3287. ForceSendFields []string `json:"-"`
  3288. // NullFields is a list of field names (e.g. "CalloutStatusRows") to
  3289. // include in API requests with the JSON null value. By default, fields
  3290. // with empty values are omitted from API requests. However, any field
  3291. // with an empty value appearing in NullFields will be sent to the
  3292. // server as null. It is an error if a field in this list has a
  3293. // non-empty value. This may be used to include null fields in Patch
  3294. // requests.
  3295. NullFields []string `json:"-"`
  3296. }
  3297. func (s *ListFilteredBidRequestsResponse) MarshalJSON() ([]byte, error) {
  3298. type NoMethod ListFilteredBidRequestsResponse
  3299. raw := NoMethod(*s)
  3300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3301. }
  3302. // ListFilteredBidsResponse: Response message for listing all reasons
  3303. // that bids were filtered from the
  3304. // auction.
  3305. type ListFilteredBidsResponse struct {
  3306. // CreativeStatusRows: List of rows, with counts of filtered bids
  3307. // aggregated by filtering reason
  3308. // (i.e. creative status).
  3309. CreativeStatusRows []*CreativeStatusRow `json:"creativeStatusRows,omitempty"`
  3310. // NextPageToken: A token to retrieve the next page of results.
  3311. // Pass this value in the
  3312. // ListFilteredBidsRequest.pageToken
  3313. // field in the subsequent call to the filteredBids.list
  3314. // method to retrieve the next page of results.
  3315. NextPageToken string `json:"nextPageToken,omitempty"`
  3316. // ServerResponse contains the HTTP response code and headers from the
  3317. // server.
  3318. googleapi.ServerResponse `json:"-"`
  3319. // ForceSendFields is a list of field names (e.g. "CreativeStatusRows")
  3320. // to unconditionally include in API requests. By default, fields with
  3321. // empty values are omitted from API requests. However, any non-pointer,
  3322. // non-interface field appearing in ForceSendFields will be sent to the
  3323. // server regardless of whether the field is empty or not. This may be
  3324. // used to include empty fields in Patch requests.
  3325. ForceSendFields []string `json:"-"`
  3326. // NullFields is a list of field names (e.g. "CreativeStatusRows") to
  3327. // include in API requests with the JSON null value. By default, fields
  3328. // with empty values are omitted from API requests. However, any field
  3329. // with an empty value appearing in NullFields will be sent to the
  3330. // server as null. It is an error if a field in this list has a
  3331. // non-empty value. This may be used to include null fields in Patch
  3332. // requests.
  3333. NullFields []string `json:"-"`
  3334. }
  3335. func (s *ListFilteredBidsResponse) MarshalJSON() ([]byte, error) {
  3336. type NoMethod ListFilteredBidsResponse
  3337. raw := NoMethod(*s)
  3338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3339. }
  3340. // ListImpressionMetricsResponse: Response message for listing the
  3341. // metrics that are measured in number of
  3342. // impressions.
  3343. type ListImpressionMetricsResponse struct {
  3344. // ImpressionMetricsRows: List of rows, each containing a set of
  3345. // impression metrics.
  3346. ImpressionMetricsRows []*ImpressionMetricsRow `json:"impressionMetricsRows,omitempty"`
  3347. // NextPageToken: A token to retrieve the next page of results.
  3348. // Pass this value in the
  3349. // ListImpressionMetricsRequest.pageToken
  3350. // field in the subsequent call to the impressionMetrics.list
  3351. // method to retrieve the next page of results.
  3352. NextPageToken string `json:"nextPageToken,omitempty"`
  3353. // ServerResponse contains the HTTP response code and headers from the
  3354. // server.
  3355. googleapi.ServerResponse `json:"-"`
  3356. // ForceSendFields is a list of field names (e.g.
  3357. // "ImpressionMetricsRows") to unconditionally include in API requests.
  3358. // By default, fields with empty values are omitted from API requests.
  3359. // However, any non-pointer, non-interface field appearing in
  3360. // ForceSendFields will be sent to the server regardless of whether the
  3361. // field is empty or not. This may be used to include empty fields in
  3362. // Patch requests.
  3363. ForceSendFields []string `json:"-"`
  3364. // NullFields is a list of field names (e.g. "ImpressionMetricsRows") to
  3365. // include in API requests with the JSON null value. By default, fields
  3366. // with empty values are omitted from API requests. However, any field
  3367. // with an empty value appearing in NullFields will be sent to the
  3368. // server as null. It is an error if a field in this list has a
  3369. // non-empty value. This may be used to include null fields in Patch
  3370. // requests.
  3371. NullFields []string `json:"-"`
  3372. }
  3373. func (s *ListImpressionMetricsResponse) MarshalJSON() ([]byte, error) {
  3374. type NoMethod ListImpressionMetricsResponse
  3375. raw := NoMethod(*s)
  3376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3377. }
  3378. // ListLosingBidsResponse: Response message for listing all reasons that
  3379. // bids lost in the auction.
  3380. type ListLosingBidsResponse struct {
  3381. // CreativeStatusRows: List of rows, with counts of losing bids
  3382. // aggregated by loss reason (i.e.
  3383. // creative status).
  3384. CreativeStatusRows []*CreativeStatusRow `json:"creativeStatusRows,omitempty"`
  3385. // NextPageToken: A token to retrieve the next page of results.
  3386. // Pass this value in the
  3387. // ListLosingBidsRequest.pageToken
  3388. // field in the subsequent call to the losingBids.list
  3389. // method to retrieve the next page of results.
  3390. NextPageToken string `json:"nextPageToken,omitempty"`
  3391. // ServerResponse contains the HTTP response code and headers from the
  3392. // server.
  3393. googleapi.ServerResponse `json:"-"`
  3394. // ForceSendFields is a list of field names (e.g. "CreativeStatusRows")
  3395. // to unconditionally include in API requests. By default, fields with
  3396. // empty values are omitted from API requests. However, any non-pointer,
  3397. // non-interface field appearing in ForceSendFields will be sent to the
  3398. // server regardless of whether the field is empty or not. This may be
  3399. // used to include empty fields in Patch requests.
  3400. ForceSendFields []string `json:"-"`
  3401. // NullFields is a list of field names (e.g. "CreativeStatusRows") to
  3402. // include in API requests with the JSON null value. By default, fields
  3403. // with empty values are omitted from API requests. However, any field
  3404. // with an empty value appearing in NullFields will be sent to the
  3405. // server as null. It is an error if a field in this list has a
  3406. // non-empty value. This may be used to include null fields in Patch
  3407. // requests.
  3408. NullFields []string `json:"-"`
  3409. }
  3410. func (s *ListLosingBidsResponse) MarshalJSON() ([]byte, error) {
  3411. type NoMethod ListLosingBidsResponse
  3412. raw := NoMethod(*s)
  3413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3414. }
  3415. // ListNonBillableWinningBidsResponse: Response message for listing all
  3416. // reasons for which a buyer was not billed for
  3417. // a winning bid.
  3418. type ListNonBillableWinningBidsResponse struct {
  3419. // NextPageToken: A token to retrieve the next page of results.
  3420. // Pass this value in
  3421. // the
  3422. // ListNonBillableWinningBidsRequest.pageToken
  3423. // field in the subsequent call to the
  3424. // nonBillableWinningBids.list
  3425. // method to retrieve the next page of results.
  3426. NextPageToken string `json:"nextPageToken,omitempty"`
  3427. // NonBillableWinningBidStatusRows: List of rows, with counts of bids
  3428. // not billed aggregated by reason.
  3429. NonBillableWinningBidStatusRows []*NonBillableWinningBidStatusRow `json:"nonBillableWinningBidStatusRows,omitempty"`
  3430. // ServerResponse contains the HTTP response code and headers from the
  3431. // server.
  3432. googleapi.ServerResponse `json:"-"`
  3433. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  3434. // unconditionally include in API requests. By default, fields with
  3435. // empty values are omitted from API requests. However, any non-pointer,
  3436. // non-interface field appearing in ForceSendFields will be sent to the
  3437. // server regardless of whether the field is empty or not. This may be
  3438. // used to include empty fields in Patch requests.
  3439. ForceSendFields []string `json:"-"`
  3440. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3441. // in API requests with the JSON null value. By default, fields with
  3442. // empty values are omitted from API requests. However, any field with
  3443. // an empty value appearing in NullFields will be sent to the server as
  3444. // null. It is an error if a field in this list has a non-empty value.
  3445. // This may be used to include null fields in Patch requests.
  3446. NullFields []string `json:"-"`
  3447. }
  3448. func (s *ListNonBillableWinningBidsResponse) MarshalJSON() ([]byte, error) {
  3449. type NoMethod ListNonBillableWinningBidsResponse
  3450. raw := NoMethod(*s)
  3451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3452. }
  3453. // ListProductsResponse: Response message for listing products visible
  3454. // to the buyer.
  3455. type ListProductsResponse struct {
  3456. // NextPageToken: List pagination support.
  3457. NextPageToken string `json:"nextPageToken,omitempty"`
  3458. // Products: The list of matching products at their head revision
  3459. // number.
  3460. Products []*Product `json:"products,omitempty"`
  3461. // ServerResponse contains the HTTP response code and headers from the
  3462. // server.
  3463. googleapi.ServerResponse `json:"-"`
  3464. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  3465. // unconditionally include in API requests. By default, fields with
  3466. // empty values are omitted from API requests. However, any non-pointer,
  3467. // non-interface field appearing in ForceSendFields will be sent to the
  3468. // server regardless of whether the field is empty or not. This may be
  3469. // used to include empty fields in Patch requests.
  3470. ForceSendFields []string `json:"-"`
  3471. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3472. // in API requests with the JSON null value. By default, fields with
  3473. // empty values are omitted from API requests. However, any field with
  3474. // an empty value appearing in NullFields will be sent to the server as
  3475. // null. It is an error if a field in this list has a non-empty value.
  3476. // This may be used to include null fields in Patch requests.
  3477. NullFields []string `json:"-"`
  3478. }
  3479. func (s *ListProductsResponse) MarshalJSON() ([]byte, error) {
  3480. type NoMethod ListProductsResponse
  3481. raw := NoMethod(*s)
  3482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3483. }
  3484. // ListProposalsResponse: Response message for listing proposals.
  3485. type ListProposalsResponse struct {
  3486. // NextPageToken: Continuation token for fetching the next page of
  3487. // results.
  3488. NextPageToken string `json:"nextPageToken,omitempty"`
  3489. // Proposals: The list of proposals.
  3490. Proposals []*Proposal `json:"proposals,omitempty"`
  3491. // ServerResponse contains the HTTP response code and headers from the
  3492. // server.
  3493. googleapi.ServerResponse `json:"-"`
  3494. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  3495. // unconditionally include in API requests. By default, fields with
  3496. // empty values are omitted from API requests. However, any non-pointer,
  3497. // non-interface field appearing in ForceSendFields will be sent to the
  3498. // server regardless of whether the field is empty or not. This may be
  3499. // used to include empty fields in Patch requests.
  3500. ForceSendFields []string `json:"-"`
  3501. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3502. // in API requests with the JSON null value. By default, fields with
  3503. // empty values are omitted from API requests. However, any field with
  3504. // an empty value appearing in NullFields will be sent to the server as
  3505. // null. It is an error if a field in this list has a non-empty value.
  3506. // This may be used to include null fields in Patch requests.
  3507. NullFields []string `json:"-"`
  3508. }
  3509. func (s *ListProposalsResponse) MarshalJSON() ([]byte, error) {
  3510. type NoMethod ListProposalsResponse
  3511. raw := NoMethod(*s)
  3512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3513. }
  3514. // ListPublisherProfilesResponse: Response message for profiles visible
  3515. // to the buyer.
  3516. type ListPublisherProfilesResponse struct {
  3517. // NextPageToken: List pagination support
  3518. NextPageToken string `json:"nextPageToken,omitempty"`
  3519. // PublisherProfiles: The list of matching publisher profiles.
  3520. PublisherProfiles []*PublisherProfile `json:"publisherProfiles,omitempty"`
  3521. // ServerResponse contains the HTTP response code and headers from the
  3522. // server.
  3523. googleapi.ServerResponse `json:"-"`
  3524. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  3525. // unconditionally include in API requests. By default, fields with
  3526. // empty values are omitted from API requests. However, any non-pointer,
  3527. // non-interface field appearing in ForceSendFields will be sent to the
  3528. // server regardless of whether the field is empty or not. This may be
  3529. // used to include empty fields in Patch requests.
  3530. ForceSendFields []string `json:"-"`
  3531. // NullFields is a list of field names (e.g. "NextPageToken") to include
  3532. // in API requests with the JSON null value. By default, fields with
  3533. // empty values are omitted from API requests. However, any field with
  3534. // an empty value appearing in NullFields will be sent to the server as
  3535. // null. It is an error if a field in this list has a non-empty value.
  3536. // This may be used to include null fields in Patch requests.
  3537. NullFields []string `json:"-"`
  3538. }
  3539. func (s *ListPublisherProfilesResponse) MarshalJSON() ([]byte, error) {
  3540. type NoMethod ListPublisherProfilesResponse
  3541. raw := NoMethod(*s)
  3542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3543. }
  3544. // LocationContext: @OutputOnly The Geo criteria the restriction applies
  3545. // to.
  3546. type LocationContext struct {
  3547. // GeoCriteriaIds: IDs representing the geo location for this
  3548. // context.
  3549. // Please refer to
  3550. // the
  3551. // [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionarie
  3552. // s/geo-table.csv)
  3553. // file for different geo criteria IDs.
  3554. GeoCriteriaIds []int64 `json:"geoCriteriaIds,omitempty"`
  3555. // ForceSendFields is a list of field names (e.g. "GeoCriteriaIds") to
  3556. // unconditionally include in API requests. By default, fields with
  3557. // empty values are omitted from API requests. However, any non-pointer,
  3558. // non-interface field appearing in ForceSendFields will be sent to the
  3559. // server regardless of whether the field is empty or not. This may be
  3560. // used to include empty fields in Patch requests.
  3561. ForceSendFields []string `json:"-"`
  3562. // NullFields is a list of field names (e.g. "GeoCriteriaIds") to
  3563. // include in API requests with the JSON null value. By default, fields
  3564. // with empty values are omitted from API requests. However, any field
  3565. // with an empty value appearing in NullFields will be sent to the
  3566. // server as null. It is an error if a field in this list has a
  3567. // non-empty value. This may be used to include null fields in Patch
  3568. // requests.
  3569. NullFields []string `json:"-"`
  3570. }
  3571. func (s *LocationContext) MarshalJSON() ([]byte, error) {
  3572. type NoMethod LocationContext
  3573. raw := NoMethod(*s)
  3574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3575. }
  3576. // MarketplaceTargeting: Targeting represents different criteria that
  3577. // can be used by advertisers to
  3578. // target ad inventory. For example, they can choose to target ad
  3579. // requests only
  3580. // if the user is in the US.
  3581. // Multiple types of targeting are always applied as a logical AND,
  3582. // unless noted
  3583. // otherwise.
  3584. type MarketplaceTargeting struct {
  3585. // GeoTargeting: Geo criteria IDs to be included/excluded.
  3586. GeoTargeting *CriteriaTargeting `json:"geoTargeting,omitempty"`
  3587. // InventorySizeTargeting: Inventory sizes to be included/excluded.
  3588. InventorySizeTargeting *InventorySizeTargeting `json:"inventorySizeTargeting,omitempty"`
  3589. // PlacementTargeting: Placement targeting information, e.g., URL,
  3590. // mobile applications.
  3591. PlacementTargeting *PlacementTargeting `json:"placementTargeting,omitempty"`
  3592. // TechnologyTargeting: Technology targeting information, e.g.,
  3593. // operating system, device category.
  3594. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  3595. // VideoTargeting: Video targeting information.
  3596. VideoTargeting *VideoTargeting `json:"videoTargeting,omitempty"`
  3597. // ForceSendFields is a list of field names (e.g. "GeoTargeting") to
  3598. // unconditionally include in API requests. By default, fields with
  3599. // empty values are omitted from API requests. However, any non-pointer,
  3600. // non-interface field appearing in ForceSendFields will be sent to the
  3601. // server regardless of whether the field is empty or not. This may be
  3602. // used to include empty fields in Patch requests.
  3603. ForceSendFields []string `json:"-"`
  3604. // NullFields is a list of field names (e.g. "GeoTargeting") to include
  3605. // in API requests with the JSON null value. By default, fields with
  3606. // empty values are omitted from API requests. However, any field with
  3607. // an empty value appearing in NullFields will be sent to the server as
  3608. // null. It is an error if a field in this list has a non-empty value.
  3609. // This may be used to include null fields in Patch requests.
  3610. NullFields []string `json:"-"`
  3611. }
  3612. func (s *MarketplaceTargeting) MarshalJSON() ([]byte, error) {
  3613. type NoMethod MarketplaceTargeting
  3614. raw := NoMethod(*s)
  3615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3616. }
  3617. // MetricValue: A metric value, with an expected value and a variance;
  3618. // represents a count
  3619. // that may be either exact or estimated (i.e. when sampled).
  3620. type MetricValue struct {
  3621. // Value: The expected value of the metric.
  3622. Value int64 `json:"value,omitempty,string"`
  3623. // Variance: The variance (i.e. square of the standard deviation) of the
  3624. // metric value.
  3625. // If value is exact, variance is 0.
  3626. // Can be used to calculate margin of error as a percentage of value,
  3627. // using
  3628. // the following formula, where Z is the standard constant that depends
  3629. // on the
  3630. // desired size of the confidence interval (e.g. for 90% confidence
  3631. // interval,
  3632. // use Z = 1.645):
  3633. //
  3634. // marginOfError = 100 * Z * sqrt(variance) / value
  3635. Variance int64 `json:"variance,omitempty,string"`
  3636. // ForceSendFields is a list of field names (e.g. "Value") to
  3637. // unconditionally include in API requests. By default, fields with
  3638. // empty values are omitted from API requests. However, any non-pointer,
  3639. // non-interface field appearing in ForceSendFields will be sent to the
  3640. // server regardless of whether the field is empty or not. This may be
  3641. // used to include empty fields in Patch requests.
  3642. ForceSendFields []string `json:"-"`
  3643. // NullFields is a list of field names (e.g. "Value") to include in API
  3644. // requests with the JSON null value. By default, fields with empty
  3645. // values are omitted from API requests. However, any field with an
  3646. // empty value appearing in NullFields will be sent to the server as
  3647. // null. It is an error if a field in this list has a non-empty value.
  3648. // This may be used to include null fields in Patch requests.
  3649. NullFields []string `json:"-"`
  3650. }
  3651. func (s *MetricValue) MarshalJSON() ([]byte, error) {
  3652. type NoMethod MetricValue
  3653. raw := NoMethod(*s)
  3654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3655. }
  3656. // MobileApplicationTargeting: Mobile application targeting settings.
  3657. type MobileApplicationTargeting struct {
  3658. // FirstPartyTargeting: Publisher owned apps to be targeted or excluded
  3659. // by the publisher to
  3660. // display the ads in.
  3661. FirstPartyTargeting *FirstPartyMobileApplicationTargeting `json:"firstPartyTargeting,omitempty"`
  3662. // ForceSendFields is a list of field names (e.g. "FirstPartyTargeting")
  3663. // to unconditionally include in API requests. By default, fields with
  3664. // empty values are omitted from API requests. However, any non-pointer,
  3665. // non-interface field appearing in ForceSendFields will be sent to the
  3666. // server regardless of whether the field is empty or not. This may be
  3667. // used to include empty fields in Patch requests.
  3668. ForceSendFields []string `json:"-"`
  3669. // NullFields is a list of field names (e.g. "FirstPartyTargeting") to
  3670. // include in API requests with the JSON null value. By default, fields
  3671. // with empty values are omitted from API requests. However, any field
  3672. // with an empty value appearing in NullFields will be sent to the
  3673. // server as null. It is an error if a field in this list has a
  3674. // non-empty value. This may be used to include null fields in Patch
  3675. // requests.
  3676. NullFields []string `json:"-"`
  3677. }
  3678. func (s *MobileApplicationTargeting) MarshalJSON() ([]byte, error) {
  3679. type NoMethod MobileApplicationTargeting
  3680. raw := NoMethod(*s)
  3681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3682. }
  3683. // Money: Represents an amount of money with its currency type.
  3684. type Money struct {
  3685. // CurrencyCode: The 3-letter currency code defined in ISO 4217.
  3686. CurrencyCode string `json:"currencyCode,omitempty"`
  3687. // Nanos: Number of nano (10^-9) units of the amount.
  3688. // The value must be between -999,999,999 and +999,999,999 inclusive.
  3689. // If `units` is positive, `nanos` must be positive or zero.
  3690. // If `units` is zero, `nanos` can be positive, zero, or negative.
  3691. // If `units` is negative, `nanos` must be negative or zero.
  3692. // For example $-1.75 is represented as `units`=-1 and
  3693. // `nanos`=-750,000,000.
  3694. Nanos int64 `json:"nanos,omitempty"`
  3695. // Units: The whole units of the amount.
  3696. // For example if `currencyCode` is "USD", then 1 unit is one US
  3697. // dollar.
  3698. Units int64 `json:"units,omitempty,string"`
  3699. // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
  3700. // unconditionally include in API requests. By default, fields with
  3701. // empty values are omitted from API requests. However, any non-pointer,
  3702. // non-interface field appearing in ForceSendFields will be sent to the
  3703. // server regardless of whether the field is empty or not. This may be
  3704. // used to include empty fields in Patch requests.
  3705. ForceSendFields []string `json:"-"`
  3706. // NullFields is a list of field names (e.g. "CurrencyCode") to include
  3707. // in API requests with the JSON null value. By default, fields with
  3708. // empty values are omitted from API requests. However, any field with
  3709. // an empty value appearing in NullFields will be sent to the server as
  3710. // null. It is an error if a field in this list has a non-empty value.
  3711. // This may be used to include null fields in Patch requests.
  3712. NullFields []string `json:"-"`
  3713. }
  3714. func (s *Money) MarshalJSON() ([]byte, error) {
  3715. type NoMethod Money
  3716. raw := NoMethod(*s)
  3717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3718. }
  3719. // NativeContent: Native content for a creative.
  3720. type NativeContent struct {
  3721. // AdvertiserName: The name of the advertiser or sponsor, to be
  3722. // displayed in the ad creative.
  3723. AdvertiserName string `json:"advertiserName,omitempty"`
  3724. // AppIcon: The app icon, for app download ads.
  3725. AppIcon *Image `json:"appIcon,omitempty"`
  3726. // Body: A long description of the ad.
  3727. Body string `json:"body,omitempty"`
  3728. // CallToAction: A label for the button that the user is supposed to
  3729. // click.
  3730. CallToAction string `json:"callToAction,omitempty"`
  3731. // ClickLinkUrl: The URL that the browser/SDK will load when the user
  3732. // clicks the ad.
  3733. ClickLinkUrl string `json:"clickLinkUrl,omitempty"`
  3734. // ClickTrackingUrl: The URL to use for click tracking.
  3735. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  3736. // Headline: A short title for the ad.
  3737. Headline string `json:"headline,omitempty"`
  3738. // Image: A large image.
  3739. Image *Image `json:"image,omitempty"`
  3740. // Logo: A smaller image, for the advertiser's logo.
  3741. Logo *Image `json:"logo,omitempty"`
  3742. // PriceDisplayText: The price of the promoted app including currency
  3743. // info.
  3744. PriceDisplayText string `json:"priceDisplayText,omitempty"`
  3745. // StarRating: The app rating in the app store. Must be in the range
  3746. // [0-5].
  3747. StarRating float64 `json:"starRating,omitempty"`
  3748. // StoreUrl: The URL to the app store to purchase/download the promoted
  3749. // app.
  3750. StoreUrl string `json:"storeUrl,omitempty"`
  3751. // VideoUrl: The URL to fetch a native video ad.
  3752. VideoUrl string `json:"videoUrl,omitempty"`
  3753. // ForceSendFields is a list of field names (e.g. "AdvertiserName") to
  3754. // unconditionally include in API requests. By default, fields with
  3755. // empty values are omitted from API requests. However, any non-pointer,
  3756. // non-interface field appearing in ForceSendFields will be sent to the
  3757. // server regardless of whether the field is empty or not. This may be
  3758. // used to include empty fields in Patch requests.
  3759. ForceSendFields []string `json:"-"`
  3760. // NullFields is a list of field names (e.g. "AdvertiserName") to
  3761. // include in API requests with the JSON null value. By default, fields
  3762. // with empty values are omitted from API requests. However, any field
  3763. // with an empty value appearing in NullFields will be sent to the
  3764. // server as null. It is an error if a field in this list has a
  3765. // non-empty value. This may be used to include null fields in Patch
  3766. // requests.
  3767. NullFields []string `json:"-"`
  3768. }
  3769. func (s *NativeContent) MarshalJSON() ([]byte, error) {
  3770. type NoMethod NativeContent
  3771. raw := NoMethod(*s)
  3772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3773. }
  3774. func (s *NativeContent) UnmarshalJSON(data []byte) error {
  3775. type NoMethod NativeContent
  3776. var s1 struct {
  3777. StarRating gensupport.JSONFloat64 `json:"starRating"`
  3778. *NoMethod
  3779. }
  3780. s1.NoMethod = (*NoMethod)(s)
  3781. if err := json.Unmarshal(data, &s1); err != nil {
  3782. return err
  3783. }
  3784. s.StarRating = float64(s1.StarRating)
  3785. return nil
  3786. }
  3787. // NonBillableWinningBidStatusRow: The number of winning bids with the
  3788. // specified dimension values for which the
  3789. // buyer was not billed, as described by the specified status.
  3790. type NonBillableWinningBidStatusRow struct {
  3791. // BidCount: The number of bids with the specified status.
  3792. BidCount *MetricValue `json:"bidCount,omitempty"`
  3793. // RowDimensions: The values of all dimensions associated with metric
  3794. // values in this row.
  3795. RowDimensions *RowDimensions `json:"rowDimensions,omitempty"`
  3796. // Status: The status specifying why the winning bids were not billed.
  3797. //
  3798. // Possible values:
  3799. // "STATUS_UNSPECIFIED" - A placeholder for an undefined status.
  3800. // This value will never be returned in responses.
  3801. // "AD_NOT_RENDERED" - The buyer was not billed because the ad was not
  3802. // rendered by the
  3803. // publisher.
  3804. // "INVALID_IMPRESSION" - The buyer was not billed because the
  3805. // impression won by the bid was
  3806. // determined to be invalid.
  3807. Status string `json:"status,omitempty"`
  3808. // ForceSendFields is a list of field names (e.g. "BidCount") to
  3809. // unconditionally include in API requests. By default, fields with
  3810. // empty values are omitted from API requests. However, any non-pointer,
  3811. // non-interface field appearing in ForceSendFields will be sent to the
  3812. // server regardless of whether the field is empty or not. This may be
  3813. // used to include empty fields in Patch requests.
  3814. ForceSendFields []string `json:"-"`
  3815. // NullFields is a list of field names (e.g. "BidCount") to include in
  3816. // API requests with the JSON null value. By default, fields with empty
  3817. // values are omitted from API requests. However, any field with an
  3818. // empty value appearing in NullFields will be sent to the server as
  3819. // null. It is an error if a field in this list has a non-empty value.
  3820. // This may be used to include null fields in Patch requests.
  3821. NullFields []string `json:"-"`
  3822. }
  3823. func (s *NonBillableWinningBidStatusRow) MarshalJSON() ([]byte, error) {
  3824. type NoMethod NonBillableWinningBidStatusRow
  3825. raw := NoMethod(*s)
  3826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3827. }
  3828. // NonGuaranteedAuctionTerms: Terms for Private Auctions. Note that
  3829. // Private Auctions can be created only
  3830. // by the seller, but they can be returned in a get or list request.
  3831. type NonGuaranteedAuctionTerms struct {
  3832. // AutoOptimizePrivateAuction: True if open auction buyers are allowed
  3833. // to compete with invited buyers
  3834. // in this private auction.
  3835. AutoOptimizePrivateAuction bool `json:"autoOptimizePrivateAuction,omitempty"`
  3836. // ReservePricesPerBuyer: Reserve price for the specified buyer.
  3837. ReservePricesPerBuyer []*PricePerBuyer `json:"reservePricesPerBuyer,omitempty"`
  3838. // ForceSendFields is a list of field names (e.g.
  3839. // "AutoOptimizePrivateAuction") to unconditionally include in API
  3840. // requests. By default, fields with empty values are omitted from API
  3841. // requests. However, any non-pointer, non-interface field appearing in
  3842. // ForceSendFields will be sent to the server regardless of whether the
  3843. // field is empty or not. This may be used to include empty fields in
  3844. // Patch requests.
  3845. ForceSendFields []string `json:"-"`
  3846. // NullFields is a list of field names (e.g.
  3847. // "AutoOptimizePrivateAuction") to include in API requests with the
  3848. // JSON null value. By default, fields with empty values are omitted
  3849. // from API requests. However, any field with an empty value appearing
  3850. // in NullFields will be sent to the server as null. It is an error if a
  3851. // field in this list has a non-empty value. This may be used to include
  3852. // null fields in Patch requests.
  3853. NullFields []string `json:"-"`
  3854. }
  3855. func (s *NonGuaranteedAuctionTerms) MarshalJSON() ([]byte, error) {
  3856. type NoMethod NonGuaranteedAuctionTerms
  3857. raw := NoMethod(*s)
  3858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3859. }
  3860. // NonGuaranteedFixedPriceTerms: Terms for Preferred Deals. Note that
  3861. // Preferred Deals cannot be created via
  3862. // the API at this time, but can be returned in a get or list request.
  3863. type NonGuaranteedFixedPriceTerms struct {
  3864. // FixedPrices: Fixed price for the specified buyer.
  3865. FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
  3866. // ForceSendFields is a list of field names (e.g. "FixedPrices") to
  3867. // unconditionally include in API requests. By default, fields with
  3868. // empty values are omitted from API requests. However, any non-pointer,
  3869. // non-interface field appearing in ForceSendFields will be sent to the
  3870. // server regardless of whether the field is empty or not. This may be
  3871. // used to include empty fields in Patch requests.
  3872. ForceSendFields []string `json:"-"`
  3873. // NullFields is a list of field names (e.g. "FixedPrices") to include
  3874. // in API requests with the JSON null value. By default, fields with
  3875. // empty values are omitted from API requests. However, any field with
  3876. // an empty value appearing in NullFields will be sent to the server as
  3877. // null. It is an error if a field in this list has a non-empty value.
  3878. // This may be used to include null fields in Patch requests.
  3879. NullFields []string `json:"-"`
  3880. }
  3881. func (s *NonGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
  3882. type NoMethod NonGuaranteedFixedPriceTerms
  3883. raw := NoMethod(*s)
  3884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3885. }
  3886. // Note: A proposal may be associated to several notes.
  3887. type Note struct {
  3888. // CreateTime: The timestamp for when this note was created.
  3889. // @OutputOnly
  3890. CreateTime string `json:"createTime,omitempty"`
  3891. // CreatorRole: The role of the person (buyer/seller) creating the
  3892. // note.
  3893. // @OutputOnly
  3894. //
  3895. // Possible values:
  3896. // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
  3897. // buyer/seller role.
  3898. // "BUYER" - Specifies the role as buyer.
  3899. // "SELLER" - Specifies the role as seller.
  3900. CreatorRole string `json:"creatorRole,omitempty"`
  3901. // Note: The actual note to attach.
  3902. // (max-length: 1024 unicode code units)
  3903. //
  3904. // Note: This field may be set only when creating the resource.
  3905. // Modifying
  3906. // this field while updating the resource will result in an error.
  3907. Note string `json:"note,omitempty"`
  3908. // NoteId: The unique ID for the note.
  3909. // @OutputOnly
  3910. NoteId string `json:"noteId,omitempty"`
  3911. // ProposalRevision: The revision number of the proposal when the note
  3912. // is created.
  3913. // @OutputOnly
  3914. ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
  3915. // ServerResponse contains the HTTP response code and headers from the
  3916. // server.
  3917. googleapi.ServerResponse `json:"-"`
  3918. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  3919. // unconditionally include in API requests. By default, fields with
  3920. // empty values are omitted from API requests. However, any non-pointer,
  3921. // non-interface field appearing in ForceSendFields will be sent to the
  3922. // server regardless of whether the field is empty or not. This may be
  3923. // used to include empty fields in Patch requests.
  3924. ForceSendFields []string `json:"-"`
  3925. // NullFields is a list of field names (e.g. "CreateTime") to include in
  3926. // API requests with the JSON null value. By default, fields with empty
  3927. // values are omitted from API requests. However, any field with an
  3928. // empty value appearing in NullFields will be sent to the server as
  3929. // null. It is an error if a field in this list has a non-empty value.
  3930. // This may be used to include null fields in Patch requests.
  3931. NullFields []string `json:"-"`
  3932. }
  3933. func (s *Note) MarshalJSON() ([]byte, error) {
  3934. type NoMethod Note
  3935. raw := NoMethod(*s)
  3936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3937. }
  3938. // OperatingSystemTargeting: Represents targeting information for
  3939. // operating systems.
  3940. type OperatingSystemTargeting struct {
  3941. // OperatingSystemCriteria: IDs of operating systems to be
  3942. // included/excluded.
  3943. OperatingSystemCriteria *CriteriaTargeting `json:"operatingSystemCriteria,omitempty"`
  3944. // OperatingSystemVersionCriteria: IDs of operating system versions to
  3945. // be included/excluded.
  3946. OperatingSystemVersionCriteria *CriteriaTargeting `json:"operatingSystemVersionCriteria,omitempty"`
  3947. // ForceSendFields is a list of field names (e.g.
  3948. // "OperatingSystemCriteria") to unconditionally include in API
  3949. // requests. By default, fields with empty values are omitted from API
  3950. // requests. However, any non-pointer, non-interface field appearing in
  3951. // ForceSendFields will be sent to the server regardless of whether the
  3952. // field is empty or not. This may be used to include empty fields in
  3953. // Patch requests.
  3954. ForceSendFields []string `json:"-"`
  3955. // NullFields is a list of field names (e.g. "OperatingSystemCriteria")
  3956. // to include in API requests with the JSON null value. By default,
  3957. // fields with empty values are omitted from API requests. However, any
  3958. // field with an empty value appearing in NullFields will be sent to the
  3959. // server as null. It is an error if a field in this list has a
  3960. // non-empty value. This may be used to include null fields in Patch
  3961. // requests.
  3962. NullFields []string `json:"-"`
  3963. }
  3964. func (s *OperatingSystemTargeting) MarshalJSON() ([]byte, error) {
  3965. type NoMethod OperatingSystemTargeting
  3966. raw := NoMethod(*s)
  3967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3968. }
  3969. // PauseProposalRequest: Request message to pause serving for an
  3970. // already-finalized proposal.
  3971. type PauseProposalRequest struct {
  3972. // Reason: The reason why the proposal is being paused.
  3973. // This human readable message will be displayed in the seller's
  3974. // UI.
  3975. // (Max length: 1000 unicode code units.)
  3976. Reason string `json:"reason,omitempty"`
  3977. // ForceSendFields is a list of field names (e.g. "Reason") to
  3978. // unconditionally include in API requests. By default, fields with
  3979. // empty values are omitted from API requests. However, any non-pointer,
  3980. // non-interface field appearing in ForceSendFields will be sent to the
  3981. // server regardless of whether the field is empty or not. This may be
  3982. // used to include empty fields in Patch requests.
  3983. ForceSendFields []string `json:"-"`
  3984. // NullFields is a list of field names (e.g. "Reason") to include in API
  3985. // requests with the JSON null value. By default, fields with empty
  3986. // values are omitted from API requests. However, any field with an
  3987. // empty value appearing in NullFields will be sent to the server as
  3988. // null. It is an error if a field in this list has a non-empty value.
  3989. // This may be used to include null fields in Patch requests.
  3990. NullFields []string `json:"-"`
  3991. }
  3992. func (s *PauseProposalRequest) MarshalJSON() ([]byte, error) {
  3993. type NoMethod PauseProposalRequest
  3994. raw := NoMethod(*s)
  3995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3996. }
  3997. // PlacementTargeting: Represents targeting about where the ads can
  3998. // appear, e.g., certain sites or
  3999. // mobile applications.
  4000. // Different placement targeting types will be logically OR'ed.
  4001. type PlacementTargeting struct {
  4002. // MobileApplicationTargeting: Mobile application targeting information
  4003. // in a deal.
  4004. // This doesn't apply to Auction Packages.
  4005. MobileApplicationTargeting *MobileApplicationTargeting `json:"mobileApplicationTargeting,omitempty"`
  4006. // UrlTargeting: URLs to be included/excluded.
  4007. UrlTargeting *UrlTargeting `json:"urlTargeting,omitempty"`
  4008. // ForceSendFields is a list of field names (e.g.
  4009. // "MobileApplicationTargeting") to unconditionally include in API
  4010. // requests. By default, fields with empty values are omitted from API
  4011. // requests. However, any non-pointer, non-interface field appearing in
  4012. // ForceSendFields will be sent to the server regardless of whether the
  4013. // field is empty or not. This may be used to include empty fields in
  4014. // Patch requests.
  4015. ForceSendFields []string `json:"-"`
  4016. // NullFields is a list of field names (e.g.
  4017. // "MobileApplicationTargeting") to include in API requests with the
  4018. // JSON null value. By default, fields with empty values are omitted
  4019. // from API requests. However, any field with an empty value appearing
  4020. // in NullFields will be sent to the server as null. It is an error if a
  4021. // field in this list has a non-empty value. This may be used to include
  4022. // null fields in Patch requests.
  4023. NullFields []string `json:"-"`
  4024. }
  4025. func (s *PlacementTargeting) MarshalJSON() ([]byte, error) {
  4026. type NoMethod PlacementTargeting
  4027. raw := NoMethod(*s)
  4028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4029. }
  4030. // PlatformContext: @OutputOnly The type of platform the restriction
  4031. // applies to.
  4032. type PlatformContext struct {
  4033. // Platforms: The platforms this restriction applies to.
  4034. //
  4035. // Possible values:
  4036. // "DESKTOP" - Desktop platform.
  4037. // "ANDROID" - Android platform.
  4038. // "IOS" - iOS platform.
  4039. Platforms []string `json:"platforms,omitempty"`
  4040. // ForceSendFields is a list of field names (e.g. "Platforms") to
  4041. // unconditionally include in API requests. By default, fields with
  4042. // empty values are omitted from API requests. However, any non-pointer,
  4043. // non-interface field appearing in ForceSendFields will be sent to the
  4044. // server regardless of whether the field is empty or not. This may be
  4045. // used to include empty fields in Patch requests.
  4046. ForceSendFields []string `json:"-"`
  4047. // NullFields is a list of field names (e.g. "Platforms") to include in
  4048. // API requests with the JSON null value. By default, fields with empty
  4049. // values are omitted from API requests. However, any field with an
  4050. // empty value appearing in NullFields will be sent to the server as
  4051. // null. It is an error if a field in this list has a non-empty value.
  4052. // This may be used to include null fields in Patch requests.
  4053. NullFields []string `json:"-"`
  4054. }
  4055. func (s *PlatformContext) MarshalJSON() ([]byte, error) {
  4056. type NoMethod PlatformContext
  4057. raw := NoMethod(*s)
  4058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4059. }
  4060. // Price: Represents a price and a pricing type for a product / deal.
  4061. type Price struct {
  4062. // Amount: The actual price with currency specified.
  4063. Amount *Money `json:"amount,omitempty"`
  4064. // PricingType: The pricing type for the deal/product. (default: CPM)
  4065. //
  4066. // Possible values:
  4067. // "PRICING_TYPE_UNSPECIFIED" - A placeholder for an undefined pricing
  4068. // type. If the pricing type is
  4069. // unpsecified, `COST_PER_MILLE` will be used instead.
  4070. // "COST_PER_MILLE" - Cost per thousand impressions.
  4071. // "COST_PER_DAY" - Cost per day
  4072. PricingType string `json:"pricingType,omitempty"`
  4073. // ForceSendFields is a list of field names (e.g. "Amount") to
  4074. // unconditionally include in API requests. By default, fields with
  4075. // empty values are omitted from API requests. However, any non-pointer,
  4076. // non-interface field appearing in ForceSendFields will be sent to the
  4077. // server regardless of whether the field is empty or not. This may be
  4078. // used to include empty fields in Patch requests.
  4079. ForceSendFields []string `json:"-"`
  4080. // NullFields is a list of field names (e.g. "Amount") to include in API
  4081. // requests with the JSON null value. By default, fields with empty
  4082. // values are omitted from API requests. However, any field with an
  4083. // empty value appearing in NullFields will be sent to the server as
  4084. // null. It is an error if a field in this list has a non-empty value.
  4085. // This may be used to include null fields in Patch requests.
  4086. NullFields []string `json:"-"`
  4087. }
  4088. func (s *Price) MarshalJSON() ([]byte, error) {
  4089. type NoMethod Price
  4090. raw := NoMethod(*s)
  4091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4092. }
  4093. // PricePerBuyer: Used to specify pricing rules for buyers/advertisers.
  4094. // Each PricePerBuyer in
  4095. // a product can become 0 or 1 deals. To check if there is a
  4096. // PricePerBuyer for
  4097. // a particular buyer or buyer/advertiser pair, we look for the most
  4098. // specific
  4099. // matching rule - we first look for a rule matching the buyer and
  4100. // advertiser,
  4101. // next a rule with the buyer but an empty advertiser list, and
  4102. // otherwise look
  4103. // for a matching rule where no buyer is set.
  4104. type PricePerBuyer struct {
  4105. // AdvertiserIds: The list of advertisers for this price when associated
  4106. // with this buyer.
  4107. // If empty, all advertisers with this buyer pay this price.
  4108. AdvertiserIds []string `json:"advertiserIds,omitempty"`
  4109. // Buyer: The buyer who will pay this price. If unset, all buyers can
  4110. // pay this price
  4111. // (if the
  4112. // advertisers match, and there's no more specific rule matching the
  4113. // buyer).
  4114. Buyer *Buyer `json:"buyer,omitempty"`
  4115. // Price: The specified price.
  4116. Price *Price `json:"price,omitempty"`
  4117. // ForceSendFields is a list of field names (e.g. "AdvertiserIds") to
  4118. // unconditionally include in API requests. By default, fields with
  4119. // empty values are omitted from API requests. However, any non-pointer,
  4120. // non-interface field appearing in ForceSendFields will be sent to the
  4121. // server regardless of whether the field is empty or not. This may be
  4122. // used to include empty fields in Patch requests.
  4123. ForceSendFields []string `json:"-"`
  4124. // NullFields is a list of field names (e.g. "AdvertiserIds") to include
  4125. // in API requests with the JSON null value. By default, fields with
  4126. // empty values are omitted from API requests. However, any field with
  4127. // an empty value appearing in NullFields will be sent to the server as
  4128. // null. It is an error if a field in this list has a non-empty value.
  4129. // This may be used to include null fields in Patch requests.
  4130. NullFields []string `json:"-"`
  4131. }
  4132. func (s *PricePerBuyer) MarshalJSON() ([]byte, error) {
  4133. type NoMethod PricePerBuyer
  4134. raw := NoMethod(*s)
  4135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4136. }
  4137. // PrivateData: Buyers are allowed to store certain types of private
  4138. // data in a proposal/deal.
  4139. type PrivateData struct {
  4140. // ReferenceId: A buyer or seller specified reference ID. This can be
  4141. // queried in the list
  4142. // operations (max-length: 1024 unicode code units).
  4143. ReferenceId string `json:"referenceId,omitempty"`
  4144. // ForceSendFields is a list of field names (e.g. "ReferenceId") to
  4145. // unconditionally include in API requests. By default, fields with
  4146. // empty values are omitted from API requests. However, any non-pointer,
  4147. // non-interface field appearing in ForceSendFields will be sent to the
  4148. // server regardless of whether the field is empty or not. This may be
  4149. // used to include empty fields in Patch requests.
  4150. ForceSendFields []string `json:"-"`
  4151. // NullFields is a list of field names (e.g. "ReferenceId") to include
  4152. // in API requests with the JSON null value. By default, fields with
  4153. // empty values are omitted from API requests. However, any field with
  4154. // an empty value appearing in NullFields will be sent to the server as
  4155. // null. It is an error if a field in this list has a non-empty value.
  4156. // This may be used to include null fields in Patch requests.
  4157. NullFields []string `json:"-"`
  4158. }
  4159. func (s *PrivateData) MarshalJSON() ([]byte, error) {
  4160. type NoMethod PrivateData
  4161. raw := NoMethod(*s)
  4162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4163. }
  4164. // Product: Note: this resource requires whitelisting for access. Please
  4165. // contact your
  4166. // account manager for access to Marketplace resources.
  4167. //
  4168. // A product is a segment of inventory that a seller wishes to sell. It
  4169. // is
  4170. // associated with certain terms and targeting information which helps
  4171. // the buyer
  4172. // know more about the inventory.
  4173. type Product struct {
  4174. // AvailableEndTime: The proposed end time for the deal. The field will
  4175. // be truncated to the order of
  4176. // seconds during serving.
  4177. AvailableEndTime string `json:"availableEndTime,omitempty"`
  4178. // AvailableStartTime: Inventory availability dates. The start time will
  4179. // be truncated to seconds during serving.
  4180. // Thus, a field specified as 3:23:34.456 (HH:mm:ss.SSS) will be
  4181. // truncated to 3:23:34
  4182. // when serving.
  4183. AvailableStartTime string `json:"availableStartTime,omitempty"`
  4184. // CreateTime: Creation time.
  4185. CreateTime string `json:"createTime,omitempty"`
  4186. // CreatorContacts: Optional contact information for the creator of this
  4187. // product.
  4188. CreatorContacts []*ContactInformation `json:"creatorContacts,omitempty"`
  4189. // DisplayName: The display name for this product as set by the seller.
  4190. DisplayName string `json:"displayName,omitempty"`
  4191. // HasCreatorSignedOff: If the creator has already signed off on the
  4192. // product, then the buyer can
  4193. // finalize the deal by accepting the product as is. When copying to
  4194. // a
  4195. // proposal, if any of the terms are changed, then auto_finalize
  4196. // is
  4197. // automatically set to false.
  4198. HasCreatorSignedOff bool `json:"hasCreatorSignedOff,omitempty"`
  4199. // ProductId: The unique ID for the product.
  4200. ProductId string `json:"productId,omitempty"`
  4201. // ProductRevision: The revision number of the product (auto-assigned by
  4202. // Marketplace).
  4203. ProductRevision int64 `json:"productRevision,omitempty,string"`
  4204. // PublisherProfileId: An ID which can be used by the Publisher Profile
  4205. // API to get more
  4206. // information about the seller that created this product.
  4207. PublisherProfileId string `json:"publisherProfileId,omitempty"`
  4208. // Seller: Information about the seller that created this product.
  4209. Seller *Seller `json:"seller,omitempty"`
  4210. // SyndicationProduct: The syndication product associated with the deal.
  4211. //
  4212. // Possible values:
  4213. // "SYNDICATION_PRODUCT_UNSPECIFIED" - A placeholder for an undefined
  4214. // syndication product.
  4215. // "CONTENT" - This typically represents a web page.
  4216. // "MOBILE" - This represents a mobile property.
  4217. // "VIDEO" - This represents video ad formats.
  4218. // "GAMES" - This represents ads shown within games.
  4219. SyndicationProduct string `json:"syndicationProduct,omitempty"`
  4220. // TargetingCriterion: Targeting that is shared between the buyer and
  4221. // the seller. Each targeting
  4222. // criterion has a specified key and for each key there is a list of
  4223. // inclusion
  4224. // value or exclusion values.
  4225. TargetingCriterion []*TargetingCriteria `json:"targetingCriterion,omitempty"`
  4226. // Terms: The negotiable terms of the deal.
  4227. Terms *DealTerms `json:"terms,omitempty"`
  4228. // UpdateTime: Time of last update.
  4229. UpdateTime string `json:"updateTime,omitempty"`
  4230. // WebPropertyCode: The web-property code for the seller. This needs to
  4231. // be copied as is when
  4232. // adding a new deal to a proposal.
  4233. WebPropertyCode string `json:"webPropertyCode,omitempty"`
  4234. // ServerResponse contains the HTTP response code and headers from the
  4235. // server.
  4236. googleapi.ServerResponse `json:"-"`
  4237. // ForceSendFields is a list of field names (e.g. "AvailableEndTime") to
  4238. // unconditionally include in API requests. By default, fields with
  4239. // empty values are omitted from API requests. However, any non-pointer,
  4240. // non-interface field appearing in ForceSendFields will be sent to the
  4241. // server regardless of whether the field is empty or not. This may be
  4242. // used to include empty fields in Patch requests.
  4243. ForceSendFields []string `json:"-"`
  4244. // NullFields is a list of field names (e.g. "AvailableEndTime") to
  4245. // include in API requests with the JSON null value. By default, fields
  4246. // with empty values are omitted from API requests. However, any field
  4247. // with an empty value appearing in NullFields will be sent to the
  4248. // server as null. It is an error if a field in this list has a
  4249. // non-empty value. This may be used to include null fields in Patch
  4250. // requests.
  4251. NullFields []string `json:"-"`
  4252. }
  4253. func (s *Product) MarshalJSON() ([]byte, error) {
  4254. type NoMethod Product
  4255. raw := NoMethod(*s)
  4256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4257. }
  4258. // Proposal: Note: this resource requires whitelisting for access.
  4259. // Please contact your
  4260. // account manager for access to Marketplace resources.
  4261. //
  4262. // Represents a proposal in the Marketplace. A proposal is the unit
  4263. // of
  4264. // negotiation between a seller and a buyer and contains deals which
  4265. // are served.
  4266. //
  4267. // Note: you can not update, create, or otherwise modify Private
  4268. // Auction or Preferred Deals deals through the API.
  4269. //
  4270. // Fields are updatable unless noted otherwise.
  4271. type Proposal struct {
  4272. // BilledBuyer: Reference to the buyer that will get billed for this
  4273. // proposal.
  4274. // @OutputOnly
  4275. BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
  4276. // Buyer: Reference to the buyer on the proposal.
  4277. //
  4278. // Note: This field may be set only when creating the resource.
  4279. // Modifying
  4280. // this field while updating the resource will result in an error.
  4281. Buyer *Buyer `json:"buyer,omitempty"`
  4282. // BuyerContacts: Contact information for the buyer.
  4283. BuyerContacts []*ContactInformation `json:"buyerContacts,omitempty"`
  4284. // BuyerPrivateData: Private data for buyer. (hidden from seller).
  4285. BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
  4286. // Deals: The deals associated with this proposal. For Private Auction
  4287. // proposals (whose deals have
  4288. // NonGuaranteedAuctionTerms), there will only be one deal.
  4289. Deals []*Deal `json:"deals,omitempty"`
  4290. // DisplayName: The name for the proposal.
  4291. DisplayName string `json:"displayName,omitempty"`
  4292. // IsRenegotiating: True if the proposal is being
  4293. // renegotiated.
  4294. // @OutputOnly
  4295. IsRenegotiating bool `json:"isRenegotiating,omitempty"`
  4296. // IsSetupComplete: True, if the buyside inventory setup is complete for
  4297. // this proposal.
  4298. // @OutputOnly
  4299. IsSetupComplete bool `json:"isSetupComplete,omitempty"`
  4300. // LastUpdaterOrCommentorRole: The role of the last user that either
  4301. // updated the proposal or left a
  4302. // comment.
  4303. // @OutputOnly
  4304. //
  4305. // Possible values:
  4306. // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
  4307. // buyer/seller role.
  4308. // "BUYER" - Specifies the role as buyer.
  4309. // "SELLER" - Specifies the role as seller.
  4310. LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"`
  4311. // Notes: The notes associated with this proposal.
  4312. // @OutputOnly
  4313. Notes []*Note `json:"notes,omitempty"`
  4314. // OriginatorRole: Indicates whether the buyer/seller created the
  4315. // proposal.
  4316. // @OutputOnly
  4317. //
  4318. // Possible values:
  4319. // "BUYER_SELLER_ROLE_UNSPECIFIED" - A placeholder for an undefined
  4320. // buyer/seller role.
  4321. // "BUYER" - Specifies the role as buyer.
  4322. // "SELLER" - Specifies the role as seller.
  4323. OriginatorRole string `json:"originatorRole,omitempty"`
  4324. // PrivateAuctionId: Private auction ID if this proposal is a private
  4325. // auction proposal.
  4326. // @OutputOnly
  4327. PrivateAuctionId string `json:"privateAuctionId,omitempty"`
  4328. // ProposalId: The unique ID of the proposal.
  4329. // @OutputOnly
  4330. ProposalId string `json:"proposalId,omitempty"`
  4331. // ProposalRevision: The revision number for the proposal.
  4332. // Each update to the proposal or the deal causes the proposal revision
  4333. // number
  4334. // to auto-increment. The buyer keeps track of the last revision number
  4335. // they
  4336. // know of and pass it in when making an update. If the head revision
  4337. // number
  4338. // on the server has since incremented, then an ABORTED error is
  4339. // returned
  4340. // during the update operation to let the buyer know that a subsequent
  4341. // update
  4342. // was made.
  4343. // @OutputOnly
  4344. ProposalRevision int64 `json:"proposalRevision,omitempty,string"`
  4345. // ProposalState: The current state of the proposal.
  4346. // @OutputOnly
  4347. //
  4348. // Possible values:
  4349. // "PROPOSAL_STATE_UNSPECIFIED" - A placeholder for an undefined
  4350. // proposal state.
  4351. // "PROPOSED" - The proposal is under negotiation or renegotiation.
  4352. // "BUYER_ACCEPTED" - The proposal has been accepted by the buyer.
  4353. // "SELLER_ACCEPTED" - The proposal has been accepted by the seller.
  4354. // "CANCELED" - The negotiations on the proposal were canceled and the
  4355. // proposal was never
  4356. // finalized.
  4357. // "FINALIZED" - The proposal is finalized. During renegotiation, the
  4358. // proposal may
  4359. // not be in this state.
  4360. ProposalState string `json:"proposalState,omitempty"`
  4361. // Seller: Reference to the seller on the proposal.
  4362. //
  4363. // Note: This field may be set only when creating the resource.
  4364. // Modifying
  4365. // this field while updating the resource will result in an error.
  4366. Seller *Seller `json:"seller,omitempty"`
  4367. // SellerContacts: Contact information for the seller.
  4368. // @OutputOnly
  4369. SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
  4370. // UpdateTime: The time when the proposal was last revised.
  4371. // @OutputOnly
  4372. UpdateTime string `json:"updateTime,omitempty"`
  4373. // ServerResponse contains the HTTP response code and headers from the
  4374. // server.
  4375. googleapi.ServerResponse `json:"-"`
  4376. // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
  4377. // unconditionally include in API requests. By default, fields with
  4378. // empty values are omitted from API requests. However, any non-pointer,
  4379. // non-interface field appearing in ForceSendFields will be sent to the
  4380. // server regardless of whether the field is empty or not. This may be
  4381. // used to include empty fields in Patch requests.
  4382. ForceSendFields []string `json:"-"`
  4383. // NullFields is a list of field names (e.g. "BilledBuyer") to include
  4384. // in API requests with the JSON null value. By default, fields with
  4385. // empty values are omitted from API requests. However, any field with
  4386. // an empty value appearing in NullFields will be sent to the server as
  4387. // null. It is an error if a field in this list has a non-empty value.
  4388. // This may be used to include null fields in Patch requests.
  4389. NullFields []string `json:"-"`
  4390. }
  4391. func (s *Proposal) MarshalJSON() ([]byte, error) {
  4392. type NoMethod Proposal
  4393. raw := NoMethod(*s)
  4394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4395. }
  4396. // PublisherProfile: Note: this resource requires whitelisting for
  4397. // access. Please contact your
  4398. // account manager for access to Marketplace resources.
  4399. //
  4400. // Represents a publisher profile in Marketplace.
  4401. //
  4402. // All fields are read only. All string fields are free-form text
  4403. // entered by the publisher
  4404. // unless noted otherwise.
  4405. type PublisherProfile struct {
  4406. // AudienceDescription: Description on the publisher's audience.
  4407. AudienceDescription string `json:"audienceDescription,omitempty"`
  4408. // BuyerPitchStatement: Statement explaining what's unique about
  4409. // publisher's business, and why buyers should
  4410. // partner with the publisher.
  4411. BuyerPitchStatement string `json:"buyerPitchStatement,omitempty"`
  4412. // DirectDealsContact: Contact information for direct reservation deals.
  4413. // This is free text entered by the publisher
  4414. // and may include information like names, phone numbers and email
  4415. // addresses.
  4416. DirectDealsContact string `json:"directDealsContact,omitempty"`
  4417. // DisplayName: Name of the publisher profile.
  4418. DisplayName string `json:"displayName,omitempty"`
  4419. // Domains: The list of domains represented in this publisher profile.
  4420. // Empty if this is a parent profile.
  4421. // These are top private domains, meaning that these will not contain a
  4422. // string like
  4423. // "photos.google.co.uk/123", but will instead contain "google.co.uk".
  4424. Domains []string `json:"domains,omitempty"`
  4425. // GooglePlusUrl: URL to publisher's Google+ page.
  4426. GooglePlusUrl string `json:"googlePlusUrl,omitempty"`
  4427. // LogoUrl: A Google public URL to the logo for this publisher profile.
  4428. // The logo is stored as
  4429. // a PNG, JPG, or GIF image.
  4430. LogoUrl string `json:"logoUrl,omitempty"`
  4431. // MediaKitUrl: URL to additional marketing and sales materials.
  4432. MediaKitUrl string `json:"mediaKitUrl,omitempty"`
  4433. // Overview: Overview of the publisher.
  4434. Overview string `json:"overview,omitempty"`
  4435. // ProgrammaticDealsContact: Contact information for programmatic deals.
  4436. // This is free text entered by the publisher
  4437. // and may include information like names, phone numbers and email
  4438. // addresses.
  4439. ProgrammaticDealsContact string `json:"programmaticDealsContact,omitempty"`
  4440. // PublisherProfileId: Unique ID for publisher profile.
  4441. PublisherProfileId string `json:"publisherProfileId,omitempty"`
  4442. // RateCardInfoUrl: URL to a publisher rate card.
  4443. RateCardInfoUrl string `json:"rateCardInfoUrl,omitempty"`
  4444. // SamplePageUrl: URL to a sample content page.
  4445. SamplePageUrl string `json:"samplePageUrl,omitempty"`
  4446. // Seller: Seller of the publisher profile.
  4447. Seller *Seller `json:"seller,omitempty"`
  4448. // TopHeadlines: Up to three key metrics and rankings. Max 100
  4449. // characters each.
  4450. // For example "#1 Mobile News Site for 20 Straight Months".
  4451. TopHeadlines []string `json:"topHeadlines,omitempty"`
  4452. // ServerResponse contains the HTTP response code and headers from the
  4453. // server.
  4454. googleapi.ServerResponse `json:"-"`
  4455. // ForceSendFields is a list of field names (e.g. "AudienceDescription")
  4456. // to unconditionally include in API requests. By default, fields with
  4457. // empty values are omitted from API requests. However, any non-pointer,
  4458. // non-interface field appearing in ForceSendFields will be sent to the
  4459. // server regardless of whether the field is empty or not. This may be
  4460. // used to include empty fields in Patch requests.
  4461. ForceSendFields []string `json:"-"`
  4462. // NullFields is a list of field names (e.g. "AudienceDescription") to
  4463. // include in API requests with the JSON null value. By default, fields
  4464. // with empty values are omitted from API requests. However, any field
  4465. // with an empty value appearing in NullFields will be sent to the
  4466. // server as null. It is an error if a field in this list has a
  4467. // non-empty value. This may be used to include null fields in Patch
  4468. // requests.
  4469. NullFields []string `json:"-"`
  4470. }
  4471. func (s *PublisherProfile) MarshalJSON() ([]byte, error) {
  4472. type NoMethod PublisherProfile
  4473. raw := NoMethod(*s)
  4474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4475. }
  4476. // RealtimeTimeRange: An open-ended realtime time range specified by the
  4477. // start timestamp.
  4478. // For filter sets that specify a realtime time range RTB metrics
  4479. // continue to
  4480. // be aggregated throughout the lifetime of the filter set.
  4481. type RealtimeTimeRange struct {
  4482. // StartTimestamp: The start timestamp of the real-time RTB metrics
  4483. // aggregation.
  4484. StartTimestamp string `json:"startTimestamp,omitempty"`
  4485. // ForceSendFields is a list of field names (e.g. "StartTimestamp") to
  4486. // unconditionally include in API requests. By default, fields with
  4487. // empty values are omitted from API requests. However, any non-pointer,
  4488. // non-interface field appearing in ForceSendFields will be sent to the
  4489. // server regardless of whether the field is empty or not. This may be
  4490. // used to include empty fields in Patch requests.
  4491. ForceSendFields []string `json:"-"`
  4492. // NullFields is a list of field names (e.g. "StartTimestamp") to
  4493. // include in API requests with the JSON null value. By default, fields
  4494. // with empty values are omitted from API requests. However, any field
  4495. // with an empty value appearing in NullFields will be sent to the
  4496. // server as null. It is an error if a field in this list has a
  4497. // non-empty value. This may be used to include null fields in Patch
  4498. // requests.
  4499. NullFields []string `json:"-"`
  4500. }
  4501. func (s *RealtimeTimeRange) MarshalJSON() ([]byte, error) {
  4502. type NoMethod RealtimeTimeRange
  4503. raw := NoMethod(*s)
  4504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4505. }
  4506. // Reason: A specific filtering status and how many times it occurred.
  4507. type Reason struct {
  4508. // Count: The number of times the creative was filtered for the status.
  4509. // The
  4510. // count is aggregated across all publishers on the exchange.
  4511. Count int64 `json:"count,omitempty,string"`
  4512. // Status: The filtering status code. Please refer to
  4513. // the
  4514. // [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb
  4515. // -dictionaries/creative-status-codes.txt)
  4516. // file for different statuses.
  4517. Status int64 `json:"status,omitempty"`
  4518. // ForceSendFields is a list of field names (e.g. "Count") to
  4519. // unconditionally include in API requests. By default, fields with
  4520. // empty values are omitted from API requests. However, any non-pointer,
  4521. // non-interface field appearing in ForceSendFields will be sent to the
  4522. // server regardless of whether the field is empty or not. This may be
  4523. // used to include empty fields in Patch requests.
  4524. ForceSendFields []string `json:"-"`
  4525. // NullFields is a list of field names (e.g. "Count") to include in API
  4526. // requests with the JSON null value. By default, fields with empty
  4527. // values are omitted from API requests. However, any field with an
  4528. // empty value appearing in NullFields will be sent to the server as
  4529. // null. It is an error if a field in this list has a non-empty value.
  4530. // This may be used to include null fields in Patch requests.
  4531. NullFields []string `json:"-"`
  4532. }
  4533. func (s *Reason) MarshalJSON() ([]byte, error) {
  4534. type NoMethod Reason
  4535. raw := NoMethod(*s)
  4536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4537. }
  4538. // RelativeDateRange: A relative date range, specified by an offset and
  4539. // a duration.
  4540. // The supported range of dates begins 30 days before today and ends
  4541. // today,
  4542. // i.e., the limits for these values are:
  4543. // offset_days >= 0
  4544. // duration_days >= 1
  4545. // offset_days + duration_days <= 30
  4546. type RelativeDateRange struct {
  4547. // DurationDays: The number of days in the requested date range, e.g.,
  4548. // for a range spanning
  4549. // today: 1. For a range spanning the last 7 days: 7.
  4550. DurationDays int64 `json:"durationDays,omitempty"`
  4551. // OffsetDays: The end date of the filter set, specified as the number
  4552. // of days before
  4553. // today, e.g., for a range where the last date is today: 0.
  4554. OffsetDays int64 `json:"offsetDays,omitempty"`
  4555. // ForceSendFields is a list of field names (e.g. "DurationDays") to
  4556. // unconditionally include in API requests. By default, fields with
  4557. // empty values are omitted from API requests. However, any non-pointer,
  4558. // non-interface field appearing in ForceSendFields will be sent to the
  4559. // server regardless of whether the field is empty or not. This may be
  4560. // used to include empty fields in Patch requests.
  4561. ForceSendFields []string `json:"-"`
  4562. // NullFields is a list of field names (e.g. "DurationDays") to include
  4563. // in API requests with the JSON null value. By default, fields with
  4564. // empty values are omitted from API requests. However, any field with
  4565. // an empty value appearing in NullFields will be sent to the server as
  4566. // null. It is an error if a field in this list has a non-empty value.
  4567. // This may be used to include null fields in Patch requests.
  4568. NullFields []string `json:"-"`
  4569. }
  4570. func (s *RelativeDateRange) MarshalJSON() ([]byte, error) {
  4571. type NoMethod RelativeDateRange
  4572. raw := NoMethod(*s)
  4573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4574. }
  4575. // RemoveDealAssociationRequest: A request for removing the association
  4576. // between a deal and a creative.
  4577. type RemoveDealAssociationRequest struct {
  4578. // Association: The association between a creative and a deal that
  4579. // should be removed.
  4580. Association *CreativeDealAssociation `json:"association,omitempty"`
  4581. // ForceSendFields is a list of field names (e.g. "Association") to
  4582. // unconditionally include in API requests. By default, fields with
  4583. // empty values are omitted from API requests. However, any non-pointer,
  4584. // non-interface field appearing in ForceSendFields will be sent to the
  4585. // server regardless of whether the field is empty or not. This may be
  4586. // used to include empty fields in Patch requests.
  4587. ForceSendFields []string `json:"-"`
  4588. // NullFields is a list of field names (e.g. "Association") to include
  4589. // in API requests with the JSON null value. By default, fields with
  4590. // empty values are omitted from API requests. However, any field with
  4591. // an empty value appearing in NullFields will be sent to the server as
  4592. // null. It is an error if a field in this list has a non-empty value.
  4593. // This may be used to include null fields in Patch requests.
  4594. NullFields []string `json:"-"`
  4595. }
  4596. func (s *RemoveDealAssociationRequest) MarshalJSON() ([]byte, error) {
  4597. type NoMethod RemoveDealAssociationRequest
  4598. raw := NoMethod(*s)
  4599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4600. }
  4601. // ResumeProposalRequest: Request message to resume (unpause) serving
  4602. // for an already-finalized
  4603. // proposal.
  4604. type ResumeProposalRequest struct {
  4605. }
  4606. // RowDimensions: A response may include multiple rows, breaking down
  4607. // along various dimensions.
  4608. // Encapsulates the values of all dimensions for a given row.
  4609. type RowDimensions struct {
  4610. // PublisherIdentifier: The publisher identifier for this row, if a
  4611. // breakdown
  4612. // by
  4613. // [BreakdownDimension.PUBLISHER_IDENTIFIER](https://developers.google
  4614. // .com/authorized-buyers/apis/reference/rest/v2beta1/bidders.accounts.fi
  4615. // lterSets#FilterSet.BreakdownDimension)
  4616. // was requested.
  4617. PublisherIdentifier string `json:"publisherIdentifier,omitempty"`
  4618. // TimeInterval: The time interval that this row represents.
  4619. TimeInterval *TimeInterval `json:"timeInterval,omitempty"`
  4620. // ForceSendFields is a list of field names (e.g. "PublisherIdentifier")
  4621. // to unconditionally include in API requests. By default, fields with
  4622. // empty values are omitted from API requests. However, any non-pointer,
  4623. // non-interface field appearing in ForceSendFields will be sent to the
  4624. // server regardless of whether the field is empty or not. This may be
  4625. // used to include empty fields in Patch requests.
  4626. ForceSendFields []string `json:"-"`
  4627. // NullFields is a list of field names (e.g. "PublisherIdentifier") to
  4628. // include in API requests with the JSON null value. By default, fields
  4629. // with empty values are omitted from API requests. However, any field
  4630. // with an empty value appearing in NullFields will be sent to the
  4631. // server as null. It is an error if a field in this list has a
  4632. // non-empty value. This may be used to include null fields in Patch
  4633. // requests.
  4634. NullFields []string `json:"-"`
  4635. }
  4636. func (s *RowDimensions) MarshalJSON() ([]byte, error) {
  4637. type NoMethod RowDimensions
  4638. raw := NoMethod(*s)
  4639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4640. }
  4641. // SecurityContext: @OutputOnly A security context.
  4642. type SecurityContext struct {
  4643. // Securities: The security types in this context.
  4644. //
  4645. // Possible values:
  4646. // "INSECURE" - Matches impressions that require insecure
  4647. // compatibility.
  4648. // "SSL" - Matches impressions that require SSL compatibility.
  4649. Securities []string `json:"securities,omitempty"`
  4650. // ForceSendFields is a list of field names (e.g. "Securities") to
  4651. // unconditionally include in API requests. By default, fields with
  4652. // empty values are omitted from API requests. However, any non-pointer,
  4653. // non-interface field appearing in ForceSendFields will be sent to the
  4654. // server regardless of whether the field is empty or not. This may be
  4655. // used to include empty fields in Patch requests.
  4656. ForceSendFields []string `json:"-"`
  4657. // NullFields is a list of field names (e.g. "Securities") to include in
  4658. // API requests with the JSON null value. By default, fields with empty
  4659. // values are omitted from API requests. However, any field with an
  4660. // empty value appearing in NullFields will be sent to the server as
  4661. // null. It is an error if a field in this list has a non-empty value.
  4662. // This may be used to include null fields in Patch requests.
  4663. NullFields []string `json:"-"`
  4664. }
  4665. func (s *SecurityContext) MarshalJSON() ([]byte, error) {
  4666. type NoMethod SecurityContext
  4667. raw := NoMethod(*s)
  4668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4669. }
  4670. // Seller: Represents a seller of inventory. Each seller is identified
  4671. // by a unique
  4672. // Ad Manager account ID.
  4673. type Seller struct {
  4674. // AccountId: The unique ID for the seller. The seller fills in this
  4675. // field.
  4676. // The seller account ID is then available to buyer in the product.
  4677. AccountId string `json:"accountId,omitempty"`
  4678. // SubAccountId: Optional sub-account ID for the seller.
  4679. SubAccountId string `json:"subAccountId,omitempty"`
  4680. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4681. // unconditionally include in API requests. By default, fields with
  4682. // empty values are omitted from API requests. However, any non-pointer,
  4683. // non-interface field appearing in ForceSendFields will be sent to the
  4684. // server regardless of whether the field is empty or not. This may be
  4685. // used to include empty fields in Patch requests.
  4686. ForceSendFields []string `json:"-"`
  4687. // NullFields is a list of field names (e.g. "AccountId") to include in
  4688. // API requests with the JSON null value. By default, fields with empty
  4689. // values are omitted from API requests. However, any field with an
  4690. // empty value appearing in NullFields will be sent to the server as
  4691. // null. It is an error if a field in this list has a non-empty value.
  4692. // This may be used to include null fields in Patch requests.
  4693. NullFields []string `json:"-"`
  4694. }
  4695. func (s *Seller) MarshalJSON() ([]byte, error) {
  4696. type NoMethod Seller
  4697. raw := NoMethod(*s)
  4698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4699. }
  4700. // ServingContext: The serving context for this restriction.
  4701. type ServingContext struct {
  4702. // All: Matches all contexts.
  4703. //
  4704. // Possible values:
  4705. // "SIMPLE_CONTEXT" - A simple context.
  4706. All string `json:"all,omitempty"`
  4707. // AppType: Matches impressions for a particular app type.
  4708. AppType *AppContext `json:"appType,omitempty"`
  4709. // AuctionType: Matches impressions for a particular auction type.
  4710. AuctionType *AuctionContext `json:"auctionType,omitempty"`
  4711. // Location: Matches impressions coming from users *or* publishers in a
  4712. // specific
  4713. // location.
  4714. Location *LocationContext `json:"location,omitempty"`
  4715. // Platform: Matches impressions coming from a particular platform.
  4716. Platform *PlatformContext `json:"platform,omitempty"`
  4717. // SecurityType: Matches impressions for a particular security type.
  4718. SecurityType *SecurityContext `json:"securityType,omitempty"`
  4719. // ForceSendFields is a list of field names (e.g. "All") to
  4720. // unconditionally include in API requests. By default, fields with
  4721. // empty values are omitted from API requests. However, any non-pointer,
  4722. // non-interface field appearing in ForceSendFields will be sent to the
  4723. // server regardless of whether the field is empty or not. This may be
  4724. // used to include empty fields in Patch requests.
  4725. ForceSendFields []string `json:"-"`
  4726. // NullFields is a list of field names (e.g. "All") to include in API
  4727. // requests with the JSON null value. By default, fields with empty
  4728. // values are omitted from API requests. However, any field with an
  4729. // empty value appearing in NullFields will be sent to the server as
  4730. // null. It is an error if a field in this list has a non-empty value.
  4731. // This may be used to include null fields in Patch requests.
  4732. NullFields []string `json:"-"`
  4733. }
  4734. func (s *ServingContext) MarshalJSON() ([]byte, error) {
  4735. type NoMethod ServingContext
  4736. raw := NoMethod(*s)
  4737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4738. }
  4739. // ServingRestriction: @OutputOnly A representation of the status of an
  4740. // ad in a
  4741. // specific context. A context here relates to where something
  4742. // ultimately serves
  4743. // (for example, a user or publisher geo, a platform, an HTTPS vs HTTP
  4744. // request,
  4745. // or the type of auction).
  4746. type ServingRestriction struct {
  4747. // Contexts: The contexts for the restriction.
  4748. Contexts []*ServingContext `json:"contexts,omitempty"`
  4749. // Disapproval: Disapproval bound to this restriction.
  4750. // Only present if status=DISAPPROVED.
  4751. // Can be used to filter the response of the
  4752. // creatives.list
  4753. // method.
  4754. Disapproval *Disapproval `json:"disapproval,omitempty"`
  4755. // DisapprovalReasons: Any disapprovals bound to this restriction.
  4756. // Only present if status=DISAPPROVED.
  4757. // Can be used to filter the response of
  4758. // the
  4759. // creatives.list
  4760. // method.
  4761. // Deprecated; please use
  4762. // disapproval
  4763. // field instead.
  4764. DisapprovalReasons []*Disapproval `json:"disapprovalReasons,omitempty"`
  4765. // Status: The status of the creative in this context (for example, it
  4766. // has been
  4767. // explicitly disapproved or is pending review).
  4768. //
  4769. // Possible values:
  4770. // "STATUS_UNSPECIFIED" - The status is not known.
  4771. // "DISAPPROVAL" - The ad was disapproved in this context.
  4772. // "PENDING_REVIEW" - The ad is pending review in this context.
  4773. Status string `json:"status,omitempty"`
  4774. // ForceSendFields is a list of field names (e.g. "Contexts") to
  4775. // unconditionally include in API requests. By default, fields with
  4776. // empty values are omitted from API requests. However, any non-pointer,
  4777. // non-interface field appearing in ForceSendFields will be sent to the
  4778. // server regardless of whether the field is empty or not. This may be
  4779. // used to include empty fields in Patch requests.
  4780. ForceSendFields []string `json:"-"`
  4781. // NullFields is a list of field names (e.g. "Contexts") to include in
  4782. // API requests with the JSON null value. By default, fields with empty
  4783. // values are omitted from API requests. However, any field with an
  4784. // empty value appearing in NullFields will be sent to the server as
  4785. // null. It is an error if a field in this list has a non-empty value.
  4786. // This may be used to include null fields in Patch requests.
  4787. NullFields []string `json:"-"`
  4788. }
  4789. func (s *ServingRestriction) MarshalJSON() ([]byte, error) {
  4790. type NoMethod ServingRestriction
  4791. raw := NoMethod(*s)
  4792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4793. }
  4794. // Size: Message depicting the size of the creative. The units of width
  4795. // and
  4796. // height depend on the type of the targeting.
  4797. type Size struct {
  4798. // Height: The height of the creative.
  4799. Height int64 `json:"height,omitempty"`
  4800. // Width: The width of the creative
  4801. Width int64 `json:"width,omitempty"`
  4802. // ForceSendFields is a list of field names (e.g. "Height") to
  4803. // unconditionally include in API requests. By default, fields with
  4804. // empty values are omitted from API requests. However, any non-pointer,
  4805. // non-interface field appearing in ForceSendFields will be sent to the
  4806. // server regardless of whether the field is empty or not. This may be
  4807. // used to include empty fields in Patch requests.
  4808. ForceSendFields []string `json:"-"`
  4809. // NullFields is a list of field names (e.g. "Height") to include in API
  4810. // requests with the JSON null value. By default, fields with empty
  4811. // values are omitted from API requests. However, any field with an
  4812. // empty value appearing in NullFields will be sent to the server as
  4813. // null. It is an error if a field in this list has a non-empty value.
  4814. // This may be used to include null fields in Patch requests.
  4815. NullFields []string `json:"-"`
  4816. }
  4817. func (s *Size) MarshalJSON() ([]byte, error) {
  4818. type NoMethod Size
  4819. raw := NoMethod(*s)
  4820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4821. }
  4822. // StopWatchingCreativeRequest: A request for stopping notifications for
  4823. // changes to creative Status.
  4824. type StopWatchingCreativeRequest struct {
  4825. }
  4826. // TargetingCriteria: Advertisers can target different attributes of an
  4827. // ad slot. For example,
  4828. // they can choose to show ads only if the user is in the U.S.
  4829. // Such
  4830. // targeting criteria can be specified as part of Shared Targeting.
  4831. type TargetingCriteria struct {
  4832. // Exclusions: The list of values to exclude from targeting. Each value
  4833. // is AND'd
  4834. // together.
  4835. Exclusions []*TargetingValue `json:"exclusions,omitempty"`
  4836. // Inclusions: The list of value to include as part of the targeting.
  4837. // Each value is OR'd
  4838. // together.
  4839. Inclusions []*TargetingValue `json:"inclusions,omitempty"`
  4840. // Key: The key representing the shared targeting criterion.
  4841. // Targeting criteria defined by Google ad servers will begin with
  4842. // GOOG_.
  4843. // Third parties may define their own keys.
  4844. // A list of permissible keys along with the acceptable values will
  4845. // be
  4846. // provided as part of the external documentation.
  4847. Key string `json:"key,omitempty"`
  4848. // ForceSendFields is a list of field names (e.g. "Exclusions") to
  4849. // unconditionally include in API requests. By default, fields with
  4850. // empty values are omitted from API requests. However, any non-pointer,
  4851. // non-interface field appearing in ForceSendFields will be sent to the
  4852. // server regardless of whether the field is empty or not. This may be
  4853. // used to include empty fields in Patch requests.
  4854. ForceSendFields []string `json:"-"`
  4855. // NullFields is a list of field names (e.g. "Exclusions") to include in
  4856. // API requests with the JSON null value. By default, fields with empty
  4857. // values are omitted from API requests. However, any field with an
  4858. // empty value appearing in NullFields will be sent to the server as
  4859. // null. It is an error if a field in this list has a non-empty value.
  4860. // This may be used to include null fields in Patch requests.
  4861. NullFields []string `json:"-"`
  4862. }
  4863. func (s *TargetingCriteria) MarshalJSON() ([]byte, error) {
  4864. type NoMethod TargetingCriteria
  4865. raw := NoMethod(*s)
  4866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4867. }
  4868. // TargetingValue: A polymorphic targeting value used as part of Shared
  4869. // Targeting.
  4870. type TargetingValue struct {
  4871. // CreativeSizeValue: The creative size value to include/exclude.
  4872. // Filled in when key = GOOG_CREATIVE_SIZE
  4873. CreativeSizeValue *CreativeSize `json:"creativeSizeValue,omitempty"`
  4874. // DayPartTargetingValue: The daypart targeting to include /
  4875. // exclude.
  4876. // Filled in when the key is GOOG_DAYPART_TARGETING.
  4877. // The definition of this targeting is derived from the structure
  4878. // used by Ad Manager.
  4879. DayPartTargetingValue *DayPartTargeting `json:"dayPartTargetingValue,omitempty"`
  4880. // LongValue: The long value to include/exclude.
  4881. LongValue int64 `json:"longValue,omitempty,string"`
  4882. // StringValue: The string value to include/exclude.
  4883. StringValue string `json:"stringValue,omitempty"`
  4884. // ForceSendFields is a list of field names (e.g. "CreativeSizeValue")
  4885. // to unconditionally include in API requests. By default, fields with
  4886. // empty values are omitted from API requests. However, any non-pointer,
  4887. // non-interface field appearing in ForceSendFields will be sent to the
  4888. // server regardless of whether the field is empty or not. This may be
  4889. // used to include empty fields in Patch requests.
  4890. ForceSendFields []string `json:"-"`
  4891. // NullFields is a list of field names (e.g. "CreativeSizeValue") to
  4892. // include in API requests with the JSON null value. By default, fields
  4893. // with empty values are omitted from API requests. However, any field
  4894. // with an empty value appearing in NullFields will be sent to the
  4895. // server as null. It is an error if a field in this list has a
  4896. // non-empty value. This may be used to include null fields in Patch
  4897. // requests.
  4898. NullFields []string `json:"-"`
  4899. }
  4900. func (s *TargetingValue) MarshalJSON() ([]byte, error) {
  4901. type NoMethod TargetingValue
  4902. raw := NoMethod(*s)
  4903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4904. }
  4905. // TechnologyTargeting: Represents targeting about various types of
  4906. // technology.
  4907. type TechnologyTargeting struct {
  4908. // DeviceCapabilityTargeting: IDs of device capabilities to be
  4909. // included/excluded.
  4910. DeviceCapabilityTargeting *CriteriaTargeting `json:"deviceCapabilityTargeting,omitempty"`
  4911. // DeviceCategoryTargeting: IDs of device categories to be
  4912. // included/excluded.
  4913. DeviceCategoryTargeting *CriteriaTargeting `json:"deviceCategoryTargeting,omitempty"`
  4914. // OperatingSystemTargeting: Operating system related targeting
  4915. // information.
  4916. OperatingSystemTargeting *OperatingSystemTargeting `json:"operatingSystemTargeting,omitempty"`
  4917. // ForceSendFields is a list of field names (e.g.
  4918. // "DeviceCapabilityTargeting") to unconditionally include in API
  4919. // requests. By default, fields with empty values are omitted from API
  4920. // requests. However, any non-pointer, non-interface field appearing in
  4921. // ForceSendFields will be sent to the server regardless of whether the
  4922. // field is empty or not. This may be used to include empty fields in
  4923. // Patch requests.
  4924. ForceSendFields []string `json:"-"`
  4925. // NullFields is a list of field names (e.g.
  4926. // "DeviceCapabilityTargeting") to include in API requests with the JSON
  4927. // null value. By default, fields with empty values are omitted from API
  4928. // requests. However, any field with an empty value appearing in
  4929. // NullFields will be sent to the server as null. It is an error if a
  4930. // field in this list has a non-empty value. This may be used to include
  4931. // null fields in Patch requests.
  4932. NullFields []string `json:"-"`
  4933. }
  4934. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  4935. type NoMethod TechnologyTargeting
  4936. raw := NoMethod(*s)
  4937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4938. }
  4939. // TimeInterval: An interval of time, with an absolute start and end.
  4940. type TimeInterval struct {
  4941. // EndTime: The timestamp marking the end of the range (exclusive) for
  4942. // which data is
  4943. // included.
  4944. EndTime string `json:"endTime,omitempty"`
  4945. // StartTime: The timestamp marking the start of the range (inclusive)
  4946. // for which data is
  4947. // included.
  4948. StartTime string `json:"startTime,omitempty"`
  4949. // ForceSendFields is a list of field names (e.g. "EndTime") to
  4950. // unconditionally include in API requests. By default, fields with
  4951. // empty values are omitted from API requests. However, any non-pointer,
  4952. // non-interface field appearing in ForceSendFields will be sent to the
  4953. // server regardless of whether the field is empty or not. This may be
  4954. // used to include empty fields in Patch requests.
  4955. ForceSendFields []string `json:"-"`
  4956. // NullFields is a list of field names (e.g. "EndTime") to include in
  4957. // API requests with the JSON null value. By default, fields with empty
  4958. // values are omitted from API requests. However, any field with an
  4959. // empty value appearing in NullFields will be sent to the server as
  4960. // null. It is an error if a field in this list has a non-empty value.
  4961. // This may be used to include null fields in Patch requests.
  4962. NullFields []string `json:"-"`
  4963. }
  4964. func (s *TimeInterval) MarshalJSON() ([]byte, error) {
  4965. type NoMethod TimeInterval
  4966. raw := NoMethod(*s)
  4967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4968. }
  4969. // TimeOfDay: Represents a time of day. The date and time zone are
  4970. // either not significant
  4971. // or are specified elsewhere. An API may choose to allow leap seconds.
  4972. // Related
  4973. // types are google.type.Date and `google.protobuf.Timestamp`.
  4974. type TimeOfDay struct {
  4975. // Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API
  4976. // may choose
  4977. // to allow the value "24:00:00" for scenarios like business closing
  4978. // time.
  4979. Hours int64 `json:"hours,omitempty"`
  4980. // Minutes: Minutes of hour of day. Must be from 0 to 59.
  4981. Minutes int64 `json:"minutes,omitempty"`
  4982. // Nanos: Fractions of seconds in nanoseconds. Must be from 0 to
  4983. // 999,999,999.
  4984. Nanos int64 `json:"nanos,omitempty"`
  4985. // Seconds: Seconds of minutes of the time. Must normally be from 0 to
  4986. // 59. An API may
  4987. // allow the value 60 if it allows leap-seconds.
  4988. Seconds int64 `json:"seconds,omitempty"`
  4989. // ForceSendFields is a list of field names (e.g. "Hours") to
  4990. // unconditionally include in API requests. By default, fields with
  4991. // empty values are omitted from API requests. However, any non-pointer,
  4992. // non-interface field appearing in ForceSendFields will be sent to the
  4993. // server regardless of whether the field is empty or not. This may be
  4994. // used to include empty fields in Patch requests.
  4995. ForceSendFields []string `json:"-"`
  4996. // NullFields is a list of field names (e.g. "Hours") to include in API
  4997. // requests with the JSON null value. By default, fields with empty
  4998. // values are omitted from API requests. However, any field with an
  4999. // empty value appearing in NullFields will be sent to the server as
  5000. // null. It is an error if a field in this list has a non-empty value.
  5001. // This may be used to include null fields in Patch requests.
  5002. NullFields []string `json:"-"`
  5003. }
  5004. func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
  5005. type NoMethod TimeOfDay
  5006. raw := NoMethod(*s)
  5007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5008. }
  5009. // UrlTargeting: Represents a list of targeted and excluded URLs (e.g.,
  5010. // google.com).
  5011. // For Private Auction and AdX Preferred Deals, URLs are either included
  5012. // or
  5013. // excluded.
  5014. // For Programmatic Guaranteed and Preferred Deals, this doesn't
  5015. // apply.
  5016. type UrlTargeting struct {
  5017. // ExcludedUrls: A list of URLs to be excluded.
  5018. ExcludedUrls []string `json:"excludedUrls,omitempty"`
  5019. // TargetedUrls: A list of URLs to be included.
  5020. TargetedUrls []string `json:"targetedUrls,omitempty"`
  5021. // ForceSendFields is a list of field names (e.g. "ExcludedUrls") to
  5022. // unconditionally include in API requests. By default, fields with
  5023. // empty values are omitted from API requests. However, any non-pointer,
  5024. // non-interface field appearing in ForceSendFields will be sent to the
  5025. // server regardless of whether the field is empty or not. This may be
  5026. // used to include empty fields in Patch requests.
  5027. ForceSendFields []string `json:"-"`
  5028. // NullFields is a list of field names (e.g. "ExcludedUrls") to include
  5029. // in API requests with the JSON null value. By default, fields with
  5030. // empty values are omitted from API requests. However, any field with
  5031. // an empty value appearing in NullFields will be sent to the server as
  5032. // null. It is an error if a field in this list has a non-empty value.
  5033. // This may be used to include null fields in Patch requests.
  5034. NullFields []string `json:"-"`
  5035. }
  5036. func (s *UrlTargeting) MarshalJSON() ([]byte, error) {
  5037. type NoMethod UrlTargeting
  5038. raw := NoMethod(*s)
  5039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5040. }
  5041. // VideoContent: Video content for a creative.
  5042. type VideoContent struct {
  5043. // VideoUrl: The URL to fetch a video ad.
  5044. VideoUrl string `json:"videoUrl,omitempty"`
  5045. // VideoVastXml: The contents of a VAST document for a video ad.
  5046. // This document should conform to the VAST 2.0 or 3.0 standard.
  5047. VideoVastXml string `json:"videoVastXml,omitempty"`
  5048. // ForceSendFields is a list of field names (e.g. "VideoUrl") to
  5049. // unconditionally include in API requests. By default, fields with
  5050. // empty values are omitted from API requests. However, any non-pointer,
  5051. // non-interface field appearing in ForceSendFields will be sent to the
  5052. // server regardless of whether the field is empty or not. This may be
  5053. // used to include empty fields in Patch requests.
  5054. ForceSendFields []string `json:"-"`
  5055. // NullFields is a list of field names (e.g. "VideoUrl") to include in
  5056. // API requests with the JSON null value. By default, fields with empty
  5057. // values are omitted from API requests. However, any field with an
  5058. // empty value appearing in NullFields will be sent to the server as
  5059. // null. It is an error if a field in this list has a non-empty value.
  5060. // This may be used to include null fields in Patch requests.
  5061. NullFields []string `json:"-"`
  5062. }
  5063. func (s *VideoContent) MarshalJSON() ([]byte, error) {
  5064. type NoMethod VideoContent
  5065. raw := NoMethod(*s)
  5066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5067. }
  5068. // VideoTargeting: Represents targeting information about video.
  5069. type VideoTargeting struct {
  5070. // ExcludedPositionTypes: A list of video positions to be
  5071. // excluded.
  5072. // Position types can either be included or excluded (XOR).
  5073. //
  5074. // Possible values:
  5075. // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video
  5076. // position.
  5077. // "PREROLL" - Ad is played before the video.
  5078. // "MIDROLL" - Ad is played during the video.
  5079. // "POSTROLL" - Ad is played after the video.
  5080. ExcludedPositionTypes []string `json:"excludedPositionTypes,omitempty"`
  5081. // TargetedPositionTypes: A list of video positions to be included.
  5082. // When the included list is present, the excluded list must be
  5083. // empty.
  5084. // When the excluded list is present, the included list must be empty.
  5085. //
  5086. // Possible values:
  5087. // "POSITION_TYPE_UNSPECIFIED" - A placeholder for an undefined video
  5088. // position.
  5089. // "PREROLL" - Ad is played before the video.
  5090. // "MIDROLL" - Ad is played during the video.
  5091. // "POSTROLL" - Ad is played after the video.
  5092. TargetedPositionTypes []string `json:"targetedPositionTypes,omitempty"`
  5093. // ForceSendFields is a list of field names (e.g.
  5094. // "ExcludedPositionTypes") to unconditionally include in API requests.
  5095. // By default, fields with empty values are omitted from API requests.
  5096. // However, any non-pointer, non-interface field appearing in
  5097. // ForceSendFields will be sent to the server regardless of whether the
  5098. // field is empty or not. This may be used to include empty fields in
  5099. // Patch requests.
  5100. ForceSendFields []string `json:"-"`
  5101. // NullFields is a list of field names (e.g. "ExcludedPositionTypes") to
  5102. // include in API requests with the JSON null value. By default, fields
  5103. // with empty values are omitted from API requests. However, any field
  5104. // with an empty value appearing in NullFields will be sent to the
  5105. // server as null. It is an error if a field in this list has a
  5106. // non-empty value. This may be used to include null fields in Patch
  5107. // requests.
  5108. NullFields []string `json:"-"`
  5109. }
  5110. func (s *VideoTargeting) MarshalJSON() ([]byte, error) {
  5111. type NoMethod VideoTargeting
  5112. raw := NoMethod(*s)
  5113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5114. }
  5115. // WatchCreativeRequest: A request for watching changes to creative
  5116. // Status.
  5117. type WatchCreativeRequest struct {
  5118. // Topic: The Pub/Sub topic to publish notifications to.
  5119. // This topic must already exist and must give permission
  5120. // to
  5121. // ad-exchange-buyside-reports@google.com to write to the topic.
  5122. // This should be the full resource name
  5123. // in
  5124. // "projects/{project_id}/topics/{topic_id}" format.
  5125. Topic string `json:"topic,omitempty"`
  5126. // ForceSendFields is a list of field names (e.g. "Topic") to
  5127. // unconditionally include in API requests. By default, fields with
  5128. // empty values are omitted from API requests. However, any non-pointer,
  5129. // non-interface field appearing in ForceSendFields will be sent to the
  5130. // server regardless of whether the field is empty or not. This may be
  5131. // used to include empty fields in Patch requests.
  5132. ForceSendFields []string `json:"-"`
  5133. // NullFields is a list of field names (e.g. "Topic") to include in API
  5134. // requests with the JSON null value. By default, fields with empty
  5135. // values are omitted from API requests. However, any field with an
  5136. // empty value appearing in NullFields will be sent to the server as
  5137. // null. It is an error if a field in this list has a non-empty value.
  5138. // This may be used to include null fields in Patch requests.
  5139. NullFields []string `json:"-"`
  5140. }
  5141. func (s *WatchCreativeRequest) MarshalJSON() ([]byte, error) {
  5142. type NoMethod WatchCreativeRequest
  5143. raw := NoMethod(*s)
  5144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5145. }
  5146. // method id "adexchangebuyer2.accounts.clients.create":
  5147. type AccountsClientsCreateCall struct {
  5148. s *Service
  5149. accountId int64
  5150. client *Client
  5151. urlParams_ gensupport.URLParams
  5152. ctx_ context.Context
  5153. header_ http.Header
  5154. }
  5155. // Create: Creates a new client buyer.
  5156. func (r *AccountsClientsService) Create(accountId int64, client *Client) *AccountsClientsCreateCall {
  5157. c := &AccountsClientsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5158. c.accountId = accountId
  5159. c.client = client
  5160. return c
  5161. }
  5162. // Fields allows partial responses to be retrieved. See
  5163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5164. // for more information.
  5165. func (c *AccountsClientsCreateCall) Fields(s ...googleapi.Field) *AccountsClientsCreateCall {
  5166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5167. return c
  5168. }
  5169. // Context sets the context to be used in this call's Do method. Any
  5170. // pending HTTP request will be aborted if the provided context is
  5171. // canceled.
  5172. func (c *AccountsClientsCreateCall) Context(ctx context.Context) *AccountsClientsCreateCall {
  5173. c.ctx_ = ctx
  5174. return c
  5175. }
  5176. // Header returns an http.Header that can be modified by the caller to
  5177. // add HTTP headers to the request.
  5178. func (c *AccountsClientsCreateCall) Header() http.Header {
  5179. if c.header_ == nil {
  5180. c.header_ = make(http.Header)
  5181. }
  5182. return c.header_
  5183. }
  5184. func (c *AccountsClientsCreateCall) doRequest(alt string) (*http.Response, error) {
  5185. reqHeaders := make(http.Header)
  5186. for k, v := range c.header_ {
  5187. reqHeaders[k] = v
  5188. }
  5189. reqHeaders.Set("User-Agent", c.s.userAgent())
  5190. var body io.Reader = nil
  5191. body, err := googleapi.WithoutDataWrapper.JSONReader(c.client)
  5192. if err != nil {
  5193. return nil, err
  5194. }
  5195. reqHeaders.Set("Content-Type", "application/json")
  5196. c.urlParams_.Set("alt", alt)
  5197. c.urlParams_.Set("prettyPrint", "false")
  5198. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients")
  5199. urls += "?" + c.urlParams_.Encode()
  5200. req, err := http.NewRequest("POST", urls, body)
  5201. if err != nil {
  5202. return nil, err
  5203. }
  5204. req.Header = reqHeaders
  5205. googleapi.Expand(req.URL, map[string]string{
  5206. "accountId": strconv.FormatInt(c.accountId, 10),
  5207. })
  5208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5209. }
  5210. // Do executes the "adexchangebuyer2.accounts.clients.create" call.
  5211. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  5212. // code is an error. Response headers are in either
  5213. // *Client.ServerResponse.Header or (if a response was returned at all)
  5214. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5215. // check whether the returned error was because http.StatusNotModified
  5216. // was returned.
  5217. func (c *AccountsClientsCreateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  5218. gensupport.SetOptions(c.urlParams_, opts...)
  5219. res, err := c.doRequest("json")
  5220. if res != nil && res.StatusCode == http.StatusNotModified {
  5221. if res.Body != nil {
  5222. res.Body.Close()
  5223. }
  5224. return nil, &googleapi.Error{
  5225. Code: res.StatusCode,
  5226. Header: res.Header,
  5227. }
  5228. }
  5229. if err != nil {
  5230. return nil, err
  5231. }
  5232. defer googleapi.CloseBody(res)
  5233. if err := googleapi.CheckResponse(res); err != nil {
  5234. return nil, err
  5235. }
  5236. ret := &Client{
  5237. ServerResponse: googleapi.ServerResponse{
  5238. Header: res.Header,
  5239. HTTPStatusCode: res.StatusCode,
  5240. },
  5241. }
  5242. target := &ret
  5243. if err := gensupport.DecodeResponse(target, res); err != nil {
  5244. return nil, err
  5245. }
  5246. return ret, nil
  5247. // {
  5248. // "description": "Creates a new client buyer.",
  5249. // "flatPath": "v2beta1/accounts/{accountId}/clients",
  5250. // "httpMethod": "POST",
  5251. // "id": "adexchangebuyer2.accounts.clients.create",
  5252. // "parameterOrder": [
  5253. // "accountId"
  5254. // ],
  5255. // "parameters": {
  5256. // "accountId": {
  5257. // "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)",
  5258. // "format": "int64",
  5259. // "location": "path",
  5260. // "required": true,
  5261. // "type": "string"
  5262. // }
  5263. // },
  5264. // "path": "v2beta1/accounts/{accountId}/clients",
  5265. // "request": {
  5266. // "$ref": "Client"
  5267. // },
  5268. // "response": {
  5269. // "$ref": "Client"
  5270. // },
  5271. // "scopes": [
  5272. // "https://www.googleapis.com/auth/adexchange.buyer"
  5273. // ]
  5274. // }
  5275. }
  5276. // method id "adexchangebuyer2.accounts.clients.get":
  5277. type AccountsClientsGetCall struct {
  5278. s *Service
  5279. accountId int64
  5280. clientAccountId int64
  5281. urlParams_ gensupport.URLParams
  5282. ifNoneMatch_ string
  5283. ctx_ context.Context
  5284. header_ http.Header
  5285. }
  5286. // Get: Gets a client buyer with a given client account ID.
  5287. func (r *AccountsClientsService) Get(accountId int64, clientAccountId int64) *AccountsClientsGetCall {
  5288. c := &AccountsClientsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5289. c.accountId = accountId
  5290. c.clientAccountId = clientAccountId
  5291. return c
  5292. }
  5293. // Fields allows partial responses to be retrieved. See
  5294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5295. // for more information.
  5296. func (c *AccountsClientsGetCall) Fields(s ...googleapi.Field) *AccountsClientsGetCall {
  5297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5298. return c
  5299. }
  5300. // IfNoneMatch sets the optional parameter which makes the operation
  5301. // fail if the object's ETag matches the given value. This is useful for
  5302. // getting updates only after the object has changed since the last
  5303. // request. Use googleapi.IsNotModified to check whether the response
  5304. // error from Do is the result of In-None-Match.
  5305. func (c *AccountsClientsGetCall) IfNoneMatch(entityTag string) *AccountsClientsGetCall {
  5306. c.ifNoneMatch_ = entityTag
  5307. return c
  5308. }
  5309. // Context sets the context to be used in this call's Do method. Any
  5310. // pending HTTP request will be aborted if the provided context is
  5311. // canceled.
  5312. func (c *AccountsClientsGetCall) Context(ctx context.Context) *AccountsClientsGetCall {
  5313. c.ctx_ = ctx
  5314. return c
  5315. }
  5316. // Header returns an http.Header that can be modified by the caller to
  5317. // add HTTP headers to the request.
  5318. func (c *AccountsClientsGetCall) Header() http.Header {
  5319. if c.header_ == nil {
  5320. c.header_ = make(http.Header)
  5321. }
  5322. return c.header_
  5323. }
  5324. func (c *AccountsClientsGetCall) doRequest(alt string) (*http.Response, error) {
  5325. reqHeaders := make(http.Header)
  5326. for k, v := range c.header_ {
  5327. reqHeaders[k] = v
  5328. }
  5329. reqHeaders.Set("User-Agent", c.s.userAgent())
  5330. if c.ifNoneMatch_ != "" {
  5331. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5332. }
  5333. var body io.Reader = nil
  5334. c.urlParams_.Set("alt", alt)
  5335. c.urlParams_.Set("prettyPrint", "false")
  5336. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}")
  5337. urls += "?" + c.urlParams_.Encode()
  5338. req, err := http.NewRequest("GET", urls, body)
  5339. if err != nil {
  5340. return nil, err
  5341. }
  5342. req.Header = reqHeaders
  5343. googleapi.Expand(req.URL, map[string]string{
  5344. "accountId": strconv.FormatInt(c.accountId, 10),
  5345. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  5346. })
  5347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5348. }
  5349. // Do executes the "adexchangebuyer2.accounts.clients.get" call.
  5350. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  5351. // code is an error. Response headers are in either
  5352. // *Client.ServerResponse.Header or (if a response was returned at all)
  5353. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5354. // check whether the returned error was because http.StatusNotModified
  5355. // was returned.
  5356. func (c *AccountsClientsGetCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  5357. gensupport.SetOptions(c.urlParams_, opts...)
  5358. res, err := c.doRequest("json")
  5359. if res != nil && res.StatusCode == http.StatusNotModified {
  5360. if res.Body != nil {
  5361. res.Body.Close()
  5362. }
  5363. return nil, &googleapi.Error{
  5364. Code: res.StatusCode,
  5365. Header: res.Header,
  5366. }
  5367. }
  5368. if err != nil {
  5369. return nil, err
  5370. }
  5371. defer googleapi.CloseBody(res)
  5372. if err := googleapi.CheckResponse(res); err != nil {
  5373. return nil, err
  5374. }
  5375. ret := &Client{
  5376. ServerResponse: googleapi.ServerResponse{
  5377. Header: res.Header,
  5378. HTTPStatusCode: res.StatusCode,
  5379. },
  5380. }
  5381. target := &ret
  5382. if err := gensupport.DecodeResponse(target, res); err != nil {
  5383. return nil, err
  5384. }
  5385. return ret, nil
  5386. // {
  5387. // "description": "Gets a client buyer with a given client account ID.",
  5388. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  5389. // "httpMethod": "GET",
  5390. // "id": "adexchangebuyer2.accounts.clients.get",
  5391. // "parameterOrder": [
  5392. // "accountId",
  5393. // "clientAccountId"
  5394. // ],
  5395. // "parameters": {
  5396. // "accountId": {
  5397. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  5398. // "format": "int64",
  5399. // "location": "path",
  5400. // "required": true,
  5401. // "type": "string"
  5402. // },
  5403. // "clientAccountId": {
  5404. // "description": "Numerical account ID of the client buyer to retrieve. (required)",
  5405. // "format": "int64",
  5406. // "location": "path",
  5407. // "required": true,
  5408. // "type": "string"
  5409. // }
  5410. // },
  5411. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  5412. // "response": {
  5413. // "$ref": "Client"
  5414. // },
  5415. // "scopes": [
  5416. // "https://www.googleapis.com/auth/adexchange.buyer"
  5417. // ]
  5418. // }
  5419. }
  5420. // method id "adexchangebuyer2.accounts.clients.list":
  5421. type AccountsClientsListCall struct {
  5422. s *Service
  5423. accountId int64
  5424. urlParams_ gensupport.URLParams
  5425. ifNoneMatch_ string
  5426. ctx_ context.Context
  5427. header_ http.Header
  5428. }
  5429. // List: Lists all the clients for the current sponsor buyer.
  5430. func (r *AccountsClientsService) List(accountId int64) *AccountsClientsListCall {
  5431. c := &AccountsClientsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5432. c.accountId = accountId
  5433. return c
  5434. }
  5435. // PageSize sets the optional parameter "pageSize": Requested page size.
  5436. // The server may return fewer clients than requested.
  5437. // If unspecified, the server will pick an appropriate default.
  5438. func (c *AccountsClientsListCall) PageSize(pageSize int64) *AccountsClientsListCall {
  5439. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5440. return c
  5441. }
  5442. // PageToken sets the optional parameter "pageToken": A token
  5443. // identifying a page of results the server should return.
  5444. // Typically, this is the value
  5445. // of
  5446. // ListClientsResponse.nextPageToken
  5447. // returned from the previous call to the
  5448. // accounts.clients.list
  5449. // method.
  5450. func (c *AccountsClientsListCall) PageToken(pageToken string) *AccountsClientsListCall {
  5451. c.urlParams_.Set("pageToken", pageToken)
  5452. return c
  5453. }
  5454. // PartnerClientId sets the optional parameter "partnerClientId":
  5455. // Optional unique identifier (from the standpoint of an Ad Exchange
  5456. // sponsor
  5457. // buyer partner) of the client to return.
  5458. // If specified, at most one client will be returned in the response.
  5459. func (c *AccountsClientsListCall) PartnerClientId(partnerClientId string) *AccountsClientsListCall {
  5460. c.urlParams_.Set("partnerClientId", partnerClientId)
  5461. return c
  5462. }
  5463. // Fields allows partial responses to be retrieved. See
  5464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5465. // for more information.
  5466. func (c *AccountsClientsListCall) Fields(s ...googleapi.Field) *AccountsClientsListCall {
  5467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5468. return c
  5469. }
  5470. // IfNoneMatch sets the optional parameter which makes the operation
  5471. // fail if the object's ETag matches the given value. This is useful for
  5472. // getting updates only after the object has changed since the last
  5473. // request. Use googleapi.IsNotModified to check whether the response
  5474. // error from Do is the result of In-None-Match.
  5475. func (c *AccountsClientsListCall) IfNoneMatch(entityTag string) *AccountsClientsListCall {
  5476. c.ifNoneMatch_ = entityTag
  5477. return c
  5478. }
  5479. // Context sets the context to be used in this call's Do method. Any
  5480. // pending HTTP request will be aborted if the provided context is
  5481. // canceled.
  5482. func (c *AccountsClientsListCall) Context(ctx context.Context) *AccountsClientsListCall {
  5483. c.ctx_ = ctx
  5484. return c
  5485. }
  5486. // Header returns an http.Header that can be modified by the caller to
  5487. // add HTTP headers to the request.
  5488. func (c *AccountsClientsListCall) Header() http.Header {
  5489. if c.header_ == nil {
  5490. c.header_ = make(http.Header)
  5491. }
  5492. return c.header_
  5493. }
  5494. func (c *AccountsClientsListCall) doRequest(alt string) (*http.Response, error) {
  5495. reqHeaders := make(http.Header)
  5496. for k, v := range c.header_ {
  5497. reqHeaders[k] = v
  5498. }
  5499. reqHeaders.Set("User-Agent", c.s.userAgent())
  5500. if c.ifNoneMatch_ != "" {
  5501. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5502. }
  5503. var body io.Reader = nil
  5504. c.urlParams_.Set("alt", alt)
  5505. c.urlParams_.Set("prettyPrint", "false")
  5506. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients")
  5507. urls += "?" + c.urlParams_.Encode()
  5508. req, err := http.NewRequest("GET", urls, body)
  5509. if err != nil {
  5510. return nil, err
  5511. }
  5512. req.Header = reqHeaders
  5513. googleapi.Expand(req.URL, map[string]string{
  5514. "accountId": strconv.FormatInt(c.accountId, 10),
  5515. })
  5516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5517. }
  5518. // Do executes the "adexchangebuyer2.accounts.clients.list" call.
  5519. // Exactly one of *ListClientsResponse or error will be non-nil. Any
  5520. // non-2xx status code is an error. Response headers are in either
  5521. // *ListClientsResponse.ServerResponse.Header or (if a response was
  5522. // returned at all) in error.(*googleapi.Error).Header. Use
  5523. // googleapi.IsNotModified to check whether the returned error was
  5524. // because http.StatusNotModified was returned.
  5525. func (c *AccountsClientsListCall) Do(opts ...googleapi.CallOption) (*ListClientsResponse, error) {
  5526. gensupport.SetOptions(c.urlParams_, opts...)
  5527. res, err := c.doRequest("json")
  5528. if res != nil && res.StatusCode == http.StatusNotModified {
  5529. if res.Body != nil {
  5530. res.Body.Close()
  5531. }
  5532. return nil, &googleapi.Error{
  5533. Code: res.StatusCode,
  5534. Header: res.Header,
  5535. }
  5536. }
  5537. if err != nil {
  5538. return nil, err
  5539. }
  5540. defer googleapi.CloseBody(res)
  5541. if err := googleapi.CheckResponse(res); err != nil {
  5542. return nil, err
  5543. }
  5544. ret := &ListClientsResponse{
  5545. ServerResponse: googleapi.ServerResponse{
  5546. Header: res.Header,
  5547. HTTPStatusCode: res.StatusCode,
  5548. },
  5549. }
  5550. target := &ret
  5551. if err := gensupport.DecodeResponse(target, res); err != nil {
  5552. return nil, err
  5553. }
  5554. return ret, nil
  5555. // {
  5556. // "description": "Lists all the clients for the current sponsor buyer.",
  5557. // "flatPath": "v2beta1/accounts/{accountId}/clients",
  5558. // "httpMethod": "GET",
  5559. // "id": "adexchangebuyer2.accounts.clients.list",
  5560. // "parameterOrder": [
  5561. // "accountId"
  5562. // ],
  5563. // "parameters": {
  5564. // "accountId": {
  5565. // "description": "Unique numerical account ID of the sponsor buyer to list the clients for.",
  5566. // "format": "int64",
  5567. // "location": "path",
  5568. // "required": true,
  5569. // "type": "string"
  5570. // },
  5571. // "pageSize": {
  5572. // "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.",
  5573. // "format": "int32",
  5574. // "location": "query",
  5575. // "type": "integer"
  5576. // },
  5577. // "pageToken": {
  5578. // "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\nmethod.",
  5579. // "location": "query",
  5580. // "type": "string"
  5581. // },
  5582. // "partnerClientId": {
  5583. // "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.",
  5584. // "location": "query",
  5585. // "type": "string"
  5586. // }
  5587. // },
  5588. // "path": "v2beta1/accounts/{accountId}/clients",
  5589. // "response": {
  5590. // "$ref": "ListClientsResponse"
  5591. // },
  5592. // "scopes": [
  5593. // "https://www.googleapis.com/auth/adexchange.buyer"
  5594. // ]
  5595. // }
  5596. }
  5597. // Pages invokes f for each page of results.
  5598. // A non-nil error returned from f will halt the iteration.
  5599. // The provided context supersedes any context provided to the Context method.
  5600. func (c *AccountsClientsListCall) Pages(ctx context.Context, f func(*ListClientsResponse) error) error {
  5601. c.ctx_ = ctx
  5602. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5603. for {
  5604. x, err := c.Do()
  5605. if err != nil {
  5606. return err
  5607. }
  5608. if err := f(x); err != nil {
  5609. return err
  5610. }
  5611. if x.NextPageToken == "" {
  5612. return nil
  5613. }
  5614. c.PageToken(x.NextPageToken)
  5615. }
  5616. }
  5617. // method id "adexchangebuyer2.accounts.clients.update":
  5618. type AccountsClientsUpdateCall struct {
  5619. s *Service
  5620. accountId int64
  5621. clientAccountId int64
  5622. client *Client
  5623. urlParams_ gensupport.URLParams
  5624. ctx_ context.Context
  5625. header_ http.Header
  5626. }
  5627. // Update: Updates an existing client buyer.
  5628. func (r *AccountsClientsService) Update(accountId int64, clientAccountId int64, client *Client) *AccountsClientsUpdateCall {
  5629. c := &AccountsClientsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5630. c.accountId = accountId
  5631. c.clientAccountId = clientAccountId
  5632. c.client = client
  5633. return c
  5634. }
  5635. // Fields allows partial responses to be retrieved. See
  5636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5637. // for more information.
  5638. func (c *AccountsClientsUpdateCall) Fields(s ...googleapi.Field) *AccountsClientsUpdateCall {
  5639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5640. return c
  5641. }
  5642. // Context sets the context to be used in this call's Do method. Any
  5643. // pending HTTP request will be aborted if the provided context is
  5644. // canceled.
  5645. func (c *AccountsClientsUpdateCall) Context(ctx context.Context) *AccountsClientsUpdateCall {
  5646. c.ctx_ = ctx
  5647. return c
  5648. }
  5649. // Header returns an http.Header that can be modified by the caller to
  5650. // add HTTP headers to the request.
  5651. func (c *AccountsClientsUpdateCall) Header() http.Header {
  5652. if c.header_ == nil {
  5653. c.header_ = make(http.Header)
  5654. }
  5655. return c.header_
  5656. }
  5657. func (c *AccountsClientsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5658. reqHeaders := make(http.Header)
  5659. for k, v := range c.header_ {
  5660. reqHeaders[k] = v
  5661. }
  5662. reqHeaders.Set("User-Agent", c.s.userAgent())
  5663. var body io.Reader = nil
  5664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.client)
  5665. if err != nil {
  5666. return nil, err
  5667. }
  5668. reqHeaders.Set("Content-Type", "application/json")
  5669. c.urlParams_.Set("alt", alt)
  5670. c.urlParams_.Set("prettyPrint", "false")
  5671. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}")
  5672. urls += "?" + c.urlParams_.Encode()
  5673. req, err := http.NewRequest("PUT", urls, body)
  5674. if err != nil {
  5675. return nil, err
  5676. }
  5677. req.Header = reqHeaders
  5678. googleapi.Expand(req.URL, map[string]string{
  5679. "accountId": strconv.FormatInt(c.accountId, 10),
  5680. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  5681. })
  5682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5683. }
  5684. // Do executes the "adexchangebuyer2.accounts.clients.update" call.
  5685. // Exactly one of *Client or error will be non-nil. Any non-2xx status
  5686. // code is an error. Response headers are in either
  5687. // *Client.ServerResponse.Header or (if a response was returned at all)
  5688. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5689. // check whether the returned error was because http.StatusNotModified
  5690. // was returned.
  5691. func (c *AccountsClientsUpdateCall) Do(opts ...googleapi.CallOption) (*Client, error) {
  5692. gensupport.SetOptions(c.urlParams_, opts...)
  5693. res, err := c.doRequest("json")
  5694. if res != nil && res.StatusCode == http.StatusNotModified {
  5695. if res.Body != nil {
  5696. res.Body.Close()
  5697. }
  5698. return nil, &googleapi.Error{
  5699. Code: res.StatusCode,
  5700. Header: res.Header,
  5701. }
  5702. }
  5703. if err != nil {
  5704. return nil, err
  5705. }
  5706. defer googleapi.CloseBody(res)
  5707. if err := googleapi.CheckResponse(res); err != nil {
  5708. return nil, err
  5709. }
  5710. ret := &Client{
  5711. ServerResponse: googleapi.ServerResponse{
  5712. Header: res.Header,
  5713. HTTPStatusCode: res.StatusCode,
  5714. },
  5715. }
  5716. target := &ret
  5717. if err := gensupport.DecodeResponse(target, res); err != nil {
  5718. return nil, err
  5719. }
  5720. return ret, nil
  5721. // {
  5722. // "description": "Updates an existing client buyer.",
  5723. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  5724. // "httpMethod": "PUT",
  5725. // "id": "adexchangebuyer2.accounts.clients.update",
  5726. // "parameterOrder": [
  5727. // "accountId",
  5728. // "clientAccountId"
  5729. // ],
  5730. // "parameters": {
  5731. // "accountId": {
  5732. // "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)",
  5733. // "format": "int64",
  5734. // "location": "path",
  5735. // "required": true,
  5736. // "type": "string"
  5737. // },
  5738. // "clientAccountId": {
  5739. // "description": "Unique numerical account ID of the client to update. (required)",
  5740. // "format": "int64",
  5741. // "location": "path",
  5742. // "required": true,
  5743. // "type": "string"
  5744. // }
  5745. // },
  5746. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}",
  5747. // "request": {
  5748. // "$ref": "Client"
  5749. // },
  5750. // "response": {
  5751. // "$ref": "Client"
  5752. // },
  5753. // "scopes": [
  5754. // "https://www.googleapis.com/auth/adexchange.buyer"
  5755. // ]
  5756. // }
  5757. }
  5758. // method id "adexchangebuyer2.accounts.clients.invitations.create":
  5759. type AccountsClientsInvitationsCreateCall struct {
  5760. s *Service
  5761. accountId int64
  5762. clientAccountId int64
  5763. clientuserinvitation *ClientUserInvitation
  5764. urlParams_ gensupport.URLParams
  5765. ctx_ context.Context
  5766. header_ http.Header
  5767. }
  5768. // Create: Creates and sends out an email invitation to access
  5769. // an Ad Exchange client buyer account.
  5770. func (r *AccountsClientsInvitationsService) Create(accountId int64, clientAccountId int64, clientuserinvitation *ClientUserInvitation) *AccountsClientsInvitationsCreateCall {
  5771. c := &AccountsClientsInvitationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5772. c.accountId = accountId
  5773. c.clientAccountId = clientAccountId
  5774. c.clientuserinvitation = clientuserinvitation
  5775. return c
  5776. }
  5777. // Fields allows partial responses to be retrieved. See
  5778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5779. // for more information.
  5780. func (c *AccountsClientsInvitationsCreateCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsCreateCall {
  5781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5782. return c
  5783. }
  5784. // Context sets the context to be used in this call's Do method. Any
  5785. // pending HTTP request will be aborted if the provided context is
  5786. // canceled.
  5787. func (c *AccountsClientsInvitationsCreateCall) Context(ctx context.Context) *AccountsClientsInvitationsCreateCall {
  5788. c.ctx_ = ctx
  5789. return c
  5790. }
  5791. // Header returns an http.Header that can be modified by the caller to
  5792. // add HTTP headers to the request.
  5793. func (c *AccountsClientsInvitationsCreateCall) Header() http.Header {
  5794. if c.header_ == nil {
  5795. c.header_ = make(http.Header)
  5796. }
  5797. return c.header_
  5798. }
  5799. func (c *AccountsClientsInvitationsCreateCall) doRequest(alt string) (*http.Response, error) {
  5800. reqHeaders := make(http.Header)
  5801. for k, v := range c.header_ {
  5802. reqHeaders[k] = v
  5803. }
  5804. reqHeaders.Set("User-Agent", c.s.userAgent())
  5805. var body io.Reader = nil
  5806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuserinvitation)
  5807. if err != nil {
  5808. return nil, err
  5809. }
  5810. reqHeaders.Set("Content-Type", "application/json")
  5811. c.urlParams_.Set("alt", alt)
  5812. c.urlParams_.Set("prettyPrint", "false")
  5813. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations")
  5814. urls += "?" + c.urlParams_.Encode()
  5815. req, err := http.NewRequest("POST", urls, body)
  5816. if err != nil {
  5817. return nil, err
  5818. }
  5819. req.Header = reqHeaders
  5820. googleapi.Expand(req.URL, map[string]string{
  5821. "accountId": strconv.FormatInt(c.accountId, 10),
  5822. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  5823. })
  5824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5825. }
  5826. // Do executes the "adexchangebuyer2.accounts.clients.invitations.create" call.
  5827. // Exactly one of *ClientUserInvitation or error will be non-nil. Any
  5828. // non-2xx status code is an error. Response headers are in either
  5829. // *ClientUserInvitation.ServerResponse.Header or (if a response was
  5830. // returned at all) in error.(*googleapi.Error).Header. Use
  5831. // googleapi.IsNotModified to check whether the returned error was
  5832. // because http.StatusNotModified was returned.
  5833. func (c *AccountsClientsInvitationsCreateCall) Do(opts ...googleapi.CallOption) (*ClientUserInvitation, error) {
  5834. gensupport.SetOptions(c.urlParams_, opts...)
  5835. res, err := c.doRequest("json")
  5836. if res != nil && res.StatusCode == http.StatusNotModified {
  5837. if res.Body != nil {
  5838. res.Body.Close()
  5839. }
  5840. return nil, &googleapi.Error{
  5841. Code: res.StatusCode,
  5842. Header: res.Header,
  5843. }
  5844. }
  5845. if err != nil {
  5846. return nil, err
  5847. }
  5848. defer googleapi.CloseBody(res)
  5849. if err := googleapi.CheckResponse(res); err != nil {
  5850. return nil, err
  5851. }
  5852. ret := &ClientUserInvitation{
  5853. ServerResponse: googleapi.ServerResponse{
  5854. Header: res.Header,
  5855. HTTPStatusCode: res.StatusCode,
  5856. },
  5857. }
  5858. target := &ret
  5859. if err := gensupport.DecodeResponse(target, res); err != nil {
  5860. return nil, err
  5861. }
  5862. return ret, nil
  5863. // {
  5864. // "description": "Creates and sends out an email invitation to access\nan Ad Exchange client buyer account.",
  5865. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  5866. // "httpMethod": "POST",
  5867. // "id": "adexchangebuyer2.accounts.clients.invitations.create",
  5868. // "parameterOrder": [
  5869. // "accountId",
  5870. // "clientAccountId"
  5871. // ],
  5872. // "parameters": {
  5873. // "accountId": {
  5874. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  5875. // "format": "int64",
  5876. // "location": "path",
  5877. // "required": true,
  5878. // "type": "string"
  5879. // },
  5880. // "clientAccountId": {
  5881. // "description": "Numerical account ID of the client buyer that the user\nshould be associated with. (required)",
  5882. // "format": "int64",
  5883. // "location": "path",
  5884. // "required": true,
  5885. // "type": "string"
  5886. // }
  5887. // },
  5888. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  5889. // "request": {
  5890. // "$ref": "ClientUserInvitation"
  5891. // },
  5892. // "response": {
  5893. // "$ref": "ClientUserInvitation"
  5894. // },
  5895. // "scopes": [
  5896. // "https://www.googleapis.com/auth/adexchange.buyer"
  5897. // ]
  5898. // }
  5899. }
  5900. // method id "adexchangebuyer2.accounts.clients.invitations.get":
  5901. type AccountsClientsInvitationsGetCall struct {
  5902. s *Service
  5903. accountId int64
  5904. clientAccountId int64
  5905. invitationId int64
  5906. urlParams_ gensupport.URLParams
  5907. ifNoneMatch_ string
  5908. ctx_ context.Context
  5909. header_ http.Header
  5910. }
  5911. // Get: Retrieves an existing client user invitation.
  5912. func (r *AccountsClientsInvitationsService) Get(accountId int64, clientAccountId int64, invitationId int64) *AccountsClientsInvitationsGetCall {
  5913. c := &AccountsClientsInvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5914. c.accountId = accountId
  5915. c.clientAccountId = clientAccountId
  5916. c.invitationId = invitationId
  5917. return c
  5918. }
  5919. // Fields allows partial responses to be retrieved. See
  5920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5921. // for more information.
  5922. func (c *AccountsClientsInvitationsGetCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsGetCall {
  5923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5924. return c
  5925. }
  5926. // IfNoneMatch sets the optional parameter which makes the operation
  5927. // fail if the object's ETag matches the given value. This is useful for
  5928. // getting updates only after the object has changed since the last
  5929. // request. Use googleapi.IsNotModified to check whether the response
  5930. // error from Do is the result of In-None-Match.
  5931. func (c *AccountsClientsInvitationsGetCall) IfNoneMatch(entityTag string) *AccountsClientsInvitationsGetCall {
  5932. c.ifNoneMatch_ = entityTag
  5933. return c
  5934. }
  5935. // Context sets the context to be used in this call's Do method. Any
  5936. // pending HTTP request will be aborted if the provided context is
  5937. // canceled.
  5938. func (c *AccountsClientsInvitationsGetCall) Context(ctx context.Context) *AccountsClientsInvitationsGetCall {
  5939. c.ctx_ = ctx
  5940. return c
  5941. }
  5942. // Header returns an http.Header that can be modified by the caller to
  5943. // add HTTP headers to the request.
  5944. func (c *AccountsClientsInvitationsGetCall) Header() http.Header {
  5945. if c.header_ == nil {
  5946. c.header_ = make(http.Header)
  5947. }
  5948. return c.header_
  5949. }
  5950. func (c *AccountsClientsInvitationsGetCall) doRequest(alt string) (*http.Response, error) {
  5951. reqHeaders := make(http.Header)
  5952. for k, v := range c.header_ {
  5953. reqHeaders[k] = v
  5954. }
  5955. reqHeaders.Set("User-Agent", c.s.userAgent())
  5956. if c.ifNoneMatch_ != "" {
  5957. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5958. }
  5959. var body io.Reader = nil
  5960. c.urlParams_.Set("alt", alt)
  5961. c.urlParams_.Set("prettyPrint", "false")
  5962. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}")
  5963. urls += "?" + c.urlParams_.Encode()
  5964. req, err := http.NewRequest("GET", urls, body)
  5965. if err != nil {
  5966. return nil, err
  5967. }
  5968. req.Header = reqHeaders
  5969. googleapi.Expand(req.URL, map[string]string{
  5970. "accountId": strconv.FormatInt(c.accountId, 10),
  5971. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  5972. "invitationId": strconv.FormatInt(c.invitationId, 10),
  5973. })
  5974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5975. }
  5976. // Do executes the "adexchangebuyer2.accounts.clients.invitations.get" call.
  5977. // Exactly one of *ClientUserInvitation or error will be non-nil. Any
  5978. // non-2xx status code is an error. Response headers are in either
  5979. // *ClientUserInvitation.ServerResponse.Header or (if a response was
  5980. // returned at all) in error.(*googleapi.Error).Header. Use
  5981. // googleapi.IsNotModified to check whether the returned error was
  5982. // because http.StatusNotModified was returned.
  5983. func (c *AccountsClientsInvitationsGetCall) Do(opts ...googleapi.CallOption) (*ClientUserInvitation, error) {
  5984. gensupport.SetOptions(c.urlParams_, opts...)
  5985. res, err := c.doRequest("json")
  5986. if res != nil && res.StatusCode == http.StatusNotModified {
  5987. if res.Body != nil {
  5988. res.Body.Close()
  5989. }
  5990. return nil, &googleapi.Error{
  5991. Code: res.StatusCode,
  5992. Header: res.Header,
  5993. }
  5994. }
  5995. if err != nil {
  5996. return nil, err
  5997. }
  5998. defer googleapi.CloseBody(res)
  5999. if err := googleapi.CheckResponse(res); err != nil {
  6000. return nil, err
  6001. }
  6002. ret := &ClientUserInvitation{
  6003. ServerResponse: googleapi.ServerResponse{
  6004. Header: res.Header,
  6005. HTTPStatusCode: res.StatusCode,
  6006. },
  6007. }
  6008. target := &ret
  6009. if err := gensupport.DecodeResponse(target, res); err != nil {
  6010. return nil, err
  6011. }
  6012. return ret, nil
  6013. // {
  6014. // "description": "Retrieves an existing client user invitation.",
  6015. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}",
  6016. // "httpMethod": "GET",
  6017. // "id": "adexchangebuyer2.accounts.clients.invitations.get",
  6018. // "parameterOrder": [
  6019. // "accountId",
  6020. // "clientAccountId",
  6021. // "invitationId"
  6022. // ],
  6023. // "parameters": {
  6024. // "accountId": {
  6025. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  6026. // "format": "int64",
  6027. // "location": "path",
  6028. // "required": true,
  6029. // "type": "string"
  6030. // },
  6031. // "clientAccountId": {
  6032. // "description": "Numerical account ID of the client buyer that the user invitation\nto be retrieved is associated with. (required)",
  6033. // "format": "int64",
  6034. // "location": "path",
  6035. // "required": true,
  6036. // "type": "string"
  6037. // },
  6038. // "invitationId": {
  6039. // "description": "Numerical identifier of the user invitation to retrieve. (required)",
  6040. // "format": "int64",
  6041. // "location": "path",
  6042. // "required": true,
  6043. // "type": "string"
  6044. // }
  6045. // },
  6046. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}",
  6047. // "response": {
  6048. // "$ref": "ClientUserInvitation"
  6049. // },
  6050. // "scopes": [
  6051. // "https://www.googleapis.com/auth/adexchange.buyer"
  6052. // ]
  6053. // }
  6054. }
  6055. // method id "adexchangebuyer2.accounts.clients.invitations.list":
  6056. type AccountsClientsInvitationsListCall struct {
  6057. s *Service
  6058. accountId int64
  6059. clientAccountId string
  6060. urlParams_ gensupport.URLParams
  6061. ifNoneMatch_ string
  6062. ctx_ context.Context
  6063. header_ http.Header
  6064. }
  6065. // List: Lists all the client users invitations for a client
  6066. // with a given account ID.
  6067. func (r *AccountsClientsInvitationsService) List(accountId int64, clientAccountId string) *AccountsClientsInvitationsListCall {
  6068. c := &AccountsClientsInvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6069. c.accountId = accountId
  6070. c.clientAccountId = clientAccountId
  6071. return c
  6072. }
  6073. // PageSize sets the optional parameter "pageSize": Requested page size.
  6074. // Server may return fewer clients than requested.
  6075. // If unspecified, server will pick an appropriate default.
  6076. func (c *AccountsClientsInvitationsListCall) PageSize(pageSize int64) *AccountsClientsInvitationsListCall {
  6077. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6078. return c
  6079. }
  6080. // PageToken sets the optional parameter "pageToken": A token
  6081. // identifying a page of results the server should return.
  6082. // Typically, this is the value
  6083. // of
  6084. // ListClientUserInvitationsResponse.nextPageToken
  6085. // returned from the previous call to
  6086. // the
  6087. // clients.invitations.list
  6088. // method.
  6089. func (c *AccountsClientsInvitationsListCall) PageToken(pageToken string) *AccountsClientsInvitationsListCall {
  6090. c.urlParams_.Set("pageToken", pageToken)
  6091. return c
  6092. }
  6093. // Fields allows partial responses to be retrieved. See
  6094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6095. // for more information.
  6096. func (c *AccountsClientsInvitationsListCall) Fields(s ...googleapi.Field) *AccountsClientsInvitationsListCall {
  6097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6098. return c
  6099. }
  6100. // IfNoneMatch sets the optional parameter which makes the operation
  6101. // fail if the object's ETag matches the given value. This is useful for
  6102. // getting updates only after the object has changed since the last
  6103. // request. Use googleapi.IsNotModified to check whether the response
  6104. // error from Do is the result of In-None-Match.
  6105. func (c *AccountsClientsInvitationsListCall) IfNoneMatch(entityTag string) *AccountsClientsInvitationsListCall {
  6106. c.ifNoneMatch_ = entityTag
  6107. return c
  6108. }
  6109. // Context sets the context to be used in this call's Do method. Any
  6110. // pending HTTP request will be aborted if the provided context is
  6111. // canceled.
  6112. func (c *AccountsClientsInvitationsListCall) Context(ctx context.Context) *AccountsClientsInvitationsListCall {
  6113. c.ctx_ = ctx
  6114. return c
  6115. }
  6116. // Header returns an http.Header that can be modified by the caller to
  6117. // add HTTP headers to the request.
  6118. func (c *AccountsClientsInvitationsListCall) Header() http.Header {
  6119. if c.header_ == nil {
  6120. c.header_ = make(http.Header)
  6121. }
  6122. return c.header_
  6123. }
  6124. func (c *AccountsClientsInvitationsListCall) doRequest(alt string) (*http.Response, error) {
  6125. reqHeaders := make(http.Header)
  6126. for k, v := range c.header_ {
  6127. reqHeaders[k] = v
  6128. }
  6129. reqHeaders.Set("User-Agent", c.s.userAgent())
  6130. if c.ifNoneMatch_ != "" {
  6131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6132. }
  6133. var body io.Reader = nil
  6134. c.urlParams_.Set("alt", alt)
  6135. c.urlParams_.Set("prettyPrint", "false")
  6136. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations")
  6137. urls += "?" + c.urlParams_.Encode()
  6138. req, err := http.NewRequest("GET", urls, body)
  6139. if err != nil {
  6140. return nil, err
  6141. }
  6142. req.Header = reqHeaders
  6143. googleapi.Expand(req.URL, map[string]string{
  6144. "accountId": strconv.FormatInt(c.accountId, 10),
  6145. "clientAccountId": c.clientAccountId,
  6146. })
  6147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6148. }
  6149. // Do executes the "adexchangebuyer2.accounts.clients.invitations.list" call.
  6150. // Exactly one of *ListClientUserInvitationsResponse or error will be
  6151. // non-nil. Any non-2xx status code is an error. Response headers are in
  6152. // either *ListClientUserInvitationsResponse.ServerResponse.Header or
  6153. // (if a response was returned at all) in
  6154. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6155. // whether the returned error was because http.StatusNotModified was
  6156. // returned.
  6157. func (c *AccountsClientsInvitationsListCall) Do(opts ...googleapi.CallOption) (*ListClientUserInvitationsResponse, error) {
  6158. gensupport.SetOptions(c.urlParams_, opts...)
  6159. res, err := c.doRequest("json")
  6160. if res != nil && res.StatusCode == http.StatusNotModified {
  6161. if res.Body != nil {
  6162. res.Body.Close()
  6163. }
  6164. return nil, &googleapi.Error{
  6165. Code: res.StatusCode,
  6166. Header: res.Header,
  6167. }
  6168. }
  6169. if err != nil {
  6170. return nil, err
  6171. }
  6172. defer googleapi.CloseBody(res)
  6173. if err := googleapi.CheckResponse(res); err != nil {
  6174. return nil, err
  6175. }
  6176. ret := &ListClientUserInvitationsResponse{
  6177. ServerResponse: googleapi.ServerResponse{
  6178. Header: res.Header,
  6179. HTTPStatusCode: res.StatusCode,
  6180. },
  6181. }
  6182. target := &ret
  6183. if err := gensupport.DecodeResponse(target, res); err != nil {
  6184. return nil, err
  6185. }
  6186. return ret, nil
  6187. // {
  6188. // "description": "Lists all the client users invitations for a client\nwith a given account ID.",
  6189. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  6190. // "httpMethod": "GET",
  6191. // "id": "adexchangebuyer2.accounts.clients.invitations.list",
  6192. // "parameterOrder": [
  6193. // "accountId",
  6194. // "clientAccountId"
  6195. // ],
  6196. // "parameters": {
  6197. // "accountId": {
  6198. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  6199. // "format": "int64",
  6200. // "location": "path",
  6201. // "required": true,
  6202. // "type": "string"
  6203. // },
  6204. // "clientAccountId": {
  6205. // "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.",
  6206. // "location": "path",
  6207. // "required": true,
  6208. // "type": "string"
  6209. // },
  6210. // "pageSize": {
  6211. // "description": "Requested page size. Server may return fewer clients than requested.\nIf unspecified, server will pick an appropriate default.",
  6212. // "format": "int32",
  6213. // "location": "query",
  6214. // "type": "integer"
  6215. // },
  6216. // "pageToken": {
  6217. // "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.",
  6218. // "location": "query",
  6219. // "type": "string"
  6220. // }
  6221. // },
  6222. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations",
  6223. // "response": {
  6224. // "$ref": "ListClientUserInvitationsResponse"
  6225. // },
  6226. // "scopes": [
  6227. // "https://www.googleapis.com/auth/adexchange.buyer"
  6228. // ]
  6229. // }
  6230. }
  6231. // Pages invokes f for each page of results.
  6232. // A non-nil error returned from f will halt the iteration.
  6233. // The provided context supersedes any context provided to the Context method.
  6234. func (c *AccountsClientsInvitationsListCall) Pages(ctx context.Context, f func(*ListClientUserInvitationsResponse) error) error {
  6235. c.ctx_ = ctx
  6236. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6237. for {
  6238. x, err := c.Do()
  6239. if err != nil {
  6240. return err
  6241. }
  6242. if err := f(x); err != nil {
  6243. return err
  6244. }
  6245. if x.NextPageToken == "" {
  6246. return nil
  6247. }
  6248. c.PageToken(x.NextPageToken)
  6249. }
  6250. }
  6251. // method id "adexchangebuyer2.accounts.clients.users.get":
  6252. type AccountsClientsUsersGetCall struct {
  6253. s *Service
  6254. accountId int64
  6255. clientAccountId int64
  6256. userId int64
  6257. urlParams_ gensupport.URLParams
  6258. ifNoneMatch_ string
  6259. ctx_ context.Context
  6260. header_ http.Header
  6261. }
  6262. // Get: Retrieves an existing client user.
  6263. func (r *AccountsClientsUsersService) Get(accountId int64, clientAccountId int64, userId int64) *AccountsClientsUsersGetCall {
  6264. c := &AccountsClientsUsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6265. c.accountId = accountId
  6266. c.clientAccountId = clientAccountId
  6267. c.userId = userId
  6268. return c
  6269. }
  6270. // Fields allows partial responses to be retrieved. See
  6271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6272. // for more information.
  6273. func (c *AccountsClientsUsersGetCall) Fields(s ...googleapi.Field) *AccountsClientsUsersGetCall {
  6274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6275. return c
  6276. }
  6277. // IfNoneMatch sets the optional parameter which makes the operation
  6278. // fail if the object's ETag matches the given value. This is useful for
  6279. // getting updates only after the object has changed since the last
  6280. // request. Use googleapi.IsNotModified to check whether the response
  6281. // error from Do is the result of In-None-Match.
  6282. func (c *AccountsClientsUsersGetCall) IfNoneMatch(entityTag string) *AccountsClientsUsersGetCall {
  6283. c.ifNoneMatch_ = entityTag
  6284. return c
  6285. }
  6286. // Context sets the context to be used in this call's Do method. Any
  6287. // pending HTTP request will be aborted if the provided context is
  6288. // canceled.
  6289. func (c *AccountsClientsUsersGetCall) Context(ctx context.Context) *AccountsClientsUsersGetCall {
  6290. c.ctx_ = ctx
  6291. return c
  6292. }
  6293. // Header returns an http.Header that can be modified by the caller to
  6294. // add HTTP headers to the request.
  6295. func (c *AccountsClientsUsersGetCall) Header() http.Header {
  6296. if c.header_ == nil {
  6297. c.header_ = make(http.Header)
  6298. }
  6299. return c.header_
  6300. }
  6301. func (c *AccountsClientsUsersGetCall) doRequest(alt string) (*http.Response, error) {
  6302. reqHeaders := make(http.Header)
  6303. for k, v := range c.header_ {
  6304. reqHeaders[k] = v
  6305. }
  6306. reqHeaders.Set("User-Agent", c.s.userAgent())
  6307. if c.ifNoneMatch_ != "" {
  6308. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6309. }
  6310. var body io.Reader = nil
  6311. c.urlParams_.Set("alt", alt)
  6312. c.urlParams_.Set("prettyPrint", "false")
  6313. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}")
  6314. urls += "?" + c.urlParams_.Encode()
  6315. req, err := http.NewRequest("GET", urls, body)
  6316. if err != nil {
  6317. return nil, err
  6318. }
  6319. req.Header = reqHeaders
  6320. googleapi.Expand(req.URL, map[string]string{
  6321. "accountId": strconv.FormatInt(c.accountId, 10),
  6322. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  6323. "userId": strconv.FormatInt(c.userId, 10),
  6324. })
  6325. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6326. }
  6327. // Do executes the "adexchangebuyer2.accounts.clients.users.get" call.
  6328. // Exactly one of *ClientUser or error will be non-nil. Any non-2xx
  6329. // status code is an error. Response headers are in either
  6330. // *ClientUser.ServerResponse.Header or (if a response was returned at
  6331. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6332. // to check whether the returned error was because
  6333. // http.StatusNotModified was returned.
  6334. func (c *AccountsClientsUsersGetCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
  6335. gensupport.SetOptions(c.urlParams_, opts...)
  6336. res, err := c.doRequest("json")
  6337. if res != nil && res.StatusCode == http.StatusNotModified {
  6338. if res.Body != nil {
  6339. res.Body.Close()
  6340. }
  6341. return nil, &googleapi.Error{
  6342. Code: res.StatusCode,
  6343. Header: res.Header,
  6344. }
  6345. }
  6346. if err != nil {
  6347. return nil, err
  6348. }
  6349. defer googleapi.CloseBody(res)
  6350. if err := googleapi.CheckResponse(res); err != nil {
  6351. return nil, err
  6352. }
  6353. ret := &ClientUser{
  6354. ServerResponse: googleapi.ServerResponse{
  6355. Header: res.Header,
  6356. HTTPStatusCode: res.StatusCode,
  6357. },
  6358. }
  6359. target := &ret
  6360. if err := gensupport.DecodeResponse(target, res); err != nil {
  6361. return nil, err
  6362. }
  6363. return ret, nil
  6364. // {
  6365. // "description": "Retrieves an existing client user.",
  6366. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  6367. // "httpMethod": "GET",
  6368. // "id": "adexchangebuyer2.accounts.clients.users.get",
  6369. // "parameterOrder": [
  6370. // "accountId",
  6371. // "clientAccountId",
  6372. // "userId"
  6373. // ],
  6374. // "parameters": {
  6375. // "accountId": {
  6376. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  6377. // "format": "int64",
  6378. // "location": "path",
  6379. // "required": true,
  6380. // "type": "string"
  6381. // },
  6382. // "clientAccountId": {
  6383. // "description": "Numerical account ID of the client buyer\nthat the user to be retrieved is associated with. (required)",
  6384. // "format": "int64",
  6385. // "location": "path",
  6386. // "required": true,
  6387. // "type": "string"
  6388. // },
  6389. // "userId": {
  6390. // "description": "Numerical identifier of the user to retrieve. (required)",
  6391. // "format": "int64",
  6392. // "location": "path",
  6393. // "required": true,
  6394. // "type": "string"
  6395. // }
  6396. // },
  6397. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  6398. // "response": {
  6399. // "$ref": "ClientUser"
  6400. // },
  6401. // "scopes": [
  6402. // "https://www.googleapis.com/auth/adexchange.buyer"
  6403. // ]
  6404. // }
  6405. }
  6406. // method id "adexchangebuyer2.accounts.clients.users.list":
  6407. type AccountsClientsUsersListCall struct {
  6408. s *Service
  6409. accountId int64
  6410. clientAccountId string
  6411. urlParams_ gensupport.URLParams
  6412. ifNoneMatch_ string
  6413. ctx_ context.Context
  6414. header_ http.Header
  6415. }
  6416. // List: Lists all the known client users for a specified
  6417. // sponsor buyer account ID.
  6418. func (r *AccountsClientsUsersService) List(accountId int64, clientAccountId string) *AccountsClientsUsersListCall {
  6419. c := &AccountsClientsUsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6420. c.accountId = accountId
  6421. c.clientAccountId = clientAccountId
  6422. return c
  6423. }
  6424. // PageSize sets the optional parameter "pageSize": Requested page size.
  6425. // The server may return fewer clients than requested.
  6426. // If unspecified, the server will pick an appropriate default.
  6427. func (c *AccountsClientsUsersListCall) PageSize(pageSize int64) *AccountsClientsUsersListCall {
  6428. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6429. return c
  6430. }
  6431. // PageToken sets the optional parameter "pageToken": A token
  6432. // identifying a page of results the server should return.
  6433. // Typically, this is the value
  6434. // of
  6435. // ListClientUsersResponse.nextPageToken
  6436. // returned from the previous call to the
  6437. // accounts.clients.users.list method.
  6438. func (c *AccountsClientsUsersListCall) PageToken(pageToken string) *AccountsClientsUsersListCall {
  6439. c.urlParams_.Set("pageToken", pageToken)
  6440. return c
  6441. }
  6442. // Fields allows partial responses to be retrieved. See
  6443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6444. // for more information.
  6445. func (c *AccountsClientsUsersListCall) Fields(s ...googleapi.Field) *AccountsClientsUsersListCall {
  6446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6447. return c
  6448. }
  6449. // IfNoneMatch sets the optional parameter which makes the operation
  6450. // fail if the object's ETag matches the given value. This is useful for
  6451. // getting updates only after the object has changed since the last
  6452. // request. Use googleapi.IsNotModified to check whether the response
  6453. // error from Do is the result of In-None-Match.
  6454. func (c *AccountsClientsUsersListCall) IfNoneMatch(entityTag string) *AccountsClientsUsersListCall {
  6455. c.ifNoneMatch_ = entityTag
  6456. return c
  6457. }
  6458. // Context sets the context to be used in this call's Do method. Any
  6459. // pending HTTP request will be aborted if the provided context is
  6460. // canceled.
  6461. func (c *AccountsClientsUsersListCall) Context(ctx context.Context) *AccountsClientsUsersListCall {
  6462. c.ctx_ = ctx
  6463. return c
  6464. }
  6465. // Header returns an http.Header that can be modified by the caller to
  6466. // add HTTP headers to the request.
  6467. func (c *AccountsClientsUsersListCall) Header() http.Header {
  6468. if c.header_ == nil {
  6469. c.header_ = make(http.Header)
  6470. }
  6471. return c.header_
  6472. }
  6473. func (c *AccountsClientsUsersListCall) doRequest(alt string) (*http.Response, error) {
  6474. reqHeaders := make(http.Header)
  6475. for k, v := range c.header_ {
  6476. reqHeaders[k] = v
  6477. }
  6478. reqHeaders.Set("User-Agent", c.s.userAgent())
  6479. if c.ifNoneMatch_ != "" {
  6480. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6481. }
  6482. var body io.Reader = nil
  6483. c.urlParams_.Set("alt", alt)
  6484. c.urlParams_.Set("prettyPrint", "false")
  6485. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users")
  6486. urls += "?" + c.urlParams_.Encode()
  6487. req, err := http.NewRequest("GET", urls, body)
  6488. if err != nil {
  6489. return nil, err
  6490. }
  6491. req.Header = reqHeaders
  6492. googleapi.Expand(req.URL, map[string]string{
  6493. "accountId": strconv.FormatInt(c.accountId, 10),
  6494. "clientAccountId": c.clientAccountId,
  6495. })
  6496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6497. }
  6498. // Do executes the "adexchangebuyer2.accounts.clients.users.list" call.
  6499. // Exactly one of *ListClientUsersResponse or error will be non-nil. Any
  6500. // non-2xx status code is an error. Response headers are in either
  6501. // *ListClientUsersResponse.ServerResponse.Header or (if a response was
  6502. // returned at all) in error.(*googleapi.Error).Header. Use
  6503. // googleapi.IsNotModified to check whether the returned error was
  6504. // because http.StatusNotModified was returned.
  6505. func (c *AccountsClientsUsersListCall) Do(opts ...googleapi.CallOption) (*ListClientUsersResponse, error) {
  6506. gensupport.SetOptions(c.urlParams_, opts...)
  6507. res, err := c.doRequest("json")
  6508. if res != nil && res.StatusCode == http.StatusNotModified {
  6509. if res.Body != nil {
  6510. res.Body.Close()
  6511. }
  6512. return nil, &googleapi.Error{
  6513. Code: res.StatusCode,
  6514. Header: res.Header,
  6515. }
  6516. }
  6517. if err != nil {
  6518. return nil, err
  6519. }
  6520. defer googleapi.CloseBody(res)
  6521. if err := googleapi.CheckResponse(res); err != nil {
  6522. return nil, err
  6523. }
  6524. ret := &ListClientUsersResponse{
  6525. ServerResponse: googleapi.ServerResponse{
  6526. Header: res.Header,
  6527. HTTPStatusCode: res.StatusCode,
  6528. },
  6529. }
  6530. target := &ret
  6531. if err := gensupport.DecodeResponse(target, res); err != nil {
  6532. return nil, err
  6533. }
  6534. return ret, nil
  6535. // {
  6536. // "description": "Lists all the known client users for a specified\nsponsor buyer account ID.",
  6537. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users",
  6538. // "httpMethod": "GET",
  6539. // "id": "adexchangebuyer2.accounts.clients.users.list",
  6540. // "parameterOrder": [
  6541. // "accountId",
  6542. // "clientAccountId"
  6543. // ],
  6544. // "parameters": {
  6545. // "accountId": {
  6546. // "description": "Numerical account ID of the sponsor buyer of the client to list users for.\n(required)",
  6547. // "format": "int64",
  6548. // "location": "path",
  6549. // "required": true,
  6550. // "type": "string"
  6551. // },
  6552. // "clientAccountId": {
  6553. // "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.",
  6554. // "location": "path",
  6555. // "required": true,
  6556. // "type": "string"
  6557. // },
  6558. // "pageSize": {
  6559. // "description": "Requested page size. The server may return fewer clients than requested.\nIf unspecified, the server will pick an appropriate default.",
  6560. // "format": "int32",
  6561. // "location": "query",
  6562. // "type": "integer"
  6563. // },
  6564. // "pageToken": {
  6565. // "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.",
  6566. // "location": "query",
  6567. // "type": "string"
  6568. // }
  6569. // },
  6570. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users",
  6571. // "response": {
  6572. // "$ref": "ListClientUsersResponse"
  6573. // },
  6574. // "scopes": [
  6575. // "https://www.googleapis.com/auth/adexchange.buyer"
  6576. // ]
  6577. // }
  6578. }
  6579. // Pages invokes f for each page of results.
  6580. // A non-nil error returned from f will halt the iteration.
  6581. // The provided context supersedes any context provided to the Context method.
  6582. func (c *AccountsClientsUsersListCall) Pages(ctx context.Context, f func(*ListClientUsersResponse) error) error {
  6583. c.ctx_ = ctx
  6584. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6585. for {
  6586. x, err := c.Do()
  6587. if err != nil {
  6588. return err
  6589. }
  6590. if err := f(x); err != nil {
  6591. return err
  6592. }
  6593. if x.NextPageToken == "" {
  6594. return nil
  6595. }
  6596. c.PageToken(x.NextPageToken)
  6597. }
  6598. }
  6599. // method id "adexchangebuyer2.accounts.clients.users.update":
  6600. type AccountsClientsUsersUpdateCall struct {
  6601. s *Service
  6602. accountId int64
  6603. clientAccountId int64
  6604. userId int64
  6605. clientuser *ClientUser
  6606. urlParams_ gensupport.URLParams
  6607. ctx_ context.Context
  6608. header_ http.Header
  6609. }
  6610. // Update: Updates an existing client user.
  6611. // Only the user status can be changed on update.
  6612. func (r *AccountsClientsUsersService) Update(accountId int64, clientAccountId int64, userId int64, clientuser *ClientUser) *AccountsClientsUsersUpdateCall {
  6613. c := &AccountsClientsUsersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6614. c.accountId = accountId
  6615. c.clientAccountId = clientAccountId
  6616. c.userId = userId
  6617. c.clientuser = clientuser
  6618. return c
  6619. }
  6620. // Fields allows partial responses to be retrieved. See
  6621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6622. // for more information.
  6623. func (c *AccountsClientsUsersUpdateCall) Fields(s ...googleapi.Field) *AccountsClientsUsersUpdateCall {
  6624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6625. return c
  6626. }
  6627. // Context sets the context to be used in this call's Do method. Any
  6628. // pending HTTP request will be aborted if the provided context is
  6629. // canceled.
  6630. func (c *AccountsClientsUsersUpdateCall) Context(ctx context.Context) *AccountsClientsUsersUpdateCall {
  6631. c.ctx_ = ctx
  6632. return c
  6633. }
  6634. // Header returns an http.Header that can be modified by the caller to
  6635. // add HTTP headers to the request.
  6636. func (c *AccountsClientsUsersUpdateCall) Header() http.Header {
  6637. if c.header_ == nil {
  6638. c.header_ = make(http.Header)
  6639. }
  6640. return c.header_
  6641. }
  6642. func (c *AccountsClientsUsersUpdateCall) doRequest(alt string) (*http.Response, error) {
  6643. reqHeaders := make(http.Header)
  6644. for k, v := range c.header_ {
  6645. reqHeaders[k] = v
  6646. }
  6647. reqHeaders.Set("User-Agent", c.s.userAgent())
  6648. var body io.Reader = nil
  6649. body, err := googleapi.WithoutDataWrapper.JSONReader(c.clientuser)
  6650. if err != nil {
  6651. return nil, err
  6652. }
  6653. reqHeaders.Set("Content-Type", "application/json")
  6654. c.urlParams_.Set("alt", alt)
  6655. c.urlParams_.Set("prettyPrint", "false")
  6656. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}")
  6657. urls += "?" + c.urlParams_.Encode()
  6658. req, err := http.NewRequest("PUT", urls, body)
  6659. if err != nil {
  6660. return nil, err
  6661. }
  6662. req.Header = reqHeaders
  6663. googleapi.Expand(req.URL, map[string]string{
  6664. "accountId": strconv.FormatInt(c.accountId, 10),
  6665. "clientAccountId": strconv.FormatInt(c.clientAccountId, 10),
  6666. "userId": strconv.FormatInt(c.userId, 10),
  6667. })
  6668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6669. }
  6670. // Do executes the "adexchangebuyer2.accounts.clients.users.update" call.
  6671. // Exactly one of *ClientUser or error will be non-nil. Any non-2xx
  6672. // status code is an error. Response headers are in either
  6673. // *ClientUser.ServerResponse.Header or (if a response was returned at
  6674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6675. // to check whether the returned error was because
  6676. // http.StatusNotModified was returned.
  6677. func (c *AccountsClientsUsersUpdateCall) Do(opts ...googleapi.CallOption) (*ClientUser, error) {
  6678. gensupport.SetOptions(c.urlParams_, opts...)
  6679. res, err := c.doRequest("json")
  6680. if res != nil && res.StatusCode == http.StatusNotModified {
  6681. if res.Body != nil {
  6682. res.Body.Close()
  6683. }
  6684. return nil, &googleapi.Error{
  6685. Code: res.StatusCode,
  6686. Header: res.Header,
  6687. }
  6688. }
  6689. if err != nil {
  6690. return nil, err
  6691. }
  6692. defer googleapi.CloseBody(res)
  6693. if err := googleapi.CheckResponse(res); err != nil {
  6694. return nil, err
  6695. }
  6696. ret := &ClientUser{
  6697. ServerResponse: googleapi.ServerResponse{
  6698. Header: res.Header,
  6699. HTTPStatusCode: res.StatusCode,
  6700. },
  6701. }
  6702. target := &ret
  6703. if err := gensupport.DecodeResponse(target, res); err != nil {
  6704. return nil, err
  6705. }
  6706. return ret, nil
  6707. // {
  6708. // "description": "Updates an existing client user.\nOnly the user status can be changed on update.",
  6709. // "flatPath": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  6710. // "httpMethod": "PUT",
  6711. // "id": "adexchangebuyer2.accounts.clients.users.update",
  6712. // "parameterOrder": [
  6713. // "accountId",
  6714. // "clientAccountId",
  6715. // "userId"
  6716. // ],
  6717. // "parameters": {
  6718. // "accountId": {
  6719. // "description": "Numerical account ID of the client's sponsor buyer. (required)",
  6720. // "format": "int64",
  6721. // "location": "path",
  6722. // "required": true,
  6723. // "type": "string"
  6724. // },
  6725. // "clientAccountId": {
  6726. // "description": "Numerical account ID of the client buyer that the user to be retrieved\nis associated with. (required)",
  6727. // "format": "int64",
  6728. // "location": "path",
  6729. // "required": true,
  6730. // "type": "string"
  6731. // },
  6732. // "userId": {
  6733. // "description": "Numerical identifier of the user to retrieve. (required)",
  6734. // "format": "int64",
  6735. // "location": "path",
  6736. // "required": true,
  6737. // "type": "string"
  6738. // }
  6739. // },
  6740. // "path": "v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}",
  6741. // "request": {
  6742. // "$ref": "ClientUser"
  6743. // },
  6744. // "response": {
  6745. // "$ref": "ClientUser"
  6746. // },
  6747. // "scopes": [
  6748. // "https://www.googleapis.com/auth/adexchange.buyer"
  6749. // ]
  6750. // }
  6751. }
  6752. // method id "adexchangebuyer2.accounts.creatives.create":
  6753. type AccountsCreativesCreateCall struct {
  6754. s *Service
  6755. accountId string
  6756. creative *Creative
  6757. urlParams_ gensupport.URLParams
  6758. ctx_ context.Context
  6759. header_ http.Header
  6760. }
  6761. // Create: Creates a creative.
  6762. func (r *AccountsCreativesService) Create(accountId string, creative *Creative) *AccountsCreativesCreateCall {
  6763. c := &AccountsCreativesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6764. c.accountId = accountId
  6765. c.creative = creative
  6766. return c
  6767. }
  6768. // DuplicateIdMode sets the optional parameter "duplicateIdMode":
  6769. // Indicates if multiple creatives can share an ID or not. Default
  6770. // is
  6771. // NO_DUPLICATES (one ID per creative).
  6772. //
  6773. // Possible values:
  6774. // "NO_DUPLICATES"
  6775. // "FORCE_ENABLE_DUPLICATE_IDS"
  6776. func (c *AccountsCreativesCreateCall) DuplicateIdMode(duplicateIdMode string) *AccountsCreativesCreateCall {
  6777. c.urlParams_.Set("duplicateIdMode", duplicateIdMode)
  6778. return c
  6779. }
  6780. // Fields allows partial responses to be retrieved. See
  6781. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6782. // for more information.
  6783. func (c *AccountsCreativesCreateCall) Fields(s ...googleapi.Field) *AccountsCreativesCreateCall {
  6784. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6785. return c
  6786. }
  6787. // Context sets the context to be used in this call's Do method. Any
  6788. // pending HTTP request will be aborted if the provided context is
  6789. // canceled.
  6790. func (c *AccountsCreativesCreateCall) Context(ctx context.Context) *AccountsCreativesCreateCall {
  6791. c.ctx_ = ctx
  6792. return c
  6793. }
  6794. // Header returns an http.Header that can be modified by the caller to
  6795. // add HTTP headers to the request.
  6796. func (c *AccountsCreativesCreateCall) Header() http.Header {
  6797. if c.header_ == nil {
  6798. c.header_ = make(http.Header)
  6799. }
  6800. return c.header_
  6801. }
  6802. func (c *AccountsCreativesCreateCall) doRequest(alt string) (*http.Response, error) {
  6803. reqHeaders := make(http.Header)
  6804. for k, v := range c.header_ {
  6805. reqHeaders[k] = v
  6806. }
  6807. reqHeaders.Set("User-Agent", c.s.userAgent())
  6808. var body io.Reader = nil
  6809. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  6810. if err != nil {
  6811. return nil, err
  6812. }
  6813. reqHeaders.Set("Content-Type", "application/json")
  6814. c.urlParams_.Set("alt", alt)
  6815. c.urlParams_.Set("prettyPrint", "false")
  6816. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives")
  6817. urls += "?" + c.urlParams_.Encode()
  6818. req, err := http.NewRequest("POST", urls, body)
  6819. if err != nil {
  6820. return nil, err
  6821. }
  6822. req.Header = reqHeaders
  6823. googleapi.Expand(req.URL, map[string]string{
  6824. "accountId": c.accountId,
  6825. })
  6826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6827. }
  6828. // Do executes the "adexchangebuyer2.accounts.creatives.create" call.
  6829. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  6830. // code is an error. Response headers are in either
  6831. // *Creative.ServerResponse.Header or (if a response was returned at
  6832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6833. // to check whether the returned error was because
  6834. // http.StatusNotModified was returned.
  6835. func (c *AccountsCreativesCreateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  6836. gensupport.SetOptions(c.urlParams_, opts...)
  6837. res, err := c.doRequest("json")
  6838. if res != nil && res.StatusCode == http.StatusNotModified {
  6839. if res.Body != nil {
  6840. res.Body.Close()
  6841. }
  6842. return nil, &googleapi.Error{
  6843. Code: res.StatusCode,
  6844. Header: res.Header,
  6845. }
  6846. }
  6847. if err != nil {
  6848. return nil, err
  6849. }
  6850. defer googleapi.CloseBody(res)
  6851. if err := googleapi.CheckResponse(res); err != nil {
  6852. return nil, err
  6853. }
  6854. ret := &Creative{
  6855. ServerResponse: googleapi.ServerResponse{
  6856. Header: res.Header,
  6857. HTTPStatusCode: res.StatusCode,
  6858. },
  6859. }
  6860. target := &ret
  6861. if err := gensupport.DecodeResponse(target, res); err != nil {
  6862. return nil, err
  6863. }
  6864. return ret, nil
  6865. // {
  6866. // "description": "Creates a creative.",
  6867. // "flatPath": "v2beta1/accounts/{accountId}/creatives",
  6868. // "httpMethod": "POST",
  6869. // "id": "adexchangebuyer2.accounts.creatives.create",
  6870. // "parameterOrder": [
  6871. // "accountId"
  6872. // ],
  6873. // "parameters": {
  6874. // "accountId": {
  6875. // "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  6876. // "location": "path",
  6877. // "required": true,
  6878. // "type": "string"
  6879. // },
  6880. // "duplicateIdMode": {
  6881. // "description": "Indicates if multiple creatives can share an ID or not. Default is\nNO_DUPLICATES (one ID per creative).",
  6882. // "enum": [
  6883. // "NO_DUPLICATES",
  6884. // "FORCE_ENABLE_DUPLICATE_IDS"
  6885. // ],
  6886. // "location": "query",
  6887. // "type": "string"
  6888. // }
  6889. // },
  6890. // "path": "v2beta1/accounts/{accountId}/creatives",
  6891. // "request": {
  6892. // "$ref": "Creative"
  6893. // },
  6894. // "response": {
  6895. // "$ref": "Creative"
  6896. // },
  6897. // "scopes": [
  6898. // "https://www.googleapis.com/auth/adexchange.buyer"
  6899. // ]
  6900. // }
  6901. }
  6902. // method id "adexchangebuyer2.accounts.creatives.get":
  6903. type AccountsCreativesGetCall struct {
  6904. s *Service
  6905. accountId string
  6906. creativeId string
  6907. urlParams_ gensupport.URLParams
  6908. ifNoneMatch_ string
  6909. ctx_ context.Context
  6910. header_ http.Header
  6911. }
  6912. // Get: Gets a creative.
  6913. func (r *AccountsCreativesService) Get(accountId string, creativeId string) *AccountsCreativesGetCall {
  6914. c := &AccountsCreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6915. c.accountId = accountId
  6916. c.creativeId = creativeId
  6917. return c
  6918. }
  6919. // Fields allows partial responses to be retrieved. See
  6920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6921. // for more information.
  6922. func (c *AccountsCreativesGetCall) Fields(s ...googleapi.Field) *AccountsCreativesGetCall {
  6923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6924. return c
  6925. }
  6926. // IfNoneMatch sets the optional parameter which makes the operation
  6927. // fail if the object's ETag matches the given value. This is useful for
  6928. // getting updates only after the object has changed since the last
  6929. // request. Use googleapi.IsNotModified to check whether the response
  6930. // error from Do is the result of In-None-Match.
  6931. func (c *AccountsCreativesGetCall) IfNoneMatch(entityTag string) *AccountsCreativesGetCall {
  6932. c.ifNoneMatch_ = entityTag
  6933. return c
  6934. }
  6935. // Context sets the context to be used in this call's Do method. Any
  6936. // pending HTTP request will be aborted if the provided context is
  6937. // canceled.
  6938. func (c *AccountsCreativesGetCall) Context(ctx context.Context) *AccountsCreativesGetCall {
  6939. c.ctx_ = ctx
  6940. return c
  6941. }
  6942. // Header returns an http.Header that can be modified by the caller to
  6943. // add HTTP headers to the request.
  6944. func (c *AccountsCreativesGetCall) Header() http.Header {
  6945. if c.header_ == nil {
  6946. c.header_ = make(http.Header)
  6947. }
  6948. return c.header_
  6949. }
  6950. func (c *AccountsCreativesGetCall) doRequest(alt string) (*http.Response, error) {
  6951. reqHeaders := make(http.Header)
  6952. for k, v := range c.header_ {
  6953. reqHeaders[k] = v
  6954. }
  6955. reqHeaders.Set("User-Agent", c.s.userAgent())
  6956. if c.ifNoneMatch_ != "" {
  6957. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6958. }
  6959. var body io.Reader = nil
  6960. c.urlParams_.Set("alt", alt)
  6961. c.urlParams_.Set("prettyPrint", "false")
  6962. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}")
  6963. urls += "?" + c.urlParams_.Encode()
  6964. req, err := http.NewRequest("GET", urls, body)
  6965. if err != nil {
  6966. return nil, err
  6967. }
  6968. req.Header = reqHeaders
  6969. googleapi.Expand(req.URL, map[string]string{
  6970. "accountId": c.accountId,
  6971. "creativeId": c.creativeId,
  6972. })
  6973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6974. }
  6975. // Do executes the "adexchangebuyer2.accounts.creatives.get" call.
  6976. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  6977. // code is an error. Response headers are in either
  6978. // *Creative.ServerResponse.Header or (if a response was returned at
  6979. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6980. // to check whether the returned error was because
  6981. // http.StatusNotModified was returned.
  6982. func (c *AccountsCreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  6983. gensupport.SetOptions(c.urlParams_, opts...)
  6984. res, err := c.doRequest("json")
  6985. if res != nil && res.StatusCode == http.StatusNotModified {
  6986. if res.Body != nil {
  6987. res.Body.Close()
  6988. }
  6989. return nil, &googleapi.Error{
  6990. Code: res.StatusCode,
  6991. Header: res.Header,
  6992. }
  6993. }
  6994. if err != nil {
  6995. return nil, err
  6996. }
  6997. defer googleapi.CloseBody(res)
  6998. if err := googleapi.CheckResponse(res); err != nil {
  6999. return nil, err
  7000. }
  7001. ret := &Creative{
  7002. ServerResponse: googleapi.ServerResponse{
  7003. Header: res.Header,
  7004. HTTPStatusCode: res.StatusCode,
  7005. },
  7006. }
  7007. target := &ret
  7008. if err := gensupport.DecodeResponse(target, res); err != nil {
  7009. return nil, err
  7010. }
  7011. return ret, nil
  7012. // {
  7013. // "description": "Gets a creative.",
  7014. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  7015. // "httpMethod": "GET",
  7016. // "id": "adexchangebuyer2.accounts.creatives.get",
  7017. // "parameterOrder": [
  7018. // "accountId",
  7019. // "creativeId"
  7020. // ],
  7021. // "parameters": {
  7022. // "accountId": {
  7023. // "description": "The account the creative belongs to.",
  7024. // "location": "path",
  7025. // "required": true,
  7026. // "type": "string"
  7027. // },
  7028. // "creativeId": {
  7029. // "description": "The ID of the creative to retrieve.",
  7030. // "location": "path",
  7031. // "required": true,
  7032. // "type": "string"
  7033. // }
  7034. // },
  7035. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  7036. // "response": {
  7037. // "$ref": "Creative"
  7038. // },
  7039. // "scopes": [
  7040. // "https://www.googleapis.com/auth/adexchange.buyer"
  7041. // ]
  7042. // }
  7043. }
  7044. // method id "adexchangebuyer2.accounts.creatives.list":
  7045. type AccountsCreativesListCall struct {
  7046. s *Service
  7047. accountId string
  7048. urlParams_ gensupport.URLParams
  7049. ifNoneMatch_ string
  7050. ctx_ context.Context
  7051. header_ http.Header
  7052. }
  7053. // List: Lists creatives.
  7054. func (r *AccountsCreativesService) List(accountId string) *AccountsCreativesListCall {
  7055. c := &AccountsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7056. c.accountId = accountId
  7057. return c
  7058. }
  7059. // PageSize sets the optional parameter "pageSize": Requested page size.
  7060. // The server may return fewer creatives than requested
  7061. // (due to timeout constraint) even if more are available via another
  7062. // call.
  7063. // If unspecified, server will pick an appropriate default.
  7064. // Acceptable values are 1 to 1000, inclusive.
  7065. func (c *AccountsCreativesListCall) PageSize(pageSize int64) *AccountsCreativesListCall {
  7066. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7067. return c
  7068. }
  7069. // PageToken sets the optional parameter "pageToken": A token
  7070. // identifying a page of results the server should return.
  7071. // Typically, this is the value
  7072. // of
  7073. // ListCreativesResponse.next_page_token
  7074. // returned from the previous call to 'ListCreatives' method.
  7075. func (c *AccountsCreativesListCall) PageToken(pageToken string) *AccountsCreativesListCall {
  7076. c.urlParams_.Set("pageToken", pageToken)
  7077. return c
  7078. }
  7079. // Query sets the optional parameter "query": An optional query string
  7080. // to filter creatives. If no filter is specified,
  7081. // all active creatives will be returned.
  7082. // <p>Supported queries
  7083. // are:
  7084. // <ul>
  7085. // <li>accountId=<i>account_id_string</i>
  7086. // <li>creativeId=<i>cre
  7087. // ative_id_string</i>
  7088. // <li>dealsStatus: {approved, conditionally_approved, disapproved,
  7089. // not_checked}
  7090. // <li>openAuctionStatus: {approved, conditionally_approved,
  7091. // disapproved,
  7092. // not_checked}
  7093. // <li>attribute: {a numeric attribute from the list of
  7094. // attributes}
  7095. // <li>disapprovalReason: {a reason
  7096. // from
  7097. // DisapprovalReason}
  7098. // </ul>
  7099. // Example: 'accountId=12345 AND (dealsStatus:disapproved
  7100. // AND
  7101. // disapprovalReason:unacceptable_content) OR attribute:47'
  7102. func (c *AccountsCreativesListCall) Query(query string) *AccountsCreativesListCall {
  7103. c.urlParams_.Set("query", query)
  7104. return c
  7105. }
  7106. // Fields allows partial responses to be retrieved. See
  7107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7108. // for more information.
  7109. func (c *AccountsCreativesListCall) Fields(s ...googleapi.Field) *AccountsCreativesListCall {
  7110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7111. return c
  7112. }
  7113. // IfNoneMatch sets the optional parameter which makes the operation
  7114. // fail if the object's ETag matches the given value. This is useful for
  7115. // getting updates only after the object has changed since the last
  7116. // request. Use googleapi.IsNotModified to check whether the response
  7117. // error from Do is the result of In-None-Match.
  7118. func (c *AccountsCreativesListCall) IfNoneMatch(entityTag string) *AccountsCreativesListCall {
  7119. c.ifNoneMatch_ = entityTag
  7120. return c
  7121. }
  7122. // Context sets the context to be used in this call's Do method. Any
  7123. // pending HTTP request will be aborted if the provided context is
  7124. // canceled.
  7125. func (c *AccountsCreativesListCall) Context(ctx context.Context) *AccountsCreativesListCall {
  7126. c.ctx_ = ctx
  7127. return c
  7128. }
  7129. // Header returns an http.Header that can be modified by the caller to
  7130. // add HTTP headers to the request.
  7131. func (c *AccountsCreativesListCall) Header() http.Header {
  7132. if c.header_ == nil {
  7133. c.header_ = make(http.Header)
  7134. }
  7135. return c.header_
  7136. }
  7137. func (c *AccountsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  7138. reqHeaders := make(http.Header)
  7139. for k, v := range c.header_ {
  7140. reqHeaders[k] = v
  7141. }
  7142. reqHeaders.Set("User-Agent", c.s.userAgent())
  7143. if c.ifNoneMatch_ != "" {
  7144. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7145. }
  7146. var body io.Reader = nil
  7147. c.urlParams_.Set("alt", alt)
  7148. c.urlParams_.Set("prettyPrint", "false")
  7149. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives")
  7150. urls += "?" + c.urlParams_.Encode()
  7151. req, err := http.NewRequest("GET", urls, body)
  7152. if err != nil {
  7153. return nil, err
  7154. }
  7155. req.Header = reqHeaders
  7156. googleapi.Expand(req.URL, map[string]string{
  7157. "accountId": c.accountId,
  7158. })
  7159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7160. }
  7161. // Do executes the "adexchangebuyer2.accounts.creatives.list" call.
  7162. // Exactly one of *ListCreativesResponse or error will be non-nil. Any
  7163. // non-2xx status code is an error. Response headers are in either
  7164. // *ListCreativesResponse.ServerResponse.Header or (if a response was
  7165. // returned at all) in error.(*googleapi.Error).Header. Use
  7166. // googleapi.IsNotModified to check whether the returned error was
  7167. // because http.StatusNotModified was returned.
  7168. func (c *AccountsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativesResponse, error) {
  7169. gensupport.SetOptions(c.urlParams_, opts...)
  7170. res, err := c.doRequest("json")
  7171. if res != nil && res.StatusCode == http.StatusNotModified {
  7172. if res.Body != nil {
  7173. res.Body.Close()
  7174. }
  7175. return nil, &googleapi.Error{
  7176. Code: res.StatusCode,
  7177. Header: res.Header,
  7178. }
  7179. }
  7180. if err != nil {
  7181. return nil, err
  7182. }
  7183. defer googleapi.CloseBody(res)
  7184. if err := googleapi.CheckResponse(res); err != nil {
  7185. return nil, err
  7186. }
  7187. ret := &ListCreativesResponse{
  7188. ServerResponse: googleapi.ServerResponse{
  7189. Header: res.Header,
  7190. HTTPStatusCode: res.StatusCode,
  7191. },
  7192. }
  7193. target := &ret
  7194. if err := gensupport.DecodeResponse(target, res); err != nil {
  7195. return nil, err
  7196. }
  7197. return ret, nil
  7198. // {
  7199. // "description": "Lists creatives.",
  7200. // "flatPath": "v2beta1/accounts/{accountId}/creatives",
  7201. // "httpMethod": "GET",
  7202. // "id": "adexchangebuyer2.accounts.creatives.list",
  7203. // "parameterOrder": [
  7204. // "accountId"
  7205. // ],
  7206. // "parameters": {
  7207. // "accountId": {
  7208. // "description": "The account to list the creatives from.\nSpecify \"-\" to list all creatives the current user has access to.",
  7209. // "location": "path",
  7210. // "required": true,
  7211. // "type": "string"
  7212. // },
  7213. // "pageSize": {
  7214. // "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.",
  7215. // "format": "int32",
  7216. // "location": "query",
  7217. // "type": "integer"
  7218. // },
  7219. // "pageToken": {
  7220. // "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.",
  7221. // "location": "query",
  7222. // "type": "string"
  7223. // },
  7224. // "query": {
  7225. // "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'",
  7226. // "location": "query",
  7227. // "type": "string"
  7228. // }
  7229. // },
  7230. // "path": "v2beta1/accounts/{accountId}/creatives",
  7231. // "response": {
  7232. // "$ref": "ListCreativesResponse"
  7233. // },
  7234. // "scopes": [
  7235. // "https://www.googleapis.com/auth/adexchange.buyer"
  7236. // ]
  7237. // }
  7238. }
  7239. // Pages invokes f for each page of results.
  7240. // A non-nil error returned from f will halt the iteration.
  7241. // The provided context supersedes any context provided to the Context method.
  7242. func (c *AccountsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativesResponse) error) error {
  7243. c.ctx_ = ctx
  7244. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7245. for {
  7246. x, err := c.Do()
  7247. if err != nil {
  7248. return err
  7249. }
  7250. if err := f(x); err != nil {
  7251. return err
  7252. }
  7253. if x.NextPageToken == "" {
  7254. return nil
  7255. }
  7256. c.PageToken(x.NextPageToken)
  7257. }
  7258. }
  7259. // method id "adexchangebuyer2.accounts.creatives.stopWatching":
  7260. type AccountsCreativesStopWatchingCall struct {
  7261. s *Service
  7262. accountId string
  7263. creativeId string
  7264. stopwatchingcreativerequest *StopWatchingCreativeRequest
  7265. urlParams_ gensupport.URLParams
  7266. ctx_ context.Context
  7267. header_ http.Header
  7268. }
  7269. // StopWatching: Stops watching a creative. Will stop push notifications
  7270. // being sent to the
  7271. // topics when the creative changes status.
  7272. func (r *AccountsCreativesService) StopWatching(accountId string, creativeId string, stopwatchingcreativerequest *StopWatchingCreativeRequest) *AccountsCreativesStopWatchingCall {
  7273. c := &AccountsCreativesStopWatchingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7274. c.accountId = accountId
  7275. c.creativeId = creativeId
  7276. c.stopwatchingcreativerequest = stopwatchingcreativerequest
  7277. return c
  7278. }
  7279. // Fields allows partial responses to be retrieved. See
  7280. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7281. // for more information.
  7282. func (c *AccountsCreativesStopWatchingCall) Fields(s ...googleapi.Field) *AccountsCreativesStopWatchingCall {
  7283. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7284. return c
  7285. }
  7286. // Context sets the context to be used in this call's Do method. Any
  7287. // pending HTTP request will be aborted if the provided context is
  7288. // canceled.
  7289. func (c *AccountsCreativesStopWatchingCall) Context(ctx context.Context) *AccountsCreativesStopWatchingCall {
  7290. c.ctx_ = ctx
  7291. return c
  7292. }
  7293. // Header returns an http.Header that can be modified by the caller to
  7294. // add HTTP headers to the request.
  7295. func (c *AccountsCreativesStopWatchingCall) Header() http.Header {
  7296. if c.header_ == nil {
  7297. c.header_ = make(http.Header)
  7298. }
  7299. return c.header_
  7300. }
  7301. func (c *AccountsCreativesStopWatchingCall) doRequest(alt string) (*http.Response, error) {
  7302. reqHeaders := make(http.Header)
  7303. for k, v := range c.header_ {
  7304. reqHeaders[k] = v
  7305. }
  7306. reqHeaders.Set("User-Agent", c.s.userAgent())
  7307. var body io.Reader = nil
  7308. body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopwatchingcreativerequest)
  7309. if err != nil {
  7310. return nil, err
  7311. }
  7312. reqHeaders.Set("Content-Type", "application/json")
  7313. c.urlParams_.Set("alt", alt)
  7314. c.urlParams_.Set("prettyPrint", "false")
  7315. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching")
  7316. urls += "?" + c.urlParams_.Encode()
  7317. req, err := http.NewRequest("POST", urls, body)
  7318. if err != nil {
  7319. return nil, err
  7320. }
  7321. req.Header = reqHeaders
  7322. googleapi.Expand(req.URL, map[string]string{
  7323. "accountId": c.accountId,
  7324. "creativeId": c.creativeId,
  7325. })
  7326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7327. }
  7328. // Do executes the "adexchangebuyer2.accounts.creatives.stopWatching" call.
  7329. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7330. // code is an error. Response headers are in either
  7331. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7332. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7333. // check whether the returned error was because http.StatusNotModified
  7334. // was returned.
  7335. func (c *AccountsCreativesStopWatchingCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7336. gensupport.SetOptions(c.urlParams_, opts...)
  7337. res, err := c.doRequest("json")
  7338. if res != nil && res.StatusCode == http.StatusNotModified {
  7339. if res.Body != nil {
  7340. res.Body.Close()
  7341. }
  7342. return nil, &googleapi.Error{
  7343. Code: res.StatusCode,
  7344. Header: res.Header,
  7345. }
  7346. }
  7347. if err != nil {
  7348. return nil, err
  7349. }
  7350. defer googleapi.CloseBody(res)
  7351. if err := googleapi.CheckResponse(res); err != nil {
  7352. return nil, err
  7353. }
  7354. ret := &Empty{
  7355. ServerResponse: googleapi.ServerResponse{
  7356. Header: res.Header,
  7357. HTTPStatusCode: res.StatusCode,
  7358. },
  7359. }
  7360. target := &ret
  7361. if err := gensupport.DecodeResponse(target, res); err != nil {
  7362. return nil, err
  7363. }
  7364. return ret, nil
  7365. // {
  7366. // "description": "Stops watching a creative. Will stop push notifications being sent to the\ntopics when the creative changes status.",
  7367. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching",
  7368. // "httpMethod": "POST",
  7369. // "id": "adexchangebuyer2.accounts.creatives.stopWatching",
  7370. // "parameterOrder": [
  7371. // "accountId",
  7372. // "creativeId"
  7373. // ],
  7374. // "parameters": {
  7375. // "accountId": {
  7376. // "description": "The account of the creative to stop notifications for.",
  7377. // "location": "path",
  7378. // "required": true,
  7379. // "type": "string"
  7380. // },
  7381. // "creativeId": {
  7382. // "description": "The creative ID of the creative to stop notifications for.\nSpecify \"-\" to specify stopping account level notifications.",
  7383. // "location": "path",
  7384. // "required": true,
  7385. // "type": "string"
  7386. // }
  7387. // },
  7388. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching",
  7389. // "request": {
  7390. // "$ref": "StopWatchingCreativeRequest"
  7391. // },
  7392. // "response": {
  7393. // "$ref": "Empty"
  7394. // },
  7395. // "scopes": [
  7396. // "https://www.googleapis.com/auth/adexchange.buyer"
  7397. // ]
  7398. // }
  7399. }
  7400. // method id "adexchangebuyer2.accounts.creatives.update":
  7401. type AccountsCreativesUpdateCall struct {
  7402. s *Service
  7403. accountId string
  7404. creativeId string
  7405. creative *Creative
  7406. urlParams_ gensupport.URLParams
  7407. ctx_ context.Context
  7408. header_ http.Header
  7409. }
  7410. // Update: Updates a creative.
  7411. func (r *AccountsCreativesService) Update(accountId string, creativeId string, creative *Creative) *AccountsCreativesUpdateCall {
  7412. c := &AccountsCreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7413. c.accountId = accountId
  7414. c.creativeId = creativeId
  7415. c.creative = creative
  7416. return c
  7417. }
  7418. // Fields allows partial responses to be retrieved. See
  7419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7420. // for more information.
  7421. func (c *AccountsCreativesUpdateCall) Fields(s ...googleapi.Field) *AccountsCreativesUpdateCall {
  7422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7423. return c
  7424. }
  7425. // Context sets the context to be used in this call's Do method. Any
  7426. // pending HTTP request will be aborted if the provided context is
  7427. // canceled.
  7428. func (c *AccountsCreativesUpdateCall) Context(ctx context.Context) *AccountsCreativesUpdateCall {
  7429. c.ctx_ = ctx
  7430. return c
  7431. }
  7432. // Header returns an http.Header that can be modified by the caller to
  7433. // add HTTP headers to the request.
  7434. func (c *AccountsCreativesUpdateCall) Header() http.Header {
  7435. if c.header_ == nil {
  7436. c.header_ = make(http.Header)
  7437. }
  7438. return c.header_
  7439. }
  7440. func (c *AccountsCreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  7441. reqHeaders := make(http.Header)
  7442. for k, v := range c.header_ {
  7443. reqHeaders[k] = v
  7444. }
  7445. reqHeaders.Set("User-Agent", c.s.userAgent())
  7446. var body io.Reader = nil
  7447. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  7448. if err != nil {
  7449. return nil, err
  7450. }
  7451. reqHeaders.Set("Content-Type", "application/json")
  7452. c.urlParams_.Set("alt", alt)
  7453. c.urlParams_.Set("prettyPrint", "false")
  7454. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}")
  7455. urls += "?" + c.urlParams_.Encode()
  7456. req, err := http.NewRequest("PUT", urls, body)
  7457. if err != nil {
  7458. return nil, err
  7459. }
  7460. req.Header = reqHeaders
  7461. googleapi.Expand(req.URL, map[string]string{
  7462. "accountId": c.accountId,
  7463. "creativeId": c.creativeId,
  7464. })
  7465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7466. }
  7467. // Do executes the "adexchangebuyer2.accounts.creatives.update" call.
  7468. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  7469. // code is an error. Response headers are in either
  7470. // *Creative.ServerResponse.Header or (if a response was returned at
  7471. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7472. // to check whether the returned error was because
  7473. // http.StatusNotModified was returned.
  7474. func (c *AccountsCreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  7475. gensupport.SetOptions(c.urlParams_, opts...)
  7476. res, err := c.doRequest("json")
  7477. if res != nil && res.StatusCode == http.StatusNotModified {
  7478. if res.Body != nil {
  7479. res.Body.Close()
  7480. }
  7481. return nil, &googleapi.Error{
  7482. Code: res.StatusCode,
  7483. Header: res.Header,
  7484. }
  7485. }
  7486. if err != nil {
  7487. return nil, err
  7488. }
  7489. defer googleapi.CloseBody(res)
  7490. if err := googleapi.CheckResponse(res); err != nil {
  7491. return nil, err
  7492. }
  7493. ret := &Creative{
  7494. ServerResponse: googleapi.ServerResponse{
  7495. Header: res.Header,
  7496. HTTPStatusCode: res.StatusCode,
  7497. },
  7498. }
  7499. target := &ret
  7500. if err := gensupport.DecodeResponse(target, res); err != nil {
  7501. return nil, err
  7502. }
  7503. return ret, nil
  7504. // {
  7505. // "description": "Updates a creative.",
  7506. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  7507. // "httpMethod": "PUT",
  7508. // "id": "adexchangebuyer2.accounts.creatives.update",
  7509. // "parameterOrder": [
  7510. // "accountId",
  7511. // "creativeId"
  7512. // ],
  7513. // "parameters": {
  7514. // "accountId": {
  7515. // "description": "The account that this creative belongs to.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  7516. // "location": "path",
  7517. // "required": true,
  7518. // "type": "string"
  7519. // },
  7520. // "creativeId": {
  7521. // "description": "The buyer-defined creative ID of this creative.\nCan be used to filter the response of the\ncreatives.list\nmethod.",
  7522. // "location": "path",
  7523. // "required": true,
  7524. // "type": "string"
  7525. // }
  7526. // },
  7527. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}",
  7528. // "request": {
  7529. // "$ref": "Creative"
  7530. // },
  7531. // "response": {
  7532. // "$ref": "Creative"
  7533. // },
  7534. // "scopes": [
  7535. // "https://www.googleapis.com/auth/adexchange.buyer"
  7536. // ]
  7537. // }
  7538. }
  7539. // method id "adexchangebuyer2.accounts.creatives.watch":
  7540. type AccountsCreativesWatchCall struct {
  7541. s *Service
  7542. accountId string
  7543. creativeId string
  7544. watchcreativerequest *WatchCreativeRequest
  7545. urlParams_ gensupport.URLParams
  7546. ctx_ context.Context
  7547. header_ http.Header
  7548. }
  7549. // Watch: Watches a creative. Will result in push notifications being
  7550. // sent to the
  7551. // topic when the creative changes status.
  7552. func (r *AccountsCreativesService) Watch(accountId string, creativeId string, watchcreativerequest *WatchCreativeRequest) *AccountsCreativesWatchCall {
  7553. c := &AccountsCreativesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7554. c.accountId = accountId
  7555. c.creativeId = creativeId
  7556. c.watchcreativerequest = watchcreativerequest
  7557. return c
  7558. }
  7559. // Fields allows partial responses to be retrieved. See
  7560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7561. // for more information.
  7562. func (c *AccountsCreativesWatchCall) Fields(s ...googleapi.Field) *AccountsCreativesWatchCall {
  7563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7564. return c
  7565. }
  7566. // Context sets the context to be used in this call's Do method. Any
  7567. // pending HTTP request will be aborted if the provided context is
  7568. // canceled.
  7569. func (c *AccountsCreativesWatchCall) Context(ctx context.Context) *AccountsCreativesWatchCall {
  7570. c.ctx_ = ctx
  7571. return c
  7572. }
  7573. // Header returns an http.Header that can be modified by the caller to
  7574. // add HTTP headers to the request.
  7575. func (c *AccountsCreativesWatchCall) Header() http.Header {
  7576. if c.header_ == nil {
  7577. c.header_ = make(http.Header)
  7578. }
  7579. return c.header_
  7580. }
  7581. func (c *AccountsCreativesWatchCall) doRequest(alt string) (*http.Response, error) {
  7582. reqHeaders := make(http.Header)
  7583. for k, v := range c.header_ {
  7584. reqHeaders[k] = v
  7585. }
  7586. reqHeaders.Set("User-Agent", c.s.userAgent())
  7587. var body io.Reader = nil
  7588. body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchcreativerequest)
  7589. if err != nil {
  7590. return nil, err
  7591. }
  7592. reqHeaders.Set("Content-Type", "application/json")
  7593. c.urlParams_.Set("alt", alt)
  7594. c.urlParams_.Set("prettyPrint", "false")
  7595. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch")
  7596. urls += "?" + c.urlParams_.Encode()
  7597. req, err := http.NewRequest("POST", urls, body)
  7598. if err != nil {
  7599. return nil, err
  7600. }
  7601. req.Header = reqHeaders
  7602. googleapi.Expand(req.URL, map[string]string{
  7603. "accountId": c.accountId,
  7604. "creativeId": c.creativeId,
  7605. })
  7606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7607. }
  7608. // Do executes the "adexchangebuyer2.accounts.creatives.watch" call.
  7609. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7610. // code is an error. Response headers are in either
  7611. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7612. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7613. // check whether the returned error was because http.StatusNotModified
  7614. // was returned.
  7615. func (c *AccountsCreativesWatchCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7616. gensupport.SetOptions(c.urlParams_, opts...)
  7617. res, err := c.doRequest("json")
  7618. if res != nil && res.StatusCode == http.StatusNotModified {
  7619. if res.Body != nil {
  7620. res.Body.Close()
  7621. }
  7622. return nil, &googleapi.Error{
  7623. Code: res.StatusCode,
  7624. Header: res.Header,
  7625. }
  7626. }
  7627. if err != nil {
  7628. return nil, err
  7629. }
  7630. defer googleapi.CloseBody(res)
  7631. if err := googleapi.CheckResponse(res); err != nil {
  7632. return nil, err
  7633. }
  7634. ret := &Empty{
  7635. ServerResponse: googleapi.ServerResponse{
  7636. Header: res.Header,
  7637. HTTPStatusCode: res.StatusCode,
  7638. },
  7639. }
  7640. target := &ret
  7641. if err := gensupport.DecodeResponse(target, res); err != nil {
  7642. return nil, err
  7643. }
  7644. return ret, nil
  7645. // {
  7646. // "description": "Watches a creative. Will result in push notifications being sent to the\ntopic when the creative changes status.",
  7647. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch",
  7648. // "httpMethod": "POST",
  7649. // "id": "adexchangebuyer2.accounts.creatives.watch",
  7650. // "parameterOrder": [
  7651. // "accountId",
  7652. // "creativeId"
  7653. // ],
  7654. // "parameters": {
  7655. // "accountId": {
  7656. // "description": "The account of the creative to watch.",
  7657. // "location": "path",
  7658. // "required": true,
  7659. // "type": "string"
  7660. // },
  7661. // "creativeId": {
  7662. // "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.",
  7663. // "location": "path",
  7664. // "required": true,
  7665. // "type": "string"
  7666. // }
  7667. // },
  7668. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}:watch",
  7669. // "request": {
  7670. // "$ref": "WatchCreativeRequest"
  7671. // },
  7672. // "response": {
  7673. // "$ref": "Empty"
  7674. // },
  7675. // "scopes": [
  7676. // "https://www.googleapis.com/auth/adexchange.buyer"
  7677. // ]
  7678. // }
  7679. }
  7680. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.add":
  7681. type AccountsCreativesDealAssociationsAddCall struct {
  7682. s *Service
  7683. accountId string
  7684. creativeId string
  7685. adddealassociationrequest *AddDealAssociationRequest
  7686. urlParams_ gensupport.URLParams
  7687. ctx_ context.Context
  7688. header_ http.Header
  7689. }
  7690. // Add: Associate an existing deal with a creative.
  7691. func (r *AccountsCreativesDealAssociationsService) Add(accountId string, creativeId string, adddealassociationrequest *AddDealAssociationRequest) *AccountsCreativesDealAssociationsAddCall {
  7692. c := &AccountsCreativesDealAssociationsAddCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7693. c.accountId = accountId
  7694. c.creativeId = creativeId
  7695. c.adddealassociationrequest = adddealassociationrequest
  7696. return c
  7697. }
  7698. // Fields allows partial responses to be retrieved. See
  7699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7700. // for more information.
  7701. func (c *AccountsCreativesDealAssociationsAddCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsAddCall {
  7702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7703. return c
  7704. }
  7705. // Context sets the context to be used in this call's Do method. Any
  7706. // pending HTTP request will be aborted if the provided context is
  7707. // canceled.
  7708. func (c *AccountsCreativesDealAssociationsAddCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsAddCall {
  7709. c.ctx_ = ctx
  7710. return c
  7711. }
  7712. // Header returns an http.Header that can be modified by the caller to
  7713. // add HTTP headers to the request.
  7714. func (c *AccountsCreativesDealAssociationsAddCall) Header() http.Header {
  7715. if c.header_ == nil {
  7716. c.header_ = make(http.Header)
  7717. }
  7718. return c.header_
  7719. }
  7720. func (c *AccountsCreativesDealAssociationsAddCall) doRequest(alt string) (*http.Response, error) {
  7721. reqHeaders := make(http.Header)
  7722. for k, v := range c.header_ {
  7723. reqHeaders[k] = v
  7724. }
  7725. reqHeaders.Set("User-Agent", c.s.userAgent())
  7726. var body io.Reader = nil
  7727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.adddealassociationrequest)
  7728. if err != nil {
  7729. return nil, err
  7730. }
  7731. reqHeaders.Set("Content-Type", "application/json")
  7732. c.urlParams_.Set("alt", alt)
  7733. c.urlParams_.Set("prettyPrint", "false")
  7734. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add")
  7735. urls += "?" + c.urlParams_.Encode()
  7736. req, err := http.NewRequest("POST", urls, body)
  7737. if err != nil {
  7738. return nil, err
  7739. }
  7740. req.Header = reqHeaders
  7741. googleapi.Expand(req.URL, map[string]string{
  7742. "accountId": c.accountId,
  7743. "creativeId": c.creativeId,
  7744. })
  7745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7746. }
  7747. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.add" call.
  7748. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7749. // code is an error. Response headers are in either
  7750. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7751. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7752. // check whether the returned error was because http.StatusNotModified
  7753. // was returned.
  7754. func (c *AccountsCreativesDealAssociationsAddCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7755. gensupport.SetOptions(c.urlParams_, opts...)
  7756. res, err := c.doRequest("json")
  7757. if res != nil && res.StatusCode == http.StatusNotModified {
  7758. if res.Body != nil {
  7759. res.Body.Close()
  7760. }
  7761. return nil, &googleapi.Error{
  7762. Code: res.StatusCode,
  7763. Header: res.Header,
  7764. }
  7765. }
  7766. if err != nil {
  7767. return nil, err
  7768. }
  7769. defer googleapi.CloseBody(res)
  7770. if err := googleapi.CheckResponse(res); err != nil {
  7771. return nil, err
  7772. }
  7773. ret := &Empty{
  7774. ServerResponse: googleapi.ServerResponse{
  7775. Header: res.Header,
  7776. HTTPStatusCode: res.StatusCode,
  7777. },
  7778. }
  7779. target := &ret
  7780. if err := gensupport.DecodeResponse(target, res); err != nil {
  7781. return nil, err
  7782. }
  7783. return ret, nil
  7784. // {
  7785. // "description": "Associate an existing deal with a creative.",
  7786. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add",
  7787. // "httpMethod": "POST",
  7788. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.add",
  7789. // "parameterOrder": [
  7790. // "accountId",
  7791. // "creativeId"
  7792. // ],
  7793. // "parameters": {
  7794. // "accountId": {
  7795. // "description": "The account the creative belongs to.",
  7796. // "location": "path",
  7797. // "required": true,
  7798. // "type": "string"
  7799. // },
  7800. // "creativeId": {
  7801. // "description": "The ID of the creative associated with the deal.",
  7802. // "location": "path",
  7803. // "required": true,
  7804. // "type": "string"
  7805. // }
  7806. // },
  7807. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add",
  7808. // "request": {
  7809. // "$ref": "AddDealAssociationRequest"
  7810. // },
  7811. // "response": {
  7812. // "$ref": "Empty"
  7813. // },
  7814. // "scopes": [
  7815. // "https://www.googleapis.com/auth/adexchange.buyer"
  7816. // ]
  7817. // }
  7818. }
  7819. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.list":
  7820. type AccountsCreativesDealAssociationsListCall struct {
  7821. s *Service
  7822. accountId string
  7823. creativeId string
  7824. urlParams_ gensupport.URLParams
  7825. ifNoneMatch_ string
  7826. ctx_ context.Context
  7827. header_ http.Header
  7828. }
  7829. // List: List all creative-deal associations.
  7830. func (r *AccountsCreativesDealAssociationsService) List(accountId string, creativeId string) *AccountsCreativesDealAssociationsListCall {
  7831. c := &AccountsCreativesDealAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7832. c.accountId = accountId
  7833. c.creativeId = creativeId
  7834. return c
  7835. }
  7836. // PageSize sets the optional parameter "pageSize": Requested page size.
  7837. // Server may return fewer associations than requested.
  7838. // If unspecified, server will pick an appropriate default.
  7839. func (c *AccountsCreativesDealAssociationsListCall) PageSize(pageSize int64) *AccountsCreativesDealAssociationsListCall {
  7840. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7841. return c
  7842. }
  7843. // PageToken sets the optional parameter "pageToken": A token
  7844. // identifying a page of results the server should return.
  7845. // Typically, this is the value
  7846. // of
  7847. // ListDealAssociationsResponse.next_page_token
  7848. // returned from the previous call to 'ListDealAssociations' method.
  7849. func (c *AccountsCreativesDealAssociationsListCall) PageToken(pageToken string) *AccountsCreativesDealAssociationsListCall {
  7850. c.urlParams_.Set("pageToken", pageToken)
  7851. return c
  7852. }
  7853. // Query sets the optional parameter "query": An optional query string
  7854. // to filter deal associations. If no filter is
  7855. // specified, all associations will be returned.
  7856. // Supported queries
  7857. // are:
  7858. // <ul>
  7859. // <li>accountId=<i>account_id_string</i>
  7860. // <li>creativeId=<i>cre
  7861. // ative_id_string</i>
  7862. // <li>dealsId=<i>deals_id_string</i>
  7863. // <li>dealsStatus
  7864. // :{approved, conditionally_approved, disapproved,
  7865. // not_checked}
  7866. // <li>openAuctionStatus:{approved, conditionally_approved,
  7867. // disapproved,
  7868. // not_checked}
  7869. // </ul>
  7870. // Example: 'dealsId=12345 AND dealsStatus:disapproved'
  7871. func (c *AccountsCreativesDealAssociationsListCall) Query(query string) *AccountsCreativesDealAssociationsListCall {
  7872. c.urlParams_.Set("query", query)
  7873. return c
  7874. }
  7875. // Fields allows partial responses to be retrieved. See
  7876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7877. // for more information.
  7878. func (c *AccountsCreativesDealAssociationsListCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsListCall {
  7879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7880. return c
  7881. }
  7882. // IfNoneMatch sets the optional parameter which makes the operation
  7883. // fail if the object's ETag matches the given value. This is useful for
  7884. // getting updates only after the object has changed since the last
  7885. // request. Use googleapi.IsNotModified to check whether the response
  7886. // error from Do is the result of In-None-Match.
  7887. func (c *AccountsCreativesDealAssociationsListCall) IfNoneMatch(entityTag string) *AccountsCreativesDealAssociationsListCall {
  7888. c.ifNoneMatch_ = entityTag
  7889. return c
  7890. }
  7891. // Context sets the context to be used in this call's Do method. Any
  7892. // pending HTTP request will be aborted if the provided context is
  7893. // canceled.
  7894. func (c *AccountsCreativesDealAssociationsListCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsListCall {
  7895. c.ctx_ = ctx
  7896. return c
  7897. }
  7898. // Header returns an http.Header that can be modified by the caller to
  7899. // add HTTP headers to the request.
  7900. func (c *AccountsCreativesDealAssociationsListCall) Header() http.Header {
  7901. if c.header_ == nil {
  7902. c.header_ = make(http.Header)
  7903. }
  7904. return c.header_
  7905. }
  7906. func (c *AccountsCreativesDealAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  7907. reqHeaders := make(http.Header)
  7908. for k, v := range c.header_ {
  7909. reqHeaders[k] = v
  7910. }
  7911. reqHeaders.Set("User-Agent", c.s.userAgent())
  7912. if c.ifNoneMatch_ != "" {
  7913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7914. }
  7915. var body io.Reader = nil
  7916. c.urlParams_.Set("alt", alt)
  7917. c.urlParams_.Set("prettyPrint", "false")
  7918. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations")
  7919. urls += "?" + c.urlParams_.Encode()
  7920. req, err := http.NewRequest("GET", urls, body)
  7921. if err != nil {
  7922. return nil, err
  7923. }
  7924. req.Header = reqHeaders
  7925. googleapi.Expand(req.URL, map[string]string{
  7926. "accountId": c.accountId,
  7927. "creativeId": c.creativeId,
  7928. })
  7929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7930. }
  7931. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.list" call.
  7932. // Exactly one of *ListDealAssociationsResponse or error will be
  7933. // non-nil. Any non-2xx status code is an error. Response headers are in
  7934. // either *ListDealAssociationsResponse.ServerResponse.Header or (if a
  7935. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7936. // googleapi.IsNotModified to check whether the returned error was
  7937. // because http.StatusNotModified was returned.
  7938. func (c *AccountsCreativesDealAssociationsListCall) Do(opts ...googleapi.CallOption) (*ListDealAssociationsResponse, error) {
  7939. gensupport.SetOptions(c.urlParams_, opts...)
  7940. res, err := c.doRequest("json")
  7941. if res != nil && res.StatusCode == http.StatusNotModified {
  7942. if res.Body != nil {
  7943. res.Body.Close()
  7944. }
  7945. return nil, &googleapi.Error{
  7946. Code: res.StatusCode,
  7947. Header: res.Header,
  7948. }
  7949. }
  7950. if err != nil {
  7951. return nil, err
  7952. }
  7953. defer googleapi.CloseBody(res)
  7954. if err := googleapi.CheckResponse(res); err != nil {
  7955. return nil, err
  7956. }
  7957. ret := &ListDealAssociationsResponse{
  7958. ServerResponse: googleapi.ServerResponse{
  7959. Header: res.Header,
  7960. HTTPStatusCode: res.StatusCode,
  7961. },
  7962. }
  7963. target := &ret
  7964. if err := gensupport.DecodeResponse(target, res); err != nil {
  7965. return nil, err
  7966. }
  7967. return ret, nil
  7968. // {
  7969. // "description": "List all creative-deal associations.",
  7970. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations",
  7971. // "httpMethod": "GET",
  7972. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.list",
  7973. // "parameterOrder": [
  7974. // "accountId",
  7975. // "creativeId"
  7976. // ],
  7977. // "parameters": {
  7978. // "accountId": {
  7979. // "description": "The account to list the associations from.\nSpecify \"-\" to list all creatives the current user has access to.",
  7980. // "location": "path",
  7981. // "required": true,
  7982. // "type": "string"
  7983. // },
  7984. // "creativeId": {
  7985. // "description": "The creative ID to list the associations from.\nSpecify \"-\" to list all creatives under the above account.",
  7986. // "location": "path",
  7987. // "required": true,
  7988. // "type": "string"
  7989. // },
  7990. // "pageSize": {
  7991. // "description": "Requested page size. Server may return fewer associations than requested.\nIf unspecified, server will pick an appropriate default.",
  7992. // "format": "int32",
  7993. // "location": "query",
  7994. // "type": "integer"
  7995. // },
  7996. // "pageToken": {
  7997. // "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.",
  7998. // "location": "query",
  7999. // "type": "string"
  8000. // },
  8001. // "query": {
  8002. // "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'",
  8003. // "location": "query",
  8004. // "type": "string"
  8005. // }
  8006. // },
  8007. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations",
  8008. // "response": {
  8009. // "$ref": "ListDealAssociationsResponse"
  8010. // },
  8011. // "scopes": [
  8012. // "https://www.googleapis.com/auth/adexchange.buyer"
  8013. // ]
  8014. // }
  8015. }
  8016. // Pages invokes f for each page of results.
  8017. // A non-nil error returned from f will halt the iteration.
  8018. // The provided context supersedes any context provided to the Context method.
  8019. func (c *AccountsCreativesDealAssociationsListCall) Pages(ctx context.Context, f func(*ListDealAssociationsResponse) error) error {
  8020. c.ctx_ = ctx
  8021. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8022. for {
  8023. x, err := c.Do()
  8024. if err != nil {
  8025. return err
  8026. }
  8027. if err := f(x); err != nil {
  8028. return err
  8029. }
  8030. if x.NextPageToken == "" {
  8031. return nil
  8032. }
  8033. c.PageToken(x.NextPageToken)
  8034. }
  8035. }
  8036. // method id "adexchangebuyer2.accounts.creatives.dealAssociations.remove":
  8037. type AccountsCreativesDealAssociationsRemoveCall struct {
  8038. s *Service
  8039. accountId string
  8040. creativeId string
  8041. removedealassociationrequest *RemoveDealAssociationRequest
  8042. urlParams_ gensupport.URLParams
  8043. ctx_ context.Context
  8044. header_ http.Header
  8045. }
  8046. // Remove: Remove the association between a deal and a creative.
  8047. func (r *AccountsCreativesDealAssociationsService) Remove(accountId string, creativeId string, removedealassociationrequest *RemoveDealAssociationRequest) *AccountsCreativesDealAssociationsRemoveCall {
  8048. c := &AccountsCreativesDealAssociationsRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8049. c.accountId = accountId
  8050. c.creativeId = creativeId
  8051. c.removedealassociationrequest = removedealassociationrequest
  8052. return c
  8053. }
  8054. // Fields allows partial responses to be retrieved. See
  8055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8056. // for more information.
  8057. func (c *AccountsCreativesDealAssociationsRemoveCall) Fields(s ...googleapi.Field) *AccountsCreativesDealAssociationsRemoveCall {
  8058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8059. return c
  8060. }
  8061. // Context sets the context to be used in this call's Do method. Any
  8062. // pending HTTP request will be aborted if the provided context is
  8063. // canceled.
  8064. func (c *AccountsCreativesDealAssociationsRemoveCall) Context(ctx context.Context) *AccountsCreativesDealAssociationsRemoveCall {
  8065. c.ctx_ = ctx
  8066. return c
  8067. }
  8068. // Header returns an http.Header that can be modified by the caller to
  8069. // add HTTP headers to the request.
  8070. func (c *AccountsCreativesDealAssociationsRemoveCall) Header() http.Header {
  8071. if c.header_ == nil {
  8072. c.header_ = make(http.Header)
  8073. }
  8074. return c.header_
  8075. }
  8076. func (c *AccountsCreativesDealAssociationsRemoveCall) doRequest(alt string) (*http.Response, error) {
  8077. reqHeaders := make(http.Header)
  8078. for k, v := range c.header_ {
  8079. reqHeaders[k] = v
  8080. }
  8081. reqHeaders.Set("User-Agent", c.s.userAgent())
  8082. var body io.Reader = nil
  8083. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removedealassociationrequest)
  8084. if err != nil {
  8085. return nil, err
  8086. }
  8087. reqHeaders.Set("Content-Type", "application/json")
  8088. c.urlParams_.Set("alt", alt)
  8089. c.urlParams_.Set("prettyPrint", "false")
  8090. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove")
  8091. urls += "?" + c.urlParams_.Encode()
  8092. req, err := http.NewRequest("POST", urls, body)
  8093. if err != nil {
  8094. return nil, err
  8095. }
  8096. req.Header = reqHeaders
  8097. googleapi.Expand(req.URL, map[string]string{
  8098. "accountId": c.accountId,
  8099. "creativeId": c.creativeId,
  8100. })
  8101. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8102. }
  8103. // Do executes the "adexchangebuyer2.accounts.creatives.dealAssociations.remove" call.
  8104. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  8105. // code is an error. Response headers are in either
  8106. // *Empty.ServerResponse.Header or (if a response was returned at all)
  8107. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8108. // check whether the returned error was because http.StatusNotModified
  8109. // was returned.
  8110. func (c *AccountsCreativesDealAssociationsRemoveCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8111. gensupport.SetOptions(c.urlParams_, opts...)
  8112. res, err := c.doRequest("json")
  8113. if res != nil && res.StatusCode == http.StatusNotModified {
  8114. if res.Body != nil {
  8115. res.Body.Close()
  8116. }
  8117. return nil, &googleapi.Error{
  8118. Code: res.StatusCode,
  8119. Header: res.Header,
  8120. }
  8121. }
  8122. if err != nil {
  8123. return nil, err
  8124. }
  8125. defer googleapi.CloseBody(res)
  8126. if err := googleapi.CheckResponse(res); err != nil {
  8127. return nil, err
  8128. }
  8129. ret := &Empty{
  8130. ServerResponse: googleapi.ServerResponse{
  8131. Header: res.Header,
  8132. HTTPStatusCode: res.StatusCode,
  8133. },
  8134. }
  8135. target := &ret
  8136. if err := gensupport.DecodeResponse(target, res); err != nil {
  8137. return nil, err
  8138. }
  8139. return ret, nil
  8140. // {
  8141. // "description": "Remove the association between a deal and a creative.",
  8142. // "flatPath": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove",
  8143. // "httpMethod": "POST",
  8144. // "id": "adexchangebuyer2.accounts.creatives.dealAssociations.remove",
  8145. // "parameterOrder": [
  8146. // "accountId",
  8147. // "creativeId"
  8148. // ],
  8149. // "parameters": {
  8150. // "accountId": {
  8151. // "description": "The account the creative belongs to.",
  8152. // "location": "path",
  8153. // "required": true,
  8154. // "type": "string"
  8155. // },
  8156. // "creativeId": {
  8157. // "description": "The ID of the creative associated with the deal.",
  8158. // "location": "path",
  8159. // "required": true,
  8160. // "type": "string"
  8161. // }
  8162. // },
  8163. // "path": "v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove",
  8164. // "request": {
  8165. // "$ref": "RemoveDealAssociationRequest"
  8166. // },
  8167. // "response": {
  8168. // "$ref": "Empty"
  8169. // },
  8170. // "scopes": [
  8171. // "https://www.googleapis.com/auth/adexchange.buyer"
  8172. // ]
  8173. // }
  8174. }
  8175. // method id "adexchangebuyer2.accounts.finalizedProposals.list":
  8176. type AccountsFinalizedProposalsListCall struct {
  8177. s *Service
  8178. accountId string
  8179. urlParams_ gensupport.URLParams
  8180. ifNoneMatch_ string
  8181. ctx_ context.Context
  8182. header_ http.Header
  8183. }
  8184. // List: List finalized proposals, regardless if a proposal is being
  8185. // renegotiated.
  8186. // A filter expression (PQL query) may be specified to filter the
  8187. // results.
  8188. // The notes will not be returned.
  8189. func (r *AccountsFinalizedProposalsService) List(accountId string) *AccountsFinalizedProposalsListCall {
  8190. c := &AccountsFinalizedProposalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8191. c.accountId = accountId
  8192. return c
  8193. }
  8194. // Filter sets the optional parameter "filter": An optional PQL filter
  8195. // query used to query for proposals.
  8196. //
  8197. // Nested repeated fields, such as
  8198. // proposal.deals.targetingCriterion,
  8199. // cannot be filtered.
  8200. func (c *AccountsFinalizedProposalsListCall) Filter(filter string) *AccountsFinalizedProposalsListCall {
  8201. c.urlParams_.Set("filter", filter)
  8202. return c
  8203. }
  8204. // FilterSyntax sets the optional parameter "filterSyntax": Syntax the
  8205. // filter is written in. Current implementation defaults to PQL
  8206. // but in the future it will be LIST_FILTER.
  8207. //
  8208. // Possible values:
  8209. // "FILTER_SYNTAX_UNSPECIFIED"
  8210. // "PQL"
  8211. // "LIST_FILTER"
  8212. func (c *AccountsFinalizedProposalsListCall) FilterSyntax(filterSyntax string) *AccountsFinalizedProposalsListCall {
  8213. c.urlParams_.Set("filterSyntax", filterSyntax)
  8214. return c
  8215. }
  8216. // PageSize sets the optional parameter "pageSize": Requested page size.
  8217. // The server may return fewer results than requested.
  8218. // If unspecified, the server will pick an appropriate default.
  8219. func (c *AccountsFinalizedProposalsListCall) PageSize(pageSize int64) *AccountsFinalizedProposalsListCall {
  8220. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8221. return c
  8222. }
  8223. // PageToken sets the optional parameter "pageToken": The page token as
  8224. // returned from ListProposalsResponse.
  8225. func (c *AccountsFinalizedProposalsListCall) PageToken(pageToken string) *AccountsFinalizedProposalsListCall {
  8226. c.urlParams_.Set("pageToken", pageToken)
  8227. return c
  8228. }
  8229. // Fields allows partial responses to be retrieved. See
  8230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8231. // for more information.
  8232. func (c *AccountsFinalizedProposalsListCall) Fields(s ...googleapi.Field) *AccountsFinalizedProposalsListCall {
  8233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8234. return c
  8235. }
  8236. // IfNoneMatch sets the optional parameter which makes the operation
  8237. // fail if the object's ETag matches the given value. This is useful for
  8238. // getting updates only after the object has changed since the last
  8239. // request. Use googleapi.IsNotModified to check whether the response
  8240. // error from Do is the result of In-None-Match.
  8241. func (c *AccountsFinalizedProposalsListCall) IfNoneMatch(entityTag string) *AccountsFinalizedProposalsListCall {
  8242. c.ifNoneMatch_ = entityTag
  8243. return c
  8244. }
  8245. // Context sets the context to be used in this call's Do method. Any
  8246. // pending HTTP request will be aborted if the provided context is
  8247. // canceled.
  8248. func (c *AccountsFinalizedProposalsListCall) Context(ctx context.Context) *AccountsFinalizedProposalsListCall {
  8249. c.ctx_ = ctx
  8250. return c
  8251. }
  8252. // Header returns an http.Header that can be modified by the caller to
  8253. // add HTTP headers to the request.
  8254. func (c *AccountsFinalizedProposalsListCall) Header() http.Header {
  8255. if c.header_ == nil {
  8256. c.header_ = make(http.Header)
  8257. }
  8258. return c.header_
  8259. }
  8260. func (c *AccountsFinalizedProposalsListCall) doRequest(alt string) (*http.Response, error) {
  8261. reqHeaders := make(http.Header)
  8262. for k, v := range c.header_ {
  8263. reqHeaders[k] = v
  8264. }
  8265. reqHeaders.Set("User-Agent", c.s.userAgent())
  8266. if c.ifNoneMatch_ != "" {
  8267. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8268. }
  8269. var body io.Reader = nil
  8270. c.urlParams_.Set("alt", alt)
  8271. c.urlParams_.Set("prettyPrint", "false")
  8272. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/finalizedProposals")
  8273. urls += "?" + c.urlParams_.Encode()
  8274. req, err := http.NewRequest("GET", urls, body)
  8275. if err != nil {
  8276. return nil, err
  8277. }
  8278. req.Header = reqHeaders
  8279. googleapi.Expand(req.URL, map[string]string{
  8280. "accountId": c.accountId,
  8281. })
  8282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8283. }
  8284. // Do executes the "adexchangebuyer2.accounts.finalizedProposals.list" call.
  8285. // Exactly one of *ListProposalsResponse or error will be non-nil. Any
  8286. // non-2xx status code is an error. Response headers are in either
  8287. // *ListProposalsResponse.ServerResponse.Header or (if a response was
  8288. // returned at all) in error.(*googleapi.Error).Header. Use
  8289. // googleapi.IsNotModified to check whether the returned error was
  8290. // because http.StatusNotModified was returned.
  8291. func (c *AccountsFinalizedProposalsListCall) Do(opts ...googleapi.CallOption) (*ListProposalsResponse, error) {
  8292. gensupport.SetOptions(c.urlParams_, opts...)
  8293. res, err := c.doRequest("json")
  8294. if res != nil && res.StatusCode == http.StatusNotModified {
  8295. if res.Body != nil {
  8296. res.Body.Close()
  8297. }
  8298. return nil, &googleapi.Error{
  8299. Code: res.StatusCode,
  8300. Header: res.Header,
  8301. }
  8302. }
  8303. if err != nil {
  8304. return nil, err
  8305. }
  8306. defer googleapi.CloseBody(res)
  8307. if err := googleapi.CheckResponse(res); err != nil {
  8308. return nil, err
  8309. }
  8310. ret := &ListProposalsResponse{
  8311. ServerResponse: googleapi.ServerResponse{
  8312. Header: res.Header,
  8313. HTTPStatusCode: res.StatusCode,
  8314. },
  8315. }
  8316. target := &ret
  8317. if err := gensupport.DecodeResponse(target, res); err != nil {
  8318. return nil, err
  8319. }
  8320. return ret, nil
  8321. // {
  8322. // "description": "List finalized proposals, regardless if a proposal is being renegotiated.\nA filter expression (PQL query) may be specified to filter the results.\nThe notes will not be returned.",
  8323. // "flatPath": "v2beta1/accounts/{accountId}/finalizedProposals",
  8324. // "httpMethod": "GET",
  8325. // "id": "adexchangebuyer2.accounts.finalizedProposals.list",
  8326. // "parameterOrder": [
  8327. // "accountId"
  8328. // ],
  8329. // "parameters": {
  8330. // "accountId": {
  8331. // "description": "Account ID of the buyer.",
  8332. // "location": "path",
  8333. // "required": true,
  8334. // "type": "string"
  8335. // },
  8336. // "filter": {
  8337. // "description": "An optional PQL filter query used to query for proposals.\n\nNested repeated fields, such as proposal.deals.targetingCriterion,\ncannot be filtered.",
  8338. // "location": "query",
  8339. // "type": "string"
  8340. // },
  8341. // "filterSyntax": {
  8342. // "description": "Syntax the filter is written in. Current implementation defaults to PQL\nbut in the future it will be LIST_FILTER.",
  8343. // "enum": [
  8344. // "FILTER_SYNTAX_UNSPECIFIED",
  8345. // "PQL",
  8346. // "LIST_FILTER"
  8347. // ],
  8348. // "location": "query",
  8349. // "type": "string"
  8350. // },
  8351. // "pageSize": {
  8352. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  8353. // "format": "int32",
  8354. // "location": "query",
  8355. // "type": "integer"
  8356. // },
  8357. // "pageToken": {
  8358. // "description": "The page token as returned from ListProposalsResponse.",
  8359. // "location": "query",
  8360. // "type": "string"
  8361. // }
  8362. // },
  8363. // "path": "v2beta1/accounts/{accountId}/finalizedProposals",
  8364. // "response": {
  8365. // "$ref": "ListProposalsResponse"
  8366. // },
  8367. // "scopes": [
  8368. // "https://www.googleapis.com/auth/adexchange.buyer"
  8369. // ]
  8370. // }
  8371. }
  8372. // Pages invokes f for each page of results.
  8373. // A non-nil error returned from f will halt the iteration.
  8374. // The provided context supersedes any context provided to the Context method.
  8375. func (c *AccountsFinalizedProposalsListCall) Pages(ctx context.Context, f func(*ListProposalsResponse) error) error {
  8376. c.ctx_ = ctx
  8377. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8378. for {
  8379. x, err := c.Do()
  8380. if err != nil {
  8381. return err
  8382. }
  8383. if err := f(x); err != nil {
  8384. return err
  8385. }
  8386. if x.NextPageToken == "" {
  8387. return nil
  8388. }
  8389. c.PageToken(x.NextPageToken)
  8390. }
  8391. }
  8392. // method id "adexchangebuyer2.accounts.products.get":
  8393. type AccountsProductsGetCall struct {
  8394. s *Service
  8395. accountId string
  8396. productId string
  8397. urlParams_ gensupport.URLParams
  8398. ifNoneMatch_ string
  8399. ctx_ context.Context
  8400. header_ http.Header
  8401. }
  8402. // Get: Gets the requested product by ID.
  8403. func (r *AccountsProductsService) Get(accountId string, productId string) *AccountsProductsGetCall {
  8404. c := &AccountsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8405. c.accountId = accountId
  8406. c.productId = productId
  8407. return c
  8408. }
  8409. // Fields allows partial responses to be retrieved. See
  8410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8411. // for more information.
  8412. func (c *AccountsProductsGetCall) Fields(s ...googleapi.Field) *AccountsProductsGetCall {
  8413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8414. return c
  8415. }
  8416. // IfNoneMatch sets the optional parameter which makes the operation
  8417. // fail if the object's ETag matches the given value. This is useful for
  8418. // getting updates only after the object has changed since the last
  8419. // request. Use googleapi.IsNotModified to check whether the response
  8420. // error from Do is the result of In-None-Match.
  8421. func (c *AccountsProductsGetCall) IfNoneMatch(entityTag string) *AccountsProductsGetCall {
  8422. c.ifNoneMatch_ = entityTag
  8423. return c
  8424. }
  8425. // Context sets the context to be used in this call's Do method. Any
  8426. // pending HTTP request will be aborted if the provided context is
  8427. // canceled.
  8428. func (c *AccountsProductsGetCall) Context(ctx context.Context) *AccountsProductsGetCall {
  8429. c.ctx_ = ctx
  8430. return c
  8431. }
  8432. // Header returns an http.Header that can be modified by the caller to
  8433. // add HTTP headers to the request.
  8434. func (c *AccountsProductsGetCall) Header() http.Header {
  8435. if c.header_ == nil {
  8436. c.header_ = make(http.Header)
  8437. }
  8438. return c.header_
  8439. }
  8440. func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) {
  8441. reqHeaders := make(http.Header)
  8442. for k, v := range c.header_ {
  8443. reqHeaders[k] = v
  8444. }
  8445. reqHeaders.Set("User-Agent", c.s.userAgent())
  8446. if c.ifNoneMatch_ != "" {
  8447. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8448. }
  8449. var body io.Reader = nil
  8450. c.urlParams_.Set("alt", alt)
  8451. c.urlParams_.Set("prettyPrint", "false")
  8452. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/products/{productId}")
  8453. urls += "?" + c.urlParams_.Encode()
  8454. req, err := http.NewRequest("GET", urls, body)
  8455. if err != nil {
  8456. return nil, err
  8457. }
  8458. req.Header = reqHeaders
  8459. googleapi.Expand(req.URL, map[string]string{
  8460. "accountId": c.accountId,
  8461. "productId": c.productId,
  8462. })
  8463. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8464. }
  8465. // Do executes the "adexchangebuyer2.accounts.products.get" call.
  8466. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  8467. // code is an error. Response headers are in either
  8468. // *Product.ServerResponse.Header or (if a response was returned at all)
  8469. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8470. // check whether the returned error was because http.StatusNotModified
  8471. // was returned.
  8472. func (c *AccountsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  8473. gensupport.SetOptions(c.urlParams_, opts...)
  8474. res, err := c.doRequest("json")
  8475. if res != nil && res.StatusCode == http.StatusNotModified {
  8476. if res.Body != nil {
  8477. res.Body.Close()
  8478. }
  8479. return nil, &googleapi.Error{
  8480. Code: res.StatusCode,
  8481. Header: res.Header,
  8482. }
  8483. }
  8484. if err != nil {
  8485. return nil, err
  8486. }
  8487. defer googleapi.CloseBody(res)
  8488. if err := googleapi.CheckResponse(res); err != nil {
  8489. return nil, err
  8490. }
  8491. ret := &Product{
  8492. ServerResponse: googleapi.ServerResponse{
  8493. Header: res.Header,
  8494. HTTPStatusCode: res.StatusCode,
  8495. },
  8496. }
  8497. target := &ret
  8498. if err := gensupport.DecodeResponse(target, res); err != nil {
  8499. return nil, err
  8500. }
  8501. return ret, nil
  8502. // {
  8503. // "description": "Gets the requested product by ID.",
  8504. // "flatPath": "v2beta1/accounts/{accountId}/products/{productId}",
  8505. // "httpMethod": "GET",
  8506. // "id": "adexchangebuyer2.accounts.products.get",
  8507. // "parameterOrder": [
  8508. // "accountId",
  8509. // "productId"
  8510. // ],
  8511. // "parameters": {
  8512. // "accountId": {
  8513. // "description": "Account ID of the buyer.",
  8514. // "location": "path",
  8515. // "required": true,
  8516. // "type": "string"
  8517. // },
  8518. // "productId": {
  8519. // "description": "The ID for the product to get the head revision for.",
  8520. // "location": "path",
  8521. // "required": true,
  8522. // "type": "string"
  8523. // }
  8524. // },
  8525. // "path": "v2beta1/accounts/{accountId}/products/{productId}",
  8526. // "response": {
  8527. // "$ref": "Product"
  8528. // },
  8529. // "scopes": [
  8530. // "https://www.googleapis.com/auth/adexchange.buyer"
  8531. // ]
  8532. // }
  8533. }
  8534. // method id "adexchangebuyer2.accounts.products.list":
  8535. type AccountsProductsListCall struct {
  8536. s *Service
  8537. accountId string
  8538. urlParams_ gensupport.URLParams
  8539. ifNoneMatch_ string
  8540. ctx_ context.Context
  8541. header_ http.Header
  8542. }
  8543. // List: List all products visible to the buyer (optionally filtered by
  8544. // the
  8545. // specified PQL query).
  8546. func (r *AccountsProductsService) List(accountId string) *AccountsProductsListCall {
  8547. c := &AccountsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8548. c.accountId = accountId
  8549. return c
  8550. }
  8551. // Filter sets the optional parameter "filter": An optional PQL query
  8552. // used to query for products.
  8553. // See
  8554. // https://developers.google.com/ad-manager/docs/pqlreference
  8555. // for documentation about PQL and examples.
  8556. //
  8557. // Nested repeated fields, such as
  8558. // product.targetingCriterion.inclusions,
  8559. // cannot be filtered.
  8560. func (c *AccountsProductsListCall) Filter(filter string) *AccountsProductsListCall {
  8561. c.urlParams_.Set("filter", filter)
  8562. return c
  8563. }
  8564. // PageSize sets the optional parameter "pageSize": Requested page size.
  8565. // The server may return fewer results than requested.
  8566. // If unspecified, the server will pick an appropriate default.
  8567. func (c *AccountsProductsListCall) PageSize(pageSize int64) *AccountsProductsListCall {
  8568. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8569. return c
  8570. }
  8571. // PageToken sets the optional parameter "pageToken": The page token as
  8572. // returned from ListProductsResponse.
  8573. func (c *AccountsProductsListCall) PageToken(pageToken string) *AccountsProductsListCall {
  8574. c.urlParams_.Set("pageToken", pageToken)
  8575. return c
  8576. }
  8577. // Fields allows partial responses to be retrieved. See
  8578. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8579. // for more information.
  8580. func (c *AccountsProductsListCall) Fields(s ...googleapi.Field) *AccountsProductsListCall {
  8581. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8582. return c
  8583. }
  8584. // IfNoneMatch sets the optional parameter which makes the operation
  8585. // fail if the object's ETag matches the given value. This is useful for
  8586. // getting updates only after the object has changed since the last
  8587. // request. Use googleapi.IsNotModified to check whether the response
  8588. // error from Do is the result of In-None-Match.
  8589. func (c *AccountsProductsListCall) IfNoneMatch(entityTag string) *AccountsProductsListCall {
  8590. c.ifNoneMatch_ = entityTag
  8591. return c
  8592. }
  8593. // Context sets the context to be used in this call's Do method. Any
  8594. // pending HTTP request will be aborted if the provided context is
  8595. // canceled.
  8596. func (c *AccountsProductsListCall) Context(ctx context.Context) *AccountsProductsListCall {
  8597. c.ctx_ = ctx
  8598. return c
  8599. }
  8600. // Header returns an http.Header that can be modified by the caller to
  8601. // add HTTP headers to the request.
  8602. func (c *AccountsProductsListCall) Header() http.Header {
  8603. if c.header_ == nil {
  8604. c.header_ = make(http.Header)
  8605. }
  8606. return c.header_
  8607. }
  8608. func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) {
  8609. reqHeaders := make(http.Header)
  8610. for k, v := range c.header_ {
  8611. reqHeaders[k] = v
  8612. }
  8613. reqHeaders.Set("User-Agent", c.s.userAgent())
  8614. if c.ifNoneMatch_ != "" {
  8615. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8616. }
  8617. var body io.Reader = nil
  8618. c.urlParams_.Set("alt", alt)
  8619. c.urlParams_.Set("prettyPrint", "false")
  8620. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/products")
  8621. urls += "?" + c.urlParams_.Encode()
  8622. req, err := http.NewRequest("GET", urls, body)
  8623. if err != nil {
  8624. return nil, err
  8625. }
  8626. req.Header = reqHeaders
  8627. googleapi.Expand(req.URL, map[string]string{
  8628. "accountId": c.accountId,
  8629. })
  8630. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8631. }
  8632. // Do executes the "adexchangebuyer2.accounts.products.list" call.
  8633. // Exactly one of *ListProductsResponse or error will be non-nil. Any
  8634. // non-2xx status code is an error. Response headers are in either
  8635. // *ListProductsResponse.ServerResponse.Header or (if a response was
  8636. // returned at all) in error.(*googleapi.Error).Header. Use
  8637. // googleapi.IsNotModified to check whether the returned error was
  8638. // because http.StatusNotModified was returned.
  8639. func (c *AccountsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) {
  8640. gensupport.SetOptions(c.urlParams_, opts...)
  8641. res, err := c.doRequest("json")
  8642. if res != nil && res.StatusCode == http.StatusNotModified {
  8643. if res.Body != nil {
  8644. res.Body.Close()
  8645. }
  8646. return nil, &googleapi.Error{
  8647. Code: res.StatusCode,
  8648. Header: res.Header,
  8649. }
  8650. }
  8651. if err != nil {
  8652. return nil, err
  8653. }
  8654. defer googleapi.CloseBody(res)
  8655. if err := googleapi.CheckResponse(res); err != nil {
  8656. return nil, err
  8657. }
  8658. ret := &ListProductsResponse{
  8659. ServerResponse: googleapi.ServerResponse{
  8660. Header: res.Header,
  8661. HTTPStatusCode: res.StatusCode,
  8662. },
  8663. }
  8664. target := &ret
  8665. if err := gensupport.DecodeResponse(target, res); err != nil {
  8666. return nil, err
  8667. }
  8668. return ret, nil
  8669. // {
  8670. // "description": "List all products visible to the buyer (optionally filtered by the\nspecified PQL query).",
  8671. // "flatPath": "v2beta1/accounts/{accountId}/products",
  8672. // "httpMethod": "GET",
  8673. // "id": "adexchangebuyer2.accounts.products.list",
  8674. // "parameterOrder": [
  8675. // "accountId"
  8676. // ],
  8677. // "parameters": {
  8678. // "accountId": {
  8679. // "description": "Account ID of the buyer.",
  8680. // "location": "path",
  8681. // "required": true,
  8682. // "type": "string"
  8683. // },
  8684. // "filter": {
  8685. // "description": "An optional PQL query used to query for products. See\nhttps://developers.google.com/ad-manager/docs/pqlreference\nfor documentation about PQL and examples.\n\nNested repeated fields, such as product.targetingCriterion.inclusions,\ncannot be filtered.",
  8686. // "location": "query",
  8687. // "type": "string"
  8688. // },
  8689. // "pageSize": {
  8690. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  8691. // "format": "int32",
  8692. // "location": "query",
  8693. // "type": "integer"
  8694. // },
  8695. // "pageToken": {
  8696. // "description": "The page token as returned from ListProductsResponse.",
  8697. // "location": "query",
  8698. // "type": "string"
  8699. // }
  8700. // },
  8701. // "path": "v2beta1/accounts/{accountId}/products",
  8702. // "response": {
  8703. // "$ref": "ListProductsResponse"
  8704. // },
  8705. // "scopes": [
  8706. // "https://www.googleapis.com/auth/adexchange.buyer"
  8707. // ]
  8708. // }
  8709. }
  8710. // Pages invokes f for each page of results.
  8711. // A non-nil error returned from f will halt the iteration.
  8712. // The provided context supersedes any context provided to the Context method.
  8713. func (c *AccountsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error {
  8714. c.ctx_ = ctx
  8715. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8716. for {
  8717. x, err := c.Do()
  8718. if err != nil {
  8719. return err
  8720. }
  8721. if err := f(x); err != nil {
  8722. return err
  8723. }
  8724. if x.NextPageToken == "" {
  8725. return nil
  8726. }
  8727. c.PageToken(x.NextPageToken)
  8728. }
  8729. }
  8730. // method id "adexchangebuyer2.accounts.proposals.accept":
  8731. type AccountsProposalsAcceptCall struct {
  8732. s *Service
  8733. accountId string
  8734. proposalId string
  8735. acceptproposalrequest *AcceptProposalRequest
  8736. urlParams_ gensupport.URLParams
  8737. ctx_ context.Context
  8738. header_ http.Header
  8739. }
  8740. // Accept: Mark the proposal as accepted at the given revision number.
  8741. // If the number
  8742. // does not match the server's revision number an `ABORTED` error
  8743. // message will
  8744. // be returned. This call updates the proposal_state from `PROPOSED`
  8745. // to
  8746. // `BUYER_ACCEPTED`, or from `SELLER_ACCEPTED` to `FINALIZED`.
  8747. func (r *AccountsProposalsService) Accept(accountId string, proposalId string, acceptproposalrequest *AcceptProposalRequest) *AccountsProposalsAcceptCall {
  8748. c := &AccountsProposalsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8749. c.accountId = accountId
  8750. c.proposalId = proposalId
  8751. c.acceptproposalrequest = acceptproposalrequest
  8752. return c
  8753. }
  8754. // Fields allows partial responses to be retrieved. See
  8755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8756. // for more information.
  8757. func (c *AccountsProposalsAcceptCall) Fields(s ...googleapi.Field) *AccountsProposalsAcceptCall {
  8758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8759. return c
  8760. }
  8761. // Context sets the context to be used in this call's Do method. Any
  8762. // pending HTTP request will be aborted if the provided context is
  8763. // canceled.
  8764. func (c *AccountsProposalsAcceptCall) Context(ctx context.Context) *AccountsProposalsAcceptCall {
  8765. c.ctx_ = ctx
  8766. return c
  8767. }
  8768. // Header returns an http.Header that can be modified by the caller to
  8769. // add HTTP headers to the request.
  8770. func (c *AccountsProposalsAcceptCall) Header() http.Header {
  8771. if c.header_ == nil {
  8772. c.header_ = make(http.Header)
  8773. }
  8774. return c.header_
  8775. }
  8776. func (c *AccountsProposalsAcceptCall) doRequest(alt string) (*http.Response, error) {
  8777. reqHeaders := make(http.Header)
  8778. for k, v := range c.header_ {
  8779. reqHeaders[k] = v
  8780. }
  8781. reqHeaders.Set("User-Agent", c.s.userAgent())
  8782. var body io.Reader = nil
  8783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptproposalrequest)
  8784. if err != nil {
  8785. return nil, err
  8786. }
  8787. reqHeaders.Set("Content-Type", "application/json")
  8788. c.urlParams_.Set("alt", alt)
  8789. c.urlParams_.Set("prettyPrint", "false")
  8790. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:accept")
  8791. urls += "?" + c.urlParams_.Encode()
  8792. req, err := http.NewRequest("POST", urls, body)
  8793. if err != nil {
  8794. return nil, err
  8795. }
  8796. req.Header = reqHeaders
  8797. googleapi.Expand(req.URL, map[string]string{
  8798. "accountId": c.accountId,
  8799. "proposalId": c.proposalId,
  8800. })
  8801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8802. }
  8803. // Do executes the "adexchangebuyer2.accounts.proposals.accept" call.
  8804. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  8805. // code is an error. Response headers are in either
  8806. // *Proposal.ServerResponse.Header or (if a response was returned at
  8807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8808. // to check whether the returned error was because
  8809. // http.StatusNotModified was returned.
  8810. func (c *AccountsProposalsAcceptCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  8811. gensupport.SetOptions(c.urlParams_, opts...)
  8812. res, err := c.doRequest("json")
  8813. if res != nil && res.StatusCode == http.StatusNotModified {
  8814. if res.Body != nil {
  8815. res.Body.Close()
  8816. }
  8817. return nil, &googleapi.Error{
  8818. Code: res.StatusCode,
  8819. Header: res.Header,
  8820. }
  8821. }
  8822. if err != nil {
  8823. return nil, err
  8824. }
  8825. defer googleapi.CloseBody(res)
  8826. if err := googleapi.CheckResponse(res); err != nil {
  8827. return nil, err
  8828. }
  8829. ret := &Proposal{
  8830. ServerResponse: googleapi.ServerResponse{
  8831. Header: res.Header,
  8832. HTTPStatusCode: res.StatusCode,
  8833. },
  8834. }
  8835. target := &ret
  8836. if err := gensupport.DecodeResponse(target, res); err != nil {
  8837. return nil, err
  8838. }
  8839. return ret, nil
  8840. // {
  8841. // "description": "Mark the proposal as accepted at the given revision number. If the number\ndoes not match the server's revision number an `ABORTED` error message will\nbe returned. This call updates the proposal_state from `PROPOSED` to\n`BUYER_ACCEPTED`, or from `SELLER_ACCEPTED` to `FINALIZED`.",
  8842. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:accept",
  8843. // "httpMethod": "POST",
  8844. // "id": "adexchangebuyer2.accounts.proposals.accept",
  8845. // "parameterOrder": [
  8846. // "accountId",
  8847. // "proposalId"
  8848. // ],
  8849. // "parameters": {
  8850. // "accountId": {
  8851. // "description": "Account ID of the buyer.",
  8852. // "location": "path",
  8853. // "required": true,
  8854. // "type": "string"
  8855. // },
  8856. // "proposalId": {
  8857. // "description": "The ID of the proposal to accept.",
  8858. // "location": "path",
  8859. // "required": true,
  8860. // "type": "string"
  8861. // }
  8862. // },
  8863. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:accept",
  8864. // "request": {
  8865. // "$ref": "AcceptProposalRequest"
  8866. // },
  8867. // "response": {
  8868. // "$ref": "Proposal"
  8869. // },
  8870. // "scopes": [
  8871. // "https://www.googleapis.com/auth/adexchange.buyer"
  8872. // ]
  8873. // }
  8874. }
  8875. // method id "adexchangebuyer2.accounts.proposals.addNote":
  8876. type AccountsProposalsAddNoteCall struct {
  8877. s *Service
  8878. accountId string
  8879. proposalId string
  8880. addnoterequest *AddNoteRequest
  8881. urlParams_ gensupport.URLParams
  8882. ctx_ context.Context
  8883. header_ http.Header
  8884. }
  8885. // AddNote: Create a new note and attach it to the proposal. The note is
  8886. // assigned
  8887. // a unique ID by the server.
  8888. // The proposal revision number will not increase when associated with
  8889. // a
  8890. // new note.
  8891. func (r *AccountsProposalsService) AddNote(accountId string, proposalId string, addnoterequest *AddNoteRequest) *AccountsProposalsAddNoteCall {
  8892. c := &AccountsProposalsAddNoteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8893. c.accountId = accountId
  8894. c.proposalId = proposalId
  8895. c.addnoterequest = addnoterequest
  8896. return c
  8897. }
  8898. // Fields allows partial responses to be retrieved. See
  8899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8900. // for more information.
  8901. func (c *AccountsProposalsAddNoteCall) Fields(s ...googleapi.Field) *AccountsProposalsAddNoteCall {
  8902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8903. return c
  8904. }
  8905. // Context sets the context to be used in this call's Do method. Any
  8906. // pending HTTP request will be aborted if the provided context is
  8907. // canceled.
  8908. func (c *AccountsProposalsAddNoteCall) Context(ctx context.Context) *AccountsProposalsAddNoteCall {
  8909. c.ctx_ = ctx
  8910. return c
  8911. }
  8912. // Header returns an http.Header that can be modified by the caller to
  8913. // add HTTP headers to the request.
  8914. func (c *AccountsProposalsAddNoteCall) Header() http.Header {
  8915. if c.header_ == nil {
  8916. c.header_ = make(http.Header)
  8917. }
  8918. return c.header_
  8919. }
  8920. func (c *AccountsProposalsAddNoteCall) doRequest(alt string) (*http.Response, error) {
  8921. reqHeaders := make(http.Header)
  8922. for k, v := range c.header_ {
  8923. reqHeaders[k] = v
  8924. }
  8925. reqHeaders.Set("User-Agent", c.s.userAgent())
  8926. var body io.Reader = nil
  8927. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addnoterequest)
  8928. if err != nil {
  8929. return nil, err
  8930. }
  8931. reqHeaders.Set("Content-Type", "application/json")
  8932. c.urlParams_.Set("alt", alt)
  8933. c.urlParams_.Set("prettyPrint", "false")
  8934. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:addNote")
  8935. urls += "?" + c.urlParams_.Encode()
  8936. req, err := http.NewRequest("POST", urls, body)
  8937. if err != nil {
  8938. return nil, err
  8939. }
  8940. req.Header = reqHeaders
  8941. googleapi.Expand(req.URL, map[string]string{
  8942. "accountId": c.accountId,
  8943. "proposalId": c.proposalId,
  8944. })
  8945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8946. }
  8947. // Do executes the "adexchangebuyer2.accounts.proposals.addNote" call.
  8948. // Exactly one of *Note or error will be non-nil. Any non-2xx status
  8949. // code is an error. Response headers are in either
  8950. // *Note.ServerResponse.Header or (if a response was returned at all) in
  8951. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8952. // whether the returned error was because http.StatusNotModified was
  8953. // returned.
  8954. func (c *AccountsProposalsAddNoteCall) Do(opts ...googleapi.CallOption) (*Note, error) {
  8955. gensupport.SetOptions(c.urlParams_, opts...)
  8956. res, err := c.doRequest("json")
  8957. if res != nil && res.StatusCode == http.StatusNotModified {
  8958. if res.Body != nil {
  8959. res.Body.Close()
  8960. }
  8961. return nil, &googleapi.Error{
  8962. Code: res.StatusCode,
  8963. Header: res.Header,
  8964. }
  8965. }
  8966. if err != nil {
  8967. return nil, err
  8968. }
  8969. defer googleapi.CloseBody(res)
  8970. if err := googleapi.CheckResponse(res); err != nil {
  8971. return nil, err
  8972. }
  8973. ret := &Note{
  8974. ServerResponse: googleapi.ServerResponse{
  8975. Header: res.Header,
  8976. HTTPStatusCode: res.StatusCode,
  8977. },
  8978. }
  8979. target := &ret
  8980. if err := gensupport.DecodeResponse(target, res); err != nil {
  8981. return nil, err
  8982. }
  8983. return ret, nil
  8984. // {
  8985. // "description": "Create a new note and attach it to the proposal. The note is assigned\na unique ID by the server.\nThe proposal revision number will not increase when associated with a\nnew note.",
  8986. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:addNote",
  8987. // "httpMethod": "POST",
  8988. // "id": "adexchangebuyer2.accounts.proposals.addNote",
  8989. // "parameterOrder": [
  8990. // "accountId",
  8991. // "proposalId"
  8992. // ],
  8993. // "parameters": {
  8994. // "accountId": {
  8995. // "description": "Account ID of the buyer.",
  8996. // "location": "path",
  8997. // "required": true,
  8998. // "type": "string"
  8999. // },
  9000. // "proposalId": {
  9001. // "description": "The ID of the proposal to attach the note to.",
  9002. // "location": "path",
  9003. // "required": true,
  9004. // "type": "string"
  9005. // }
  9006. // },
  9007. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:addNote",
  9008. // "request": {
  9009. // "$ref": "AddNoteRequest"
  9010. // },
  9011. // "response": {
  9012. // "$ref": "Note"
  9013. // },
  9014. // "scopes": [
  9015. // "https://www.googleapis.com/auth/adexchange.buyer"
  9016. // ]
  9017. // }
  9018. }
  9019. // method id "adexchangebuyer2.accounts.proposals.cancelNegotiation":
  9020. type AccountsProposalsCancelNegotiationCall struct {
  9021. s *Service
  9022. accountId string
  9023. proposalId string
  9024. cancelnegotiationrequest *CancelNegotiationRequest
  9025. urlParams_ gensupport.URLParams
  9026. ctx_ context.Context
  9027. header_ http.Header
  9028. }
  9029. // CancelNegotiation: Cancel an ongoing negotiation on a proposal. This
  9030. // does not cancel or end
  9031. // serving for the deals if the proposal has been finalized, but only
  9032. // cancels
  9033. // a negotiation unilaterally.
  9034. func (r *AccountsProposalsService) CancelNegotiation(accountId string, proposalId string, cancelnegotiationrequest *CancelNegotiationRequest) *AccountsProposalsCancelNegotiationCall {
  9035. c := &AccountsProposalsCancelNegotiationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9036. c.accountId = accountId
  9037. c.proposalId = proposalId
  9038. c.cancelnegotiationrequest = cancelnegotiationrequest
  9039. return c
  9040. }
  9041. // Fields allows partial responses to be retrieved. See
  9042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9043. // for more information.
  9044. func (c *AccountsProposalsCancelNegotiationCall) Fields(s ...googleapi.Field) *AccountsProposalsCancelNegotiationCall {
  9045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9046. return c
  9047. }
  9048. // Context sets the context to be used in this call's Do method. Any
  9049. // pending HTTP request will be aborted if the provided context is
  9050. // canceled.
  9051. func (c *AccountsProposalsCancelNegotiationCall) Context(ctx context.Context) *AccountsProposalsCancelNegotiationCall {
  9052. c.ctx_ = ctx
  9053. return c
  9054. }
  9055. // Header returns an http.Header that can be modified by the caller to
  9056. // add HTTP headers to the request.
  9057. func (c *AccountsProposalsCancelNegotiationCall) Header() http.Header {
  9058. if c.header_ == nil {
  9059. c.header_ = make(http.Header)
  9060. }
  9061. return c.header_
  9062. }
  9063. func (c *AccountsProposalsCancelNegotiationCall) doRequest(alt string) (*http.Response, error) {
  9064. reqHeaders := make(http.Header)
  9065. for k, v := range c.header_ {
  9066. reqHeaders[k] = v
  9067. }
  9068. reqHeaders.Set("User-Agent", c.s.userAgent())
  9069. var body io.Reader = nil
  9070. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelnegotiationrequest)
  9071. if err != nil {
  9072. return nil, err
  9073. }
  9074. reqHeaders.Set("Content-Type", "application/json")
  9075. c.urlParams_.Set("alt", alt)
  9076. c.urlParams_.Set("prettyPrint", "false")
  9077. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:cancelNegotiation")
  9078. urls += "?" + c.urlParams_.Encode()
  9079. req, err := http.NewRequest("POST", urls, body)
  9080. if err != nil {
  9081. return nil, err
  9082. }
  9083. req.Header = reqHeaders
  9084. googleapi.Expand(req.URL, map[string]string{
  9085. "accountId": c.accountId,
  9086. "proposalId": c.proposalId,
  9087. })
  9088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9089. }
  9090. // Do executes the "adexchangebuyer2.accounts.proposals.cancelNegotiation" call.
  9091. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  9092. // code is an error. Response headers are in either
  9093. // *Proposal.ServerResponse.Header or (if a response was returned at
  9094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9095. // to check whether the returned error was because
  9096. // http.StatusNotModified was returned.
  9097. func (c *AccountsProposalsCancelNegotiationCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  9098. gensupport.SetOptions(c.urlParams_, opts...)
  9099. res, err := c.doRequest("json")
  9100. if res != nil && res.StatusCode == http.StatusNotModified {
  9101. if res.Body != nil {
  9102. res.Body.Close()
  9103. }
  9104. return nil, &googleapi.Error{
  9105. Code: res.StatusCode,
  9106. Header: res.Header,
  9107. }
  9108. }
  9109. if err != nil {
  9110. return nil, err
  9111. }
  9112. defer googleapi.CloseBody(res)
  9113. if err := googleapi.CheckResponse(res); err != nil {
  9114. return nil, err
  9115. }
  9116. ret := &Proposal{
  9117. ServerResponse: googleapi.ServerResponse{
  9118. Header: res.Header,
  9119. HTTPStatusCode: res.StatusCode,
  9120. },
  9121. }
  9122. target := &ret
  9123. if err := gensupport.DecodeResponse(target, res); err != nil {
  9124. return nil, err
  9125. }
  9126. return ret, nil
  9127. // {
  9128. // "description": "Cancel an ongoing negotiation on a proposal. This does not cancel or end\nserving for the deals if the proposal has been finalized, but only cancels\na negotiation unilaterally.",
  9129. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:cancelNegotiation",
  9130. // "httpMethod": "POST",
  9131. // "id": "adexchangebuyer2.accounts.proposals.cancelNegotiation",
  9132. // "parameterOrder": [
  9133. // "accountId",
  9134. // "proposalId"
  9135. // ],
  9136. // "parameters": {
  9137. // "accountId": {
  9138. // "description": "Account ID of the buyer.",
  9139. // "location": "path",
  9140. // "required": true,
  9141. // "type": "string"
  9142. // },
  9143. // "proposalId": {
  9144. // "description": "The ID of the proposal to cancel negotiation for.",
  9145. // "location": "path",
  9146. // "required": true,
  9147. // "type": "string"
  9148. // }
  9149. // },
  9150. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:cancelNegotiation",
  9151. // "request": {
  9152. // "$ref": "CancelNegotiationRequest"
  9153. // },
  9154. // "response": {
  9155. // "$ref": "Proposal"
  9156. // },
  9157. // "scopes": [
  9158. // "https://www.googleapis.com/auth/adexchange.buyer"
  9159. // ]
  9160. // }
  9161. }
  9162. // method id "adexchangebuyer2.accounts.proposals.completeSetup":
  9163. type AccountsProposalsCompleteSetupCall struct {
  9164. s *Service
  9165. accountId string
  9166. proposalId string
  9167. completesetuprequest *CompleteSetupRequest
  9168. urlParams_ gensupport.URLParams
  9169. ctx_ context.Context
  9170. header_ http.Header
  9171. }
  9172. // CompleteSetup: Update the given proposal to indicate that setup has
  9173. // been completed.
  9174. // This method is called by the buyer when the line items have been
  9175. // created
  9176. // on their end for a finalized proposal and all the required
  9177. // creatives
  9178. // have been uploaded using the creatives API. This call updates
  9179. // the
  9180. // `is_setup_completed` bit on the proposal and also notifies the
  9181. // seller.
  9182. // The server will advance the revision number of the most recent
  9183. // proposal.
  9184. func (r *AccountsProposalsService) CompleteSetup(accountId string, proposalId string, completesetuprequest *CompleteSetupRequest) *AccountsProposalsCompleteSetupCall {
  9185. c := &AccountsProposalsCompleteSetupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9186. c.accountId = accountId
  9187. c.proposalId = proposalId
  9188. c.completesetuprequest = completesetuprequest
  9189. return c
  9190. }
  9191. // Fields allows partial responses to be retrieved. See
  9192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9193. // for more information.
  9194. func (c *AccountsProposalsCompleteSetupCall) Fields(s ...googleapi.Field) *AccountsProposalsCompleteSetupCall {
  9195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9196. return c
  9197. }
  9198. // Context sets the context to be used in this call's Do method. Any
  9199. // pending HTTP request will be aborted if the provided context is
  9200. // canceled.
  9201. func (c *AccountsProposalsCompleteSetupCall) Context(ctx context.Context) *AccountsProposalsCompleteSetupCall {
  9202. c.ctx_ = ctx
  9203. return c
  9204. }
  9205. // Header returns an http.Header that can be modified by the caller to
  9206. // add HTTP headers to the request.
  9207. func (c *AccountsProposalsCompleteSetupCall) Header() http.Header {
  9208. if c.header_ == nil {
  9209. c.header_ = make(http.Header)
  9210. }
  9211. return c.header_
  9212. }
  9213. func (c *AccountsProposalsCompleteSetupCall) doRequest(alt string) (*http.Response, error) {
  9214. reqHeaders := make(http.Header)
  9215. for k, v := range c.header_ {
  9216. reqHeaders[k] = v
  9217. }
  9218. reqHeaders.Set("User-Agent", c.s.userAgent())
  9219. var body io.Reader = nil
  9220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.completesetuprequest)
  9221. if err != nil {
  9222. return nil, err
  9223. }
  9224. reqHeaders.Set("Content-Type", "application/json")
  9225. c.urlParams_.Set("alt", alt)
  9226. c.urlParams_.Set("prettyPrint", "false")
  9227. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:completeSetup")
  9228. urls += "?" + c.urlParams_.Encode()
  9229. req, err := http.NewRequest("POST", urls, body)
  9230. if err != nil {
  9231. return nil, err
  9232. }
  9233. req.Header = reqHeaders
  9234. googleapi.Expand(req.URL, map[string]string{
  9235. "accountId": c.accountId,
  9236. "proposalId": c.proposalId,
  9237. })
  9238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9239. }
  9240. // Do executes the "adexchangebuyer2.accounts.proposals.completeSetup" call.
  9241. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  9242. // code is an error. Response headers are in either
  9243. // *Proposal.ServerResponse.Header or (if a response was returned at
  9244. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9245. // to check whether the returned error was because
  9246. // http.StatusNotModified was returned.
  9247. func (c *AccountsProposalsCompleteSetupCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  9248. gensupport.SetOptions(c.urlParams_, opts...)
  9249. res, err := c.doRequest("json")
  9250. if res != nil && res.StatusCode == http.StatusNotModified {
  9251. if res.Body != nil {
  9252. res.Body.Close()
  9253. }
  9254. return nil, &googleapi.Error{
  9255. Code: res.StatusCode,
  9256. Header: res.Header,
  9257. }
  9258. }
  9259. if err != nil {
  9260. return nil, err
  9261. }
  9262. defer googleapi.CloseBody(res)
  9263. if err := googleapi.CheckResponse(res); err != nil {
  9264. return nil, err
  9265. }
  9266. ret := &Proposal{
  9267. ServerResponse: googleapi.ServerResponse{
  9268. Header: res.Header,
  9269. HTTPStatusCode: res.StatusCode,
  9270. },
  9271. }
  9272. target := &ret
  9273. if err := gensupport.DecodeResponse(target, res); err != nil {
  9274. return nil, err
  9275. }
  9276. return ret, nil
  9277. // {
  9278. // "description": "Update the given proposal to indicate that setup has been completed.\nThis method is called by the buyer when the line items have been created\non their end for a finalized proposal and all the required creatives\nhave been uploaded using the creatives API. This call updates the\n`is_setup_completed` bit on the proposal and also notifies the seller.\nThe server will advance the revision number of the most recent proposal.",
  9279. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:completeSetup",
  9280. // "httpMethod": "POST",
  9281. // "id": "adexchangebuyer2.accounts.proposals.completeSetup",
  9282. // "parameterOrder": [
  9283. // "accountId",
  9284. // "proposalId"
  9285. // ],
  9286. // "parameters": {
  9287. // "accountId": {
  9288. // "description": "Account ID of the buyer.",
  9289. // "location": "path",
  9290. // "required": true,
  9291. // "type": "string"
  9292. // },
  9293. // "proposalId": {
  9294. // "description": "The ID of the proposal to mark as setup completed.",
  9295. // "location": "path",
  9296. // "required": true,
  9297. // "type": "string"
  9298. // }
  9299. // },
  9300. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:completeSetup",
  9301. // "request": {
  9302. // "$ref": "CompleteSetupRequest"
  9303. // },
  9304. // "response": {
  9305. // "$ref": "Proposal"
  9306. // },
  9307. // "scopes": [
  9308. // "https://www.googleapis.com/auth/adexchange.buyer"
  9309. // ]
  9310. // }
  9311. }
  9312. // method id "adexchangebuyer2.accounts.proposals.create":
  9313. type AccountsProposalsCreateCall struct {
  9314. s *Service
  9315. accountId string
  9316. proposal *Proposal
  9317. urlParams_ gensupport.URLParams
  9318. ctx_ context.Context
  9319. header_ http.Header
  9320. }
  9321. // Create: Create the given proposal. Each created proposal and any
  9322. // deals it contains
  9323. // are assigned a unique ID by the server.
  9324. func (r *AccountsProposalsService) Create(accountId string, proposal *Proposal) *AccountsProposalsCreateCall {
  9325. c := &AccountsProposalsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9326. c.accountId = accountId
  9327. c.proposal = proposal
  9328. return c
  9329. }
  9330. // Fields allows partial responses to be retrieved. See
  9331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9332. // for more information.
  9333. func (c *AccountsProposalsCreateCall) Fields(s ...googleapi.Field) *AccountsProposalsCreateCall {
  9334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9335. return c
  9336. }
  9337. // Context sets the context to be used in this call's Do method. Any
  9338. // pending HTTP request will be aborted if the provided context is
  9339. // canceled.
  9340. func (c *AccountsProposalsCreateCall) Context(ctx context.Context) *AccountsProposalsCreateCall {
  9341. c.ctx_ = ctx
  9342. return c
  9343. }
  9344. // Header returns an http.Header that can be modified by the caller to
  9345. // add HTTP headers to the request.
  9346. func (c *AccountsProposalsCreateCall) Header() http.Header {
  9347. if c.header_ == nil {
  9348. c.header_ = make(http.Header)
  9349. }
  9350. return c.header_
  9351. }
  9352. func (c *AccountsProposalsCreateCall) doRequest(alt string) (*http.Response, error) {
  9353. reqHeaders := make(http.Header)
  9354. for k, v := range c.header_ {
  9355. reqHeaders[k] = v
  9356. }
  9357. reqHeaders.Set("User-Agent", c.s.userAgent())
  9358. var body io.Reader = nil
  9359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
  9360. if err != nil {
  9361. return nil, err
  9362. }
  9363. reqHeaders.Set("Content-Type", "application/json")
  9364. c.urlParams_.Set("alt", alt)
  9365. c.urlParams_.Set("prettyPrint", "false")
  9366. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals")
  9367. urls += "?" + c.urlParams_.Encode()
  9368. req, err := http.NewRequest("POST", urls, body)
  9369. if err != nil {
  9370. return nil, err
  9371. }
  9372. req.Header = reqHeaders
  9373. googleapi.Expand(req.URL, map[string]string{
  9374. "accountId": c.accountId,
  9375. })
  9376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9377. }
  9378. // Do executes the "adexchangebuyer2.accounts.proposals.create" call.
  9379. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  9380. // code is an error. Response headers are in either
  9381. // *Proposal.ServerResponse.Header or (if a response was returned at
  9382. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9383. // to check whether the returned error was because
  9384. // http.StatusNotModified was returned.
  9385. func (c *AccountsProposalsCreateCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  9386. gensupport.SetOptions(c.urlParams_, opts...)
  9387. res, err := c.doRequest("json")
  9388. if res != nil && res.StatusCode == http.StatusNotModified {
  9389. if res.Body != nil {
  9390. res.Body.Close()
  9391. }
  9392. return nil, &googleapi.Error{
  9393. Code: res.StatusCode,
  9394. Header: res.Header,
  9395. }
  9396. }
  9397. if err != nil {
  9398. return nil, err
  9399. }
  9400. defer googleapi.CloseBody(res)
  9401. if err := googleapi.CheckResponse(res); err != nil {
  9402. return nil, err
  9403. }
  9404. ret := &Proposal{
  9405. ServerResponse: googleapi.ServerResponse{
  9406. Header: res.Header,
  9407. HTTPStatusCode: res.StatusCode,
  9408. },
  9409. }
  9410. target := &ret
  9411. if err := gensupport.DecodeResponse(target, res); err != nil {
  9412. return nil, err
  9413. }
  9414. return ret, nil
  9415. // {
  9416. // "description": "Create the given proposal. Each created proposal and any deals it contains\nare assigned a unique ID by the server.",
  9417. // "flatPath": "v2beta1/accounts/{accountId}/proposals",
  9418. // "httpMethod": "POST",
  9419. // "id": "adexchangebuyer2.accounts.proposals.create",
  9420. // "parameterOrder": [
  9421. // "accountId"
  9422. // ],
  9423. // "parameters": {
  9424. // "accountId": {
  9425. // "description": "Account ID of the buyer.",
  9426. // "location": "path",
  9427. // "required": true,
  9428. // "type": "string"
  9429. // }
  9430. // },
  9431. // "path": "v2beta1/accounts/{accountId}/proposals",
  9432. // "request": {
  9433. // "$ref": "Proposal"
  9434. // },
  9435. // "response": {
  9436. // "$ref": "Proposal"
  9437. // },
  9438. // "scopes": [
  9439. // "https://www.googleapis.com/auth/adexchange.buyer"
  9440. // ]
  9441. // }
  9442. }
  9443. // method id "adexchangebuyer2.accounts.proposals.get":
  9444. type AccountsProposalsGetCall struct {
  9445. s *Service
  9446. accountId string
  9447. proposalId string
  9448. urlParams_ gensupport.URLParams
  9449. ifNoneMatch_ string
  9450. ctx_ context.Context
  9451. header_ http.Header
  9452. }
  9453. // Get: Gets a proposal given its ID. The proposal is returned at its
  9454. // head
  9455. // revision.
  9456. func (r *AccountsProposalsService) Get(accountId string, proposalId string) *AccountsProposalsGetCall {
  9457. c := &AccountsProposalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9458. c.accountId = accountId
  9459. c.proposalId = proposalId
  9460. return c
  9461. }
  9462. // Fields allows partial responses to be retrieved. See
  9463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9464. // for more information.
  9465. func (c *AccountsProposalsGetCall) Fields(s ...googleapi.Field) *AccountsProposalsGetCall {
  9466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9467. return c
  9468. }
  9469. // IfNoneMatch sets the optional parameter which makes the operation
  9470. // fail if the object's ETag matches the given value. This is useful for
  9471. // getting updates only after the object has changed since the last
  9472. // request. Use googleapi.IsNotModified to check whether the response
  9473. // error from Do is the result of In-None-Match.
  9474. func (c *AccountsProposalsGetCall) IfNoneMatch(entityTag string) *AccountsProposalsGetCall {
  9475. c.ifNoneMatch_ = entityTag
  9476. return c
  9477. }
  9478. // Context sets the context to be used in this call's Do method. Any
  9479. // pending HTTP request will be aborted if the provided context is
  9480. // canceled.
  9481. func (c *AccountsProposalsGetCall) Context(ctx context.Context) *AccountsProposalsGetCall {
  9482. c.ctx_ = ctx
  9483. return c
  9484. }
  9485. // Header returns an http.Header that can be modified by the caller to
  9486. // add HTTP headers to the request.
  9487. func (c *AccountsProposalsGetCall) Header() http.Header {
  9488. if c.header_ == nil {
  9489. c.header_ = make(http.Header)
  9490. }
  9491. return c.header_
  9492. }
  9493. func (c *AccountsProposalsGetCall) doRequest(alt string) (*http.Response, error) {
  9494. reqHeaders := make(http.Header)
  9495. for k, v := range c.header_ {
  9496. reqHeaders[k] = v
  9497. }
  9498. reqHeaders.Set("User-Agent", c.s.userAgent())
  9499. if c.ifNoneMatch_ != "" {
  9500. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9501. }
  9502. var body io.Reader = nil
  9503. c.urlParams_.Set("alt", alt)
  9504. c.urlParams_.Set("prettyPrint", "false")
  9505. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}")
  9506. urls += "?" + c.urlParams_.Encode()
  9507. req, err := http.NewRequest("GET", urls, body)
  9508. if err != nil {
  9509. return nil, err
  9510. }
  9511. req.Header = reqHeaders
  9512. googleapi.Expand(req.URL, map[string]string{
  9513. "accountId": c.accountId,
  9514. "proposalId": c.proposalId,
  9515. })
  9516. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9517. }
  9518. // Do executes the "adexchangebuyer2.accounts.proposals.get" call.
  9519. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  9520. // code is an error. Response headers are in either
  9521. // *Proposal.ServerResponse.Header or (if a response was returned at
  9522. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9523. // to check whether the returned error was because
  9524. // http.StatusNotModified was returned.
  9525. func (c *AccountsProposalsGetCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  9526. gensupport.SetOptions(c.urlParams_, opts...)
  9527. res, err := c.doRequest("json")
  9528. if res != nil && res.StatusCode == http.StatusNotModified {
  9529. if res.Body != nil {
  9530. res.Body.Close()
  9531. }
  9532. return nil, &googleapi.Error{
  9533. Code: res.StatusCode,
  9534. Header: res.Header,
  9535. }
  9536. }
  9537. if err != nil {
  9538. return nil, err
  9539. }
  9540. defer googleapi.CloseBody(res)
  9541. if err := googleapi.CheckResponse(res); err != nil {
  9542. return nil, err
  9543. }
  9544. ret := &Proposal{
  9545. ServerResponse: googleapi.ServerResponse{
  9546. Header: res.Header,
  9547. HTTPStatusCode: res.StatusCode,
  9548. },
  9549. }
  9550. target := &ret
  9551. if err := gensupport.DecodeResponse(target, res); err != nil {
  9552. return nil, err
  9553. }
  9554. return ret, nil
  9555. // {
  9556. // "description": "Gets a proposal given its ID. The proposal is returned at its head\nrevision.",
  9557. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}",
  9558. // "httpMethod": "GET",
  9559. // "id": "adexchangebuyer2.accounts.proposals.get",
  9560. // "parameterOrder": [
  9561. // "accountId",
  9562. // "proposalId"
  9563. // ],
  9564. // "parameters": {
  9565. // "accountId": {
  9566. // "description": "Account ID of the buyer.",
  9567. // "location": "path",
  9568. // "required": true,
  9569. // "type": "string"
  9570. // },
  9571. // "proposalId": {
  9572. // "description": "The unique ID of the proposal",
  9573. // "location": "path",
  9574. // "required": true,
  9575. // "type": "string"
  9576. // }
  9577. // },
  9578. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}",
  9579. // "response": {
  9580. // "$ref": "Proposal"
  9581. // },
  9582. // "scopes": [
  9583. // "https://www.googleapis.com/auth/adexchange.buyer"
  9584. // ]
  9585. // }
  9586. }
  9587. // method id "adexchangebuyer2.accounts.proposals.list":
  9588. type AccountsProposalsListCall struct {
  9589. s *Service
  9590. accountId string
  9591. urlParams_ gensupport.URLParams
  9592. ifNoneMatch_ string
  9593. ctx_ context.Context
  9594. header_ http.Header
  9595. }
  9596. // List: List proposals. A filter expression (PQL query) may be
  9597. // specified to
  9598. // filter the results. To retrieve all finalized proposals, regardless
  9599. // if a
  9600. // proposal is being renegotiated, see the FinalizedProposals
  9601. // resource.
  9602. // Note that Bidder/ChildSeat relationships differ from the usual
  9603. // behavior.
  9604. // A Bidder account can only see its child seats' proposals by
  9605. // specifying
  9606. // the ChildSeat's accountId in the request path.
  9607. func (r *AccountsProposalsService) List(accountId string) *AccountsProposalsListCall {
  9608. c := &AccountsProposalsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9609. c.accountId = accountId
  9610. return c
  9611. }
  9612. // Filter sets the optional parameter "filter": An optional PQL filter
  9613. // query used to query for proposals.
  9614. //
  9615. // Nested repeated fields, such as
  9616. // proposal.deals.targetingCriterion,
  9617. // cannot be filtered.
  9618. func (c *AccountsProposalsListCall) Filter(filter string) *AccountsProposalsListCall {
  9619. c.urlParams_.Set("filter", filter)
  9620. return c
  9621. }
  9622. // FilterSyntax sets the optional parameter "filterSyntax": Syntax the
  9623. // filter is written in. Current implementation defaults to PQL
  9624. // but in the future it will be LIST_FILTER.
  9625. //
  9626. // Possible values:
  9627. // "FILTER_SYNTAX_UNSPECIFIED"
  9628. // "PQL"
  9629. // "LIST_FILTER"
  9630. func (c *AccountsProposalsListCall) FilterSyntax(filterSyntax string) *AccountsProposalsListCall {
  9631. c.urlParams_.Set("filterSyntax", filterSyntax)
  9632. return c
  9633. }
  9634. // PageSize sets the optional parameter "pageSize": Requested page size.
  9635. // The server may return fewer results than requested.
  9636. // If unspecified, the server will pick an appropriate default.
  9637. func (c *AccountsProposalsListCall) PageSize(pageSize int64) *AccountsProposalsListCall {
  9638. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9639. return c
  9640. }
  9641. // PageToken sets the optional parameter "pageToken": The page token as
  9642. // returned from ListProposalsResponse.
  9643. func (c *AccountsProposalsListCall) PageToken(pageToken string) *AccountsProposalsListCall {
  9644. c.urlParams_.Set("pageToken", pageToken)
  9645. return c
  9646. }
  9647. // Fields allows partial responses to be retrieved. See
  9648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9649. // for more information.
  9650. func (c *AccountsProposalsListCall) Fields(s ...googleapi.Field) *AccountsProposalsListCall {
  9651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9652. return c
  9653. }
  9654. // IfNoneMatch sets the optional parameter which makes the operation
  9655. // fail if the object's ETag matches the given value. This is useful for
  9656. // getting updates only after the object has changed since the last
  9657. // request. Use googleapi.IsNotModified to check whether the response
  9658. // error from Do is the result of In-None-Match.
  9659. func (c *AccountsProposalsListCall) IfNoneMatch(entityTag string) *AccountsProposalsListCall {
  9660. c.ifNoneMatch_ = entityTag
  9661. return c
  9662. }
  9663. // Context sets the context to be used in this call's Do method. Any
  9664. // pending HTTP request will be aborted if the provided context is
  9665. // canceled.
  9666. func (c *AccountsProposalsListCall) Context(ctx context.Context) *AccountsProposalsListCall {
  9667. c.ctx_ = ctx
  9668. return c
  9669. }
  9670. // Header returns an http.Header that can be modified by the caller to
  9671. // add HTTP headers to the request.
  9672. func (c *AccountsProposalsListCall) Header() http.Header {
  9673. if c.header_ == nil {
  9674. c.header_ = make(http.Header)
  9675. }
  9676. return c.header_
  9677. }
  9678. func (c *AccountsProposalsListCall) doRequest(alt string) (*http.Response, error) {
  9679. reqHeaders := make(http.Header)
  9680. for k, v := range c.header_ {
  9681. reqHeaders[k] = v
  9682. }
  9683. reqHeaders.Set("User-Agent", c.s.userAgent())
  9684. if c.ifNoneMatch_ != "" {
  9685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9686. }
  9687. var body io.Reader = nil
  9688. c.urlParams_.Set("alt", alt)
  9689. c.urlParams_.Set("prettyPrint", "false")
  9690. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals")
  9691. urls += "?" + c.urlParams_.Encode()
  9692. req, err := http.NewRequest("GET", urls, body)
  9693. if err != nil {
  9694. return nil, err
  9695. }
  9696. req.Header = reqHeaders
  9697. googleapi.Expand(req.URL, map[string]string{
  9698. "accountId": c.accountId,
  9699. })
  9700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9701. }
  9702. // Do executes the "adexchangebuyer2.accounts.proposals.list" call.
  9703. // Exactly one of *ListProposalsResponse or error will be non-nil. Any
  9704. // non-2xx status code is an error. Response headers are in either
  9705. // *ListProposalsResponse.ServerResponse.Header or (if a response was
  9706. // returned at all) in error.(*googleapi.Error).Header. Use
  9707. // googleapi.IsNotModified to check whether the returned error was
  9708. // because http.StatusNotModified was returned.
  9709. func (c *AccountsProposalsListCall) Do(opts ...googleapi.CallOption) (*ListProposalsResponse, error) {
  9710. gensupport.SetOptions(c.urlParams_, opts...)
  9711. res, err := c.doRequest("json")
  9712. if res != nil && res.StatusCode == http.StatusNotModified {
  9713. if res.Body != nil {
  9714. res.Body.Close()
  9715. }
  9716. return nil, &googleapi.Error{
  9717. Code: res.StatusCode,
  9718. Header: res.Header,
  9719. }
  9720. }
  9721. if err != nil {
  9722. return nil, err
  9723. }
  9724. defer googleapi.CloseBody(res)
  9725. if err := googleapi.CheckResponse(res); err != nil {
  9726. return nil, err
  9727. }
  9728. ret := &ListProposalsResponse{
  9729. ServerResponse: googleapi.ServerResponse{
  9730. Header: res.Header,
  9731. HTTPStatusCode: res.StatusCode,
  9732. },
  9733. }
  9734. target := &ret
  9735. if err := gensupport.DecodeResponse(target, res); err != nil {
  9736. return nil, err
  9737. }
  9738. return ret, nil
  9739. // {
  9740. // "description": "List proposals. A filter expression (PQL query) may be specified to\nfilter the results. To retrieve all finalized proposals, regardless if a\nproposal is being renegotiated, see the FinalizedProposals resource.\nNote that Bidder/ChildSeat relationships differ from the usual behavior.\nA Bidder account can only see its child seats' proposals by specifying\nthe ChildSeat's accountId in the request path.",
  9741. // "flatPath": "v2beta1/accounts/{accountId}/proposals",
  9742. // "httpMethod": "GET",
  9743. // "id": "adexchangebuyer2.accounts.proposals.list",
  9744. // "parameterOrder": [
  9745. // "accountId"
  9746. // ],
  9747. // "parameters": {
  9748. // "accountId": {
  9749. // "description": "Account ID of the buyer.",
  9750. // "location": "path",
  9751. // "required": true,
  9752. // "type": "string"
  9753. // },
  9754. // "filter": {
  9755. // "description": "An optional PQL filter query used to query for proposals.\n\nNested repeated fields, such as proposal.deals.targetingCriterion,\ncannot be filtered.",
  9756. // "location": "query",
  9757. // "type": "string"
  9758. // },
  9759. // "filterSyntax": {
  9760. // "description": "Syntax the filter is written in. Current implementation defaults to PQL\nbut in the future it will be LIST_FILTER.",
  9761. // "enum": [
  9762. // "FILTER_SYNTAX_UNSPECIFIED",
  9763. // "PQL",
  9764. // "LIST_FILTER"
  9765. // ],
  9766. // "location": "query",
  9767. // "type": "string"
  9768. // },
  9769. // "pageSize": {
  9770. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  9771. // "format": "int32",
  9772. // "location": "query",
  9773. // "type": "integer"
  9774. // },
  9775. // "pageToken": {
  9776. // "description": "The page token as returned from ListProposalsResponse.",
  9777. // "location": "query",
  9778. // "type": "string"
  9779. // }
  9780. // },
  9781. // "path": "v2beta1/accounts/{accountId}/proposals",
  9782. // "response": {
  9783. // "$ref": "ListProposalsResponse"
  9784. // },
  9785. // "scopes": [
  9786. // "https://www.googleapis.com/auth/adexchange.buyer"
  9787. // ]
  9788. // }
  9789. }
  9790. // Pages invokes f for each page of results.
  9791. // A non-nil error returned from f will halt the iteration.
  9792. // The provided context supersedes any context provided to the Context method.
  9793. func (c *AccountsProposalsListCall) Pages(ctx context.Context, f func(*ListProposalsResponse) error) error {
  9794. c.ctx_ = ctx
  9795. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9796. for {
  9797. x, err := c.Do()
  9798. if err != nil {
  9799. return err
  9800. }
  9801. if err := f(x); err != nil {
  9802. return err
  9803. }
  9804. if x.NextPageToken == "" {
  9805. return nil
  9806. }
  9807. c.PageToken(x.NextPageToken)
  9808. }
  9809. }
  9810. // method id "adexchangebuyer2.accounts.proposals.pause":
  9811. type AccountsProposalsPauseCall struct {
  9812. s *Service
  9813. accountId string
  9814. proposalId string
  9815. pauseproposalrequest *PauseProposalRequest
  9816. urlParams_ gensupport.URLParams
  9817. ctx_ context.Context
  9818. header_ http.Header
  9819. }
  9820. // Pause: Update the given proposal to pause serving.
  9821. // This method will set
  9822. // the
  9823. // `DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to true
  9824. // for all
  9825. // deals in the proposal.
  9826. //
  9827. // It is a no-op to pause an already-paused proposal.
  9828. // It is an error to call PauseProposal for a proposal that is
  9829. // not
  9830. // finalized or renegotiating.
  9831. func (r *AccountsProposalsService) Pause(accountId string, proposalId string, pauseproposalrequest *PauseProposalRequest) *AccountsProposalsPauseCall {
  9832. c := &AccountsProposalsPauseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9833. c.accountId = accountId
  9834. c.proposalId = proposalId
  9835. c.pauseproposalrequest = pauseproposalrequest
  9836. return c
  9837. }
  9838. // Fields allows partial responses to be retrieved. See
  9839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9840. // for more information.
  9841. func (c *AccountsProposalsPauseCall) Fields(s ...googleapi.Field) *AccountsProposalsPauseCall {
  9842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9843. return c
  9844. }
  9845. // Context sets the context to be used in this call's Do method. Any
  9846. // pending HTTP request will be aborted if the provided context is
  9847. // canceled.
  9848. func (c *AccountsProposalsPauseCall) Context(ctx context.Context) *AccountsProposalsPauseCall {
  9849. c.ctx_ = ctx
  9850. return c
  9851. }
  9852. // Header returns an http.Header that can be modified by the caller to
  9853. // add HTTP headers to the request.
  9854. func (c *AccountsProposalsPauseCall) Header() http.Header {
  9855. if c.header_ == nil {
  9856. c.header_ = make(http.Header)
  9857. }
  9858. return c.header_
  9859. }
  9860. func (c *AccountsProposalsPauseCall) doRequest(alt string) (*http.Response, error) {
  9861. reqHeaders := make(http.Header)
  9862. for k, v := range c.header_ {
  9863. reqHeaders[k] = v
  9864. }
  9865. reqHeaders.Set("User-Agent", c.s.userAgent())
  9866. var body io.Reader = nil
  9867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pauseproposalrequest)
  9868. if err != nil {
  9869. return nil, err
  9870. }
  9871. reqHeaders.Set("Content-Type", "application/json")
  9872. c.urlParams_.Set("alt", alt)
  9873. c.urlParams_.Set("prettyPrint", "false")
  9874. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:pause")
  9875. urls += "?" + c.urlParams_.Encode()
  9876. req, err := http.NewRequest("POST", urls, body)
  9877. if err != nil {
  9878. return nil, err
  9879. }
  9880. req.Header = reqHeaders
  9881. googleapi.Expand(req.URL, map[string]string{
  9882. "accountId": c.accountId,
  9883. "proposalId": c.proposalId,
  9884. })
  9885. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9886. }
  9887. // Do executes the "adexchangebuyer2.accounts.proposals.pause" call.
  9888. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  9889. // code is an error. Response headers are in either
  9890. // *Proposal.ServerResponse.Header or (if a response was returned at
  9891. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9892. // to check whether the returned error was because
  9893. // http.StatusNotModified was returned.
  9894. func (c *AccountsProposalsPauseCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  9895. gensupport.SetOptions(c.urlParams_, opts...)
  9896. res, err := c.doRequest("json")
  9897. if res != nil && res.StatusCode == http.StatusNotModified {
  9898. if res.Body != nil {
  9899. res.Body.Close()
  9900. }
  9901. return nil, &googleapi.Error{
  9902. Code: res.StatusCode,
  9903. Header: res.Header,
  9904. }
  9905. }
  9906. if err != nil {
  9907. return nil, err
  9908. }
  9909. defer googleapi.CloseBody(res)
  9910. if err := googleapi.CheckResponse(res); err != nil {
  9911. return nil, err
  9912. }
  9913. ret := &Proposal{
  9914. ServerResponse: googleapi.ServerResponse{
  9915. Header: res.Header,
  9916. HTTPStatusCode: res.StatusCode,
  9917. },
  9918. }
  9919. target := &ret
  9920. if err := gensupport.DecodeResponse(target, res); err != nil {
  9921. return nil, err
  9922. }
  9923. return ret, nil
  9924. // {
  9925. // "description": "Update the given proposal to pause serving.\nThis method will set the\n`DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to true for all\ndeals in the proposal.\n\nIt is a no-op to pause an already-paused proposal.\nIt is an error to call PauseProposal for a proposal that is not\nfinalized or renegotiating.",
  9926. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:pause",
  9927. // "httpMethod": "POST",
  9928. // "id": "adexchangebuyer2.accounts.proposals.pause",
  9929. // "parameterOrder": [
  9930. // "accountId",
  9931. // "proposalId"
  9932. // ],
  9933. // "parameters": {
  9934. // "accountId": {
  9935. // "description": "Account ID of the buyer.",
  9936. // "location": "path",
  9937. // "required": true,
  9938. // "type": "string"
  9939. // },
  9940. // "proposalId": {
  9941. // "description": "The ID of the proposal to pause.",
  9942. // "location": "path",
  9943. // "required": true,
  9944. // "type": "string"
  9945. // }
  9946. // },
  9947. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:pause",
  9948. // "request": {
  9949. // "$ref": "PauseProposalRequest"
  9950. // },
  9951. // "response": {
  9952. // "$ref": "Proposal"
  9953. // },
  9954. // "scopes": [
  9955. // "https://www.googleapis.com/auth/adexchange.buyer"
  9956. // ]
  9957. // }
  9958. }
  9959. // method id "adexchangebuyer2.accounts.proposals.resume":
  9960. type AccountsProposalsResumeCall struct {
  9961. s *Service
  9962. accountId string
  9963. proposalId string
  9964. resumeproposalrequest *ResumeProposalRequest
  9965. urlParams_ gensupport.URLParams
  9966. ctx_ context.Context
  9967. header_ http.Header
  9968. }
  9969. // Resume: Update the given proposal to resume serving.
  9970. // This method will set
  9971. // the
  9972. // `DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to false
  9973. // for all
  9974. // deals in the proposal.
  9975. //
  9976. // Note that if the `has_seller_paused` bit is also set, serving will
  9977. // not
  9978. // resume until the seller also resumes.
  9979. //
  9980. // It is a no-op to resume an already-running proposal.
  9981. // It is an error to call ResumeProposal for a proposal that is
  9982. // not
  9983. // finalized or renegotiating.
  9984. func (r *AccountsProposalsService) Resume(accountId string, proposalId string, resumeproposalrequest *ResumeProposalRequest) *AccountsProposalsResumeCall {
  9985. c := &AccountsProposalsResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9986. c.accountId = accountId
  9987. c.proposalId = proposalId
  9988. c.resumeproposalrequest = resumeproposalrequest
  9989. return c
  9990. }
  9991. // Fields allows partial responses to be retrieved. See
  9992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9993. // for more information.
  9994. func (c *AccountsProposalsResumeCall) Fields(s ...googleapi.Field) *AccountsProposalsResumeCall {
  9995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9996. return c
  9997. }
  9998. // Context sets the context to be used in this call's Do method. Any
  9999. // pending HTTP request will be aborted if the provided context is
  10000. // canceled.
  10001. func (c *AccountsProposalsResumeCall) Context(ctx context.Context) *AccountsProposalsResumeCall {
  10002. c.ctx_ = ctx
  10003. return c
  10004. }
  10005. // Header returns an http.Header that can be modified by the caller to
  10006. // add HTTP headers to the request.
  10007. func (c *AccountsProposalsResumeCall) Header() http.Header {
  10008. if c.header_ == nil {
  10009. c.header_ = make(http.Header)
  10010. }
  10011. return c.header_
  10012. }
  10013. func (c *AccountsProposalsResumeCall) doRequest(alt string) (*http.Response, error) {
  10014. reqHeaders := make(http.Header)
  10015. for k, v := range c.header_ {
  10016. reqHeaders[k] = v
  10017. }
  10018. reqHeaders.Set("User-Agent", c.s.userAgent())
  10019. var body io.Reader = nil
  10020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resumeproposalrequest)
  10021. if err != nil {
  10022. return nil, err
  10023. }
  10024. reqHeaders.Set("Content-Type", "application/json")
  10025. c.urlParams_.Set("alt", alt)
  10026. c.urlParams_.Set("prettyPrint", "false")
  10027. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}:resume")
  10028. urls += "?" + c.urlParams_.Encode()
  10029. req, err := http.NewRequest("POST", urls, body)
  10030. if err != nil {
  10031. return nil, err
  10032. }
  10033. req.Header = reqHeaders
  10034. googleapi.Expand(req.URL, map[string]string{
  10035. "accountId": c.accountId,
  10036. "proposalId": c.proposalId,
  10037. })
  10038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10039. }
  10040. // Do executes the "adexchangebuyer2.accounts.proposals.resume" call.
  10041. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  10042. // code is an error. Response headers are in either
  10043. // *Proposal.ServerResponse.Header or (if a response was returned at
  10044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10045. // to check whether the returned error was because
  10046. // http.StatusNotModified was returned.
  10047. func (c *AccountsProposalsResumeCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  10048. gensupport.SetOptions(c.urlParams_, opts...)
  10049. res, err := c.doRequest("json")
  10050. if res != nil && res.StatusCode == http.StatusNotModified {
  10051. if res.Body != nil {
  10052. res.Body.Close()
  10053. }
  10054. return nil, &googleapi.Error{
  10055. Code: res.StatusCode,
  10056. Header: res.Header,
  10057. }
  10058. }
  10059. if err != nil {
  10060. return nil, err
  10061. }
  10062. defer googleapi.CloseBody(res)
  10063. if err := googleapi.CheckResponse(res); err != nil {
  10064. return nil, err
  10065. }
  10066. ret := &Proposal{
  10067. ServerResponse: googleapi.ServerResponse{
  10068. Header: res.Header,
  10069. HTTPStatusCode: res.StatusCode,
  10070. },
  10071. }
  10072. target := &ret
  10073. if err := gensupport.DecodeResponse(target, res); err != nil {
  10074. return nil, err
  10075. }
  10076. return ret, nil
  10077. // {
  10078. // "description": "Update the given proposal to resume serving.\nThis method will set the\n`DealServingMetadata.DealPauseStatus.has_buyer_paused` bit to false for all\ndeals in the proposal.\n\nNote that if the `has_seller_paused` bit is also set, serving will not\nresume until the seller also resumes.\n\nIt is a no-op to resume an already-running proposal.\nIt is an error to call ResumeProposal for a proposal that is not\nfinalized or renegotiating.",
  10079. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}:resume",
  10080. // "httpMethod": "POST",
  10081. // "id": "adexchangebuyer2.accounts.proposals.resume",
  10082. // "parameterOrder": [
  10083. // "accountId",
  10084. // "proposalId"
  10085. // ],
  10086. // "parameters": {
  10087. // "accountId": {
  10088. // "description": "Account ID of the buyer.",
  10089. // "location": "path",
  10090. // "required": true,
  10091. // "type": "string"
  10092. // },
  10093. // "proposalId": {
  10094. // "description": "The ID of the proposal to resume.",
  10095. // "location": "path",
  10096. // "required": true,
  10097. // "type": "string"
  10098. // }
  10099. // },
  10100. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}:resume",
  10101. // "request": {
  10102. // "$ref": "ResumeProposalRequest"
  10103. // },
  10104. // "response": {
  10105. // "$ref": "Proposal"
  10106. // },
  10107. // "scopes": [
  10108. // "https://www.googleapis.com/auth/adexchange.buyer"
  10109. // ]
  10110. // }
  10111. }
  10112. // method id "adexchangebuyer2.accounts.proposals.update":
  10113. type AccountsProposalsUpdateCall struct {
  10114. s *Service
  10115. accountId string
  10116. proposalId string
  10117. proposal *Proposal
  10118. urlParams_ gensupport.URLParams
  10119. ctx_ context.Context
  10120. header_ http.Header
  10121. }
  10122. // Update: Update the given proposal at the client known revision
  10123. // number. If the
  10124. // server revision has advanced since the
  10125. // passed-in
  10126. // `proposal.proposal_revision`, an `ABORTED` error message will be
  10127. // returned.
  10128. // Only the buyer-modifiable fields of the proposal will be
  10129. // updated.
  10130. //
  10131. // Note that the deals in the proposal will be updated to match the
  10132. // passed-in
  10133. // copy.
  10134. // If a passed-in deal does not have a `deal_id`, the server will assign
  10135. // a new
  10136. // unique ID and create the deal.
  10137. // If passed-in deal has a `deal_id`, it will be updated to match
  10138. // the
  10139. // passed-in copy.
  10140. // Any existing deals not present in the passed-in proposal will be
  10141. // deleted.
  10142. // It is an error to pass in a deal with a `deal_id` not present at
  10143. // head.
  10144. func (r *AccountsProposalsService) Update(accountId string, proposalId string, proposal *Proposal) *AccountsProposalsUpdateCall {
  10145. c := &AccountsProposalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10146. c.accountId = accountId
  10147. c.proposalId = proposalId
  10148. c.proposal = proposal
  10149. return c
  10150. }
  10151. // Fields allows partial responses to be retrieved. See
  10152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10153. // for more information.
  10154. func (c *AccountsProposalsUpdateCall) Fields(s ...googleapi.Field) *AccountsProposalsUpdateCall {
  10155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10156. return c
  10157. }
  10158. // Context sets the context to be used in this call's Do method. Any
  10159. // pending HTTP request will be aborted if the provided context is
  10160. // canceled.
  10161. func (c *AccountsProposalsUpdateCall) Context(ctx context.Context) *AccountsProposalsUpdateCall {
  10162. c.ctx_ = ctx
  10163. return c
  10164. }
  10165. // Header returns an http.Header that can be modified by the caller to
  10166. // add HTTP headers to the request.
  10167. func (c *AccountsProposalsUpdateCall) Header() http.Header {
  10168. if c.header_ == nil {
  10169. c.header_ = make(http.Header)
  10170. }
  10171. return c.header_
  10172. }
  10173. func (c *AccountsProposalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10174. reqHeaders := make(http.Header)
  10175. for k, v := range c.header_ {
  10176. reqHeaders[k] = v
  10177. }
  10178. reqHeaders.Set("User-Agent", c.s.userAgent())
  10179. var body io.Reader = nil
  10180. body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
  10181. if err != nil {
  10182. return nil, err
  10183. }
  10184. reqHeaders.Set("Content-Type", "application/json")
  10185. c.urlParams_.Set("alt", alt)
  10186. c.urlParams_.Set("prettyPrint", "false")
  10187. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/proposals/{proposalId}")
  10188. urls += "?" + c.urlParams_.Encode()
  10189. req, err := http.NewRequest("PUT", urls, body)
  10190. if err != nil {
  10191. return nil, err
  10192. }
  10193. req.Header = reqHeaders
  10194. googleapi.Expand(req.URL, map[string]string{
  10195. "accountId": c.accountId,
  10196. "proposalId": c.proposalId,
  10197. })
  10198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10199. }
  10200. // Do executes the "adexchangebuyer2.accounts.proposals.update" call.
  10201. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  10202. // code is an error. Response headers are in either
  10203. // *Proposal.ServerResponse.Header or (if a response was returned at
  10204. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10205. // to check whether the returned error was because
  10206. // http.StatusNotModified was returned.
  10207. func (c *AccountsProposalsUpdateCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  10208. gensupport.SetOptions(c.urlParams_, opts...)
  10209. res, err := c.doRequest("json")
  10210. if res != nil && res.StatusCode == http.StatusNotModified {
  10211. if res.Body != nil {
  10212. res.Body.Close()
  10213. }
  10214. return nil, &googleapi.Error{
  10215. Code: res.StatusCode,
  10216. Header: res.Header,
  10217. }
  10218. }
  10219. if err != nil {
  10220. return nil, err
  10221. }
  10222. defer googleapi.CloseBody(res)
  10223. if err := googleapi.CheckResponse(res); err != nil {
  10224. return nil, err
  10225. }
  10226. ret := &Proposal{
  10227. ServerResponse: googleapi.ServerResponse{
  10228. Header: res.Header,
  10229. HTTPStatusCode: res.StatusCode,
  10230. },
  10231. }
  10232. target := &ret
  10233. if err := gensupport.DecodeResponse(target, res); err != nil {
  10234. return nil, err
  10235. }
  10236. return ret, nil
  10237. // {
  10238. // "description": "Update the given proposal at the client known revision number. If the\nserver revision has advanced since the passed-in\n`proposal.proposal_revision`, an `ABORTED` error message will be returned.\nOnly the buyer-modifiable fields of the proposal will be updated.\n\nNote that the deals in the proposal will be updated to match the passed-in\ncopy.\nIf a passed-in deal does not have a `deal_id`, the server will assign a new\nunique ID and create the deal.\nIf passed-in deal has a `deal_id`, it will be updated to match the\npassed-in copy.\nAny existing deals not present in the passed-in proposal will be deleted.\nIt is an error to pass in a deal with a `deal_id` not present at head.",
  10239. // "flatPath": "v2beta1/accounts/{accountId}/proposals/{proposalId}",
  10240. // "httpMethod": "PUT",
  10241. // "id": "adexchangebuyer2.accounts.proposals.update",
  10242. // "parameterOrder": [
  10243. // "accountId",
  10244. // "proposalId"
  10245. // ],
  10246. // "parameters": {
  10247. // "accountId": {
  10248. // "description": "Account ID of the buyer.",
  10249. // "location": "path",
  10250. // "required": true,
  10251. // "type": "string"
  10252. // },
  10253. // "proposalId": {
  10254. // "description": "The unique ID of the proposal.",
  10255. // "location": "path",
  10256. // "required": true,
  10257. // "type": "string"
  10258. // }
  10259. // },
  10260. // "path": "v2beta1/accounts/{accountId}/proposals/{proposalId}",
  10261. // "request": {
  10262. // "$ref": "Proposal"
  10263. // },
  10264. // "response": {
  10265. // "$ref": "Proposal"
  10266. // },
  10267. // "scopes": [
  10268. // "https://www.googleapis.com/auth/adexchange.buyer"
  10269. // ]
  10270. // }
  10271. }
  10272. // method id "adexchangebuyer2.accounts.publisherProfiles.get":
  10273. type AccountsPublisherProfilesGetCall struct {
  10274. s *Service
  10275. accountId string
  10276. publisherProfileId string
  10277. urlParams_ gensupport.URLParams
  10278. ifNoneMatch_ string
  10279. ctx_ context.Context
  10280. header_ http.Header
  10281. }
  10282. // Get: Gets the requested publisher profile by id.
  10283. func (r *AccountsPublisherProfilesService) Get(accountId string, publisherProfileId string) *AccountsPublisherProfilesGetCall {
  10284. c := &AccountsPublisherProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10285. c.accountId = accountId
  10286. c.publisherProfileId = publisherProfileId
  10287. return c
  10288. }
  10289. // Fields allows partial responses to be retrieved. See
  10290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10291. // for more information.
  10292. func (c *AccountsPublisherProfilesGetCall) Fields(s ...googleapi.Field) *AccountsPublisherProfilesGetCall {
  10293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10294. return c
  10295. }
  10296. // IfNoneMatch sets the optional parameter which makes the operation
  10297. // fail if the object's ETag matches the given value. This is useful for
  10298. // getting updates only after the object has changed since the last
  10299. // request. Use googleapi.IsNotModified to check whether the response
  10300. // error from Do is the result of In-None-Match.
  10301. func (c *AccountsPublisherProfilesGetCall) IfNoneMatch(entityTag string) *AccountsPublisherProfilesGetCall {
  10302. c.ifNoneMatch_ = entityTag
  10303. return c
  10304. }
  10305. // Context sets the context to be used in this call's Do method. Any
  10306. // pending HTTP request will be aborted if the provided context is
  10307. // canceled.
  10308. func (c *AccountsPublisherProfilesGetCall) Context(ctx context.Context) *AccountsPublisherProfilesGetCall {
  10309. c.ctx_ = ctx
  10310. return c
  10311. }
  10312. // Header returns an http.Header that can be modified by the caller to
  10313. // add HTTP headers to the request.
  10314. func (c *AccountsPublisherProfilesGetCall) Header() http.Header {
  10315. if c.header_ == nil {
  10316. c.header_ = make(http.Header)
  10317. }
  10318. return c.header_
  10319. }
  10320. func (c *AccountsPublisherProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  10321. reqHeaders := make(http.Header)
  10322. for k, v := range c.header_ {
  10323. reqHeaders[k] = v
  10324. }
  10325. reqHeaders.Set("User-Agent", c.s.userAgent())
  10326. if c.ifNoneMatch_ != "" {
  10327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10328. }
  10329. var body io.Reader = nil
  10330. c.urlParams_.Set("alt", alt)
  10331. c.urlParams_.Set("prettyPrint", "false")
  10332. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/publisherProfiles/{publisherProfileId}")
  10333. urls += "?" + c.urlParams_.Encode()
  10334. req, err := http.NewRequest("GET", urls, body)
  10335. if err != nil {
  10336. return nil, err
  10337. }
  10338. req.Header = reqHeaders
  10339. googleapi.Expand(req.URL, map[string]string{
  10340. "accountId": c.accountId,
  10341. "publisherProfileId": c.publisherProfileId,
  10342. })
  10343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10344. }
  10345. // Do executes the "adexchangebuyer2.accounts.publisherProfiles.get" call.
  10346. // Exactly one of *PublisherProfile or error will be non-nil. Any
  10347. // non-2xx status code is an error. Response headers are in either
  10348. // *PublisherProfile.ServerResponse.Header or (if a response was
  10349. // returned at all) in error.(*googleapi.Error).Header. Use
  10350. // googleapi.IsNotModified to check whether the returned error was
  10351. // because http.StatusNotModified was returned.
  10352. func (c *AccountsPublisherProfilesGetCall) Do(opts ...googleapi.CallOption) (*PublisherProfile, error) {
  10353. gensupport.SetOptions(c.urlParams_, opts...)
  10354. res, err := c.doRequest("json")
  10355. if res != nil && res.StatusCode == http.StatusNotModified {
  10356. if res.Body != nil {
  10357. res.Body.Close()
  10358. }
  10359. return nil, &googleapi.Error{
  10360. Code: res.StatusCode,
  10361. Header: res.Header,
  10362. }
  10363. }
  10364. if err != nil {
  10365. return nil, err
  10366. }
  10367. defer googleapi.CloseBody(res)
  10368. if err := googleapi.CheckResponse(res); err != nil {
  10369. return nil, err
  10370. }
  10371. ret := &PublisherProfile{
  10372. ServerResponse: googleapi.ServerResponse{
  10373. Header: res.Header,
  10374. HTTPStatusCode: res.StatusCode,
  10375. },
  10376. }
  10377. target := &ret
  10378. if err := gensupport.DecodeResponse(target, res); err != nil {
  10379. return nil, err
  10380. }
  10381. return ret, nil
  10382. // {
  10383. // "description": "Gets the requested publisher profile by id.",
  10384. // "flatPath": "v2beta1/accounts/{accountId}/publisherProfiles/{publisherProfileId}",
  10385. // "httpMethod": "GET",
  10386. // "id": "adexchangebuyer2.accounts.publisherProfiles.get",
  10387. // "parameterOrder": [
  10388. // "accountId",
  10389. // "publisherProfileId"
  10390. // ],
  10391. // "parameters": {
  10392. // "accountId": {
  10393. // "description": "Account ID of the buyer.",
  10394. // "location": "path",
  10395. // "required": true,
  10396. // "type": "string"
  10397. // },
  10398. // "publisherProfileId": {
  10399. // "description": "The id for the publisher profile to get.",
  10400. // "location": "path",
  10401. // "required": true,
  10402. // "type": "string"
  10403. // }
  10404. // },
  10405. // "path": "v2beta1/accounts/{accountId}/publisherProfiles/{publisherProfileId}",
  10406. // "response": {
  10407. // "$ref": "PublisherProfile"
  10408. // },
  10409. // "scopes": [
  10410. // "https://www.googleapis.com/auth/adexchange.buyer"
  10411. // ]
  10412. // }
  10413. }
  10414. // method id "adexchangebuyer2.accounts.publisherProfiles.list":
  10415. type AccountsPublisherProfilesListCall struct {
  10416. s *Service
  10417. accountId string
  10418. urlParams_ gensupport.URLParams
  10419. ifNoneMatch_ string
  10420. ctx_ context.Context
  10421. header_ http.Header
  10422. }
  10423. // List: List all publisher profiles visible to the buyer
  10424. func (r *AccountsPublisherProfilesService) List(accountId string) *AccountsPublisherProfilesListCall {
  10425. c := &AccountsPublisherProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10426. c.accountId = accountId
  10427. return c
  10428. }
  10429. // PageSize sets the optional parameter "pageSize": Specify the number
  10430. // of results to include per page.
  10431. func (c *AccountsPublisherProfilesListCall) PageSize(pageSize int64) *AccountsPublisherProfilesListCall {
  10432. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10433. return c
  10434. }
  10435. // PageToken sets the optional parameter "pageToken": The page token as
  10436. // return from ListPublisherProfilesResponse.
  10437. func (c *AccountsPublisherProfilesListCall) PageToken(pageToken string) *AccountsPublisherProfilesListCall {
  10438. c.urlParams_.Set("pageToken", pageToken)
  10439. return c
  10440. }
  10441. // Fields allows partial responses to be retrieved. See
  10442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10443. // for more information.
  10444. func (c *AccountsPublisherProfilesListCall) Fields(s ...googleapi.Field) *AccountsPublisherProfilesListCall {
  10445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10446. return c
  10447. }
  10448. // IfNoneMatch sets the optional parameter which makes the operation
  10449. // fail if the object's ETag matches the given value. This is useful for
  10450. // getting updates only after the object has changed since the last
  10451. // request. Use googleapi.IsNotModified to check whether the response
  10452. // error from Do is the result of In-None-Match.
  10453. func (c *AccountsPublisherProfilesListCall) IfNoneMatch(entityTag string) *AccountsPublisherProfilesListCall {
  10454. c.ifNoneMatch_ = entityTag
  10455. return c
  10456. }
  10457. // Context sets the context to be used in this call's Do method. Any
  10458. // pending HTTP request will be aborted if the provided context is
  10459. // canceled.
  10460. func (c *AccountsPublisherProfilesListCall) Context(ctx context.Context) *AccountsPublisherProfilesListCall {
  10461. c.ctx_ = ctx
  10462. return c
  10463. }
  10464. // Header returns an http.Header that can be modified by the caller to
  10465. // add HTTP headers to the request.
  10466. func (c *AccountsPublisherProfilesListCall) Header() http.Header {
  10467. if c.header_ == nil {
  10468. c.header_ = make(http.Header)
  10469. }
  10470. return c.header_
  10471. }
  10472. func (c *AccountsPublisherProfilesListCall) doRequest(alt string) (*http.Response, error) {
  10473. reqHeaders := make(http.Header)
  10474. for k, v := range c.header_ {
  10475. reqHeaders[k] = v
  10476. }
  10477. reqHeaders.Set("User-Agent", c.s.userAgent())
  10478. if c.ifNoneMatch_ != "" {
  10479. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10480. }
  10481. var body io.Reader = nil
  10482. c.urlParams_.Set("alt", alt)
  10483. c.urlParams_.Set("prettyPrint", "false")
  10484. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/accounts/{accountId}/publisherProfiles")
  10485. urls += "?" + c.urlParams_.Encode()
  10486. req, err := http.NewRequest("GET", urls, body)
  10487. if err != nil {
  10488. return nil, err
  10489. }
  10490. req.Header = reqHeaders
  10491. googleapi.Expand(req.URL, map[string]string{
  10492. "accountId": c.accountId,
  10493. })
  10494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10495. }
  10496. // Do executes the "adexchangebuyer2.accounts.publisherProfiles.list" call.
  10497. // Exactly one of *ListPublisherProfilesResponse or error will be
  10498. // non-nil. Any non-2xx status code is an error. Response headers are in
  10499. // either *ListPublisherProfilesResponse.ServerResponse.Header or (if a
  10500. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10501. // googleapi.IsNotModified to check whether the returned error was
  10502. // because http.StatusNotModified was returned.
  10503. func (c *AccountsPublisherProfilesListCall) Do(opts ...googleapi.CallOption) (*ListPublisherProfilesResponse, error) {
  10504. gensupport.SetOptions(c.urlParams_, opts...)
  10505. res, err := c.doRequest("json")
  10506. if res != nil && res.StatusCode == http.StatusNotModified {
  10507. if res.Body != nil {
  10508. res.Body.Close()
  10509. }
  10510. return nil, &googleapi.Error{
  10511. Code: res.StatusCode,
  10512. Header: res.Header,
  10513. }
  10514. }
  10515. if err != nil {
  10516. return nil, err
  10517. }
  10518. defer googleapi.CloseBody(res)
  10519. if err := googleapi.CheckResponse(res); err != nil {
  10520. return nil, err
  10521. }
  10522. ret := &ListPublisherProfilesResponse{
  10523. ServerResponse: googleapi.ServerResponse{
  10524. Header: res.Header,
  10525. HTTPStatusCode: res.StatusCode,
  10526. },
  10527. }
  10528. target := &ret
  10529. if err := gensupport.DecodeResponse(target, res); err != nil {
  10530. return nil, err
  10531. }
  10532. return ret, nil
  10533. // {
  10534. // "description": "List all publisher profiles visible to the buyer",
  10535. // "flatPath": "v2beta1/accounts/{accountId}/publisherProfiles",
  10536. // "httpMethod": "GET",
  10537. // "id": "adexchangebuyer2.accounts.publisherProfiles.list",
  10538. // "parameterOrder": [
  10539. // "accountId"
  10540. // ],
  10541. // "parameters": {
  10542. // "accountId": {
  10543. // "description": "Account ID of the buyer.",
  10544. // "location": "path",
  10545. // "required": true,
  10546. // "type": "string"
  10547. // },
  10548. // "pageSize": {
  10549. // "description": "Specify the number of results to include per page.",
  10550. // "format": "int32",
  10551. // "location": "query",
  10552. // "type": "integer"
  10553. // },
  10554. // "pageToken": {
  10555. // "description": "The page token as return from ListPublisherProfilesResponse.",
  10556. // "location": "query",
  10557. // "type": "string"
  10558. // }
  10559. // },
  10560. // "path": "v2beta1/accounts/{accountId}/publisherProfiles",
  10561. // "response": {
  10562. // "$ref": "ListPublisherProfilesResponse"
  10563. // },
  10564. // "scopes": [
  10565. // "https://www.googleapis.com/auth/adexchange.buyer"
  10566. // ]
  10567. // }
  10568. }
  10569. // Pages invokes f for each page of results.
  10570. // A non-nil error returned from f will halt the iteration.
  10571. // The provided context supersedes any context provided to the Context method.
  10572. func (c *AccountsPublisherProfilesListCall) Pages(ctx context.Context, f func(*ListPublisherProfilesResponse) error) error {
  10573. c.ctx_ = ctx
  10574. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10575. for {
  10576. x, err := c.Do()
  10577. if err != nil {
  10578. return err
  10579. }
  10580. if err := f(x); err != nil {
  10581. return err
  10582. }
  10583. if x.NextPageToken == "" {
  10584. return nil
  10585. }
  10586. c.PageToken(x.NextPageToken)
  10587. }
  10588. }
  10589. // method id "adexchangebuyer2.bidders.accounts.creatives.delete":
  10590. type BiddersAccountsCreativesDeleteCall struct {
  10591. s *Service
  10592. ownerName string
  10593. creativeId string
  10594. urlParams_ gensupport.URLParams
  10595. ctx_ context.Context
  10596. header_ http.Header
  10597. }
  10598. // Delete: Deletes a single creative.
  10599. //
  10600. // A creative is deactivated upon deletion and does not count against
  10601. // active
  10602. // snippet quota. A deleted creative should not be used in bidding (all
  10603. // bids
  10604. // with that creative will be rejected).
  10605. func (r *BiddersAccountsCreativesService) Delete(ownerName string, creativeId string) *BiddersAccountsCreativesDeleteCall {
  10606. c := &BiddersAccountsCreativesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10607. c.ownerName = ownerName
  10608. c.creativeId = creativeId
  10609. return c
  10610. }
  10611. // Fields allows partial responses to be retrieved. See
  10612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10613. // for more information.
  10614. func (c *BiddersAccountsCreativesDeleteCall) Fields(s ...googleapi.Field) *BiddersAccountsCreativesDeleteCall {
  10615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10616. return c
  10617. }
  10618. // Context sets the context to be used in this call's Do method. Any
  10619. // pending HTTP request will be aborted if the provided context is
  10620. // canceled.
  10621. func (c *BiddersAccountsCreativesDeleteCall) Context(ctx context.Context) *BiddersAccountsCreativesDeleteCall {
  10622. c.ctx_ = ctx
  10623. return c
  10624. }
  10625. // Header returns an http.Header that can be modified by the caller to
  10626. // add HTTP headers to the request.
  10627. func (c *BiddersAccountsCreativesDeleteCall) Header() http.Header {
  10628. if c.header_ == nil {
  10629. c.header_ = make(http.Header)
  10630. }
  10631. return c.header_
  10632. }
  10633. func (c *BiddersAccountsCreativesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10634. reqHeaders := make(http.Header)
  10635. for k, v := range c.header_ {
  10636. reqHeaders[k] = v
  10637. }
  10638. reqHeaders.Set("User-Agent", c.s.userAgent())
  10639. var body io.Reader = nil
  10640. c.urlParams_.Set("alt", alt)
  10641. c.urlParams_.Set("prettyPrint", "false")
  10642. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/creatives/{creativeId}")
  10643. urls += "?" + c.urlParams_.Encode()
  10644. req, err := http.NewRequest("DELETE", urls, body)
  10645. if err != nil {
  10646. return nil, err
  10647. }
  10648. req.Header = reqHeaders
  10649. googleapi.Expand(req.URL, map[string]string{
  10650. "ownerName": c.ownerName,
  10651. "creativeId": c.creativeId,
  10652. })
  10653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10654. }
  10655. // Do executes the "adexchangebuyer2.bidders.accounts.creatives.delete" call.
  10656. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  10657. // code is an error. Response headers are in either
  10658. // *Empty.ServerResponse.Header or (if a response was returned at all)
  10659. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10660. // check whether the returned error was because http.StatusNotModified
  10661. // was returned.
  10662. func (c *BiddersAccountsCreativesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  10663. gensupport.SetOptions(c.urlParams_, opts...)
  10664. res, err := c.doRequest("json")
  10665. if res != nil && res.StatusCode == http.StatusNotModified {
  10666. if res.Body != nil {
  10667. res.Body.Close()
  10668. }
  10669. return nil, &googleapi.Error{
  10670. Code: res.StatusCode,
  10671. Header: res.Header,
  10672. }
  10673. }
  10674. if err != nil {
  10675. return nil, err
  10676. }
  10677. defer googleapi.CloseBody(res)
  10678. if err := googleapi.CheckResponse(res); err != nil {
  10679. return nil, err
  10680. }
  10681. ret := &Empty{
  10682. ServerResponse: googleapi.ServerResponse{
  10683. Header: res.Header,
  10684. HTTPStatusCode: res.StatusCode,
  10685. },
  10686. }
  10687. target := &ret
  10688. if err := gensupport.DecodeResponse(target, res); err != nil {
  10689. return nil, err
  10690. }
  10691. return ret, nil
  10692. // {
  10693. // "description": "Deletes a single creative.\n\nA creative is deactivated upon deletion and does not count against active\nsnippet quota. A deleted creative should not be used in bidding (all bids\nwith that creative will be rejected).",
  10694. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/creatives/{creativeId}",
  10695. // "httpMethod": "DELETE",
  10696. // "id": "adexchangebuyer2.bidders.accounts.creatives.delete",
  10697. // "parameterOrder": [
  10698. // "ownerName",
  10699. // "creativeId"
  10700. // ],
  10701. // "parameters": {
  10702. // "creativeId": {
  10703. // "description": "The ID of the creative to delete.",
  10704. // "location": "path",
  10705. // "required": true,
  10706. // "type": "string"
  10707. // },
  10708. // "ownerName": {
  10709. // "description": "Name of the owner (bidder or account) of the creative to be deleted.\nFor example:\n\n- For an account-level creative for the buyer account representing bidder\n 123: `bidders/123/accounts/123`\n\n- For an account-level creative for the child seat buyer account 456\n whose bidder is 123: `bidders/123/accounts/456`",
  10710. // "location": "path",
  10711. // "pattern": "^bidders/[^/]+/accounts/[^/]+$",
  10712. // "required": true,
  10713. // "type": "string"
  10714. // }
  10715. // },
  10716. // "path": "v2beta1/{+ownerName}/creatives/{creativeId}",
  10717. // "response": {
  10718. // "$ref": "Empty"
  10719. // },
  10720. // "scopes": [
  10721. // "https://www.googleapis.com/auth/adexchange.buyer"
  10722. // ]
  10723. // }
  10724. }
  10725. // method id "adexchangebuyer2.bidders.accounts.filterSets.create":
  10726. type BiddersAccountsFilterSetsCreateCall struct {
  10727. s *Service
  10728. ownerName string
  10729. filterset *FilterSet
  10730. urlParams_ gensupport.URLParams
  10731. ctx_ context.Context
  10732. header_ http.Header
  10733. }
  10734. // Create: Creates the specified filter set for the account with the
  10735. // given account ID.
  10736. func (r *BiddersAccountsFilterSetsService) Create(ownerName string, filterset *FilterSet) *BiddersAccountsFilterSetsCreateCall {
  10737. c := &BiddersAccountsFilterSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10738. c.ownerName = ownerName
  10739. c.filterset = filterset
  10740. return c
  10741. }
  10742. // IsTransient sets the optional parameter "isTransient": Whether the
  10743. // filter set is transient, or should be persisted indefinitely.
  10744. // By default, filter sets are not transient.
  10745. // If transient, it will be available for at least 1 hour after
  10746. // creation.
  10747. func (c *BiddersAccountsFilterSetsCreateCall) IsTransient(isTransient bool) *BiddersAccountsFilterSetsCreateCall {
  10748. c.urlParams_.Set("isTransient", fmt.Sprint(isTransient))
  10749. return c
  10750. }
  10751. // Fields allows partial responses to be retrieved. See
  10752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10753. // for more information.
  10754. func (c *BiddersAccountsFilterSetsCreateCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsCreateCall {
  10755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10756. return c
  10757. }
  10758. // Context sets the context to be used in this call's Do method. Any
  10759. // pending HTTP request will be aborted if the provided context is
  10760. // canceled.
  10761. func (c *BiddersAccountsFilterSetsCreateCall) Context(ctx context.Context) *BiddersAccountsFilterSetsCreateCall {
  10762. c.ctx_ = ctx
  10763. return c
  10764. }
  10765. // Header returns an http.Header that can be modified by the caller to
  10766. // add HTTP headers to the request.
  10767. func (c *BiddersAccountsFilterSetsCreateCall) Header() http.Header {
  10768. if c.header_ == nil {
  10769. c.header_ = make(http.Header)
  10770. }
  10771. return c.header_
  10772. }
  10773. func (c *BiddersAccountsFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) {
  10774. reqHeaders := make(http.Header)
  10775. for k, v := range c.header_ {
  10776. reqHeaders[k] = v
  10777. }
  10778. reqHeaders.Set("User-Agent", c.s.userAgent())
  10779. var body io.Reader = nil
  10780. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset)
  10781. if err != nil {
  10782. return nil, err
  10783. }
  10784. reqHeaders.Set("Content-Type", "application/json")
  10785. c.urlParams_.Set("alt", alt)
  10786. c.urlParams_.Set("prettyPrint", "false")
  10787. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  10788. urls += "?" + c.urlParams_.Encode()
  10789. req, err := http.NewRequest("POST", urls, body)
  10790. if err != nil {
  10791. return nil, err
  10792. }
  10793. req.Header = reqHeaders
  10794. googleapi.Expand(req.URL, map[string]string{
  10795. "ownerName": c.ownerName,
  10796. })
  10797. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10798. }
  10799. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.create" call.
  10800. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  10801. // status code is an error. Response headers are in either
  10802. // *FilterSet.ServerResponse.Header or (if a response was returned at
  10803. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10804. // to check whether the returned error was because
  10805. // http.StatusNotModified was returned.
  10806. func (c *BiddersAccountsFilterSetsCreateCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  10807. gensupport.SetOptions(c.urlParams_, opts...)
  10808. res, err := c.doRequest("json")
  10809. if res != nil && res.StatusCode == http.StatusNotModified {
  10810. if res.Body != nil {
  10811. res.Body.Close()
  10812. }
  10813. return nil, &googleapi.Error{
  10814. Code: res.StatusCode,
  10815. Header: res.Header,
  10816. }
  10817. }
  10818. if err != nil {
  10819. return nil, err
  10820. }
  10821. defer googleapi.CloseBody(res)
  10822. if err := googleapi.CheckResponse(res); err != nil {
  10823. return nil, err
  10824. }
  10825. ret := &FilterSet{
  10826. ServerResponse: googleapi.ServerResponse{
  10827. Header: res.Header,
  10828. HTTPStatusCode: res.StatusCode,
  10829. },
  10830. }
  10831. target := &ret
  10832. if err := gensupport.DecodeResponse(target, res); err != nil {
  10833. return nil, err
  10834. }
  10835. return ret, nil
  10836. // {
  10837. // "description": "Creates the specified filter set for the account with the given account ID.",
  10838. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets",
  10839. // "httpMethod": "POST",
  10840. // "id": "adexchangebuyer2.bidders.accounts.filterSets.create",
  10841. // "parameterOrder": [
  10842. // "ownerName"
  10843. // ],
  10844. // "parameters": {
  10845. // "isTransient": {
  10846. // "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.",
  10847. // "location": "query",
  10848. // "type": "boolean"
  10849. // },
  10850. // "ownerName": {
  10851. // "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`",
  10852. // "location": "path",
  10853. // "pattern": "^bidders/[^/]+/accounts/[^/]+$",
  10854. // "required": true,
  10855. // "type": "string"
  10856. // }
  10857. // },
  10858. // "path": "v2beta1/{+ownerName}/filterSets",
  10859. // "request": {
  10860. // "$ref": "FilterSet"
  10861. // },
  10862. // "response": {
  10863. // "$ref": "FilterSet"
  10864. // },
  10865. // "scopes": [
  10866. // "https://www.googleapis.com/auth/adexchange.buyer"
  10867. // ]
  10868. // }
  10869. }
  10870. // method id "adexchangebuyer2.bidders.accounts.filterSets.delete":
  10871. type BiddersAccountsFilterSetsDeleteCall struct {
  10872. s *Service
  10873. name string
  10874. urlParams_ gensupport.URLParams
  10875. ctx_ context.Context
  10876. header_ http.Header
  10877. }
  10878. // Delete: Deletes the requested filter set from the account with the
  10879. // given account
  10880. // ID.
  10881. func (r *BiddersAccountsFilterSetsService) Delete(name string) *BiddersAccountsFilterSetsDeleteCall {
  10882. c := &BiddersAccountsFilterSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10883. c.name = name
  10884. return c
  10885. }
  10886. // Fields allows partial responses to be retrieved. See
  10887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10888. // for more information.
  10889. func (c *BiddersAccountsFilterSetsDeleteCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsDeleteCall {
  10890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10891. return c
  10892. }
  10893. // Context sets the context to be used in this call's Do method. Any
  10894. // pending HTTP request will be aborted if the provided context is
  10895. // canceled.
  10896. func (c *BiddersAccountsFilterSetsDeleteCall) Context(ctx context.Context) *BiddersAccountsFilterSetsDeleteCall {
  10897. c.ctx_ = ctx
  10898. return c
  10899. }
  10900. // Header returns an http.Header that can be modified by the caller to
  10901. // add HTTP headers to the request.
  10902. func (c *BiddersAccountsFilterSetsDeleteCall) Header() http.Header {
  10903. if c.header_ == nil {
  10904. c.header_ = make(http.Header)
  10905. }
  10906. return c.header_
  10907. }
  10908. func (c *BiddersAccountsFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10909. reqHeaders := make(http.Header)
  10910. for k, v := range c.header_ {
  10911. reqHeaders[k] = v
  10912. }
  10913. reqHeaders.Set("User-Agent", c.s.userAgent())
  10914. var body io.Reader = nil
  10915. c.urlParams_.Set("alt", alt)
  10916. c.urlParams_.Set("prettyPrint", "false")
  10917. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  10918. urls += "?" + c.urlParams_.Encode()
  10919. req, err := http.NewRequest("DELETE", urls, body)
  10920. if err != nil {
  10921. return nil, err
  10922. }
  10923. req.Header = reqHeaders
  10924. googleapi.Expand(req.URL, map[string]string{
  10925. "name": c.name,
  10926. })
  10927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10928. }
  10929. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.delete" call.
  10930. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  10931. // code is an error. Response headers are in either
  10932. // *Empty.ServerResponse.Header or (if a response was returned at all)
  10933. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10934. // check whether the returned error was because http.StatusNotModified
  10935. // was returned.
  10936. func (c *BiddersAccountsFilterSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  10937. gensupport.SetOptions(c.urlParams_, opts...)
  10938. res, err := c.doRequest("json")
  10939. if res != nil && res.StatusCode == http.StatusNotModified {
  10940. if res.Body != nil {
  10941. res.Body.Close()
  10942. }
  10943. return nil, &googleapi.Error{
  10944. Code: res.StatusCode,
  10945. Header: res.Header,
  10946. }
  10947. }
  10948. if err != nil {
  10949. return nil, err
  10950. }
  10951. defer googleapi.CloseBody(res)
  10952. if err := googleapi.CheckResponse(res); err != nil {
  10953. return nil, err
  10954. }
  10955. ret := &Empty{
  10956. ServerResponse: googleapi.ServerResponse{
  10957. Header: res.Header,
  10958. HTTPStatusCode: res.StatusCode,
  10959. },
  10960. }
  10961. target := &ret
  10962. if err := gensupport.DecodeResponse(target, res); err != nil {
  10963. return nil, err
  10964. }
  10965. return ret, nil
  10966. // {
  10967. // "description": "Deletes the requested filter set from the account with the given account\nID.",
  10968. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}",
  10969. // "httpMethod": "DELETE",
  10970. // "id": "adexchangebuyer2.bidders.accounts.filterSets.delete",
  10971. // "parameterOrder": [
  10972. // "name"
  10973. // ],
  10974. // "parameters": {
  10975. // "name": {
  10976. // "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`",
  10977. // "location": "path",
  10978. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  10979. // "required": true,
  10980. // "type": "string"
  10981. // }
  10982. // },
  10983. // "path": "v2beta1/{+name}",
  10984. // "response": {
  10985. // "$ref": "Empty"
  10986. // },
  10987. // "scopes": [
  10988. // "https://www.googleapis.com/auth/adexchange.buyer"
  10989. // ]
  10990. // }
  10991. }
  10992. // method id "adexchangebuyer2.bidders.accounts.filterSets.get":
  10993. type BiddersAccountsFilterSetsGetCall struct {
  10994. s *Service
  10995. name string
  10996. urlParams_ gensupport.URLParams
  10997. ifNoneMatch_ string
  10998. ctx_ context.Context
  10999. header_ http.Header
  11000. }
  11001. // Get: Retrieves the requested filter set for the account with the
  11002. // given account
  11003. // ID.
  11004. func (r *BiddersAccountsFilterSetsService) Get(name string) *BiddersAccountsFilterSetsGetCall {
  11005. c := &BiddersAccountsFilterSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11006. c.name = name
  11007. return c
  11008. }
  11009. // Fields allows partial responses to be retrieved. See
  11010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11011. // for more information.
  11012. func (c *BiddersAccountsFilterSetsGetCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsGetCall {
  11013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11014. return c
  11015. }
  11016. // IfNoneMatch sets the optional parameter which makes the operation
  11017. // fail if the object's ETag matches the given value. This is useful for
  11018. // getting updates only after the object has changed since the last
  11019. // request. Use googleapi.IsNotModified to check whether the response
  11020. // error from Do is the result of In-None-Match.
  11021. func (c *BiddersAccountsFilterSetsGetCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsGetCall {
  11022. c.ifNoneMatch_ = entityTag
  11023. return c
  11024. }
  11025. // Context sets the context to be used in this call's Do method. Any
  11026. // pending HTTP request will be aborted if the provided context is
  11027. // canceled.
  11028. func (c *BiddersAccountsFilterSetsGetCall) Context(ctx context.Context) *BiddersAccountsFilterSetsGetCall {
  11029. c.ctx_ = ctx
  11030. return c
  11031. }
  11032. // Header returns an http.Header that can be modified by the caller to
  11033. // add HTTP headers to the request.
  11034. func (c *BiddersAccountsFilterSetsGetCall) Header() http.Header {
  11035. if c.header_ == nil {
  11036. c.header_ = make(http.Header)
  11037. }
  11038. return c.header_
  11039. }
  11040. func (c *BiddersAccountsFilterSetsGetCall) doRequest(alt string) (*http.Response, error) {
  11041. reqHeaders := make(http.Header)
  11042. for k, v := range c.header_ {
  11043. reqHeaders[k] = v
  11044. }
  11045. reqHeaders.Set("User-Agent", c.s.userAgent())
  11046. if c.ifNoneMatch_ != "" {
  11047. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11048. }
  11049. var body io.Reader = nil
  11050. c.urlParams_.Set("alt", alt)
  11051. c.urlParams_.Set("prettyPrint", "false")
  11052. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  11053. urls += "?" + c.urlParams_.Encode()
  11054. req, err := http.NewRequest("GET", urls, body)
  11055. if err != nil {
  11056. return nil, err
  11057. }
  11058. req.Header = reqHeaders
  11059. googleapi.Expand(req.URL, map[string]string{
  11060. "name": c.name,
  11061. })
  11062. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11063. }
  11064. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.get" call.
  11065. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  11066. // status code is an error. Response headers are in either
  11067. // *FilterSet.ServerResponse.Header or (if a response was returned at
  11068. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11069. // to check whether the returned error was because
  11070. // http.StatusNotModified was returned.
  11071. func (c *BiddersAccountsFilterSetsGetCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  11072. gensupport.SetOptions(c.urlParams_, opts...)
  11073. res, err := c.doRequest("json")
  11074. if res != nil && res.StatusCode == http.StatusNotModified {
  11075. if res.Body != nil {
  11076. res.Body.Close()
  11077. }
  11078. return nil, &googleapi.Error{
  11079. Code: res.StatusCode,
  11080. Header: res.Header,
  11081. }
  11082. }
  11083. if err != nil {
  11084. return nil, err
  11085. }
  11086. defer googleapi.CloseBody(res)
  11087. if err := googleapi.CheckResponse(res); err != nil {
  11088. return nil, err
  11089. }
  11090. ret := &FilterSet{
  11091. ServerResponse: googleapi.ServerResponse{
  11092. Header: res.Header,
  11093. HTTPStatusCode: res.StatusCode,
  11094. },
  11095. }
  11096. target := &ret
  11097. if err := gensupport.DecodeResponse(target, res); err != nil {
  11098. return nil, err
  11099. }
  11100. return ret, nil
  11101. // {
  11102. // "description": "Retrieves the requested filter set for the account with the given account\nID.",
  11103. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}",
  11104. // "httpMethod": "GET",
  11105. // "id": "adexchangebuyer2.bidders.accounts.filterSets.get",
  11106. // "parameterOrder": [
  11107. // "name"
  11108. // ],
  11109. // "parameters": {
  11110. // "name": {
  11111. // "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`",
  11112. // "location": "path",
  11113. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  11114. // "required": true,
  11115. // "type": "string"
  11116. // }
  11117. // },
  11118. // "path": "v2beta1/{+name}",
  11119. // "response": {
  11120. // "$ref": "FilterSet"
  11121. // },
  11122. // "scopes": [
  11123. // "https://www.googleapis.com/auth/adexchange.buyer"
  11124. // ]
  11125. // }
  11126. }
  11127. // method id "adexchangebuyer2.bidders.accounts.filterSets.list":
  11128. type BiddersAccountsFilterSetsListCall struct {
  11129. s *Service
  11130. ownerName string
  11131. urlParams_ gensupport.URLParams
  11132. ifNoneMatch_ string
  11133. ctx_ context.Context
  11134. header_ http.Header
  11135. }
  11136. // List: Lists all filter sets for the account with the given account
  11137. // ID.
  11138. func (r *BiddersAccountsFilterSetsService) List(ownerName string) *BiddersAccountsFilterSetsListCall {
  11139. c := &BiddersAccountsFilterSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11140. c.ownerName = ownerName
  11141. return c
  11142. }
  11143. // PageSize sets the optional parameter "pageSize": Requested page size.
  11144. // The server may return fewer results than requested.
  11145. // If unspecified, the server will pick an appropriate default.
  11146. func (c *BiddersAccountsFilterSetsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsListCall {
  11147. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11148. return c
  11149. }
  11150. // PageToken sets the optional parameter "pageToken": A token
  11151. // identifying a page of results the server should return.
  11152. // Typically, this is the value
  11153. // of
  11154. // ListFilterSetsResponse.nextPageToken
  11155. // returned from the previous call to
  11156. // the
  11157. // accounts.filterSets.list
  11158. // method.
  11159. func (c *BiddersAccountsFilterSetsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsListCall {
  11160. c.urlParams_.Set("pageToken", pageToken)
  11161. return c
  11162. }
  11163. // Fields allows partial responses to be retrieved. See
  11164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11165. // for more information.
  11166. func (c *BiddersAccountsFilterSetsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsListCall {
  11167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11168. return c
  11169. }
  11170. // IfNoneMatch sets the optional parameter which makes the operation
  11171. // fail if the object's ETag matches the given value. This is useful for
  11172. // getting updates only after the object has changed since the last
  11173. // request. Use googleapi.IsNotModified to check whether the response
  11174. // error from Do is the result of In-None-Match.
  11175. func (c *BiddersAccountsFilterSetsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsListCall {
  11176. c.ifNoneMatch_ = entityTag
  11177. return c
  11178. }
  11179. // Context sets the context to be used in this call's Do method. Any
  11180. // pending HTTP request will be aborted if the provided context is
  11181. // canceled.
  11182. func (c *BiddersAccountsFilterSetsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsListCall {
  11183. c.ctx_ = ctx
  11184. return c
  11185. }
  11186. // Header returns an http.Header that can be modified by the caller to
  11187. // add HTTP headers to the request.
  11188. func (c *BiddersAccountsFilterSetsListCall) Header() http.Header {
  11189. if c.header_ == nil {
  11190. c.header_ = make(http.Header)
  11191. }
  11192. return c.header_
  11193. }
  11194. func (c *BiddersAccountsFilterSetsListCall) doRequest(alt string) (*http.Response, error) {
  11195. reqHeaders := make(http.Header)
  11196. for k, v := range c.header_ {
  11197. reqHeaders[k] = v
  11198. }
  11199. reqHeaders.Set("User-Agent", c.s.userAgent())
  11200. if c.ifNoneMatch_ != "" {
  11201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11202. }
  11203. var body io.Reader = nil
  11204. c.urlParams_.Set("alt", alt)
  11205. c.urlParams_.Set("prettyPrint", "false")
  11206. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  11207. urls += "?" + c.urlParams_.Encode()
  11208. req, err := http.NewRequest("GET", urls, body)
  11209. if err != nil {
  11210. return nil, err
  11211. }
  11212. req.Header = reqHeaders
  11213. googleapi.Expand(req.URL, map[string]string{
  11214. "ownerName": c.ownerName,
  11215. })
  11216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11217. }
  11218. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.list" call.
  11219. // Exactly one of *ListFilterSetsResponse or error will be non-nil. Any
  11220. // non-2xx status code is an error. Response headers are in either
  11221. // *ListFilterSetsResponse.ServerResponse.Header or (if a response was
  11222. // returned at all) in error.(*googleapi.Error).Header. Use
  11223. // googleapi.IsNotModified to check whether the returned error was
  11224. // because http.StatusNotModified was returned.
  11225. func (c *BiddersAccountsFilterSetsListCall) Do(opts ...googleapi.CallOption) (*ListFilterSetsResponse, error) {
  11226. gensupport.SetOptions(c.urlParams_, opts...)
  11227. res, err := c.doRequest("json")
  11228. if res != nil && res.StatusCode == http.StatusNotModified {
  11229. if res.Body != nil {
  11230. res.Body.Close()
  11231. }
  11232. return nil, &googleapi.Error{
  11233. Code: res.StatusCode,
  11234. Header: res.Header,
  11235. }
  11236. }
  11237. if err != nil {
  11238. return nil, err
  11239. }
  11240. defer googleapi.CloseBody(res)
  11241. if err := googleapi.CheckResponse(res); err != nil {
  11242. return nil, err
  11243. }
  11244. ret := &ListFilterSetsResponse{
  11245. ServerResponse: googleapi.ServerResponse{
  11246. Header: res.Header,
  11247. HTTPStatusCode: res.StatusCode,
  11248. },
  11249. }
  11250. target := &ret
  11251. if err := gensupport.DecodeResponse(target, res); err != nil {
  11252. return nil, err
  11253. }
  11254. return ret, nil
  11255. // {
  11256. // "description": "Lists all filter sets for the account with the given account ID.",
  11257. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets",
  11258. // "httpMethod": "GET",
  11259. // "id": "adexchangebuyer2.bidders.accounts.filterSets.list",
  11260. // "parameterOrder": [
  11261. // "ownerName"
  11262. // ],
  11263. // "parameters": {
  11264. // "ownerName": {
  11265. // "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`",
  11266. // "location": "path",
  11267. // "pattern": "^bidders/[^/]+/accounts/[^/]+$",
  11268. // "required": true,
  11269. // "type": "string"
  11270. // },
  11271. // "pageSize": {
  11272. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  11273. // "format": "int32",
  11274. // "location": "query",
  11275. // "type": "integer"
  11276. // },
  11277. // "pageToken": {
  11278. // "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.",
  11279. // "location": "query",
  11280. // "type": "string"
  11281. // }
  11282. // },
  11283. // "path": "v2beta1/{+ownerName}/filterSets",
  11284. // "response": {
  11285. // "$ref": "ListFilterSetsResponse"
  11286. // },
  11287. // "scopes": [
  11288. // "https://www.googleapis.com/auth/adexchange.buyer"
  11289. // ]
  11290. // }
  11291. }
  11292. // Pages invokes f for each page of results.
  11293. // A non-nil error returned from f will halt the iteration.
  11294. // The provided context supersedes any context provided to the Context method.
  11295. func (c *BiddersAccountsFilterSetsListCall) Pages(ctx context.Context, f func(*ListFilterSetsResponse) error) error {
  11296. c.ctx_ = ctx
  11297. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11298. for {
  11299. x, err := c.Do()
  11300. if err != nil {
  11301. return err
  11302. }
  11303. if err := f(x); err != nil {
  11304. return err
  11305. }
  11306. if x.NextPageToken == "" {
  11307. return nil
  11308. }
  11309. c.PageToken(x.NextPageToken)
  11310. }
  11311. }
  11312. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list":
  11313. type BiddersAccountsFilterSetsBidMetricsListCall struct {
  11314. s *Service
  11315. filterSetName string
  11316. urlParams_ gensupport.URLParams
  11317. ifNoneMatch_ string
  11318. ctx_ context.Context
  11319. header_ http.Header
  11320. }
  11321. // List: Lists all metrics that are measured in terms of number of bids.
  11322. func (r *BiddersAccountsFilterSetsBidMetricsService) List(filterSetName string) *BiddersAccountsFilterSetsBidMetricsListCall {
  11323. c := &BiddersAccountsFilterSetsBidMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11324. c.filterSetName = filterSetName
  11325. return c
  11326. }
  11327. // PageSize sets the optional parameter "pageSize": Requested page size.
  11328. // The server may return fewer results than requested.
  11329. // If unspecified, the server will pick an appropriate default.
  11330. func (c *BiddersAccountsFilterSetsBidMetricsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidMetricsListCall {
  11331. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11332. return c
  11333. }
  11334. // PageToken sets the optional parameter "pageToken": A token
  11335. // identifying a page of results the server should return.
  11336. // Typically, this is the value
  11337. // of
  11338. // ListBidMetricsResponse.nextPageToken
  11339. // returned from the previous call to the bidMetrics.list
  11340. // method.
  11341. func (c *BiddersAccountsFilterSetsBidMetricsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidMetricsListCall {
  11342. c.urlParams_.Set("pageToken", pageToken)
  11343. return c
  11344. }
  11345. // Fields allows partial responses to be retrieved. See
  11346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11347. // for more information.
  11348. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidMetricsListCall {
  11349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11350. return c
  11351. }
  11352. // IfNoneMatch sets the optional parameter which makes the operation
  11353. // fail if the object's ETag matches the given value. This is useful for
  11354. // getting updates only after the object has changed since the last
  11355. // request. Use googleapi.IsNotModified to check whether the response
  11356. // error from Do is the result of In-None-Match.
  11357. func (c *BiddersAccountsFilterSetsBidMetricsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidMetricsListCall {
  11358. c.ifNoneMatch_ = entityTag
  11359. return c
  11360. }
  11361. // Context sets the context to be used in this call's Do method. Any
  11362. // pending HTTP request will be aborted if the provided context is
  11363. // canceled.
  11364. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidMetricsListCall {
  11365. c.ctx_ = ctx
  11366. return c
  11367. }
  11368. // Header returns an http.Header that can be modified by the caller to
  11369. // add HTTP headers to the request.
  11370. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Header() http.Header {
  11371. if c.header_ == nil {
  11372. c.header_ = make(http.Header)
  11373. }
  11374. return c.header_
  11375. }
  11376. func (c *BiddersAccountsFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Response, error) {
  11377. reqHeaders := make(http.Header)
  11378. for k, v := range c.header_ {
  11379. reqHeaders[k] = v
  11380. }
  11381. reqHeaders.Set("User-Agent", c.s.userAgent())
  11382. if c.ifNoneMatch_ != "" {
  11383. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11384. }
  11385. var body io.Reader = nil
  11386. c.urlParams_.Set("alt", alt)
  11387. c.urlParams_.Set("prettyPrint", "false")
  11388. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics")
  11389. urls += "?" + c.urlParams_.Encode()
  11390. req, err := http.NewRequest("GET", urls, body)
  11391. if err != nil {
  11392. return nil, err
  11393. }
  11394. req.Header = reqHeaders
  11395. googleapi.Expand(req.URL, map[string]string{
  11396. "filterSetName": c.filterSetName,
  11397. })
  11398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11399. }
  11400. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list" call.
  11401. // Exactly one of *ListBidMetricsResponse or error will be non-nil. Any
  11402. // non-2xx status code is an error. Response headers are in either
  11403. // *ListBidMetricsResponse.ServerResponse.Header or (if a response was
  11404. // returned at all) in error.(*googleapi.Error).Header. Use
  11405. // googleapi.IsNotModified to check whether the returned error was
  11406. // because http.StatusNotModified was returned.
  11407. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Do(opts ...googleapi.CallOption) (*ListBidMetricsResponse, error) {
  11408. gensupport.SetOptions(c.urlParams_, opts...)
  11409. res, err := c.doRequest("json")
  11410. if res != nil && res.StatusCode == http.StatusNotModified {
  11411. if res.Body != nil {
  11412. res.Body.Close()
  11413. }
  11414. return nil, &googleapi.Error{
  11415. Code: res.StatusCode,
  11416. Header: res.Header,
  11417. }
  11418. }
  11419. if err != nil {
  11420. return nil, err
  11421. }
  11422. defer googleapi.CloseBody(res)
  11423. if err := googleapi.CheckResponse(res); err != nil {
  11424. return nil, err
  11425. }
  11426. ret := &ListBidMetricsResponse{
  11427. ServerResponse: googleapi.ServerResponse{
  11428. Header: res.Header,
  11429. HTTPStatusCode: res.StatusCode,
  11430. },
  11431. }
  11432. target := &ret
  11433. if err := gensupport.DecodeResponse(target, res); err != nil {
  11434. return nil, err
  11435. }
  11436. return ret, nil
  11437. // {
  11438. // "description": "Lists all metrics that are measured in terms of number of bids.",
  11439. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidMetrics",
  11440. // "httpMethod": "GET",
  11441. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list",
  11442. // "parameterOrder": [
  11443. // "filterSetName"
  11444. // ],
  11445. // "parameters": {
  11446. // "filterSetName": {
  11447. // "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`",
  11448. // "location": "path",
  11449. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  11450. // "required": true,
  11451. // "type": "string"
  11452. // },
  11453. // "pageSize": {
  11454. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  11455. // "format": "int32",
  11456. // "location": "query",
  11457. // "type": "integer"
  11458. // },
  11459. // "pageToken": {
  11460. // "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.",
  11461. // "location": "query",
  11462. // "type": "string"
  11463. // }
  11464. // },
  11465. // "path": "v2beta1/{+filterSetName}/bidMetrics",
  11466. // "response": {
  11467. // "$ref": "ListBidMetricsResponse"
  11468. // },
  11469. // "scopes": [
  11470. // "https://www.googleapis.com/auth/adexchange.buyer"
  11471. // ]
  11472. // }
  11473. }
  11474. // Pages invokes f for each page of results.
  11475. // A non-nil error returned from f will halt the iteration.
  11476. // The provided context supersedes any context provided to the Context method.
  11477. func (c *BiddersAccountsFilterSetsBidMetricsListCall) Pages(ctx context.Context, f func(*ListBidMetricsResponse) error) error {
  11478. c.ctx_ = ctx
  11479. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11480. for {
  11481. x, err := c.Do()
  11482. if err != nil {
  11483. return err
  11484. }
  11485. if err := f(x); err != nil {
  11486. return err
  11487. }
  11488. if x.NextPageToken == "" {
  11489. return nil
  11490. }
  11491. c.PageToken(x.NextPageToken)
  11492. }
  11493. }
  11494. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list":
  11495. type BiddersAccountsFilterSetsBidResponseErrorsListCall struct {
  11496. s *Service
  11497. filterSetName string
  11498. urlParams_ gensupport.URLParams
  11499. ifNoneMatch_ string
  11500. ctx_ context.Context
  11501. header_ http.Header
  11502. }
  11503. // List: List all errors that occurred in bid responses, with the number
  11504. // of bid
  11505. // responses affected for each reason.
  11506. func (r *BiddersAccountsFilterSetsBidResponseErrorsService) List(filterSetName string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11507. c := &BiddersAccountsFilterSetsBidResponseErrorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11508. c.filterSetName = filterSetName
  11509. return c
  11510. }
  11511. // PageSize sets the optional parameter "pageSize": Requested page size.
  11512. // The server may return fewer results than requested.
  11513. // If unspecified, the server will pick an appropriate default.
  11514. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11515. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11516. return c
  11517. }
  11518. // PageToken sets the optional parameter "pageToken": A token
  11519. // identifying a page of results the server should return.
  11520. // Typically, this is the value
  11521. // of
  11522. // ListBidResponseErrorsResponse.nextPageToken
  11523. // returned from the previous call to the bidResponseErrors.list
  11524. // method.
  11525. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11526. c.urlParams_.Set("pageToken", pageToken)
  11527. return c
  11528. }
  11529. // Fields allows partial responses to be retrieved. See
  11530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11531. // for more information.
  11532. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11534. return c
  11535. }
  11536. // IfNoneMatch sets the optional parameter which makes the operation
  11537. // fail if the object's ETag matches the given value. This is useful for
  11538. // getting updates only after the object has changed since the last
  11539. // request. Use googleapi.IsNotModified to check whether the response
  11540. // error from Do is the result of In-None-Match.
  11541. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11542. c.ifNoneMatch_ = entityTag
  11543. return c
  11544. }
  11545. // Context sets the context to be used in this call's Do method. Any
  11546. // pending HTTP request will be aborted if the provided context is
  11547. // canceled.
  11548. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidResponseErrorsListCall {
  11549. c.ctx_ = ctx
  11550. return c
  11551. }
  11552. // Header returns an http.Header that can be modified by the caller to
  11553. // add HTTP headers to the request.
  11554. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Header() http.Header {
  11555. if c.header_ == nil {
  11556. c.header_ = make(http.Header)
  11557. }
  11558. return c.header_
  11559. }
  11560. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*http.Response, error) {
  11561. reqHeaders := make(http.Header)
  11562. for k, v := range c.header_ {
  11563. reqHeaders[k] = v
  11564. }
  11565. reqHeaders.Set("User-Agent", c.s.userAgent())
  11566. if c.ifNoneMatch_ != "" {
  11567. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11568. }
  11569. var body io.Reader = nil
  11570. c.urlParams_.Set("alt", alt)
  11571. c.urlParams_.Set("prettyPrint", "false")
  11572. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors")
  11573. urls += "?" + c.urlParams_.Encode()
  11574. req, err := http.NewRequest("GET", urls, body)
  11575. if err != nil {
  11576. return nil, err
  11577. }
  11578. req.Header = reqHeaders
  11579. googleapi.Expand(req.URL, map[string]string{
  11580. "filterSetName": c.filterSetName,
  11581. })
  11582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11583. }
  11584. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list" call.
  11585. // Exactly one of *ListBidResponseErrorsResponse or error will be
  11586. // non-nil. Any non-2xx status code is an error. Response headers are in
  11587. // either *ListBidResponseErrorsResponse.ServerResponse.Header or (if a
  11588. // response was returned at all) in error.(*googleapi.Error).Header. Use
  11589. // googleapi.IsNotModified to check whether the returned error was
  11590. // because http.StatusNotModified was returned.
  11591. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponseErrorsResponse, error) {
  11592. gensupport.SetOptions(c.urlParams_, opts...)
  11593. res, err := c.doRequest("json")
  11594. if res != nil && res.StatusCode == http.StatusNotModified {
  11595. if res.Body != nil {
  11596. res.Body.Close()
  11597. }
  11598. return nil, &googleapi.Error{
  11599. Code: res.StatusCode,
  11600. Header: res.Header,
  11601. }
  11602. }
  11603. if err != nil {
  11604. return nil, err
  11605. }
  11606. defer googleapi.CloseBody(res)
  11607. if err := googleapi.CheckResponse(res); err != nil {
  11608. return nil, err
  11609. }
  11610. ret := &ListBidResponseErrorsResponse{
  11611. ServerResponse: googleapi.ServerResponse{
  11612. Header: res.Header,
  11613. HTTPStatusCode: res.StatusCode,
  11614. },
  11615. }
  11616. target := &ret
  11617. if err := gensupport.DecodeResponse(target, res); err != nil {
  11618. return nil, err
  11619. }
  11620. return ret, nil
  11621. // {
  11622. // "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason.",
  11623. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponseErrors",
  11624. // "httpMethod": "GET",
  11625. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list",
  11626. // "parameterOrder": [
  11627. // "filterSetName"
  11628. // ],
  11629. // "parameters": {
  11630. // "filterSetName": {
  11631. // "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`",
  11632. // "location": "path",
  11633. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  11634. // "required": true,
  11635. // "type": "string"
  11636. // },
  11637. // "pageSize": {
  11638. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  11639. // "format": "int32",
  11640. // "location": "query",
  11641. // "type": "integer"
  11642. // },
  11643. // "pageToken": {
  11644. // "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.",
  11645. // "location": "query",
  11646. // "type": "string"
  11647. // }
  11648. // },
  11649. // "path": "v2beta1/{+filterSetName}/bidResponseErrors",
  11650. // "response": {
  11651. // "$ref": "ListBidResponseErrorsResponse"
  11652. // },
  11653. // "scopes": [
  11654. // "https://www.googleapis.com/auth/adexchange.buyer"
  11655. // ]
  11656. // }
  11657. }
  11658. // Pages invokes f for each page of results.
  11659. // A non-nil error returned from f will halt the iteration.
  11660. // The provided context supersedes any context provided to the Context method.
  11661. func (c *BiddersAccountsFilterSetsBidResponseErrorsListCall) Pages(ctx context.Context, f func(*ListBidResponseErrorsResponse) error) error {
  11662. c.ctx_ = ctx
  11663. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11664. for {
  11665. x, err := c.Do()
  11666. if err != nil {
  11667. return err
  11668. }
  11669. if err := f(x); err != nil {
  11670. return err
  11671. }
  11672. if x.NextPageToken == "" {
  11673. return nil
  11674. }
  11675. c.PageToken(x.NextPageToken)
  11676. }
  11677. }
  11678. // method id "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list":
  11679. type BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall struct {
  11680. s *Service
  11681. filterSetName string
  11682. urlParams_ gensupport.URLParams
  11683. ifNoneMatch_ string
  11684. ctx_ context.Context
  11685. header_ http.Header
  11686. }
  11687. // List: List all reasons for which bid responses were considered to
  11688. // have no
  11689. // applicable bids, with the number of bid responses affected for each
  11690. // reason.
  11691. func (r *BiddersAccountsFilterSetsBidResponsesWithoutBidsService) List(filterSetName string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11692. c := &BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11693. c.filterSetName = filterSetName
  11694. return c
  11695. }
  11696. // PageSize sets the optional parameter "pageSize": Requested page size.
  11697. // The server may return fewer results than requested.
  11698. // If unspecified, the server will pick an appropriate default.
  11699. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11700. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11701. return c
  11702. }
  11703. // PageToken sets the optional parameter "pageToken": A token
  11704. // identifying a page of results the server should return.
  11705. // Typically, this is the value
  11706. // of
  11707. // ListBidResponsesWithoutBidsResponse.nextPageToken
  11708. // returned from the previous call to the
  11709. // bidResponsesWithoutBids.list
  11710. // method.
  11711. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11712. c.urlParams_.Set("pageToken", pageToken)
  11713. return c
  11714. }
  11715. // Fields allows partial responses to be retrieved. See
  11716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11717. // for more information.
  11718. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11720. return c
  11721. }
  11722. // IfNoneMatch sets the optional parameter which makes the operation
  11723. // fail if the object's ETag matches the given value. This is useful for
  11724. // getting updates only after the object has changed since the last
  11725. // request. Use googleapi.IsNotModified to check whether the response
  11726. // error from Do is the result of In-None-Match.
  11727. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11728. c.ifNoneMatch_ = entityTag
  11729. return c
  11730. }
  11731. // Context sets the context to be used in this call's Do method. Any
  11732. // pending HTTP request will be aborted if the provided context is
  11733. // canceled.
  11734. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall {
  11735. c.ctx_ = ctx
  11736. return c
  11737. }
  11738. // Header returns an http.Header that can be modified by the caller to
  11739. // add HTTP headers to the request.
  11740. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Header() http.Header {
  11741. if c.header_ == nil {
  11742. c.header_ = make(http.Header)
  11743. }
  11744. return c.header_
  11745. }
  11746. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) (*http.Response, error) {
  11747. reqHeaders := make(http.Header)
  11748. for k, v := range c.header_ {
  11749. reqHeaders[k] = v
  11750. }
  11751. reqHeaders.Set("User-Agent", c.s.userAgent())
  11752. if c.ifNoneMatch_ != "" {
  11753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11754. }
  11755. var body io.Reader = nil
  11756. c.urlParams_.Set("alt", alt)
  11757. c.urlParams_.Set("prettyPrint", "false")
  11758. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids")
  11759. urls += "?" + c.urlParams_.Encode()
  11760. req, err := http.NewRequest("GET", urls, body)
  11761. if err != nil {
  11762. return nil, err
  11763. }
  11764. req.Header = reqHeaders
  11765. googleapi.Expand(req.URL, map[string]string{
  11766. "filterSetName": c.filterSetName,
  11767. })
  11768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11769. }
  11770. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list" call.
  11771. // Exactly one of *ListBidResponsesWithoutBidsResponse or error will be
  11772. // non-nil. Any non-2xx status code is an error. Response headers are in
  11773. // either *ListBidResponsesWithoutBidsResponse.ServerResponse.Header or
  11774. // (if a response was returned at all) in
  11775. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11776. // whether the returned error was because http.StatusNotModified was
  11777. // returned.
  11778. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponsesWithoutBidsResponse, error) {
  11779. gensupport.SetOptions(c.urlParams_, opts...)
  11780. res, err := c.doRequest("json")
  11781. if res != nil && res.StatusCode == http.StatusNotModified {
  11782. if res.Body != nil {
  11783. res.Body.Close()
  11784. }
  11785. return nil, &googleapi.Error{
  11786. Code: res.StatusCode,
  11787. Header: res.Header,
  11788. }
  11789. }
  11790. if err != nil {
  11791. return nil, err
  11792. }
  11793. defer googleapi.CloseBody(res)
  11794. if err := googleapi.CheckResponse(res); err != nil {
  11795. return nil, err
  11796. }
  11797. ret := &ListBidResponsesWithoutBidsResponse{
  11798. ServerResponse: googleapi.ServerResponse{
  11799. Header: res.Header,
  11800. HTTPStatusCode: res.StatusCode,
  11801. },
  11802. }
  11803. target := &ret
  11804. if err := gensupport.DecodeResponse(target, res); err != nil {
  11805. return nil, err
  11806. }
  11807. return ret, nil
  11808. // {
  11809. // "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.",
  11810. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/bidResponsesWithoutBids",
  11811. // "httpMethod": "GET",
  11812. // "id": "adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list",
  11813. // "parameterOrder": [
  11814. // "filterSetName"
  11815. // ],
  11816. // "parameters": {
  11817. // "filterSetName": {
  11818. // "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`",
  11819. // "location": "path",
  11820. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  11821. // "required": true,
  11822. // "type": "string"
  11823. // },
  11824. // "pageSize": {
  11825. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  11826. // "format": "int32",
  11827. // "location": "query",
  11828. // "type": "integer"
  11829. // },
  11830. // "pageToken": {
  11831. // "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.",
  11832. // "location": "query",
  11833. // "type": "string"
  11834. // }
  11835. // },
  11836. // "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids",
  11837. // "response": {
  11838. // "$ref": "ListBidResponsesWithoutBidsResponse"
  11839. // },
  11840. // "scopes": [
  11841. // "https://www.googleapis.com/auth/adexchange.buyer"
  11842. // ]
  11843. // }
  11844. }
  11845. // Pages invokes f for each page of results.
  11846. // A non-nil error returned from f will halt the iteration.
  11847. // The provided context supersedes any context provided to the Context method.
  11848. func (c *BiddersAccountsFilterSetsBidResponsesWithoutBidsListCall) Pages(ctx context.Context, f func(*ListBidResponsesWithoutBidsResponse) error) error {
  11849. c.ctx_ = ctx
  11850. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11851. for {
  11852. x, err := c.Do()
  11853. if err != nil {
  11854. return err
  11855. }
  11856. if err := f(x); err != nil {
  11857. return err
  11858. }
  11859. if x.NextPageToken == "" {
  11860. return nil
  11861. }
  11862. c.PageToken(x.NextPageToken)
  11863. }
  11864. }
  11865. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list":
  11866. type BiddersAccountsFilterSetsFilteredBidRequestsListCall struct {
  11867. s *Service
  11868. filterSetName string
  11869. urlParams_ gensupport.URLParams
  11870. ifNoneMatch_ string
  11871. ctx_ context.Context
  11872. header_ http.Header
  11873. }
  11874. // List: List all reasons that caused a bid request not to be sent for
  11875. // an
  11876. // impression, with the number of bid requests not sent for each reason.
  11877. func (r *BiddersAccountsFilterSetsFilteredBidRequestsService) List(filterSetName string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11878. c := &BiddersAccountsFilterSetsFilteredBidRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11879. c.filterSetName = filterSetName
  11880. return c
  11881. }
  11882. // PageSize sets the optional parameter "pageSize": Requested page size.
  11883. // The server may return fewer results than requested.
  11884. // If unspecified, the server will pick an appropriate default.
  11885. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11886. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11887. return c
  11888. }
  11889. // PageToken sets the optional parameter "pageToken": A token
  11890. // identifying a page of results the server should return.
  11891. // Typically, this is the value
  11892. // of
  11893. // ListFilteredBidRequestsResponse.nextPageToken
  11894. // returned from the previous call to the
  11895. // filteredBidRequests.list
  11896. // method.
  11897. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11898. c.urlParams_.Set("pageToken", pageToken)
  11899. return c
  11900. }
  11901. // Fields allows partial responses to be retrieved. See
  11902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11903. // for more information.
  11904. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11906. return c
  11907. }
  11908. // IfNoneMatch sets the optional parameter which makes the operation
  11909. // fail if the object's ETag matches the given value. This is useful for
  11910. // getting updates only after the object has changed since the last
  11911. // request. Use googleapi.IsNotModified to check whether the response
  11912. // error from Do is the result of In-None-Match.
  11913. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11914. c.ifNoneMatch_ = entityTag
  11915. return c
  11916. }
  11917. // Context sets the context to be used in this call's Do method. Any
  11918. // pending HTTP request will be aborted if the provided context is
  11919. // canceled.
  11920. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidRequestsListCall {
  11921. c.ctx_ = ctx
  11922. return c
  11923. }
  11924. // Header returns an http.Header that can be modified by the caller to
  11925. // add HTTP headers to the request.
  11926. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Header() http.Header {
  11927. if c.header_ == nil {
  11928. c.header_ = make(http.Header)
  11929. }
  11930. return c.header_
  11931. }
  11932. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*http.Response, error) {
  11933. reqHeaders := make(http.Header)
  11934. for k, v := range c.header_ {
  11935. reqHeaders[k] = v
  11936. }
  11937. reqHeaders.Set("User-Agent", c.s.userAgent())
  11938. if c.ifNoneMatch_ != "" {
  11939. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11940. }
  11941. var body io.Reader = nil
  11942. c.urlParams_.Set("alt", alt)
  11943. c.urlParams_.Set("prettyPrint", "false")
  11944. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests")
  11945. urls += "?" + c.urlParams_.Encode()
  11946. req, err := http.NewRequest("GET", urls, body)
  11947. if err != nil {
  11948. return nil, err
  11949. }
  11950. req.Header = reqHeaders
  11951. googleapi.Expand(req.URL, map[string]string{
  11952. "filterSetName": c.filterSetName,
  11953. })
  11954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11955. }
  11956. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list" call.
  11957. // Exactly one of *ListFilteredBidRequestsResponse or error will be
  11958. // non-nil. Any non-2xx status code is an error. Response headers are in
  11959. // either *ListFilteredBidRequestsResponse.ServerResponse.Header or (if
  11960. // a response was returned at all) in error.(*googleapi.Error).Header.
  11961. // Use googleapi.IsNotModified to check whether the returned error was
  11962. // because http.StatusNotModified was returned.
  11963. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidRequestsResponse, error) {
  11964. gensupport.SetOptions(c.urlParams_, opts...)
  11965. res, err := c.doRequest("json")
  11966. if res != nil && res.StatusCode == http.StatusNotModified {
  11967. if res.Body != nil {
  11968. res.Body.Close()
  11969. }
  11970. return nil, &googleapi.Error{
  11971. Code: res.StatusCode,
  11972. Header: res.Header,
  11973. }
  11974. }
  11975. if err != nil {
  11976. return nil, err
  11977. }
  11978. defer googleapi.CloseBody(res)
  11979. if err := googleapi.CheckResponse(res); err != nil {
  11980. return nil, err
  11981. }
  11982. ret := &ListFilteredBidRequestsResponse{
  11983. ServerResponse: googleapi.ServerResponse{
  11984. Header: res.Header,
  11985. HTTPStatusCode: res.StatusCode,
  11986. },
  11987. }
  11988. target := &ret
  11989. if err := gensupport.DecodeResponse(target, res); err != nil {
  11990. return nil, err
  11991. }
  11992. return ret, nil
  11993. // {
  11994. // "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.",
  11995. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBidRequests",
  11996. // "httpMethod": "GET",
  11997. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list",
  11998. // "parameterOrder": [
  11999. // "filterSetName"
  12000. // ],
  12001. // "parameters": {
  12002. // "filterSetName": {
  12003. // "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`",
  12004. // "location": "path",
  12005. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12006. // "required": true,
  12007. // "type": "string"
  12008. // },
  12009. // "pageSize": {
  12010. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12011. // "format": "int32",
  12012. // "location": "query",
  12013. // "type": "integer"
  12014. // },
  12015. // "pageToken": {
  12016. // "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.",
  12017. // "location": "query",
  12018. // "type": "string"
  12019. // }
  12020. // },
  12021. // "path": "v2beta1/{+filterSetName}/filteredBidRequests",
  12022. // "response": {
  12023. // "$ref": "ListFilteredBidRequestsResponse"
  12024. // },
  12025. // "scopes": [
  12026. // "https://www.googleapis.com/auth/adexchange.buyer"
  12027. // ]
  12028. // }
  12029. }
  12030. // Pages invokes f for each page of results.
  12031. // A non-nil error returned from f will halt the iteration.
  12032. // The provided context supersedes any context provided to the Context method.
  12033. func (c *BiddersAccountsFilterSetsFilteredBidRequestsListCall) Pages(ctx context.Context, f func(*ListFilteredBidRequestsResponse) error) error {
  12034. c.ctx_ = ctx
  12035. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12036. for {
  12037. x, err := c.Do()
  12038. if err != nil {
  12039. return err
  12040. }
  12041. if err := f(x); err != nil {
  12042. return err
  12043. }
  12044. if x.NextPageToken == "" {
  12045. return nil
  12046. }
  12047. c.PageToken(x.NextPageToken)
  12048. }
  12049. }
  12050. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list":
  12051. type BiddersAccountsFilterSetsFilteredBidsListCall struct {
  12052. s *Service
  12053. filterSetName string
  12054. urlParams_ gensupport.URLParams
  12055. ifNoneMatch_ string
  12056. ctx_ context.Context
  12057. header_ http.Header
  12058. }
  12059. // List: List all reasons for which bids were filtered, with the number
  12060. // of bids
  12061. // filtered for each reason.
  12062. func (r *BiddersAccountsFilterSetsFilteredBidsService) List(filterSetName string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12063. c := &BiddersAccountsFilterSetsFilteredBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12064. c.filterSetName = filterSetName
  12065. return c
  12066. }
  12067. // PageSize sets the optional parameter "pageSize": Requested page size.
  12068. // The server may return fewer results than requested.
  12069. // If unspecified, the server will pick an appropriate default.
  12070. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12071. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12072. return c
  12073. }
  12074. // PageToken sets the optional parameter "pageToken": A token
  12075. // identifying a page of results the server should return.
  12076. // Typically, this is the value
  12077. // of
  12078. // ListFilteredBidsResponse.nextPageToken
  12079. // returned from the previous call to the filteredBids.list
  12080. // method.
  12081. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12082. c.urlParams_.Set("pageToken", pageToken)
  12083. return c
  12084. }
  12085. // Fields allows partial responses to be retrieved. See
  12086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12087. // for more information.
  12088. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12090. return c
  12091. }
  12092. // IfNoneMatch sets the optional parameter which makes the operation
  12093. // fail if the object's ETag matches the given value. This is useful for
  12094. // getting updates only after the object has changed since the last
  12095. // request. Use googleapi.IsNotModified to check whether the response
  12096. // error from Do is the result of In-None-Match.
  12097. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12098. c.ifNoneMatch_ = entityTag
  12099. return c
  12100. }
  12101. // Context sets the context to be used in this call's Do method. Any
  12102. // pending HTTP request will be aborted if the provided context is
  12103. // canceled.
  12104. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsListCall {
  12105. c.ctx_ = ctx
  12106. return c
  12107. }
  12108. // Header returns an http.Header that can be modified by the caller to
  12109. // add HTTP headers to the request.
  12110. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Header() http.Header {
  12111. if c.header_ == nil {
  12112. c.header_ = make(http.Header)
  12113. }
  12114. return c.header_
  12115. }
  12116. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Response, error) {
  12117. reqHeaders := make(http.Header)
  12118. for k, v := range c.header_ {
  12119. reqHeaders[k] = v
  12120. }
  12121. reqHeaders.Set("User-Agent", c.s.userAgent())
  12122. if c.ifNoneMatch_ != "" {
  12123. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12124. }
  12125. var body io.Reader = nil
  12126. c.urlParams_.Set("alt", alt)
  12127. c.urlParams_.Set("prettyPrint", "false")
  12128. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids")
  12129. urls += "?" + c.urlParams_.Encode()
  12130. req, err := http.NewRequest("GET", urls, body)
  12131. if err != nil {
  12132. return nil, err
  12133. }
  12134. req.Header = reqHeaders
  12135. googleapi.Expand(req.URL, map[string]string{
  12136. "filterSetName": c.filterSetName,
  12137. })
  12138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12139. }
  12140. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list" call.
  12141. // Exactly one of *ListFilteredBidsResponse or error will be non-nil.
  12142. // Any non-2xx status code is an error. Response headers are in either
  12143. // *ListFilteredBidsResponse.ServerResponse.Header or (if a response was
  12144. // returned at all) in error.(*googleapi.Error).Header. Use
  12145. // googleapi.IsNotModified to check whether the returned error was
  12146. // because http.StatusNotModified was returned.
  12147. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidsResponse, error) {
  12148. gensupport.SetOptions(c.urlParams_, opts...)
  12149. res, err := c.doRequest("json")
  12150. if res != nil && res.StatusCode == http.StatusNotModified {
  12151. if res.Body != nil {
  12152. res.Body.Close()
  12153. }
  12154. return nil, &googleapi.Error{
  12155. Code: res.StatusCode,
  12156. Header: res.Header,
  12157. }
  12158. }
  12159. if err != nil {
  12160. return nil, err
  12161. }
  12162. defer googleapi.CloseBody(res)
  12163. if err := googleapi.CheckResponse(res); err != nil {
  12164. return nil, err
  12165. }
  12166. ret := &ListFilteredBidsResponse{
  12167. ServerResponse: googleapi.ServerResponse{
  12168. Header: res.Header,
  12169. HTTPStatusCode: res.StatusCode,
  12170. },
  12171. }
  12172. target := &ret
  12173. if err := gensupport.DecodeResponse(target, res); err != nil {
  12174. return nil, err
  12175. }
  12176. return ret, nil
  12177. // {
  12178. // "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.",
  12179. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids",
  12180. // "httpMethod": "GET",
  12181. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list",
  12182. // "parameterOrder": [
  12183. // "filterSetName"
  12184. // ],
  12185. // "parameters": {
  12186. // "filterSetName": {
  12187. // "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`",
  12188. // "location": "path",
  12189. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12190. // "required": true,
  12191. // "type": "string"
  12192. // },
  12193. // "pageSize": {
  12194. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12195. // "format": "int32",
  12196. // "location": "query",
  12197. // "type": "integer"
  12198. // },
  12199. // "pageToken": {
  12200. // "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.",
  12201. // "location": "query",
  12202. // "type": "string"
  12203. // }
  12204. // },
  12205. // "path": "v2beta1/{+filterSetName}/filteredBids",
  12206. // "response": {
  12207. // "$ref": "ListFilteredBidsResponse"
  12208. // },
  12209. // "scopes": [
  12210. // "https://www.googleapis.com/auth/adexchange.buyer"
  12211. // ]
  12212. // }
  12213. }
  12214. // Pages invokes f for each page of results.
  12215. // A non-nil error returned from f will halt the iteration.
  12216. // The provided context supersedes any context provided to the Context method.
  12217. func (c *BiddersAccountsFilterSetsFilteredBidsListCall) Pages(ctx context.Context, f func(*ListFilteredBidsResponse) error) error {
  12218. c.ctx_ = ctx
  12219. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12220. for {
  12221. x, err := c.Do()
  12222. if err != nil {
  12223. return err
  12224. }
  12225. if err := f(x); err != nil {
  12226. return err
  12227. }
  12228. if x.NextPageToken == "" {
  12229. return nil
  12230. }
  12231. c.PageToken(x.NextPageToken)
  12232. }
  12233. }
  12234. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list":
  12235. type BiddersAccountsFilterSetsFilteredBidsCreativesListCall struct {
  12236. s *Service
  12237. filterSetName string
  12238. creativeStatusId int64
  12239. urlParams_ gensupport.URLParams
  12240. ifNoneMatch_ string
  12241. ctx_ context.Context
  12242. header_ http.Header
  12243. }
  12244. // List: List all creatives associated with a specific reason for which
  12245. // bids were
  12246. // filtered, with the number of bids filtered for each creative.
  12247. func (r *BiddersAccountsFilterSetsFilteredBidsCreativesService) List(filterSetName string, creativeStatusId int64) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12248. c := &BiddersAccountsFilterSetsFilteredBidsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12249. c.filterSetName = filterSetName
  12250. c.creativeStatusId = creativeStatusId
  12251. return c
  12252. }
  12253. // PageSize sets the optional parameter "pageSize": Requested page size.
  12254. // The server may return fewer results than requested.
  12255. // If unspecified, the server will pick an appropriate default.
  12256. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12257. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12258. return c
  12259. }
  12260. // PageToken sets the optional parameter "pageToken": A token
  12261. // identifying a page of results the server should return.
  12262. // Typically, this is the value
  12263. // of
  12264. // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken
  12265. // returne
  12266. // d from the previous call to the filteredBids.creatives.list
  12267. // method.
  12268. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12269. c.urlParams_.Set("pageToken", pageToken)
  12270. return c
  12271. }
  12272. // Fields allows partial responses to be retrieved. See
  12273. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12274. // for more information.
  12275. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12276. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12277. return c
  12278. }
  12279. // IfNoneMatch sets the optional parameter which makes the operation
  12280. // fail if the object's ETag matches the given value. This is useful for
  12281. // getting updates only after the object has changed since the last
  12282. // request. Use googleapi.IsNotModified to check whether the response
  12283. // error from Do is the result of In-None-Match.
  12284. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12285. c.ifNoneMatch_ = entityTag
  12286. return c
  12287. }
  12288. // Context sets the context to be used in this call's Do method. Any
  12289. // pending HTTP request will be aborted if the provided context is
  12290. // canceled.
  12291. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsCreativesListCall {
  12292. c.ctx_ = ctx
  12293. return c
  12294. }
  12295. // Header returns an http.Header that can be modified by the caller to
  12296. // add HTTP headers to the request.
  12297. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Header() http.Header {
  12298. if c.header_ == nil {
  12299. c.header_ = make(http.Header)
  12300. }
  12301. return c.header_
  12302. }
  12303. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  12304. reqHeaders := make(http.Header)
  12305. for k, v := range c.header_ {
  12306. reqHeaders[k] = v
  12307. }
  12308. reqHeaders.Set("User-Agent", c.s.userAgent())
  12309. if c.ifNoneMatch_ != "" {
  12310. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12311. }
  12312. var body io.Reader = nil
  12313. c.urlParams_.Set("alt", alt)
  12314. c.urlParams_.Set("prettyPrint", "false")
  12315. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives")
  12316. urls += "?" + c.urlParams_.Encode()
  12317. req, err := http.NewRequest("GET", urls, body)
  12318. if err != nil {
  12319. return nil, err
  12320. }
  12321. req.Header = reqHeaders
  12322. googleapi.Expand(req.URL, map[string]string{
  12323. "filterSetName": c.filterSetName,
  12324. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  12325. })
  12326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12327. }
  12328. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list" call.
  12329. // Exactly one of *ListCreativeStatusBreakdownByCreativeResponse or
  12330. // error will be non-nil. Any non-2xx status code is an error. Response
  12331. // headers are in either
  12332. // *ListCreativeStatusBreakdownByCreativeResponse.ServerResponse.Header
  12333. // or (if a response was returned at all) in
  12334. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12335. // whether the returned error was because http.StatusNotModified was
  12336. // returned.
  12337. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByCreativeResponse, error) {
  12338. gensupport.SetOptions(c.urlParams_, opts...)
  12339. res, err := c.doRequest("json")
  12340. if res != nil && res.StatusCode == http.StatusNotModified {
  12341. if res.Body != nil {
  12342. res.Body.Close()
  12343. }
  12344. return nil, &googleapi.Error{
  12345. Code: res.StatusCode,
  12346. Header: res.Header,
  12347. }
  12348. }
  12349. if err != nil {
  12350. return nil, err
  12351. }
  12352. defer googleapi.CloseBody(res)
  12353. if err := googleapi.CheckResponse(res); err != nil {
  12354. return nil, err
  12355. }
  12356. ret := &ListCreativeStatusBreakdownByCreativeResponse{
  12357. ServerResponse: googleapi.ServerResponse{
  12358. Header: res.Header,
  12359. HTTPStatusCode: res.StatusCode,
  12360. },
  12361. }
  12362. target := &ret
  12363. if err := gensupport.DecodeResponse(target, res); err != nil {
  12364. return nil, err
  12365. }
  12366. return ret, nil
  12367. // {
  12368. // "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.",
  12369. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives",
  12370. // "httpMethod": "GET",
  12371. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list",
  12372. // "parameterOrder": [
  12373. // "filterSetName",
  12374. // "creativeStatusId"
  12375. // ],
  12376. // "parameters": {
  12377. // "creativeStatusId": {
  12378. // "description": "The ID of the creative status for which to retrieve a breakdown by\ncreative.\nSee\n[creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes).",
  12379. // "format": "int32",
  12380. // "location": "path",
  12381. // "required": true,
  12382. // "type": "integer"
  12383. // },
  12384. // "filterSetName": {
  12385. // "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`",
  12386. // "location": "path",
  12387. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12388. // "required": true,
  12389. // "type": "string"
  12390. // },
  12391. // "pageSize": {
  12392. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12393. // "format": "int32",
  12394. // "location": "query",
  12395. // "type": "integer"
  12396. // },
  12397. // "pageToken": {
  12398. // "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.",
  12399. // "location": "query",
  12400. // "type": "string"
  12401. // }
  12402. // },
  12403. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives",
  12404. // "response": {
  12405. // "$ref": "ListCreativeStatusBreakdownByCreativeResponse"
  12406. // },
  12407. // "scopes": [
  12408. // "https://www.googleapis.com/auth/adexchange.buyer"
  12409. // ]
  12410. // }
  12411. }
  12412. // Pages invokes f for each page of results.
  12413. // A non-nil error returned from f will halt the iteration.
  12414. // The provided context supersedes any context provided to the Context method.
  12415. func (c *BiddersAccountsFilterSetsFilteredBidsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByCreativeResponse) error) error {
  12416. c.ctx_ = ctx
  12417. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12418. for {
  12419. x, err := c.Do()
  12420. if err != nil {
  12421. return err
  12422. }
  12423. if err := f(x); err != nil {
  12424. return err
  12425. }
  12426. if x.NextPageToken == "" {
  12427. return nil
  12428. }
  12429. c.PageToken(x.NextPageToken)
  12430. }
  12431. }
  12432. // method id "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list":
  12433. type BiddersAccountsFilterSetsFilteredBidsDetailsListCall struct {
  12434. s *Service
  12435. filterSetName string
  12436. creativeStatusId int64
  12437. urlParams_ gensupport.URLParams
  12438. ifNoneMatch_ string
  12439. ctx_ context.Context
  12440. header_ http.Header
  12441. }
  12442. // List: List all details associated with a specific reason for which
  12443. // bids were
  12444. // filtered, with the number of bids filtered for each detail.
  12445. func (r *BiddersAccountsFilterSetsFilteredBidsDetailsService) List(filterSetName string, creativeStatusId int64) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12446. c := &BiddersAccountsFilterSetsFilteredBidsDetailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12447. c.filterSetName = filterSetName
  12448. c.creativeStatusId = creativeStatusId
  12449. return c
  12450. }
  12451. // PageSize sets the optional parameter "pageSize": Requested page size.
  12452. // The server may return fewer results than requested.
  12453. // If unspecified, the server will pick an appropriate default.
  12454. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12455. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12456. return c
  12457. }
  12458. // PageToken sets the optional parameter "pageToken": A token
  12459. // identifying a page of results the server should return.
  12460. // Typically, this is the value
  12461. // of
  12462. // ListCreativeStatusBreakdownByDetailResponse.nextPageToken
  12463. // returned from the previous call to the
  12464. // filteredBids.details.list
  12465. // method.
  12466. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12467. c.urlParams_.Set("pageToken", pageToken)
  12468. return c
  12469. }
  12470. // Fields allows partial responses to be retrieved. See
  12471. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12472. // for more information.
  12473. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12474. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12475. return c
  12476. }
  12477. // IfNoneMatch sets the optional parameter which makes the operation
  12478. // fail if the object's ETag matches the given value. This is useful for
  12479. // getting updates only after the object has changed since the last
  12480. // request. Use googleapi.IsNotModified to check whether the response
  12481. // error from Do is the result of In-None-Match.
  12482. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12483. c.ifNoneMatch_ = entityTag
  12484. return c
  12485. }
  12486. // Context sets the context to be used in this call's Do method. Any
  12487. // pending HTTP request will be aborted if the provided context is
  12488. // canceled.
  12489. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsFilteredBidsDetailsListCall {
  12490. c.ctx_ = ctx
  12491. return c
  12492. }
  12493. // Header returns an http.Header that can be modified by the caller to
  12494. // add HTTP headers to the request.
  12495. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Header() http.Header {
  12496. if c.header_ == nil {
  12497. c.header_ = make(http.Header)
  12498. }
  12499. return c.header_
  12500. }
  12501. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*http.Response, error) {
  12502. reqHeaders := make(http.Header)
  12503. for k, v := range c.header_ {
  12504. reqHeaders[k] = v
  12505. }
  12506. reqHeaders.Set("User-Agent", c.s.userAgent())
  12507. if c.ifNoneMatch_ != "" {
  12508. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12509. }
  12510. var body io.Reader = nil
  12511. c.urlParams_.Set("alt", alt)
  12512. c.urlParams_.Set("prettyPrint", "false")
  12513. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details")
  12514. urls += "?" + c.urlParams_.Encode()
  12515. req, err := http.NewRequest("GET", urls, body)
  12516. if err != nil {
  12517. return nil, err
  12518. }
  12519. req.Header = reqHeaders
  12520. googleapi.Expand(req.URL, map[string]string{
  12521. "filterSetName": c.filterSetName,
  12522. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  12523. })
  12524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12525. }
  12526. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list" call.
  12527. // Exactly one of *ListCreativeStatusBreakdownByDetailResponse or error
  12528. // will be non-nil. Any non-2xx status code is an error. Response
  12529. // headers are in either
  12530. // *ListCreativeStatusBreakdownByDetailResponse.ServerResponse.Header or
  12531. // (if a response was returned at all) in
  12532. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12533. // whether the returned error was because http.StatusNotModified was
  12534. // returned.
  12535. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByDetailResponse, error) {
  12536. gensupport.SetOptions(c.urlParams_, opts...)
  12537. res, err := c.doRequest("json")
  12538. if res != nil && res.StatusCode == http.StatusNotModified {
  12539. if res.Body != nil {
  12540. res.Body.Close()
  12541. }
  12542. return nil, &googleapi.Error{
  12543. Code: res.StatusCode,
  12544. Header: res.Header,
  12545. }
  12546. }
  12547. if err != nil {
  12548. return nil, err
  12549. }
  12550. defer googleapi.CloseBody(res)
  12551. if err := googleapi.CheckResponse(res); err != nil {
  12552. return nil, err
  12553. }
  12554. ret := &ListCreativeStatusBreakdownByDetailResponse{
  12555. ServerResponse: googleapi.ServerResponse{
  12556. Header: res.Header,
  12557. HTTPStatusCode: res.StatusCode,
  12558. },
  12559. }
  12560. target := &ret
  12561. if err := gensupport.DecodeResponse(target, res); err != nil {
  12562. return nil, err
  12563. }
  12564. return ret, nil
  12565. // {
  12566. // "description": "List all details associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each detail.",
  12567. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details",
  12568. // "httpMethod": "GET",
  12569. // "id": "adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list",
  12570. // "parameterOrder": [
  12571. // "filterSetName",
  12572. // "creativeStatusId"
  12573. // ],
  12574. // "parameters": {
  12575. // "creativeStatusId": {
  12576. // "description": "The ID of the creative status for which to retrieve a breakdown by detail.\nSee\n[creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes).\nDetails are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87.",
  12577. // "format": "int32",
  12578. // "location": "path",
  12579. // "required": true,
  12580. // "type": "integer"
  12581. // },
  12582. // "filterSetName": {
  12583. // "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`",
  12584. // "location": "path",
  12585. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12586. // "required": true,
  12587. // "type": "string"
  12588. // },
  12589. // "pageSize": {
  12590. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12591. // "format": "int32",
  12592. // "location": "query",
  12593. // "type": "integer"
  12594. // },
  12595. // "pageToken": {
  12596. // "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.",
  12597. // "location": "query",
  12598. // "type": "string"
  12599. // }
  12600. // },
  12601. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details",
  12602. // "response": {
  12603. // "$ref": "ListCreativeStatusBreakdownByDetailResponse"
  12604. // },
  12605. // "scopes": [
  12606. // "https://www.googleapis.com/auth/adexchange.buyer"
  12607. // ]
  12608. // }
  12609. }
  12610. // Pages invokes f for each page of results.
  12611. // A non-nil error returned from f will halt the iteration.
  12612. // The provided context supersedes any context provided to the Context method.
  12613. func (c *BiddersAccountsFilterSetsFilteredBidsDetailsListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByDetailResponse) error) error {
  12614. c.ctx_ = ctx
  12615. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12616. for {
  12617. x, err := c.Do()
  12618. if err != nil {
  12619. return err
  12620. }
  12621. if err := f(x); err != nil {
  12622. return err
  12623. }
  12624. if x.NextPageToken == "" {
  12625. return nil
  12626. }
  12627. c.PageToken(x.NextPageToken)
  12628. }
  12629. }
  12630. // method id "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list":
  12631. type BiddersAccountsFilterSetsImpressionMetricsListCall struct {
  12632. s *Service
  12633. filterSetName string
  12634. urlParams_ gensupport.URLParams
  12635. ifNoneMatch_ string
  12636. ctx_ context.Context
  12637. header_ http.Header
  12638. }
  12639. // List: Lists all metrics that are measured in terms of number of
  12640. // impressions.
  12641. func (r *BiddersAccountsFilterSetsImpressionMetricsService) List(filterSetName string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12642. c := &BiddersAccountsFilterSetsImpressionMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12643. c.filterSetName = filterSetName
  12644. return c
  12645. }
  12646. // PageSize sets the optional parameter "pageSize": Requested page size.
  12647. // The server may return fewer results than requested.
  12648. // If unspecified, the server will pick an appropriate default.
  12649. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12650. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12651. return c
  12652. }
  12653. // PageToken sets the optional parameter "pageToken": A token
  12654. // identifying a page of results the server should return.
  12655. // Typically, this is the value
  12656. // of
  12657. // ListImpressionMetricsResponse.nextPageToken
  12658. // returned from the previous call to the impressionMetrics.list
  12659. // method.
  12660. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12661. c.urlParams_.Set("pageToken", pageToken)
  12662. return c
  12663. }
  12664. // Fields allows partial responses to be retrieved. See
  12665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12666. // for more information.
  12667. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12669. return c
  12670. }
  12671. // IfNoneMatch sets the optional parameter which makes the operation
  12672. // fail if the object's ETag matches the given value. This is useful for
  12673. // getting updates only after the object has changed since the last
  12674. // request. Use googleapi.IsNotModified to check whether the response
  12675. // error from Do is the result of In-None-Match.
  12676. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12677. c.ifNoneMatch_ = entityTag
  12678. return c
  12679. }
  12680. // Context sets the context to be used in this call's Do method. Any
  12681. // pending HTTP request will be aborted if the provided context is
  12682. // canceled.
  12683. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsImpressionMetricsListCall {
  12684. c.ctx_ = ctx
  12685. return c
  12686. }
  12687. // Header returns an http.Header that can be modified by the caller to
  12688. // add HTTP headers to the request.
  12689. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Header() http.Header {
  12690. if c.header_ == nil {
  12691. c.header_ = make(http.Header)
  12692. }
  12693. return c.header_
  12694. }
  12695. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) doRequest(alt string) (*http.Response, error) {
  12696. reqHeaders := make(http.Header)
  12697. for k, v := range c.header_ {
  12698. reqHeaders[k] = v
  12699. }
  12700. reqHeaders.Set("User-Agent", c.s.userAgent())
  12701. if c.ifNoneMatch_ != "" {
  12702. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12703. }
  12704. var body io.Reader = nil
  12705. c.urlParams_.Set("alt", alt)
  12706. c.urlParams_.Set("prettyPrint", "false")
  12707. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics")
  12708. urls += "?" + c.urlParams_.Encode()
  12709. req, err := http.NewRequest("GET", urls, body)
  12710. if err != nil {
  12711. return nil, err
  12712. }
  12713. req.Header = reqHeaders
  12714. googleapi.Expand(req.URL, map[string]string{
  12715. "filterSetName": c.filterSetName,
  12716. })
  12717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12718. }
  12719. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list" call.
  12720. // Exactly one of *ListImpressionMetricsResponse or error will be
  12721. // non-nil. Any non-2xx status code is an error. Response headers are in
  12722. // either *ListImpressionMetricsResponse.ServerResponse.Header or (if a
  12723. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12724. // googleapi.IsNotModified to check whether the returned error was
  12725. // because http.StatusNotModified was returned.
  12726. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Do(opts ...googleapi.CallOption) (*ListImpressionMetricsResponse, error) {
  12727. gensupport.SetOptions(c.urlParams_, opts...)
  12728. res, err := c.doRequest("json")
  12729. if res != nil && res.StatusCode == http.StatusNotModified {
  12730. if res.Body != nil {
  12731. res.Body.Close()
  12732. }
  12733. return nil, &googleapi.Error{
  12734. Code: res.StatusCode,
  12735. Header: res.Header,
  12736. }
  12737. }
  12738. if err != nil {
  12739. return nil, err
  12740. }
  12741. defer googleapi.CloseBody(res)
  12742. if err := googleapi.CheckResponse(res); err != nil {
  12743. return nil, err
  12744. }
  12745. ret := &ListImpressionMetricsResponse{
  12746. ServerResponse: googleapi.ServerResponse{
  12747. Header: res.Header,
  12748. HTTPStatusCode: res.StatusCode,
  12749. },
  12750. }
  12751. target := &ret
  12752. if err := gensupport.DecodeResponse(target, res); err != nil {
  12753. return nil, err
  12754. }
  12755. return ret, nil
  12756. // {
  12757. // "description": "Lists all metrics that are measured in terms of number of impressions.",
  12758. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/impressionMetrics",
  12759. // "httpMethod": "GET",
  12760. // "id": "adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list",
  12761. // "parameterOrder": [
  12762. // "filterSetName"
  12763. // ],
  12764. // "parameters": {
  12765. // "filterSetName": {
  12766. // "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`",
  12767. // "location": "path",
  12768. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12769. // "required": true,
  12770. // "type": "string"
  12771. // },
  12772. // "pageSize": {
  12773. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12774. // "format": "int32",
  12775. // "location": "query",
  12776. // "type": "integer"
  12777. // },
  12778. // "pageToken": {
  12779. // "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.",
  12780. // "location": "query",
  12781. // "type": "string"
  12782. // }
  12783. // },
  12784. // "path": "v2beta1/{+filterSetName}/impressionMetrics",
  12785. // "response": {
  12786. // "$ref": "ListImpressionMetricsResponse"
  12787. // },
  12788. // "scopes": [
  12789. // "https://www.googleapis.com/auth/adexchange.buyer"
  12790. // ]
  12791. // }
  12792. }
  12793. // Pages invokes f for each page of results.
  12794. // A non-nil error returned from f will halt the iteration.
  12795. // The provided context supersedes any context provided to the Context method.
  12796. func (c *BiddersAccountsFilterSetsImpressionMetricsListCall) Pages(ctx context.Context, f func(*ListImpressionMetricsResponse) error) error {
  12797. c.ctx_ = ctx
  12798. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12799. for {
  12800. x, err := c.Do()
  12801. if err != nil {
  12802. return err
  12803. }
  12804. if err := f(x); err != nil {
  12805. return err
  12806. }
  12807. if x.NextPageToken == "" {
  12808. return nil
  12809. }
  12810. c.PageToken(x.NextPageToken)
  12811. }
  12812. }
  12813. // method id "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list":
  12814. type BiddersAccountsFilterSetsLosingBidsListCall struct {
  12815. s *Service
  12816. filterSetName string
  12817. urlParams_ gensupport.URLParams
  12818. ifNoneMatch_ string
  12819. ctx_ context.Context
  12820. header_ http.Header
  12821. }
  12822. // List: List all reasons for which bids lost in the auction, with the
  12823. // number of
  12824. // bids that lost for each reason.
  12825. func (r *BiddersAccountsFilterSetsLosingBidsService) List(filterSetName string) *BiddersAccountsFilterSetsLosingBidsListCall {
  12826. c := &BiddersAccountsFilterSetsLosingBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12827. c.filterSetName = filterSetName
  12828. return c
  12829. }
  12830. // PageSize sets the optional parameter "pageSize": Requested page size.
  12831. // The server may return fewer results than requested.
  12832. // If unspecified, the server will pick an appropriate default.
  12833. func (c *BiddersAccountsFilterSetsLosingBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsLosingBidsListCall {
  12834. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  12835. return c
  12836. }
  12837. // PageToken sets the optional parameter "pageToken": A token
  12838. // identifying a page of results the server should return.
  12839. // Typically, this is the value
  12840. // of
  12841. // ListLosingBidsResponse.nextPageToken
  12842. // returned from the previous call to the losingBids.list
  12843. // method.
  12844. func (c *BiddersAccountsFilterSetsLosingBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsLosingBidsListCall {
  12845. c.urlParams_.Set("pageToken", pageToken)
  12846. return c
  12847. }
  12848. // Fields allows partial responses to be retrieved. See
  12849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12850. // for more information.
  12851. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsLosingBidsListCall {
  12852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12853. return c
  12854. }
  12855. // IfNoneMatch sets the optional parameter which makes the operation
  12856. // fail if the object's ETag matches the given value. This is useful for
  12857. // getting updates only after the object has changed since the last
  12858. // request. Use googleapi.IsNotModified to check whether the response
  12859. // error from Do is the result of In-None-Match.
  12860. func (c *BiddersAccountsFilterSetsLosingBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsLosingBidsListCall {
  12861. c.ifNoneMatch_ = entityTag
  12862. return c
  12863. }
  12864. // Context sets the context to be used in this call's Do method. Any
  12865. // pending HTTP request will be aborted if the provided context is
  12866. // canceled.
  12867. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsLosingBidsListCall {
  12868. c.ctx_ = ctx
  12869. return c
  12870. }
  12871. // Header returns an http.Header that can be modified by the caller to
  12872. // add HTTP headers to the request.
  12873. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Header() http.Header {
  12874. if c.header_ == nil {
  12875. c.header_ = make(http.Header)
  12876. }
  12877. return c.header_
  12878. }
  12879. func (c *BiddersAccountsFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Response, error) {
  12880. reqHeaders := make(http.Header)
  12881. for k, v := range c.header_ {
  12882. reqHeaders[k] = v
  12883. }
  12884. reqHeaders.Set("User-Agent", c.s.userAgent())
  12885. if c.ifNoneMatch_ != "" {
  12886. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12887. }
  12888. var body io.Reader = nil
  12889. c.urlParams_.Set("alt", alt)
  12890. c.urlParams_.Set("prettyPrint", "false")
  12891. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids")
  12892. urls += "?" + c.urlParams_.Encode()
  12893. req, err := http.NewRequest("GET", urls, body)
  12894. if err != nil {
  12895. return nil, err
  12896. }
  12897. req.Header = reqHeaders
  12898. googleapi.Expand(req.URL, map[string]string{
  12899. "filterSetName": c.filterSetName,
  12900. })
  12901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12902. }
  12903. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list" call.
  12904. // Exactly one of *ListLosingBidsResponse or error will be non-nil. Any
  12905. // non-2xx status code is an error. Response headers are in either
  12906. // *ListLosingBidsResponse.ServerResponse.Header or (if a response was
  12907. // returned at all) in error.(*googleapi.Error).Header. Use
  12908. // googleapi.IsNotModified to check whether the returned error was
  12909. // because http.StatusNotModified was returned.
  12910. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Do(opts ...googleapi.CallOption) (*ListLosingBidsResponse, error) {
  12911. gensupport.SetOptions(c.urlParams_, opts...)
  12912. res, err := c.doRequest("json")
  12913. if res != nil && res.StatusCode == http.StatusNotModified {
  12914. if res.Body != nil {
  12915. res.Body.Close()
  12916. }
  12917. return nil, &googleapi.Error{
  12918. Code: res.StatusCode,
  12919. Header: res.Header,
  12920. }
  12921. }
  12922. if err != nil {
  12923. return nil, err
  12924. }
  12925. defer googleapi.CloseBody(res)
  12926. if err := googleapi.CheckResponse(res); err != nil {
  12927. return nil, err
  12928. }
  12929. ret := &ListLosingBidsResponse{
  12930. ServerResponse: googleapi.ServerResponse{
  12931. Header: res.Header,
  12932. HTTPStatusCode: res.StatusCode,
  12933. },
  12934. }
  12935. target := &ret
  12936. if err := gensupport.DecodeResponse(target, res); err != nil {
  12937. return nil, err
  12938. }
  12939. return ret, nil
  12940. // {
  12941. // "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.",
  12942. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/losingBids",
  12943. // "httpMethod": "GET",
  12944. // "id": "adexchangebuyer2.bidders.accounts.filterSets.losingBids.list",
  12945. // "parameterOrder": [
  12946. // "filterSetName"
  12947. // ],
  12948. // "parameters": {
  12949. // "filterSetName": {
  12950. // "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`",
  12951. // "location": "path",
  12952. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  12953. // "required": true,
  12954. // "type": "string"
  12955. // },
  12956. // "pageSize": {
  12957. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  12958. // "format": "int32",
  12959. // "location": "query",
  12960. // "type": "integer"
  12961. // },
  12962. // "pageToken": {
  12963. // "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.",
  12964. // "location": "query",
  12965. // "type": "string"
  12966. // }
  12967. // },
  12968. // "path": "v2beta1/{+filterSetName}/losingBids",
  12969. // "response": {
  12970. // "$ref": "ListLosingBidsResponse"
  12971. // },
  12972. // "scopes": [
  12973. // "https://www.googleapis.com/auth/adexchange.buyer"
  12974. // ]
  12975. // }
  12976. }
  12977. // Pages invokes f for each page of results.
  12978. // A non-nil error returned from f will halt the iteration.
  12979. // The provided context supersedes any context provided to the Context method.
  12980. func (c *BiddersAccountsFilterSetsLosingBidsListCall) Pages(ctx context.Context, f func(*ListLosingBidsResponse) error) error {
  12981. c.ctx_ = ctx
  12982. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12983. for {
  12984. x, err := c.Do()
  12985. if err != nil {
  12986. return err
  12987. }
  12988. if err := f(x); err != nil {
  12989. return err
  12990. }
  12991. if x.NextPageToken == "" {
  12992. return nil
  12993. }
  12994. c.PageToken(x.NextPageToken)
  12995. }
  12996. }
  12997. // method id "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list":
  12998. type BiddersAccountsFilterSetsNonBillableWinningBidsListCall struct {
  12999. s *Service
  13000. filterSetName string
  13001. urlParams_ gensupport.URLParams
  13002. ifNoneMatch_ string
  13003. ctx_ context.Context
  13004. header_ http.Header
  13005. }
  13006. // List: List all reasons for which winning bids were not billable, with
  13007. // the number
  13008. // of bids not billed for each reason.
  13009. func (r *BiddersAccountsFilterSetsNonBillableWinningBidsService) List(filterSetName string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13010. c := &BiddersAccountsFilterSetsNonBillableWinningBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13011. c.filterSetName = filterSetName
  13012. return c
  13013. }
  13014. // PageSize sets the optional parameter "pageSize": Requested page size.
  13015. // The server may return fewer results than requested.
  13016. // If unspecified, the server will pick an appropriate default.
  13017. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) PageSize(pageSize int64) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13018. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13019. return c
  13020. }
  13021. // PageToken sets the optional parameter "pageToken": A token
  13022. // identifying a page of results the server should return.
  13023. // Typically, this is the value
  13024. // of
  13025. // ListNonBillableWinningBidsResponse.nextPageToken
  13026. // returned from the previous call to the
  13027. // nonBillableWinningBids.list
  13028. // method.
  13029. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) PageToken(pageToken string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13030. c.urlParams_.Set("pageToken", pageToken)
  13031. return c
  13032. }
  13033. // Fields allows partial responses to be retrieved. See
  13034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13035. // for more information.
  13036. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Fields(s ...googleapi.Field) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13038. return c
  13039. }
  13040. // IfNoneMatch sets the optional parameter which makes the operation
  13041. // fail if the object's ETag matches the given value. This is useful for
  13042. // getting updates only after the object has changed since the last
  13043. // request. Use googleapi.IsNotModified to check whether the response
  13044. // error from Do is the result of In-None-Match.
  13045. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) IfNoneMatch(entityTag string) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13046. c.ifNoneMatch_ = entityTag
  13047. return c
  13048. }
  13049. // Context sets the context to be used in this call's Do method. Any
  13050. // pending HTTP request will be aborted if the provided context is
  13051. // canceled.
  13052. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Context(ctx context.Context) *BiddersAccountsFilterSetsNonBillableWinningBidsListCall {
  13053. c.ctx_ = ctx
  13054. return c
  13055. }
  13056. // Header returns an http.Header that can be modified by the caller to
  13057. // add HTTP headers to the request.
  13058. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Header() http.Header {
  13059. if c.header_ == nil {
  13060. c.header_ = make(http.Header)
  13061. }
  13062. return c.header_
  13063. }
  13064. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) (*http.Response, error) {
  13065. reqHeaders := make(http.Header)
  13066. for k, v := range c.header_ {
  13067. reqHeaders[k] = v
  13068. }
  13069. reqHeaders.Set("User-Agent", c.s.userAgent())
  13070. if c.ifNoneMatch_ != "" {
  13071. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13072. }
  13073. var body io.Reader = nil
  13074. c.urlParams_.Set("alt", alt)
  13075. c.urlParams_.Set("prettyPrint", "false")
  13076. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids")
  13077. urls += "?" + c.urlParams_.Encode()
  13078. req, err := http.NewRequest("GET", urls, body)
  13079. if err != nil {
  13080. return nil, err
  13081. }
  13082. req.Header = reqHeaders
  13083. googleapi.Expand(req.URL, map[string]string{
  13084. "filterSetName": c.filterSetName,
  13085. })
  13086. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13087. }
  13088. // Do executes the "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list" call.
  13089. // Exactly one of *ListNonBillableWinningBidsResponse or error will be
  13090. // non-nil. Any non-2xx status code is an error. Response headers are in
  13091. // either *ListNonBillableWinningBidsResponse.ServerResponse.Header or
  13092. // (if a response was returned at all) in
  13093. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13094. // whether the returned error was because http.StatusNotModified was
  13095. // returned.
  13096. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Do(opts ...googleapi.CallOption) (*ListNonBillableWinningBidsResponse, error) {
  13097. gensupport.SetOptions(c.urlParams_, opts...)
  13098. res, err := c.doRequest("json")
  13099. if res != nil && res.StatusCode == http.StatusNotModified {
  13100. if res.Body != nil {
  13101. res.Body.Close()
  13102. }
  13103. return nil, &googleapi.Error{
  13104. Code: res.StatusCode,
  13105. Header: res.Header,
  13106. }
  13107. }
  13108. if err != nil {
  13109. return nil, err
  13110. }
  13111. defer googleapi.CloseBody(res)
  13112. if err := googleapi.CheckResponse(res); err != nil {
  13113. return nil, err
  13114. }
  13115. ret := &ListNonBillableWinningBidsResponse{
  13116. ServerResponse: googleapi.ServerResponse{
  13117. Header: res.Header,
  13118. HTTPStatusCode: res.StatusCode,
  13119. },
  13120. }
  13121. target := &ret
  13122. if err := gensupport.DecodeResponse(target, res); err != nil {
  13123. return nil, err
  13124. }
  13125. return ret, nil
  13126. // {
  13127. // "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.",
  13128. // "flatPath": "v2beta1/bidders/{biddersId}/accounts/{accountsId}/filterSets/{filterSetsId}/nonBillableWinningBids",
  13129. // "httpMethod": "GET",
  13130. // "id": "adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list",
  13131. // "parameterOrder": [
  13132. // "filterSetName"
  13133. // ],
  13134. // "parameters": {
  13135. // "filterSetName": {
  13136. // "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`",
  13137. // "location": "path",
  13138. // "pattern": "^bidders/[^/]+/accounts/[^/]+/filterSets/[^/]+$",
  13139. // "required": true,
  13140. // "type": "string"
  13141. // },
  13142. // "pageSize": {
  13143. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  13144. // "format": "int32",
  13145. // "location": "query",
  13146. // "type": "integer"
  13147. // },
  13148. // "pageToken": {
  13149. // "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.",
  13150. // "location": "query",
  13151. // "type": "string"
  13152. // }
  13153. // },
  13154. // "path": "v2beta1/{+filterSetName}/nonBillableWinningBids",
  13155. // "response": {
  13156. // "$ref": "ListNonBillableWinningBidsResponse"
  13157. // },
  13158. // "scopes": [
  13159. // "https://www.googleapis.com/auth/adexchange.buyer"
  13160. // ]
  13161. // }
  13162. }
  13163. // Pages invokes f for each page of results.
  13164. // A non-nil error returned from f will halt the iteration.
  13165. // The provided context supersedes any context provided to the Context method.
  13166. func (c *BiddersAccountsFilterSetsNonBillableWinningBidsListCall) Pages(ctx context.Context, f func(*ListNonBillableWinningBidsResponse) error) error {
  13167. c.ctx_ = ctx
  13168. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13169. for {
  13170. x, err := c.Do()
  13171. if err != nil {
  13172. return err
  13173. }
  13174. if err := f(x); err != nil {
  13175. return err
  13176. }
  13177. if x.NextPageToken == "" {
  13178. return nil
  13179. }
  13180. c.PageToken(x.NextPageToken)
  13181. }
  13182. }
  13183. // method id "adexchangebuyer2.bidders.filterSets.create":
  13184. type BiddersFilterSetsCreateCall struct {
  13185. s *Service
  13186. ownerName string
  13187. filterset *FilterSet
  13188. urlParams_ gensupport.URLParams
  13189. ctx_ context.Context
  13190. header_ http.Header
  13191. }
  13192. // Create: Creates the specified filter set for the account with the
  13193. // given account ID.
  13194. func (r *BiddersFilterSetsService) Create(ownerName string, filterset *FilterSet) *BiddersFilterSetsCreateCall {
  13195. c := &BiddersFilterSetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13196. c.ownerName = ownerName
  13197. c.filterset = filterset
  13198. return c
  13199. }
  13200. // IsTransient sets the optional parameter "isTransient": Whether the
  13201. // filter set is transient, or should be persisted indefinitely.
  13202. // By default, filter sets are not transient.
  13203. // If transient, it will be available for at least 1 hour after
  13204. // creation.
  13205. func (c *BiddersFilterSetsCreateCall) IsTransient(isTransient bool) *BiddersFilterSetsCreateCall {
  13206. c.urlParams_.Set("isTransient", fmt.Sprint(isTransient))
  13207. return c
  13208. }
  13209. // Fields allows partial responses to be retrieved. See
  13210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13211. // for more information.
  13212. func (c *BiddersFilterSetsCreateCall) Fields(s ...googleapi.Field) *BiddersFilterSetsCreateCall {
  13213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13214. return c
  13215. }
  13216. // Context sets the context to be used in this call's Do method. Any
  13217. // pending HTTP request will be aborted if the provided context is
  13218. // canceled.
  13219. func (c *BiddersFilterSetsCreateCall) Context(ctx context.Context) *BiddersFilterSetsCreateCall {
  13220. c.ctx_ = ctx
  13221. return c
  13222. }
  13223. // Header returns an http.Header that can be modified by the caller to
  13224. // add HTTP headers to the request.
  13225. func (c *BiddersFilterSetsCreateCall) Header() http.Header {
  13226. if c.header_ == nil {
  13227. c.header_ = make(http.Header)
  13228. }
  13229. return c.header_
  13230. }
  13231. func (c *BiddersFilterSetsCreateCall) doRequest(alt string) (*http.Response, error) {
  13232. reqHeaders := make(http.Header)
  13233. for k, v := range c.header_ {
  13234. reqHeaders[k] = v
  13235. }
  13236. reqHeaders.Set("User-Agent", c.s.userAgent())
  13237. var body io.Reader = nil
  13238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.filterset)
  13239. if err != nil {
  13240. return nil, err
  13241. }
  13242. reqHeaders.Set("Content-Type", "application/json")
  13243. c.urlParams_.Set("alt", alt)
  13244. c.urlParams_.Set("prettyPrint", "false")
  13245. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  13246. urls += "?" + c.urlParams_.Encode()
  13247. req, err := http.NewRequest("POST", urls, body)
  13248. if err != nil {
  13249. return nil, err
  13250. }
  13251. req.Header = reqHeaders
  13252. googleapi.Expand(req.URL, map[string]string{
  13253. "ownerName": c.ownerName,
  13254. })
  13255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13256. }
  13257. // Do executes the "adexchangebuyer2.bidders.filterSets.create" call.
  13258. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  13259. // status code is an error. Response headers are in either
  13260. // *FilterSet.ServerResponse.Header or (if a response was returned at
  13261. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13262. // to check whether the returned error was because
  13263. // http.StatusNotModified was returned.
  13264. func (c *BiddersFilterSetsCreateCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  13265. gensupport.SetOptions(c.urlParams_, opts...)
  13266. res, err := c.doRequest("json")
  13267. if res != nil && res.StatusCode == http.StatusNotModified {
  13268. if res.Body != nil {
  13269. res.Body.Close()
  13270. }
  13271. return nil, &googleapi.Error{
  13272. Code: res.StatusCode,
  13273. Header: res.Header,
  13274. }
  13275. }
  13276. if err != nil {
  13277. return nil, err
  13278. }
  13279. defer googleapi.CloseBody(res)
  13280. if err := googleapi.CheckResponse(res); err != nil {
  13281. return nil, err
  13282. }
  13283. ret := &FilterSet{
  13284. ServerResponse: googleapi.ServerResponse{
  13285. Header: res.Header,
  13286. HTTPStatusCode: res.StatusCode,
  13287. },
  13288. }
  13289. target := &ret
  13290. if err := gensupport.DecodeResponse(target, res); err != nil {
  13291. return nil, err
  13292. }
  13293. return ret, nil
  13294. // {
  13295. // "description": "Creates the specified filter set for the account with the given account ID.",
  13296. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets",
  13297. // "httpMethod": "POST",
  13298. // "id": "adexchangebuyer2.bidders.filterSets.create",
  13299. // "parameterOrder": [
  13300. // "ownerName"
  13301. // ],
  13302. // "parameters": {
  13303. // "isTransient": {
  13304. // "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.",
  13305. // "location": "query",
  13306. // "type": "boolean"
  13307. // },
  13308. // "ownerName": {
  13309. // "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`",
  13310. // "location": "path",
  13311. // "pattern": "^bidders/[^/]+$",
  13312. // "required": true,
  13313. // "type": "string"
  13314. // }
  13315. // },
  13316. // "path": "v2beta1/{+ownerName}/filterSets",
  13317. // "request": {
  13318. // "$ref": "FilterSet"
  13319. // },
  13320. // "response": {
  13321. // "$ref": "FilterSet"
  13322. // },
  13323. // "scopes": [
  13324. // "https://www.googleapis.com/auth/adexchange.buyer"
  13325. // ]
  13326. // }
  13327. }
  13328. // method id "adexchangebuyer2.bidders.filterSets.delete":
  13329. type BiddersFilterSetsDeleteCall struct {
  13330. s *Service
  13331. name string
  13332. urlParams_ gensupport.URLParams
  13333. ctx_ context.Context
  13334. header_ http.Header
  13335. }
  13336. // Delete: Deletes the requested filter set from the account with the
  13337. // given account
  13338. // ID.
  13339. func (r *BiddersFilterSetsService) Delete(name string) *BiddersFilterSetsDeleteCall {
  13340. c := &BiddersFilterSetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13341. c.name = name
  13342. return c
  13343. }
  13344. // Fields allows partial responses to be retrieved. See
  13345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13346. // for more information.
  13347. func (c *BiddersFilterSetsDeleteCall) Fields(s ...googleapi.Field) *BiddersFilterSetsDeleteCall {
  13348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13349. return c
  13350. }
  13351. // Context sets the context to be used in this call's Do method. Any
  13352. // pending HTTP request will be aborted if the provided context is
  13353. // canceled.
  13354. func (c *BiddersFilterSetsDeleteCall) Context(ctx context.Context) *BiddersFilterSetsDeleteCall {
  13355. c.ctx_ = ctx
  13356. return c
  13357. }
  13358. // Header returns an http.Header that can be modified by the caller to
  13359. // add HTTP headers to the request.
  13360. func (c *BiddersFilterSetsDeleteCall) Header() http.Header {
  13361. if c.header_ == nil {
  13362. c.header_ = make(http.Header)
  13363. }
  13364. return c.header_
  13365. }
  13366. func (c *BiddersFilterSetsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13367. reqHeaders := make(http.Header)
  13368. for k, v := range c.header_ {
  13369. reqHeaders[k] = v
  13370. }
  13371. reqHeaders.Set("User-Agent", c.s.userAgent())
  13372. var body io.Reader = nil
  13373. c.urlParams_.Set("alt", alt)
  13374. c.urlParams_.Set("prettyPrint", "false")
  13375. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13376. urls += "?" + c.urlParams_.Encode()
  13377. req, err := http.NewRequest("DELETE", urls, body)
  13378. if err != nil {
  13379. return nil, err
  13380. }
  13381. req.Header = reqHeaders
  13382. googleapi.Expand(req.URL, map[string]string{
  13383. "name": c.name,
  13384. })
  13385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13386. }
  13387. // Do executes the "adexchangebuyer2.bidders.filterSets.delete" call.
  13388. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  13389. // code is an error. Response headers are in either
  13390. // *Empty.ServerResponse.Header or (if a response was returned at all)
  13391. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13392. // check whether the returned error was because http.StatusNotModified
  13393. // was returned.
  13394. func (c *BiddersFilterSetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  13395. gensupport.SetOptions(c.urlParams_, opts...)
  13396. res, err := c.doRequest("json")
  13397. if res != nil && res.StatusCode == http.StatusNotModified {
  13398. if res.Body != nil {
  13399. res.Body.Close()
  13400. }
  13401. return nil, &googleapi.Error{
  13402. Code: res.StatusCode,
  13403. Header: res.Header,
  13404. }
  13405. }
  13406. if err != nil {
  13407. return nil, err
  13408. }
  13409. defer googleapi.CloseBody(res)
  13410. if err := googleapi.CheckResponse(res); err != nil {
  13411. return nil, err
  13412. }
  13413. ret := &Empty{
  13414. ServerResponse: googleapi.ServerResponse{
  13415. Header: res.Header,
  13416. HTTPStatusCode: res.StatusCode,
  13417. },
  13418. }
  13419. target := &ret
  13420. if err := gensupport.DecodeResponse(target, res); err != nil {
  13421. return nil, err
  13422. }
  13423. return ret, nil
  13424. // {
  13425. // "description": "Deletes the requested filter set from the account with the given account\nID.",
  13426. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}",
  13427. // "httpMethod": "DELETE",
  13428. // "id": "adexchangebuyer2.bidders.filterSets.delete",
  13429. // "parameterOrder": [
  13430. // "name"
  13431. // ],
  13432. // "parameters": {
  13433. // "name": {
  13434. // "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`",
  13435. // "location": "path",
  13436. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  13437. // "required": true,
  13438. // "type": "string"
  13439. // }
  13440. // },
  13441. // "path": "v2beta1/{+name}",
  13442. // "response": {
  13443. // "$ref": "Empty"
  13444. // },
  13445. // "scopes": [
  13446. // "https://www.googleapis.com/auth/adexchange.buyer"
  13447. // ]
  13448. // }
  13449. }
  13450. // method id "adexchangebuyer2.bidders.filterSets.get":
  13451. type BiddersFilterSetsGetCall struct {
  13452. s *Service
  13453. name string
  13454. urlParams_ gensupport.URLParams
  13455. ifNoneMatch_ string
  13456. ctx_ context.Context
  13457. header_ http.Header
  13458. }
  13459. // Get: Retrieves the requested filter set for the account with the
  13460. // given account
  13461. // ID.
  13462. func (r *BiddersFilterSetsService) Get(name string) *BiddersFilterSetsGetCall {
  13463. c := &BiddersFilterSetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13464. c.name = name
  13465. return c
  13466. }
  13467. // Fields allows partial responses to be retrieved. See
  13468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13469. // for more information.
  13470. func (c *BiddersFilterSetsGetCall) Fields(s ...googleapi.Field) *BiddersFilterSetsGetCall {
  13471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13472. return c
  13473. }
  13474. // IfNoneMatch sets the optional parameter which makes the operation
  13475. // fail if the object's ETag matches the given value. This is useful for
  13476. // getting updates only after the object has changed since the last
  13477. // request. Use googleapi.IsNotModified to check whether the response
  13478. // error from Do is the result of In-None-Match.
  13479. func (c *BiddersFilterSetsGetCall) IfNoneMatch(entityTag string) *BiddersFilterSetsGetCall {
  13480. c.ifNoneMatch_ = entityTag
  13481. return c
  13482. }
  13483. // Context sets the context to be used in this call's Do method. Any
  13484. // pending HTTP request will be aborted if the provided context is
  13485. // canceled.
  13486. func (c *BiddersFilterSetsGetCall) Context(ctx context.Context) *BiddersFilterSetsGetCall {
  13487. c.ctx_ = ctx
  13488. return c
  13489. }
  13490. // Header returns an http.Header that can be modified by the caller to
  13491. // add HTTP headers to the request.
  13492. func (c *BiddersFilterSetsGetCall) Header() http.Header {
  13493. if c.header_ == nil {
  13494. c.header_ = make(http.Header)
  13495. }
  13496. return c.header_
  13497. }
  13498. func (c *BiddersFilterSetsGetCall) doRequest(alt string) (*http.Response, error) {
  13499. reqHeaders := make(http.Header)
  13500. for k, v := range c.header_ {
  13501. reqHeaders[k] = v
  13502. }
  13503. reqHeaders.Set("User-Agent", c.s.userAgent())
  13504. if c.ifNoneMatch_ != "" {
  13505. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13506. }
  13507. var body io.Reader = nil
  13508. c.urlParams_.Set("alt", alt)
  13509. c.urlParams_.Set("prettyPrint", "false")
  13510. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+name}")
  13511. urls += "?" + c.urlParams_.Encode()
  13512. req, err := http.NewRequest("GET", urls, body)
  13513. if err != nil {
  13514. return nil, err
  13515. }
  13516. req.Header = reqHeaders
  13517. googleapi.Expand(req.URL, map[string]string{
  13518. "name": c.name,
  13519. })
  13520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13521. }
  13522. // Do executes the "adexchangebuyer2.bidders.filterSets.get" call.
  13523. // Exactly one of *FilterSet or error will be non-nil. Any non-2xx
  13524. // status code is an error. Response headers are in either
  13525. // *FilterSet.ServerResponse.Header or (if a response was returned at
  13526. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13527. // to check whether the returned error was because
  13528. // http.StatusNotModified was returned.
  13529. func (c *BiddersFilterSetsGetCall) Do(opts ...googleapi.CallOption) (*FilterSet, error) {
  13530. gensupport.SetOptions(c.urlParams_, opts...)
  13531. res, err := c.doRequest("json")
  13532. if res != nil && res.StatusCode == http.StatusNotModified {
  13533. if res.Body != nil {
  13534. res.Body.Close()
  13535. }
  13536. return nil, &googleapi.Error{
  13537. Code: res.StatusCode,
  13538. Header: res.Header,
  13539. }
  13540. }
  13541. if err != nil {
  13542. return nil, err
  13543. }
  13544. defer googleapi.CloseBody(res)
  13545. if err := googleapi.CheckResponse(res); err != nil {
  13546. return nil, err
  13547. }
  13548. ret := &FilterSet{
  13549. ServerResponse: googleapi.ServerResponse{
  13550. Header: res.Header,
  13551. HTTPStatusCode: res.StatusCode,
  13552. },
  13553. }
  13554. target := &ret
  13555. if err := gensupport.DecodeResponse(target, res); err != nil {
  13556. return nil, err
  13557. }
  13558. return ret, nil
  13559. // {
  13560. // "description": "Retrieves the requested filter set for the account with the given account\nID.",
  13561. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}",
  13562. // "httpMethod": "GET",
  13563. // "id": "adexchangebuyer2.bidders.filterSets.get",
  13564. // "parameterOrder": [
  13565. // "name"
  13566. // ],
  13567. // "parameters": {
  13568. // "name": {
  13569. // "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`",
  13570. // "location": "path",
  13571. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  13572. // "required": true,
  13573. // "type": "string"
  13574. // }
  13575. // },
  13576. // "path": "v2beta1/{+name}",
  13577. // "response": {
  13578. // "$ref": "FilterSet"
  13579. // },
  13580. // "scopes": [
  13581. // "https://www.googleapis.com/auth/adexchange.buyer"
  13582. // ]
  13583. // }
  13584. }
  13585. // method id "adexchangebuyer2.bidders.filterSets.list":
  13586. type BiddersFilterSetsListCall struct {
  13587. s *Service
  13588. ownerName string
  13589. urlParams_ gensupport.URLParams
  13590. ifNoneMatch_ string
  13591. ctx_ context.Context
  13592. header_ http.Header
  13593. }
  13594. // List: Lists all filter sets for the account with the given account
  13595. // ID.
  13596. func (r *BiddersFilterSetsService) List(ownerName string) *BiddersFilterSetsListCall {
  13597. c := &BiddersFilterSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13598. c.ownerName = ownerName
  13599. return c
  13600. }
  13601. // PageSize sets the optional parameter "pageSize": Requested page size.
  13602. // The server may return fewer results than requested.
  13603. // If unspecified, the server will pick an appropriate default.
  13604. func (c *BiddersFilterSetsListCall) PageSize(pageSize int64) *BiddersFilterSetsListCall {
  13605. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13606. return c
  13607. }
  13608. // PageToken sets the optional parameter "pageToken": A token
  13609. // identifying a page of results the server should return.
  13610. // Typically, this is the value
  13611. // of
  13612. // ListFilterSetsResponse.nextPageToken
  13613. // returned from the previous call to
  13614. // the
  13615. // accounts.filterSets.list
  13616. // method.
  13617. func (c *BiddersFilterSetsListCall) PageToken(pageToken string) *BiddersFilterSetsListCall {
  13618. c.urlParams_.Set("pageToken", pageToken)
  13619. return c
  13620. }
  13621. // Fields allows partial responses to be retrieved. See
  13622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13623. // for more information.
  13624. func (c *BiddersFilterSetsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsListCall {
  13625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13626. return c
  13627. }
  13628. // IfNoneMatch sets the optional parameter which makes the operation
  13629. // fail if the object's ETag matches the given value. This is useful for
  13630. // getting updates only after the object has changed since the last
  13631. // request. Use googleapi.IsNotModified to check whether the response
  13632. // error from Do is the result of In-None-Match.
  13633. func (c *BiddersFilterSetsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsListCall {
  13634. c.ifNoneMatch_ = entityTag
  13635. return c
  13636. }
  13637. // Context sets the context to be used in this call's Do method. Any
  13638. // pending HTTP request will be aborted if the provided context is
  13639. // canceled.
  13640. func (c *BiddersFilterSetsListCall) Context(ctx context.Context) *BiddersFilterSetsListCall {
  13641. c.ctx_ = ctx
  13642. return c
  13643. }
  13644. // Header returns an http.Header that can be modified by the caller to
  13645. // add HTTP headers to the request.
  13646. func (c *BiddersFilterSetsListCall) Header() http.Header {
  13647. if c.header_ == nil {
  13648. c.header_ = make(http.Header)
  13649. }
  13650. return c.header_
  13651. }
  13652. func (c *BiddersFilterSetsListCall) doRequest(alt string) (*http.Response, error) {
  13653. reqHeaders := make(http.Header)
  13654. for k, v := range c.header_ {
  13655. reqHeaders[k] = v
  13656. }
  13657. reqHeaders.Set("User-Agent", c.s.userAgent())
  13658. if c.ifNoneMatch_ != "" {
  13659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13660. }
  13661. var body io.Reader = nil
  13662. c.urlParams_.Set("alt", alt)
  13663. c.urlParams_.Set("prettyPrint", "false")
  13664. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+ownerName}/filterSets")
  13665. urls += "?" + c.urlParams_.Encode()
  13666. req, err := http.NewRequest("GET", urls, body)
  13667. if err != nil {
  13668. return nil, err
  13669. }
  13670. req.Header = reqHeaders
  13671. googleapi.Expand(req.URL, map[string]string{
  13672. "ownerName": c.ownerName,
  13673. })
  13674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13675. }
  13676. // Do executes the "adexchangebuyer2.bidders.filterSets.list" call.
  13677. // Exactly one of *ListFilterSetsResponse or error will be non-nil. Any
  13678. // non-2xx status code is an error. Response headers are in either
  13679. // *ListFilterSetsResponse.ServerResponse.Header or (if a response was
  13680. // returned at all) in error.(*googleapi.Error).Header. Use
  13681. // googleapi.IsNotModified to check whether the returned error was
  13682. // because http.StatusNotModified was returned.
  13683. func (c *BiddersFilterSetsListCall) Do(opts ...googleapi.CallOption) (*ListFilterSetsResponse, error) {
  13684. gensupport.SetOptions(c.urlParams_, opts...)
  13685. res, err := c.doRequest("json")
  13686. if res != nil && res.StatusCode == http.StatusNotModified {
  13687. if res.Body != nil {
  13688. res.Body.Close()
  13689. }
  13690. return nil, &googleapi.Error{
  13691. Code: res.StatusCode,
  13692. Header: res.Header,
  13693. }
  13694. }
  13695. if err != nil {
  13696. return nil, err
  13697. }
  13698. defer googleapi.CloseBody(res)
  13699. if err := googleapi.CheckResponse(res); err != nil {
  13700. return nil, err
  13701. }
  13702. ret := &ListFilterSetsResponse{
  13703. ServerResponse: googleapi.ServerResponse{
  13704. Header: res.Header,
  13705. HTTPStatusCode: res.StatusCode,
  13706. },
  13707. }
  13708. target := &ret
  13709. if err := gensupport.DecodeResponse(target, res); err != nil {
  13710. return nil, err
  13711. }
  13712. return ret, nil
  13713. // {
  13714. // "description": "Lists all filter sets for the account with the given account ID.",
  13715. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets",
  13716. // "httpMethod": "GET",
  13717. // "id": "adexchangebuyer2.bidders.filterSets.list",
  13718. // "parameterOrder": [
  13719. // "ownerName"
  13720. // ],
  13721. // "parameters": {
  13722. // "ownerName": {
  13723. // "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`",
  13724. // "location": "path",
  13725. // "pattern": "^bidders/[^/]+$",
  13726. // "required": true,
  13727. // "type": "string"
  13728. // },
  13729. // "pageSize": {
  13730. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  13731. // "format": "int32",
  13732. // "location": "query",
  13733. // "type": "integer"
  13734. // },
  13735. // "pageToken": {
  13736. // "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.",
  13737. // "location": "query",
  13738. // "type": "string"
  13739. // }
  13740. // },
  13741. // "path": "v2beta1/{+ownerName}/filterSets",
  13742. // "response": {
  13743. // "$ref": "ListFilterSetsResponse"
  13744. // },
  13745. // "scopes": [
  13746. // "https://www.googleapis.com/auth/adexchange.buyer"
  13747. // ]
  13748. // }
  13749. }
  13750. // Pages invokes f for each page of results.
  13751. // A non-nil error returned from f will halt the iteration.
  13752. // The provided context supersedes any context provided to the Context method.
  13753. func (c *BiddersFilterSetsListCall) Pages(ctx context.Context, f func(*ListFilterSetsResponse) error) error {
  13754. c.ctx_ = ctx
  13755. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13756. for {
  13757. x, err := c.Do()
  13758. if err != nil {
  13759. return err
  13760. }
  13761. if err := f(x); err != nil {
  13762. return err
  13763. }
  13764. if x.NextPageToken == "" {
  13765. return nil
  13766. }
  13767. c.PageToken(x.NextPageToken)
  13768. }
  13769. }
  13770. // method id "adexchangebuyer2.bidders.filterSets.bidMetrics.list":
  13771. type BiddersFilterSetsBidMetricsListCall struct {
  13772. s *Service
  13773. filterSetName string
  13774. urlParams_ gensupport.URLParams
  13775. ifNoneMatch_ string
  13776. ctx_ context.Context
  13777. header_ http.Header
  13778. }
  13779. // List: Lists all metrics that are measured in terms of number of bids.
  13780. func (r *BiddersFilterSetsBidMetricsService) List(filterSetName string) *BiddersFilterSetsBidMetricsListCall {
  13781. c := &BiddersFilterSetsBidMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13782. c.filterSetName = filterSetName
  13783. return c
  13784. }
  13785. // PageSize sets the optional parameter "pageSize": Requested page size.
  13786. // The server may return fewer results than requested.
  13787. // If unspecified, the server will pick an appropriate default.
  13788. func (c *BiddersFilterSetsBidMetricsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidMetricsListCall {
  13789. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13790. return c
  13791. }
  13792. // PageToken sets the optional parameter "pageToken": A token
  13793. // identifying a page of results the server should return.
  13794. // Typically, this is the value
  13795. // of
  13796. // ListBidMetricsResponse.nextPageToken
  13797. // returned from the previous call to the bidMetrics.list
  13798. // method.
  13799. func (c *BiddersFilterSetsBidMetricsListCall) PageToken(pageToken string) *BiddersFilterSetsBidMetricsListCall {
  13800. c.urlParams_.Set("pageToken", pageToken)
  13801. return c
  13802. }
  13803. // Fields allows partial responses to be retrieved. See
  13804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13805. // for more information.
  13806. func (c *BiddersFilterSetsBidMetricsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidMetricsListCall {
  13807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13808. return c
  13809. }
  13810. // IfNoneMatch sets the optional parameter which makes the operation
  13811. // fail if the object's ETag matches the given value. This is useful for
  13812. // getting updates only after the object has changed since the last
  13813. // request. Use googleapi.IsNotModified to check whether the response
  13814. // error from Do is the result of In-None-Match.
  13815. func (c *BiddersFilterSetsBidMetricsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidMetricsListCall {
  13816. c.ifNoneMatch_ = entityTag
  13817. return c
  13818. }
  13819. // Context sets the context to be used in this call's Do method. Any
  13820. // pending HTTP request will be aborted if the provided context is
  13821. // canceled.
  13822. func (c *BiddersFilterSetsBidMetricsListCall) Context(ctx context.Context) *BiddersFilterSetsBidMetricsListCall {
  13823. c.ctx_ = ctx
  13824. return c
  13825. }
  13826. // Header returns an http.Header that can be modified by the caller to
  13827. // add HTTP headers to the request.
  13828. func (c *BiddersFilterSetsBidMetricsListCall) Header() http.Header {
  13829. if c.header_ == nil {
  13830. c.header_ = make(http.Header)
  13831. }
  13832. return c.header_
  13833. }
  13834. func (c *BiddersFilterSetsBidMetricsListCall) doRequest(alt string) (*http.Response, error) {
  13835. reqHeaders := make(http.Header)
  13836. for k, v := range c.header_ {
  13837. reqHeaders[k] = v
  13838. }
  13839. reqHeaders.Set("User-Agent", c.s.userAgent())
  13840. if c.ifNoneMatch_ != "" {
  13841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13842. }
  13843. var body io.Reader = nil
  13844. c.urlParams_.Set("alt", alt)
  13845. c.urlParams_.Set("prettyPrint", "false")
  13846. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidMetrics")
  13847. urls += "?" + c.urlParams_.Encode()
  13848. req, err := http.NewRequest("GET", urls, body)
  13849. if err != nil {
  13850. return nil, err
  13851. }
  13852. req.Header = reqHeaders
  13853. googleapi.Expand(req.URL, map[string]string{
  13854. "filterSetName": c.filterSetName,
  13855. })
  13856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13857. }
  13858. // Do executes the "adexchangebuyer2.bidders.filterSets.bidMetrics.list" call.
  13859. // Exactly one of *ListBidMetricsResponse or error will be non-nil. Any
  13860. // non-2xx status code is an error. Response headers are in either
  13861. // *ListBidMetricsResponse.ServerResponse.Header or (if a response was
  13862. // returned at all) in error.(*googleapi.Error).Header. Use
  13863. // googleapi.IsNotModified to check whether the returned error was
  13864. // because http.StatusNotModified was returned.
  13865. func (c *BiddersFilterSetsBidMetricsListCall) Do(opts ...googleapi.CallOption) (*ListBidMetricsResponse, error) {
  13866. gensupport.SetOptions(c.urlParams_, opts...)
  13867. res, err := c.doRequest("json")
  13868. if res != nil && res.StatusCode == http.StatusNotModified {
  13869. if res.Body != nil {
  13870. res.Body.Close()
  13871. }
  13872. return nil, &googleapi.Error{
  13873. Code: res.StatusCode,
  13874. Header: res.Header,
  13875. }
  13876. }
  13877. if err != nil {
  13878. return nil, err
  13879. }
  13880. defer googleapi.CloseBody(res)
  13881. if err := googleapi.CheckResponse(res); err != nil {
  13882. return nil, err
  13883. }
  13884. ret := &ListBidMetricsResponse{
  13885. ServerResponse: googleapi.ServerResponse{
  13886. Header: res.Header,
  13887. HTTPStatusCode: res.StatusCode,
  13888. },
  13889. }
  13890. target := &ret
  13891. if err := gensupport.DecodeResponse(target, res); err != nil {
  13892. return nil, err
  13893. }
  13894. return ret, nil
  13895. // {
  13896. // "description": "Lists all metrics that are measured in terms of number of bids.",
  13897. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidMetrics",
  13898. // "httpMethod": "GET",
  13899. // "id": "adexchangebuyer2.bidders.filterSets.bidMetrics.list",
  13900. // "parameterOrder": [
  13901. // "filterSetName"
  13902. // ],
  13903. // "parameters": {
  13904. // "filterSetName": {
  13905. // "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`",
  13906. // "location": "path",
  13907. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  13908. // "required": true,
  13909. // "type": "string"
  13910. // },
  13911. // "pageSize": {
  13912. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  13913. // "format": "int32",
  13914. // "location": "query",
  13915. // "type": "integer"
  13916. // },
  13917. // "pageToken": {
  13918. // "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.",
  13919. // "location": "query",
  13920. // "type": "string"
  13921. // }
  13922. // },
  13923. // "path": "v2beta1/{+filterSetName}/bidMetrics",
  13924. // "response": {
  13925. // "$ref": "ListBidMetricsResponse"
  13926. // },
  13927. // "scopes": [
  13928. // "https://www.googleapis.com/auth/adexchange.buyer"
  13929. // ]
  13930. // }
  13931. }
  13932. // Pages invokes f for each page of results.
  13933. // A non-nil error returned from f will halt the iteration.
  13934. // The provided context supersedes any context provided to the Context method.
  13935. func (c *BiddersFilterSetsBidMetricsListCall) Pages(ctx context.Context, f func(*ListBidMetricsResponse) error) error {
  13936. c.ctx_ = ctx
  13937. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13938. for {
  13939. x, err := c.Do()
  13940. if err != nil {
  13941. return err
  13942. }
  13943. if err := f(x); err != nil {
  13944. return err
  13945. }
  13946. if x.NextPageToken == "" {
  13947. return nil
  13948. }
  13949. c.PageToken(x.NextPageToken)
  13950. }
  13951. }
  13952. // method id "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list":
  13953. type BiddersFilterSetsBidResponseErrorsListCall struct {
  13954. s *Service
  13955. filterSetName string
  13956. urlParams_ gensupport.URLParams
  13957. ifNoneMatch_ string
  13958. ctx_ context.Context
  13959. header_ http.Header
  13960. }
  13961. // List: List all errors that occurred in bid responses, with the number
  13962. // of bid
  13963. // responses affected for each reason.
  13964. func (r *BiddersFilterSetsBidResponseErrorsService) List(filterSetName string) *BiddersFilterSetsBidResponseErrorsListCall {
  13965. c := &BiddersFilterSetsBidResponseErrorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13966. c.filterSetName = filterSetName
  13967. return c
  13968. }
  13969. // PageSize sets the optional parameter "pageSize": Requested page size.
  13970. // The server may return fewer results than requested.
  13971. // If unspecified, the server will pick an appropriate default.
  13972. func (c *BiddersFilterSetsBidResponseErrorsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidResponseErrorsListCall {
  13973. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  13974. return c
  13975. }
  13976. // PageToken sets the optional parameter "pageToken": A token
  13977. // identifying a page of results the server should return.
  13978. // Typically, this is the value
  13979. // of
  13980. // ListBidResponseErrorsResponse.nextPageToken
  13981. // returned from the previous call to the bidResponseErrors.list
  13982. // method.
  13983. func (c *BiddersFilterSetsBidResponseErrorsListCall) PageToken(pageToken string) *BiddersFilterSetsBidResponseErrorsListCall {
  13984. c.urlParams_.Set("pageToken", pageToken)
  13985. return c
  13986. }
  13987. // Fields allows partial responses to be retrieved. See
  13988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13989. // for more information.
  13990. func (c *BiddersFilterSetsBidResponseErrorsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidResponseErrorsListCall {
  13991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13992. return c
  13993. }
  13994. // IfNoneMatch sets the optional parameter which makes the operation
  13995. // fail if the object's ETag matches the given value. This is useful for
  13996. // getting updates only after the object has changed since the last
  13997. // request. Use googleapi.IsNotModified to check whether the response
  13998. // error from Do is the result of In-None-Match.
  13999. func (c *BiddersFilterSetsBidResponseErrorsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidResponseErrorsListCall {
  14000. c.ifNoneMatch_ = entityTag
  14001. return c
  14002. }
  14003. // Context sets the context to be used in this call's Do method. Any
  14004. // pending HTTP request will be aborted if the provided context is
  14005. // canceled.
  14006. func (c *BiddersFilterSetsBidResponseErrorsListCall) Context(ctx context.Context) *BiddersFilterSetsBidResponseErrorsListCall {
  14007. c.ctx_ = ctx
  14008. return c
  14009. }
  14010. // Header returns an http.Header that can be modified by the caller to
  14011. // add HTTP headers to the request.
  14012. func (c *BiddersFilterSetsBidResponseErrorsListCall) Header() http.Header {
  14013. if c.header_ == nil {
  14014. c.header_ = make(http.Header)
  14015. }
  14016. return c.header_
  14017. }
  14018. func (c *BiddersFilterSetsBidResponseErrorsListCall) doRequest(alt string) (*http.Response, error) {
  14019. reqHeaders := make(http.Header)
  14020. for k, v := range c.header_ {
  14021. reqHeaders[k] = v
  14022. }
  14023. reqHeaders.Set("User-Agent", c.s.userAgent())
  14024. if c.ifNoneMatch_ != "" {
  14025. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14026. }
  14027. var body io.Reader = nil
  14028. c.urlParams_.Set("alt", alt)
  14029. c.urlParams_.Set("prettyPrint", "false")
  14030. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponseErrors")
  14031. urls += "?" + c.urlParams_.Encode()
  14032. req, err := http.NewRequest("GET", urls, body)
  14033. if err != nil {
  14034. return nil, err
  14035. }
  14036. req.Header = reqHeaders
  14037. googleapi.Expand(req.URL, map[string]string{
  14038. "filterSetName": c.filterSetName,
  14039. })
  14040. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14041. }
  14042. // Do executes the "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list" call.
  14043. // Exactly one of *ListBidResponseErrorsResponse or error will be
  14044. // non-nil. Any non-2xx status code is an error. Response headers are in
  14045. // either *ListBidResponseErrorsResponse.ServerResponse.Header or (if a
  14046. // response was returned at all) in error.(*googleapi.Error).Header. Use
  14047. // googleapi.IsNotModified to check whether the returned error was
  14048. // because http.StatusNotModified was returned.
  14049. func (c *BiddersFilterSetsBidResponseErrorsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponseErrorsResponse, error) {
  14050. gensupport.SetOptions(c.urlParams_, opts...)
  14051. res, err := c.doRequest("json")
  14052. if res != nil && res.StatusCode == http.StatusNotModified {
  14053. if res.Body != nil {
  14054. res.Body.Close()
  14055. }
  14056. return nil, &googleapi.Error{
  14057. Code: res.StatusCode,
  14058. Header: res.Header,
  14059. }
  14060. }
  14061. if err != nil {
  14062. return nil, err
  14063. }
  14064. defer googleapi.CloseBody(res)
  14065. if err := googleapi.CheckResponse(res); err != nil {
  14066. return nil, err
  14067. }
  14068. ret := &ListBidResponseErrorsResponse{
  14069. ServerResponse: googleapi.ServerResponse{
  14070. Header: res.Header,
  14071. HTTPStatusCode: res.StatusCode,
  14072. },
  14073. }
  14074. target := &ret
  14075. if err := gensupport.DecodeResponse(target, res); err != nil {
  14076. return nil, err
  14077. }
  14078. return ret, nil
  14079. // {
  14080. // "description": "List all errors that occurred in bid responses, with the number of bid\nresponses affected for each reason.",
  14081. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponseErrors",
  14082. // "httpMethod": "GET",
  14083. // "id": "adexchangebuyer2.bidders.filterSets.bidResponseErrors.list",
  14084. // "parameterOrder": [
  14085. // "filterSetName"
  14086. // ],
  14087. // "parameters": {
  14088. // "filterSetName": {
  14089. // "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`",
  14090. // "location": "path",
  14091. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  14092. // "required": true,
  14093. // "type": "string"
  14094. // },
  14095. // "pageSize": {
  14096. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  14097. // "format": "int32",
  14098. // "location": "query",
  14099. // "type": "integer"
  14100. // },
  14101. // "pageToken": {
  14102. // "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.",
  14103. // "location": "query",
  14104. // "type": "string"
  14105. // }
  14106. // },
  14107. // "path": "v2beta1/{+filterSetName}/bidResponseErrors",
  14108. // "response": {
  14109. // "$ref": "ListBidResponseErrorsResponse"
  14110. // },
  14111. // "scopes": [
  14112. // "https://www.googleapis.com/auth/adexchange.buyer"
  14113. // ]
  14114. // }
  14115. }
  14116. // Pages invokes f for each page of results.
  14117. // A non-nil error returned from f will halt the iteration.
  14118. // The provided context supersedes any context provided to the Context method.
  14119. func (c *BiddersFilterSetsBidResponseErrorsListCall) Pages(ctx context.Context, f func(*ListBidResponseErrorsResponse) error) error {
  14120. c.ctx_ = ctx
  14121. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14122. for {
  14123. x, err := c.Do()
  14124. if err != nil {
  14125. return err
  14126. }
  14127. if err := f(x); err != nil {
  14128. return err
  14129. }
  14130. if x.NextPageToken == "" {
  14131. return nil
  14132. }
  14133. c.PageToken(x.NextPageToken)
  14134. }
  14135. }
  14136. // method id "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list":
  14137. type BiddersFilterSetsBidResponsesWithoutBidsListCall struct {
  14138. s *Service
  14139. filterSetName string
  14140. urlParams_ gensupport.URLParams
  14141. ifNoneMatch_ string
  14142. ctx_ context.Context
  14143. header_ http.Header
  14144. }
  14145. // List: List all reasons for which bid responses were considered to
  14146. // have no
  14147. // applicable bids, with the number of bid responses affected for each
  14148. // reason.
  14149. func (r *BiddersFilterSetsBidResponsesWithoutBidsService) List(filterSetName string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14150. c := &BiddersFilterSetsBidResponsesWithoutBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14151. c.filterSetName = filterSetName
  14152. return c
  14153. }
  14154. // PageSize sets the optional parameter "pageSize": Requested page size.
  14155. // The server may return fewer results than requested.
  14156. // If unspecified, the server will pick an appropriate default.
  14157. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14158. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14159. return c
  14160. }
  14161. // PageToken sets the optional parameter "pageToken": A token
  14162. // identifying a page of results the server should return.
  14163. // Typically, this is the value
  14164. // of
  14165. // ListBidResponsesWithoutBidsResponse.nextPageToken
  14166. // returned from the previous call to the
  14167. // bidResponsesWithoutBids.list
  14168. // method.
  14169. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) PageToken(pageToken string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14170. c.urlParams_.Set("pageToken", pageToken)
  14171. return c
  14172. }
  14173. // Fields allows partial responses to be retrieved. See
  14174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14175. // for more information.
  14176. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14178. return c
  14179. }
  14180. // IfNoneMatch sets the optional parameter which makes the operation
  14181. // fail if the object's ETag matches the given value. This is useful for
  14182. // getting updates only after the object has changed since the last
  14183. // request. Use googleapi.IsNotModified to check whether the response
  14184. // error from Do is the result of In-None-Match.
  14185. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14186. c.ifNoneMatch_ = entityTag
  14187. return c
  14188. }
  14189. // Context sets the context to be used in this call's Do method. Any
  14190. // pending HTTP request will be aborted if the provided context is
  14191. // canceled.
  14192. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Context(ctx context.Context) *BiddersFilterSetsBidResponsesWithoutBidsListCall {
  14193. c.ctx_ = ctx
  14194. return c
  14195. }
  14196. // Header returns an http.Header that can be modified by the caller to
  14197. // add HTTP headers to the request.
  14198. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Header() http.Header {
  14199. if c.header_ == nil {
  14200. c.header_ = make(http.Header)
  14201. }
  14202. return c.header_
  14203. }
  14204. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) doRequest(alt string) (*http.Response, error) {
  14205. reqHeaders := make(http.Header)
  14206. for k, v := range c.header_ {
  14207. reqHeaders[k] = v
  14208. }
  14209. reqHeaders.Set("User-Agent", c.s.userAgent())
  14210. if c.ifNoneMatch_ != "" {
  14211. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14212. }
  14213. var body io.Reader = nil
  14214. c.urlParams_.Set("alt", alt)
  14215. c.urlParams_.Set("prettyPrint", "false")
  14216. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/bidResponsesWithoutBids")
  14217. urls += "?" + c.urlParams_.Encode()
  14218. req, err := http.NewRequest("GET", urls, body)
  14219. if err != nil {
  14220. return nil, err
  14221. }
  14222. req.Header = reqHeaders
  14223. googleapi.Expand(req.URL, map[string]string{
  14224. "filterSetName": c.filterSetName,
  14225. })
  14226. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14227. }
  14228. // Do executes the "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list" call.
  14229. // Exactly one of *ListBidResponsesWithoutBidsResponse or error will be
  14230. // non-nil. Any non-2xx status code is an error. Response headers are in
  14231. // either *ListBidResponsesWithoutBidsResponse.ServerResponse.Header or
  14232. // (if a response was returned at all) in
  14233. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14234. // whether the returned error was because http.StatusNotModified was
  14235. // returned.
  14236. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Do(opts ...googleapi.CallOption) (*ListBidResponsesWithoutBidsResponse, error) {
  14237. gensupport.SetOptions(c.urlParams_, opts...)
  14238. res, err := c.doRequest("json")
  14239. if res != nil && res.StatusCode == http.StatusNotModified {
  14240. if res.Body != nil {
  14241. res.Body.Close()
  14242. }
  14243. return nil, &googleapi.Error{
  14244. Code: res.StatusCode,
  14245. Header: res.Header,
  14246. }
  14247. }
  14248. if err != nil {
  14249. return nil, err
  14250. }
  14251. defer googleapi.CloseBody(res)
  14252. if err := googleapi.CheckResponse(res); err != nil {
  14253. return nil, err
  14254. }
  14255. ret := &ListBidResponsesWithoutBidsResponse{
  14256. ServerResponse: googleapi.ServerResponse{
  14257. Header: res.Header,
  14258. HTTPStatusCode: res.StatusCode,
  14259. },
  14260. }
  14261. target := &ret
  14262. if err := gensupport.DecodeResponse(target, res); err != nil {
  14263. return nil, err
  14264. }
  14265. return ret, nil
  14266. // {
  14267. // "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.",
  14268. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/bidResponsesWithoutBids",
  14269. // "httpMethod": "GET",
  14270. // "id": "adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list",
  14271. // "parameterOrder": [
  14272. // "filterSetName"
  14273. // ],
  14274. // "parameters": {
  14275. // "filterSetName": {
  14276. // "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`",
  14277. // "location": "path",
  14278. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  14279. // "required": true,
  14280. // "type": "string"
  14281. // },
  14282. // "pageSize": {
  14283. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  14284. // "format": "int32",
  14285. // "location": "query",
  14286. // "type": "integer"
  14287. // },
  14288. // "pageToken": {
  14289. // "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.",
  14290. // "location": "query",
  14291. // "type": "string"
  14292. // }
  14293. // },
  14294. // "path": "v2beta1/{+filterSetName}/bidResponsesWithoutBids",
  14295. // "response": {
  14296. // "$ref": "ListBidResponsesWithoutBidsResponse"
  14297. // },
  14298. // "scopes": [
  14299. // "https://www.googleapis.com/auth/adexchange.buyer"
  14300. // ]
  14301. // }
  14302. }
  14303. // Pages invokes f for each page of results.
  14304. // A non-nil error returned from f will halt the iteration.
  14305. // The provided context supersedes any context provided to the Context method.
  14306. func (c *BiddersFilterSetsBidResponsesWithoutBidsListCall) Pages(ctx context.Context, f func(*ListBidResponsesWithoutBidsResponse) error) error {
  14307. c.ctx_ = ctx
  14308. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14309. for {
  14310. x, err := c.Do()
  14311. if err != nil {
  14312. return err
  14313. }
  14314. if err := f(x); err != nil {
  14315. return err
  14316. }
  14317. if x.NextPageToken == "" {
  14318. return nil
  14319. }
  14320. c.PageToken(x.NextPageToken)
  14321. }
  14322. }
  14323. // method id "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list":
  14324. type BiddersFilterSetsFilteredBidRequestsListCall struct {
  14325. s *Service
  14326. filterSetName string
  14327. urlParams_ gensupport.URLParams
  14328. ifNoneMatch_ string
  14329. ctx_ context.Context
  14330. header_ http.Header
  14331. }
  14332. // List: List all reasons that caused a bid request not to be sent for
  14333. // an
  14334. // impression, with the number of bid requests not sent for each reason.
  14335. func (r *BiddersFilterSetsFilteredBidRequestsService) List(filterSetName string) *BiddersFilterSetsFilteredBidRequestsListCall {
  14336. c := &BiddersFilterSetsFilteredBidRequestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14337. c.filterSetName = filterSetName
  14338. return c
  14339. }
  14340. // PageSize sets the optional parameter "pageSize": Requested page size.
  14341. // The server may return fewer results than requested.
  14342. // If unspecified, the server will pick an appropriate default.
  14343. func (c *BiddersFilterSetsFilteredBidRequestsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidRequestsListCall {
  14344. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14345. return c
  14346. }
  14347. // PageToken sets the optional parameter "pageToken": A token
  14348. // identifying a page of results the server should return.
  14349. // Typically, this is the value
  14350. // of
  14351. // ListFilteredBidRequestsResponse.nextPageToken
  14352. // returned from the previous call to the
  14353. // filteredBidRequests.list
  14354. // method.
  14355. func (c *BiddersFilterSetsFilteredBidRequestsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidRequestsListCall {
  14356. c.urlParams_.Set("pageToken", pageToken)
  14357. return c
  14358. }
  14359. // Fields allows partial responses to be retrieved. See
  14360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14361. // for more information.
  14362. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidRequestsListCall {
  14363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14364. return c
  14365. }
  14366. // IfNoneMatch sets the optional parameter which makes the operation
  14367. // fail if the object's ETag matches the given value. This is useful for
  14368. // getting updates only after the object has changed since the last
  14369. // request. Use googleapi.IsNotModified to check whether the response
  14370. // error from Do is the result of In-None-Match.
  14371. func (c *BiddersFilterSetsFilteredBidRequestsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidRequestsListCall {
  14372. c.ifNoneMatch_ = entityTag
  14373. return c
  14374. }
  14375. // Context sets the context to be used in this call's Do method. Any
  14376. // pending HTTP request will be aborted if the provided context is
  14377. // canceled.
  14378. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidRequestsListCall {
  14379. c.ctx_ = ctx
  14380. return c
  14381. }
  14382. // Header returns an http.Header that can be modified by the caller to
  14383. // add HTTP headers to the request.
  14384. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Header() http.Header {
  14385. if c.header_ == nil {
  14386. c.header_ = make(http.Header)
  14387. }
  14388. return c.header_
  14389. }
  14390. func (c *BiddersFilterSetsFilteredBidRequestsListCall) doRequest(alt string) (*http.Response, error) {
  14391. reqHeaders := make(http.Header)
  14392. for k, v := range c.header_ {
  14393. reqHeaders[k] = v
  14394. }
  14395. reqHeaders.Set("User-Agent", c.s.userAgent())
  14396. if c.ifNoneMatch_ != "" {
  14397. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14398. }
  14399. var body io.Reader = nil
  14400. c.urlParams_.Set("alt", alt)
  14401. c.urlParams_.Set("prettyPrint", "false")
  14402. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBidRequests")
  14403. urls += "?" + c.urlParams_.Encode()
  14404. req, err := http.NewRequest("GET", urls, body)
  14405. if err != nil {
  14406. return nil, err
  14407. }
  14408. req.Header = reqHeaders
  14409. googleapi.Expand(req.URL, map[string]string{
  14410. "filterSetName": c.filterSetName,
  14411. })
  14412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14413. }
  14414. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list" call.
  14415. // Exactly one of *ListFilteredBidRequestsResponse or error will be
  14416. // non-nil. Any non-2xx status code is an error. Response headers are in
  14417. // either *ListFilteredBidRequestsResponse.ServerResponse.Header or (if
  14418. // a response was returned at all) in error.(*googleapi.Error).Header.
  14419. // Use googleapi.IsNotModified to check whether the returned error was
  14420. // because http.StatusNotModified was returned.
  14421. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidRequestsResponse, error) {
  14422. gensupport.SetOptions(c.urlParams_, opts...)
  14423. res, err := c.doRequest("json")
  14424. if res != nil && res.StatusCode == http.StatusNotModified {
  14425. if res.Body != nil {
  14426. res.Body.Close()
  14427. }
  14428. return nil, &googleapi.Error{
  14429. Code: res.StatusCode,
  14430. Header: res.Header,
  14431. }
  14432. }
  14433. if err != nil {
  14434. return nil, err
  14435. }
  14436. defer googleapi.CloseBody(res)
  14437. if err := googleapi.CheckResponse(res); err != nil {
  14438. return nil, err
  14439. }
  14440. ret := &ListFilteredBidRequestsResponse{
  14441. ServerResponse: googleapi.ServerResponse{
  14442. Header: res.Header,
  14443. HTTPStatusCode: res.StatusCode,
  14444. },
  14445. }
  14446. target := &ret
  14447. if err := gensupport.DecodeResponse(target, res); err != nil {
  14448. return nil, err
  14449. }
  14450. return ret, nil
  14451. // {
  14452. // "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.",
  14453. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBidRequests",
  14454. // "httpMethod": "GET",
  14455. // "id": "adexchangebuyer2.bidders.filterSets.filteredBidRequests.list",
  14456. // "parameterOrder": [
  14457. // "filterSetName"
  14458. // ],
  14459. // "parameters": {
  14460. // "filterSetName": {
  14461. // "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`",
  14462. // "location": "path",
  14463. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  14464. // "required": true,
  14465. // "type": "string"
  14466. // },
  14467. // "pageSize": {
  14468. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  14469. // "format": "int32",
  14470. // "location": "query",
  14471. // "type": "integer"
  14472. // },
  14473. // "pageToken": {
  14474. // "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.",
  14475. // "location": "query",
  14476. // "type": "string"
  14477. // }
  14478. // },
  14479. // "path": "v2beta1/{+filterSetName}/filteredBidRequests",
  14480. // "response": {
  14481. // "$ref": "ListFilteredBidRequestsResponse"
  14482. // },
  14483. // "scopes": [
  14484. // "https://www.googleapis.com/auth/adexchange.buyer"
  14485. // ]
  14486. // }
  14487. }
  14488. // Pages invokes f for each page of results.
  14489. // A non-nil error returned from f will halt the iteration.
  14490. // The provided context supersedes any context provided to the Context method.
  14491. func (c *BiddersFilterSetsFilteredBidRequestsListCall) Pages(ctx context.Context, f func(*ListFilteredBidRequestsResponse) error) error {
  14492. c.ctx_ = ctx
  14493. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14494. for {
  14495. x, err := c.Do()
  14496. if err != nil {
  14497. return err
  14498. }
  14499. if err := f(x); err != nil {
  14500. return err
  14501. }
  14502. if x.NextPageToken == "" {
  14503. return nil
  14504. }
  14505. c.PageToken(x.NextPageToken)
  14506. }
  14507. }
  14508. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.list":
  14509. type BiddersFilterSetsFilteredBidsListCall struct {
  14510. s *Service
  14511. filterSetName string
  14512. urlParams_ gensupport.URLParams
  14513. ifNoneMatch_ string
  14514. ctx_ context.Context
  14515. header_ http.Header
  14516. }
  14517. // List: List all reasons for which bids were filtered, with the number
  14518. // of bids
  14519. // filtered for each reason.
  14520. func (r *BiddersFilterSetsFilteredBidsService) List(filterSetName string) *BiddersFilterSetsFilteredBidsListCall {
  14521. c := &BiddersFilterSetsFilteredBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14522. c.filterSetName = filterSetName
  14523. return c
  14524. }
  14525. // PageSize sets the optional parameter "pageSize": Requested page size.
  14526. // The server may return fewer results than requested.
  14527. // If unspecified, the server will pick an appropriate default.
  14528. func (c *BiddersFilterSetsFilteredBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsListCall {
  14529. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14530. return c
  14531. }
  14532. // PageToken sets the optional parameter "pageToken": A token
  14533. // identifying a page of results the server should return.
  14534. // Typically, this is the value
  14535. // of
  14536. // ListFilteredBidsResponse.nextPageToken
  14537. // returned from the previous call to the filteredBids.list
  14538. // method.
  14539. func (c *BiddersFilterSetsFilteredBidsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsListCall {
  14540. c.urlParams_.Set("pageToken", pageToken)
  14541. return c
  14542. }
  14543. // Fields allows partial responses to be retrieved. See
  14544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14545. // for more information.
  14546. func (c *BiddersFilterSetsFilteredBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsListCall {
  14547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14548. return c
  14549. }
  14550. // IfNoneMatch sets the optional parameter which makes the operation
  14551. // fail if the object's ETag matches the given value. This is useful for
  14552. // getting updates only after the object has changed since the last
  14553. // request. Use googleapi.IsNotModified to check whether the response
  14554. // error from Do is the result of In-None-Match.
  14555. func (c *BiddersFilterSetsFilteredBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsListCall {
  14556. c.ifNoneMatch_ = entityTag
  14557. return c
  14558. }
  14559. // Context sets the context to be used in this call's Do method. Any
  14560. // pending HTTP request will be aborted if the provided context is
  14561. // canceled.
  14562. func (c *BiddersFilterSetsFilteredBidsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsListCall {
  14563. c.ctx_ = ctx
  14564. return c
  14565. }
  14566. // Header returns an http.Header that can be modified by the caller to
  14567. // add HTTP headers to the request.
  14568. func (c *BiddersFilterSetsFilteredBidsListCall) Header() http.Header {
  14569. if c.header_ == nil {
  14570. c.header_ = make(http.Header)
  14571. }
  14572. return c.header_
  14573. }
  14574. func (c *BiddersFilterSetsFilteredBidsListCall) doRequest(alt string) (*http.Response, error) {
  14575. reqHeaders := make(http.Header)
  14576. for k, v := range c.header_ {
  14577. reqHeaders[k] = v
  14578. }
  14579. reqHeaders.Set("User-Agent", c.s.userAgent())
  14580. if c.ifNoneMatch_ != "" {
  14581. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14582. }
  14583. var body io.Reader = nil
  14584. c.urlParams_.Set("alt", alt)
  14585. c.urlParams_.Set("prettyPrint", "false")
  14586. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids")
  14587. urls += "?" + c.urlParams_.Encode()
  14588. req, err := http.NewRequest("GET", urls, body)
  14589. if err != nil {
  14590. return nil, err
  14591. }
  14592. req.Header = reqHeaders
  14593. googleapi.Expand(req.URL, map[string]string{
  14594. "filterSetName": c.filterSetName,
  14595. })
  14596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14597. }
  14598. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.list" call.
  14599. // Exactly one of *ListFilteredBidsResponse or error will be non-nil.
  14600. // Any non-2xx status code is an error. Response headers are in either
  14601. // *ListFilteredBidsResponse.ServerResponse.Header or (if a response was
  14602. // returned at all) in error.(*googleapi.Error).Header. Use
  14603. // googleapi.IsNotModified to check whether the returned error was
  14604. // because http.StatusNotModified was returned.
  14605. func (c *BiddersFilterSetsFilteredBidsListCall) Do(opts ...googleapi.CallOption) (*ListFilteredBidsResponse, error) {
  14606. gensupport.SetOptions(c.urlParams_, opts...)
  14607. res, err := c.doRequest("json")
  14608. if res != nil && res.StatusCode == http.StatusNotModified {
  14609. if res.Body != nil {
  14610. res.Body.Close()
  14611. }
  14612. return nil, &googleapi.Error{
  14613. Code: res.StatusCode,
  14614. Header: res.Header,
  14615. }
  14616. }
  14617. if err != nil {
  14618. return nil, err
  14619. }
  14620. defer googleapi.CloseBody(res)
  14621. if err := googleapi.CheckResponse(res); err != nil {
  14622. return nil, err
  14623. }
  14624. ret := &ListFilteredBidsResponse{
  14625. ServerResponse: googleapi.ServerResponse{
  14626. Header: res.Header,
  14627. HTTPStatusCode: res.StatusCode,
  14628. },
  14629. }
  14630. target := &ret
  14631. if err := gensupport.DecodeResponse(target, res); err != nil {
  14632. return nil, err
  14633. }
  14634. return ret, nil
  14635. // {
  14636. // "description": "List all reasons for which bids were filtered, with the number of bids\nfiltered for each reason.",
  14637. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids",
  14638. // "httpMethod": "GET",
  14639. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.list",
  14640. // "parameterOrder": [
  14641. // "filterSetName"
  14642. // ],
  14643. // "parameters": {
  14644. // "filterSetName": {
  14645. // "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`",
  14646. // "location": "path",
  14647. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  14648. // "required": true,
  14649. // "type": "string"
  14650. // },
  14651. // "pageSize": {
  14652. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  14653. // "format": "int32",
  14654. // "location": "query",
  14655. // "type": "integer"
  14656. // },
  14657. // "pageToken": {
  14658. // "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.",
  14659. // "location": "query",
  14660. // "type": "string"
  14661. // }
  14662. // },
  14663. // "path": "v2beta1/{+filterSetName}/filteredBids",
  14664. // "response": {
  14665. // "$ref": "ListFilteredBidsResponse"
  14666. // },
  14667. // "scopes": [
  14668. // "https://www.googleapis.com/auth/adexchange.buyer"
  14669. // ]
  14670. // }
  14671. }
  14672. // Pages invokes f for each page of results.
  14673. // A non-nil error returned from f will halt the iteration.
  14674. // The provided context supersedes any context provided to the Context method.
  14675. func (c *BiddersFilterSetsFilteredBidsListCall) Pages(ctx context.Context, f func(*ListFilteredBidsResponse) error) error {
  14676. c.ctx_ = ctx
  14677. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14678. for {
  14679. x, err := c.Do()
  14680. if err != nil {
  14681. return err
  14682. }
  14683. if err := f(x); err != nil {
  14684. return err
  14685. }
  14686. if x.NextPageToken == "" {
  14687. return nil
  14688. }
  14689. c.PageToken(x.NextPageToken)
  14690. }
  14691. }
  14692. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list":
  14693. type BiddersFilterSetsFilteredBidsCreativesListCall struct {
  14694. s *Service
  14695. filterSetName string
  14696. creativeStatusId int64
  14697. urlParams_ gensupport.URLParams
  14698. ifNoneMatch_ string
  14699. ctx_ context.Context
  14700. header_ http.Header
  14701. }
  14702. // List: List all creatives associated with a specific reason for which
  14703. // bids were
  14704. // filtered, with the number of bids filtered for each creative.
  14705. func (r *BiddersFilterSetsFilteredBidsCreativesService) List(filterSetName string, creativeStatusId int64) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14706. c := &BiddersFilterSetsFilteredBidsCreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14707. c.filterSetName = filterSetName
  14708. c.creativeStatusId = creativeStatusId
  14709. return c
  14710. }
  14711. // PageSize sets the optional parameter "pageSize": Requested page size.
  14712. // The server may return fewer results than requested.
  14713. // If unspecified, the server will pick an appropriate default.
  14714. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14715. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14716. return c
  14717. }
  14718. // PageToken sets the optional parameter "pageToken": A token
  14719. // identifying a page of results the server should return.
  14720. // Typically, this is the value
  14721. // of
  14722. // ListCreativeStatusBreakdownByCreativeResponse.nextPageToken
  14723. // returne
  14724. // d from the previous call to the filteredBids.creatives.list
  14725. // method.
  14726. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14727. c.urlParams_.Set("pageToken", pageToken)
  14728. return c
  14729. }
  14730. // Fields allows partial responses to be retrieved. See
  14731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14732. // for more information.
  14733. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14735. return c
  14736. }
  14737. // IfNoneMatch sets the optional parameter which makes the operation
  14738. // fail if the object's ETag matches the given value. This is useful for
  14739. // getting updates only after the object has changed since the last
  14740. // request. Use googleapi.IsNotModified to check whether the response
  14741. // error from Do is the result of In-None-Match.
  14742. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14743. c.ifNoneMatch_ = entityTag
  14744. return c
  14745. }
  14746. // Context sets the context to be used in this call's Do method. Any
  14747. // pending HTTP request will be aborted if the provided context is
  14748. // canceled.
  14749. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsCreativesListCall {
  14750. c.ctx_ = ctx
  14751. return c
  14752. }
  14753. // Header returns an http.Header that can be modified by the caller to
  14754. // add HTTP headers to the request.
  14755. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Header() http.Header {
  14756. if c.header_ == nil {
  14757. c.header_ = make(http.Header)
  14758. }
  14759. return c.header_
  14760. }
  14761. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) doRequest(alt string) (*http.Response, error) {
  14762. reqHeaders := make(http.Header)
  14763. for k, v := range c.header_ {
  14764. reqHeaders[k] = v
  14765. }
  14766. reqHeaders.Set("User-Agent", c.s.userAgent())
  14767. if c.ifNoneMatch_ != "" {
  14768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14769. }
  14770. var body io.Reader = nil
  14771. c.urlParams_.Set("alt", alt)
  14772. c.urlParams_.Set("prettyPrint", "false")
  14773. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives")
  14774. urls += "?" + c.urlParams_.Encode()
  14775. req, err := http.NewRequest("GET", urls, body)
  14776. if err != nil {
  14777. return nil, err
  14778. }
  14779. req.Header = reqHeaders
  14780. googleapi.Expand(req.URL, map[string]string{
  14781. "filterSetName": c.filterSetName,
  14782. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  14783. })
  14784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14785. }
  14786. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list" call.
  14787. // Exactly one of *ListCreativeStatusBreakdownByCreativeResponse or
  14788. // error will be non-nil. Any non-2xx status code is an error. Response
  14789. // headers are in either
  14790. // *ListCreativeStatusBreakdownByCreativeResponse.ServerResponse.Header
  14791. // or (if a response was returned at all) in
  14792. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14793. // whether the returned error was because http.StatusNotModified was
  14794. // returned.
  14795. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByCreativeResponse, error) {
  14796. gensupport.SetOptions(c.urlParams_, opts...)
  14797. res, err := c.doRequest("json")
  14798. if res != nil && res.StatusCode == http.StatusNotModified {
  14799. if res.Body != nil {
  14800. res.Body.Close()
  14801. }
  14802. return nil, &googleapi.Error{
  14803. Code: res.StatusCode,
  14804. Header: res.Header,
  14805. }
  14806. }
  14807. if err != nil {
  14808. return nil, err
  14809. }
  14810. defer googleapi.CloseBody(res)
  14811. if err := googleapi.CheckResponse(res); err != nil {
  14812. return nil, err
  14813. }
  14814. ret := &ListCreativeStatusBreakdownByCreativeResponse{
  14815. ServerResponse: googleapi.ServerResponse{
  14816. Header: res.Header,
  14817. HTTPStatusCode: res.StatusCode,
  14818. },
  14819. }
  14820. target := &ret
  14821. if err := gensupport.DecodeResponse(target, res); err != nil {
  14822. return nil, err
  14823. }
  14824. return ret, nil
  14825. // {
  14826. // "description": "List all creatives associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each creative.",
  14827. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/creatives",
  14828. // "httpMethod": "GET",
  14829. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list",
  14830. // "parameterOrder": [
  14831. // "filterSetName",
  14832. // "creativeStatusId"
  14833. // ],
  14834. // "parameters": {
  14835. // "creativeStatusId": {
  14836. // "description": "The ID of the creative status for which to retrieve a breakdown by\ncreative.\nSee\n[creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes).",
  14837. // "format": "int32",
  14838. // "location": "path",
  14839. // "required": true,
  14840. // "type": "integer"
  14841. // },
  14842. // "filterSetName": {
  14843. // "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`",
  14844. // "location": "path",
  14845. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  14846. // "required": true,
  14847. // "type": "string"
  14848. // },
  14849. // "pageSize": {
  14850. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  14851. // "format": "int32",
  14852. // "location": "query",
  14853. // "type": "integer"
  14854. // },
  14855. // "pageToken": {
  14856. // "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.",
  14857. // "location": "query",
  14858. // "type": "string"
  14859. // }
  14860. // },
  14861. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives",
  14862. // "response": {
  14863. // "$ref": "ListCreativeStatusBreakdownByCreativeResponse"
  14864. // },
  14865. // "scopes": [
  14866. // "https://www.googleapis.com/auth/adexchange.buyer"
  14867. // ]
  14868. // }
  14869. }
  14870. // Pages invokes f for each page of results.
  14871. // A non-nil error returned from f will halt the iteration.
  14872. // The provided context supersedes any context provided to the Context method.
  14873. func (c *BiddersFilterSetsFilteredBidsCreativesListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByCreativeResponse) error) error {
  14874. c.ctx_ = ctx
  14875. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14876. for {
  14877. x, err := c.Do()
  14878. if err != nil {
  14879. return err
  14880. }
  14881. if err := f(x); err != nil {
  14882. return err
  14883. }
  14884. if x.NextPageToken == "" {
  14885. return nil
  14886. }
  14887. c.PageToken(x.NextPageToken)
  14888. }
  14889. }
  14890. // method id "adexchangebuyer2.bidders.filterSets.filteredBids.details.list":
  14891. type BiddersFilterSetsFilteredBidsDetailsListCall struct {
  14892. s *Service
  14893. filterSetName string
  14894. creativeStatusId int64
  14895. urlParams_ gensupport.URLParams
  14896. ifNoneMatch_ string
  14897. ctx_ context.Context
  14898. header_ http.Header
  14899. }
  14900. // List: List all details associated with a specific reason for which
  14901. // bids were
  14902. // filtered, with the number of bids filtered for each detail.
  14903. func (r *BiddersFilterSetsFilteredBidsDetailsService) List(filterSetName string, creativeStatusId int64) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14904. c := &BiddersFilterSetsFilteredBidsDetailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14905. c.filterSetName = filterSetName
  14906. c.creativeStatusId = creativeStatusId
  14907. return c
  14908. }
  14909. // PageSize sets the optional parameter "pageSize": Requested page size.
  14910. // The server may return fewer results than requested.
  14911. // If unspecified, the server will pick an appropriate default.
  14912. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) PageSize(pageSize int64) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14913. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  14914. return c
  14915. }
  14916. // PageToken sets the optional parameter "pageToken": A token
  14917. // identifying a page of results the server should return.
  14918. // Typically, this is the value
  14919. // of
  14920. // ListCreativeStatusBreakdownByDetailResponse.nextPageToken
  14921. // returned from the previous call to the
  14922. // filteredBids.details.list
  14923. // method.
  14924. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) PageToken(pageToken string) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14925. c.urlParams_.Set("pageToken", pageToken)
  14926. return c
  14927. }
  14928. // Fields allows partial responses to be retrieved. See
  14929. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14930. // for more information.
  14931. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14932. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14933. return c
  14934. }
  14935. // IfNoneMatch sets the optional parameter which makes the operation
  14936. // fail if the object's ETag matches the given value. This is useful for
  14937. // getting updates only after the object has changed since the last
  14938. // request. Use googleapi.IsNotModified to check whether the response
  14939. // error from Do is the result of In-None-Match.
  14940. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14941. c.ifNoneMatch_ = entityTag
  14942. return c
  14943. }
  14944. // Context sets the context to be used in this call's Do method. Any
  14945. // pending HTTP request will be aborted if the provided context is
  14946. // canceled.
  14947. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Context(ctx context.Context) *BiddersFilterSetsFilteredBidsDetailsListCall {
  14948. c.ctx_ = ctx
  14949. return c
  14950. }
  14951. // Header returns an http.Header that can be modified by the caller to
  14952. // add HTTP headers to the request.
  14953. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Header() http.Header {
  14954. if c.header_ == nil {
  14955. c.header_ = make(http.Header)
  14956. }
  14957. return c.header_
  14958. }
  14959. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) doRequest(alt string) (*http.Response, error) {
  14960. reqHeaders := make(http.Header)
  14961. for k, v := range c.header_ {
  14962. reqHeaders[k] = v
  14963. }
  14964. reqHeaders.Set("User-Agent", c.s.userAgent())
  14965. if c.ifNoneMatch_ != "" {
  14966. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14967. }
  14968. var body io.Reader = nil
  14969. c.urlParams_.Set("alt", alt)
  14970. c.urlParams_.Set("prettyPrint", "false")
  14971. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details")
  14972. urls += "?" + c.urlParams_.Encode()
  14973. req, err := http.NewRequest("GET", urls, body)
  14974. if err != nil {
  14975. return nil, err
  14976. }
  14977. req.Header = reqHeaders
  14978. googleapi.Expand(req.URL, map[string]string{
  14979. "filterSetName": c.filterSetName,
  14980. "creativeStatusId": strconv.FormatInt(c.creativeStatusId, 10),
  14981. })
  14982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14983. }
  14984. // Do executes the "adexchangebuyer2.bidders.filterSets.filteredBids.details.list" call.
  14985. // Exactly one of *ListCreativeStatusBreakdownByDetailResponse or error
  14986. // will be non-nil. Any non-2xx status code is an error. Response
  14987. // headers are in either
  14988. // *ListCreativeStatusBreakdownByDetailResponse.ServerResponse.Header or
  14989. // (if a response was returned at all) in
  14990. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14991. // whether the returned error was because http.StatusNotModified was
  14992. // returned.
  14993. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Do(opts ...googleapi.CallOption) (*ListCreativeStatusBreakdownByDetailResponse, error) {
  14994. gensupport.SetOptions(c.urlParams_, opts...)
  14995. res, err := c.doRequest("json")
  14996. if res != nil && res.StatusCode == http.StatusNotModified {
  14997. if res.Body != nil {
  14998. res.Body.Close()
  14999. }
  15000. return nil, &googleapi.Error{
  15001. Code: res.StatusCode,
  15002. Header: res.Header,
  15003. }
  15004. }
  15005. if err != nil {
  15006. return nil, err
  15007. }
  15008. defer googleapi.CloseBody(res)
  15009. if err := googleapi.CheckResponse(res); err != nil {
  15010. return nil, err
  15011. }
  15012. ret := &ListCreativeStatusBreakdownByDetailResponse{
  15013. ServerResponse: googleapi.ServerResponse{
  15014. Header: res.Header,
  15015. HTTPStatusCode: res.StatusCode,
  15016. },
  15017. }
  15018. target := &ret
  15019. if err := gensupport.DecodeResponse(target, res); err != nil {
  15020. return nil, err
  15021. }
  15022. return ret, nil
  15023. // {
  15024. // "description": "List all details associated with a specific reason for which bids were\nfiltered, with the number of bids filtered for each detail.",
  15025. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/filteredBids/{creativeStatusId}/details",
  15026. // "httpMethod": "GET",
  15027. // "id": "adexchangebuyer2.bidders.filterSets.filteredBids.details.list",
  15028. // "parameterOrder": [
  15029. // "filterSetName",
  15030. // "creativeStatusId"
  15031. // ],
  15032. // "parameters": {
  15033. // "creativeStatusId": {
  15034. // "description": "The ID of the creative status for which to retrieve a breakdown by detail.\nSee\n[creative-status-codes](https://developers.google.com/authorized-buyers/rtb/downloads/creative-status-codes).\nDetails are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87.",
  15035. // "format": "int32",
  15036. // "location": "path",
  15037. // "required": true,
  15038. // "type": "integer"
  15039. // },
  15040. // "filterSetName": {
  15041. // "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`",
  15042. // "location": "path",
  15043. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  15044. // "required": true,
  15045. // "type": "string"
  15046. // },
  15047. // "pageSize": {
  15048. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  15049. // "format": "int32",
  15050. // "location": "query",
  15051. // "type": "integer"
  15052. // },
  15053. // "pageToken": {
  15054. // "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.",
  15055. // "location": "query",
  15056. // "type": "string"
  15057. // }
  15058. // },
  15059. // "path": "v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details",
  15060. // "response": {
  15061. // "$ref": "ListCreativeStatusBreakdownByDetailResponse"
  15062. // },
  15063. // "scopes": [
  15064. // "https://www.googleapis.com/auth/adexchange.buyer"
  15065. // ]
  15066. // }
  15067. }
  15068. // Pages invokes f for each page of results.
  15069. // A non-nil error returned from f will halt the iteration.
  15070. // The provided context supersedes any context provided to the Context method.
  15071. func (c *BiddersFilterSetsFilteredBidsDetailsListCall) Pages(ctx context.Context, f func(*ListCreativeStatusBreakdownByDetailResponse) error) error {
  15072. c.ctx_ = ctx
  15073. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15074. for {
  15075. x, err := c.Do()
  15076. if err != nil {
  15077. return err
  15078. }
  15079. if err := f(x); err != nil {
  15080. return err
  15081. }
  15082. if x.NextPageToken == "" {
  15083. return nil
  15084. }
  15085. c.PageToken(x.NextPageToken)
  15086. }
  15087. }
  15088. // method id "adexchangebuyer2.bidders.filterSets.impressionMetrics.list":
  15089. type BiddersFilterSetsImpressionMetricsListCall struct {
  15090. s *Service
  15091. filterSetName string
  15092. urlParams_ gensupport.URLParams
  15093. ifNoneMatch_ string
  15094. ctx_ context.Context
  15095. header_ http.Header
  15096. }
  15097. // List: Lists all metrics that are measured in terms of number of
  15098. // impressions.
  15099. func (r *BiddersFilterSetsImpressionMetricsService) List(filterSetName string) *BiddersFilterSetsImpressionMetricsListCall {
  15100. c := &BiddersFilterSetsImpressionMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15101. c.filterSetName = filterSetName
  15102. return c
  15103. }
  15104. // PageSize sets the optional parameter "pageSize": Requested page size.
  15105. // The server may return fewer results than requested.
  15106. // If unspecified, the server will pick an appropriate default.
  15107. func (c *BiddersFilterSetsImpressionMetricsListCall) PageSize(pageSize int64) *BiddersFilterSetsImpressionMetricsListCall {
  15108. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  15109. return c
  15110. }
  15111. // PageToken sets the optional parameter "pageToken": A token
  15112. // identifying a page of results the server should return.
  15113. // Typically, this is the value
  15114. // of
  15115. // ListImpressionMetricsResponse.nextPageToken
  15116. // returned from the previous call to the impressionMetrics.list
  15117. // method.
  15118. func (c *BiddersFilterSetsImpressionMetricsListCall) PageToken(pageToken string) *BiddersFilterSetsImpressionMetricsListCall {
  15119. c.urlParams_.Set("pageToken", pageToken)
  15120. return c
  15121. }
  15122. // Fields allows partial responses to be retrieved. See
  15123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15124. // for more information.
  15125. func (c *BiddersFilterSetsImpressionMetricsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsImpressionMetricsListCall {
  15126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15127. return c
  15128. }
  15129. // IfNoneMatch sets the optional parameter which makes the operation
  15130. // fail if the object's ETag matches the given value. This is useful for
  15131. // getting updates only after the object has changed since the last
  15132. // request. Use googleapi.IsNotModified to check whether the response
  15133. // error from Do is the result of In-None-Match.
  15134. func (c *BiddersFilterSetsImpressionMetricsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsImpressionMetricsListCall {
  15135. c.ifNoneMatch_ = entityTag
  15136. return c
  15137. }
  15138. // Context sets the context to be used in this call's Do method. Any
  15139. // pending HTTP request will be aborted if the provided context is
  15140. // canceled.
  15141. func (c *BiddersFilterSetsImpressionMetricsListCall) Context(ctx context.Context) *BiddersFilterSetsImpressionMetricsListCall {
  15142. c.ctx_ = ctx
  15143. return c
  15144. }
  15145. // Header returns an http.Header that can be modified by the caller to
  15146. // add HTTP headers to the request.
  15147. func (c *BiddersFilterSetsImpressionMetricsListCall) Header() http.Header {
  15148. if c.header_ == nil {
  15149. c.header_ = make(http.Header)
  15150. }
  15151. return c.header_
  15152. }
  15153. func (c *BiddersFilterSetsImpressionMetricsListCall) doRequest(alt string) (*http.Response, error) {
  15154. reqHeaders := make(http.Header)
  15155. for k, v := range c.header_ {
  15156. reqHeaders[k] = v
  15157. }
  15158. reqHeaders.Set("User-Agent", c.s.userAgent())
  15159. if c.ifNoneMatch_ != "" {
  15160. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15161. }
  15162. var body io.Reader = nil
  15163. c.urlParams_.Set("alt", alt)
  15164. c.urlParams_.Set("prettyPrint", "false")
  15165. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/impressionMetrics")
  15166. urls += "?" + c.urlParams_.Encode()
  15167. req, err := http.NewRequest("GET", urls, body)
  15168. if err != nil {
  15169. return nil, err
  15170. }
  15171. req.Header = reqHeaders
  15172. googleapi.Expand(req.URL, map[string]string{
  15173. "filterSetName": c.filterSetName,
  15174. })
  15175. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15176. }
  15177. // Do executes the "adexchangebuyer2.bidders.filterSets.impressionMetrics.list" call.
  15178. // Exactly one of *ListImpressionMetricsResponse or error will be
  15179. // non-nil. Any non-2xx status code is an error. Response headers are in
  15180. // either *ListImpressionMetricsResponse.ServerResponse.Header or (if a
  15181. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15182. // googleapi.IsNotModified to check whether the returned error was
  15183. // because http.StatusNotModified was returned.
  15184. func (c *BiddersFilterSetsImpressionMetricsListCall) Do(opts ...googleapi.CallOption) (*ListImpressionMetricsResponse, error) {
  15185. gensupport.SetOptions(c.urlParams_, opts...)
  15186. res, err := c.doRequest("json")
  15187. if res != nil && res.StatusCode == http.StatusNotModified {
  15188. if res.Body != nil {
  15189. res.Body.Close()
  15190. }
  15191. return nil, &googleapi.Error{
  15192. Code: res.StatusCode,
  15193. Header: res.Header,
  15194. }
  15195. }
  15196. if err != nil {
  15197. return nil, err
  15198. }
  15199. defer googleapi.CloseBody(res)
  15200. if err := googleapi.CheckResponse(res); err != nil {
  15201. return nil, err
  15202. }
  15203. ret := &ListImpressionMetricsResponse{
  15204. ServerResponse: googleapi.ServerResponse{
  15205. Header: res.Header,
  15206. HTTPStatusCode: res.StatusCode,
  15207. },
  15208. }
  15209. target := &ret
  15210. if err := gensupport.DecodeResponse(target, res); err != nil {
  15211. return nil, err
  15212. }
  15213. return ret, nil
  15214. // {
  15215. // "description": "Lists all metrics that are measured in terms of number of impressions.",
  15216. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/impressionMetrics",
  15217. // "httpMethod": "GET",
  15218. // "id": "adexchangebuyer2.bidders.filterSets.impressionMetrics.list",
  15219. // "parameterOrder": [
  15220. // "filterSetName"
  15221. // ],
  15222. // "parameters": {
  15223. // "filterSetName": {
  15224. // "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`",
  15225. // "location": "path",
  15226. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  15227. // "required": true,
  15228. // "type": "string"
  15229. // },
  15230. // "pageSize": {
  15231. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  15232. // "format": "int32",
  15233. // "location": "query",
  15234. // "type": "integer"
  15235. // },
  15236. // "pageToken": {
  15237. // "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.",
  15238. // "location": "query",
  15239. // "type": "string"
  15240. // }
  15241. // },
  15242. // "path": "v2beta1/{+filterSetName}/impressionMetrics",
  15243. // "response": {
  15244. // "$ref": "ListImpressionMetricsResponse"
  15245. // },
  15246. // "scopes": [
  15247. // "https://www.googleapis.com/auth/adexchange.buyer"
  15248. // ]
  15249. // }
  15250. }
  15251. // Pages invokes f for each page of results.
  15252. // A non-nil error returned from f will halt the iteration.
  15253. // The provided context supersedes any context provided to the Context method.
  15254. func (c *BiddersFilterSetsImpressionMetricsListCall) Pages(ctx context.Context, f func(*ListImpressionMetricsResponse) error) error {
  15255. c.ctx_ = ctx
  15256. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15257. for {
  15258. x, err := c.Do()
  15259. if err != nil {
  15260. return err
  15261. }
  15262. if err := f(x); err != nil {
  15263. return err
  15264. }
  15265. if x.NextPageToken == "" {
  15266. return nil
  15267. }
  15268. c.PageToken(x.NextPageToken)
  15269. }
  15270. }
  15271. // method id "adexchangebuyer2.bidders.filterSets.losingBids.list":
  15272. type BiddersFilterSetsLosingBidsListCall struct {
  15273. s *Service
  15274. filterSetName string
  15275. urlParams_ gensupport.URLParams
  15276. ifNoneMatch_ string
  15277. ctx_ context.Context
  15278. header_ http.Header
  15279. }
  15280. // List: List all reasons for which bids lost in the auction, with the
  15281. // number of
  15282. // bids that lost for each reason.
  15283. func (r *BiddersFilterSetsLosingBidsService) List(filterSetName string) *BiddersFilterSetsLosingBidsListCall {
  15284. c := &BiddersFilterSetsLosingBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15285. c.filterSetName = filterSetName
  15286. return c
  15287. }
  15288. // PageSize sets the optional parameter "pageSize": Requested page size.
  15289. // The server may return fewer results than requested.
  15290. // If unspecified, the server will pick an appropriate default.
  15291. func (c *BiddersFilterSetsLosingBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsLosingBidsListCall {
  15292. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  15293. return c
  15294. }
  15295. // PageToken sets the optional parameter "pageToken": A token
  15296. // identifying a page of results the server should return.
  15297. // Typically, this is the value
  15298. // of
  15299. // ListLosingBidsResponse.nextPageToken
  15300. // returned from the previous call to the losingBids.list
  15301. // method.
  15302. func (c *BiddersFilterSetsLosingBidsListCall) PageToken(pageToken string) *BiddersFilterSetsLosingBidsListCall {
  15303. c.urlParams_.Set("pageToken", pageToken)
  15304. return c
  15305. }
  15306. // Fields allows partial responses to be retrieved. See
  15307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15308. // for more information.
  15309. func (c *BiddersFilterSetsLosingBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsLosingBidsListCall {
  15310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15311. return c
  15312. }
  15313. // IfNoneMatch sets the optional parameter which makes the operation
  15314. // fail if the object's ETag matches the given value. This is useful for
  15315. // getting updates only after the object has changed since the last
  15316. // request. Use googleapi.IsNotModified to check whether the response
  15317. // error from Do is the result of In-None-Match.
  15318. func (c *BiddersFilterSetsLosingBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsLosingBidsListCall {
  15319. c.ifNoneMatch_ = entityTag
  15320. return c
  15321. }
  15322. // Context sets the context to be used in this call's Do method. Any
  15323. // pending HTTP request will be aborted if the provided context is
  15324. // canceled.
  15325. func (c *BiddersFilterSetsLosingBidsListCall) Context(ctx context.Context) *BiddersFilterSetsLosingBidsListCall {
  15326. c.ctx_ = ctx
  15327. return c
  15328. }
  15329. // Header returns an http.Header that can be modified by the caller to
  15330. // add HTTP headers to the request.
  15331. func (c *BiddersFilterSetsLosingBidsListCall) Header() http.Header {
  15332. if c.header_ == nil {
  15333. c.header_ = make(http.Header)
  15334. }
  15335. return c.header_
  15336. }
  15337. func (c *BiddersFilterSetsLosingBidsListCall) doRequest(alt string) (*http.Response, error) {
  15338. reqHeaders := make(http.Header)
  15339. for k, v := range c.header_ {
  15340. reqHeaders[k] = v
  15341. }
  15342. reqHeaders.Set("User-Agent", c.s.userAgent())
  15343. if c.ifNoneMatch_ != "" {
  15344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15345. }
  15346. var body io.Reader = nil
  15347. c.urlParams_.Set("alt", alt)
  15348. c.urlParams_.Set("prettyPrint", "false")
  15349. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/losingBids")
  15350. urls += "?" + c.urlParams_.Encode()
  15351. req, err := http.NewRequest("GET", urls, body)
  15352. if err != nil {
  15353. return nil, err
  15354. }
  15355. req.Header = reqHeaders
  15356. googleapi.Expand(req.URL, map[string]string{
  15357. "filterSetName": c.filterSetName,
  15358. })
  15359. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15360. }
  15361. // Do executes the "adexchangebuyer2.bidders.filterSets.losingBids.list" call.
  15362. // Exactly one of *ListLosingBidsResponse or error will be non-nil. Any
  15363. // non-2xx status code is an error. Response headers are in either
  15364. // *ListLosingBidsResponse.ServerResponse.Header or (if a response was
  15365. // returned at all) in error.(*googleapi.Error).Header. Use
  15366. // googleapi.IsNotModified to check whether the returned error was
  15367. // because http.StatusNotModified was returned.
  15368. func (c *BiddersFilterSetsLosingBidsListCall) Do(opts ...googleapi.CallOption) (*ListLosingBidsResponse, error) {
  15369. gensupport.SetOptions(c.urlParams_, opts...)
  15370. res, err := c.doRequest("json")
  15371. if res != nil && res.StatusCode == http.StatusNotModified {
  15372. if res.Body != nil {
  15373. res.Body.Close()
  15374. }
  15375. return nil, &googleapi.Error{
  15376. Code: res.StatusCode,
  15377. Header: res.Header,
  15378. }
  15379. }
  15380. if err != nil {
  15381. return nil, err
  15382. }
  15383. defer googleapi.CloseBody(res)
  15384. if err := googleapi.CheckResponse(res); err != nil {
  15385. return nil, err
  15386. }
  15387. ret := &ListLosingBidsResponse{
  15388. ServerResponse: googleapi.ServerResponse{
  15389. Header: res.Header,
  15390. HTTPStatusCode: res.StatusCode,
  15391. },
  15392. }
  15393. target := &ret
  15394. if err := gensupport.DecodeResponse(target, res); err != nil {
  15395. return nil, err
  15396. }
  15397. return ret, nil
  15398. // {
  15399. // "description": "List all reasons for which bids lost in the auction, with the number of\nbids that lost for each reason.",
  15400. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/losingBids",
  15401. // "httpMethod": "GET",
  15402. // "id": "adexchangebuyer2.bidders.filterSets.losingBids.list",
  15403. // "parameterOrder": [
  15404. // "filterSetName"
  15405. // ],
  15406. // "parameters": {
  15407. // "filterSetName": {
  15408. // "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`",
  15409. // "location": "path",
  15410. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  15411. // "required": true,
  15412. // "type": "string"
  15413. // },
  15414. // "pageSize": {
  15415. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  15416. // "format": "int32",
  15417. // "location": "query",
  15418. // "type": "integer"
  15419. // },
  15420. // "pageToken": {
  15421. // "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.",
  15422. // "location": "query",
  15423. // "type": "string"
  15424. // }
  15425. // },
  15426. // "path": "v2beta1/{+filterSetName}/losingBids",
  15427. // "response": {
  15428. // "$ref": "ListLosingBidsResponse"
  15429. // },
  15430. // "scopes": [
  15431. // "https://www.googleapis.com/auth/adexchange.buyer"
  15432. // ]
  15433. // }
  15434. }
  15435. // Pages invokes f for each page of results.
  15436. // A non-nil error returned from f will halt the iteration.
  15437. // The provided context supersedes any context provided to the Context method.
  15438. func (c *BiddersFilterSetsLosingBidsListCall) Pages(ctx context.Context, f func(*ListLosingBidsResponse) error) error {
  15439. c.ctx_ = ctx
  15440. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15441. for {
  15442. x, err := c.Do()
  15443. if err != nil {
  15444. return err
  15445. }
  15446. if err := f(x); err != nil {
  15447. return err
  15448. }
  15449. if x.NextPageToken == "" {
  15450. return nil
  15451. }
  15452. c.PageToken(x.NextPageToken)
  15453. }
  15454. }
  15455. // method id "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list":
  15456. type BiddersFilterSetsNonBillableWinningBidsListCall struct {
  15457. s *Service
  15458. filterSetName string
  15459. urlParams_ gensupport.URLParams
  15460. ifNoneMatch_ string
  15461. ctx_ context.Context
  15462. header_ http.Header
  15463. }
  15464. // List: List all reasons for which winning bids were not billable, with
  15465. // the number
  15466. // of bids not billed for each reason.
  15467. func (r *BiddersFilterSetsNonBillableWinningBidsService) List(filterSetName string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15468. c := &BiddersFilterSetsNonBillableWinningBidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15469. c.filterSetName = filterSetName
  15470. return c
  15471. }
  15472. // PageSize sets the optional parameter "pageSize": Requested page size.
  15473. // The server may return fewer results than requested.
  15474. // If unspecified, the server will pick an appropriate default.
  15475. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) PageSize(pageSize int64) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15476. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  15477. return c
  15478. }
  15479. // PageToken sets the optional parameter "pageToken": A token
  15480. // identifying a page of results the server should return.
  15481. // Typically, this is the value
  15482. // of
  15483. // ListNonBillableWinningBidsResponse.nextPageToken
  15484. // returned from the previous call to the
  15485. // nonBillableWinningBids.list
  15486. // method.
  15487. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) PageToken(pageToken string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15488. c.urlParams_.Set("pageToken", pageToken)
  15489. return c
  15490. }
  15491. // Fields allows partial responses to be retrieved. See
  15492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15493. // for more information.
  15494. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Fields(s ...googleapi.Field) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15496. return c
  15497. }
  15498. // IfNoneMatch sets the optional parameter which makes the operation
  15499. // fail if the object's ETag matches the given value. This is useful for
  15500. // getting updates only after the object has changed since the last
  15501. // request. Use googleapi.IsNotModified to check whether the response
  15502. // error from Do is the result of In-None-Match.
  15503. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) IfNoneMatch(entityTag string) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15504. c.ifNoneMatch_ = entityTag
  15505. return c
  15506. }
  15507. // Context sets the context to be used in this call's Do method. Any
  15508. // pending HTTP request will be aborted if the provided context is
  15509. // canceled.
  15510. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Context(ctx context.Context) *BiddersFilterSetsNonBillableWinningBidsListCall {
  15511. c.ctx_ = ctx
  15512. return c
  15513. }
  15514. // Header returns an http.Header that can be modified by the caller to
  15515. // add HTTP headers to the request.
  15516. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Header() http.Header {
  15517. if c.header_ == nil {
  15518. c.header_ = make(http.Header)
  15519. }
  15520. return c.header_
  15521. }
  15522. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) doRequest(alt string) (*http.Response, error) {
  15523. reqHeaders := make(http.Header)
  15524. for k, v := range c.header_ {
  15525. reqHeaders[k] = v
  15526. }
  15527. reqHeaders.Set("User-Agent", c.s.userAgent())
  15528. if c.ifNoneMatch_ != "" {
  15529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15530. }
  15531. var body io.Reader = nil
  15532. c.urlParams_.Set("alt", alt)
  15533. c.urlParams_.Set("prettyPrint", "false")
  15534. urls := googleapi.ResolveRelative(c.s.BasePath, "v2beta1/{+filterSetName}/nonBillableWinningBids")
  15535. urls += "?" + c.urlParams_.Encode()
  15536. req, err := http.NewRequest("GET", urls, body)
  15537. if err != nil {
  15538. return nil, err
  15539. }
  15540. req.Header = reqHeaders
  15541. googleapi.Expand(req.URL, map[string]string{
  15542. "filterSetName": c.filterSetName,
  15543. })
  15544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15545. }
  15546. // Do executes the "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list" call.
  15547. // Exactly one of *ListNonBillableWinningBidsResponse or error will be
  15548. // non-nil. Any non-2xx status code is an error. Response headers are in
  15549. // either *ListNonBillableWinningBidsResponse.ServerResponse.Header or
  15550. // (if a response was returned at all) in
  15551. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15552. // whether the returned error was because http.StatusNotModified was
  15553. // returned.
  15554. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Do(opts ...googleapi.CallOption) (*ListNonBillableWinningBidsResponse, error) {
  15555. gensupport.SetOptions(c.urlParams_, opts...)
  15556. res, err := c.doRequest("json")
  15557. if res != nil && res.StatusCode == http.StatusNotModified {
  15558. if res.Body != nil {
  15559. res.Body.Close()
  15560. }
  15561. return nil, &googleapi.Error{
  15562. Code: res.StatusCode,
  15563. Header: res.Header,
  15564. }
  15565. }
  15566. if err != nil {
  15567. return nil, err
  15568. }
  15569. defer googleapi.CloseBody(res)
  15570. if err := googleapi.CheckResponse(res); err != nil {
  15571. return nil, err
  15572. }
  15573. ret := &ListNonBillableWinningBidsResponse{
  15574. ServerResponse: googleapi.ServerResponse{
  15575. Header: res.Header,
  15576. HTTPStatusCode: res.StatusCode,
  15577. },
  15578. }
  15579. target := &ret
  15580. if err := gensupport.DecodeResponse(target, res); err != nil {
  15581. return nil, err
  15582. }
  15583. return ret, nil
  15584. // {
  15585. // "description": "List all reasons for which winning bids were not billable, with the number\nof bids not billed for each reason.",
  15586. // "flatPath": "v2beta1/bidders/{biddersId}/filterSets/{filterSetsId}/nonBillableWinningBids",
  15587. // "httpMethod": "GET",
  15588. // "id": "adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list",
  15589. // "parameterOrder": [
  15590. // "filterSetName"
  15591. // ],
  15592. // "parameters": {
  15593. // "filterSetName": {
  15594. // "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`",
  15595. // "location": "path",
  15596. // "pattern": "^bidders/[^/]+/filterSets/[^/]+$",
  15597. // "required": true,
  15598. // "type": "string"
  15599. // },
  15600. // "pageSize": {
  15601. // "description": "Requested page size. The server may return fewer results than requested.\nIf unspecified, the server will pick an appropriate default.",
  15602. // "format": "int32",
  15603. // "location": "query",
  15604. // "type": "integer"
  15605. // },
  15606. // "pageToken": {
  15607. // "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.",
  15608. // "location": "query",
  15609. // "type": "string"
  15610. // }
  15611. // },
  15612. // "path": "v2beta1/{+filterSetName}/nonBillableWinningBids",
  15613. // "response": {
  15614. // "$ref": "ListNonBillableWinningBidsResponse"
  15615. // },
  15616. // "scopes": [
  15617. // "https://www.googleapis.com/auth/adexchange.buyer"
  15618. // ]
  15619. // }
  15620. }
  15621. // Pages invokes f for each page of results.
  15622. // A non-nil error returned from f will halt the iteration.
  15623. // The provided context supersedes any context provided to the Context method.
  15624. func (c *BiddersFilterSetsNonBillableWinningBidsListCall) Pages(ctx context.Context, f func(*ListNonBillableWinningBidsResponse) error) error {
  15625. c.ctx_ = ctx
  15626. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15627. for {
  15628. x, err := c.Do()
  15629. if err != nil {
  15630. return err
  15631. }
  15632. if err := f(x); err != nil {
  15633. return err
  15634. }
  15635. if x.NextPageToken == "" {
  15636. return nil
  15637. }
  15638. c.PageToken(x.NextPageToken)
  15639. }
  15640. }