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.
 
 
 

9423 lignes
333 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 adexchangebuyer provides access to the Ad Exchange Buyer API.
  6. //
  7. // For product documentation, see: https://developers.google.com/ad-exchange/buyer-rest
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/adexchangebuyer/v1.4"
  14. // ...
  15. // ctx := context.Background()
  16. // adexchangebuyerService, err := adexchangebuyer.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. // adexchangebuyerService, err := adexchangebuyer.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. // adexchangebuyerService, err := adexchangebuyer.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 adexchangebuyer // import "google.golang.org/api/adexchangebuyer/v1.4"
  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 = "adexchangebuyer:v1.4"
  67. const apiName = "adexchangebuyer"
  68. const apiVersion = "v1.4"
  69. const basePath = "https://www.googleapis.com/adexchangebuyer/v1.4/"
  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.BillingInfo = NewBillingInfoService(s)
  107. s.Budget = NewBudgetService(s)
  108. s.Creatives = NewCreativesService(s)
  109. s.Marketplacedeals = NewMarketplacedealsService(s)
  110. s.Marketplacenotes = NewMarketplacenotesService(s)
  111. s.Marketplaceprivateauction = NewMarketplaceprivateauctionService(s)
  112. s.PerformanceReport = NewPerformanceReportService(s)
  113. s.PretargetingConfig = NewPretargetingConfigService(s)
  114. s.Products = NewProductsService(s)
  115. s.Proposals = NewProposalsService(s)
  116. s.Pubprofiles = NewPubprofilesService(s)
  117. return s, nil
  118. }
  119. type Service struct {
  120. client *http.Client
  121. BasePath string // API endpoint base URL
  122. UserAgent string // optional additional User-Agent fragment
  123. Accounts *AccountsService
  124. BillingInfo *BillingInfoService
  125. Budget *BudgetService
  126. Creatives *CreativesService
  127. Marketplacedeals *MarketplacedealsService
  128. Marketplacenotes *MarketplacenotesService
  129. Marketplaceprivateauction *MarketplaceprivateauctionService
  130. PerformanceReport *PerformanceReportService
  131. PretargetingConfig *PretargetingConfigService
  132. Products *ProductsService
  133. Proposals *ProposalsService
  134. Pubprofiles *PubprofilesService
  135. }
  136. func (s *Service) userAgent() string {
  137. if s.UserAgent == "" {
  138. return googleapi.UserAgent
  139. }
  140. return googleapi.UserAgent + " " + s.UserAgent
  141. }
  142. func NewAccountsService(s *Service) *AccountsService {
  143. rs := &AccountsService{s: s}
  144. return rs
  145. }
  146. type AccountsService struct {
  147. s *Service
  148. }
  149. func NewBillingInfoService(s *Service) *BillingInfoService {
  150. rs := &BillingInfoService{s: s}
  151. return rs
  152. }
  153. type BillingInfoService struct {
  154. s *Service
  155. }
  156. func NewBudgetService(s *Service) *BudgetService {
  157. rs := &BudgetService{s: s}
  158. return rs
  159. }
  160. type BudgetService struct {
  161. s *Service
  162. }
  163. func NewCreativesService(s *Service) *CreativesService {
  164. rs := &CreativesService{s: s}
  165. return rs
  166. }
  167. type CreativesService struct {
  168. s *Service
  169. }
  170. func NewMarketplacedealsService(s *Service) *MarketplacedealsService {
  171. rs := &MarketplacedealsService{s: s}
  172. return rs
  173. }
  174. type MarketplacedealsService struct {
  175. s *Service
  176. }
  177. func NewMarketplacenotesService(s *Service) *MarketplacenotesService {
  178. rs := &MarketplacenotesService{s: s}
  179. return rs
  180. }
  181. type MarketplacenotesService struct {
  182. s *Service
  183. }
  184. func NewMarketplaceprivateauctionService(s *Service) *MarketplaceprivateauctionService {
  185. rs := &MarketplaceprivateauctionService{s: s}
  186. return rs
  187. }
  188. type MarketplaceprivateauctionService struct {
  189. s *Service
  190. }
  191. func NewPerformanceReportService(s *Service) *PerformanceReportService {
  192. rs := &PerformanceReportService{s: s}
  193. return rs
  194. }
  195. type PerformanceReportService struct {
  196. s *Service
  197. }
  198. func NewPretargetingConfigService(s *Service) *PretargetingConfigService {
  199. rs := &PretargetingConfigService{s: s}
  200. return rs
  201. }
  202. type PretargetingConfigService struct {
  203. s *Service
  204. }
  205. func NewProductsService(s *Service) *ProductsService {
  206. rs := &ProductsService{s: s}
  207. return rs
  208. }
  209. type ProductsService struct {
  210. s *Service
  211. }
  212. func NewProposalsService(s *Service) *ProposalsService {
  213. rs := &ProposalsService{s: s}
  214. return rs
  215. }
  216. type ProposalsService struct {
  217. s *Service
  218. }
  219. func NewPubprofilesService(s *Service) *PubprofilesService {
  220. rs := &PubprofilesService{s: s}
  221. return rs
  222. }
  223. type PubprofilesService struct {
  224. s *Service
  225. }
  226. // Account: Configuration data for an Ad Exchange buyer account.
  227. type Account struct {
  228. // ApplyPretargetingToNonGuaranteedDeals: When this is false, bid
  229. // requests that include a deal ID for a private auction or preferred
  230. // deal are always sent to your bidder. When true, all active
  231. // pretargeting configs will be applied to private auctions and
  232. // preferred deals. Programmatic Guaranteed deals (when enabled) are
  233. // always sent to your bidder.
  234. ApplyPretargetingToNonGuaranteedDeals bool `json:"applyPretargetingToNonGuaranteedDeals,omitempty"`
  235. // BidderLocation: Your bidder locations that have distinct URLs.
  236. BidderLocation []*AccountBidderLocation `json:"bidderLocation,omitempty"`
  237. // CookieMatchingNid: The nid parameter value used in cookie match
  238. // requests. Please contact your technical account manager if you need
  239. // to change this.
  240. CookieMatchingNid string `json:"cookieMatchingNid,omitempty"`
  241. // CookieMatchingUrl: The base URL used in cookie match requests.
  242. CookieMatchingUrl string `json:"cookieMatchingUrl,omitempty"`
  243. // Id: Account id.
  244. Id int64 `json:"id,omitempty"`
  245. // Kind: Resource type.
  246. Kind string `json:"kind,omitempty"`
  247. // MaximumActiveCreatives: The maximum number of active creatives that
  248. // an account can have, where a creative is active if it was inserted or
  249. // bid with in the last 30 days. Please contact your technical account
  250. // manager if you need to change this.
  251. MaximumActiveCreatives int64 `json:"maximumActiveCreatives,omitempty"`
  252. // MaximumTotalQps: The sum of all bidderLocation.maximumQps values
  253. // cannot exceed this. Please contact your technical account manager if
  254. // you need to change this.
  255. MaximumTotalQps int64 `json:"maximumTotalQps,omitempty"`
  256. // NumberActiveCreatives: The number of creatives that this account
  257. // inserted or bid with in the last 30 days.
  258. NumberActiveCreatives int64 `json:"numberActiveCreatives,omitempty"`
  259. // ServerResponse contains the HTTP response code and headers from the
  260. // server.
  261. googleapi.ServerResponse `json:"-"`
  262. // ForceSendFields is a list of field names (e.g.
  263. // "ApplyPretargetingToNonGuaranteedDeals") to unconditionally include
  264. // in API requests. By default, fields with empty values are omitted
  265. // from API requests. However, any non-pointer, non-interface field
  266. // appearing in ForceSendFields will be sent to the server regardless of
  267. // whether the field is empty or not. This may be used to include empty
  268. // fields in Patch requests.
  269. ForceSendFields []string `json:"-"`
  270. // NullFields is a list of field names (e.g.
  271. // "ApplyPretargetingToNonGuaranteedDeals") to include in API requests
  272. // with the JSON null value. By default, fields with empty values are
  273. // omitted from API requests. However, any field with an empty value
  274. // appearing in NullFields will be sent to the server as null. It is an
  275. // error if a field in this list has a non-empty value. This may be used
  276. // to include null fields in Patch requests.
  277. NullFields []string `json:"-"`
  278. }
  279. func (s *Account) MarshalJSON() ([]byte, error) {
  280. type NoMethod Account
  281. raw := NoMethod(*s)
  282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  283. }
  284. type AccountBidderLocation struct {
  285. // BidProtocol: The protocol that the bidder endpoint is using. OpenRTB
  286. // protocols with prefix PROTOCOL_OPENRTB_PROTOBUF use proto buffer,
  287. // otherwise use JSON. Allowed values:
  288. // - PROTOCOL_ADX
  289. // - PROTOCOL_OPENRTB_2_2
  290. // - PROTOCOL_OPENRTB_2_3
  291. // - PROTOCOL_OPENRTB_2_4
  292. // - PROTOCOL_OPENRTB_2_5
  293. // - PROTOCOL_OPENRTB_PROTOBUF_2_3
  294. // - PROTOCOL_OPENRTB_PROTOBUF_2_4
  295. // - PROTOCOL_OPENRTB_PROTOBUF_2_5
  296. BidProtocol string `json:"bidProtocol,omitempty"`
  297. // MaximumQps: The maximum queries per second the Ad Exchange will send.
  298. MaximumQps int64 `json:"maximumQps,omitempty"`
  299. // Region: The geographical region the Ad Exchange should send requests
  300. // from. Only used by some quota systems, but always setting the value
  301. // is recommended. Allowed values:
  302. // - ASIA
  303. // - EUROPE
  304. // - US_EAST
  305. // - US_WEST
  306. Region string `json:"region,omitempty"`
  307. // Url: The URL to which the Ad Exchange will send bid requests.
  308. Url string `json:"url,omitempty"`
  309. // ForceSendFields is a list of field names (e.g. "BidProtocol") to
  310. // unconditionally include in API requests. By default, fields with
  311. // empty values are omitted from API requests. However, any non-pointer,
  312. // non-interface field appearing in ForceSendFields will be sent to the
  313. // server regardless of whether the field is empty or not. This may be
  314. // used to include empty fields in Patch requests.
  315. ForceSendFields []string `json:"-"`
  316. // NullFields is a list of field names (e.g. "BidProtocol") to include
  317. // in API requests with the JSON null value. By default, fields with
  318. // empty values are omitted from API requests. However, any field with
  319. // an empty value appearing in NullFields will be sent to the server as
  320. // null. It is an error if a field in this list has a non-empty value.
  321. // This may be used to include null fields in Patch requests.
  322. NullFields []string `json:"-"`
  323. }
  324. func (s *AccountBidderLocation) MarshalJSON() ([]byte, error) {
  325. type NoMethod AccountBidderLocation
  326. raw := NoMethod(*s)
  327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  328. }
  329. // AccountsList: An account feed lists Ad Exchange buyer accounts that
  330. // the user has access to. Each entry in the feed corresponds to a
  331. // single buyer account.
  332. type AccountsList struct {
  333. // Items: A list of accounts.
  334. Items []*Account `json:"items,omitempty"`
  335. // Kind: Resource type.
  336. Kind string `json:"kind,omitempty"`
  337. // ServerResponse contains the HTTP response code and headers from the
  338. // server.
  339. googleapi.ServerResponse `json:"-"`
  340. // ForceSendFields is a list of field names (e.g. "Items") to
  341. // unconditionally include in API requests. By default, fields with
  342. // empty values are omitted from API requests. However, any non-pointer,
  343. // non-interface field appearing in ForceSendFields will be sent to the
  344. // server regardless of whether the field is empty or not. This may be
  345. // used to include empty fields in Patch requests.
  346. ForceSendFields []string `json:"-"`
  347. // NullFields is a list of field names (e.g. "Items") to include in API
  348. // requests with the JSON null value. By default, fields with empty
  349. // values are omitted from API requests. However, any field with an
  350. // empty value appearing in NullFields will be sent to the server as
  351. // null. It is an error if a field in this list has a non-empty value.
  352. // This may be used to include null fields in Patch requests.
  353. NullFields []string `json:"-"`
  354. }
  355. func (s *AccountsList) MarshalJSON() ([]byte, error) {
  356. type NoMethod AccountsList
  357. raw := NoMethod(*s)
  358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  359. }
  360. type AddOrderDealsRequest struct {
  361. // Deals: The list of deals to add
  362. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  363. // ProposalRevisionNumber: The last known proposal revision number.
  364. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  365. // UpdateAction: Indicates an optional action to take on the proposal
  366. UpdateAction string `json:"updateAction,omitempty"`
  367. // ForceSendFields is a list of field names (e.g. "Deals") to
  368. // unconditionally include in API requests. By default, fields with
  369. // empty values are omitted from API requests. However, any non-pointer,
  370. // non-interface field appearing in ForceSendFields will be sent to the
  371. // server regardless of whether the field is empty or not. This may be
  372. // used to include empty fields in Patch requests.
  373. ForceSendFields []string `json:"-"`
  374. // NullFields is a list of field names (e.g. "Deals") to include in API
  375. // requests with the JSON null value. By default, fields with empty
  376. // values are omitted from API requests. However, any field with an
  377. // empty value appearing in NullFields will be sent to the server as
  378. // null. It is an error if a field in this list has a non-empty value.
  379. // This may be used to include null fields in Patch requests.
  380. NullFields []string `json:"-"`
  381. }
  382. func (s *AddOrderDealsRequest) MarshalJSON() ([]byte, error) {
  383. type NoMethod AddOrderDealsRequest
  384. raw := NoMethod(*s)
  385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  386. }
  387. type AddOrderDealsResponse struct {
  388. // Deals: List of deals added (in the same proposal as passed in the
  389. // request)
  390. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  391. // ProposalRevisionNumber: The updated revision number for the proposal.
  392. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  393. // ServerResponse contains the HTTP response code and headers from the
  394. // server.
  395. googleapi.ServerResponse `json:"-"`
  396. // ForceSendFields is a list of field names (e.g. "Deals") to
  397. // unconditionally include in API requests. By default, fields with
  398. // empty values are omitted from API requests. However, any non-pointer,
  399. // non-interface field appearing in ForceSendFields will be sent to the
  400. // server regardless of whether the field is empty or not. This may be
  401. // used to include empty fields in Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. // NullFields is a list of field names (e.g. "Deals") to include in API
  404. // requests with the JSON null value. By default, fields with empty
  405. // values are omitted from API requests. However, any field with an
  406. // empty value appearing in NullFields will be sent to the server as
  407. // null. It is an error if a field in this list has a non-empty value.
  408. // This may be used to include null fields in Patch requests.
  409. NullFields []string `json:"-"`
  410. }
  411. func (s *AddOrderDealsResponse) MarshalJSON() ([]byte, error) {
  412. type NoMethod AddOrderDealsResponse
  413. raw := NoMethod(*s)
  414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  415. }
  416. type AddOrderNotesRequest struct {
  417. // Notes: The list of notes to add.
  418. Notes []*MarketplaceNote `json:"notes,omitempty"`
  419. // ForceSendFields is a list of field names (e.g. "Notes") to
  420. // unconditionally include in API requests. By default, fields with
  421. // empty values are omitted from API requests. However, any non-pointer,
  422. // non-interface field appearing in ForceSendFields will be sent to the
  423. // server regardless of whether the field is empty or not. This may be
  424. // used to include empty fields in Patch requests.
  425. ForceSendFields []string `json:"-"`
  426. // NullFields is a list of field names (e.g. "Notes") to include in API
  427. // requests with the JSON null value. By default, fields with empty
  428. // values are omitted from API requests. However, any field with an
  429. // empty value appearing in NullFields will be sent to the server as
  430. // null. It is an error if a field in this list has a non-empty value.
  431. // This may be used to include null fields in Patch requests.
  432. NullFields []string `json:"-"`
  433. }
  434. func (s *AddOrderNotesRequest) MarshalJSON() ([]byte, error) {
  435. type NoMethod AddOrderNotesRequest
  436. raw := NoMethod(*s)
  437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  438. }
  439. type AddOrderNotesResponse struct {
  440. Notes []*MarketplaceNote `json:"notes,omitempty"`
  441. // ServerResponse contains the HTTP response code and headers from the
  442. // server.
  443. googleapi.ServerResponse `json:"-"`
  444. // ForceSendFields is a list of field names (e.g. "Notes") to
  445. // unconditionally include in API requests. By default, fields with
  446. // empty values are omitted from API requests. However, any non-pointer,
  447. // non-interface field appearing in ForceSendFields will be sent to the
  448. // server regardless of whether the field is empty or not. This may be
  449. // used to include empty fields in Patch requests.
  450. ForceSendFields []string `json:"-"`
  451. // NullFields is a list of field names (e.g. "Notes") to include in API
  452. // requests with the JSON null value. By default, fields with empty
  453. // values are omitted from API requests. However, any field with an
  454. // empty value appearing in NullFields will be sent to the server as
  455. // null. It is an error if a field in this list has a non-empty value.
  456. // This may be used to include null fields in Patch requests.
  457. NullFields []string `json:"-"`
  458. }
  459. func (s *AddOrderNotesResponse) MarshalJSON() ([]byte, error) {
  460. type NoMethod AddOrderNotesResponse
  461. raw := NoMethod(*s)
  462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  463. }
  464. // BillingInfo: The configuration data for an Ad Exchange billing info.
  465. type BillingInfo struct {
  466. // AccountId: Account id.
  467. AccountId int64 `json:"accountId,omitempty"`
  468. // AccountName: Account name.
  469. AccountName string `json:"accountName,omitempty"`
  470. // BillingId: A list of adgroup IDs associated with this particular
  471. // account. These IDs may show up as part of a realtime bidding
  472. // BidRequest, which indicates a bid request for this account.
  473. BillingId []string `json:"billingId,omitempty"`
  474. // Kind: Resource type.
  475. Kind string `json:"kind,omitempty"`
  476. // ServerResponse contains the HTTP response code and headers from the
  477. // server.
  478. googleapi.ServerResponse `json:"-"`
  479. // ForceSendFields is a list of field names (e.g. "AccountId") to
  480. // unconditionally include in API requests. By default, fields with
  481. // empty values are omitted from API requests. However, any non-pointer,
  482. // non-interface field appearing in ForceSendFields will be sent to the
  483. // server regardless of whether the field is empty or not. This may be
  484. // used to include empty fields in Patch requests.
  485. ForceSendFields []string `json:"-"`
  486. // NullFields is a list of field names (e.g. "AccountId") to include in
  487. // API requests with the JSON null value. By default, fields with empty
  488. // values are omitted from API requests. However, any field with an
  489. // empty value appearing in NullFields will be sent to the server as
  490. // null. It is an error if a field in this list has a non-empty value.
  491. // This may be used to include null fields in Patch requests.
  492. NullFields []string `json:"-"`
  493. }
  494. func (s *BillingInfo) MarshalJSON() ([]byte, error) {
  495. type NoMethod BillingInfo
  496. raw := NoMethod(*s)
  497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  498. }
  499. // BillingInfoList: A billing info feed lists Billing Info the Ad
  500. // Exchange buyer account has access to. Each entry in the feed
  501. // corresponds to a single billing info.
  502. type BillingInfoList struct {
  503. // Items: A list of billing info relevant for your account.
  504. Items []*BillingInfo `json:"items,omitempty"`
  505. // Kind: Resource type.
  506. Kind string `json:"kind,omitempty"`
  507. // ServerResponse contains the HTTP response code and headers from the
  508. // server.
  509. googleapi.ServerResponse `json:"-"`
  510. // ForceSendFields is a list of field names (e.g. "Items") to
  511. // unconditionally include in API requests. By default, fields with
  512. // empty values are omitted from API requests. However, any non-pointer,
  513. // non-interface field appearing in ForceSendFields will be sent to the
  514. // server regardless of whether the field is empty or not. This may be
  515. // used to include empty fields in Patch requests.
  516. ForceSendFields []string `json:"-"`
  517. // NullFields is a list of field names (e.g. "Items") to include in API
  518. // requests with the JSON null value. By default, fields with empty
  519. // values are omitted from API requests. However, any field with an
  520. // empty value appearing in NullFields will be sent to the server as
  521. // null. It is an error if a field in this list has a non-empty value.
  522. // This may be used to include null fields in Patch requests.
  523. NullFields []string `json:"-"`
  524. }
  525. func (s *BillingInfoList) MarshalJSON() ([]byte, error) {
  526. type NoMethod BillingInfoList
  527. raw := NoMethod(*s)
  528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  529. }
  530. // Budget: The configuration data for Ad Exchange RTB - Budget API.
  531. type Budget struct {
  532. // AccountId: The id of the account. This is required for get and update
  533. // requests.
  534. AccountId int64 `json:"accountId,omitempty,string"`
  535. // BillingId: The billing id to determine which adgroup to provide
  536. // budget information for. This is required for get and update requests.
  537. BillingId int64 `json:"billingId,omitempty,string"`
  538. // BudgetAmount: The daily budget amount in unit amount of the account
  539. // currency to apply for the billingId provided. This is required for
  540. // update requests.
  541. BudgetAmount int64 `json:"budgetAmount,omitempty,string"`
  542. // CurrencyCode: The currency code for the buyer. This cannot be altered
  543. // here.
  544. CurrencyCode string `json:"currencyCode,omitempty"`
  545. // Id: The unique id that describes this item.
  546. Id string `json:"id,omitempty"`
  547. // Kind: The kind of the resource, i.e. "adexchangebuyer#budget".
  548. Kind string `json:"kind,omitempty"`
  549. // ServerResponse contains the HTTP response code and headers from the
  550. // server.
  551. googleapi.ServerResponse `json:"-"`
  552. // ForceSendFields is a list of field names (e.g. "AccountId") to
  553. // unconditionally include in API requests. By default, fields with
  554. // empty values are omitted from API requests. However, any non-pointer,
  555. // non-interface field appearing in ForceSendFields will be sent to the
  556. // server regardless of whether the field is empty or not. This may be
  557. // used to include empty fields in Patch requests.
  558. ForceSendFields []string `json:"-"`
  559. // NullFields is a list of field names (e.g. "AccountId") to include in
  560. // API requests with the JSON null value. By default, fields with empty
  561. // values are omitted from API requests. However, any field with an
  562. // empty value appearing in NullFields will be sent to the server as
  563. // null. It is an error if a field in this list has a non-empty value.
  564. // This may be used to include null fields in Patch requests.
  565. NullFields []string `json:"-"`
  566. }
  567. func (s *Budget) MarshalJSON() ([]byte, error) {
  568. type NoMethod Budget
  569. raw := NoMethod(*s)
  570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  571. }
  572. type Buyer struct {
  573. // AccountId: Adx account id of the buyer.
  574. AccountId string `json:"accountId,omitempty"`
  575. // ForceSendFields is a list of field names (e.g. "AccountId") to
  576. // unconditionally include in API requests. By default, fields with
  577. // empty values are omitted from API requests. However, any non-pointer,
  578. // non-interface field appearing in ForceSendFields will be sent to the
  579. // server regardless of whether the field is empty or not. This may be
  580. // used to include empty fields in Patch requests.
  581. ForceSendFields []string `json:"-"`
  582. // NullFields is a list of field names (e.g. "AccountId") to include in
  583. // API requests with the JSON null value. By default, fields with empty
  584. // values are omitted from API requests. However, any field with an
  585. // empty value appearing in NullFields will be sent to the server as
  586. // null. It is an error if a field in this list has a non-empty value.
  587. // This may be used to include null fields in Patch requests.
  588. NullFields []string `json:"-"`
  589. }
  590. func (s *Buyer) MarshalJSON() ([]byte, error) {
  591. type NoMethod Buyer
  592. raw := NoMethod(*s)
  593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  594. }
  595. type ContactInformation struct {
  596. // Email: Email address of the contact.
  597. Email string `json:"email,omitempty"`
  598. // Name: The name of the contact.
  599. Name string `json:"name,omitempty"`
  600. // ForceSendFields is a list of field names (e.g. "Email") to
  601. // unconditionally include in API requests. By default, fields with
  602. // empty values are omitted from API requests. However, any non-pointer,
  603. // non-interface field appearing in ForceSendFields will be sent to the
  604. // server regardless of whether the field is empty or not. This may be
  605. // used to include empty fields in Patch requests.
  606. ForceSendFields []string `json:"-"`
  607. // NullFields is a list of field names (e.g. "Email") to include in API
  608. // requests with the JSON null value. By default, fields with empty
  609. // values are omitted from API requests. However, any field with an
  610. // empty value appearing in NullFields will be sent to the server as
  611. // null. It is an error if a field in this list has a non-empty value.
  612. // This may be used to include null fields in Patch requests.
  613. NullFields []string `json:"-"`
  614. }
  615. func (s *ContactInformation) MarshalJSON() ([]byte, error) {
  616. type NoMethod ContactInformation
  617. raw := NoMethod(*s)
  618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  619. }
  620. type CreateOrdersRequest struct {
  621. // Proposals: The list of proposals to create.
  622. Proposals []*Proposal `json:"proposals,omitempty"`
  623. // WebPropertyCode: Web property id of the seller creating these orders
  624. WebPropertyCode string `json:"webPropertyCode,omitempty"`
  625. // ForceSendFields is a list of field names (e.g. "Proposals") to
  626. // unconditionally include in API requests. By default, fields with
  627. // empty values are omitted from API requests. However, any non-pointer,
  628. // non-interface field appearing in ForceSendFields will be sent to the
  629. // server regardless of whether the field is empty or not. This may be
  630. // used to include empty fields in Patch requests.
  631. ForceSendFields []string `json:"-"`
  632. // NullFields is a list of field names (e.g. "Proposals") to include in
  633. // API requests with the JSON null value. By default, fields with empty
  634. // values are omitted from API requests. However, any field with an
  635. // empty value appearing in NullFields will be sent to the server as
  636. // null. It is an error if a field in this list has a non-empty value.
  637. // This may be used to include null fields in Patch requests.
  638. NullFields []string `json:"-"`
  639. }
  640. func (s *CreateOrdersRequest) MarshalJSON() ([]byte, error) {
  641. type NoMethod CreateOrdersRequest
  642. raw := NoMethod(*s)
  643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  644. }
  645. type CreateOrdersResponse struct {
  646. // Proposals: The list of proposals successfully created.
  647. Proposals []*Proposal `json:"proposals,omitempty"`
  648. // ServerResponse contains the HTTP response code and headers from the
  649. // server.
  650. googleapi.ServerResponse `json:"-"`
  651. // ForceSendFields is a list of field names (e.g. "Proposals") to
  652. // unconditionally include in API requests. By default, fields with
  653. // empty values are omitted from API requests. However, any non-pointer,
  654. // non-interface field appearing in ForceSendFields will be sent to the
  655. // server regardless of whether the field is empty or not. This may be
  656. // used to include empty fields in Patch requests.
  657. ForceSendFields []string `json:"-"`
  658. // NullFields is a list of field names (e.g. "Proposals") to include in
  659. // API requests with the JSON null value. By default, fields with empty
  660. // values are omitted from API requests. However, any field with an
  661. // empty value appearing in NullFields will be sent to the server as
  662. // null. It is an error if a field in this list has a non-empty value.
  663. // This may be used to include null fields in Patch requests.
  664. NullFields []string `json:"-"`
  665. }
  666. func (s *CreateOrdersResponse) MarshalJSON() ([]byte, error) {
  667. type NoMethod CreateOrdersResponse
  668. raw := NoMethod(*s)
  669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  670. }
  671. // Creative: A creative and its classification data.
  672. type Creative struct {
  673. // HTMLSnippet: The HTML snippet that displays the ad when inserted in
  674. // the web page. If set, videoURL, videoVastXML, and nativeAd should not
  675. // be set.
  676. HTMLSnippet string `json:"HTMLSnippet,omitempty"`
  677. // AccountId: Account id.
  678. AccountId int64 `json:"accountId,omitempty"`
  679. // AdChoicesDestinationUrl: The link to the Ad Preferences page. This is
  680. // only supported for native ads.
  681. AdChoicesDestinationUrl string `json:"adChoicesDestinationUrl,omitempty"`
  682. // AdvertiserId: Detected advertiser id, if any. Read-only. This field
  683. // should not be set in requests.
  684. AdvertiserId googleapi.Int64s `json:"advertiserId,omitempty"`
  685. // AdvertiserName: The name of the company being advertised in the
  686. // creative. The value provided must exist in the advertisers.txt file.
  687. AdvertiserName string `json:"advertiserName,omitempty"`
  688. // AgencyId: The agency id for this creative.
  689. AgencyId int64 `json:"agencyId,omitempty,string"`
  690. // ApiUploadTimestamp: The last upload timestamp of this creative if it
  691. // was uploaded via API. Read-only. The value of this field is
  692. // generated, and will be ignored for uploads. (formatted RFC 3339
  693. // timestamp).
  694. ApiUploadTimestamp string `json:"apiUploadTimestamp,omitempty"`
  695. // Attribute: List of buyer selectable attributes for the ads that may
  696. // be shown from this snippet. Each attribute is represented by an
  697. // integer as defined in buyer-declarable-creative-attributes.txt.
  698. Attribute []int64 `json:"attribute,omitempty"`
  699. // BuyerCreativeId: A buyer-specific id identifying the creative in this
  700. // ad.
  701. BuyerCreativeId string `json:"buyerCreativeId,omitempty"`
  702. // ClickThroughUrl: The set of destination urls for the snippet.
  703. ClickThroughUrl []string `json:"clickThroughUrl,omitempty"`
  704. // Corrections: Shows any corrections that were applied to this
  705. // creative. Read-only. This field should not be set in requests.
  706. Corrections []*CreativeCorrections `json:"corrections,omitempty"`
  707. // CreativeStatusIdentityType: Creative status identity type that the
  708. // creative item applies to. Ad Exchange real-time bidding is migrating
  709. // to the sizeless creative verification. Originally, Ad Exchange
  710. // assigned creative verification status to a unique combination of a
  711. // buyer creative ID and creative dimensions. Post-migration, a single
  712. // verification status will be assigned at the buyer creative ID level.
  713. // This field allows to distinguish whether a given creative status
  714. // applies to a unique combination of a buyer creative ID and creative
  715. // dimensions, or to a buyer creative ID as a whole.
  716. CreativeStatusIdentityType string `json:"creativeStatusIdentityType,omitempty"`
  717. // DealsStatus: Top-level deals status. Read-only. This field should not
  718. // be set in requests. If disapproved, an entry for
  719. // auctionType=DIRECT_DEALS (or ALL) in servingRestrictions will also
  720. // exist. Note that this may be nuanced with other contextual
  721. // restrictions, in which case it may be preferable to read from
  722. // servingRestrictions directly.
  723. DealsStatus string `json:"dealsStatus,omitempty"`
  724. // DetectedDomains: Detected domains for this creative. Read-only. This
  725. // field should not be set in requests.
  726. DetectedDomains []string `json:"detectedDomains,omitempty"`
  727. // FilteringReasons: The filtering reasons for the creative. Read-only.
  728. // This field should not be set in requests.
  729. FilteringReasons *CreativeFilteringReasons `json:"filteringReasons,omitempty"`
  730. // Height: Ad height.
  731. Height int64 `json:"height,omitempty"`
  732. // ImpressionTrackingUrl: The set of urls to be called to record an
  733. // impression.
  734. ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
  735. // Kind: Resource type.
  736. Kind string `json:"kind,omitempty"`
  737. // Languages: Detected languages for this creative. Read-only. This
  738. // field should not be set in requests.
  739. Languages []string `json:"languages,omitempty"`
  740. // NativeAd: If nativeAd is set, HTMLSnippet, videoVastXML, and the
  741. // videoURL outside of nativeAd should not be set. (The videoURL inside
  742. // nativeAd can be set.)
  743. NativeAd *CreativeNativeAd `json:"nativeAd,omitempty"`
  744. // OpenAuctionStatus: Top-level open auction status. Read-only. This
  745. // field should not be set in requests. If disapproved, an entry for
  746. // auctionType=OPEN_AUCTION (or ALL) in servingRestrictions will also
  747. // exist. Note that this may be nuanced with other contextual
  748. // restrictions, in which case it may be preferable to read from
  749. // ServingRestrictions directly.
  750. OpenAuctionStatus string `json:"openAuctionStatus,omitempty"`
  751. // ProductCategories: Detected product categories, if any. Each category
  752. // is represented by an integer as defined in
  753. // ad-product-categories.txt. Read-only. This field should not be set in
  754. // requests.
  755. ProductCategories []int64 `json:"productCategories,omitempty"`
  756. // RestrictedCategories: All restricted categories for the ads that may
  757. // be shown from this snippet. Each category is represented by an
  758. // integer as defined in the ad-restricted-categories.txt.
  759. RestrictedCategories []int64 `json:"restrictedCategories,omitempty"`
  760. // SensitiveCategories: Detected sensitive categories, if any. Each
  761. // category is represented by an integer as defined in
  762. // ad-sensitive-categories.txt. Read-only. This field should not be set
  763. // in requests.
  764. SensitiveCategories []int64 `json:"sensitiveCategories,omitempty"`
  765. // ServingRestrictions: The granular status of this ad in specific
  766. // contexts. A context here relates to where something ultimately serves
  767. // (for example, a physical location, a platform, an HTTPS vs HTTP
  768. // request, or the type of auction). Read-only. This field should not be
  769. // set in requests. See the examples in the Creatives guide for more
  770. // details.
  771. ServingRestrictions []*CreativeServingRestrictions `json:"servingRestrictions,omitempty"`
  772. // VendorType: List of vendor types for the ads that may be shown from
  773. // this snippet. Each vendor type is represented by an integer as
  774. // defined in vendors.txt.
  775. VendorType []int64 `json:"vendorType,omitempty"`
  776. // Version: The version for this creative. Read-only. This field should
  777. // not be set in requests.
  778. Version int64 `json:"version,omitempty"`
  779. // VideoURL: The URL to fetch a video ad. If set, HTMLSnippet,
  780. // videoVastXML, and nativeAd should not be set. Note, this is different
  781. // from resource.native_ad.video_url above.
  782. VideoURL string `json:"videoURL,omitempty"`
  783. // VideoVastXML: The contents of a VAST document for a video ad. This
  784. // document should conform to the VAST 2.0 or 3.0 standard. If set,
  785. // HTMLSnippet, videoURL, and nativeAd and should not be set.
  786. VideoVastXML string `json:"videoVastXML,omitempty"`
  787. // Width: Ad width.
  788. Width int64 `json:"width,omitempty"`
  789. // ServerResponse contains the HTTP response code and headers from the
  790. // server.
  791. googleapi.ServerResponse `json:"-"`
  792. // ForceSendFields is a list of field names (e.g. "HTMLSnippet") to
  793. // unconditionally include in API requests. By default, fields with
  794. // empty values are omitted from API requests. However, any non-pointer,
  795. // non-interface field appearing in ForceSendFields will be sent to the
  796. // server regardless of whether the field is empty or not. This may be
  797. // used to include empty fields in Patch requests.
  798. ForceSendFields []string `json:"-"`
  799. // NullFields is a list of field names (e.g. "HTMLSnippet") to include
  800. // in API requests with the JSON null value. By default, fields with
  801. // empty values are omitted from API requests. However, any field with
  802. // an empty value appearing in NullFields will be sent to the server as
  803. // null. It is an error if a field in this list has a non-empty value.
  804. // This may be used to include null fields in Patch requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *Creative) MarshalJSON() ([]byte, error) {
  808. type NoMethod Creative
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. type CreativeCorrections struct {
  813. // Contexts: All known serving contexts containing serving status
  814. // information.
  815. Contexts []*CreativeCorrectionsContexts `json:"contexts,omitempty"`
  816. // Details: Additional details about the correction.
  817. Details []string `json:"details,omitempty"`
  818. // Reason: The type of correction that was applied to the creative.
  819. Reason string `json:"reason,omitempty"`
  820. // ForceSendFields is a list of field names (e.g. "Contexts") to
  821. // unconditionally include in API requests. By default, fields with
  822. // empty values are omitted from API requests. However, any non-pointer,
  823. // non-interface field appearing in ForceSendFields will be sent to the
  824. // server regardless of whether the field is empty or not. This may be
  825. // used to include empty fields in Patch requests.
  826. ForceSendFields []string `json:"-"`
  827. // NullFields is a list of field names (e.g. "Contexts") to include in
  828. // API requests with the JSON null value. By default, fields with empty
  829. // values are omitted from API requests. However, any field with an
  830. // empty value appearing in NullFields will be sent to the server as
  831. // null. It is an error if a field in this list has a non-empty value.
  832. // This may be used to include null fields in Patch requests.
  833. NullFields []string `json:"-"`
  834. }
  835. func (s *CreativeCorrections) MarshalJSON() ([]byte, error) {
  836. type NoMethod CreativeCorrections
  837. raw := NoMethod(*s)
  838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  839. }
  840. type CreativeCorrectionsContexts struct {
  841. // AuctionType: Only set when contextType=AUCTION_TYPE. Represents the
  842. // auction types this correction applies to.
  843. AuctionType []string `json:"auctionType,omitempty"`
  844. // ContextType: The type of context (e.g., location, platform, auction
  845. // type, SSL-ness).
  846. ContextType string `json:"contextType,omitempty"`
  847. // GeoCriteriaId: Only set when contextType=LOCATION. Represents the geo
  848. // criterias this correction applies to.
  849. GeoCriteriaId []int64 `json:"geoCriteriaId,omitempty"`
  850. // Platform: Only set when contextType=PLATFORM. Represents the
  851. // platforms this correction applies to.
  852. Platform []string `json:"platform,omitempty"`
  853. // ForceSendFields is a list of field names (e.g. "AuctionType") to
  854. // unconditionally include in API requests. By default, fields with
  855. // empty values are omitted from API requests. However, any non-pointer,
  856. // non-interface field appearing in ForceSendFields will be sent to the
  857. // server regardless of whether the field is empty or not. This may be
  858. // used to include empty fields in Patch requests.
  859. ForceSendFields []string `json:"-"`
  860. // NullFields is a list of field names (e.g. "AuctionType") to include
  861. // in API requests with the JSON null value. By default, fields with
  862. // empty values are omitted from API requests. However, any field with
  863. // an empty value appearing in NullFields will be sent to the server as
  864. // null. It is an error if a field in this list has a non-empty value.
  865. // This may be used to include null fields in Patch requests.
  866. NullFields []string `json:"-"`
  867. }
  868. func (s *CreativeCorrectionsContexts) MarshalJSON() ([]byte, error) {
  869. type NoMethod CreativeCorrectionsContexts
  870. raw := NoMethod(*s)
  871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  872. }
  873. // CreativeFilteringReasons: The filtering reasons for the creative.
  874. // Read-only. This field should not be set in requests.
  875. type CreativeFilteringReasons struct {
  876. // Date: The date in ISO 8601 format for the data. The data is collected
  877. // from 00:00:00 to 23:59:59 in PST.
  878. Date string `json:"date,omitempty"`
  879. // Reasons: The filtering reasons.
  880. Reasons []*CreativeFilteringReasonsReasons `json:"reasons,omitempty"`
  881. // ForceSendFields is a list of field names (e.g. "Date") to
  882. // unconditionally include in API requests. By default, fields with
  883. // empty values are omitted from API requests. However, any non-pointer,
  884. // non-interface field appearing in ForceSendFields will be sent to the
  885. // server regardless of whether the field is empty or not. This may be
  886. // used to include empty fields in Patch requests.
  887. ForceSendFields []string `json:"-"`
  888. // NullFields is a list of field names (e.g. "Date") to include in API
  889. // requests with the JSON null value. By default, fields with empty
  890. // values are omitted from API requests. However, any field with an
  891. // empty value appearing in NullFields will be sent to the server as
  892. // null. It is an error if a field in this list has a non-empty value.
  893. // This may be used to include null fields in Patch requests.
  894. NullFields []string `json:"-"`
  895. }
  896. func (s *CreativeFilteringReasons) MarshalJSON() ([]byte, error) {
  897. type NoMethod CreativeFilteringReasons
  898. raw := NoMethod(*s)
  899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  900. }
  901. type CreativeFilteringReasonsReasons struct {
  902. // FilteringCount: The number of times the creative was filtered for the
  903. // status. The count is aggregated across all publishers on the
  904. // exchange.
  905. FilteringCount int64 `json:"filteringCount,omitempty,string"`
  906. // FilteringStatus: The filtering status code as defined in
  907. // creative-status-codes.txt.
  908. FilteringStatus int64 `json:"filteringStatus,omitempty"`
  909. // ForceSendFields is a list of field names (e.g. "FilteringCount") to
  910. // unconditionally include in API requests. By default, fields with
  911. // empty values are omitted from API requests. However, any non-pointer,
  912. // non-interface field appearing in ForceSendFields will be sent to the
  913. // server regardless of whether the field is empty or not. This may be
  914. // used to include empty fields in Patch requests.
  915. ForceSendFields []string `json:"-"`
  916. // NullFields is a list of field names (e.g. "FilteringCount") to
  917. // include in API requests with the JSON null value. By default, fields
  918. // with empty values are omitted from API requests. However, any field
  919. // with an empty value appearing in NullFields will be sent to the
  920. // server as null. It is an error if a field in this list has a
  921. // non-empty value. This may be used to include null fields in Patch
  922. // requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *CreativeFilteringReasonsReasons) MarshalJSON() ([]byte, error) {
  926. type NoMethod CreativeFilteringReasonsReasons
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // CreativeNativeAd: If nativeAd is set, HTMLSnippet, videoVastXML, and
  931. // the videoURL outside of nativeAd should not be set. (The videoURL
  932. // inside nativeAd can be set.)
  933. type CreativeNativeAd struct {
  934. Advertiser string `json:"advertiser,omitempty"`
  935. // AppIcon: The app icon, for app download ads.
  936. AppIcon *CreativeNativeAdAppIcon `json:"appIcon,omitempty"`
  937. // Body: A long description of the ad.
  938. Body string `json:"body,omitempty"`
  939. // CallToAction: A label for the button that the user is supposed to
  940. // click.
  941. CallToAction string `json:"callToAction,omitempty"`
  942. // ClickLinkUrl: The URL that the browser/SDK will load when the user
  943. // clicks the ad.
  944. ClickLinkUrl string `json:"clickLinkUrl,omitempty"`
  945. // ClickTrackingUrl: The URL to use for click tracking.
  946. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  947. // Headline: A short title for the ad.
  948. Headline string `json:"headline,omitempty"`
  949. // Image: A large image.
  950. Image *CreativeNativeAdImage `json:"image,omitempty"`
  951. // ImpressionTrackingUrl: The URLs are called when the impression is
  952. // rendered.
  953. ImpressionTrackingUrl []string `json:"impressionTrackingUrl,omitempty"`
  954. // Logo: A smaller image, for the advertiser logo.
  955. Logo *CreativeNativeAdLogo `json:"logo,omitempty"`
  956. // Price: The price of the promoted app including the currency info.
  957. Price string `json:"price,omitempty"`
  958. // StarRating: The app rating in the app store. Must be in the range
  959. // [0-5].
  960. StarRating float64 `json:"starRating,omitempty"`
  961. // Store: The URL to the app store to purchase/download the promoted
  962. // app.
  963. Store string `json:"store,omitempty"`
  964. // VideoURL: The URL of the XML VAST for a native ad. Note this is a
  965. // separate field from resource.video_url.
  966. VideoURL string `json:"videoURL,omitempty"`
  967. // ForceSendFields is a list of field names (e.g. "Advertiser") to
  968. // unconditionally include in API requests. By default, fields with
  969. // empty values are omitted from API requests. However, any non-pointer,
  970. // non-interface field appearing in ForceSendFields will be sent to the
  971. // server regardless of whether the field is empty or not. This may be
  972. // used to include empty fields in Patch requests.
  973. ForceSendFields []string `json:"-"`
  974. // NullFields is a list of field names (e.g. "Advertiser") to include in
  975. // API requests with the JSON null value. By default, fields with empty
  976. // values are omitted from API requests. However, any field with an
  977. // empty value appearing in NullFields will be sent to the server as
  978. // null. It is an error if a field in this list has a non-empty value.
  979. // This may be used to include null fields in Patch requests.
  980. NullFields []string `json:"-"`
  981. }
  982. func (s *CreativeNativeAd) MarshalJSON() ([]byte, error) {
  983. type NoMethod CreativeNativeAd
  984. raw := NoMethod(*s)
  985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  986. }
  987. func (s *CreativeNativeAd) UnmarshalJSON(data []byte) error {
  988. type NoMethod CreativeNativeAd
  989. var s1 struct {
  990. StarRating gensupport.JSONFloat64 `json:"starRating"`
  991. *NoMethod
  992. }
  993. s1.NoMethod = (*NoMethod)(s)
  994. if err := json.Unmarshal(data, &s1); err != nil {
  995. return err
  996. }
  997. s.StarRating = float64(s1.StarRating)
  998. return nil
  999. }
  1000. // CreativeNativeAdAppIcon: The app icon, for app download ads.
  1001. type CreativeNativeAdAppIcon struct {
  1002. Height int64 `json:"height,omitempty"`
  1003. Url string `json:"url,omitempty"`
  1004. Width int64 `json:"width,omitempty"`
  1005. // ForceSendFields is a list of field names (e.g. "Height") to
  1006. // unconditionally include in API requests. By default, fields with
  1007. // empty values are omitted from API requests. However, any non-pointer,
  1008. // non-interface field appearing in ForceSendFields will be sent to the
  1009. // server regardless of whether the field is empty or not. This may be
  1010. // used to include empty fields in Patch requests.
  1011. ForceSendFields []string `json:"-"`
  1012. // NullFields is a list of field names (e.g. "Height") to include in API
  1013. // requests with the JSON null value. By default, fields with empty
  1014. // values are omitted from API requests. However, any field with an
  1015. // empty value appearing in NullFields will be sent to the server as
  1016. // null. It is an error if a field in this list has a non-empty value.
  1017. // This may be used to include null fields in Patch requests.
  1018. NullFields []string `json:"-"`
  1019. }
  1020. func (s *CreativeNativeAdAppIcon) MarshalJSON() ([]byte, error) {
  1021. type NoMethod CreativeNativeAdAppIcon
  1022. raw := NoMethod(*s)
  1023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1024. }
  1025. // CreativeNativeAdImage: A large image.
  1026. type CreativeNativeAdImage struct {
  1027. Height int64 `json:"height,omitempty"`
  1028. Url string `json:"url,omitempty"`
  1029. Width int64 `json:"width,omitempty"`
  1030. // ForceSendFields is a list of field names (e.g. "Height") to
  1031. // unconditionally include in API requests. By default, fields with
  1032. // empty values are omitted from API requests. However, any non-pointer,
  1033. // non-interface field appearing in ForceSendFields will be sent to the
  1034. // server regardless of whether the field is empty or not. This may be
  1035. // used to include empty fields in Patch requests.
  1036. ForceSendFields []string `json:"-"`
  1037. // NullFields is a list of field names (e.g. "Height") to include in API
  1038. // requests with the JSON null value. By default, fields with empty
  1039. // values are omitted from API requests. However, any field with an
  1040. // empty value appearing in NullFields will be sent to the server as
  1041. // null. It is an error if a field in this list has a non-empty value.
  1042. // This may be used to include null fields in Patch requests.
  1043. NullFields []string `json:"-"`
  1044. }
  1045. func (s *CreativeNativeAdImage) MarshalJSON() ([]byte, error) {
  1046. type NoMethod CreativeNativeAdImage
  1047. raw := NoMethod(*s)
  1048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1049. }
  1050. // CreativeNativeAdLogo: A smaller image, for the advertiser logo.
  1051. type CreativeNativeAdLogo struct {
  1052. Height int64 `json:"height,omitempty"`
  1053. Url string `json:"url,omitempty"`
  1054. Width int64 `json:"width,omitempty"`
  1055. // ForceSendFields is a list of field names (e.g. "Height") to
  1056. // unconditionally include in API requests. By default, fields with
  1057. // empty values are omitted from API requests. However, any non-pointer,
  1058. // non-interface field appearing in ForceSendFields will be sent to the
  1059. // server regardless of whether the field is empty or not. This may be
  1060. // used to include empty fields in Patch requests.
  1061. ForceSendFields []string `json:"-"`
  1062. // NullFields is a list of field names (e.g. "Height") to include in API
  1063. // requests with the JSON null value. By default, fields with empty
  1064. // values are omitted from API requests. However, any field with an
  1065. // empty value appearing in NullFields will be sent to the server as
  1066. // null. It is an error if a field in this list has a non-empty value.
  1067. // This may be used to include null fields in Patch requests.
  1068. NullFields []string `json:"-"`
  1069. }
  1070. func (s *CreativeNativeAdLogo) MarshalJSON() ([]byte, error) {
  1071. type NoMethod CreativeNativeAdLogo
  1072. raw := NoMethod(*s)
  1073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1074. }
  1075. type CreativeServingRestrictions struct {
  1076. // Contexts: All known contexts/restrictions.
  1077. Contexts []*CreativeServingRestrictionsContexts `json:"contexts,omitempty"`
  1078. // DisapprovalReasons: The reasons for disapproval within this
  1079. // restriction, if any. Note that not all disapproval reasons may be
  1080. // categorized, so it is possible for the creative to have a status of
  1081. // DISAPPROVED or CONDITIONALLY_APPROVED with an empty list for
  1082. // disapproval_reasons. In this case, please reach out to your TAM to
  1083. // help debug the issue.
  1084. DisapprovalReasons []*CreativeServingRestrictionsDisapprovalReasons `json:"disapprovalReasons,omitempty"`
  1085. // Reason: Why the creative is ineligible to serve in this context
  1086. // (e.g., it has been explicitly disapproved or is pending review).
  1087. Reason string `json:"reason,omitempty"`
  1088. // ForceSendFields is a list of field names (e.g. "Contexts") to
  1089. // unconditionally include in API requests. By default, fields with
  1090. // empty values are omitted from API requests. However, any non-pointer,
  1091. // non-interface field appearing in ForceSendFields will be sent to the
  1092. // server regardless of whether the field is empty or not. This may be
  1093. // used to include empty fields in Patch requests.
  1094. ForceSendFields []string `json:"-"`
  1095. // NullFields is a list of field names (e.g. "Contexts") to include in
  1096. // API requests with the JSON null value. By default, fields with empty
  1097. // values are omitted from API requests. However, any field with an
  1098. // empty value appearing in NullFields will be sent to the server as
  1099. // null. It is an error if a field in this list has a non-empty value.
  1100. // This may be used to include null fields in Patch requests.
  1101. NullFields []string `json:"-"`
  1102. }
  1103. func (s *CreativeServingRestrictions) MarshalJSON() ([]byte, error) {
  1104. type NoMethod CreativeServingRestrictions
  1105. raw := NoMethod(*s)
  1106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1107. }
  1108. type CreativeServingRestrictionsContexts struct {
  1109. // AuctionType: Only set when contextType=AUCTION_TYPE. Represents the
  1110. // auction types this restriction applies to.
  1111. AuctionType []string `json:"auctionType,omitempty"`
  1112. // ContextType: The type of context (e.g., location, platform, auction
  1113. // type, SSL-ness).
  1114. ContextType string `json:"contextType,omitempty"`
  1115. // GeoCriteriaId: Only set when contextType=LOCATION. Represents the geo
  1116. // criterias this restriction applies to. Impressions are considered to
  1117. // match a context if either the user location or publisher location
  1118. // matches a given geoCriteriaId.
  1119. GeoCriteriaId []int64 `json:"geoCriteriaId,omitempty"`
  1120. // Platform: Only set when contextType=PLATFORM. Represents the
  1121. // platforms this restriction applies to.
  1122. Platform []string `json:"platform,omitempty"`
  1123. // ForceSendFields is a list of field names (e.g. "AuctionType") 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. "AuctionType") to include
  1131. // in API requests with the JSON null value. By default, fields with
  1132. // empty values are omitted from API requests. However, any field with
  1133. // an 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 *CreativeServingRestrictionsContexts) MarshalJSON() ([]byte, error) {
  1139. type NoMethod CreativeServingRestrictionsContexts
  1140. raw := NoMethod(*s)
  1141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1142. }
  1143. type CreativeServingRestrictionsDisapprovalReasons struct {
  1144. // Details: Additional details about the reason for disapproval.
  1145. Details []string `json:"details,omitempty"`
  1146. // Reason: The categorized reason for disapproval.
  1147. Reason string `json:"reason,omitempty"`
  1148. // ForceSendFields is a list of field names (e.g. "Details") to
  1149. // unconditionally include in API requests. By default, fields with
  1150. // empty values are omitted from API requests. However, any non-pointer,
  1151. // non-interface field appearing in ForceSendFields will be sent to the
  1152. // server regardless of whether the field is empty or not. This may be
  1153. // used to include empty fields in Patch requests.
  1154. ForceSendFields []string `json:"-"`
  1155. // NullFields is a list of field names (e.g. "Details") to include in
  1156. // API requests with the JSON null value. By default, fields with empty
  1157. // values are omitted from API requests. However, any field with an
  1158. // empty value appearing in NullFields will be sent to the server as
  1159. // null. It is an error if a field in this list has a non-empty value.
  1160. // This may be used to include null fields in Patch requests.
  1161. NullFields []string `json:"-"`
  1162. }
  1163. func (s *CreativeServingRestrictionsDisapprovalReasons) MarshalJSON() ([]byte, error) {
  1164. type NoMethod CreativeServingRestrictionsDisapprovalReasons
  1165. raw := NoMethod(*s)
  1166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1167. }
  1168. // CreativeDealIds: The external deal ids associated with a creative.
  1169. type CreativeDealIds struct {
  1170. // DealStatuses: A list of external deal ids and ARC approval status.
  1171. DealStatuses []*CreativeDealIdsDealStatuses `json:"dealStatuses,omitempty"`
  1172. // Kind: Resource type.
  1173. Kind string `json:"kind,omitempty"`
  1174. // ServerResponse contains the HTTP response code and headers from the
  1175. // server.
  1176. googleapi.ServerResponse `json:"-"`
  1177. // ForceSendFields is a list of field names (e.g. "DealStatuses") to
  1178. // unconditionally include in API requests. By default, fields with
  1179. // empty values are omitted from API requests. However, any non-pointer,
  1180. // non-interface field appearing in ForceSendFields will be sent to the
  1181. // server regardless of whether the field is empty or not. This may be
  1182. // used to include empty fields in Patch requests.
  1183. ForceSendFields []string `json:"-"`
  1184. // NullFields is a list of field names (e.g. "DealStatuses") to include
  1185. // in API requests with the JSON null value. By default, fields with
  1186. // empty values are omitted from API requests. However, any field with
  1187. // an empty value appearing in NullFields will be sent to the server as
  1188. // null. It is an error if a field in this list has a non-empty value.
  1189. // This may be used to include null fields in Patch requests.
  1190. NullFields []string `json:"-"`
  1191. }
  1192. func (s *CreativeDealIds) MarshalJSON() ([]byte, error) {
  1193. type NoMethod CreativeDealIds
  1194. raw := NoMethod(*s)
  1195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1196. }
  1197. type CreativeDealIdsDealStatuses struct {
  1198. // ArcStatus: ARC approval status.
  1199. ArcStatus string `json:"arcStatus,omitempty"`
  1200. // DealId: External deal ID.
  1201. DealId int64 `json:"dealId,omitempty,string"`
  1202. // WebPropertyId: Publisher ID.
  1203. WebPropertyId int64 `json:"webPropertyId,omitempty"`
  1204. // ForceSendFields is a list of field names (e.g. "ArcStatus") to
  1205. // unconditionally include in API requests. By default, fields with
  1206. // empty values are omitted from API requests. However, any non-pointer,
  1207. // non-interface field appearing in ForceSendFields will be sent to the
  1208. // server regardless of whether the field is empty or not. This may be
  1209. // used to include empty fields in Patch requests.
  1210. ForceSendFields []string `json:"-"`
  1211. // NullFields is a list of field names (e.g. "ArcStatus") to include in
  1212. // API requests with the JSON null value. By default, fields with empty
  1213. // values are omitted from API requests. However, any field with an
  1214. // empty value appearing in NullFields will be sent to the server as
  1215. // null. It is an error if a field in this list has a non-empty value.
  1216. // This may be used to include null fields in Patch requests.
  1217. NullFields []string `json:"-"`
  1218. }
  1219. func (s *CreativeDealIdsDealStatuses) MarshalJSON() ([]byte, error) {
  1220. type NoMethod CreativeDealIdsDealStatuses
  1221. raw := NoMethod(*s)
  1222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1223. }
  1224. // CreativesList: The creatives feed lists the active creatives for the
  1225. // Ad Exchange buyer accounts that the user has access to. Each entry in
  1226. // the feed corresponds to a single creative.
  1227. type CreativesList struct {
  1228. // Items: A list of creatives.
  1229. Items []*Creative `json:"items,omitempty"`
  1230. // Kind: Resource type.
  1231. Kind string `json:"kind,omitempty"`
  1232. // NextPageToken: Continuation token used to page through creatives. To
  1233. // retrieve the next page of results, set the next request's "pageToken"
  1234. // value to this.
  1235. NextPageToken string `json:"nextPageToken,omitempty"`
  1236. // ServerResponse contains the HTTP response code and headers from the
  1237. // server.
  1238. googleapi.ServerResponse `json:"-"`
  1239. // ForceSendFields is a list of field names (e.g. "Items") to
  1240. // unconditionally include in API requests. By default, fields with
  1241. // empty values are omitted from API requests. However, any non-pointer,
  1242. // non-interface field appearing in ForceSendFields will be sent to the
  1243. // server regardless of whether the field is empty or not. This may be
  1244. // used to include empty fields in Patch requests.
  1245. ForceSendFields []string `json:"-"`
  1246. // NullFields is a list of field names (e.g. "Items") to include in API
  1247. // requests with the JSON null value. By default, fields with empty
  1248. // values are omitted from API requests. However, any field with an
  1249. // empty value appearing in NullFields will be sent to the server as
  1250. // null. It is an error if a field in this list has a non-empty value.
  1251. // This may be used to include null fields in Patch requests.
  1252. NullFields []string `json:"-"`
  1253. }
  1254. func (s *CreativesList) MarshalJSON() ([]byte, error) {
  1255. type NoMethod CreativesList
  1256. raw := NoMethod(*s)
  1257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1258. }
  1259. type DealServingMetadata struct {
  1260. // AlcoholAdsAllowed: True if alcohol ads are allowed for this deal
  1261. // (read-only). This field is only populated when querying for finalized
  1262. // orders using the method GetFinalizedOrderDeals
  1263. AlcoholAdsAllowed bool `json:"alcoholAdsAllowed,omitempty"`
  1264. // DealPauseStatus: Tracks which parties (if any) have paused a deal.
  1265. // (readonly, except via PauseResumeOrderDeals action)
  1266. DealPauseStatus *DealServingMetadataDealPauseStatus `json:"dealPauseStatus,omitempty"`
  1267. // ForceSendFields is a list of field names (e.g. "AlcoholAdsAllowed")
  1268. // to unconditionally include in API requests. By default, fields with
  1269. // empty values are omitted from API requests. However, any non-pointer,
  1270. // non-interface field appearing in ForceSendFields will be sent to the
  1271. // server regardless of whether the field is empty or not. This may be
  1272. // used to include empty fields in Patch requests.
  1273. ForceSendFields []string `json:"-"`
  1274. // NullFields is a list of field names (e.g. "AlcoholAdsAllowed") to
  1275. // include in API requests with the JSON null value. By default, fields
  1276. // with empty values are omitted from API requests. However, any field
  1277. // with an empty value appearing in NullFields will be sent to the
  1278. // server as null. It is an error if a field in this list has a
  1279. // non-empty value. This may be used to include null fields in Patch
  1280. // requests.
  1281. NullFields []string `json:"-"`
  1282. }
  1283. func (s *DealServingMetadata) MarshalJSON() ([]byte, error) {
  1284. type NoMethod DealServingMetadata
  1285. raw := NoMethod(*s)
  1286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1287. }
  1288. // DealServingMetadataDealPauseStatus: Tracks which parties (if any)
  1289. // have paused a deal. The deal is considered paused if has_buyer_paused
  1290. // || has_seller_paused. Each of the has_buyer_paused or the
  1291. // has_seller_paused bits can be set independently.
  1292. type DealServingMetadataDealPauseStatus struct {
  1293. BuyerPauseReason string `json:"buyerPauseReason,omitempty"`
  1294. // FirstPausedBy: If the deal is paused, records which party paused the
  1295. // deal first.
  1296. FirstPausedBy string `json:"firstPausedBy,omitempty"`
  1297. HasBuyerPaused bool `json:"hasBuyerPaused,omitempty"`
  1298. HasSellerPaused bool `json:"hasSellerPaused,omitempty"`
  1299. SellerPauseReason string `json:"sellerPauseReason,omitempty"`
  1300. // ForceSendFields is a list of field names (e.g. "BuyerPauseReason") to
  1301. // unconditionally include in API requests. By default, fields with
  1302. // empty values are omitted from API requests. However, any non-pointer,
  1303. // non-interface field appearing in ForceSendFields will be sent to the
  1304. // server regardless of whether the field is empty or not. This may be
  1305. // used to include empty fields in Patch requests.
  1306. ForceSendFields []string `json:"-"`
  1307. // NullFields is a list of field names (e.g. "BuyerPauseReason") to
  1308. // include in API requests with the JSON null value. By default, fields
  1309. // with empty values are omitted from API requests. However, any field
  1310. // with an empty value appearing in NullFields will be sent to the
  1311. // server as null. It is an error if a field in this list has a
  1312. // non-empty value. This may be used to include null fields in Patch
  1313. // requests.
  1314. NullFields []string `json:"-"`
  1315. }
  1316. func (s *DealServingMetadataDealPauseStatus) MarshalJSON() ([]byte, error) {
  1317. type NoMethod DealServingMetadataDealPauseStatus
  1318. raw := NoMethod(*s)
  1319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1320. }
  1321. type DealTerms struct {
  1322. // BrandingType: Visibilty of the URL in bid requests.
  1323. BrandingType string `json:"brandingType,omitempty"`
  1324. // CrossListedExternalDealIdType: Indicates that this ExternalDealId
  1325. // exists under at least two different AdxInventoryDeals. Currently, the
  1326. // only case that the same ExternalDealId will exist is programmatic
  1327. // cross sell case.
  1328. CrossListedExternalDealIdType string `json:"crossListedExternalDealIdType,omitempty"`
  1329. // Description: Description for the proposed terms of the deal.
  1330. Description string `json:"description,omitempty"`
  1331. // EstimatedGrossSpend: Non-binding estimate of the estimated gross
  1332. // spend for this deal Can be set by buyer or seller.
  1333. EstimatedGrossSpend *Price `json:"estimatedGrossSpend,omitempty"`
  1334. // EstimatedImpressionsPerDay: Non-binding estimate of the impressions
  1335. // served per day Can be set by buyer or seller.
  1336. EstimatedImpressionsPerDay int64 `json:"estimatedImpressionsPerDay,omitempty,string"`
  1337. // GuaranteedFixedPriceTerms: The terms for guaranteed fixed price
  1338. // deals.
  1339. GuaranteedFixedPriceTerms *DealTermsGuaranteedFixedPriceTerms `json:"guaranteedFixedPriceTerms,omitempty"`
  1340. // NonGuaranteedAuctionTerms: The terms for non-guaranteed auction
  1341. // deals.
  1342. NonGuaranteedAuctionTerms *DealTermsNonGuaranteedAuctionTerms `json:"nonGuaranteedAuctionTerms,omitempty"`
  1343. // NonGuaranteedFixedPriceTerms: The terms for non-guaranteed fixed
  1344. // price deals.
  1345. NonGuaranteedFixedPriceTerms *DealTermsNonGuaranteedFixedPriceTerms `json:"nonGuaranteedFixedPriceTerms,omitempty"`
  1346. // RubiconNonGuaranteedTerms: The terms for rubicon non-guaranteed
  1347. // deals.
  1348. RubiconNonGuaranteedTerms *DealTermsRubiconNonGuaranteedTerms `json:"rubiconNonGuaranteedTerms,omitempty"`
  1349. // SellerTimeZone: For deals with Cost Per Day billing, defines the
  1350. // timezone used to mark the boundaries of a day (buyer-readonly)
  1351. SellerTimeZone string `json:"sellerTimeZone,omitempty"`
  1352. // ForceSendFields is a list of field names (e.g. "BrandingType") to
  1353. // unconditionally include in API requests. By default, fields with
  1354. // empty values are omitted from API requests. However, any non-pointer,
  1355. // non-interface field appearing in ForceSendFields will be sent to the
  1356. // server regardless of whether the field is empty or not. This may be
  1357. // used to include empty fields in Patch requests.
  1358. ForceSendFields []string `json:"-"`
  1359. // NullFields is a list of field names (e.g. "BrandingType") to include
  1360. // in API requests with the JSON null value. By default, fields with
  1361. // empty values are omitted from API requests. However, any field with
  1362. // an empty value appearing in NullFields will be sent to the server as
  1363. // null. It is an error if a field in this list has a non-empty value.
  1364. // This may be used to include null fields in Patch requests.
  1365. NullFields []string `json:"-"`
  1366. }
  1367. func (s *DealTerms) MarshalJSON() ([]byte, error) {
  1368. type NoMethod DealTerms
  1369. raw := NoMethod(*s)
  1370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1371. }
  1372. type DealTermsGuaranteedFixedPriceTerms struct {
  1373. // BillingInfo: External billing info for this Deal. This field is
  1374. // relevant when external billing info such as price has a different
  1375. // currency code than DFP/AdX.
  1376. BillingInfo *DealTermsGuaranteedFixedPriceTermsBillingInfo `json:"billingInfo,omitempty"`
  1377. // FixedPrices: Fixed price for the specified buyer.
  1378. FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
  1379. // GuaranteedImpressions: Guaranteed impressions as a percentage. This
  1380. // is the percentage of guaranteed looks that the buyer is guaranteeing
  1381. // to buy.
  1382. GuaranteedImpressions int64 `json:"guaranteedImpressions,omitempty,string"`
  1383. // GuaranteedLooks: Count of guaranteed looks. Required for deal,
  1384. // optional for product. For CPD deals, buyer changes to
  1385. // guaranteed_looks will be ignored.
  1386. GuaranteedLooks int64 `json:"guaranteedLooks,omitempty,string"`
  1387. // MinimumDailyLooks: Count of minimum daily looks for a CPD deal. For
  1388. // CPD deals, buyer should negotiate on this field instead of
  1389. // guaranteed_looks.
  1390. MinimumDailyLooks int64 `json:"minimumDailyLooks,omitempty,string"`
  1391. // ForceSendFields is a list of field names (e.g. "BillingInfo") to
  1392. // unconditionally include in API requests. By default, fields with
  1393. // empty values are omitted from API requests. However, any non-pointer,
  1394. // non-interface field appearing in ForceSendFields will be sent to the
  1395. // server regardless of whether the field is empty or not. This may be
  1396. // used to include empty fields in Patch requests.
  1397. ForceSendFields []string `json:"-"`
  1398. // NullFields is a list of field names (e.g. "BillingInfo") to include
  1399. // in API requests with the JSON null value. By default, fields with
  1400. // empty values are omitted from API requests. However, any field with
  1401. // an empty value appearing in NullFields will be sent to the server as
  1402. // null. It is an error if a field in this list has a non-empty value.
  1403. // This may be used to include null fields in Patch requests.
  1404. NullFields []string `json:"-"`
  1405. }
  1406. func (s *DealTermsGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
  1407. type NoMethod DealTermsGuaranteedFixedPriceTerms
  1408. raw := NoMethod(*s)
  1409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1410. }
  1411. type DealTermsGuaranteedFixedPriceTermsBillingInfo struct {
  1412. // CurrencyConversionTimeMs: The timestamp (in ms since epoch) when the
  1413. // original reservation price for the deal was first converted to DFP
  1414. // currency. This is used to convert the contracted price into buyer's
  1415. // currency without discrepancy.
  1416. CurrencyConversionTimeMs int64 `json:"currencyConversionTimeMs,omitempty,string"`
  1417. // DfpLineItemId: The DFP line item id associated with this deal. For
  1418. // features like CPD, buyers can retrieve the DFP line item for billing
  1419. // reconciliation.
  1420. DfpLineItemId int64 `json:"dfpLineItemId,omitempty,string"`
  1421. // OriginalContractedQuantity: The original contracted quantity (#
  1422. // impressions) for this deal. To ensure delivery, sometimes the
  1423. // publisher will book the deal with a impression buffer, such that
  1424. // guaranteed_looks is greater than the contracted quantity. However
  1425. // clients are billed using the original contracted quantity.
  1426. OriginalContractedQuantity int64 `json:"originalContractedQuantity,omitempty,string"`
  1427. // Price: The original reservation price for the deal, if the currency
  1428. // code is different from the one used in negotiation.
  1429. Price *Price `json:"price,omitempty"`
  1430. // ForceSendFields is a list of field names (e.g.
  1431. // "CurrencyConversionTimeMs") to unconditionally include in API
  1432. // requests. By default, fields with empty values are omitted from API
  1433. // requests. However, any non-pointer, non-interface field appearing in
  1434. // ForceSendFields will be sent to the server regardless of whether the
  1435. // field is empty or not. This may be used to include empty fields in
  1436. // Patch requests.
  1437. ForceSendFields []string `json:"-"`
  1438. // NullFields is a list of field names (e.g. "CurrencyConversionTimeMs")
  1439. // to include in API requests with the JSON null value. By default,
  1440. // fields with empty values are omitted from API requests. However, any
  1441. // field with an empty value appearing in NullFields will be sent to the
  1442. // server as null. It is an error if a field in this list has a
  1443. // non-empty value. This may be used to include null fields in Patch
  1444. // requests.
  1445. NullFields []string `json:"-"`
  1446. }
  1447. func (s *DealTermsGuaranteedFixedPriceTermsBillingInfo) MarshalJSON() ([]byte, error) {
  1448. type NoMethod DealTermsGuaranteedFixedPriceTermsBillingInfo
  1449. raw := NoMethod(*s)
  1450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1451. }
  1452. type DealTermsNonGuaranteedAuctionTerms struct {
  1453. // AutoOptimizePrivateAuction: True if open auction buyers are allowed
  1454. // to compete with invited buyers in this private auction
  1455. // (buyer-readonly).
  1456. AutoOptimizePrivateAuction bool `json:"autoOptimizePrivateAuction,omitempty"`
  1457. // ReservePricePerBuyers: Reserve price for the specified buyer.
  1458. ReservePricePerBuyers []*PricePerBuyer `json:"reservePricePerBuyers,omitempty"`
  1459. // ForceSendFields is a list of field names (e.g.
  1460. // "AutoOptimizePrivateAuction") to unconditionally include in API
  1461. // requests. By default, fields with empty values are omitted from API
  1462. // requests. However, any non-pointer, non-interface field appearing in
  1463. // ForceSendFields will be sent to the server regardless of whether the
  1464. // field is empty or not. This may be used to include empty fields in
  1465. // Patch requests.
  1466. ForceSendFields []string `json:"-"`
  1467. // NullFields is a list of field names (e.g.
  1468. // "AutoOptimizePrivateAuction") to include in API requests with the
  1469. // JSON null value. By default, fields with empty values are omitted
  1470. // from API requests. However, any field with an empty value appearing
  1471. // in NullFields will be sent to the server as null. It is an error if a
  1472. // field in this list has a non-empty value. This may be used to include
  1473. // null fields in Patch requests.
  1474. NullFields []string `json:"-"`
  1475. }
  1476. func (s *DealTermsNonGuaranteedAuctionTerms) MarshalJSON() ([]byte, error) {
  1477. type NoMethod DealTermsNonGuaranteedAuctionTerms
  1478. raw := NoMethod(*s)
  1479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1480. }
  1481. type DealTermsNonGuaranteedFixedPriceTerms struct {
  1482. // FixedPrices: Fixed price for the specified buyer.
  1483. FixedPrices []*PricePerBuyer `json:"fixedPrices,omitempty"`
  1484. // ForceSendFields is a list of field names (e.g. "FixedPrices") to
  1485. // unconditionally include in API requests. By default, fields with
  1486. // empty values are omitted from API requests. However, any non-pointer,
  1487. // non-interface field appearing in ForceSendFields will be sent to the
  1488. // server regardless of whether the field is empty or not. This may be
  1489. // used to include empty fields in Patch requests.
  1490. ForceSendFields []string `json:"-"`
  1491. // NullFields is a list of field names (e.g. "FixedPrices") to include
  1492. // in API requests with the JSON null value. By default, fields with
  1493. // empty values are omitted from API requests. However, any field with
  1494. // an empty value appearing in NullFields will be sent to the server as
  1495. // null. It is an error if a field in this list has a non-empty value.
  1496. // This may be used to include null fields in Patch requests.
  1497. NullFields []string `json:"-"`
  1498. }
  1499. func (s *DealTermsNonGuaranteedFixedPriceTerms) MarshalJSON() ([]byte, error) {
  1500. type NoMethod DealTermsNonGuaranteedFixedPriceTerms
  1501. raw := NoMethod(*s)
  1502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1503. }
  1504. type DealTermsRubiconNonGuaranteedTerms struct {
  1505. // PriorityPrice: Optional price for Rubicon priority access in the
  1506. // auction.
  1507. PriorityPrice *Price `json:"priorityPrice,omitempty"`
  1508. // StandardPrice: Optional price for Rubicon standard access in the
  1509. // auction.
  1510. StandardPrice *Price `json:"standardPrice,omitempty"`
  1511. // ForceSendFields is a list of field names (e.g. "PriorityPrice") to
  1512. // unconditionally include in API requests. By default, fields with
  1513. // empty values are omitted from API requests. However, any non-pointer,
  1514. // non-interface field appearing in ForceSendFields will be sent to the
  1515. // server regardless of whether the field is empty or not. This may be
  1516. // used to include empty fields in Patch requests.
  1517. ForceSendFields []string `json:"-"`
  1518. // NullFields is a list of field names (e.g. "PriorityPrice") to include
  1519. // in API requests with the JSON null value. By default, fields with
  1520. // empty values are omitted from API requests. However, any field with
  1521. // an empty value appearing in NullFields will be sent to the server as
  1522. // null. It is an error if a field in this list has a non-empty value.
  1523. // This may be used to include null fields in Patch requests.
  1524. NullFields []string `json:"-"`
  1525. }
  1526. func (s *DealTermsRubiconNonGuaranteedTerms) MarshalJSON() ([]byte, error) {
  1527. type NoMethod DealTermsRubiconNonGuaranteedTerms
  1528. raw := NoMethod(*s)
  1529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1530. }
  1531. type DeleteOrderDealsRequest struct {
  1532. // DealIds: List of deals to delete for a given proposal
  1533. DealIds []string `json:"dealIds,omitempty"`
  1534. // ProposalRevisionNumber: The last known proposal revision number.
  1535. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  1536. // UpdateAction: Indicates an optional action to take on the proposal
  1537. UpdateAction string `json:"updateAction,omitempty"`
  1538. // ForceSendFields is a list of field names (e.g. "DealIds") to
  1539. // unconditionally include in API requests. By default, fields with
  1540. // empty values are omitted from API requests. However, any non-pointer,
  1541. // non-interface field appearing in ForceSendFields will be sent to the
  1542. // server regardless of whether the field is empty or not. This may be
  1543. // used to include empty fields in Patch requests.
  1544. ForceSendFields []string `json:"-"`
  1545. // NullFields is a list of field names (e.g. "DealIds") to include in
  1546. // API requests with the JSON null value. By default, fields with empty
  1547. // values are omitted from API requests. However, any field with an
  1548. // empty value appearing in NullFields will be sent to the server as
  1549. // null. It is an error if a field in this list has a non-empty value.
  1550. // This may be used to include null fields in Patch requests.
  1551. NullFields []string `json:"-"`
  1552. }
  1553. func (s *DeleteOrderDealsRequest) MarshalJSON() ([]byte, error) {
  1554. type NoMethod DeleteOrderDealsRequest
  1555. raw := NoMethod(*s)
  1556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1557. }
  1558. type DeleteOrderDealsResponse struct {
  1559. // Deals: List of deals deleted (in the same proposal as passed in the
  1560. // request)
  1561. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  1562. // ProposalRevisionNumber: The updated revision number for the proposal.
  1563. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  1564. // ServerResponse contains the HTTP response code and headers from the
  1565. // server.
  1566. googleapi.ServerResponse `json:"-"`
  1567. // ForceSendFields is a list of field names (e.g. "Deals") to
  1568. // unconditionally include in API requests. By default, fields with
  1569. // empty values are omitted from API requests. However, any non-pointer,
  1570. // non-interface field appearing in ForceSendFields will be sent to the
  1571. // server regardless of whether the field is empty or not. This may be
  1572. // used to include empty fields in Patch requests.
  1573. ForceSendFields []string `json:"-"`
  1574. // NullFields is a list of field names (e.g. "Deals") to include in API
  1575. // requests with the JSON null value. By default, fields with empty
  1576. // values are omitted from API requests. However, any field with an
  1577. // empty value appearing in NullFields will be sent to the server as
  1578. // null. It is an error if a field in this list has a non-empty value.
  1579. // This may be used to include null fields in Patch requests.
  1580. NullFields []string `json:"-"`
  1581. }
  1582. func (s *DeleteOrderDealsResponse) MarshalJSON() ([]byte, error) {
  1583. type NoMethod DeleteOrderDealsResponse
  1584. raw := NoMethod(*s)
  1585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1586. }
  1587. type DeliveryControl struct {
  1588. CreativeBlockingLevel string `json:"creativeBlockingLevel,omitempty"`
  1589. DeliveryRateType string `json:"deliveryRateType,omitempty"`
  1590. FrequencyCaps []*DeliveryControlFrequencyCap `json:"frequencyCaps,omitempty"`
  1591. // ForceSendFields is a list of field names (e.g.
  1592. // "CreativeBlockingLevel") to unconditionally include in API requests.
  1593. // By default, fields with empty values are omitted from API requests.
  1594. // However, any non-pointer, non-interface field appearing in
  1595. // ForceSendFields will be sent to the server regardless of whether the
  1596. // field is empty or not. This may be used to include empty fields in
  1597. // Patch requests.
  1598. ForceSendFields []string `json:"-"`
  1599. // NullFields is a list of field names (e.g. "CreativeBlockingLevel") 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 *DeliveryControl) MarshalJSON() ([]byte, error) {
  1609. type NoMethod DeliveryControl
  1610. raw := NoMethod(*s)
  1611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1612. }
  1613. type DeliveryControlFrequencyCap struct {
  1614. MaxImpressions int64 `json:"maxImpressions,omitempty"`
  1615. NumTimeUnits int64 `json:"numTimeUnits,omitempty"`
  1616. TimeUnitType string `json:"timeUnitType,omitempty"`
  1617. // ForceSendFields is a list of field names (e.g. "MaxImpressions") to
  1618. // unconditionally include in API requests. By default, fields with
  1619. // empty values are omitted from API requests. However, any non-pointer,
  1620. // non-interface field appearing in ForceSendFields will be sent to the
  1621. // server regardless of whether the field is empty or not. This may be
  1622. // used to include empty fields in Patch requests.
  1623. ForceSendFields []string `json:"-"`
  1624. // NullFields is a list of field names (e.g. "MaxImpressions") to
  1625. // include in API requests with the JSON null value. By default, fields
  1626. // with empty values are omitted from API requests. However, any field
  1627. // with an empty value appearing in NullFields will be sent to the
  1628. // server as null. It is an error if a field in this list has a
  1629. // non-empty value. This may be used to include null fields in Patch
  1630. // requests.
  1631. NullFields []string `json:"-"`
  1632. }
  1633. func (s *DeliveryControlFrequencyCap) MarshalJSON() ([]byte, error) {
  1634. type NoMethod DeliveryControlFrequencyCap
  1635. raw := NoMethod(*s)
  1636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1637. }
  1638. // Dimension: This message carries publisher provided breakdown. E.g.
  1639. // {dimension_type: 'COUNTRY', [{dimension_value: {id: 1, name: 'US'}},
  1640. // {dimension_value: {id: 2, name: 'UK'}}]}
  1641. type Dimension struct {
  1642. DimensionType string `json:"dimensionType,omitempty"`
  1643. DimensionValues []*DimensionDimensionValue `json:"dimensionValues,omitempty"`
  1644. // ForceSendFields is a list of field names (e.g. "DimensionType") to
  1645. // unconditionally include in API requests. By default, fields with
  1646. // empty values are omitted from API requests. However, any non-pointer,
  1647. // non-interface field appearing in ForceSendFields will be sent to the
  1648. // server regardless of whether the field is empty or not. This may be
  1649. // used to include empty fields in Patch requests.
  1650. ForceSendFields []string `json:"-"`
  1651. // NullFields is a list of field names (e.g. "DimensionType") to include
  1652. // in API requests with the JSON null value. By default, fields with
  1653. // empty values are omitted from API requests. However, any field with
  1654. // an empty value appearing in NullFields will be sent to the server as
  1655. // null. It is an error if a field in this list has a non-empty value.
  1656. // This may be used to include null fields in Patch requests.
  1657. NullFields []string `json:"-"`
  1658. }
  1659. func (s *Dimension) MarshalJSON() ([]byte, error) {
  1660. type NoMethod Dimension
  1661. raw := NoMethod(*s)
  1662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1663. }
  1664. // DimensionDimensionValue: Value of the dimension.
  1665. type DimensionDimensionValue struct {
  1666. // Id: Id of the dimension.
  1667. Id int64 `json:"id,omitempty"`
  1668. // Name: Name of the dimension mainly for debugging purposes, except for
  1669. // the case of CREATIVE_SIZE. For CREATIVE_SIZE, strings are used
  1670. // instead of ids.
  1671. Name string `json:"name,omitempty"`
  1672. // Percentage: Percent of total impressions for a dimension type. e.g.
  1673. // {dimension_type: 'GENDER', [{dimension_value: {id: 1, name: 'MALE',
  1674. // percentage: 60}}]} Gender MALE is 60% of all impressions which have
  1675. // gender.
  1676. Percentage int64 `json:"percentage,omitempty"`
  1677. // ForceSendFields is a list of field names (e.g. "Id") to
  1678. // unconditionally include in API requests. By default, fields with
  1679. // empty values are omitted from API requests. However, any non-pointer,
  1680. // non-interface field appearing in ForceSendFields will be sent to the
  1681. // server regardless of whether the field is empty or not. This may be
  1682. // used to include empty fields in Patch requests.
  1683. ForceSendFields []string `json:"-"`
  1684. // NullFields is a list of field names (e.g. "Id") to include in API
  1685. // requests with the JSON null value. By default, fields with empty
  1686. // values are omitted from API requests. However, any field with an
  1687. // empty value appearing in NullFields will be sent to the server as
  1688. // null. It is an error if a field in this list has a non-empty value.
  1689. // This may be used to include null fields in Patch requests.
  1690. NullFields []string `json:"-"`
  1691. }
  1692. func (s *DimensionDimensionValue) MarshalJSON() ([]byte, error) {
  1693. type NoMethod DimensionDimensionValue
  1694. raw := NoMethod(*s)
  1695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1696. }
  1697. type EditAllOrderDealsRequest struct {
  1698. // Deals: List of deals to edit. Service may perform 3 different
  1699. // operations based on comparison of deals in this list vs deals already
  1700. // persisted in database: 1. Add new deal to proposal If a deal in this
  1701. // list does not exist in the proposal, the service will create a new
  1702. // deal and add it to the proposal. Validation will follow
  1703. // AddOrderDealsRequest. 2. Update existing deal in the proposal If a
  1704. // deal in this list already exist in the proposal, the service will
  1705. // update that existing deal to this new deal in the request. Validation
  1706. // will follow UpdateOrderDealsRequest. 3. Delete deals from the
  1707. // proposal (just need the id) If a existing deal in the proposal is not
  1708. // present in this list, the service will delete that deal from the
  1709. // proposal. Validation will follow DeleteOrderDealsRequest.
  1710. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  1711. // Proposal: If specified, also updates the proposal in the batch
  1712. // transaction. This is useful when the proposal and the deals need to
  1713. // be updated in one transaction.
  1714. Proposal *Proposal `json:"proposal,omitempty"`
  1715. // ProposalRevisionNumber: The last known revision number for the
  1716. // proposal.
  1717. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  1718. // UpdateAction: Indicates an optional action to take on the proposal
  1719. UpdateAction string `json:"updateAction,omitempty"`
  1720. // ForceSendFields is a list of field names (e.g. "Deals") to
  1721. // unconditionally include in API requests. By default, fields with
  1722. // empty values are omitted from API requests. However, any non-pointer,
  1723. // non-interface field appearing in ForceSendFields will be sent to the
  1724. // server regardless of whether the field is empty or not. This may be
  1725. // used to include empty fields in Patch requests.
  1726. ForceSendFields []string `json:"-"`
  1727. // NullFields is a list of field names (e.g. "Deals") to include in API
  1728. // requests with the JSON null value. By default, fields with empty
  1729. // values are omitted from API requests. However, any field with an
  1730. // empty value appearing in NullFields will be sent to the server as
  1731. // null. It is an error if a field in this list has a non-empty value.
  1732. // This may be used to include null fields in Patch requests.
  1733. NullFields []string `json:"-"`
  1734. }
  1735. func (s *EditAllOrderDealsRequest) MarshalJSON() ([]byte, error) {
  1736. type NoMethod EditAllOrderDealsRequest
  1737. raw := NoMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1739. }
  1740. type EditAllOrderDealsResponse struct {
  1741. // Deals: List of all deals in the proposal after edit.
  1742. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  1743. // OrderRevisionNumber: The latest revision number after the update has
  1744. // been applied.
  1745. OrderRevisionNumber int64 `json:"orderRevisionNumber,omitempty,string"`
  1746. // ServerResponse contains the HTTP response code and headers from the
  1747. // server.
  1748. googleapi.ServerResponse `json:"-"`
  1749. // ForceSendFields is a list of field names (e.g. "Deals") to
  1750. // unconditionally include in API requests. By default, fields with
  1751. // empty values are omitted from API requests. However, any non-pointer,
  1752. // non-interface field appearing in ForceSendFields will be sent to the
  1753. // server regardless of whether the field is empty or not. This may be
  1754. // used to include empty fields in Patch requests.
  1755. ForceSendFields []string `json:"-"`
  1756. // NullFields is a list of field names (e.g. "Deals") to include in API
  1757. // requests with the JSON null value. By default, fields with empty
  1758. // values are omitted from API requests. However, any field with an
  1759. // empty value appearing in NullFields will be sent to the server as
  1760. // null. It is an error if a field in this list has a non-empty value.
  1761. // This may be used to include null fields in Patch requests.
  1762. NullFields []string `json:"-"`
  1763. }
  1764. func (s *EditAllOrderDealsResponse) MarshalJSON() ([]byte, error) {
  1765. type NoMethod EditAllOrderDealsResponse
  1766. raw := NoMethod(*s)
  1767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1768. }
  1769. type GetOffersResponse struct {
  1770. // Products: The returned list of products.
  1771. Products []*Product `json:"products,omitempty"`
  1772. // ServerResponse contains the HTTP response code and headers from the
  1773. // server.
  1774. googleapi.ServerResponse `json:"-"`
  1775. // ForceSendFields is a list of field names (e.g. "Products") to
  1776. // unconditionally include in API requests. By default, fields with
  1777. // empty values are omitted from API requests. However, any non-pointer,
  1778. // non-interface field appearing in ForceSendFields will be sent to the
  1779. // server regardless of whether the field is empty or not. This may be
  1780. // used to include empty fields in Patch requests.
  1781. ForceSendFields []string `json:"-"`
  1782. // NullFields is a list of field names (e.g. "Products") to include in
  1783. // API requests with the JSON null value. By default, fields with empty
  1784. // values are omitted from API requests. However, any field with an
  1785. // empty value appearing in NullFields will be sent to the server as
  1786. // null. It is an error if a field in this list has a non-empty value.
  1787. // This may be used to include null fields in Patch requests.
  1788. NullFields []string `json:"-"`
  1789. }
  1790. func (s *GetOffersResponse) MarshalJSON() ([]byte, error) {
  1791. type NoMethod GetOffersResponse
  1792. raw := NoMethod(*s)
  1793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1794. }
  1795. type GetOrderDealsResponse struct {
  1796. // Deals: List of deals for the proposal
  1797. Deals []*MarketplaceDeal `json:"deals,omitempty"`
  1798. // ServerResponse contains the HTTP response code and headers from the
  1799. // server.
  1800. googleapi.ServerResponse `json:"-"`
  1801. // ForceSendFields is a list of field names (e.g. "Deals") to
  1802. // unconditionally include in API requests. By default, fields with
  1803. // empty values are omitted from API requests. However, any non-pointer,
  1804. // non-interface field appearing in ForceSendFields will be sent to the
  1805. // server regardless of whether the field is empty or not. This may be
  1806. // used to include empty fields in Patch requests.
  1807. ForceSendFields []string `json:"-"`
  1808. // NullFields is a list of field names (e.g. "Deals") to include in API
  1809. // requests with the JSON null value. By default, fields with empty
  1810. // values are omitted from API requests. However, any field with an
  1811. // empty value appearing in NullFields will be sent to the server as
  1812. // null. It is an error if a field in this list has a non-empty value.
  1813. // This may be used to include null fields in Patch requests.
  1814. NullFields []string `json:"-"`
  1815. }
  1816. func (s *GetOrderDealsResponse) MarshalJSON() ([]byte, error) {
  1817. type NoMethod GetOrderDealsResponse
  1818. raw := NoMethod(*s)
  1819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1820. }
  1821. type GetOrderNotesResponse struct {
  1822. // Notes: The list of matching notes. The notes for a proposal are
  1823. // ordered from oldest to newest. If the notes span multiple proposals,
  1824. // they will be grouped by proposal, with the notes for the most
  1825. // recently modified proposal appearing first.
  1826. Notes []*MarketplaceNote `json:"notes,omitempty"`
  1827. // ServerResponse contains the HTTP response code and headers from the
  1828. // server.
  1829. googleapi.ServerResponse `json:"-"`
  1830. // ForceSendFields is a list of field names (e.g. "Notes") to
  1831. // unconditionally include in API requests. By default, fields with
  1832. // empty values are omitted from API requests. However, any non-pointer,
  1833. // non-interface field appearing in ForceSendFields will be sent to the
  1834. // server regardless of whether the field is empty or not. This may be
  1835. // used to include empty fields in Patch requests.
  1836. ForceSendFields []string `json:"-"`
  1837. // NullFields is a list of field names (e.g. "Notes") to include in API
  1838. // requests with the JSON null value. By default, fields with empty
  1839. // values are omitted from API requests. However, any field with an
  1840. // empty value appearing in NullFields will be sent to the server as
  1841. // null. It is an error if a field in this list has a non-empty value.
  1842. // This may be used to include null fields in Patch requests.
  1843. NullFields []string `json:"-"`
  1844. }
  1845. func (s *GetOrderNotesResponse) MarshalJSON() ([]byte, error) {
  1846. type NoMethod GetOrderNotesResponse
  1847. raw := NoMethod(*s)
  1848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1849. }
  1850. type GetOrdersResponse struct {
  1851. // Proposals: The list of matching proposals.
  1852. Proposals []*Proposal `json:"proposals,omitempty"`
  1853. // ServerResponse contains the HTTP response code and headers from the
  1854. // server.
  1855. googleapi.ServerResponse `json:"-"`
  1856. // ForceSendFields is a list of field names (e.g. "Proposals") to
  1857. // unconditionally include in API requests. By default, fields with
  1858. // empty values are omitted from API requests. However, any non-pointer,
  1859. // non-interface field appearing in ForceSendFields will be sent to the
  1860. // server regardless of whether the field is empty or not. This may be
  1861. // used to include empty fields in Patch requests.
  1862. ForceSendFields []string `json:"-"`
  1863. // NullFields is a list of field names (e.g. "Proposals") to include in
  1864. // API requests with the JSON null value. By default, fields with empty
  1865. // values are omitted from API requests. However, any field with an
  1866. // empty value appearing in NullFields will be sent to the server as
  1867. // null. It is an error if a field in this list has a non-empty value.
  1868. // This may be used to include null fields in Patch requests.
  1869. NullFields []string `json:"-"`
  1870. }
  1871. func (s *GetOrdersResponse) MarshalJSON() ([]byte, error) {
  1872. type NoMethod GetOrdersResponse
  1873. raw := NoMethod(*s)
  1874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1875. }
  1876. type GetPublisherProfilesByAccountIdResponse struct {
  1877. // Profiles: Profiles for the requested publisher
  1878. Profiles []*PublisherProfileApiProto `json:"profiles,omitempty"`
  1879. // ServerResponse contains the HTTP response code and headers from the
  1880. // server.
  1881. googleapi.ServerResponse `json:"-"`
  1882. // ForceSendFields is a list of field names (e.g. "Profiles") to
  1883. // unconditionally include in API requests. By default, fields with
  1884. // empty values are omitted from API requests. However, any non-pointer,
  1885. // non-interface field appearing in ForceSendFields will be sent to the
  1886. // server regardless of whether the field is empty or not. This may be
  1887. // used to include empty fields in Patch requests.
  1888. ForceSendFields []string `json:"-"`
  1889. // NullFields is a list of field names (e.g. "Profiles") to include in
  1890. // API requests with the JSON null value. By default, fields with empty
  1891. // values are omitted from API requests. However, any field with an
  1892. // empty value appearing in NullFields will be sent to the server as
  1893. // null. It is an error if a field in this list has a non-empty value.
  1894. // This may be used to include null fields in Patch requests.
  1895. NullFields []string `json:"-"`
  1896. }
  1897. func (s *GetPublisherProfilesByAccountIdResponse) MarshalJSON() ([]byte, error) {
  1898. type NoMethod GetPublisherProfilesByAccountIdResponse
  1899. raw := NoMethod(*s)
  1900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1901. }
  1902. // MarketplaceDeal: A proposal can contain multiple deals. A deal
  1903. // contains the terms and targeting information that is used for
  1904. // serving.
  1905. type MarketplaceDeal struct {
  1906. // BuyerPrivateData: Buyer private data (hidden from seller).
  1907. BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
  1908. // CreationTimeMs: The time (ms since epoch) of the deal creation.
  1909. // (readonly)
  1910. CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"`
  1911. // CreativePreApprovalPolicy: Specifies the creative pre-approval policy
  1912. // (buyer-readonly)
  1913. CreativePreApprovalPolicy string `json:"creativePreApprovalPolicy,omitempty"`
  1914. // CreativeSafeFrameCompatibility: Specifies whether the creative is
  1915. // safeFrame compatible (buyer-readonly)
  1916. CreativeSafeFrameCompatibility string `json:"creativeSafeFrameCompatibility,omitempty"`
  1917. // DealId: A unique deal-id for the deal (readonly).
  1918. DealId string `json:"dealId,omitempty"`
  1919. // DealServingMetadata: Metadata about the serving status of this deal
  1920. // (readonly, writes via custom actions)
  1921. DealServingMetadata *DealServingMetadata `json:"dealServingMetadata,omitempty"`
  1922. // DeliveryControl: The set of fields around delivery control that are
  1923. // interesting for a buyer to see but are non-negotiable. These are set
  1924. // by the publisher. This message is assigned an id of 100 since some
  1925. // day we would want to model this as a protobuf extension.
  1926. DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
  1927. // ExternalDealId: The external deal id assigned to this deal once the
  1928. // deal is finalized. This is the deal-id that shows up in
  1929. // serving/reporting etc. (readonly)
  1930. ExternalDealId string `json:"externalDealId,omitempty"`
  1931. // FlightEndTimeMs: Proposed flight end time of the deal (ms since
  1932. // epoch) This will generally be stored in a granularity of a second.
  1933. // (updatable)
  1934. FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"`
  1935. // FlightStartTimeMs: Proposed flight start time of the deal (ms since
  1936. // epoch) This will generally be stored in a granularity of a second.
  1937. // (updatable)
  1938. FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"`
  1939. // InventoryDescription: Description for the deal terms.
  1940. // (buyer-readonly)
  1941. InventoryDescription string `json:"inventoryDescription,omitempty"`
  1942. // IsRfpTemplate: Indicates whether the current deal is a RFP template.
  1943. // RFP template is created by buyer and not based on seller created
  1944. // products.
  1945. IsRfpTemplate bool `json:"isRfpTemplate,omitempty"`
  1946. // IsSetupComplete: True, if the buyside inventory setup is complete for
  1947. // this deal. (readonly, except via OrderSetupCompleted action)
  1948. IsSetupComplete bool `json:"isSetupComplete,omitempty"`
  1949. // Kind: Identifies what kind of resource this is. Value: the fixed
  1950. // string "adexchangebuyer#marketplaceDeal".
  1951. Kind string `json:"kind,omitempty"`
  1952. // LastUpdateTimeMs: The time (ms since epoch) when the deal was last
  1953. // updated. (readonly)
  1954. LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"`
  1955. // Name: The name of the deal. (updatable)
  1956. Name string `json:"name,omitempty"`
  1957. // ProductId: The product-id from which this deal was created.
  1958. // (readonly, except on create)
  1959. ProductId string `json:"productId,omitempty"`
  1960. // ProductRevisionNumber: The revision number of the product that the
  1961. // deal was created from (readonly, except on create)
  1962. ProductRevisionNumber int64 `json:"productRevisionNumber,omitempty,string"`
  1963. // ProgrammaticCreativeSource: Specifies the creative source for
  1964. // programmatic deals, PUBLISHER means creative is provided by seller
  1965. // and ADVERTISR means creative is provided by buyer. (buyer-readonly)
  1966. ProgrammaticCreativeSource string `json:"programmaticCreativeSource,omitempty"`
  1967. ProposalId string `json:"proposalId,omitempty"`
  1968. // SellerContacts: Optional Seller contact information for the deal
  1969. // (buyer-readonly)
  1970. SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
  1971. // SharedTargetings: The shared targeting visible to buyers and sellers.
  1972. // Each shared targeting entity is AND'd together. (updatable)
  1973. SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"`
  1974. // SyndicationProduct: The syndication product associated with the deal.
  1975. // (readonly, except on create)
  1976. SyndicationProduct string `json:"syndicationProduct,omitempty"`
  1977. // Terms: The negotiable terms of the deal. (updatable)
  1978. Terms *DealTerms `json:"terms,omitempty"`
  1979. WebPropertyCode string `json:"webPropertyCode,omitempty"`
  1980. // ForceSendFields is a list of field names (e.g. "BuyerPrivateData") to
  1981. // unconditionally include in API requests. By default, fields with
  1982. // empty values are omitted from API requests. However, any non-pointer,
  1983. // non-interface field appearing in ForceSendFields will be sent to the
  1984. // server regardless of whether the field is empty or not. This may be
  1985. // used to include empty fields in Patch requests.
  1986. ForceSendFields []string `json:"-"`
  1987. // NullFields is a list of field names (e.g. "BuyerPrivateData") to
  1988. // include in API requests with the JSON null value. By default, fields
  1989. // with empty values are omitted from API requests. However, any field
  1990. // with an empty value appearing in NullFields will be sent to the
  1991. // server as null. It is an error if a field in this list has a
  1992. // non-empty value. This may be used to include null fields in Patch
  1993. // requests.
  1994. NullFields []string `json:"-"`
  1995. }
  1996. func (s *MarketplaceDeal) MarshalJSON() ([]byte, error) {
  1997. type NoMethod MarketplaceDeal
  1998. raw := NoMethod(*s)
  1999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2000. }
  2001. type MarketplaceDealParty struct {
  2002. // Buyer: The buyer/seller associated with the deal. One of buyer/seller
  2003. // is specified for a deal-party.
  2004. Buyer *Buyer `json:"buyer,omitempty"`
  2005. // Seller: The buyer/seller associated with the deal. One of
  2006. // buyer/seller is specified for a deal party.
  2007. Seller *Seller `json:"seller,omitempty"`
  2008. // ForceSendFields is a list of field names (e.g. "Buyer") to
  2009. // unconditionally include in API requests. By default, fields with
  2010. // empty values are omitted from API requests. However, any non-pointer,
  2011. // non-interface field appearing in ForceSendFields will be sent to the
  2012. // server regardless of whether the field is empty or not. This may be
  2013. // used to include empty fields in Patch requests.
  2014. ForceSendFields []string `json:"-"`
  2015. // NullFields is a list of field names (e.g. "Buyer") to include in API
  2016. // requests with the JSON null value. By default, fields with empty
  2017. // values are omitted from API requests. However, any field with an
  2018. // empty value appearing in NullFields will be sent to the server as
  2019. // null. It is an error if a field in this list has a non-empty value.
  2020. // This may be used to include null fields in Patch requests.
  2021. NullFields []string `json:"-"`
  2022. }
  2023. func (s *MarketplaceDealParty) MarshalJSON() ([]byte, error) {
  2024. type NoMethod MarketplaceDealParty
  2025. raw := NoMethod(*s)
  2026. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2027. }
  2028. type MarketplaceLabel struct {
  2029. // AccountId: The accountId of the party that created the label.
  2030. AccountId string `json:"accountId,omitempty"`
  2031. // CreateTimeMs: The creation time (in ms since epoch) for the label.
  2032. CreateTimeMs int64 `json:"createTimeMs,omitempty,string"`
  2033. // DeprecatedMarketplaceDealParty: Information about the party that
  2034. // created the label.
  2035. DeprecatedMarketplaceDealParty *MarketplaceDealParty `json:"deprecatedMarketplaceDealParty,omitempty"`
  2036. // Label: The label to use.
  2037. Label string `json:"label,omitempty"`
  2038. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2039. // unconditionally include in API requests. By default, fields with
  2040. // empty values are omitted from API requests. However, any non-pointer,
  2041. // non-interface field appearing in ForceSendFields will be sent to the
  2042. // server regardless of whether the field is empty or not. This may be
  2043. // used to include empty fields in Patch requests.
  2044. ForceSendFields []string `json:"-"`
  2045. // NullFields is a list of field names (e.g. "AccountId") to include in
  2046. // API requests with the JSON null value. By default, fields with empty
  2047. // values are omitted from API requests. However, any field with an
  2048. // empty value appearing in NullFields will be sent to the server as
  2049. // null. It is an error if a field in this list has a non-empty value.
  2050. // This may be used to include null fields in Patch requests.
  2051. NullFields []string `json:"-"`
  2052. }
  2053. func (s *MarketplaceLabel) MarshalJSON() ([]byte, error) {
  2054. type NoMethod MarketplaceLabel
  2055. raw := NoMethod(*s)
  2056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2057. }
  2058. // MarketplaceNote: A proposal is associated with a bunch of notes which
  2059. // may optionally be associated with a deal and/or revision number.
  2060. type MarketplaceNote struct {
  2061. // CreatorRole: The role of the person (buyer/seller) creating the note.
  2062. // (readonly)
  2063. CreatorRole string `json:"creatorRole,omitempty"`
  2064. // DealId: Notes can optionally be associated with a deal. (readonly,
  2065. // except on create)
  2066. DealId string `json:"dealId,omitempty"`
  2067. // Kind: Identifies what kind of resource this is. Value: the fixed
  2068. // string "adexchangebuyer#marketplaceNote".
  2069. Kind string `json:"kind,omitempty"`
  2070. // Note: The actual note to attach. (readonly, except on create)
  2071. Note string `json:"note,omitempty"`
  2072. // NoteId: The unique id for the note. (readonly)
  2073. NoteId string `json:"noteId,omitempty"`
  2074. // ProposalId: The proposalId that a note is attached to. (readonly)
  2075. ProposalId string `json:"proposalId,omitempty"`
  2076. // ProposalRevisionNumber: If the note is associated with a proposal
  2077. // revision number, then store that here. (readonly, except on create)
  2078. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  2079. // TimestampMs: The timestamp (ms since epoch) that this note was
  2080. // created. (readonly)
  2081. TimestampMs int64 `json:"timestampMs,omitempty,string"`
  2082. // ForceSendFields is a list of field names (e.g. "CreatorRole") to
  2083. // unconditionally include in API requests. By default, fields with
  2084. // empty values are omitted from API requests. However, any non-pointer,
  2085. // non-interface field appearing in ForceSendFields will be sent to the
  2086. // server regardless of whether the field is empty or not. This may be
  2087. // used to include empty fields in Patch requests.
  2088. ForceSendFields []string `json:"-"`
  2089. // NullFields is a list of field names (e.g. "CreatorRole") to include
  2090. // in API requests with the JSON null value. By default, fields with
  2091. // empty values are omitted from API requests. However, any field with
  2092. // an empty value appearing in NullFields will be sent to the server as
  2093. // null. It is an error if a field in this list has a non-empty value.
  2094. // This may be used to include null fields in Patch requests.
  2095. NullFields []string `json:"-"`
  2096. }
  2097. func (s *MarketplaceNote) MarshalJSON() ([]byte, error) {
  2098. type NoMethod MarketplaceNote
  2099. raw := NoMethod(*s)
  2100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2101. }
  2102. // PerformanceReport: The configuration data for an Ad Exchange
  2103. // performance report list.
  2104. type PerformanceReport struct {
  2105. // BidRate: The number of bid responses with an ad.
  2106. BidRate float64 `json:"bidRate,omitempty"`
  2107. // BidRequestRate: The number of bid requests sent to your bidder.
  2108. BidRequestRate float64 `json:"bidRequestRate,omitempty"`
  2109. // CalloutStatusRate: Rate of various prefiltering statuses per match.
  2110. // Please refer to the callout-status-codes.txt file for different
  2111. // statuses.
  2112. CalloutStatusRate []interface{} `json:"calloutStatusRate,omitempty"`
  2113. // CookieMatcherStatusRate: Average QPS for cookie matcher operations.
  2114. CookieMatcherStatusRate []interface{} `json:"cookieMatcherStatusRate,omitempty"`
  2115. // CreativeStatusRate: Rate of ads with a given status. Please refer to
  2116. // the creative-status-codes.txt file for different statuses.
  2117. CreativeStatusRate []interface{} `json:"creativeStatusRate,omitempty"`
  2118. // FilteredBidRate: The number of bid responses that were filtered due
  2119. // to a policy violation or other errors.
  2120. FilteredBidRate float64 `json:"filteredBidRate,omitempty"`
  2121. // HostedMatchStatusRate: Average QPS for hosted match operations.
  2122. HostedMatchStatusRate []interface{} `json:"hostedMatchStatusRate,omitempty"`
  2123. // InventoryMatchRate: The number of potential queries based on your
  2124. // pretargeting settings.
  2125. InventoryMatchRate float64 `json:"inventoryMatchRate,omitempty"`
  2126. // Kind: Resource type.
  2127. Kind string `json:"kind,omitempty"`
  2128. // Latency50thPercentile: The 50th percentile round trip latency(ms) as
  2129. // perceived from Google servers for the duration period covered by the
  2130. // report.
  2131. Latency50thPercentile float64 `json:"latency50thPercentile,omitempty"`
  2132. // Latency85thPercentile: The 85th percentile round trip latency(ms) as
  2133. // perceived from Google servers for the duration period covered by the
  2134. // report.
  2135. Latency85thPercentile float64 `json:"latency85thPercentile,omitempty"`
  2136. // Latency95thPercentile: The 95th percentile round trip latency(ms) as
  2137. // perceived from Google servers for the duration period covered by the
  2138. // report.
  2139. Latency95thPercentile float64 `json:"latency95thPercentile,omitempty"`
  2140. // NoQuotaInRegion: Rate of various quota account statuses per quota
  2141. // check.
  2142. NoQuotaInRegion float64 `json:"noQuotaInRegion,omitempty"`
  2143. // OutOfQuota: Rate of various quota account statuses per quota check.
  2144. OutOfQuota float64 `json:"outOfQuota,omitempty"`
  2145. // PixelMatchRequests: Average QPS for pixel match requests from
  2146. // clients.
  2147. PixelMatchRequests float64 `json:"pixelMatchRequests,omitempty"`
  2148. // PixelMatchResponses: Average QPS for pixel match responses from
  2149. // clients.
  2150. PixelMatchResponses float64 `json:"pixelMatchResponses,omitempty"`
  2151. // QuotaConfiguredLimit: The configured quota limits for this account.
  2152. QuotaConfiguredLimit float64 `json:"quotaConfiguredLimit,omitempty"`
  2153. // QuotaThrottledLimit: The throttled quota limits for this account.
  2154. QuotaThrottledLimit float64 `json:"quotaThrottledLimit,omitempty"`
  2155. // Region: The trading location of this data.
  2156. Region string `json:"region,omitempty"`
  2157. // SuccessfulRequestRate: The number of properly formed bid responses
  2158. // received by our servers within the deadline.
  2159. SuccessfulRequestRate float64 `json:"successfulRequestRate,omitempty"`
  2160. // Timestamp: The unix timestamp of the starting time of this
  2161. // performance data.
  2162. Timestamp int64 `json:"timestamp,omitempty,string"`
  2163. // UnsuccessfulRequestRate: The number of bid responses that were
  2164. // unsuccessful due to timeouts, incorrect formatting, etc.
  2165. UnsuccessfulRequestRate float64 `json:"unsuccessfulRequestRate,omitempty"`
  2166. // ForceSendFields is a list of field names (e.g. "BidRate") to
  2167. // unconditionally include in API requests. By default, fields with
  2168. // empty values are omitted from API requests. However, any non-pointer,
  2169. // non-interface field appearing in ForceSendFields will be sent to the
  2170. // server regardless of whether the field is empty or not. This may be
  2171. // used to include empty fields in Patch requests.
  2172. ForceSendFields []string `json:"-"`
  2173. // NullFields is a list of field names (e.g. "BidRate") to include in
  2174. // API requests with the JSON null value. By default, fields with empty
  2175. // values are omitted from API requests. However, any field with an
  2176. // empty value appearing in NullFields will be sent to the server as
  2177. // null. It is an error if a field in this list has a non-empty value.
  2178. // This may be used to include null fields in Patch requests.
  2179. NullFields []string `json:"-"`
  2180. }
  2181. func (s *PerformanceReport) MarshalJSON() ([]byte, error) {
  2182. type NoMethod PerformanceReport
  2183. raw := NoMethod(*s)
  2184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2185. }
  2186. func (s *PerformanceReport) UnmarshalJSON(data []byte) error {
  2187. type NoMethod PerformanceReport
  2188. var s1 struct {
  2189. BidRate gensupport.JSONFloat64 `json:"bidRate"`
  2190. BidRequestRate gensupport.JSONFloat64 `json:"bidRequestRate"`
  2191. FilteredBidRate gensupport.JSONFloat64 `json:"filteredBidRate"`
  2192. InventoryMatchRate gensupport.JSONFloat64 `json:"inventoryMatchRate"`
  2193. Latency50thPercentile gensupport.JSONFloat64 `json:"latency50thPercentile"`
  2194. Latency85thPercentile gensupport.JSONFloat64 `json:"latency85thPercentile"`
  2195. Latency95thPercentile gensupport.JSONFloat64 `json:"latency95thPercentile"`
  2196. NoQuotaInRegion gensupport.JSONFloat64 `json:"noQuotaInRegion"`
  2197. OutOfQuota gensupport.JSONFloat64 `json:"outOfQuota"`
  2198. PixelMatchRequests gensupport.JSONFloat64 `json:"pixelMatchRequests"`
  2199. PixelMatchResponses gensupport.JSONFloat64 `json:"pixelMatchResponses"`
  2200. QuotaConfiguredLimit gensupport.JSONFloat64 `json:"quotaConfiguredLimit"`
  2201. QuotaThrottledLimit gensupport.JSONFloat64 `json:"quotaThrottledLimit"`
  2202. SuccessfulRequestRate gensupport.JSONFloat64 `json:"successfulRequestRate"`
  2203. UnsuccessfulRequestRate gensupport.JSONFloat64 `json:"unsuccessfulRequestRate"`
  2204. *NoMethod
  2205. }
  2206. s1.NoMethod = (*NoMethod)(s)
  2207. if err := json.Unmarshal(data, &s1); err != nil {
  2208. return err
  2209. }
  2210. s.BidRate = float64(s1.BidRate)
  2211. s.BidRequestRate = float64(s1.BidRequestRate)
  2212. s.FilteredBidRate = float64(s1.FilteredBidRate)
  2213. s.InventoryMatchRate = float64(s1.InventoryMatchRate)
  2214. s.Latency50thPercentile = float64(s1.Latency50thPercentile)
  2215. s.Latency85thPercentile = float64(s1.Latency85thPercentile)
  2216. s.Latency95thPercentile = float64(s1.Latency95thPercentile)
  2217. s.NoQuotaInRegion = float64(s1.NoQuotaInRegion)
  2218. s.OutOfQuota = float64(s1.OutOfQuota)
  2219. s.PixelMatchRequests = float64(s1.PixelMatchRequests)
  2220. s.PixelMatchResponses = float64(s1.PixelMatchResponses)
  2221. s.QuotaConfiguredLimit = float64(s1.QuotaConfiguredLimit)
  2222. s.QuotaThrottledLimit = float64(s1.QuotaThrottledLimit)
  2223. s.SuccessfulRequestRate = float64(s1.SuccessfulRequestRate)
  2224. s.UnsuccessfulRequestRate = float64(s1.UnsuccessfulRequestRate)
  2225. return nil
  2226. }
  2227. // PerformanceReportList: The configuration data for an Ad Exchange
  2228. // performance report list.
  2229. type PerformanceReportList struct {
  2230. // Kind: Resource type.
  2231. Kind string `json:"kind,omitempty"`
  2232. // PerformanceReport: A list of performance reports relevant for the
  2233. // account.
  2234. PerformanceReport []*PerformanceReport `json:"performanceReport,omitempty"`
  2235. // ServerResponse contains the HTTP response code and headers from the
  2236. // server.
  2237. googleapi.ServerResponse `json:"-"`
  2238. // ForceSendFields is a list of field names (e.g. "Kind") to
  2239. // unconditionally include in API requests. By default, fields with
  2240. // empty values are omitted from API requests. However, any non-pointer,
  2241. // non-interface field appearing in ForceSendFields will be sent to the
  2242. // server regardless of whether the field is empty or not. This may be
  2243. // used to include empty fields in Patch requests.
  2244. ForceSendFields []string `json:"-"`
  2245. // NullFields is a list of field names (e.g. "Kind") to include in API
  2246. // requests with the JSON null value. By default, fields with empty
  2247. // values are omitted from API requests. However, any field with an
  2248. // empty value appearing in NullFields will be sent to the server as
  2249. // null. It is an error if a field in this list has a non-empty value.
  2250. // This may be used to include null fields in Patch requests.
  2251. NullFields []string `json:"-"`
  2252. }
  2253. func (s *PerformanceReportList) MarshalJSON() ([]byte, error) {
  2254. type NoMethod PerformanceReportList
  2255. raw := NoMethod(*s)
  2256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2257. }
  2258. type PretargetingConfig struct {
  2259. // BillingId: The id for billing purposes, provided for reference. Leave
  2260. // this field blank for insert requests; the id will be generated
  2261. // automatically.
  2262. BillingId int64 `json:"billingId,omitempty,string"`
  2263. // ConfigId: The config id; generated automatically. Leave this field
  2264. // blank for insert requests.
  2265. ConfigId int64 `json:"configId,omitempty,string"`
  2266. // ConfigName: The name of the config. Must be unique. Required for all
  2267. // requests.
  2268. ConfigName string `json:"configName,omitempty"`
  2269. // CreativeType: List must contain exactly one of
  2270. // PRETARGETING_CREATIVE_TYPE_HTML or PRETARGETING_CREATIVE_TYPE_VIDEO.
  2271. CreativeType []string `json:"creativeType,omitempty"`
  2272. // Dimensions: Requests which allow one of these (width, height) pairs
  2273. // will match. All pairs must be supported ad dimensions.
  2274. Dimensions []*PretargetingConfigDimensions `json:"dimensions,omitempty"`
  2275. // ExcludedContentLabels: Requests with any of these content labels will
  2276. // not match. Values are from content-labels.txt in the downloadable
  2277. // files section.
  2278. ExcludedContentLabels googleapi.Int64s `json:"excludedContentLabels,omitempty"`
  2279. // ExcludedGeoCriteriaIds: Requests containing any of these geo criteria
  2280. // ids will not match.
  2281. ExcludedGeoCriteriaIds googleapi.Int64s `json:"excludedGeoCriteriaIds,omitempty"`
  2282. // ExcludedPlacements: Requests containing any of these placements will
  2283. // not match.
  2284. ExcludedPlacements []*PretargetingConfigExcludedPlacements `json:"excludedPlacements,omitempty"`
  2285. // ExcludedUserLists: Requests containing any of these users list ids
  2286. // will not match.
  2287. ExcludedUserLists googleapi.Int64s `json:"excludedUserLists,omitempty"`
  2288. // ExcludedVerticals: Requests containing any of these vertical ids will
  2289. // not match. Values are from the publisher-verticals.txt file in the
  2290. // downloadable files section.
  2291. ExcludedVerticals googleapi.Int64s `json:"excludedVerticals,omitempty"`
  2292. // GeoCriteriaIds: Requests containing any of these geo criteria ids
  2293. // will match.
  2294. GeoCriteriaIds googleapi.Int64s `json:"geoCriteriaIds,omitempty"`
  2295. // IsActive: Whether this config is active. Required for all requests.
  2296. IsActive bool `json:"isActive,omitempty"`
  2297. // Kind: The kind of the resource, i.e.
  2298. // "adexchangebuyer#pretargetingConfig".
  2299. Kind string `json:"kind,omitempty"`
  2300. // Languages: Request containing any of these language codes will match.
  2301. Languages []string `json:"languages,omitempty"`
  2302. // MinimumViewabilityDecile: Requests where the predicted viewability is
  2303. // below the specified decile will not match. E.g. if the buyer sets
  2304. // this value to 5, requests from slots where the predicted viewability
  2305. // is below 50% will not match. If the predicted viewability is unknown
  2306. // this field will be ignored.
  2307. MinimumViewabilityDecile int64 `json:"minimumViewabilityDecile,omitempty"`
  2308. // MobileCarriers: Requests containing any of these mobile carrier ids
  2309. // will match. Values are from mobile-carriers.csv in the downloadable
  2310. // files section.
  2311. MobileCarriers googleapi.Int64s `json:"mobileCarriers,omitempty"`
  2312. // MobileDevices: Requests containing any of these mobile device ids
  2313. // will match. Values are from mobile-devices.csv in the downloadable
  2314. // files section.
  2315. MobileDevices googleapi.Int64s `json:"mobileDevices,omitempty"`
  2316. // MobileOperatingSystemVersions: Requests containing any of these
  2317. // mobile operating system version ids will match. Values are from
  2318. // mobile-os.csv in the downloadable files section.
  2319. MobileOperatingSystemVersions googleapi.Int64s `json:"mobileOperatingSystemVersions,omitempty"`
  2320. // Placements: Requests containing any of these placements will match.
  2321. Placements []*PretargetingConfigPlacements `json:"placements,omitempty"`
  2322. // Platforms: Requests matching any of these platforms will match.
  2323. // Possible values are PRETARGETING_PLATFORM_MOBILE,
  2324. // PRETARGETING_PLATFORM_DESKTOP, and PRETARGETING_PLATFORM_TABLET.
  2325. Platforms []string `json:"platforms,omitempty"`
  2326. // SupportedCreativeAttributes: Creative attributes should be declared
  2327. // here if all creatives corresponding to this pretargeting
  2328. // configuration have that creative attribute. Values are from
  2329. // pretargetable-creative-attributes.txt in the downloadable files
  2330. // section.
  2331. SupportedCreativeAttributes googleapi.Int64s `json:"supportedCreativeAttributes,omitempty"`
  2332. // UserIdentifierDataRequired: Requests containing the specified type of
  2333. // user data will match. Possible values are HOSTED_MATCH_DATA, which
  2334. // means the request is cookie-targetable and has a match in the buyer's
  2335. // hosted match table, and COOKIE_OR_IDFA, which means the request has
  2336. // either a targetable cookie or an iOS IDFA.
  2337. UserIdentifierDataRequired []string `json:"userIdentifierDataRequired,omitempty"`
  2338. // UserLists: Requests containing any of these user list ids will match.
  2339. UserLists googleapi.Int64s `json:"userLists,omitempty"`
  2340. // VendorTypes: Requests that allow any of these vendor ids will match.
  2341. // Values are from vendors.txt in the downloadable files section.
  2342. VendorTypes googleapi.Int64s `json:"vendorTypes,omitempty"`
  2343. // Verticals: Requests containing any of these vertical ids will match.
  2344. Verticals googleapi.Int64s `json:"verticals,omitempty"`
  2345. // VideoPlayerSizes: Video requests satisfying any of these player size
  2346. // constraints will match.
  2347. VideoPlayerSizes []*PretargetingConfigVideoPlayerSizes `json:"videoPlayerSizes,omitempty"`
  2348. // ServerResponse contains the HTTP response code and headers from the
  2349. // server.
  2350. googleapi.ServerResponse `json:"-"`
  2351. // ForceSendFields is a list of field names (e.g. "BillingId") to
  2352. // unconditionally include in API requests. By default, fields with
  2353. // empty values are omitted from API requests. However, any non-pointer,
  2354. // non-interface field appearing in ForceSendFields will be sent to the
  2355. // server regardless of whether the field is empty or not. This may be
  2356. // used to include empty fields in Patch requests.
  2357. ForceSendFields []string `json:"-"`
  2358. // NullFields is a list of field names (e.g. "BillingId") to include in
  2359. // API requests with the JSON null value. By default, fields with empty
  2360. // values are omitted from API requests. However, any field with an
  2361. // empty value appearing in NullFields will be sent to the server as
  2362. // null. It is an error if a field in this list has a non-empty value.
  2363. // This may be used to include null fields in Patch requests.
  2364. NullFields []string `json:"-"`
  2365. }
  2366. func (s *PretargetingConfig) MarshalJSON() ([]byte, error) {
  2367. type NoMethod PretargetingConfig
  2368. raw := NoMethod(*s)
  2369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2370. }
  2371. type PretargetingConfigDimensions struct {
  2372. // Height: Height in pixels.
  2373. Height int64 `json:"height,omitempty,string"`
  2374. // Width: Width in pixels.
  2375. Width int64 `json:"width,omitempty,string"`
  2376. // ForceSendFields is a list of field names (e.g. "Height") to
  2377. // unconditionally include in API requests. By default, fields with
  2378. // empty values are omitted from API requests. However, any non-pointer,
  2379. // non-interface field appearing in ForceSendFields will be sent to the
  2380. // server regardless of whether the field is empty or not. This may be
  2381. // used to include empty fields in Patch requests.
  2382. ForceSendFields []string `json:"-"`
  2383. // NullFields is a list of field names (e.g. "Height") to include in API
  2384. // requests with the JSON null value. By default, fields with empty
  2385. // values are omitted from API requests. However, any field with an
  2386. // empty value appearing in NullFields will be sent to the server as
  2387. // null. It is an error if a field in this list has a non-empty value.
  2388. // This may be used to include null fields in Patch requests.
  2389. NullFields []string `json:"-"`
  2390. }
  2391. func (s *PretargetingConfigDimensions) MarshalJSON() ([]byte, error) {
  2392. type NoMethod PretargetingConfigDimensions
  2393. raw := NoMethod(*s)
  2394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2395. }
  2396. type PretargetingConfigExcludedPlacements struct {
  2397. // Token: The value of the placement. Interpretation depends on the
  2398. // placement type, e.g. URL for a site placement, channel name for a
  2399. // channel placement, app id for a mobile app placement.
  2400. Token string `json:"token,omitempty"`
  2401. // Type: The type of the placement.
  2402. Type string `json:"type,omitempty"`
  2403. // ForceSendFields is a list of field names (e.g. "Token") to
  2404. // unconditionally include in API requests. By default, fields with
  2405. // empty values are omitted from API requests. However, any non-pointer,
  2406. // non-interface field appearing in ForceSendFields will be sent to the
  2407. // server regardless of whether the field is empty or not. This may be
  2408. // used to include empty fields in Patch requests.
  2409. ForceSendFields []string `json:"-"`
  2410. // NullFields is a list of field names (e.g. "Token") to include in API
  2411. // requests with the JSON null value. By default, fields with empty
  2412. // values are omitted from API requests. However, any field with an
  2413. // empty value appearing in NullFields will be sent to the server as
  2414. // null. It is an error if a field in this list has a non-empty value.
  2415. // This may be used to include null fields in Patch requests.
  2416. NullFields []string `json:"-"`
  2417. }
  2418. func (s *PretargetingConfigExcludedPlacements) MarshalJSON() ([]byte, error) {
  2419. type NoMethod PretargetingConfigExcludedPlacements
  2420. raw := NoMethod(*s)
  2421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2422. }
  2423. type PretargetingConfigPlacements struct {
  2424. // Token: The value of the placement. Interpretation depends on the
  2425. // placement type, e.g. URL for a site placement, channel name for a
  2426. // channel placement, app id for a mobile app placement.
  2427. Token string `json:"token,omitempty"`
  2428. // Type: The type of the placement.
  2429. Type string `json:"type,omitempty"`
  2430. // ForceSendFields is a list of field names (e.g. "Token") to
  2431. // unconditionally include in API requests. By default, fields with
  2432. // empty values are omitted from API requests. However, any non-pointer,
  2433. // non-interface field appearing in ForceSendFields will be sent to the
  2434. // server regardless of whether the field is empty or not. This may be
  2435. // used to include empty fields in Patch requests.
  2436. ForceSendFields []string `json:"-"`
  2437. // NullFields is a list of field names (e.g. "Token") to include in API
  2438. // requests with the JSON null value. By default, fields with empty
  2439. // values are omitted from API requests. However, any field with an
  2440. // empty value appearing in NullFields will be sent to the server as
  2441. // null. It is an error if a field in this list has a non-empty value.
  2442. // This may be used to include null fields in Patch requests.
  2443. NullFields []string `json:"-"`
  2444. }
  2445. func (s *PretargetingConfigPlacements) MarshalJSON() ([]byte, error) {
  2446. type NoMethod PretargetingConfigPlacements
  2447. raw := NoMethod(*s)
  2448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2449. }
  2450. type PretargetingConfigVideoPlayerSizes struct {
  2451. // AspectRatio: The type of aspect ratio. Leave this field blank to
  2452. // match all aspect ratios.
  2453. AspectRatio string `json:"aspectRatio,omitempty"`
  2454. // MinHeight: The minimum player height in pixels. Leave this field
  2455. // blank to match any player height.
  2456. MinHeight int64 `json:"minHeight,omitempty,string"`
  2457. // MinWidth: The minimum player width in pixels. Leave this field blank
  2458. // to match any player width.
  2459. MinWidth int64 `json:"minWidth,omitempty,string"`
  2460. // ForceSendFields is a list of field names (e.g. "AspectRatio") to
  2461. // unconditionally include in API requests. By default, fields with
  2462. // empty values are omitted from API requests. However, any non-pointer,
  2463. // non-interface field appearing in ForceSendFields will be sent to the
  2464. // server regardless of whether the field is empty or not. This may be
  2465. // used to include empty fields in Patch requests.
  2466. ForceSendFields []string `json:"-"`
  2467. // NullFields is a list of field names (e.g. "AspectRatio") to include
  2468. // in API requests with the JSON null value. By default, fields with
  2469. // empty values are omitted from API requests. However, any field with
  2470. // an empty value appearing in NullFields will be sent to the server as
  2471. // null. It is an error if a field in this list has a non-empty value.
  2472. // This may be used to include null fields in Patch requests.
  2473. NullFields []string `json:"-"`
  2474. }
  2475. func (s *PretargetingConfigVideoPlayerSizes) MarshalJSON() ([]byte, error) {
  2476. type NoMethod PretargetingConfigVideoPlayerSizes
  2477. raw := NoMethod(*s)
  2478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2479. }
  2480. type PretargetingConfigList struct {
  2481. // Items: A list of pretargeting configs
  2482. Items []*PretargetingConfig `json:"items,omitempty"`
  2483. // Kind: Resource type.
  2484. Kind string `json:"kind,omitempty"`
  2485. // ServerResponse contains the HTTP response code and headers from the
  2486. // server.
  2487. googleapi.ServerResponse `json:"-"`
  2488. // ForceSendFields is a list of field names (e.g. "Items") 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. "Items") to include in API
  2496. // 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 *PretargetingConfigList) MarshalJSON() ([]byte, error) {
  2504. type NoMethod PretargetingConfigList
  2505. raw := NoMethod(*s)
  2506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2507. }
  2508. type Price struct {
  2509. // AmountMicros: The price value in micros.
  2510. AmountMicros float64 `json:"amountMicros,omitempty"`
  2511. // CurrencyCode: The currency code for the price.
  2512. CurrencyCode string `json:"currencyCode,omitempty"`
  2513. // ExpectedCpmMicros: In case of CPD deals, the expected CPM in micros.
  2514. ExpectedCpmMicros float64 `json:"expectedCpmMicros,omitempty"`
  2515. // PricingType: The pricing type for the deal/product.
  2516. PricingType string `json:"pricingType,omitempty"`
  2517. // ForceSendFields is a list of field names (e.g. "AmountMicros") to
  2518. // unconditionally include in API requests. By default, fields with
  2519. // empty values are omitted from API requests. However, any non-pointer,
  2520. // non-interface field appearing in ForceSendFields will be sent to the
  2521. // server regardless of whether the field is empty or not. This may be
  2522. // used to include empty fields in Patch requests.
  2523. ForceSendFields []string `json:"-"`
  2524. // NullFields is a list of field names (e.g. "AmountMicros") to include
  2525. // in API requests with the JSON null value. By default, fields with
  2526. // empty values are omitted from API requests. However, any field with
  2527. // an empty value appearing in NullFields will be sent to the server as
  2528. // null. It is an error if a field in this list has a non-empty value.
  2529. // This may be used to include null fields in Patch requests.
  2530. NullFields []string `json:"-"`
  2531. }
  2532. func (s *Price) MarshalJSON() ([]byte, error) {
  2533. type NoMethod Price
  2534. raw := NoMethod(*s)
  2535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2536. }
  2537. func (s *Price) UnmarshalJSON(data []byte) error {
  2538. type NoMethod Price
  2539. var s1 struct {
  2540. AmountMicros gensupport.JSONFloat64 `json:"amountMicros"`
  2541. ExpectedCpmMicros gensupport.JSONFloat64 `json:"expectedCpmMicros"`
  2542. *NoMethod
  2543. }
  2544. s1.NoMethod = (*NoMethod)(s)
  2545. if err := json.Unmarshal(data, &s1); err != nil {
  2546. return err
  2547. }
  2548. s.AmountMicros = float64(s1.AmountMicros)
  2549. s.ExpectedCpmMicros = float64(s1.ExpectedCpmMicros)
  2550. return nil
  2551. }
  2552. // PricePerBuyer: Used to specify pricing rules for buyers. Each
  2553. // PricePerBuyer in a product can become [0,1] deals. To check if there
  2554. // is a PricePerBuyer for a particular buyer we look for the most
  2555. // specific matching rule - we first look for a rule matching the buyer
  2556. // and otherwise look for a matching rule where no buyer is set.
  2557. type PricePerBuyer struct {
  2558. // AuctionTier: Optional access type for this buyer.
  2559. AuctionTier string `json:"auctionTier,omitempty"`
  2560. // BilledBuyer: Reference to the buyer that will get billed.
  2561. BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
  2562. // Buyer: The buyer who will pay this price. If unset, all buyers can
  2563. // pay this price (if the advertisers match, and there's no more
  2564. // specific rule matching the buyer).
  2565. Buyer *Buyer `json:"buyer,omitempty"`
  2566. // Price: The specified price
  2567. Price *Price `json:"price,omitempty"`
  2568. // ForceSendFields is a list of field names (e.g. "AuctionTier") to
  2569. // unconditionally include in API requests. By default, fields with
  2570. // empty values are omitted from API requests. However, any non-pointer,
  2571. // non-interface field appearing in ForceSendFields will be sent to the
  2572. // server regardless of whether the field is empty or not. This may be
  2573. // used to include empty fields in Patch requests.
  2574. ForceSendFields []string `json:"-"`
  2575. // NullFields is a list of field names (e.g. "AuctionTier") to include
  2576. // in API requests with the JSON null value. By default, fields with
  2577. // empty values are omitted from API requests. However, any field with
  2578. // an empty value appearing in NullFields will be sent to the server as
  2579. // null. It is an error if a field in this list has a non-empty value.
  2580. // This may be used to include null fields in Patch requests.
  2581. NullFields []string `json:"-"`
  2582. }
  2583. func (s *PricePerBuyer) MarshalJSON() ([]byte, error) {
  2584. type NoMethod PricePerBuyer
  2585. raw := NoMethod(*s)
  2586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2587. }
  2588. type PrivateData struct {
  2589. ReferenceId string `json:"referenceId,omitempty"`
  2590. ReferencePayload string `json:"referencePayload,omitempty"`
  2591. // ForceSendFields is a list of field names (e.g. "ReferenceId") 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. "ReferenceId") to include
  2599. // in API requests with the JSON null value. By default, fields with
  2600. // empty values are omitted from API requests. However, any field with
  2601. // an empty value appearing in NullFields will be sent to the server as
  2602. // null. It is an error if a field in this list has a non-empty value.
  2603. // This may be used to include null fields in Patch requests.
  2604. NullFields []string `json:"-"`
  2605. }
  2606. func (s *PrivateData) MarshalJSON() ([]byte, error) {
  2607. type NoMethod PrivateData
  2608. raw := NoMethod(*s)
  2609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2610. }
  2611. // Product: A product is segment of inventory that a seller wishes to
  2612. // sell. It is associated with certain terms and targeting information
  2613. // which helps buyer know more about the inventory. Each field in a
  2614. // product can have one of the following setting:
  2615. //
  2616. // (readonly) - It is an error to try and set this field.
  2617. // (buyer-readonly) - Only the seller can set this field.
  2618. // (seller-readonly) - Only the buyer can set this field. (updatable) -
  2619. // The field is updatable at all times by either buyer or the seller.
  2620. type Product struct {
  2621. // BilledBuyer: The billed buyer corresponding to the buyer that created
  2622. // the offer. (readonly, except on create)
  2623. BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
  2624. // Buyer: The buyer that created the offer if this is a buyer initiated
  2625. // offer (readonly, except on create)
  2626. Buyer *Buyer `json:"buyer,omitempty"`
  2627. // CreationTimeMs: Creation time in ms. since epoch (readonly)
  2628. CreationTimeMs int64 `json:"creationTimeMs,omitempty,string"`
  2629. // CreatorContacts: Optional contact information for the creator of this
  2630. // product. (buyer-readonly)
  2631. CreatorContacts []*ContactInformation `json:"creatorContacts,omitempty"`
  2632. // CreatorRole: The role that created the offer. Set to BUYER for buyer
  2633. // initiated offers.
  2634. CreatorRole string `json:"creatorRole,omitempty"`
  2635. // DeliveryControl: The set of fields around delivery control that are
  2636. // interesting for a buyer to see but are non-negotiable. These are set
  2637. // by the publisher. This message is assigned an id of 100 since some
  2638. // day we would want to model this as a protobuf extension.
  2639. DeliveryControl *DeliveryControl `json:"deliveryControl,omitempty"`
  2640. // FlightEndTimeMs: The proposed end time for the deal (ms since epoch)
  2641. // (buyer-readonly)
  2642. FlightEndTimeMs int64 `json:"flightEndTimeMs,omitempty,string"`
  2643. // FlightStartTimeMs: Inventory availability dates. (times are in ms
  2644. // since epoch) The granularity is generally in the order of seconds.
  2645. // (buyer-readonly)
  2646. FlightStartTimeMs int64 `json:"flightStartTimeMs,omitempty,string"`
  2647. // HasCreatorSignedOff: If the creator has already signed off on the
  2648. // product, then the buyer can finalize the deal by accepting the
  2649. // product as is. When copying to a proposal, if any of the terms are
  2650. // changed, then auto_finalize is automatically set to false.
  2651. HasCreatorSignedOff bool `json:"hasCreatorSignedOff,omitempty"`
  2652. // InventorySource: What exchange will provide this inventory (readonly,
  2653. // except on create).
  2654. InventorySource string `json:"inventorySource,omitempty"`
  2655. // Kind: Identifies what kind of resource this is. Value: the fixed
  2656. // string "adexchangebuyer#product".
  2657. Kind string `json:"kind,omitempty"`
  2658. // Labels: Optional List of labels for the product (optional,
  2659. // buyer-readonly).
  2660. Labels []*MarketplaceLabel `json:"labels,omitempty"`
  2661. // LastUpdateTimeMs: Time of last update in ms. since epoch (readonly)
  2662. LastUpdateTimeMs int64 `json:"lastUpdateTimeMs,omitempty,string"`
  2663. // LegacyOfferId: Optional legacy offer id if this offer is a preferred
  2664. // deal offer.
  2665. LegacyOfferId string `json:"legacyOfferId,omitempty"`
  2666. // MarketplacePublisherProfileId: Marketplace publisher profile Id. This
  2667. // Id differs from the regular publisher_profile_id in that 1. This is a
  2668. // new id, the old Id will be deprecated in 2017. 2. This id uniquely
  2669. // identifies a publisher profile by itself.
  2670. MarketplacePublisherProfileId string `json:"marketplacePublisherProfileId,omitempty"`
  2671. // Name: The name for this product as set by the seller.
  2672. // (buyer-readonly)
  2673. Name string `json:"name,omitempty"`
  2674. // PrivateAuctionId: Optional private auction id if this offer is a
  2675. // private auction offer.
  2676. PrivateAuctionId string `json:"privateAuctionId,omitempty"`
  2677. // ProductId: The unique id for the product (readonly)
  2678. ProductId string `json:"productId,omitempty"`
  2679. // PublisherProfileId: Id of the publisher profile for a given seller. A
  2680. // (seller.account_id, publisher_profile_id) pair uniquely identifies a
  2681. // publisher profile. Buyers can call the PublisherProfiles::List
  2682. // endpoint to get a list of publisher profiles for a given seller.
  2683. PublisherProfileId string `json:"publisherProfileId,omitempty"`
  2684. // PublisherProvidedForecast: Publisher self-provided forecast
  2685. // information.
  2686. PublisherProvidedForecast *PublisherProvidedForecast `json:"publisherProvidedForecast,omitempty"`
  2687. // RevisionNumber: The revision number of the product. (readonly)
  2688. RevisionNumber int64 `json:"revisionNumber,omitempty,string"`
  2689. // Seller: Information about the seller that created this product
  2690. // (readonly, except on create)
  2691. Seller *Seller `json:"seller,omitempty"`
  2692. // SharedTargetings: Targeting that is shared between the buyer and the
  2693. // seller. Each targeting criteria has a specified key and for each key
  2694. // there is a list of inclusion value or exclusion values.
  2695. // (buyer-readonly)
  2696. SharedTargetings []*SharedTargeting `json:"sharedTargetings,omitempty"`
  2697. // State: The state of the product. (buyer-readonly)
  2698. State string `json:"state,omitempty"`
  2699. // SyndicationProduct: The syndication product associated with the deal.
  2700. // (readonly, except on create)
  2701. SyndicationProduct string `json:"syndicationProduct,omitempty"`
  2702. // Terms: The negotiable terms of the deal (buyer-readonly)
  2703. Terms *DealTerms `json:"terms,omitempty"`
  2704. // WebPropertyCode: The web property code for the seller. This field is
  2705. // meant to be copied over as is when creating deals.
  2706. WebPropertyCode string `json:"webPropertyCode,omitempty"`
  2707. // ServerResponse contains the HTTP response code and headers from the
  2708. // server.
  2709. googleapi.ServerResponse `json:"-"`
  2710. // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
  2711. // unconditionally include in API requests. By default, fields with
  2712. // empty values are omitted from API requests. However, any non-pointer,
  2713. // non-interface field appearing in ForceSendFields will be sent to the
  2714. // server regardless of whether the field is empty or not. This may be
  2715. // used to include empty fields in Patch requests.
  2716. ForceSendFields []string `json:"-"`
  2717. // NullFields is a list of field names (e.g. "BilledBuyer") to include
  2718. // in API requests with the JSON null value. By default, fields with
  2719. // empty values are omitted from API requests. However, any field with
  2720. // an empty value appearing in NullFields will be sent to the server as
  2721. // null. It is an error if a field in this list has a non-empty value.
  2722. // This may be used to include null fields in Patch requests.
  2723. NullFields []string `json:"-"`
  2724. }
  2725. func (s *Product) MarshalJSON() ([]byte, error) {
  2726. type NoMethod Product
  2727. raw := NoMethod(*s)
  2728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2729. }
  2730. // Proposal: Represents a proposal in the marketplace. A proposal is the
  2731. // unit of negotiation between a seller and a buyer and contains deals
  2732. // which are served. Each field in a proposal can have one of the
  2733. // following setting:
  2734. //
  2735. // (readonly) - It is an error to try and set this field.
  2736. // (buyer-readonly) - Only the seller can set this field.
  2737. // (seller-readonly) - Only the buyer can set this field. (updatable) -
  2738. // The field is updatable at all times by either buyer or the seller.
  2739. type Proposal struct {
  2740. // BilledBuyer: Reference to the buyer that will get billed for this
  2741. // proposal. (readonly)
  2742. BilledBuyer *Buyer `json:"billedBuyer,omitempty"`
  2743. // Buyer: Reference to the buyer on the proposal. (readonly, except on
  2744. // create)
  2745. Buyer *Buyer `json:"buyer,omitempty"`
  2746. // BuyerContacts: Optional contact information of the buyer.
  2747. // (seller-readonly)
  2748. BuyerContacts []*ContactInformation `json:"buyerContacts,omitempty"`
  2749. // BuyerPrivateData: Private data for buyer. (hidden from seller).
  2750. BuyerPrivateData *PrivateData `json:"buyerPrivateData,omitempty"`
  2751. // DbmAdvertiserIds: IDs of DBM advertisers permission to this proposal.
  2752. DbmAdvertiserIds []string `json:"dbmAdvertiserIds,omitempty"`
  2753. // HasBuyerSignedOff: When an proposal is in an accepted state,
  2754. // indicates whether the buyer has signed off. Once both sides have
  2755. // signed off on a deal, the proposal can be finalized by the seller.
  2756. // (seller-readonly)
  2757. HasBuyerSignedOff bool `json:"hasBuyerSignedOff,omitempty"`
  2758. // HasSellerSignedOff: When an proposal is in an accepted state,
  2759. // indicates whether the buyer has signed off Once both sides have
  2760. // signed off on a deal, the proposal can be finalized by the seller.
  2761. // (buyer-readonly)
  2762. HasSellerSignedOff bool `json:"hasSellerSignedOff,omitempty"`
  2763. // InventorySource: What exchange will provide this inventory (readonly,
  2764. // except on create).
  2765. InventorySource string `json:"inventorySource,omitempty"`
  2766. // IsRenegotiating: True if the proposal is being renegotiated
  2767. // (readonly).
  2768. IsRenegotiating bool `json:"isRenegotiating,omitempty"`
  2769. // IsSetupComplete: True, if the buyside inventory setup is complete for
  2770. // this proposal. (readonly, except via OrderSetupCompleted action)
  2771. // Deprecated in favor of deal level setup complete flag.
  2772. IsSetupComplete bool `json:"isSetupComplete,omitempty"`
  2773. // Kind: Identifies what kind of resource this is. Value: the fixed
  2774. // string "adexchangebuyer#proposal".
  2775. Kind string `json:"kind,omitempty"`
  2776. // Labels: List of labels associated with the proposal. (readonly)
  2777. Labels []*MarketplaceLabel `json:"labels,omitempty"`
  2778. // LastUpdaterOrCommentorRole: The role of the last user that either
  2779. // updated the proposal or left a comment. (readonly)
  2780. LastUpdaterOrCommentorRole string `json:"lastUpdaterOrCommentorRole,omitempty"`
  2781. // Name: The name for the proposal (updatable)
  2782. Name string `json:"name,omitempty"`
  2783. // NegotiationId: Optional negotiation id if this proposal is a
  2784. // preferred deal proposal.
  2785. NegotiationId string `json:"negotiationId,omitempty"`
  2786. // OriginatorRole: Indicates whether the buyer/seller created the
  2787. // proposal.(readonly)
  2788. OriginatorRole string `json:"originatorRole,omitempty"`
  2789. // PrivateAuctionId: Optional private auction id if this proposal is a
  2790. // private auction proposal.
  2791. PrivateAuctionId string `json:"privateAuctionId,omitempty"`
  2792. // ProposalId: The unique id of the proposal. (readonly).
  2793. ProposalId string `json:"proposalId,omitempty"`
  2794. // ProposalState: The current state of the proposal. (readonly)
  2795. ProposalState string `json:"proposalState,omitempty"`
  2796. // RevisionNumber: The revision number for the proposal (readonly).
  2797. RevisionNumber int64 `json:"revisionNumber,omitempty,string"`
  2798. // RevisionTimeMs: The time (ms since epoch) when the proposal was last
  2799. // revised (readonly).
  2800. RevisionTimeMs int64 `json:"revisionTimeMs,omitempty,string"`
  2801. // Seller: Reference to the seller on the proposal. (readonly, except on
  2802. // create)
  2803. Seller *Seller `json:"seller,omitempty"`
  2804. // SellerContacts: Optional contact information of the seller
  2805. // (buyer-readonly).
  2806. SellerContacts []*ContactInformation `json:"sellerContacts,omitempty"`
  2807. // ServerResponse contains the HTTP response code and headers from the
  2808. // server.
  2809. googleapi.ServerResponse `json:"-"`
  2810. // ForceSendFields is a list of field names (e.g. "BilledBuyer") to
  2811. // unconditionally include in API requests. By default, fields with
  2812. // empty values are omitted from API requests. However, any non-pointer,
  2813. // non-interface field appearing in ForceSendFields will be sent to the
  2814. // server regardless of whether the field is empty or not. This may be
  2815. // used to include empty fields in Patch requests.
  2816. ForceSendFields []string `json:"-"`
  2817. // NullFields is a list of field names (e.g. "BilledBuyer") to include
  2818. // in API requests with the JSON null value. By default, fields with
  2819. // empty values are omitted from API requests. However, any field with
  2820. // an empty value appearing in NullFields will be sent to the server as
  2821. // null. It is an error if a field in this list has a non-empty value.
  2822. // This may be used to include null fields in Patch requests.
  2823. NullFields []string `json:"-"`
  2824. }
  2825. func (s *Proposal) MarshalJSON() ([]byte, error) {
  2826. type NoMethod Proposal
  2827. raw := NoMethod(*s)
  2828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2829. }
  2830. type PublisherProfileApiProto struct {
  2831. // Audience: Publisher provided info on its audience.
  2832. Audience string `json:"audience,omitempty"`
  2833. // BuyerPitchStatement: A pitch statement for the buyer
  2834. BuyerPitchStatement string `json:"buyerPitchStatement,omitempty"`
  2835. // DirectContact: Direct contact for the publisher profile.
  2836. DirectContact string `json:"directContact,omitempty"`
  2837. // Exchange: Exchange where this publisher profile is from. E.g. AdX,
  2838. // Rubicon etc...
  2839. Exchange string `json:"exchange,omitempty"`
  2840. // GooglePlusLink: Link to publisher's Google+ page.
  2841. GooglePlusLink string `json:"googlePlusLink,omitempty"`
  2842. // IsParent: True, if this is the parent profile, which represents all
  2843. // domains owned by the publisher.
  2844. IsParent bool `json:"isParent,omitempty"`
  2845. // IsPublished: True, if this profile is published. Deprecated for
  2846. // state.
  2847. IsPublished bool `json:"isPublished,omitempty"`
  2848. // Kind: Identifies what kind of resource this is. Value: the fixed
  2849. // string "adexchangebuyer#publisherProfileApiProto".
  2850. Kind string `json:"kind,omitempty"`
  2851. // LogoUrl: The url to the logo for the publisher.
  2852. LogoUrl string `json:"logoUrl,omitempty"`
  2853. // MediaKitLink: The url for additional marketing and sales materials.
  2854. MediaKitLink string `json:"mediaKitLink,omitempty"`
  2855. Name string `json:"name,omitempty"`
  2856. // Overview: Publisher provided overview.
  2857. Overview string `json:"overview,omitempty"`
  2858. // ProfileId: The pair of (seller.account_id, profile_id) uniquely
  2859. // identifies a publisher profile for a given publisher.
  2860. ProfileId int64 `json:"profileId,omitempty"`
  2861. // ProgrammaticContact: Programmatic contact for the publisher profile.
  2862. ProgrammaticContact string `json:"programmaticContact,omitempty"`
  2863. // PublisherDomains: The list of domains represented in this publisher
  2864. // profile. Empty if this is a parent profile.
  2865. PublisherDomains []string `json:"publisherDomains,omitempty"`
  2866. // PublisherProfileId: Unique Id for publisher profile.
  2867. PublisherProfileId string `json:"publisherProfileId,omitempty"`
  2868. // PublisherProvidedForecast: Publisher provided forecasting
  2869. // information.
  2870. PublisherProvidedForecast *PublisherProvidedForecast `json:"publisherProvidedForecast,omitempty"`
  2871. // RateCardInfoLink: Link to publisher rate card
  2872. RateCardInfoLink string `json:"rateCardInfoLink,omitempty"`
  2873. // SamplePageLink: Link for a sample content page.
  2874. SamplePageLink string `json:"samplePageLink,omitempty"`
  2875. // Seller: Seller of the publisher profile.
  2876. Seller *Seller `json:"seller,omitempty"`
  2877. // State: State of the publisher profile.
  2878. State string `json:"state,omitempty"`
  2879. // TopHeadlines: Publisher provided key metrics and rankings.
  2880. TopHeadlines []string `json:"topHeadlines,omitempty"`
  2881. // ForceSendFields is a list of field names (e.g. "Audience") to
  2882. // unconditionally include in API requests. By default, fields with
  2883. // empty values are omitted from API requests. However, any non-pointer,
  2884. // non-interface field appearing in ForceSendFields will be sent to the
  2885. // server regardless of whether the field is empty or not. This may be
  2886. // used to include empty fields in Patch requests.
  2887. ForceSendFields []string `json:"-"`
  2888. // NullFields is a list of field names (e.g. "Audience") to include in
  2889. // API requests with the JSON null value. By default, fields with empty
  2890. // values are omitted from API requests. However, any field with an
  2891. // empty value appearing in NullFields will be sent to the server as
  2892. // null. It is an error if a field in this list has a non-empty value.
  2893. // This may be used to include null fields in Patch requests.
  2894. NullFields []string `json:"-"`
  2895. }
  2896. func (s *PublisherProfileApiProto) MarshalJSON() ([]byte, error) {
  2897. type NoMethod PublisherProfileApiProto
  2898. raw := NoMethod(*s)
  2899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2900. }
  2901. // PublisherProvidedForecast: This message carries publisher provided
  2902. // forecasting information.
  2903. type PublisherProvidedForecast struct {
  2904. // Dimensions: Publisher provided dimensions. E.g. geo, sizes etc...
  2905. Dimensions []*Dimension `json:"dimensions,omitempty"`
  2906. // WeeklyImpressions: Publisher provided weekly impressions.
  2907. WeeklyImpressions int64 `json:"weeklyImpressions,omitempty,string"`
  2908. // WeeklyUniques: Publisher provided weekly uniques.
  2909. WeeklyUniques int64 `json:"weeklyUniques,omitempty,string"`
  2910. // ForceSendFields is a list of field names (e.g. "Dimensions") to
  2911. // unconditionally include in API requests. By default, fields with
  2912. // empty values are omitted from API requests. However, any non-pointer,
  2913. // non-interface field appearing in ForceSendFields will be sent to the
  2914. // server regardless of whether the field is empty or not. This may be
  2915. // used to include empty fields in Patch requests.
  2916. ForceSendFields []string `json:"-"`
  2917. // NullFields is a list of field names (e.g. "Dimensions") to include in
  2918. // API requests with the JSON null value. By default, fields with empty
  2919. // values are omitted from API requests. However, any field with an
  2920. // empty value appearing in NullFields will be sent to the server as
  2921. // null. It is an error if a field in this list has a non-empty value.
  2922. // This may be used to include null fields in Patch requests.
  2923. NullFields []string `json:"-"`
  2924. }
  2925. func (s *PublisherProvidedForecast) MarshalJSON() ([]byte, error) {
  2926. type NoMethod PublisherProvidedForecast
  2927. raw := NoMethod(*s)
  2928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2929. }
  2930. type Seller struct {
  2931. // AccountId: The unique id for the seller. The seller fills in this
  2932. // field. The seller account id is then available to buyer in the
  2933. // product.
  2934. AccountId string `json:"accountId,omitempty"`
  2935. // SubAccountId: Optional sub-account id for the seller.
  2936. SubAccountId string `json:"subAccountId,omitempty"`
  2937. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2938. // unconditionally include in API requests. By default, fields with
  2939. // empty values are omitted from API requests. However, any non-pointer,
  2940. // non-interface field appearing in ForceSendFields will be sent to the
  2941. // server regardless of whether the field is empty or not. This may be
  2942. // used to include empty fields in Patch requests.
  2943. ForceSendFields []string `json:"-"`
  2944. // NullFields is a list of field names (e.g. "AccountId") to include in
  2945. // API requests with the JSON null value. By default, fields with empty
  2946. // values are omitted from API requests. However, any field with an
  2947. // empty value appearing in NullFields will be sent to the server as
  2948. // null. It is an error if a field in this list has a non-empty value.
  2949. // This may be used to include null fields in Patch requests.
  2950. NullFields []string `json:"-"`
  2951. }
  2952. func (s *Seller) MarshalJSON() ([]byte, error) {
  2953. type NoMethod Seller
  2954. raw := NoMethod(*s)
  2955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2956. }
  2957. type SharedTargeting struct {
  2958. // Exclusions: The list of values to exclude from targeting. Each value
  2959. // is AND'd together.
  2960. Exclusions []*TargetingValue `json:"exclusions,omitempty"`
  2961. // Inclusions: The list of value to include as part of the targeting.
  2962. // Each value is OR'd together.
  2963. Inclusions []*TargetingValue `json:"inclusions,omitempty"`
  2964. // Key: The key representing the shared targeting criterion.
  2965. Key string `json:"key,omitempty"`
  2966. // ForceSendFields is a list of field names (e.g. "Exclusions") to
  2967. // unconditionally include in API requests. By default, fields with
  2968. // empty values are omitted from API requests. However, any non-pointer,
  2969. // non-interface field appearing in ForceSendFields will be sent to the
  2970. // server regardless of whether the field is empty or not. This may be
  2971. // used to include empty fields in Patch requests.
  2972. ForceSendFields []string `json:"-"`
  2973. // NullFields is a list of field names (e.g. "Exclusions") to include in
  2974. // API requests with the JSON null value. By default, fields with empty
  2975. // values are omitted from API requests. However, any field with an
  2976. // empty value appearing in NullFields will be sent to the server as
  2977. // null. It is an error if a field in this list has a non-empty value.
  2978. // This may be used to include null fields in Patch requests.
  2979. NullFields []string `json:"-"`
  2980. }
  2981. func (s *SharedTargeting) MarshalJSON() ([]byte, error) {
  2982. type NoMethod SharedTargeting
  2983. raw := NoMethod(*s)
  2984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2985. }
  2986. type TargetingValue struct {
  2987. // CreativeSizeValue: The creative size value to exclude/include.
  2988. CreativeSizeValue *TargetingValueCreativeSize `json:"creativeSizeValue,omitempty"`
  2989. // DayPartTargetingValue: The daypart targeting to include / exclude.
  2990. // Filled in when the key is GOOG_DAYPART_TARGETING.
  2991. DayPartTargetingValue *TargetingValueDayPartTargeting `json:"dayPartTargetingValue,omitempty"`
  2992. DemogAgeCriteriaValue *TargetingValueDemogAgeCriteria `json:"demogAgeCriteriaValue,omitempty"`
  2993. DemogGenderCriteriaValue *TargetingValueDemogGenderCriteria `json:"demogGenderCriteriaValue,omitempty"`
  2994. // LongValue: The long value to exclude/include.
  2995. LongValue int64 `json:"longValue,omitempty,string"`
  2996. // StringValue: The string value to exclude/include.
  2997. StringValue string `json:"stringValue,omitempty"`
  2998. // ForceSendFields is a list of field names (e.g. "CreativeSizeValue")
  2999. // to unconditionally include in API requests. By default, fields with
  3000. // empty values are omitted from API requests. However, any non-pointer,
  3001. // non-interface field appearing in ForceSendFields will be sent to the
  3002. // server regardless of whether the field is empty or not. This may be
  3003. // used to include empty fields in Patch requests.
  3004. ForceSendFields []string `json:"-"`
  3005. // NullFields is a list of field names (e.g. "CreativeSizeValue") to
  3006. // include in API requests with the JSON null value. By default, fields
  3007. // with empty values are omitted from API requests. However, any field
  3008. // with an empty value appearing in NullFields will be sent to the
  3009. // server as null. It is an error if a field in this list has a
  3010. // non-empty value. This may be used to include null fields in Patch
  3011. // requests.
  3012. NullFields []string `json:"-"`
  3013. }
  3014. func (s *TargetingValue) MarshalJSON() ([]byte, error) {
  3015. type NoMethod TargetingValue
  3016. raw := NoMethod(*s)
  3017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3018. }
  3019. // TargetingValueCreativeSize: Next Id: 7
  3020. type TargetingValueCreativeSize struct {
  3021. // AllowedFormats: The formats allowed by the publisher.
  3022. AllowedFormats []string `json:"allowedFormats,omitempty"`
  3023. // CompanionSizes: For video size type, the list of companion sizes.
  3024. CompanionSizes []*TargetingValueSize `json:"companionSizes,omitempty"`
  3025. // CreativeSizeType: The Creative size type.
  3026. CreativeSizeType string `json:"creativeSizeType,omitempty"`
  3027. // NativeTemplate: The native template for native ad.
  3028. NativeTemplate string `json:"nativeTemplate,omitempty"`
  3029. // Size: For regular or video creative size type, specifies the size of
  3030. // the creative.
  3031. Size *TargetingValueSize `json:"size,omitempty"`
  3032. // SkippableAdType: The skippable ad type for video size.
  3033. SkippableAdType string `json:"skippableAdType,omitempty"`
  3034. // ForceSendFields is a list of field names (e.g. "AllowedFormats") to
  3035. // unconditionally include in API requests. By default, fields with
  3036. // empty values are omitted from API requests. However, any non-pointer,
  3037. // non-interface field appearing in ForceSendFields will be sent to the
  3038. // server regardless of whether the field is empty or not. This may be
  3039. // used to include empty fields in Patch requests.
  3040. ForceSendFields []string `json:"-"`
  3041. // NullFields is a list of field names (e.g. "AllowedFormats") to
  3042. // include in API requests with the JSON null value. By default, fields
  3043. // with empty values are omitted from API requests. However, any field
  3044. // with an empty value appearing in NullFields will be sent to the
  3045. // server as null. It is an error if a field in this list has a
  3046. // non-empty value. This may be used to include null fields in Patch
  3047. // requests.
  3048. NullFields []string `json:"-"`
  3049. }
  3050. func (s *TargetingValueCreativeSize) MarshalJSON() ([]byte, error) {
  3051. type NoMethod TargetingValueCreativeSize
  3052. raw := NoMethod(*s)
  3053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3054. }
  3055. type TargetingValueDayPartTargeting struct {
  3056. DayParts []*TargetingValueDayPartTargetingDayPart `json:"dayParts,omitempty"`
  3057. TimeZoneType string `json:"timeZoneType,omitempty"`
  3058. // ForceSendFields is a list of field names (e.g. "DayParts") to
  3059. // unconditionally include in API requests. By default, fields with
  3060. // empty values are omitted from API requests. However, any non-pointer,
  3061. // non-interface field appearing in ForceSendFields will be sent to the
  3062. // server regardless of whether the field is empty or not. This may be
  3063. // used to include empty fields in Patch requests.
  3064. ForceSendFields []string `json:"-"`
  3065. // NullFields is a list of field names (e.g. "DayParts") to include in
  3066. // API requests with the JSON null value. By default, fields with empty
  3067. // values are omitted from API requests. However, any field with an
  3068. // empty value appearing in NullFields will be sent to the server as
  3069. // null. It is an error if a field in this list has a non-empty value.
  3070. // This may be used to include null fields in Patch requests.
  3071. NullFields []string `json:"-"`
  3072. }
  3073. func (s *TargetingValueDayPartTargeting) MarshalJSON() ([]byte, error) {
  3074. type NoMethod TargetingValueDayPartTargeting
  3075. raw := NoMethod(*s)
  3076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3077. }
  3078. type TargetingValueDayPartTargetingDayPart struct {
  3079. DayOfWeek string `json:"dayOfWeek,omitempty"`
  3080. EndHour int64 `json:"endHour,omitempty"`
  3081. EndMinute int64 `json:"endMinute,omitempty"`
  3082. StartHour int64 `json:"startHour,omitempty"`
  3083. StartMinute int64 `json:"startMinute,omitempty"`
  3084. // ForceSendFields is a list of field names (e.g. "DayOfWeek") to
  3085. // unconditionally include in API requests. By default, fields with
  3086. // empty values are omitted from API requests. However, any non-pointer,
  3087. // non-interface field appearing in ForceSendFields will be sent to the
  3088. // server regardless of whether the field is empty or not. This may be
  3089. // used to include empty fields in Patch requests.
  3090. ForceSendFields []string `json:"-"`
  3091. // NullFields is a list of field names (e.g. "DayOfWeek") to include in
  3092. // API requests with the JSON null value. By default, fields with empty
  3093. // values are omitted from API requests. However, any field with an
  3094. // empty value appearing in NullFields will be sent to the server as
  3095. // null. It is an error if a field in this list has a non-empty value.
  3096. // This may be used to include null fields in Patch requests.
  3097. NullFields []string `json:"-"`
  3098. }
  3099. func (s *TargetingValueDayPartTargetingDayPart) MarshalJSON() ([]byte, error) {
  3100. type NoMethod TargetingValueDayPartTargetingDayPart
  3101. raw := NoMethod(*s)
  3102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3103. }
  3104. type TargetingValueDemogAgeCriteria struct {
  3105. DemogAgeCriteriaIds []string `json:"demogAgeCriteriaIds,omitempty"`
  3106. // ForceSendFields is a list of field names (e.g. "DemogAgeCriteriaIds")
  3107. // to unconditionally include in API requests. By default, fields with
  3108. // empty values are omitted from API requests. However, any non-pointer,
  3109. // non-interface field appearing in ForceSendFields will be sent to the
  3110. // server regardless of whether the field is empty or not. This may be
  3111. // used to include empty fields in Patch requests.
  3112. ForceSendFields []string `json:"-"`
  3113. // NullFields is a list of field names (e.g. "DemogAgeCriteriaIds") to
  3114. // include in API requests with the JSON null value. By default, fields
  3115. // with empty values are omitted from API requests. However, any field
  3116. // with an empty value appearing in NullFields will be sent to the
  3117. // server as null. It is an error if a field in this list has a
  3118. // non-empty value. This may be used to include null fields in Patch
  3119. // requests.
  3120. NullFields []string `json:"-"`
  3121. }
  3122. func (s *TargetingValueDemogAgeCriteria) MarshalJSON() ([]byte, error) {
  3123. type NoMethod TargetingValueDemogAgeCriteria
  3124. raw := NoMethod(*s)
  3125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3126. }
  3127. type TargetingValueDemogGenderCriteria struct {
  3128. DemogGenderCriteriaIds []string `json:"demogGenderCriteriaIds,omitempty"`
  3129. // ForceSendFields is a list of field names (e.g.
  3130. // "DemogGenderCriteriaIds") to unconditionally include in API requests.
  3131. // By default, fields with empty values are omitted from API requests.
  3132. // However, any non-pointer, non-interface field appearing in
  3133. // ForceSendFields will be sent to the server regardless of whether the
  3134. // field is empty or not. This may be used to include empty fields in
  3135. // Patch requests.
  3136. ForceSendFields []string `json:"-"`
  3137. // NullFields is a list of field names (e.g. "DemogGenderCriteriaIds")
  3138. // to include in API requests with the JSON null value. By default,
  3139. // fields with empty values are omitted from API requests. However, any
  3140. // field with an empty value appearing in NullFields will be sent to the
  3141. // server as null. It is an error if a field in this list has a
  3142. // non-empty value. This may be used to include null fields in Patch
  3143. // requests.
  3144. NullFields []string `json:"-"`
  3145. }
  3146. func (s *TargetingValueDemogGenderCriteria) MarshalJSON() ([]byte, error) {
  3147. type NoMethod TargetingValueDemogGenderCriteria
  3148. raw := NoMethod(*s)
  3149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3150. }
  3151. type TargetingValueSize struct {
  3152. // Height: The height of the creative.
  3153. Height int64 `json:"height,omitempty"`
  3154. // Width: The width of the creative.
  3155. Width int64 `json:"width,omitempty"`
  3156. // ForceSendFields is a list of field names (e.g. "Height") to
  3157. // unconditionally include in API requests. By default, fields with
  3158. // empty values are omitted from API requests. However, any non-pointer,
  3159. // non-interface field appearing in ForceSendFields will be sent to the
  3160. // server regardless of whether the field is empty or not. This may be
  3161. // used to include empty fields in Patch requests.
  3162. ForceSendFields []string `json:"-"`
  3163. // NullFields is a list of field names (e.g. "Height") to include in API
  3164. // requests with the JSON null value. By default, fields with empty
  3165. // values are omitted from API requests. However, any field with an
  3166. // empty value appearing in NullFields will be sent to the server as
  3167. // null. It is an error if a field in this list has a non-empty value.
  3168. // This may be used to include null fields in Patch requests.
  3169. NullFields []string `json:"-"`
  3170. }
  3171. func (s *TargetingValueSize) MarshalJSON() ([]byte, error) {
  3172. type NoMethod TargetingValueSize
  3173. raw := NoMethod(*s)
  3174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3175. }
  3176. type UpdatePrivateAuctionProposalRequest struct {
  3177. // ExternalDealId: The externalDealId of the deal to be updated.
  3178. ExternalDealId string `json:"externalDealId,omitempty"`
  3179. // Note: Optional note to be added.
  3180. Note *MarketplaceNote `json:"note,omitempty"`
  3181. // ProposalRevisionNumber: The current revision number of the proposal
  3182. // to be updated.
  3183. ProposalRevisionNumber int64 `json:"proposalRevisionNumber,omitempty,string"`
  3184. // UpdateAction: The proposed action on the private auction proposal.
  3185. UpdateAction string `json:"updateAction,omitempty"`
  3186. // ForceSendFields is a list of field names (e.g. "ExternalDealId") to
  3187. // unconditionally include in API requests. By default, fields with
  3188. // empty values are omitted from API requests. However, any non-pointer,
  3189. // non-interface field appearing in ForceSendFields will be sent to the
  3190. // server regardless of whether the field is empty or not. This may be
  3191. // used to include empty fields in Patch requests.
  3192. ForceSendFields []string `json:"-"`
  3193. // NullFields is a list of field names (e.g. "ExternalDealId") to
  3194. // include in API requests with the JSON null value. By default, fields
  3195. // with empty values are omitted from API requests. However, any field
  3196. // with an empty value appearing in NullFields will be sent to the
  3197. // server as null. It is an error if a field in this list has a
  3198. // non-empty value. This may be used to include null fields in Patch
  3199. // requests.
  3200. NullFields []string `json:"-"`
  3201. }
  3202. func (s *UpdatePrivateAuctionProposalRequest) MarshalJSON() ([]byte, error) {
  3203. type NoMethod UpdatePrivateAuctionProposalRequest
  3204. raw := NoMethod(*s)
  3205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3206. }
  3207. // method id "adexchangebuyer.accounts.get":
  3208. type AccountsGetCall struct {
  3209. s *Service
  3210. id int64
  3211. urlParams_ gensupport.URLParams
  3212. ifNoneMatch_ string
  3213. ctx_ context.Context
  3214. header_ http.Header
  3215. }
  3216. // Get: Gets one account by ID.
  3217. func (r *AccountsService) Get(id int64) *AccountsGetCall {
  3218. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3219. c.id = id
  3220. return c
  3221. }
  3222. // Fields allows partial responses to be retrieved. See
  3223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3224. // for more information.
  3225. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  3226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3227. return c
  3228. }
  3229. // IfNoneMatch sets the optional parameter which makes the operation
  3230. // fail if the object's ETag matches the given value. This is useful for
  3231. // getting updates only after the object has changed since the last
  3232. // request. Use googleapi.IsNotModified to check whether the response
  3233. // error from Do is the result of In-None-Match.
  3234. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  3235. c.ifNoneMatch_ = entityTag
  3236. return c
  3237. }
  3238. // Context sets the context to be used in this call's Do method. Any
  3239. // pending HTTP request will be aborted if the provided context is
  3240. // canceled.
  3241. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  3242. c.ctx_ = ctx
  3243. return c
  3244. }
  3245. // Header returns an http.Header that can be modified by the caller to
  3246. // add HTTP headers to the request.
  3247. func (c *AccountsGetCall) Header() http.Header {
  3248. if c.header_ == nil {
  3249. c.header_ = make(http.Header)
  3250. }
  3251. return c.header_
  3252. }
  3253. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  3254. reqHeaders := make(http.Header)
  3255. for k, v := range c.header_ {
  3256. reqHeaders[k] = v
  3257. }
  3258. reqHeaders.Set("User-Agent", c.s.userAgent())
  3259. if c.ifNoneMatch_ != "" {
  3260. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3261. }
  3262. var body io.Reader = nil
  3263. c.urlParams_.Set("alt", alt)
  3264. c.urlParams_.Set("prettyPrint", "false")
  3265. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
  3266. urls += "?" + c.urlParams_.Encode()
  3267. req, err := http.NewRequest("GET", urls, body)
  3268. if err != nil {
  3269. return nil, err
  3270. }
  3271. req.Header = reqHeaders
  3272. googleapi.Expand(req.URL, map[string]string{
  3273. "id": strconv.FormatInt(c.id, 10),
  3274. })
  3275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3276. }
  3277. // Do executes the "adexchangebuyer.accounts.get" call.
  3278. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  3279. // code is an error. Response headers are in either
  3280. // *Account.ServerResponse.Header or (if a response was returned at all)
  3281. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3282. // check whether the returned error was because http.StatusNotModified
  3283. // was returned.
  3284. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  3285. gensupport.SetOptions(c.urlParams_, opts...)
  3286. res, err := c.doRequest("json")
  3287. if res != nil && res.StatusCode == http.StatusNotModified {
  3288. if res.Body != nil {
  3289. res.Body.Close()
  3290. }
  3291. return nil, &googleapi.Error{
  3292. Code: res.StatusCode,
  3293. Header: res.Header,
  3294. }
  3295. }
  3296. if err != nil {
  3297. return nil, err
  3298. }
  3299. defer googleapi.CloseBody(res)
  3300. if err := googleapi.CheckResponse(res); err != nil {
  3301. return nil, err
  3302. }
  3303. ret := &Account{
  3304. ServerResponse: googleapi.ServerResponse{
  3305. Header: res.Header,
  3306. HTTPStatusCode: res.StatusCode,
  3307. },
  3308. }
  3309. target := &ret
  3310. if err := gensupport.DecodeResponse(target, res); err != nil {
  3311. return nil, err
  3312. }
  3313. return ret, nil
  3314. // {
  3315. // "description": "Gets one account by ID.",
  3316. // "httpMethod": "GET",
  3317. // "id": "adexchangebuyer.accounts.get",
  3318. // "parameterOrder": [
  3319. // "id"
  3320. // ],
  3321. // "parameters": {
  3322. // "id": {
  3323. // "description": "The account id",
  3324. // "format": "int32",
  3325. // "location": "path",
  3326. // "required": true,
  3327. // "type": "integer"
  3328. // }
  3329. // },
  3330. // "path": "accounts/{id}",
  3331. // "response": {
  3332. // "$ref": "Account"
  3333. // },
  3334. // "scopes": [
  3335. // "https://www.googleapis.com/auth/adexchange.buyer"
  3336. // ]
  3337. // }
  3338. }
  3339. // method id "adexchangebuyer.accounts.list":
  3340. type AccountsListCall struct {
  3341. s *Service
  3342. urlParams_ gensupport.URLParams
  3343. ifNoneMatch_ string
  3344. ctx_ context.Context
  3345. header_ http.Header
  3346. }
  3347. // List: Retrieves the authenticated user's list of accounts.
  3348. func (r *AccountsService) List() *AccountsListCall {
  3349. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3350. return c
  3351. }
  3352. // Fields allows partial responses to be retrieved. See
  3353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3354. // for more information.
  3355. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  3356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3357. return c
  3358. }
  3359. // IfNoneMatch sets the optional parameter which makes the operation
  3360. // fail if the object's ETag matches the given value. This is useful for
  3361. // getting updates only after the object has changed since the last
  3362. // request. Use googleapi.IsNotModified to check whether the response
  3363. // error from Do is the result of In-None-Match.
  3364. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  3365. c.ifNoneMatch_ = entityTag
  3366. return c
  3367. }
  3368. // Context sets the context to be used in this call's Do method. Any
  3369. // pending HTTP request will be aborted if the provided context is
  3370. // canceled.
  3371. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  3372. c.ctx_ = ctx
  3373. return c
  3374. }
  3375. // Header returns an http.Header that can be modified by the caller to
  3376. // add HTTP headers to the request.
  3377. func (c *AccountsListCall) Header() http.Header {
  3378. if c.header_ == nil {
  3379. c.header_ = make(http.Header)
  3380. }
  3381. return c.header_
  3382. }
  3383. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  3384. reqHeaders := make(http.Header)
  3385. for k, v := range c.header_ {
  3386. reqHeaders[k] = v
  3387. }
  3388. reqHeaders.Set("User-Agent", c.s.userAgent())
  3389. if c.ifNoneMatch_ != "" {
  3390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3391. }
  3392. var body io.Reader = nil
  3393. c.urlParams_.Set("alt", alt)
  3394. c.urlParams_.Set("prettyPrint", "false")
  3395. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts")
  3396. urls += "?" + c.urlParams_.Encode()
  3397. req, err := http.NewRequest("GET", urls, body)
  3398. if err != nil {
  3399. return nil, err
  3400. }
  3401. req.Header = reqHeaders
  3402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3403. }
  3404. // Do executes the "adexchangebuyer.accounts.list" call.
  3405. // Exactly one of *AccountsList or error will be non-nil. Any non-2xx
  3406. // status code is an error. Response headers are in either
  3407. // *AccountsList.ServerResponse.Header or (if a response was returned at
  3408. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3409. // to check whether the returned error was because
  3410. // http.StatusNotModified was returned.
  3411. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsList, error) {
  3412. gensupport.SetOptions(c.urlParams_, opts...)
  3413. res, err := c.doRequest("json")
  3414. if res != nil && res.StatusCode == http.StatusNotModified {
  3415. if res.Body != nil {
  3416. res.Body.Close()
  3417. }
  3418. return nil, &googleapi.Error{
  3419. Code: res.StatusCode,
  3420. Header: res.Header,
  3421. }
  3422. }
  3423. if err != nil {
  3424. return nil, err
  3425. }
  3426. defer googleapi.CloseBody(res)
  3427. if err := googleapi.CheckResponse(res); err != nil {
  3428. return nil, err
  3429. }
  3430. ret := &AccountsList{
  3431. ServerResponse: googleapi.ServerResponse{
  3432. Header: res.Header,
  3433. HTTPStatusCode: res.StatusCode,
  3434. },
  3435. }
  3436. target := &ret
  3437. if err := gensupport.DecodeResponse(target, res); err != nil {
  3438. return nil, err
  3439. }
  3440. return ret, nil
  3441. // {
  3442. // "description": "Retrieves the authenticated user's list of accounts.",
  3443. // "httpMethod": "GET",
  3444. // "id": "adexchangebuyer.accounts.list",
  3445. // "path": "accounts",
  3446. // "response": {
  3447. // "$ref": "AccountsList"
  3448. // },
  3449. // "scopes": [
  3450. // "https://www.googleapis.com/auth/adexchange.buyer"
  3451. // ]
  3452. // }
  3453. }
  3454. // method id "adexchangebuyer.accounts.patch":
  3455. type AccountsPatchCall struct {
  3456. s *Service
  3457. id int64
  3458. account *Account
  3459. urlParams_ gensupport.URLParams
  3460. ctx_ context.Context
  3461. header_ http.Header
  3462. }
  3463. // Patch: Updates an existing account. This method supports patch
  3464. // semantics.
  3465. func (r *AccountsService) Patch(id int64, account *Account) *AccountsPatchCall {
  3466. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3467. c.id = id
  3468. c.account = account
  3469. return c
  3470. }
  3471. // ConfirmUnsafeAccountChange sets the optional parameter
  3472. // "confirmUnsafeAccountChange": Confirmation for erasing bidder and
  3473. // cookie matching urls.
  3474. func (c *AccountsPatchCall) ConfirmUnsafeAccountChange(confirmUnsafeAccountChange bool) *AccountsPatchCall {
  3475. c.urlParams_.Set("confirmUnsafeAccountChange", fmt.Sprint(confirmUnsafeAccountChange))
  3476. return c
  3477. }
  3478. // Fields allows partial responses to be retrieved. See
  3479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3480. // for more information.
  3481. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  3482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3483. return c
  3484. }
  3485. // Context sets the context to be used in this call's Do method. Any
  3486. // pending HTTP request will be aborted if the provided context is
  3487. // canceled.
  3488. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  3489. c.ctx_ = ctx
  3490. return c
  3491. }
  3492. // Header returns an http.Header that can be modified by the caller to
  3493. // add HTTP headers to the request.
  3494. func (c *AccountsPatchCall) Header() http.Header {
  3495. if c.header_ == nil {
  3496. c.header_ = make(http.Header)
  3497. }
  3498. return c.header_
  3499. }
  3500. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  3501. reqHeaders := make(http.Header)
  3502. for k, v := range c.header_ {
  3503. reqHeaders[k] = v
  3504. }
  3505. reqHeaders.Set("User-Agent", c.s.userAgent())
  3506. var body io.Reader = nil
  3507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  3508. if err != nil {
  3509. return nil, err
  3510. }
  3511. reqHeaders.Set("Content-Type", "application/json")
  3512. c.urlParams_.Set("alt", alt)
  3513. c.urlParams_.Set("prettyPrint", "false")
  3514. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
  3515. urls += "?" + c.urlParams_.Encode()
  3516. req, err := http.NewRequest("PATCH", urls, body)
  3517. if err != nil {
  3518. return nil, err
  3519. }
  3520. req.Header = reqHeaders
  3521. googleapi.Expand(req.URL, map[string]string{
  3522. "id": strconv.FormatInt(c.id, 10),
  3523. })
  3524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3525. }
  3526. // Do executes the "adexchangebuyer.accounts.patch" call.
  3527. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  3528. // code is an error. Response headers are in either
  3529. // *Account.ServerResponse.Header or (if a response was returned at all)
  3530. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3531. // check whether the returned error was because http.StatusNotModified
  3532. // was returned.
  3533. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  3534. gensupport.SetOptions(c.urlParams_, opts...)
  3535. res, err := c.doRequest("json")
  3536. if res != nil && res.StatusCode == http.StatusNotModified {
  3537. if res.Body != nil {
  3538. res.Body.Close()
  3539. }
  3540. return nil, &googleapi.Error{
  3541. Code: res.StatusCode,
  3542. Header: res.Header,
  3543. }
  3544. }
  3545. if err != nil {
  3546. return nil, err
  3547. }
  3548. defer googleapi.CloseBody(res)
  3549. if err := googleapi.CheckResponse(res); err != nil {
  3550. return nil, err
  3551. }
  3552. ret := &Account{
  3553. ServerResponse: googleapi.ServerResponse{
  3554. Header: res.Header,
  3555. HTTPStatusCode: res.StatusCode,
  3556. },
  3557. }
  3558. target := &ret
  3559. if err := gensupport.DecodeResponse(target, res); err != nil {
  3560. return nil, err
  3561. }
  3562. return ret, nil
  3563. // {
  3564. // "description": "Updates an existing account. This method supports patch semantics.",
  3565. // "httpMethod": "PATCH",
  3566. // "id": "adexchangebuyer.accounts.patch",
  3567. // "parameterOrder": [
  3568. // "id"
  3569. // ],
  3570. // "parameters": {
  3571. // "confirmUnsafeAccountChange": {
  3572. // "description": "Confirmation for erasing bidder and cookie matching urls.",
  3573. // "location": "query",
  3574. // "type": "boolean"
  3575. // },
  3576. // "id": {
  3577. // "description": "The account id",
  3578. // "format": "int32",
  3579. // "location": "path",
  3580. // "required": true,
  3581. // "type": "integer"
  3582. // }
  3583. // },
  3584. // "path": "accounts/{id}",
  3585. // "request": {
  3586. // "$ref": "Account"
  3587. // },
  3588. // "response": {
  3589. // "$ref": "Account"
  3590. // },
  3591. // "scopes": [
  3592. // "https://www.googleapis.com/auth/adexchange.buyer"
  3593. // ]
  3594. // }
  3595. }
  3596. // method id "adexchangebuyer.accounts.update":
  3597. type AccountsUpdateCall struct {
  3598. s *Service
  3599. id int64
  3600. account *Account
  3601. urlParams_ gensupport.URLParams
  3602. ctx_ context.Context
  3603. header_ http.Header
  3604. }
  3605. // Update: Updates an existing account.
  3606. func (r *AccountsService) Update(id int64, account *Account) *AccountsUpdateCall {
  3607. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3608. c.id = id
  3609. c.account = account
  3610. return c
  3611. }
  3612. // ConfirmUnsafeAccountChange sets the optional parameter
  3613. // "confirmUnsafeAccountChange": Confirmation for erasing bidder and
  3614. // cookie matching urls.
  3615. func (c *AccountsUpdateCall) ConfirmUnsafeAccountChange(confirmUnsafeAccountChange bool) *AccountsUpdateCall {
  3616. c.urlParams_.Set("confirmUnsafeAccountChange", fmt.Sprint(confirmUnsafeAccountChange))
  3617. return c
  3618. }
  3619. // Fields allows partial responses to be retrieved. See
  3620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3621. // for more information.
  3622. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  3623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3624. return c
  3625. }
  3626. // Context sets the context to be used in this call's Do method. Any
  3627. // pending HTTP request will be aborted if the provided context is
  3628. // canceled.
  3629. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  3630. c.ctx_ = ctx
  3631. return c
  3632. }
  3633. // Header returns an http.Header that can be modified by the caller to
  3634. // add HTTP headers to the request.
  3635. func (c *AccountsUpdateCall) Header() http.Header {
  3636. if c.header_ == nil {
  3637. c.header_ = make(http.Header)
  3638. }
  3639. return c.header_
  3640. }
  3641. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3642. reqHeaders := make(http.Header)
  3643. for k, v := range c.header_ {
  3644. reqHeaders[k] = v
  3645. }
  3646. reqHeaders.Set("User-Agent", c.s.userAgent())
  3647. var body io.Reader = nil
  3648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  3649. if err != nil {
  3650. return nil, err
  3651. }
  3652. reqHeaders.Set("Content-Type", "application/json")
  3653. c.urlParams_.Set("alt", alt)
  3654. c.urlParams_.Set("prettyPrint", "false")
  3655. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{id}")
  3656. urls += "?" + c.urlParams_.Encode()
  3657. req, err := http.NewRequest("PUT", urls, body)
  3658. if err != nil {
  3659. return nil, err
  3660. }
  3661. req.Header = reqHeaders
  3662. googleapi.Expand(req.URL, map[string]string{
  3663. "id": strconv.FormatInt(c.id, 10),
  3664. })
  3665. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3666. }
  3667. // Do executes the "adexchangebuyer.accounts.update" call.
  3668. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  3669. // code is an error. Response headers are in either
  3670. // *Account.ServerResponse.Header or (if a response was returned at all)
  3671. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3672. // check whether the returned error was because http.StatusNotModified
  3673. // was returned.
  3674. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  3675. gensupport.SetOptions(c.urlParams_, opts...)
  3676. res, err := c.doRequest("json")
  3677. if res != nil && res.StatusCode == http.StatusNotModified {
  3678. if res.Body != nil {
  3679. res.Body.Close()
  3680. }
  3681. return nil, &googleapi.Error{
  3682. Code: res.StatusCode,
  3683. Header: res.Header,
  3684. }
  3685. }
  3686. if err != nil {
  3687. return nil, err
  3688. }
  3689. defer googleapi.CloseBody(res)
  3690. if err := googleapi.CheckResponse(res); err != nil {
  3691. return nil, err
  3692. }
  3693. ret := &Account{
  3694. ServerResponse: googleapi.ServerResponse{
  3695. Header: res.Header,
  3696. HTTPStatusCode: res.StatusCode,
  3697. },
  3698. }
  3699. target := &ret
  3700. if err := gensupport.DecodeResponse(target, res); err != nil {
  3701. return nil, err
  3702. }
  3703. return ret, nil
  3704. // {
  3705. // "description": "Updates an existing account.",
  3706. // "httpMethod": "PUT",
  3707. // "id": "adexchangebuyer.accounts.update",
  3708. // "parameterOrder": [
  3709. // "id"
  3710. // ],
  3711. // "parameters": {
  3712. // "confirmUnsafeAccountChange": {
  3713. // "description": "Confirmation for erasing bidder and cookie matching urls.",
  3714. // "location": "query",
  3715. // "type": "boolean"
  3716. // },
  3717. // "id": {
  3718. // "description": "The account id",
  3719. // "format": "int32",
  3720. // "location": "path",
  3721. // "required": true,
  3722. // "type": "integer"
  3723. // }
  3724. // },
  3725. // "path": "accounts/{id}",
  3726. // "request": {
  3727. // "$ref": "Account"
  3728. // },
  3729. // "response": {
  3730. // "$ref": "Account"
  3731. // },
  3732. // "scopes": [
  3733. // "https://www.googleapis.com/auth/adexchange.buyer"
  3734. // ]
  3735. // }
  3736. }
  3737. // method id "adexchangebuyer.billingInfo.get":
  3738. type BillingInfoGetCall struct {
  3739. s *Service
  3740. accountId int64
  3741. urlParams_ gensupport.URLParams
  3742. ifNoneMatch_ string
  3743. ctx_ context.Context
  3744. header_ http.Header
  3745. }
  3746. // Get: Returns the billing information for one account specified by
  3747. // account ID.
  3748. func (r *BillingInfoService) Get(accountId int64) *BillingInfoGetCall {
  3749. c := &BillingInfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3750. c.accountId = accountId
  3751. return c
  3752. }
  3753. // Fields allows partial responses to be retrieved. See
  3754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3755. // for more information.
  3756. func (c *BillingInfoGetCall) Fields(s ...googleapi.Field) *BillingInfoGetCall {
  3757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3758. return c
  3759. }
  3760. // IfNoneMatch sets the optional parameter which makes the operation
  3761. // fail if the object's ETag matches the given value. This is useful for
  3762. // getting updates only after the object has changed since the last
  3763. // request. Use googleapi.IsNotModified to check whether the response
  3764. // error from Do is the result of In-None-Match.
  3765. func (c *BillingInfoGetCall) IfNoneMatch(entityTag string) *BillingInfoGetCall {
  3766. c.ifNoneMatch_ = entityTag
  3767. return c
  3768. }
  3769. // Context sets the context to be used in this call's Do method. Any
  3770. // pending HTTP request will be aborted if the provided context is
  3771. // canceled.
  3772. func (c *BillingInfoGetCall) Context(ctx context.Context) *BillingInfoGetCall {
  3773. c.ctx_ = ctx
  3774. return c
  3775. }
  3776. // Header returns an http.Header that can be modified by the caller to
  3777. // add HTTP headers to the request.
  3778. func (c *BillingInfoGetCall) Header() http.Header {
  3779. if c.header_ == nil {
  3780. c.header_ = make(http.Header)
  3781. }
  3782. return c.header_
  3783. }
  3784. func (c *BillingInfoGetCall) doRequest(alt string) (*http.Response, error) {
  3785. reqHeaders := make(http.Header)
  3786. for k, v := range c.header_ {
  3787. reqHeaders[k] = v
  3788. }
  3789. reqHeaders.Set("User-Agent", c.s.userAgent())
  3790. if c.ifNoneMatch_ != "" {
  3791. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3792. }
  3793. var body io.Reader = nil
  3794. c.urlParams_.Set("alt", alt)
  3795. c.urlParams_.Set("prettyPrint", "false")
  3796. urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}")
  3797. urls += "?" + c.urlParams_.Encode()
  3798. req, err := http.NewRequest("GET", urls, body)
  3799. if err != nil {
  3800. return nil, err
  3801. }
  3802. req.Header = reqHeaders
  3803. googleapi.Expand(req.URL, map[string]string{
  3804. "accountId": strconv.FormatInt(c.accountId, 10),
  3805. })
  3806. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3807. }
  3808. // Do executes the "adexchangebuyer.billingInfo.get" call.
  3809. // Exactly one of *BillingInfo or error will be non-nil. Any non-2xx
  3810. // status code is an error. Response headers are in either
  3811. // *BillingInfo.ServerResponse.Header or (if a response was returned at
  3812. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3813. // to check whether the returned error was because
  3814. // http.StatusNotModified was returned.
  3815. func (c *BillingInfoGetCall) Do(opts ...googleapi.CallOption) (*BillingInfo, error) {
  3816. gensupport.SetOptions(c.urlParams_, opts...)
  3817. res, err := c.doRequest("json")
  3818. if res != nil && res.StatusCode == http.StatusNotModified {
  3819. if res.Body != nil {
  3820. res.Body.Close()
  3821. }
  3822. return nil, &googleapi.Error{
  3823. Code: res.StatusCode,
  3824. Header: res.Header,
  3825. }
  3826. }
  3827. if err != nil {
  3828. return nil, err
  3829. }
  3830. defer googleapi.CloseBody(res)
  3831. if err := googleapi.CheckResponse(res); err != nil {
  3832. return nil, err
  3833. }
  3834. ret := &BillingInfo{
  3835. ServerResponse: googleapi.ServerResponse{
  3836. Header: res.Header,
  3837. HTTPStatusCode: res.StatusCode,
  3838. },
  3839. }
  3840. target := &ret
  3841. if err := gensupport.DecodeResponse(target, res); err != nil {
  3842. return nil, err
  3843. }
  3844. return ret, nil
  3845. // {
  3846. // "description": "Returns the billing information for one account specified by account ID.",
  3847. // "httpMethod": "GET",
  3848. // "id": "adexchangebuyer.billingInfo.get",
  3849. // "parameterOrder": [
  3850. // "accountId"
  3851. // ],
  3852. // "parameters": {
  3853. // "accountId": {
  3854. // "description": "The account id.",
  3855. // "format": "int32",
  3856. // "location": "path",
  3857. // "required": true,
  3858. // "type": "integer"
  3859. // }
  3860. // },
  3861. // "path": "billinginfo/{accountId}",
  3862. // "response": {
  3863. // "$ref": "BillingInfo"
  3864. // },
  3865. // "scopes": [
  3866. // "https://www.googleapis.com/auth/adexchange.buyer"
  3867. // ]
  3868. // }
  3869. }
  3870. // method id "adexchangebuyer.billingInfo.list":
  3871. type BillingInfoListCall struct {
  3872. s *Service
  3873. urlParams_ gensupport.URLParams
  3874. ifNoneMatch_ string
  3875. ctx_ context.Context
  3876. header_ http.Header
  3877. }
  3878. // List: Retrieves a list of billing information for all accounts of the
  3879. // authenticated user.
  3880. func (r *BillingInfoService) List() *BillingInfoListCall {
  3881. c := &BillingInfoListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3882. return c
  3883. }
  3884. // Fields allows partial responses to be retrieved. See
  3885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3886. // for more information.
  3887. func (c *BillingInfoListCall) Fields(s ...googleapi.Field) *BillingInfoListCall {
  3888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3889. return c
  3890. }
  3891. // IfNoneMatch sets the optional parameter which makes the operation
  3892. // fail if the object's ETag matches the given value. This is useful for
  3893. // getting updates only after the object has changed since the last
  3894. // request. Use googleapi.IsNotModified to check whether the response
  3895. // error from Do is the result of In-None-Match.
  3896. func (c *BillingInfoListCall) IfNoneMatch(entityTag string) *BillingInfoListCall {
  3897. c.ifNoneMatch_ = entityTag
  3898. return c
  3899. }
  3900. // Context sets the context to be used in this call's Do method. Any
  3901. // pending HTTP request will be aborted if the provided context is
  3902. // canceled.
  3903. func (c *BillingInfoListCall) Context(ctx context.Context) *BillingInfoListCall {
  3904. c.ctx_ = ctx
  3905. return c
  3906. }
  3907. // Header returns an http.Header that can be modified by the caller to
  3908. // add HTTP headers to the request.
  3909. func (c *BillingInfoListCall) Header() http.Header {
  3910. if c.header_ == nil {
  3911. c.header_ = make(http.Header)
  3912. }
  3913. return c.header_
  3914. }
  3915. func (c *BillingInfoListCall) doRequest(alt string) (*http.Response, error) {
  3916. reqHeaders := make(http.Header)
  3917. for k, v := range c.header_ {
  3918. reqHeaders[k] = v
  3919. }
  3920. reqHeaders.Set("User-Agent", c.s.userAgent())
  3921. if c.ifNoneMatch_ != "" {
  3922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3923. }
  3924. var body io.Reader = nil
  3925. c.urlParams_.Set("alt", alt)
  3926. c.urlParams_.Set("prettyPrint", "false")
  3927. urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo")
  3928. urls += "?" + c.urlParams_.Encode()
  3929. req, err := http.NewRequest("GET", urls, body)
  3930. if err != nil {
  3931. return nil, err
  3932. }
  3933. req.Header = reqHeaders
  3934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3935. }
  3936. // Do executes the "adexchangebuyer.billingInfo.list" call.
  3937. // Exactly one of *BillingInfoList or error will be non-nil. Any non-2xx
  3938. // status code is an error. Response headers are in either
  3939. // *BillingInfoList.ServerResponse.Header or (if a response was returned
  3940. // at all) in error.(*googleapi.Error).Header. Use
  3941. // googleapi.IsNotModified to check whether the returned error was
  3942. // because http.StatusNotModified was returned.
  3943. func (c *BillingInfoListCall) Do(opts ...googleapi.CallOption) (*BillingInfoList, error) {
  3944. gensupport.SetOptions(c.urlParams_, opts...)
  3945. res, err := c.doRequest("json")
  3946. if res != nil && res.StatusCode == http.StatusNotModified {
  3947. if res.Body != nil {
  3948. res.Body.Close()
  3949. }
  3950. return nil, &googleapi.Error{
  3951. Code: res.StatusCode,
  3952. Header: res.Header,
  3953. }
  3954. }
  3955. if err != nil {
  3956. return nil, err
  3957. }
  3958. defer googleapi.CloseBody(res)
  3959. if err := googleapi.CheckResponse(res); err != nil {
  3960. return nil, err
  3961. }
  3962. ret := &BillingInfoList{
  3963. ServerResponse: googleapi.ServerResponse{
  3964. Header: res.Header,
  3965. HTTPStatusCode: res.StatusCode,
  3966. },
  3967. }
  3968. target := &ret
  3969. if err := gensupport.DecodeResponse(target, res); err != nil {
  3970. return nil, err
  3971. }
  3972. return ret, nil
  3973. // {
  3974. // "description": "Retrieves a list of billing information for all accounts of the authenticated user.",
  3975. // "httpMethod": "GET",
  3976. // "id": "adexchangebuyer.billingInfo.list",
  3977. // "path": "billinginfo",
  3978. // "response": {
  3979. // "$ref": "BillingInfoList"
  3980. // },
  3981. // "scopes": [
  3982. // "https://www.googleapis.com/auth/adexchange.buyer"
  3983. // ]
  3984. // }
  3985. }
  3986. // method id "adexchangebuyer.budget.get":
  3987. type BudgetGetCall struct {
  3988. s *Service
  3989. accountId int64
  3990. billingId int64
  3991. urlParams_ gensupport.URLParams
  3992. ifNoneMatch_ string
  3993. ctx_ context.Context
  3994. header_ http.Header
  3995. }
  3996. // Get: Returns the budget information for the adgroup specified by the
  3997. // accountId and billingId.
  3998. func (r *BudgetService) Get(accountId int64, billingId int64) *BudgetGetCall {
  3999. c := &BudgetGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4000. c.accountId = accountId
  4001. c.billingId = billingId
  4002. return c
  4003. }
  4004. // Fields allows partial responses to be retrieved. See
  4005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4006. // for more information.
  4007. func (c *BudgetGetCall) Fields(s ...googleapi.Field) *BudgetGetCall {
  4008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4009. return c
  4010. }
  4011. // IfNoneMatch sets the optional parameter which makes the operation
  4012. // fail if the object's ETag matches the given value. This is useful for
  4013. // getting updates only after the object has changed since the last
  4014. // request. Use googleapi.IsNotModified to check whether the response
  4015. // error from Do is the result of In-None-Match.
  4016. func (c *BudgetGetCall) IfNoneMatch(entityTag string) *BudgetGetCall {
  4017. c.ifNoneMatch_ = entityTag
  4018. return c
  4019. }
  4020. // Context sets the context to be used in this call's Do method. Any
  4021. // pending HTTP request will be aborted if the provided context is
  4022. // canceled.
  4023. func (c *BudgetGetCall) Context(ctx context.Context) *BudgetGetCall {
  4024. c.ctx_ = ctx
  4025. return c
  4026. }
  4027. // Header returns an http.Header that can be modified by the caller to
  4028. // add HTTP headers to the request.
  4029. func (c *BudgetGetCall) Header() http.Header {
  4030. if c.header_ == nil {
  4031. c.header_ = make(http.Header)
  4032. }
  4033. return c.header_
  4034. }
  4035. func (c *BudgetGetCall) doRequest(alt string) (*http.Response, error) {
  4036. reqHeaders := make(http.Header)
  4037. for k, v := range c.header_ {
  4038. reqHeaders[k] = v
  4039. }
  4040. reqHeaders.Set("User-Agent", c.s.userAgent())
  4041. if c.ifNoneMatch_ != "" {
  4042. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4043. }
  4044. var body io.Reader = nil
  4045. c.urlParams_.Set("alt", alt)
  4046. c.urlParams_.Set("prettyPrint", "false")
  4047. urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
  4048. urls += "?" + c.urlParams_.Encode()
  4049. req, err := http.NewRequest("GET", urls, body)
  4050. if err != nil {
  4051. return nil, err
  4052. }
  4053. req.Header = reqHeaders
  4054. googleapi.Expand(req.URL, map[string]string{
  4055. "accountId": strconv.FormatInt(c.accountId, 10),
  4056. "billingId": strconv.FormatInt(c.billingId, 10),
  4057. })
  4058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4059. }
  4060. // Do executes the "adexchangebuyer.budget.get" call.
  4061. // Exactly one of *Budget or error will be non-nil. Any non-2xx status
  4062. // code is an error. Response headers are in either
  4063. // *Budget.ServerResponse.Header or (if a response was returned at all)
  4064. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4065. // check whether the returned error was because http.StatusNotModified
  4066. // was returned.
  4067. func (c *BudgetGetCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
  4068. gensupport.SetOptions(c.urlParams_, opts...)
  4069. res, err := c.doRequest("json")
  4070. if res != nil && res.StatusCode == http.StatusNotModified {
  4071. if res.Body != nil {
  4072. res.Body.Close()
  4073. }
  4074. return nil, &googleapi.Error{
  4075. Code: res.StatusCode,
  4076. Header: res.Header,
  4077. }
  4078. }
  4079. if err != nil {
  4080. return nil, err
  4081. }
  4082. defer googleapi.CloseBody(res)
  4083. if err := googleapi.CheckResponse(res); err != nil {
  4084. return nil, err
  4085. }
  4086. ret := &Budget{
  4087. ServerResponse: googleapi.ServerResponse{
  4088. Header: res.Header,
  4089. HTTPStatusCode: res.StatusCode,
  4090. },
  4091. }
  4092. target := &ret
  4093. if err := gensupport.DecodeResponse(target, res); err != nil {
  4094. return nil, err
  4095. }
  4096. return ret, nil
  4097. // {
  4098. // "description": "Returns the budget information for the adgroup specified by the accountId and billingId.",
  4099. // "httpMethod": "GET",
  4100. // "id": "adexchangebuyer.budget.get",
  4101. // "parameterOrder": [
  4102. // "accountId",
  4103. // "billingId"
  4104. // ],
  4105. // "parameters": {
  4106. // "accountId": {
  4107. // "description": "The account id to get the budget information for.",
  4108. // "format": "int64",
  4109. // "location": "path",
  4110. // "required": true,
  4111. // "type": "string"
  4112. // },
  4113. // "billingId": {
  4114. // "description": "The billing id to get the budget information for.",
  4115. // "format": "int64",
  4116. // "location": "path",
  4117. // "required": true,
  4118. // "type": "string"
  4119. // }
  4120. // },
  4121. // "path": "billinginfo/{accountId}/{billingId}",
  4122. // "response": {
  4123. // "$ref": "Budget"
  4124. // },
  4125. // "scopes": [
  4126. // "https://www.googleapis.com/auth/adexchange.buyer"
  4127. // ]
  4128. // }
  4129. }
  4130. // method id "adexchangebuyer.budget.patch":
  4131. type BudgetPatchCall struct {
  4132. s *Service
  4133. accountId int64
  4134. billingId int64
  4135. budget *Budget
  4136. urlParams_ gensupport.URLParams
  4137. ctx_ context.Context
  4138. header_ http.Header
  4139. }
  4140. // Patch: Updates the budget amount for the budget of the adgroup
  4141. // specified by the accountId and billingId, with the budget amount in
  4142. // the request. This method supports patch semantics.
  4143. func (r *BudgetService) Patch(accountId int64, billingId int64, budget *Budget) *BudgetPatchCall {
  4144. c := &BudgetPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4145. c.accountId = accountId
  4146. c.billingId = billingId
  4147. c.budget = budget
  4148. return c
  4149. }
  4150. // Fields allows partial responses to be retrieved. See
  4151. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4152. // for more information.
  4153. func (c *BudgetPatchCall) Fields(s ...googleapi.Field) *BudgetPatchCall {
  4154. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4155. return c
  4156. }
  4157. // Context sets the context to be used in this call's Do method. Any
  4158. // pending HTTP request will be aborted if the provided context is
  4159. // canceled.
  4160. func (c *BudgetPatchCall) Context(ctx context.Context) *BudgetPatchCall {
  4161. c.ctx_ = ctx
  4162. return c
  4163. }
  4164. // Header returns an http.Header that can be modified by the caller to
  4165. // add HTTP headers to the request.
  4166. func (c *BudgetPatchCall) Header() http.Header {
  4167. if c.header_ == nil {
  4168. c.header_ = make(http.Header)
  4169. }
  4170. return c.header_
  4171. }
  4172. func (c *BudgetPatchCall) doRequest(alt string) (*http.Response, error) {
  4173. reqHeaders := make(http.Header)
  4174. for k, v := range c.header_ {
  4175. reqHeaders[k] = v
  4176. }
  4177. reqHeaders.Set("User-Agent", c.s.userAgent())
  4178. var body io.Reader = nil
  4179. body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
  4180. if err != nil {
  4181. return nil, err
  4182. }
  4183. reqHeaders.Set("Content-Type", "application/json")
  4184. c.urlParams_.Set("alt", alt)
  4185. c.urlParams_.Set("prettyPrint", "false")
  4186. urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
  4187. urls += "?" + c.urlParams_.Encode()
  4188. req, err := http.NewRequest("PATCH", urls, body)
  4189. if err != nil {
  4190. return nil, err
  4191. }
  4192. req.Header = reqHeaders
  4193. googleapi.Expand(req.URL, map[string]string{
  4194. "accountId": strconv.FormatInt(c.accountId, 10),
  4195. "billingId": strconv.FormatInt(c.billingId, 10),
  4196. })
  4197. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4198. }
  4199. // Do executes the "adexchangebuyer.budget.patch" call.
  4200. // Exactly one of *Budget or error will be non-nil. Any non-2xx status
  4201. // code is an error. Response headers are in either
  4202. // *Budget.ServerResponse.Header or (if a response was returned at all)
  4203. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4204. // check whether the returned error was because http.StatusNotModified
  4205. // was returned.
  4206. func (c *BudgetPatchCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
  4207. gensupport.SetOptions(c.urlParams_, opts...)
  4208. res, err := c.doRequest("json")
  4209. if res != nil && res.StatusCode == http.StatusNotModified {
  4210. if res.Body != nil {
  4211. res.Body.Close()
  4212. }
  4213. return nil, &googleapi.Error{
  4214. Code: res.StatusCode,
  4215. Header: res.Header,
  4216. }
  4217. }
  4218. if err != nil {
  4219. return nil, err
  4220. }
  4221. defer googleapi.CloseBody(res)
  4222. if err := googleapi.CheckResponse(res); err != nil {
  4223. return nil, err
  4224. }
  4225. ret := &Budget{
  4226. ServerResponse: googleapi.ServerResponse{
  4227. Header: res.Header,
  4228. HTTPStatusCode: res.StatusCode,
  4229. },
  4230. }
  4231. target := &ret
  4232. if err := gensupport.DecodeResponse(target, res); err != nil {
  4233. return nil, err
  4234. }
  4235. return ret, nil
  4236. // {
  4237. // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.",
  4238. // "httpMethod": "PATCH",
  4239. // "id": "adexchangebuyer.budget.patch",
  4240. // "parameterOrder": [
  4241. // "accountId",
  4242. // "billingId"
  4243. // ],
  4244. // "parameters": {
  4245. // "accountId": {
  4246. // "description": "The account id associated with the budget being updated.",
  4247. // "format": "int64",
  4248. // "location": "path",
  4249. // "required": true,
  4250. // "type": "string"
  4251. // },
  4252. // "billingId": {
  4253. // "description": "The billing id associated with the budget being updated.",
  4254. // "format": "int64",
  4255. // "location": "path",
  4256. // "required": true,
  4257. // "type": "string"
  4258. // }
  4259. // },
  4260. // "path": "billinginfo/{accountId}/{billingId}",
  4261. // "request": {
  4262. // "$ref": "Budget"
  4263. // },
  4264. // "response": {
  4265. // "$ref": "Budget"
  4266. // },
  4267. // "scopes": [
  4268. // "https://www.googleapis.com/auth/adexchange.buyer"
  4269. // ]
  4270. // }
  4271. }
  4272. // method id "adexchangebuyer.budget.update":
  4273. type BudgetUpdateCall struct {
  4274. s *Service
  4275. accountId int64
  4276. billingId int64
  4277. budget *Budget
  4278. urlParams_ gensupport.URLParams
  4279. ctx_ context.Context
  4280. header_ http.Header
  4281. }
  4282. // Update: Updates the budget amount for the budget of the adgroup
  4283. // specified by the accountId and billingId, with the budget amount in
  4284. // the request.
  4285. func (r *BudgetService) Update(accountId int64, billingId int64, budget *Budget) *BudgetUpdateCall {
  4286. c := &BudgetUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4287. c.accountId = accountId
  4288. c.billingId = billingId
  4289. c.budget = budget
  4290. return c
  4291. }
  4292. // Fields allows partial responses to be retrieved. See
  4293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4294. // for more information.
  4295. func (c *BudgetUpdateCall) Fields(s ...googleapi.Field) *BudgetUpdateCall {
  4296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4297. return c
  4298. }
  4299. // Context sets the context to be used in this call's Do method. Any
  4300. // pending HTTP request will be aborted if the provided context is
  4301. // canceled.
  4302. func (c *BudgetUpdateCall) Context(ctx context.Context) *BudgetUpdateCall {
  4303. c.ctx_ = ctx
  4304. return c
  4305. }
  4306. // Header returns an http.Header that can be modified by the caller to
  4307. // add HTTP headers to the request.
  4308. func (c *BudgetUpdateCall) Header() http.Header {
  4309. if c.header_ == nil {
  4310. c.header_ = make(http.Header)
  4311. }
  4312. return c.header_
  4313. }
  4314. func (c *BudgetUpdateCall) doRequest(alt string) (*http.Response, error) {
  4315. reqHeaders := make(http.Header)
  4316. for k, v := range c.header_ {
  4317. reqHeaders[k] = v
  4318. }
  4319. reqHeaders.Set("User-Agent", c.s.userAgent())
  4320. var body io.Reader = nil
  4321. body, err := googleapi.WithoutDataWrapper.JSONReader(c.budget)
  4322. if err != nil {
  4323. return nil, err
  4324. }
  4325. reqHeaders.Set("Content-Type", "application/json")
  4326. c.urlParams_.Set("alt", alt)
  4327. c.urlParams_.Set("prettyPrint", "false")
  4328. urls := googleapi.ResolveRelative(c.s.BasePath, "billinginfo/{accountId}/{billingId}")
  4329. urls += "?" + c.urlParams_.Encode()
  4330. req, err := http.NewRequest("PUT", urls, body)
  4331. if err != nil {
  4332. return nil, err
  4333. }
  4334. req.Header = reqHeaders
  4335. googleapi.Expand(req.URL, map[string]string{
  4336. "accountId": strconv.FormatInt(c.accountId, 10),
  4337. "billingId": strconv.FormatInt(c.billingId, 10),
  4338. })
  4339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4340. }
  4341. // Do executes the "adexchangebuyer.budget.update" call.
  4342. // Exactly one of *Budget or error will be non-nil. Any non-2xx status
  4343. // code is an error. Response headers are in either
  4344. // *Budget.ServerResponse.Header or (if a response was returned at all)
  4345. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4346. // check whether the returned error was because http.StatusNotModified
  4347. // was returned.
  4348. func (c *BudgetUpdateCall) Do(opts ...googleapi.CallOption) (*Budget, error) {
  4349. gensupport.SetOptions(c.urlParams_, opts...)
  4350. res, err := c.doRequest("json")
  4351. if res != nil && res.StatusCode == http.StatusNotModified {
  4352. if res.Body != nil {
  4353. res.Body.Close()
  4354. }
  4355. return nil, &googleapi.Error{
  4356. Code: res.StatusCode,
  4357. Header: res.Header,
  4358. }
  4359. }
  4360. if err != nil {
  4361. return nil, err
  4362. }
  4363. defer googleapi.CloseBody(res)
  4364. if err := googleapi.CheckResponse(res); err != nil {
  4365. return nil, err
  4366. }
  4367. ret := &Budget{
  4368. ServerResponse: googleapi.ServerResponse{
  4369. Header: res.Header,
  4370. HTTPStatusCode: res.StatusCode,
  4371. },
  4372. }
  4373. target := &ret
  4374. if err := gensupport.DecodeResponse(target, res); err != nil {
  4375. return nil, err
  4376. }
  4377. return ret, nil
  4378. // {
  4379. // "description": "Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.",
  4380. // "httpMethod": "PUT",
  4381. // "id": "adexchangebuyer.budget.update",
  4382. // "parameterOrder": [
  4383. // "accountId",
  4384. // "billingId"
  4385. // ],
  4386. // "parameters": {
  4387. // "accountId": {
  4388. // "description": "The account id associated with the budget being updated.",
  4389. // "format": "int64",
  4390. // "location": "path",
  4391. // "required": true,
  4392. // "type": "string"
  4393. // },
  4394. // "billingId": {
  4395. // "description": "The billing id associated with the budget being updated.",
  4396. // "format": "int64",
  4397. // "location": "path",
  4398. // "required": true,
  4399. // "type": "string"
  4400. // }
  4401. // },
  4402. // "path": "billinginfo/{accountId}/{billingId}",
  4403. // "request": {
  4404. // "$ref": "Budget"
  4405. // },
  4406. // "response": {
  4407. // "$ref": "Budget"
  4408. // },
  4409. // "scopes": [
  4410. // "https://www.googleapis.com/auth/adexchange.buyer"
  4411. // ]
  4412. // }
  4413. }
  4414. // method id "adexchangebuyer.creatives.addDeal":
  4415. type CreativesAddDealCall struct {
  4416. s *Service
  4417. accountId int64
  4418. buyerCreativeId string
  4419. dealId int64
  4420. urlParams_ gensupport.URLParams
  4421. ctx_ context.Context
  4422. header_ http.Header
  4423. }
  4424. // AddDeal: Add a deal id association for the creative.
  4425. func (r *CreativesService) AddDeal(accountId int64, buyerCreativeId string, dealId int64) *CreativesAddDealCall {
  4426. c := &CreativesAddDealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4427. c.accountId = accountId
  4428. c.buyerCreativeId = buyerCreativeId
  4429. c.dealId = dealId
  4430. return c
  4431. }
  4432. // Fields allows partial responses to be retrieved. See
  4433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4434. // for more information.
  4435. func (c *CreativesAddDealCall) Fields(s ...googleapi.Field) *CreativesAddDealCall {
  4436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4437. return c
  4438. }
  4439. // Context sets the context to be used in this call's Do method. Any
  4440. // pending HTTP request will be aborted if the provided context is
  4441. // canceled.
  4442. func (c *CreativesAddDealCall) Context(ctx context.Context) *CreativesAddDealCall {
  4443. c.ctx_ = ctx
  4444. return c
  4445. }
  4446. // Header returns an http.Header that can be modified by the caller to
  4447. // add HTTP headers to the request.
  4448. func (c *CreativesAddDealCall) Header() http.Header {
  4449. if c.header_ == nil {
  4450. c.header_ = make(http.Header)
  4451. }
  4452. return c.header_
  4453. }
  4454. func (c *CreativesAddDealCall) doRequest(alt string) (*http.Response, error) {
  4455. reqHeaders := make(http.Header)
  4456. for k, v := range c.header_ {
  4457. reqHeaders[k] = v
  4458. }
  4459. reqHeaders.Set("User-Agent", c.s.userAgent())
  4460. var body io.Reader = nil
  4461. c.urlParams_.Set("alt", alt)
  4462. c.urlParams_.Set("prettyPrint", "false")
  4463. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}")
  4464. urls += "?" + c.urlParams_.Encode()
  4465. req, err := http.NewRequest("POST", urls, body)
  4466. if err != nil {
  4467. return nil, err
  4468. }
  4469. req.Header = reqHeaders
  4470. googleapi.Expand(req.URL, map[string]string{
  4471. "accountId": strconv.FormatInt(c.accountId, 10),
  4472. "buyerCreativeId": c.buyerCreativeId,
  4473. "dealId": strconv.FormatInt(c.dealId, 10),
  4474. })
  4475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4476. }
  4477. // Do executes the "adexchangebuyer.creatives.addDeal" call.
  4478. func (c *CreativesAddDealCall) Do(opts ...googleapi.CallOption) error {
  4479. gensupport.SetOptions(c.urlParams_, opts...)
  4480. res, err := c.doRequest("json")
  4481. if err != nil {
  4482. return err
  4483. }
  4484. defer googleapi.CloseBody(res)
  4485. if err := googleapi.CheckResponse(res); err != nil {
  4486. return err
  4487. }
  4488. return nil
  4489. // {
  4490. // "description": "Add a deal id association for the creative.",
  4491. // "httpMethod": "POST",
  4492. // "id": "adexchangebuyer.creatives.addDeal",
  4493. // "parameterOrder": [
  4494. // "accountId",
  4495. // "buyerCreativeId",
  4496. // "dealId"
  4497. // ],
  4498. // "parameters": {
  4499. // "accountId": {
  4500. // "description": "The id for the account that will serve this creative.",
  4501. // "format": "int32",
  4502. // "location": "path",
  4503. // "required": true,
  4504. // "type": "integer"
  4505. // },
  4506. // "buyerCreativeId": {
  4507. // "description": "The buyer-specific id for this creative.",
  4508. // "location": "path",
  4509. // "required": true,
  4510. // "type": "string"
  4511. // },
  4512. // "dealId": {
  4513. // "description": "The id of the deal id to associate with this creative.",
  4514. // "format": "int64",
  4515. // "location": "path",
  4516. // "required": true,
  4517. // "type": "string"
  4518. // }
  4519. // },
  4520. // "path": "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}",
  4521. // "scopes": [
  4522. // "https://www.googleapis.com/auth/adexchange.buyer"
  4523. // ]
  4524. // }
  4525. }
  4526. // method id "adexchangebuyer.creatives.get":
  4527. type CreativesGetCall struct {
  4528. s *Service
  4529. accountId int64
  4530. buyerCreativeId string
  4531. urlParams_ gensupport.URLParams
  4532. ifNoneMatch_ string
  4533. ctx_ context.Context
  4534. header_ http.Header
  4535. }
  4536. // Get: Gets the status for a single creative. A creative will be
  4537. // available 30-40 minutes after submission.
  4538. func (r *CreativesService) Get(accountId int64, buyerCreativeId string) *CreativesGetCall {
  4539. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4540. c.accountId = accountId
  4541. c.buyerCreativeId = buyerCreativeId
  4542. return c
  4543. }
  4544. // Fields allows partial responses to be retrieved. See
  4545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4546. // for more information.
  4547. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  4548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4549. return c
  4550. }
  4551. // IfNoneMatch sets the optional parameter which makes the operation
  4552. // fail if the object's ETag matches the given value. This is useful for
  4553. // getting updates only after the object has changed since the last
  4554. // request. Use googleapi.IsNotModified to check whether the response
  4555. // error from Do is the result of In-None-Match.
  4556. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  4557. c.ifNoneMatch_ = entityTag
  4558. return c
  4559. }
  4560. // Context sets the context to be used in this call's Do method. Any
  4561. // pending HTTP request will be aborted if the provided context is
  4562. // canceled.
  4563. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  4564. c.ctx_ = ctx
  4565. return c
  4566. }
  4567. // Header returns an http.Header that can be modified by the caller to
  4568. // add HTTP headers to the request.
  4569. func (c *CreativesGetCall) Header() http.Header {
  4570. if c.header_ == nil {
  4571. c.header_ = make(http.Header)
  4572. }
  4573. return c.header_
  4574. }
  4575. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  4576. reqHeaders := make(http.Header)
  4577. for k, v := range c.header_ {
  4578. reqHeaders[k] = v
  4579. }
  4580. reqHeaders.Set("User-Agent", c.s.userAgent())
  4581. if c.ifNoneMatch_ != "" {
  4582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4583. }
  4584. var body io.Reader = nil
  4585. c.urlParams_.Set("alt", alt)
  4586. c.urlParams_.Set("prettyPrint", "false")
  4587. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}")
  4588. urls += "?" + c.urlParams_.Encode()
  4589. req, err := http.NewRequest("GET", urls, body)
  4590. if err != nil {
  4591. return nil, err
  4592. }
  4593. req.Header = reqHeaders
  4594. googleapi.Expand(req.URL, map[string]string{
  4595. "accountId": strconv.FormatInt(c.accountId, 10),
  4596. "buyerCreativeId": c.buyerCreativeId,
  4597. })
  4598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4599. }
  4600. // Do executes the "adexchangebuyer.creatives.get" call.
  4601. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  4602. // code is an error. Response headers are in either
  4603. // *Creative.ServerResponse.Header or (if a response was returned at
  4604. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4605. // to check whether the returned error was because
  4606. // http.StatusNotModified was returned.
  4607. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  4608. gensupport.SetOptions(c.urlParams_, opts...)
  4609. res, err := c.doRequest("json")
  4610. if res != nil && res.StatusCode == http.StatusNotModified {
  4611. if res.Body != nil {
  4612. res.Body.Close()
  4613. }
  4614. return nil, &googleapi.Error{
  4615. Code: res.StatusCode,
  4616. Header: res.Header,
  4617. }
  4618. }
  4619. if err != nil {
  4620. return nil, err
  4621. }
  4622. defer googleapi.CloseBody(res)
  4623. if err := googleapi.CheckResponse(res); err != nil {
  4624. return nil, err
  4625. }
  4626. ret := &Creative{
  4627. ServerResponse: googleapi.ServerResponse{
  4628. Header: res.Header,
  4629. HTTPStatusCode: res.StatusCode,
  4630. },
  4631. }
  4632. target := &ret
  4633. if err := gensupport.DecodeResponse(target, res); err != nil {
  4634. return nil, err
  4635. }
  4636. return ret, nil
  4637. // {
  4638. // "description": "Gets the status for a single creative. A creative will be available 30-40 minutes after submission.",
  4639. // "httpMethod": "GET",
  4640. // "id": "adexchangebuyer.creatives.get",
  4641. // "parameterOrder": [
  4642. // "accountId",
  4643. // "buyerCreativeId"
  4644. // ],
  4645. // "parameters": {
  4646. // "accountId": {
  4647. // "description": "The id for the account that will serve this creative.",
  4648. // "format": "int32",
  4649. // "location": "path",
  4650. // "required": true,
  4651. // "type": "integer"
  4652. // },
  4653. // "buyerCreativeId": {
  4654. // "description": "The buyer-specific id for this creative.",
  4655. // "location": "path",
  4656. // "required": true,
  4657. // "type": "string"
  4658. // }
  4659. // },
  4660. // "path": "creatives/{accountId}/{buyerCreativeId}",
  4661. // "response": {
  4662. // "$ref": "Creative"
  4663. // },
  4664. // "scopes": [
  4665. // "https://www.googleapis.com/auth/adexchange.buyer"
  4666. // ]
  4667. // }
  4668. }
  4669. // method id "adexchangebuyer.creatives.insert":
  4670. type CreativesInsertCall struct {
  4671. s *Service
  4672. creative *Creative
  4673. urlParams_ gensupport.URLParams
  4674. ctx_ context.Context
  4675. header_ http.Header
  4676. }
  4677. // Insert: Submit a new creative.
  4678. func (r *CreativesService) Insert(creative *Creative) *CreativesInsertCall {
  4679. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4680. c.creative = creative
  4681. return c
  4682. }
  4683. // Fields allows partial responses to be retrieved. See
  4684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4685. // for more information.
  4686. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  4687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4688. return c
  4689. }
  4690. // Context sets the context to be used in this call's Do method. Any
  4691. // pending HTTP request will be aborted if the provided context is
  4692. // canceled.
  4693. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  4694. c.ctx_ = ctx
  4695. return c
  4696. }
  4697. // Header returns an http.Header that can be modified by the caller to
  4698. // add HTTP headers to the request.
  4699. func (c *CreativesInsertCall) Header() http.Header {
  4700. if c.header_ == nil {
  4701. c.header_ = make(http.Header)
  4702. }
  4703. return c.header_
  4704. }
  4705. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  4706. reqHeaders := make(http.Header)
  4707. for k, v := range c.header_ {
  4708. reqHeaders[k] = v
  4709. }
  4710. reqHeaders.Set("User-Agent", c.s.userAgent())
  4711. var body io.Reader = nil
  4712. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  4713. if err != nil {
  4714. return nil, err
  4715. }
  4716. reqHeaders.Set("Content-Type", "application/json")
  4717. c.urlParams_.Set("alt", alt)
  4718. c.urlParams_.Set("prettyPrint", "false")
  4719. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
  4720. urls += "?" + c.urlParams_.Encode()
  4721. req, err := http.NewRequest("POST", urls, body)
  4722. if err != nil {
  4723. return nil, err
  4724. }
  4725. req.Header = reqHeaders
  4726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4727. }
  4728. // Do executes the "adexchangebuyer.creatives.insert" call.
  4729. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  4730. // code is an error. Response headers are in either
  4731. // *Creative.ServerResponse.Header or (if a response was returned at
  4732. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4733. // to check whether the returned error was because
  4734. // http.StatusNotModified was returned.
  4735. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  4736. gensupport.SetOptions(c.urlParams_, opts...)
  4737. res, err := c.doRequest("json")
  4738. if res != nil && res.StatusCode == http.StatusNotModified {
  4739. if res.Body != nil {
  4740. res.Body.Close()
  4741. }
  4742. return nil, &googleapi.Error{
  4743. Code: res.StatusCode,
  4744. Header: res.Header,
  4745. }
  4746. }
  4747. if err != nil {
  4748. return nil, err
  4749. }
  4750. defer googleapi.CloseBody(res)
  4751. if err := googleapi.CheckResponse(res); err != nil {
  4752. return nil, err
  4753. }
  4754. ret := &Creative{
  4755. ServerResponse: googleapi.ServerResponse{
  4756. Header: res.Header,
  4757. HTTPStatusCode: res.StatusCode,
  4758. },
  4759. }
  4760. target := &ret
  4761. if err := gensupport.DecodeResponse(target, res); err != nil {
  4762. return nil, err
  4763. }
  4764. return ret, nil
  4765. // {
  4766. // "description": "Submit a new creative.",
  4767. // "httpMethod": "POST",
  4768. // "id": "adexchangebuyer.creatives.insert",
  4769. // "path": "creatives",
  4770. // "request": {
  4771. // "$ref": "Creative"
  4772. // },
  4773. // "response": {
  4774. // "$ref": "Creative"
  4775. // },
  4776. // "scopes": [
  4777. // "https://www.googleapis.com/auth/adexchange.buyer"
  4778. // ]
  4779. // }
  4780. }
  4781. // method id "adexchangebuyer.creatives.list":
  4782. type CreativesListCall struct {
  4783. s *Service
  4784. urlParams_ gensupport.URLParams
  4785. ifNoneMatch_ string
  4786. ctx_ context.Context
  4787. header_ http.Header
  4788. }
  4789. // List: Retrieves a list of the authenticated user's active creatives.
  4790. // A creative will be available 30-40 minutes after submission.
  4791. func (r *CreativesService) List() *CreativesListCall {
  4792. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4793. return c
  4794. }
  4795. // AccountId sets the optional parameter "accountId": When specified,
  4796. // only creatives for the given account ids are returned.
  4797. func (c *CreativesListCall) AccountId(accountId ...int64) *CreativesListCall {
  4798. var accountId_ []string
  4799. for _, v := range accountId {
  4800. accountId_ = append(accountId_, fmt.Sprint(v))
  4801. }
  4802. c.urlParams_.SetMulti("accountId", accountId_)
  4803. return c
  4804. }
  4805. // BuyerCreativeId sets the optional parameter "buyerCreativeId": When
  4806. // specified, only creatives for the given buyer creative ids are
  4807. // returned.
  4808. func (c *CreativesListCall) BuyerCreativeId(buyerCreativeId ...string) *CreativesListCall {
  4809. c.urlParams_.SetMulti("buyerCreativeId", append([]string{}, buyerCreativeId...))
  4810. return c
  4811. }
  4812. // DealsStatusFilter sets the optional parameter "dealsStatusFilter":
  4813. // When specified, only creatives having the given deals status are
  4814. // returned.
  4815. //
  4816. // Possible values:
  4817. // "approved" - Creatives which have been approved for serving on
  4818. // deals.
  4819. // "conditionally_approved" - Creatives which have been conditionally
  4820. // approved for serving on deals.
  4821. // "disapproved" - Creatives which have been disapproved for serving
  4822. // on deals.
  4823. // "not_checked" - Creatives whose deals status is not yet checked.
  4824. func (c *CreativesListCall) DealsStatusFilter(dealsStatusFilter string) *CreativesListCall {
  4825. c.urlParams_.Set("dealsStatusFilter", dealsStatusFilter)
  4826. return c
  4827. }
  4828. // MaxResults sets the optional parameter "maxResults": Maximum number
  4829. // of entries returned on one result page. If not set, the default is
  4830. // 100.
  4831. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  4832. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4833. return c
  4834. }
  4835. // OpenAuctionStatusFilter sets the optional parameter
  4836. // "openAuctionStatusFilter": When specified, only creatives having the
  4837. // given open auction status are returned.
  4838. //
  4839. // Possible values:
  4840. // "approved" - Creatives which have been approved for serving on the
  4841. // open auction.
  4842. // "conditionally_approved" - Creatives which have been conditionally
  4843. // approved for serving on the open auction.
  4844. // "disapproved" - Creatives which have been disapproved for serving
  4845. // on the open auction.
  4846. // "not_checked" - Creatives whose open auction status is not yet
  4847. // checked.
  4848. func (c *CreativesListCall) OpenAuctionStatusFilter(openAuctionStatusFilter string) *CreativesListCall {
  4849. c.urlParams_.Set("openAuctionStatusFilter", openAuctionStatusFilter)
  4850. return c
  4851. }
  4852. // PageToken sets the optional parameter "pageToken": A continuation
  4853. // token, used to page through ad clients. To retrieve the next page,
  4854. // set this parameter to the value of "nextPageToken" from the previous
  4855. // response.
  4856. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  4857. c.urlParams_.Set("pageToken", pageToken)
  4858. return c
  4859. }
  4860. // Fields allows partial responses to be retrieved. See
  4861. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4862. // for more information.
  4863. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  4864. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4865. return c
  4866. }
  4867. // IfNoneMatch sets the optional parameter which makes the operation
  4868. // fail if the object's ETag matches the given value. This is useful for
  4869. // getting updates only after the object has changed since the last
  4870. // request. Use googleapi.IsNotModified to check whether the response
  4871. // error from Do is the result of In-None-Match.
  4872. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  4873. c.ifNoneMatch_ = entityTag
  4874. return c
  4875. }
  4876. // Context sets the context to be used in this call's Do method. Any
  4877. // pending HTTP request will be aborted if the provided context is
  4878. // canceled.
  4879. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  4880. c.ctx_ = ctx
  4881. return c
  4882. }
  4883. // Header returns an http.Header that can be modified by the caller to
  4884. // add HTTP headers to the request.
  4885. func (c *CreativesListCall) Header() http.Header {
  4886. if c.header_ == nil {
  4887. c.header_ = make(http.Header)
  4888. }
  4889. return c.header_
  4890. }
  4891. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  4892. reqHeaders := make(http.Header)
  4893. for k, v := range c.header_ {
  4894. reqHeaders[k] = v
  4895. }
  4896. reqHeaders.Set("User-Agent", c.s.userAgent())
  4897. if c.ifNoneMatch_ != "" {
  4898. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4899. }
  4900. var body io.Reader = nil
  4901. c.urlParams_.Set("alt", alt)
  4902. c.urlParams_.Set("prettyPrint", "false")
  4903. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives")
  4904. urls += "?" + c.urlParams_.Encode()
  4905. req, err := http.NewRequest("GET", urls, body)
  4906. if err != nil {
  4907. return nil, err
  4908. }
  4909. req.Header = reqHeaders
  4910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4911. }
  4912. // Do executes the "adexchangebuyer.creatives.list" call.
  4913. // Exactly one of *CreativesList or error will be non-nil. Any non-2xx
  4914. // status code is an error. Response headers are in either
  4915. // *CreativesList.ServerResponse.Header or (if a response was returned
  4916. // at all) in error.(*googleapi.Error).Header. Use
  4917. // googleapi.IsNotModified to check whether the returned error was
  4918. // because http.StatusNotModified was returned.
  4919. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesList, error) {
  4920. gensupport.SetOptions(c.urlParams_, opts...)
  4921. res, err := c.doRequest("json")
  4922. if res != nil && res.StatusCode == http.StatusNotModified {
  4923. if res.Body != nil {
  4924. res.Body.Close()
  4925. }
  4926. return nil, &googleapi.Error{
  4927. Code: res.StatusCode,
  4928. Header: res.Header,
  4929. }
  4930. }
  4931. if err != nil {
  4932. return nil, err
  4933. }
  4934. defer googleapi.CloseBody(res)
  4935. if err := googleapi.CheckResponse(res); err != nil {
  4936. return nil, err
  4937. }
  4938. ret := &CreativesList{
  4939. ServerResponse: googleapi.ServerResponse{
  4940. Header: res.Header,
  4941. HTTPStatusCode: res.StatusCode,
  4942. },
  4943. }
  4944. target := &ret
  4945. if err := gensupport.DecodeResponse(target, res); err != nil {
  4946. return nil, err
  4947. }
  4948. return ret, nil
  4949. // {
  4950. // "description": "Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.",
  4951. // "httpMethod": "GET",
  4952. // "id": "adexchangebuyer.creatives.list",
  4953. // "parameters": {
  4954. // "accountId": {
  4955. // "description": "When specified, only creatives for the given account ids are returned.",
  4956. // "format": "int32",
  4957. // "location": "query",
  4958. // "repeated": true,
  4959. // "type": "integer"
  4960. // },
  4961. // "buyerCreativeId": {
  4962. // "description": "When specified, only creatives for the given buyer creative ids are returned.",
  4963. // "location": "query",
  4964. // "repeated": true,
  4965. // "type": "string"
  4966. // },
  4967. // "dealsStatusFilter": {
  4968. // "description": "When specified, only creatives having the given deals status are returned.",
  4969. // "enum": [
  4970. // "approved",
  4971. // "conditionally_approved",
  4972. // "disapproved",
  4973. // "not_checked"
  4974. // ],
  4975. // "enumDescriptions": [
  4976. // "Creatives which have been approved for serving on deals.",
  4977. // "Creatives which have been conditionally approved for serving on deals.",
  4978. // "Creatives which have been disapproved for serving on deals.",
  4979. // "Creatives whose deals status is not yet checked."
  4980. // ],
  4981. // "location": "query",
  4982. // "type": "string"
  4983. // },
  4984. // "maxResults": {
  4985. // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
  4986. // "format": "uint32",
  4987. // "location": "query",
  4988. // "maximum": "1000",
  4989. // "minimum": "1",
  4990. // "type": "integer"
  4991. // },
  4992. // "openAuctionStatusFilter": {
  4993. // "description": "When specified, only creatives having the given open auction status are returned.",
  4994. // "enum": [
  4995. // "approved",
  4996. // "conditionally_approved",
  4997. // "disapproved",
  4998. // "not_checked"
  4999. // ],
  5000. // "enumDescriptions": [
  5001. // "Creatives which have been approved for serving on the open auction.",
  5002. // "Creatives which have been conditionally approved for serving on the open auction.",
  5003. // "Creatives which have been disapproved for serving on the open auction.",
  5004. // "Creatives whose open auction status is not yet checked."
  5005. // ],
  5006. // "location": "query",
  5007. // "type": "string"
  5008. // },
  5009. // "pageToken": {
  5010. // "description": "A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.",
  5011. // "location": "query",
  5012. // "type": "string"
  5013. // }
  5014. // },
  5015. // "path": "creatives",
  5016. // "response": {
  5017. // "$ref": "CreativesList"
  5018. // },
  5019. // "scopes": [
  5020. // "https://www.googleapis.com/auth/adexchange.buyer"
  5021. // ]
  5022. // }
  5023. }
  5024. // Pages invokes f for each page of results.
  5025. // A non-nil error returned from f will halt the iteration.
  5026. // The provided context supersedes any context provided to the Context method.
  5027. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesList) error) error {
  5028. c.ctx_ = ctx
  5029. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5030. for {
  5031. x, err := c.Do()
  5032. if err != nil {
  5033. return err
  5034. }
  5035. if err := f(x); err != nil {
  5036. return err
  5037. }
  5038. if x.NextPageToken == "" {
  5039. return nil
  5040. }
  5041. c.PageToken(x.NextPageToken)
  5042. }
  5043. }
  5044. // method id "adexchangebuyer.creatives.listDeals":
  5045. type CreativesListDealsCall struct {
  5046. s *Service
  5047. accountId int64
  5048. buyerCreativeId string
  5049. urlParams_ gensupport.URLParams
  5050. ifNoneMatch_ string
  5051. ctx_ context.Context
  5052. header_ http.Header
  5053. }
  5054. // ListDeals: Lists the external deal ids associated with the creative.
  5055. func (r *CreativesService) ListDeals(accountId int64, buyerCreativeId string) *CreativesListDealsCall {
  5056. c := &CreativesListDealsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5057. c.accountId = accountId
  5058. c.buyerCreativeId = buyerCreativeId
  5059. return c
  5060. }
  5061. // Fields allows partial responses to be retrieved. See
  5062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5063. // for more information.
  5064. func (c *CreativesListDealsCall) Fields(s ...googleapi.Field) *CreativesListDealsCall {
  5065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5066. return c
  5067. }
  5068. // IfNoneMatch sets the optional parameter which makes the operation
  5069. // fail if the object's ETag matches the given value. This is useful for
  5070. // getting updates only after the object has changed since the last
  5071. // request. Use googleapi.IsNotModified to check whether the response
  5072. // error from Do is the result of In-None-Match.
  5073. func (c *CreativesListDealsCall) IfNoneMatch(entityTag string) *CreativesListDealsCall {
  5074. c.ifNoneMatch_ = entityTag
  5075. return c
  5076. }
  5077. // Context sets the context to be used in this call's Do method. Any
  5078. // pending HTTP request will be aborted if the provided context is
  5079. // canceled.
  5080. func (c *CreativesListDealsCall) Context(ctx context.Context) *CreativesListDealsCall {
  5081. c.ctx_ = ctx
  5082. return c
  5083. }
  5084. // Header returns an http.Header that can be modified by the caller to
  5085. // add HTTP headers to the request.
  5086. func (c *CreativesListDealsCall) Header() http.Header {
  5087. if c.header_ == nil {
  5088. c.header_ = make(http.Header)
  5089. }
  5090. return c.header_
  5091. }
  5092. func (c *CreativesListDealsCall) doRequest(alt string) (*http.Response, error) {
  5093. reqHeaders := make(http.Header)
  5094. for k, v := range c.header_ {
  5095. reqHeaders[k] = v
  5096. }
  5097. reqHeaders.Set("User-Agent", c.s.userAgent())
  5098. if c.ifNoneMatch_ != "" {
  5099. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5100. }
  5101. var body io.Reader = nil
  5102. c.urlParams_.Set("alt", alt)
  5103. c.urlParams_.Set("prettyPrint", "false")
  5104. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/listDeals")
  5105. urls += "?" + c.urlParams_.Encode()
  5106. req, err := http.NewRequest("GET", urls, body)
  5107. if err != nil {
  5108. return nil, err
  5109. }
  5110. req.Header = reqHeaders
  5111. googleapi.Expand(req.URL, map[string]string{
  5112. "accountId": strconv.FormatInt(c.accountId, 10),
  5113. "buyerCreativeId": c.buyerCreativeId,
  5114. })
  5115. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5116. }
  5117. // Do executes the "adexchangebuyer.creatives.listDeals" call.
  5118. // Exactly one of *CreativeDealIds or error will be non-nil. Any non-2xx
  5119. // status code is an error. Response headers are in either
  5120. // *CreativeDealIds.ServerResponse.Header or (if a response was returned
  5121. // at all) in error.(*googleapi.Error).Header. Use
  5122. // googleapi.IsNotModified to check whether the returned error was
  5123. // because http.StatusNotModified was returned.
  5124. func (c *CreativesListDealsCall) Do(opts ...googleapi.CallOption) (*CreativeDealIds, error) {
  5125. gensupport.SetOptions(c.urlParams_, opts...)
  5126. res, err := c.doRequest("json")
  5127. if res != nil && res.StatusCode == http.StatusNotModified {
  5128. if res.Body != nil {
  5129. res.Body.Close()
  5130. }
  5131. return nil, &googleapi.Error{
  5132. Code: res.StatusCode,
  5133. Header: res.Header,
  5134. }
  5135. }
  5136. if err != nil {
  5137. return nil, err
  5138. }
  5139. defer googleapi.CloseBody(res)
  5140. if err := googleapi.CheckResponse(res); err != nil {
  5141. return nil, err
  5142. }
  5143. ret := &CreativeDealIds{
  5144. ServerResponse: googleapi.ServerResponse{
  5145. Header: res.Header,
  5146. HTTPStatusCode: res.StatusCode,
  5147. },
  5148. }
  5149. target := &ret
  5150. if err := gensupport.DecodeResponse(target, res); err != nil {
  5151. return nil, err
  5152. }
  5153. return ret, nil
  5154. // {
  5155. // "description": "Lists the external deal ids associated with the creative.",
  5156. // "httpMethod": "GET",
  5157. // "id": "adexchangebuyer.creatives.listDeals",
  5158. // "parameterOrder": [
  5159. // "accountId",
  5160. // "buyerCreativeId"
  5161. // ],
  5162. // "parameters": {
  5163. // "accountId": {
  5164. // "description": "The id for the account that will serve this creative.",
  5165. // "format": "int32",
  5166. // "location": "path",
  5167. // "required": true,
  5168. // "type": "integer"
  5169. // },
  5170. // "buyerCreativeId": {
  5171. // "description": "The buyer-specific id for this creative.",
  5172. // "location": "path",
  5173. // "required": true,
  5174. // "type": "string"
  5175. // }
  5176. // },
  5177. // "path": "creatives/{accountId}/{buyerCreativeId}/listDeals",
  5178. // "response": {
  5179. // "$ref": "CreativeDealIds"
  5180. // },
  5181. // "scopes": [
  5182. // "https://www.googleapis.com/auth/adexchange.buyer"
  5183. // ]
  5184. // }
  5185. }
  5186. // method id "adexchangebuyer.creatives.removeDeal":
  5187. type CreativesRemoveDealCall struct {
  5188. s *Service
  5189. accountId int64
  5190. buyerCreativeId string
  5191. dealId int64
  5192. urlParams_ gensupport.URLParams
  5193. ctx_ context.Context
  5194. header_ http.Header
  5195. }
  5196. // RemoveDeal: Remove a deal id associated with the creative.
  5197. func (r *CreativesService) RemoveDeal(accountId int64, buyerCreativeId string, dealId int64) *CreativesRemoveDealCall {
  5198. c := &CreativesRemoveDealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5199. c.accountId = accountId
  5200. c.buyerCreativeId = buyerCreativeId
  5201. c.dealId = dealId
  5202. return c
  5203. }
  5204. // Fields allows partial responses to be retrieved. See
  5205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5206. // for more information.
  5207. func (c *CreativesRemoveDealCall) Fields(s ...googleapi.Field) *CreativesRemoveDealCall {
  5208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5209. return c
  5210. }
  5211. // Context sets the context to be used in this call's Do method. Any
  5212. // pending HTTP request will be aborted if the provided context is
  5213. // canceled.
  5214. func (c *CreativesRemoveDealCall) Context(ctx context.Context) *CreativesRemoveDealCall {
  5215. c.ctx_ = ctx
  5216. return c
  5217. }
  5218. // Header returns an http.Header that can be modified by the caller to
  5219. // add HTTP headers to the request.
  5220. func (c *CreativesRemoveDealCall) Header() http.Header {
  5221. if c.header_ == nil {
  5222. c.header_ = make(http.Header)
  5223. }
  5224. return c.header_
  5225. }
  5226. func (c *CreativesRemoveDealCall) doRequest(alt string) (*http.Response, error) {
  5227. reqHeaders := make(http.Header)
  5228. for k, v := range c.header_ {
  5229. reqHeaders[k] = v
  5230. }
  5231. reqHeaders.Set("User-Agent", c.s.userAgent())
  5232. var body io.Reader = nil
  5233. c.urlParams_.Set("alt", alt)
  5234. c.urlParams_.Set("prettyPrint", "false")
  5235. urls := googleapi.ResolveRelative(c.s.BasePath, "creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}")
  5236. urls += "?" + c.urlParams_.Encode()
  5237. req, err := http.NewRequest("POST", urls, body)
  5238. if err != nil {
  5239. return nil, err
  5240. }
  5241. req.Header = reqHeaders
  5242. googleapi.Expand(req.URL, map[string]string{
  5243. "accountId": strconv.FormatInt(c.accountId, 10),
  5244. "buyerCreativeId": c.buyerCreativeId,
  5245. "dealId": strconv.FormatInt(c.dealId, 10),
  5246. })
  5247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5248. }
  5249. // Do executes the "adexchangebuyer.creatives.removeDeal" call.
  5250. func (c *CreativesRemoveDealCall) Do(opts ...googleapi.CallOption) error {
  5251. gensupport.SetOptions(c.urlParams_, opts...)
  5252. res, err := c.doRequest("json")
  5253. if err != nil {
  5254. return err
  5255. }
  5256. defer googleapi.CloseBody(res)
  5257. if err := googleapi.CheckResponse(res); err != nil {
  5258. return err
  5259. }
  5260. return nil
  5261. // {
  5262. // "description": "Remove a deal id associated with the creative.",
  5263. // "httpMethod": "POST",
  5264. // "id": "adexchangebuyer.creatives.removeDeal",
  5265. // "parameterOrder": [
  5266. // "accountId",
  5267. // "buyerCreativeId",
  5268. // "dealId"
  5269. // ],
  5270. // "parameters": {
  5271. // "accountId": {
  5272. // "description": "The id for the account that will serve this creative.",
  5273. // "format": "int32",
  5274. // "location": "path",
  5275. // "required": true,
  5276. // "type": "integer"
  5277. // },
  5278. // "buyerCreativeId": {
  5279. // "description": "The buyer-specific id for this creative.",
  5280. // "location": "path",
  5281. // "required": true,
  5282. // "type": "string"
  5283. // },
  5284. // "dealId": {
  5285. // "description": "The id of the deal id to disassociate with this creative.",
  5286. // "format": "int64",
  5287. // "location": "path",
  5288. // "required": true,
  5289. // "type": "string"
  5290. // }
  5291. // },
  5292. // "path": "creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}",
  5293. // "scopes": [
  5294. // "https://www.googleapis.com/auth/adexchange.buyer"
  5295. // ]
  5296. // }
  5297. }
  5298. // method id "adexchangebuyer.marketplacedeals.delete":
  5299. type MarketplacedealsDeleteCall struct {
  5300. s *Service
  5301. proposalId string
  5302. deleteorderdealsrequest *DeleteOrderDealsRequest
  5303. urlParams_ gensupport.URLParams
  5304. ctx_ context.Context
  5305. header_ http.Header
  5306. }
  5307. // Delete: Delete the specified deals from the proposal
  5308. func (r *MarketplacedealsService) Delete(proposalId string, deleteorderdealsrequest *DeleteOrderDealsRequest) *MarketplacedealsDeleteCall {
  5309. c := &MarketplacedealsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5310. c.proposalId = proposalId
  5311. c.deleteorderdealsrequest = deleteorderdealsrequest
  5312. return c
  5313. }
  5314. // Fields allows partial responses to be retrieved. See
  5315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5316. // for more information.
  5317. func (c *MarketplacedealsDeleteCall) Fields(s ...googleapi.Field) *MarketplacedealsDeleteCall {
  5318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5319. return c
  5320. }
  5321. // Context sets the context to be used in this call's Do method. Any
  5322. // pending HTTP request will be aborted if the provided context is
  5323. // canceled.
  5324. func (c *MarketplacedealsDeleteCall) Context(ctx context.Context) *MarketplacedealsDeleteCall {
  5325. c.ctx_ = ctx
  5326. return c
  5327. }
  5328. // Header returns an http.Header that can be modified by the caller to
  5329. // add HTTP headers to the request.
  5330. func (c *MarketplacedealsDeleteCall) Header() http.Header {
  5331. if c.header_ == nil {
  5332. c.header_ = make(http.Header)
  5333. }
  5334. return c.header_
  5335. }
  5336. func (c *MarketplacedealsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5337. reqHeaders := make(http.Header)
  5338. for k, v := range c.header_ {
  5339. reqHeaders[k] = v
  5340. }
  5341. reqHeaders.Set("User-Agent", c.s.userAgent())
  5342. var body io.Reader = nil
  5343. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deleteorderdealsrequest)
  5344. if err != nil {
  5345. return nil, err
  5346. }
  5347. reqHeaders.Set("Content-Type", "application/json")
  5348. c.urlParams_.Set("alt", alt)
  5349. c.urlParams_.Set("prettyPrint", "false")
  5350. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/delete")
  5351. urls += "?" + c.urlParams_.Encode()
  5352. req, err := http.NewRequest("POST", urls, body)
  5353. if err != nil {
  5354. return nil, err
  5355. }
  5356. req.Header = reqHeaders
  5357. googleapi.Expand(req.URL, map[string]string{
  5358. "proposalId": c.proposalId,
  5359. })
  5360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5361. }
  5362. // Do executes the "adexchangebuyer.marketplacedeals.delete" call.
  5363. // Exactly one of *DeleteOrderDealsResponse or error will be non-nil.
  5364. // Any non-2xx status code is an error. Response headers are in either
  5365. // *DeleteOrderDealsResponse.ServerResponse.Header or (if a response was
  5366. // returned at all) in error.(*googleapi.Error).Header. Use
  5367. // googleapi.IsNotModified to check whether the returned error was
  5368. // because http.StatusNotModified was returned.
  5369. func (c *MarketplacedealsDeleteCall) Do(opts ...googleapi.CallOption) (*DeleteOrderDealsResponse, error) {
  5370. gensupport.SetOptions(c.urlParams_, opts...)
  5371. res, err := c.doRequest("json")
  5372. if res != nil && res.StatusCode == http.StatusNotModified {
  5373. if res.Body != nil {
  5374. res.Body.Close()
  5375. }
  5376. return nil, &googleapi.Error{
  5377. Code: res.StatusCode,
  5378. Header: res.Header,
  5379. }
  5380. }
  5381. if err != nil {
  5382. return nil, err
  5383. }
  5384. defer googleapi.CloseBody(res)
  5385. if err := googleapi.CheckResponse(res); err != nil {
  5386. return nil, err
  5387. }
  5388. ret := &DeleteOrderDealsResponse{
  5389. ServerResponse: googleapi.ServerResponse{
  5390. Header: res.Header,
  5391. HTTPStatusCode: res.StatusCode,
  5392. },
  5393. }
  5394. target := &ret
  5395. if err := gensupport.DecodeResponse(target, res); err != nil {
  5396. return nil, err
  5397. }
  5398. return ret, nil
  5399. // {
  5400. // "description": "Delete the specified deals from the proposal",
  5401. // "httpMethod": "POST",
  5402. // "id": "adexchangebuyer.marketplacedeals.delete",
  5403. // "parameterOrder": [
  5404. // "proposalId"
  5405. // ],
  5406. // "parameters": {
  5407. // "proposalId": {
  5408. // "description": "The proposalId to delete deals from.",
  5409. // "location": "path",
  5410. // "required": true,
  5411. // "type": "string"
  5412. // }
  5413. // },
  5414. // "path": "proposals/{proposalId}/deals/delete",
  5415. // "request": {
  5416. // "$ref": "DeleteOrderDealsRequest"
  5417. // },
  5418. // "response": {
  5419. // "$ref": "DeleteOrderDealsResponse"
  5420. // },
  5421. // "scopes": [
  5422. // "https://www.googleapis.com/auth/adexchange.buyer"
  5423. // ]
  5424. // }
  5425. }
  5426. // method id "adexchangebuyer.marketplacedeals.insert":
  5427. type MarketplacedealsInsertCall struct {
  5428. s *Service
  5429. proposalId string
  5430. addorderdealsrequest *AddOrderDealsRequest
  5431. urlParams_ gensupport.URLParams
  5432. ctx_ context.Context
  5433. header_ http.Header
  5434. }
  5435. // Insert: Add new deals for the specified proposal
  5436. func (r *MarketplacedealsService) Insert(proposalId string, addorderdealsrequest *AddOrderDealsRequest) *MarketplacedealsInsertCall {
  5437. c := &MarketplacedealsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5438. c.proposalId = proposalId
  5439. c.addorderdealsrequest = addorderdealsrequest
  5440. return c
  5441. }
  5442. // Fields allows partial responses to be retrieved. See
  5443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5444. // for more information.
  5445. func (c *MarketplacedealsInsertCall) Fields(s ...googleapi.Field) *MarketplacedealsInsertCall {
  5446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5447. return c
  5448. }
  5449. // Context sets the context to be used in this call's Do method. Any
  5450. // pending HTTP request will be aborted if the provided context is
  5451. // canceled.
  5452. func (c *MarketplacedealsInsertCall) Context(ctx context.Context) *MarketplacedealsInsertCall {
  5453. c.ctx_ = ctx
  5454. return c
  5455. }
  5456. // Header returns an http.Header that can be modified by the caller to
  5457. // add HTTP headers to the request.
  5458. func (c *MarketplacedealsInsertCall) Header() http.Header {
  5459. if c.header_ == nil {
  5460. c.header_ = make(http.Header)
  5461. }
  5462. return c.header_
  5463. }
  5464. func (c *MarketplacedealsInsertCall) doRequest(alt string) (*http.Response, error) {
  5465. reqHeaders := make(http.Header)
  5466. for k, v := range c.header_ {
  5467. reqHeaders[k] = v
  5468. }
  5469. reqHeaders.Set("User-Agent", c.s.userAgent())
  5470. var body io.Reader = nil
  5471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addorderdealsrequest)
  5472. if err != nil {
  5473. return nil, err
  5474. }
  5475. reqHeaders.Set("Content-Type", "application/json")
  5476. c.urlParams_.Set("alt", alt)
  5477. c.urlParams_.Set("prettyPrint", "false")
  5478. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/insert")
  5479. urls += "?" + c.urlParams_.Encode()
  5480. req, err := http.NewRequest("POST", urls, body)
  5481. if err != nil {
  5482. return nil, err
  5483. }
  5484. req.Header = reqHeaders
  5485. googleapi.Expand(req.URL, map[string]string{
  5486. "proposalId": c.proposalId,
  5487. })
  5488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5489. }
  5490. // Do executes the "adexchangebuyer.marketplacedeals.insert" call.
  5491. // Exactly one of *AddOrderDealsResponse or error will be non-nil. Any
  5492. // non-2xx status code is an error. Response headers are in either
  5493. // *AddOrderDealsResponse.ServerResponse.Header or (if a response was
  5494. // returned at all) in error.(*googleapi.Error).Header. Use
  5495. // googleapi.IsNotModified to check whether the returned error was
  5496. // because http.StatusNotModified was returned.
  5497. func (c *MarketplacedealsInsertCall) Do(opts ...googleapi.CallOption) (*AddOrderDealsResponse, error) {
  5498. gensupport.SetOptions(c.urlParams_, opts...)
  5499. res, err := c.doRequest("json")
  5500. if res != nil && res.StatusCode == http.StatusNotModified {
  5501. if res.Body != nil {
  5502. res.Body.Close()
  5503. }
  5504. return nil, &googleapi.Error{
  5505. Code: res.StatusCode,
  5506. Header: res.Header,
  5507. }
  5508. }
  5509. if err != nil {
  5510. return nil, err
  5511. }
  5512. defer googleapi.CloseBody(res)
  5513. if err := googleapi.CheckResponse(res); err != nil {
  5514. return nil, err
  5515. }
  5516. ret := &AddOrderDealsResponse{
  5517. ServerResponse: googleapi.ServerResponse{
  5518. Header: res.Header,
  5519. HTTPStatusCode: res.StatusCode,
  5520. },
  5521. }
  5522. target := &ret
  5523. if err := gensupport.DecodeResponse(target, res); err != nil {
  5524. return nil, err
  5525. }
  5526. return ret, nil
  5527. // {
  5528. // "description": "Add new deals for the specified proposal",
  5529. // "httpMethod": "POST",
  5530. // "id": "adexchangebuyer.marketplacedeals.insert",
  5531. // "parameterOrder": [
  5532. // "proposalId"
  5533. // ],
  5534. // "parameters": {
  5535. // "proposalId": {
  5536. // "description": "proposalId for which deals need to be added.",
  5537. // "location": "path",
  5538. // "required": true,
  5539. // "type": "string"
  5540. // }
  5541. // },
  5542. // "path": "proposals/{proposalId}/deals/insert",
  5543. // "request": {
  5544. // "$ref": "AddOrderDealsRequest"
  5545. // },
  5546. // "response": {
  5547. // "$ref": "AddOrderDealsResponse"
  5548. // },
  5549. // "scopes": [
  5550. // "https://www.googleapis.com/auth/adexchange.buyer"
  5551. // ]
  5552. // }
  5553. }
  5554. // method id "adexchangebuyer.marketplacedeals.list":
  5555. type MarketplacedealsListCall struct {
  5556. s *Service
  5557. proposalId string
  5558. urlParams_ gensupport.URLParams
  5559. ifNoneMatch_ string
  5560. ctx_ context.Context
  5561. header_ http.Header
  5562. }
  5563. // List: List all the deals for a given proposal
  5564. func (r *MarketplacedealsService) List(proposalId string) *MarketplacedealsListCall {
  5565. c := &MarketplacedealsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5566. c.proposalId = proposalId
  5567. return c
  5568. }
  5569. // PqlQuery sets the optional parameter "pqlQuery": Query string to
  5570. // retrieve specific deals.
  5571. func (c *MarketplacedealsListCall) PqlQuery(pqlQuery string) *MarketplacedealsListCall {
  5572. c.urlParams_.Set("pqlQuery", pqlQuery)
  5573. return c
  5574. }
  5575. // Fields allows partial responses to be retrieved. See
  5576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5577. // for more information.
  5578. func (c *MarketplacedealsListCall) Fields(s ...googleapi.Field) *MarketplacedealsListCall {
  5579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5580. return c
  5581. }
  5582. // IfNoneMatch sets the optional parameter which makes the operation
  5583. // fail if the object's ETag matches the given value. This is useful for
  5584. // getting updates only after the object has changed since the last
  5585. // request. Use googleapi.IsNotModified to check whether the response
  5586. // error from Do is the result of In-None-Match.
  5587. func (c *MarketplacedealsListCall) IfNoneMatch(entityTag string) *MarketplacedealsListCall {
  5588. c.ifNoneMatch_ = entityTag
  5589. return c
  5590. }
  5591. // Context sets the context to be used in this call's Do method. Any
  5592. // pending HTTP request will be aborted if the provided context is
  5593. // canceled.
  5594. func (c *MarketplacedealsListCall) Context(ctx context.Context) *MarketplacedealsListCall {
  5595. c.ctx_ = ctx
  5596. return c
  5597. }
  5598. // Header returns an http.Header that can be modified by the caller to
  5599. // add HTTP headers to the request.
  5600. func (c *MarketplacedealsListCall) Header() http.Header {
  5601. if c.header_ == nil {
  5602. c.header_ = make(http.Header)
  5603. }
  5604. return c.header_
  5605. }
  5606. func (c *MarketplacedealsListCall) doRequest(alt string) (*http.Response, error) {
  5607. reqHeaders := make(http.Header)
  5608. for k, v := range c.header_ {
  5609. reqHeaders[k] = v
  5610. }
  5611. reqHeaders.Set("User-Agent", c.s.userAgent())
  5612. if c.ifNoneMatch_ != "" {
  5613. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5614. }
  5615. var body io.Reader = nil
  5616. c.urlParams_.Set("alt", alt)
  5617. c.urlParams_.Set("prettyPrint", "false")
  5618. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals")
  5619. urls += "?" + c.urlParams_.Encode()
  5620. req, err := http.NewRequest("GET", urls, body)
  5621. if err != nil {
  5622. return nil, err
  5623. }
  5624. req.Header = reqHeaders
  5625. googleapi.Expand(req.URL, map[string]string{
  5626. "proposalId": c.proposalId,
  5627. })
  5628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5629. }
  5630. // Do executes the "adexchangebuyer.marketplacedeals.list" call.
  5631. // Exactly one of *GetOrderDealsResponse or error will be non-nil. Any
  5632. // non-2xx status code is an error. Response headers are in either
  5633. // *GetOrderDealsResponse.ServerResponse.Header or (if a response was
  5634. // returned at all) in error.(*googleapi.Error).Header. Use
  5635. // googleapi.IsNotModified to check whether the returned error was
  5636. // because http.StatusNotModified was returned.
  5637. func (c *MarketplacedealsListCall) Do(opts ...googleapi.CallOption) (*GetOrderDealsResponse, error) {
  5638. gensupport.SetOptions(c.urlParams_, opts...)
  5639. res, err := c.doRequest("json")
  5640. if res != nil && res.StatusCode == http.StatusNotModified {
  5641. if res.Body != nil {
  5642. res.Body.Close()
  5643. }
  5644. return nil, &googleapi.Error{
  5645. Code: res.StatusCode,
  5646. Header: res.Header,
  5647. }
  5648. }
  5649. if err != nil {
  5650. return nil, err
  5651. }
  5652. defer googleapi.CloseBody(res)
  5653. if err := googleapi.CheckResponse(res); err != nil {
  5654. return nil, err
  5655. }
  5656. ret := &GetOrderDealsResponse{
  5657. ServerResponse: googleapi.ServerResponse{
  5658. Header: res.Header,
  5659. HTTPStatusCode: res.StatusCode,
  5660. },
  5661. }
  5662. target := &ret
  5663. if err := gensupport.DecodeResponse(target, res); err != nil {
  5664. return nil, err
  5665. }
  5666. return ret, nil
  5667. // {
  5668. // "description": "List all the deals for a given proposal",
  5669. // "httpMethod": "GET",
  5670. // "id": "adexchangebuyer.marketplacedeals.list",
  5671. // "parameterOrder": [
  5672. // "proposalId"
  5673. // ],
  5674. // "parameters": {
  5675. // "pqlQuery": {
  5676. // "description": "Query string to retrieve specific deals.",
  5677. // "location": "query",
  5678. // "type": "string"
  5679. // },
  5680. // "proposalId": {
  5681. // "description": "The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL.",
  5682. // "location": "path",
  5683. // "required": true,
  5684. // "type": "string"
  5685. // }
  5686. // },
  5687. // "path": "proposals/{proposalId}/deals",
  5688. // "response": {
  5689. // "$ref": "GetOrderDealsResponse"
  5690. // },
  5691. // "scopes": [
  5692. // "https://www.googleapis.com/auth/adexchange.buyer"
  5693. // ]
  5694. // }
  5695. }
  5696. // method id "adexchangebuyer.marketplacedeals.update":
  5697. type MarketplacedealsUpdateCall struct {
  5698. s *Service
  5699. proposalId string
  5700. editallorderdealsrequest *EditAllOrderDealsRequest
  5701. urlParams_ gensupport.URLParams
  5702. ctx_ context.Context
  5703. header_ http.Header
  5704. }
  5705. // Update: Replaces all the deals in the proposal with the passed in
  5706. // deals
  5707. func (r *MarketplacedealsService) Update(proposalId string, editallorderdealsrequest *EditAllOrderDealsRequest) *MarketplacedealsUpdateCall {
  5708. c := &MarketplacedealsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5709. c.proposalId = proposalId
  5710. c.editallorderdealsrequest = editallorderdealsrequest
  5711. return c
  5712. }
  5713. // Fields allows partial responses to be retrieved. See
  5714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5715. // for more information.
  5716. func (c *MarketplacedealsUpdateCall) Fields(s ...googleapi.Field) *MarketplacedealsUpdateCall {
  5717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5718. return c
  5719. }
  5720. // Context sets the context to be used in this call's Do method. Any
  5721. // pending HTTP request will be aborted if the provided context is
  5722. // canceled.
  5723. func (c *MarketplacedealsUpdateCall) Context(ctx context.Context) *MarketplacedealsUpdateCall {
  5724. c.ctx_ = ctx
  5725. return c
  5726. }
  5727. // Header returns an http.Header that can be modified by the caller to
  5728. // add HTTP headers to the request.
  5729. func (c *MarketplacedealsUpdateCall) Header() http.Header {
  5730. if c.header_ == nil {
  5731. c.header_ = make(http.Header)
  5732. }
  5733. return c.header_
  5734. }
  5735. func (c *MarketplacedealsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5736. reqHeaders := make(http.Header)
  5737. for k, v := range c.header_ {
  5738. reqHeaders[k] = v
  5739. }
  5740. reqHeaders.Set("User-Agent", c.s.userAgent())
  5741. var body io.Reader = nil
  5742. body, err := googleapi.WithoutDataWrapper.JSONReader(c.editallorderdealsrequest)
  5743. if err != nil {
  5744. return nil, err
  5745. }
  5746. reqHeaders.Set("Content-Type", "application/json")
  5747. c.urlParams_.Set("alt", alt)
  5748. c.urlParams_.Set("prettyPrint", "false")
  5749. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/deals/update")
  5750. urls += "?" + c.urlParams_.Encode()
  5751. req, err := http.NewRequest("POST", urls, body)
  5752. if err != nil {
  5753. return nil, err
  5754. }
  5755. req.Header = reqHeaders
  5756. googleapi.Expand(req.URL, map[string]string{
  5757. "proposalId": c.proposalId,
  5758. })
  5759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5760. }
  5761. // Do executes the "adexchangebuyer.marketplacedeals.update" call.
  5762. // Exactly one of *EditAllOrderDealsResponse or error will be non-nil.
  5763. // Any non-2xx status code is an error. Response headers are in either
  5764. // *EditAllOrderDealsResponse.ServerResponse.Header or (if a response
  5765. // was returned at all) in error.(*googleapi.Error).Header. Use
  5766. // googleapi.IsNotModified to check whether the returned error was
  5767. // because http.StatusNotModified was returned.
  5768. func (c *MarketplacedealsUpdateCall) Do(opts ...googleapi.CallOption) (*EditAllOrderDealsResponse, error) {
  5769. gensupport.SetOptions(c.urlParams_, opts...)
  5770. res, err := c.doRequest("json")
  5771. if res != nil && res.StatusCode == http.StatusNotModified {
  5772. if res.Body != nil {
  5773. res.Body.Close()
  5774. }
  5775. return nil, &googleapi.Error{
  5776. Code: res.StatusCode,
  5777. Header: res.Header,
  5778. }
  5779. }
  5780. if err != nil {
  5781. return nil, err
  5782. }
  5783. defer googleapi.CloseBody(res)
  5784. if err := googleapi.CheckResponse(res); err != nil {
  5785. return nil, err
  5786. }
  5787. ret := &EditAllOrderDealsResponse{
  5788. ServerResponse: googleapi.ServerResponse{
  5789. Header: res.Header,
  5790. HTTPStatusCode: res.StatusCode,
  5791. },
  5792. }
  5793. target := &ret
  5794. if err := gensupport.DecodeResponse(target, res); err != nil {
  5795. return nil, err
  5796. }
  5797. return ret, nil
  5798. // {
  5799. // "description": "Replaces all the deals in the proposal with the passed in deals",
  5800. // "httpMethod": "POST",
  5801. // "id": "adexchangebuyer.marketplacedeals.update",
  5802. // "parameterOrder": [
  5803. // "proposalId"
  5804. // ],
  5805. // "parameters": {
  5806. // "proposalId": {
  5807. // "description": "The proposalId to edit deals on.",
  5808. // "location": "path",
  5809. // "required": true,
  5810. // "type": "string"
  5811. // }
  5812. // },
  5813. // "path": "proposals/{proposalId}/deals/update",
  5814. // "request": {
  5815. // "$ref": "EditAllOrderDealsRequest"
  5816. // },
  5817. // "response": {
  5818. // "$ref": "EditAllOrderDealsResponse"
  5819. // },
  5820. // "scopes": [
  5821. // "https://www.googleapis.com/auth/adexchange.buyer"
  5822. // ]
  5823. // }
  5824. }
  5825. // method id "adexchangebuyer.marketplacenotes.insert":
  5826. type MarketplacenotesInsertCall struct {
  5827. s *Service
  5828. proposalId string
  5829. addordernotesrequest *AddOrderNotesRequest
  5830. urlParams_ gensupport.URLParams
  5831. ctx_ context.Context
  5832. header_ http.Header
  5833. }
  5834. // Insert: Add notes to the proposal
  5835. func (r *MarketplacenotesService) Insert(proposalId string, addordernotesrequest *AddOrderNotesRequest) *MarketplacenotesInsertCall {
  5836. c := &MarketplacenotesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5837. c.proposalId = proposalId
  5838. c.addordernotesrequest = addordernotesrequest
  5839. return c
  5840. }
  5841. // Fields allows partial responses to be retrieved. See
  5842. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5843. // for more information.
  5844. func (c *MarketplacenotesInsertCall) Fields(s ...googleapi.Field) *MarketplacenotesInsertCall {
  5845. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5846. return c
  5847. }
  5848. // Context sets the context to be used in this call's Do method. Any
  5849. // pending HTTP request will be aborted if the provided context is
  5850. // canceled.
  5851. func (c *MarketplacenotesInsertCall) Context(ctx context.Context) *MarketplacenotesInsertCall {
  5852. c.ctx_ = ctx
  5853. return c
  5854. }
  5855. // Header returns an http.Header that can be modified by the caller to
  5856. // add HTTP headers to the request.
  5857. func (c *MarketplacenotesInsertCall) Header() http.Header {
  5858. if c.header_ == nil {
  5859. c.header_ = make(http.Header)
  5860. }
  5861. return c.header_
  5862. }
  5863. func (c *MarketplacenotesInsertCall) doRequest(alt string) (*http.Response, error) {
  5864. reqHeaders := make(http.Header)
  5865. for k, v := range c.header_ {
  5866. reqHeaders[k] = v
  5867. }
  5868. reqHeaders.Set("User-Agent", c.s.userAgent())
  5869. var body io.Reader = nil
  5870. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addordernotesrequest)
  5871. if err != nil {
  5872. return nil, err
  5873. }
  5874. reqHeaders.Set("Content-Type", "application/json")
  5875. c.urlParams_.Set("alt", alt)
  5876. c.urlParams_.Set("prettyPrint", "false")
  5877. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/notes/insert")
  5878. urls += "?" + c.urlParams_.Encode()
  5879. req, err := http.NewRequest("POST", urls, body)
  5880. if err != nil {
  5881. return nil, err
  5882. }
  5883. req.Header = reqHeaders
  5884. googleapi.Expand(req.URL, map[string]string{
  5885. "proposalId": c.proposalId,
  5886. })
  5887. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5888. }
  5889. // Do executes the "adexchangebuyer.marketplacenotes.insert" call.
  5890. // Exactly one of *AddOrderNotesResponse or error will be non-nil. Any
  5891. // non-2xx status code is an error. Response headers are in either
  5892. // *AddOrderNotesResponse.ServerResponse.Header or (if a response was
  5893. // returned at all) in error.(*googleapi.Error).Header. Use
  5894. // googleapi.IsNotModified to check whether the returned error was
  5895. // because http.StatusNotModified was returned.
  5896. func (c *MarketplacenotesInsertCall) Do(opts ...googleapi.CallOption) (*AddOrderNotesResponse, error) {
  5897. gensupport.SetOptions(c.urlParams_, opts...)
  5898. res, err := c.doRequest("json")
  5899. if res != nil && res.StatusCode == http.StatusNotModified {
  5900. if res.Body != nil {
  5901. res.Body.Close()
  5902. }
  5903. return nil, &googleapi.Error{
  5904. Code: res.StatusCode,
  5905. Header: res.Header,
  5906. }
  5907. }
  5908. if err != nil {
  5909. return nil, err
  5910. }
  5911. defer googleapi.CloseBody(res)
  5912. if err := googleapi.CheckResponse(res); err != nil {
  5913. return nil, err
  5914. }
  5915. ret := &AddOrderNotesResponse{
  5916. ServerResponse: googleapi.ServerResponse{
  5917. Header: res.Header,
  5918. HTTPStatusCode: res.StatusCode,
  5919. },
  5920. }
  5921. target := &ret
  5922. if err := gensupport.DecodeResponse(target, res); err != nil {
  5923. return nil, err
  5924. }
  5925. return ret, nil
  5926. // {
  5927. // "description": "Add notes to the proposal",
  5928. // "httpMethod": "POST",
  5929. // "id": "adexchangebuyer.marketplacenotes.insert",
  5930. // "parameterOrder": [
  5931. // "proposalId"
  5932. // ],
  5933. // "parameters": {
  5934. // "proposalId": {
  5935. // "description": "The proposalId to add notes for.",
  5936. // "location": "path",
  5937. // "required": true,
  5938. // "type": "string"
  5939. // }
  5940. // },
  5941. // "path": "proposals/{proposalId}/notes/insert",
  5942. // "request": {
  5943. // "$ref": "AddOrderNotesRequest"
  5944. // },
  5945. // "response": {
  5946. // "$ref": "AddOrderNotesResponse"
  5947. // },
  5948. // "scopes": [
  5949. // "https://www.googleapis.com/auth/adexchange.buyer"
  5950. // ]
  5951. // }
  5952. }
  5953. // method id "adexchangebuyer.marketplacenotes.list":
  5954. type MarketplacenotesListCall struct {
  5955. s *Service
  5956. proposalId string
  5957. urlParams_ gensupport.URLParams
  5958. ifNoneMatch_ string
  5959. ctx_ context.Context
  5960. header_ http.Header
  5961. }
  5962. // List: Get all the notes associated with a proposal
  5963. func (r *MarketplacenotesService) List(proposalId string) *MarketplacenotesListCall {
  5964. c := &MarketplacenotesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5965. c.proposalId = proposalId
  5966. return c
  5967. }
  5968. // PqlQuery sets the optional parameter "pqlQuery": Query string to
  5969. // retrieve specific notes. To search the text contents of notes, please
  5970. // use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE
  5971. // "%bar%"
  5972. func (c *MarketplacenotesListCall) PqlQuery(pqlQuery string) *MarketplacenotesListCall {
  5973. c.urlParams_.Set("pqlQuery", pqlQuery)
  5974. return c
  5975. }
  5976. // Fields allows partial responses to be retrieved. See
  5977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5978. // for more information.
  5979. func (c *MarketplacenotesListCall) Fields(s ...googleapi.Field) *MarketplacenotesListCall {
  5980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5981. return c
  5982. }
  5983. // IfNoneMatch sets the optional parameter which makes the operation
  5984. // fail if the object's ETag matches the given value. This is useful for
  5985. // getting updates only after the object has changed since the last
  5986. // request. Use googleapi.IsNotModified to check whether the response
  5987. // error from Do is the result of In-None-Match.
  5988. func (c *MarketplacenotesListCall) IfNoneMatch(entityTag string) *MarketplacenotesListCall {
  5989. c.ifNoneMatch_ = entityTag
  5990. return c
  5991. }
  5992. // Context sets the context to be used in this call's Do method. Any
  5993. // pending HTTP request will be aborted if the provided context is
  5994. // canceled.
  5995. func (c *MarketplacenotesListCall) Context(ctx context.Context) *MarketplacenotesListCall {
  5996. c.ctx_ = ctx
  5997. return c
  5998. }
  5999. // Header returns an http.Header that can be modified by the caller to
  6000. // add HTTP headers to the request.
  6001. func (c *MarketplacenotesListCall) Header() http.Header {
  6002. if c.header_ == nil {
  6003. c.header_ = make(http.Header)
  6004. }
  6005. return c.header_
  6006. }
  6007. func (c *MarketplacenotesListCall) doRequest(alt string) (*http.Response, error) {
  6008. reqHeaders := make(http.Header)
  6009. for k, v := range c.header_ {
  6010. reqHeaders[k] = v
  6011. }
  6012. reqHeaders.Set("User-Agent", c.s.userAgent())
  6013. if c.ifNoneMatch_ != "" {
  6014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6015. }
  6016. var body io.Reader = nil
  6017. c.urlParams_.Set("alt", alt)
  6018. c.urlParams_.Set("prettyPrint", "false")
  6019. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/notes")
  6020. urls += "?" + c.urlParams_.Encode()
  6021. req, err := http.NewRequest("GET", urls, body)
  6022. if err != nil {
  6023. return nil, err
  6024. }
  6025. req.Header = reqHeaders
  6026. googleapi.Expand(req.URL, map[string]string{
  6027. "proposalId": c.proposalId,
  6028. })
  6029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6030. }
  6031. // Do executes the "adexchangebuyer.marketplacenotes.list" call.
  6032. // Exactly one of *GetOrderNotesResponse or error will be non-nil. Any
  6033. // non-2xx status code is an error. Response headers are in either
  6034. // *GetOrderNotesResponse.ServerResponse.Header or (if a response was
  6035. // returned at all) in error.(*googleapi.Error).Header. Use
  6036. // googleapi.IsNotModified to check whether the returned error was
  6037. // because http.StatusNotModified was returned.
  6038. func (c *MarketplacenotesListCall) Do(opts ...googleapi.CallOption) (*GetOrderNotesResponse, error) {
  6039. gensupport.SetOptions(c.urlParams_, opts...)
  6040. res, err := c.doRequest("json")
  6041. if res != nil && res.StatusCode == http.StatusNotModified {
  6042. if res.Body != nil {
  6043. res.Body.Close()
  6044. }
  6045. return nil, &googleapi.Error{
  6046. Code: res.StatusCode,
  6047. Header: res.Header,
  6048. }
  6049. }
  6050. if err != nil {
  6051. return nil, err
  6052. }
  6053. defer googleapi.CloseBody(res)
  6054. if err := googleapi.CheckResponse(res); err != nil {
  6055. return nil, err
  6056. }
  6057. ret := &GetOrderNotesResponse{
  6058. ServerResponse: googleapi.ServerResponse{
  6059. Header: res.Header,
  6060. HTTPStatusCode: res.StatusCode,
  6061. },
  6062. }
  6063. target := &ret
  6064. if err := gensupport.DecodeResponse(target, res); err != nil {
  6065. return nil, err
  6066. }
  6067. return ret, nil
  6068. // {
  6069. // "description": "Get all the notes associated with a proposal",
  6070. // "httpMethod": "GET",
  6071. // "id": "adexchangebuyer.marketplacenotes.list",
  6072. // "parameterOrder": [
  6073. // "proposalId"
  6074. // ],
  6075. // "parameters": {
  6076. // "pqlQuery": {
  6077. // "description": "Query string to retrieve specific notes. To search the text contents of notes, please use syntax like \"WHERE note.note = \"foo\" or \"WHERE note.note LIKE \"%bar%\"",
  6078. // "location": "query",
  6079. // "type": "string"
  6080. // },
  6081. // "proposalId": {
  6082. // "description": "The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL.",
  6083. // "location": "path",
  6084. // "required": true,
  6085. // "type": "string"
  6086. // }
  6087. // },
  6088. // "path": "proposals/{proposalId}/notes",
  6089. // "response": {
  6090. // "$ref": "GetOrderNotesResponse"
  6091. // },
  6092. // "scopes": [
  6093. // "https://www.googleapis.com/auth/adexchange.buyer"
  6094. // ]
  6095. // }
  6096. }
  6097. // method id "adexchangebuyer.marketplaceprivateauction.updateproposal":
  6098. type MarketplaceprivateauctionUpdateproposalCall struct {
  6099. s *Service
  6100. privateAuctionId string
  6101. updateprivateauctionproposalrequest *UpdatePrivateAuctionProposalRequest
  6102. urlParams_ gensupport.URLParams
  6103. ctx_ context.Context
  6104. header_ http.Header
  6105. }
  6106. // Updateproposal: Update a given private auction proposal
  6107. func (r *MarketplaceprivateauctionService) Updateproposal(privateAuctionId string, updateprivateauctionproposalrequest *UpdatePrivateAuctionProposalRequest) *MarketplaceprivateauctionUpdateproposalCall {
  6108. c := &MarketplaceprivateauctionUpdateproposalCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6109. c.privateAuctionId = privateAuctionId
  6110. c.updateprivateauctionproposalrequest = updateprivateauctionproposalrequest
  6111. return c
  6112. }
  6113. // Fields allows partial responses to be retrieved. See
  6114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6115. // for more information.
  6116. func (c *MarketplaceprivateauctionUpdateproposalCall) Fields(s ...googleapi.Field) *MarketplaceprivateauctionUpdateproposalCall {
  6117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6118. return c
  6119. }
  6120. // Context sets the context to be used in this call's Do method. Any
  6121. // pending HTTP request will be aborted if the provided context is
  6122. // canceled.
  6123. func (c *MarketplaceprivateauctionUpdateproposalCall) Context(ctx context.Context) *MarketplaceprivateauctionUpdateproposalCall {
  6124. c.ctx_ = ctx
  6125. return c
  6126. }
  6127. // Header returns an http.Header that can be modified by the caller to
  6128. // add HTTP headers to the request.
  6129. func (c *MarketplaceprivateauctionUpdateproposalCall) Header() http.Header {
  6130. if c.header_ == nil {
  6131. c.header_ = make(http.Header)
  6132. }
  6133. return c.header_
  6134. }
  6135. func (c *MarketplaceprivateauctionUpdateproposalCall) doRequest(alt string) (*http.Response, error) {
  6136. reqHeaders := make(http.Header)
  6137. for k, v := range c.header_ {
  6138. reqHeaders[k] = v
  6139. }
  6140. reqHeaders.Set("User-Agent", c.s.userAgent())
  6141. var body io.Reader = nil
  6142. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateprivateauctionproposalrequest)
  6143. if err != nil {
  6144. return nil, err
  6145. }
  6146. reqHeaders.Set("Content-Type", "application/json")
  6147. c.urlParams_.Set("alt", alt)
  6148. c.urlParams_.Set("prettyPrint", "false")
  6149. urls := googleapi.ResolveRelative(c.s.BasePath, "privateauction/{privateAuctionId}/updateproposal")
  6150. urls += "?" + c.urlParams_.Encode()
  6151. req, err := http.NewRequest("POST", urls, body)
  6152. if err != nil {
  6153. return nil, err
  6154. }
  6155. req.Header = reqHeaders
  6156. googleapi.Expand(req.URL, map[string]string{
  6157. "privateAuctionId": c.privateAuctionId,
  6158. })
  6159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6160. }
  6161. // Do executes the "adexchangebuyer.marketplaceprivateauction.updateproposal" call.
  6162. func (c *MarketplaceprivateauctionUpdateproposalCall) Do(opts ...googleapi.CallOption) error {
  6163. gensupport.SetOptions(c.urlParams_, opts...)
  6164. res, err := c.doRequest("json")
  6165. if err != nil {
  6166. return err
  6167. }
  6168. defer googleapi.CloseBody(res)
  6169. if err := googleapi.CheckResponse(res); err != nil {
  6170. return err
  6171. }
  6172. return nil
  6173. // {
  6174. // "description": "Update a given private auction proposal",
  6175. // "httpMethod": "POST",
  6176. // "id": "adexchangebuyer.marketplaceprivateauction.updateproposal",
  6177. // "parameterOrder": [
  6178. // "privateAuctionId"
  6179. // ],
  6180. // "parameters": {
  6181. // "privateAuctionId": {
  6182. // "description": "The private auction id to be updated.",
  6183. // "location": "path",
  6184. // "required": true,
  6185. // "type": "string"
  6186. // }
  6187. // },
  6188. // "path": "privateauction/{privateAuctionId}/updateproposal",
  6189. // "request": {
  6190. // "$ref": "UpdatePrivateAuctionProposalRequest"
  6191. // },
  6192. // "scopes": [
  6193. // "https://www.googleapis.com/auth/adexchange.buyer"
  6194. // ]
  6195. // }
  6196. }
  6197. // method id "adexchangebuyer.performanceReport.list":
  6198. type PerformanceReportListCall struct {
  6199. s *Service
  6200. urlParams_ gensupport.URLParams
  6201. ifNoneMatch_ string
  6202. ctx_ context.Context
  6203. header_ http.Header
  6204. }
  6205. // List: Retrieves the authenticated user's list of performance metrics.
  6206. func (r *PerformanceReportService) List(accountId int64, endDateTime string, startDateTime string) *PerformanceReportListCall {
  6207. c := &PerformanceReportListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6208. c.urlParams_.Set("accountId", fmt.Sprint(accountId))
  6209. c.urlParams_.Set("endDateTime", endDateTime)
  6210. c.urlParams_.Set("startDateTime", startDateTime)
  6211. return c
  6212. }
  6213. // MaxResults sets the optional parameter "maxResults": Maximum number
  6214. // of entries returned on one result page. If not set, the default is
  6215. // 100.
  6216. func (c *PerformanceReportListCall) MaxResults(maxResults int64) *PerformanceReportListCall {
  6217. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6218. return c
  6219. }
  6220. // PageToken sets the optional parameter "pageToken": A continuation
  6221. // token, used to page through performance reports. To retrieve the next
  6222. // page, set this parameter to the value of "nextPageToken" from the
  6223. // previous response.
  6224. func (c *PerformanceReportListCall) PageToken(pageToken string) *PerformanceReportListCall {
  6225. c.urlParams_.Set("pageToken", pageToken)
  6226. return c
  6227. }
  6228. // Fields allows partial responses to be retrieved. See
  6229. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6230. // for more information.
  6231. func (c *PerformanceReportListCall) Fields(s ...googleapi.Field) *PerformanceReportListCall {
  6232. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6233. return c
  6234. }
  6235. // IfNoneMatch sets the optional parameter which makes the operation
  6236. // fail if the object's ETag matches the given value. This is useful for
  6237. // getting updates only after the object has changed since the last
  6238. // request. Use googleapi.IsNotModified to check whether the response
  6239. // error from Do is the result of In-None-Match.
  6240. func (c *PerformanceReportListCall) IfNoneMatch(entityTag string) *PerformanceReportListCall {
  6241. c.ifNoneMatch_ = entityTag
  6242. return c
  6243. }
  6244. // Context sets the context to be used in this call's Do method. Any
  6245. // pending HTTP request will be aborted if the provided context is
  6246. // canceled.
  6247. func (c *PerformanceReportListCall) Context(ctx context.Context) *PerformanceReportListCall {
  6248. c.ctx_ = ctx
  6249. return c
  6250. }
  6251. // Header returns an http.Header that can be modified by the caller to
  6252. // add HTTP headers to the request.
  6253. func (c *PerformanceReportListCall) Header() http.Header {
  6254. if c.header_ == nil {
  6255. c.header_ = make(http.Header)
  6256. }
  6257. return c.header_
  6258. }
  6259. func (c *PerformanceReportListCall) doRequest(alt string) (*http.Response, error) {
  6260. reqHeaders := make(http.Header)
  6261. for k, v := range c.header_ {
  6262. reqHeaders[k] = v
  6263. }
  6264. reqHeaders.Set("User-Agent", c.s.userAgent())
  6265. if c.ifNoneMatch_ != "" {
  6266. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6267. }
  6268. var body io.Reader = nil
  6269. c.urlParams_.Set("alt", alt)
  6270. c.urlParams_.Set("prettyPrint", "false")
  6271. urls := googleapi.ResolveRelative(c.s.BasePath, "performancereport")
  6272. urls += "?" + c.urlParams_.Encode()
  6273. req, err := http.NewRequest("GET", urls, body)
  6274. if err != nil {
  6275. return nil, err
  6276. }
  6277. req.Header = reqHeaders
  6278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6279. }
  6280. // Do executes the "adexchangebuyer.performanceReport.list" call.
  6281. // Exactly one of *PerformanceReportList or error will be non-nil. Any
  6282. // non-2xx status code is an error. Response headers are in either
  6283. // *PerformanceReportList.ServerResponse.Header or (if a response was
  6284. // returned at all) in error.(*googleapi.Error).Header. Use
  6285. // googleapi.IsNotModified to check whether the returned error was
  6286. // because http.StatusNotModified was returned.
  6287. func (c *PerformanceReportListCall) Do(opts ...googleapi.CallOption) (*PerformanceReportList, error) {
  6288. gensupport.SetOptions(c.urlParams_, opts...)
  6289. res, err := c.doRequest("json")
  6290. if res != nil && res.StatusCode == http.StatusNotModified {
  6291. if res.Body != nil {
  6292. res.Body.Close()
  6293. }
  6294. return nil, &googleapi.Error{
  6295. Code: res.StatusCode,
  6296. Header: res.Header,
  6297. }
  6298. }
  6299. if err != nil {
  6300. return nil, err
  6301. }
  6302. defer googleapi.CloseBody(res)
  6303. if err := googleapi.CheckResponse(res); err != nil {
  6304. return nil, err
  6305. }
  6306. ret := &PerformanceReportList{
  6307. ServerResponse: googleapi.ServerResponse{
  6308. Header: res.Header,
  6309. HTTPStatusCode: res.StatusCode,
  6310. },
  6311. }
  6312. target := &ret
  6313. if err := gensupport.DecodeResponse(target, res); err != nil {
  6314. return nil, err
  6315. }
  6316. return ret, nil
  6317. // {
  6318. // "description": "Retrieves the authenticated user's list of performance metrics.",
  6319. // "httpMethod": "GET",
  6320. // "id": "adexchangebuyer.performanceReport.list",
  6321. // "parameterOrder": [
  6322. // "accountId",
  6323. // "endDateTime",
  6324. // "startDateTime"
  6325. // ],
  6326. // "parameters": {
  6327. // "accountId": {
  6328. // "description": "The account id to get the reports.",
  6329. // "format": "int64",
  6330. // "location": "query",
  6331. // "required": true,
  6332. // "type": "string"
  6333. // },
  6334. // "endDateTime": {
  6335. // "description": "The end time of the report in ISO 8601 timestamp format using UTC.",
  6336. // "location": "query",
  6337. // "required": true,
  6338. // "type": "string"
  6339. // },
  6340. // "maxResults": {
  6341. // "description": "Maximum number of entries returned on one result page. If not set, the default is 100. Optional.",
  6342. // "format": "uint32",
  6343. // "location": "query",
  6344. // "maximum": "1000",
  6345. // "minimum": "1",
  6346. // "type": "integer"
  6347. // },
  6348. // "pageToken": {
  6349. // "description": "A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of \"nextPageToken\" from the previous response. Optional.",
  6350. // "location": "query",
  6351. // "type": "string"
  6352. // },
  6353. // "startDateTime": {
  6354. // "description": "The start time of the report in ISO 8601 timestamp format using UTC.",
  6355. // "location": "query",
  6356. // "required": true,
  6357. // "type": "string"
  6358. // }
  6359. // },
  6360. // "path": "performancereport",
  6361. // "response": {
  6362. // "$ref": "PerformanceReportList"
  6363. // },
  6364. // "scopes": [
  6365. // "https://www.googleapis.com/auth/adexchange.buyer"
  6366. // ]
  6367. // }
  6368. }
  6369. // method id "adexchangebuyer.pretargetingConfig.delete":
  6370. type PretargetingConfigDeleteCall struct {
  6371. s *Service
  6372. accountId int64
  6373. configId int64
  6374. urlParams_ gensupport.URLParams
  6375. ctx_ context.Context
  6376. header_ http.Header
  6377. }
  6378. // Delete: Deletes an existing pretargeting config.
  6379. func (r *PretargetingConfigService) Delete(accountId int64, configId int64) *PretargetingConfigDeleteCall {
  6380. c := &PretargetingConfigDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6381. c.accountId = accountId
  6382. c.configId = configId
  6383. return c
  6384. }
  6385. // Fields allows partial responses to be retrieved. See
  6386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6387. // for more information.
  6388. func (c *PretargetingConfigDeleteCall) Fields(s ...googleapi.Field) *PretargetingConfigDeleteCall {
  6389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6390. return c
  6391. }
  6392. // Context sets the context to be used in this call's Do method. Any
  6393. // pending HTTP request will be aborted if the provided context is
  6394. // canceled.
  6395. func (c *PretargetingConfigDeleteCall) Context(ctx context.Context) *PretargetingConfigDeleteCall {
  6396. c.ctx_ = ctx
  6397. return c
  6398. }
  6399. // Header returns an http.Header that can be modified by the caller to
  6400. // add HTTP headers to the request.
  6401. func (c *PretargetingConfigDeleteCall) Header() http.Header {
  6402. if c.header_ == nil {
  6403. c.header_ = make(http.Header)
  6404. }
  6405. return c.header_
  6406. }
  6407. func (c *PretargetingConfigDeleteCall) doRequest(alt string) (*http.Response, error) {
  6408. reqHeaders := make(http.Header)
  6409. for k, v := range c.header_ {
  6410. reqHeaders[k] = v
  6411. }
  6412. reqHeaders.Set("User-Agent", c.s.userAgent())
  6413. var body io.Reader = nil
  6414. c.urlParams_.Set("alt", alt)
  6415. c.urlParams_.Set("prettyPrint", "false")
  6416. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
  6417. urls += "?" + c.urlParams_.Encode()
  6418. req, err := http.NewRequest("DELETE", urls, body)
  6419. if err != nil {
  6420. return nil, err
  6421. }
  6422. req.Header = reqHeaders
  6423. googleapi.Expand(req.URL, map[string]string{
  6424. "accountId": strconv.FormatInt(c.accountId, 10),
  6425. "configId": strconv.FormatInt(c.configId, 10),
  6426. })
  6427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6428. }
  6429. // Do executes the "adexchangebuyer.pretargetingConfig.delete" call.
  6430. func (c *PretargetingConfigDeleteCall) Do(opts ...googleapi.CallOption) error {
  6431. gensupport.SetOptions(c.urlParams_, opts...)
  6432. res, err := c.doRequest("json")
  6433. if err != nil {
  6434. return err
  6435. }
  6436. defer googleapi.CloseBody(res)
  6437. if err := googleapi.CheckResponse(res); err != nil {
  6438. return err
  6439. }
  6440. return nil
  6441. // {
  6442. // "description": "Deletes an existing pretargeting config.",
  6443. // "httpMethod": "DELETE",
  6444. // "id": "adexchangebuyer.pretargetingConfig.delete",
  6445. // "parameterOrder": [
  6446. // "accountId",
  6447. // "configId"
  6448. // ],
  6449. // "parameters": {
  6450. // "accountId": {
  6451. // "description": "The account id to delete the pretargeting config for.",
  6452. // "format": "int64",
  6453. // "location": "path",
  6454. // "required": true,
  6455. // "type": "string"
  6456. // },
  6457. // "configId": {
  6458. // "description": "The specific id of the configuration to delete.",
  6459. // "format": "int64",
  6460. // "location": "path",
  6461. // "required": true,
  6462. // "type": "string"
  6463. // }
  6464. // },
  6465. // "path": "pretargetingconfigs/{accountId}/{configId}",
  6466. // "scopes": [
  6467. // "https://www.googleapis.com/auth/adexchange.buyer"
  6468. // ]
  6469. // }
  6470. }
  6471. // method id "adexchangebuyer.pretargetingConfig.get":
  6472. type PretargetingConfigGetCall struct {
  6473. s *Service
  6474. accountId int64
  6475. configId int64
  6476. urlParams_ gensupport.URLParams
  6477. ifNoneMatch_ string
  6478. ctx_ context.Context
  6479. header_ http.Header
  6480. }
  6481. // Get: Gets a specific pretargeting configuration
  6482. func (r *PretargetingConfigService) Get(accountId int64, configId int64) *PretargetingConfigGetCall {
  6483. c := &PretargetingConfigGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6484. c.accountId = accountId
  6485. c.configId = configId
  6486. return c
  6487. }
  6488. // Fields allows partial responses to be retrieved. See
  6489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6490. // for more information.
  6491. func (c *PretargetingConfigGetCall) Fields(s ...googleapi.Field) *PretargetingConfigGetCall {
  6492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6493. return c
  6494. }
  6495. // IfNoneMatch sets the optional parameter which makes the operation
  6496. // fail if the object's ETag matches the given value. This is useful for
  6497. // getting updates only after the object has changed since the last
  6498. // request. Use googleapi.IsNotModified to check whether the response
  6499. // error from Do is the result of In-None-Match.
  6500. func (c *PretargetingConfigGetCall) IfNoneMatch(entityTag string) *PretargetingConfigGetCall {
  6501. c.ifNoneMatch_ = entityTag
  6502. return c
  6503. }
  6504. // Context sets the context to be used in this call's Do method. Any
  6505. // pending HTTP request will be aborted if the provided context is
  6506. // canceled.
  6507. func (c *PretargetingConfigGetCall) Context(ctx context.Context) *PretargetingConfigGetCall {
  6508. c.ctx_ = ctx
  6509. return c
  6510. }
  6511. // Header returns an http.Header that can be modified by the caller to
  6512. // add HTTP headers to the request.
  6513. func (c *PretargetingConfigGetCall) Header() http.Header {
  6514. if c.header_ == nil {
  6515. c.header_ = make(http.Header)
  6516. }
  6517. return c.header_
  6518. }
  6519. func (c *PretargetingConfigGetCall) doRequest(alt string) (*http.Response, error) {
  6520. reqHeaders := make(http.Header)
  6521. for k, v := range c.header_ {
  6522. reqHeaders[k] = v
  6523. }
  6524. reqHeaders.Set("User-Agent", c.s.userAgent())
  6525. if c.ifNoneMatch_ != "" {
  6526. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6527. }
  6528. var body io.Reader = nil
  6529. c.urlParams_.Set("alt", alt)
  6530. c.urlParams_.Set("prettyPrint", "false")
  6531. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
  6532. urls += "?" + c.urlParams_.Encode()
  6533. req, err := http.NewRequest("GET", urls, body)
  6534. if err != nil {
  6535. return nil, err
  6536. }
  6537. req.Header = reqHeaders
  6538. googleapi.Expand(req.URL, map[string]string{
  6539. "accountId": strconv.FormatInt(c.accountId, 10),
  6540. "configId": strconv.FormatInt(c.configId, 10),
  6541. })
  6542. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6543. }
  6544. // Do executes the "adexchangebuyer.pretargetingConfig.get" call.
  6545. // Exactly one of *PretargetingConfig or error will be non-nil. Any
  6546. // non-2xx status code is an error. Response headers are in either
  6547. // *PretargetingConfig.ServerResponse.Header or (if a response was
  6548. // returned at all) in error.(*googleapi.Error).Header. Use
  6549. // googleapi.IsNotModified to check whether the returned error was
  6550. // because http.StatusNotModified was returned.
  6551. func (c *PretargetingConfigGetCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
  6552. gensupport.SetOptions(c.urlParams_, opts...)
  6553. res, err := c.doRequest("json")
  6554. if res != nil && res.StatusCode == http.StatusNotModified {
  6555. if res.Body != nil {
  6556. res.Body.Close()
  6557. }
  6558. return nil, &googleapi.Error{
  6559. Code: res.StatusCode,
  6560. Header: res.Header,
  6561. }
  6562. }
  6563. if err != nil {
  6564. return nil, err
  6565. }
  6566. defer googleapi.CloseBody(res)
  6567. if err := googleapi.CheckResponse(res); err != nil {
  6568. return nil, err
  6569. }
  6570. ret := &PretargetingConfig{
  6571. ServerResponse: googleapi.ServerResponse{
  6572. Header: res.Header,
  6573. HTTPStatusCode: res.StatusCode,
  6574. },
  6575. }
  6576. target := &ret
  6577. if err := gensupport.DecodeResponse(target, res); err != nil {
  6578. return nil, err
  6579. }
  6580. return ret, nil
  6581. // {
  6582. // "description": "Gets a specific pretargeting configuration",
  6583. // "httpMethod": "GET",
  6584. // "id": "adexchangebuyer.pretargetingConfig.get",
  6585. // "parameterOrder": [
  6586. // "accountId",
  6587. // "configId"
  6588. // ],
  6589. // "parameters": {
  6590. // "accountId": {
  6591. // "description": "The account id to get the pretargeting config for.",
  6592. // "format": "int64",
  6593. // "location": "path",
  6594. // "required": true,
  6595. // "type": "string"
  6596. // },
  6597. // "configId": {
  6598. // "description": "The specific id of the configuration to retrieve.",
  6599. // "format": "int64",
  6600. // "location": "path",
  6601. // "required": true,
  6602. // "type": "string"
  6603. // }
  6604. // },
  6605. // "path": "pretargetingconfigs/{accountId}/{configId}",
  6606. // "response": {
  6607. // "$ref": "PretargetingConfig"
  6608. // },
  6609. // "scopes": [
  6610. // "https://www.googleapis.com/auth/adexchange.buyer"
  6611. // ]
  6612. // }
  6613. }
  6614. // method id "adexchangebuyer.pretargetingConfig.insert":
  6615. type PretargetingConfigInsertCall struct {
  6616. s *Service
  6617. accountId int64
  6618. pretargetingconfig *PretargetingConfig
  6619. urlParams_ gensupport.URLParams
  6620. ctx_ context.Context
  6621. header_ http.Header
  6622. }
  6623. // Insert: Inserts a new pretargeting configuration.
  6624. func (r *PretargetingConfigService) Insert(accountId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigInsertCall {
  6625. c := &PretargetingConfigInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6626. c.accountId = accountId
  6627. c.pretargetingconfig = pretargetingconfig
  6628. return c
  6629. }
  6630. // Fields allows partial responses to be retrieved. See
  6631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6632. // for more information.
  6633. func (c *PretargetingConfigInsertCall) Fields(s ...googleapi.Field) *PretargetingConfigInsertCall {
  6634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6635. return c
  6636. }
  6637. // Context sets the context to be used in this call's Do method. Any
  6638. // pending HTTP request will be aborted if the provided context is
  6639. // canceled.
  6640. func (c *PretargetingConfigInsertCall) Context(ctx context.Context) *PretargetingConfigInsertCall {
  6641. c.ctx_ = ctx
  6642. return c
  6643. }
  6644. // Header returns an http.Header that can be modified by the caller to
  6645. // add HTTP headers to the request.
  6646. func (c *PretargetingConfigInsertCall) Header() http.Header {
  6647. if c.header_ == nil {
  6648. c.header_ = make(http.Header)
  6649. }
  6650. return c.header_
  6651. }
  6652. func (c *PretargetingConfigInsertCall) doRequest(alt string) (*http.Response, error) {
  6653. reqHeaders := make(http.Header)
  6654. for k, v := range c.header_ {
  6655. reqHeaders[k] = v
  6656. }
  6657. reqHeaders.Set("User-Agent", c.s.userAgent())
  6658. var body io.Reader = nil
  6659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
  6660. if err != nil {
  6661. return nil, err
  6662. }
  6663. reqHeaders.Set("Content-Type", "application/json")
  6664. c.urlParams_.Set("alt", alt)
  6665. c.urlParams_.Set("prettyPrint", "false")
  6666. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
  6667. urls += "?" + c.urlParams_.Encode()
  6668. req, err := http.NewRequest("POST", urls, body)
  6669. if err != nil {
  6670. return nil, err
  6671. }
  6672. req.Header = reqHeaders
  6673. googleapi.Expand(req.URL, map[string]string{
  6674. "accountId": strconv.FormatInt(c.accountId, 10),
  6675. })
  6676. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6677. }
  6678. // Do executes the "adexchangebuyer.pretargetingConfig.insert" call.
  6679. // Exactly one of *PretargetingConfig or error will be non-nil. Any
  6680. // non-2xx status code is an error. Response headers are in either
  6681. // *PretargetingConfig.ServerResponse.Header or (if a response was
  6682. // returned at all) in error.(*googleapi.Error).Header. Use
  6683. // googleapi.IsNotModified to check whether the returned error was
  6684. // because http.StatusNotModified was returned.
  6685. func (c *PretargetingConfigInsertCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
  6686. gensupport.SetOptions(c.urlParams_, opts...)
  6687. res, err := c.doRequest("json")
  6688. if res != nil && res.StatusCode == http.StatusNotModified {
  6689. if res.Body != nil {
  6690. res.Body.Close()
  6691. }
  6692. return nil, &googleapi.Error{
  6693. Code: res.StatusCode,
  6694. Header: res.Header,
  6695. }
  6696. }
  6697. if err != nil {
  6698. return nil, err
  6699. }
  6700. defer googleapi.CloseBody(res)
  6701. if err := googleapi.CheckResponse(res); err != nil {
  6702. return nil, err
  6703. }
  6704. ret := &PretargetingConfig{
  6705. ServerResponse: googleapi.ServerResponse{
  6706. Header: res.Header,
  6707. HTTPStatusCode: res.StatusCode,
  6708. },
  6709. }
  6710. target := &ret
  6711. if err := gensupport.DecodeResponse(target, res); err != nil {
  6712. return nil, err
  6713. }
  6714. return ret, nil
  6715. // {
  6716. // "description": "Inserts a new pretargeting configuration.",
  6717. // "httpMethod": "POST",
  6718. // "id": "adexchangebuyer.pretargetingConfig.insert",
  6719. // "parameterOrder": [
  6720. // "accountId"
  6721. // ],
  6722. // "parameters": {
  6723. // "accountId": {
  6724. // "description": "The account id to insert the pretargeting config for.",
  6725. // "format": "int64",
  6726. // "location": "path",
  6727. // "required": true,
  6728. // "type": "string"
  6729. // }
  6730. // },
  6731. // "path": "pretargetingconfigs/{accountId}",
  6732. // "request": {
  6733. // "$ref": "PretargetingConfig"
  6734. // },
  6735. // "response": {
  6736. // "$ref": "PretargetingConfig"
  6737. // },
  6738. // "scopes": [
  6739. // "https://www.googleapis.com/auth/adexchange.buyer"
  6740. // ]
  6741. // }
  6742. }
  6743. // method id "adexchangebuyer.pretargetingConfig.list":
  6744. type PretargetingConfigListCall struct {
  6745. s *Service
  6746. accountId int64
  6747. urlParams_ gensupport.URLParams
  6748. ifNoneMatch_ string
  6749. ctx_ context.Context
  6750. header_ http.Header
  6751. }
  6752. // List: Retrieves a list of the authenticated user's pretargeting
  6753. // configurations.
  6754. func (r *PretargetingConfigService) List(accountId int64) *PretargetingConfigListCall {
  6755. c := &PretargetingConfigListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6756. c.accountId = accountId
  6757. return c
  6758. }
  6759. // Fields allows partial responses to be retrieved. See
  6760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6761. // for more information.
  6762. func (c *PretargetingConfigListCall) Fields(s ...googleapi.Field) *PretargetingConfigListCall {
  6763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6764. return c
  6765. }
  6766. // IfNoneMatch sets the optional parameter which makes the operation
  6767. // fail if the object's ETag matches the given value. This is useful for
  6768. // getting updates only after the object has changed since the last
  6769. // request. Use googleapi.IsNotModified to check whether the response
  6770. // error from Do is the result of In-None-Match.
  6771. func (c *PretargetingConfigListCall) IfNoneMatch(entityTag string) *PretargetingConfigListCall {
  6772. c.ifNoneMatch_ = entityTag
  6773. return c
  6774. }
  6775. // Context sets the context to be used in this call's Do method. Any
  6776. // pending HTTP request will be aborted if the provided context is
  6777. // canceled.
  6778. func (c *PretargetingConfigListCall) Context(ctx context.Context) *PretargetingConfigListCall {
  6779. c.ctx_ = ctx
  6780. return c
  6781. }
  6782. // Header returns an http.Header that can be modified by the caller to
  6783. // add HTTP headers to the request.
  6784. func (c *PretargetingConfigListCall) Header() http.Header {
  6785. if c.header_ == nil {
  6786. c.header_ = make(http.Header)
  6787. }
  6788. return c.header_
  6789. }
  6790. func (c *PretargetingConfigListCall) doRequest(alt string) (*http.Response, error) {
  6791. reqHeaders := make(http.Header)
  6792. for k, v := range c.header_ {
  6793. reqHeaders[k] = v
  6794. }
  6795. reqHeaders.Set("User-Agent", c.s.userAgent())
  6796. if c.ifNoneMatch_ != "" {
  6797. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6798. }
  6799. var body io.Reader = nil
  6800. c.urlParams_.Set("alt", alt)
  6801. c.urlParams_.Set("prettyPrint", "false")
  6802. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}")
  6803. urls += "?" + c.urlParams_.Encode()
  6804. req, err := http.NewRequest("GET", urls, body)
  6805. if err != nil {
  6806. return nil, err
  6807. }
  6808. req.Header = reqHeaders
  6809. googleapi.Expand(req.URL, map[string]string{
  6810. "accountId": strconv.FormatInt(c.accountId, 10),
  6811. })
  6812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6813. }
  6814. // Do executes the "adexchangebuyer.pretargetingConfig.list" call.
  6815. // Exactly one of *PretargetingConfigList or error will be non-nil. Any
  6816. // non-2xx status code is an error. Response headers are in either
  6817. // *PretargetingConfigList.ServerResponse.Header or (if a response was
  6818. // returned at all) in error.(*googleapi.Error).Header. Use
  6819. // googleapi.IsNotModified to check whether the returned error was
  6820. // because http.StatusNotModified was returned.
  6821. func (c *PretargetingConfigListCall) Do(opts ...googleapi.CallOption) (*PretargetingConfigList, error) {
  6822. gensupport.SetOptions(c.urlParams_, opts...)
  6823. res, err := c.doRequest("json")
  6824. if res != nil && res.StatusCode == http.StatusNotModified {
  6825. if res.Body != nil {
  6826. res.Body.Close()
  6827. }
  6828. return nil, &googleapi.Error{
  6829. Code: res.StatusCode,
  6830. Header: res.Header,
  6831. }
  6832. }
  6833. if err != nil {
  6834. return nil, err
  6835. }
  6836. defer googleapi.CloseBody(res)
  6837. if err := googleapi.CheckResponse(res); err != nil {
  6838. return nil, err
  6839. }
  6840. ret := &PretargetingConfigList{
  6841. ServerResponse: googleapi.ServerResponse{
  6842. Header: res.Header,
  6843. HTTPStatusCode: res.StatusCode,
  6844. },
  6845. }
  6846. target := &ret
  6847. if err := gensupport.DecodeResponse(target, res); err != nil {
  6848. return nil, err
  6849. }
  6850. return ret, nil
  6851. // {
  6852. // "description": "Retrieves a list of the authenticated user's pretargeting configurations.",
  6853. // "httpMethod": "GET",
  6854. // "id": "adexchangebuyer.pretargetingConfig.list",
  6855. // "parameterOrder": [
  6856. // "accountId"
  6857. // ],
  6858. // "parameters": {
  6859. // "accountId": {
  6860. // "description": "The account id to get the pretargeting configs for.",
  6861. // "format": "int64",
  6862. // "location": "path",
  6863. // "required": true,
  6864. // "type": "string"
  6865. // }
  6866. // },
  6867. // "path": "pretargetingconfigs/{accountId}",
  6868. // "response": {
  6869. // "$ref": "PretargetingConfigList"
  6870. // },
  6871. // "scopes": [
  6872. // "https://www.googleapis.com/auth/adexchange.buyer"
  6873. // ]
  6874. // }
  6875. }
  6876. // method id "adexchangebuyer.pretargetingConfig.patch":
  6877. type PretargetingConfigPatchCall struct {
  6878. s *Service
  6879. accountId int64
  6880. configId int64
  6881. pretargetingconfig *PretargetingConfig
  6882. urlParams_ gensupport.URLParams
  6883. ctx_ context.Context
  6884. header_ http.Header
  6885. }
  6886. // Patch: Updates an existing pretargeting config. This method supports
  6887. // patch semantics.
  6888. func (r *PretargetingConfigService) Patch(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigPatchCall {
  6889. c := &PretargetingConfigPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6890. c.accountId = accountId
  6891. c.configId = configId
  6892. c.pretargetingconfig = pretargetingconfig
  6893. return c
  6894. }
  6895. // Fields allows partial responses to be retrieved. See
  6896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6897. // for more information.
  6898. func (c *PretargetingConfigPatchCall) Fields(s ...googleapi.Field) *PretargetingConfigPatchCall {
  6899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6900. return c
  6901. }
  6902. // Context sets the context to be used in this call's Do method. Any
  6903. // pending HTTP request will be aborted if the provided context is
  6904. // canceled.
  6905. func (c *PretargetingConfigPatchCall) Context(ctx context.Context) *PretargetingConfigPatchCall {
  6906. c.ctx_ = ctx
  6907. return c
  6908. }
  6909. // Header returns an http.Header that can be modified by the caller to
  6910. // add HTTP headers to the request.
  6911. func (c *PretargetingConfigPatchCall) Header() http.Header {
  6912. if c.header_ == nil {
  6913. c.header_ = make(http.Header)
  6914. }
  6915. return c.header_
  6916. }
  6917. func (c *PretargetingConfigPatchCall) doRequest(alt string) (*http.Response, error) {
  6918. reqHeaders := make(http.Header)
  6919. for k, v := range c.header_ {
  6920. reqHeaders[k] = v
  6921. }
  6922. reqHeaders.Set("User-Agent", c.s.userAgent())
  6923. var body io.Reader = nil
  6924. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
  6925. if err != nil {
  6926. return nil, err
  6927. }
  6928. reqHeaders.Set("Content-Type", "application/json")
  6929. c.urlParams_.Set("alt", alt)
  6930. c.urlParams_.Set("prettyPrint", "false")
  6931. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
  6932. urls += "?" + c.urlParams_.Encode()
  6933. req, err := http.NewRequest("PATCH", urls, body)
  6934. if err != nil {
  6935. return nil, err
  6936. }
  6937. req.Header = reqHeaders
  6938. googleapi.Expand(req.URL, map[string]string{
  6939. "accountId": strconv.FormatInt(c.accountId, 10),
  6940. "configId": strconv.FormatInt(c.configId, 10),
  6941. })
  6942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6943. }
  6944. // Do executes the "adexchangebuyer.pretargetingConfig.patch" call.
  6945. // Exactly one of *PretargetingConfig or error will be non-nil. Any
  6946. // non-2xx status code is an error. Response headers are in either
  6947. // *PretargetingConfig.ServerResponse.Header or (if a response was
  6948. // returned at all) in error.(*googleapi.Error).Header. Use
  6949. // googleapi.IsNotModified to check whether the returned error was
  6950. // because http.StatusNotModified was returned.
  6951. func (c *PretargetingConfigPatchCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
  6952. gensupport.SetOptions(c.urlParams_, opts...)
  6953. res, err := c.doRequest("json")
  6954. if res != nil && res.StatusCode == http.StatusNotModified {
  6955. if res.Body != nil {
  6956. res.Body.Close()
  6957. }
  6958. return nil, &googleapi.Error{
  6959. Code: res.StatusCode,
  6960. Header: res.Header,
  6961. }
  6962. }
  6963. if err != nil {
  6964. return nil, err
  6965. }
  6966. defer googleapi.CloseBody(res)
  6967. if err := googleapi.CheckResponse(res); err != nil {
  6968. return nil, err
  6969. }
  6970. ret := &PretargetingConfig{
  6971. ServerResponse: googleapi.ServerResponse{
  6972. Header: res.Header,
  6973. HTTPStatusCode: res.StatusCode,
  6974. },
  6975. }
  6976. target := &ret
  6977. if err := gensupport.DecodeResponse(target, res); err != nil {
  6978. return nil, err
  6979. }
  6980. return ret, nil
  6981. // {
  6982. // "description": "Updates an existing pretargeting config. This method supports patch semantics.",
  6983. // "httpMethod": "PATCH",
  6984. // "id": "adexchangebuyer.pretargetingConfig.patch",
  6985. // "parameterOrder": [
  6986. // "accountId",
  6987. // "configId"
  6988. // ],
  6989. // "parameters": {
  6990. // "accountId": {
  6991. // "description": "The account id to update the pretargeting config for.",
  6992. // "format": "int64",
  6993. // "location": "path",
  6994. // "required": true,
  6995. // "type": "string"
  6996. // },
  6997. // "configId": {
  6998. // "description": "The specific id of the configuration to update.",
  6999. // "format": "int64",
  7000. // "location": "path",
  7001. // "required": true,
  7002. // "type": "string"
  7003. // }
  7004. // },
  7005. // "path": "pretargetingconfigs/{accountId}/{configId}",
  7006. // "request": {
  7007. // "$ref": "PretargetingConfig"
  7008. // },
  7009. // "response": {
  7010. // "$ref": "PretargetingConfig"
  7011. // },
  7012. // "scopes": [
  7013. // "https://www.googleapis.com/auth/adexchange.buyer"
  7014. // ]
  7015. // }
  7016. }
  7017. // method id "adexchangebuyer.pretargetingConfig.update":
  7018. type PretargetingConfigUpdateCall struct {
  7019. s *Service
  7020. accountId int64
  7021. configId int64
  7022. pretargetingconfig *PretargetingConfig
  7023. urlParams_ gensupport.URLParams
  7024. ctx_ context.Context
  7025. header_ http.Header
  7026. }
  7027. // Update: Updates an existing pretargeting config.
  7028. func (r *PretargetingConfigService) Update(accountId int64, configId int64, pretargetingconfig *PretargetingConfig) *PretargetingConfigUpdateCall {
  7029. c := &PretargetingConfigUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7030. c.accountId = accountId
  7031. c.configId = configId
  7032. c.pretargetingconfig = pretargetingconfig
  7033. return c
  7034. }
  7035. // Fields allows partial responses to be retrieved. See
  7036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7037. // for more information.
  7038. func (c *PretargetingConfigUpdateCall) Fields(s ...googleapi.Field) *PretargetingConfigUpdateCall {
  7039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7040. return c
  7041. }
  7042. // Context sets the context to be used in this call's Do method. Any
  7043. // pending HTTP request will be aborted if the provided context is
  7044. // canceled.
  7045. func (c *PretargetingConfigUpdateCall) Context(ctx context.Context) *PretargetingConfigUpdateCall {
  7046. c.ctx_ = ctx
  7047. return c
  7048. }
  7049. // Header returns an http.Header that can be modified by the caller to
  7050. // add HTTP headers to the request.
  7051. func (c *PretargetingConfigUpdateCall) Header() http.Header {
  7052. if c.header_ == nil {
  7053. c.header_ = make(http.Header)
  7054. }
  7055. return c.header_
  7056. }
  7057. func (c *PretargetingConfigUpdateCall) doRequest(alt string) (*http.Response, error) {
  7058. reqHeaders := make(http.Header)
  7059. for k, v := range c.header_ {
  7060. reqHeaders[k] = v
  7061. }
  7062. reqHeaders.Set("User-Agent", c.s.userAgent())
  7063. var body io.Reader = nil
  7064. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pretargetingconfig)
  7065. if err != nil {
  7066. return nil, err
  7067. }
  7068. reqHeaders.Set("Content-Type", "application/json")
  7069. c.urlParams_.Set("alt", alt)
  7070. c.urlParams_.Set("prettyPrint", "false")
  7071. urls := googleapi.ResolveRelative(c.s.BasePath, "pretargetingconfigs/{accountId}/{configId}")
  7072. urls += "?" + c.urlParams_.Encode()
  7073. req, err := http.NewRequest("PUT", urls, body)
  7074. if err != nil {
  7075. return nil, err
  7076. }
  7077. req.Header = reqHeaders
  7078. googleapi.Expand(req.URL, map[string]string{
  7079. "accountId": strconv.FormatInt(c.accountId, 10),
  7080. "configId": strconv.FormatInt(c.configId, 10),
  7081. })
  7082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7083. }
  7084. // Do executes the "adexchangebuyer.pretargetingConfig.update" call.
  7085. // Exactly one of *PretargetingConfig or error will be non-nil. Any
  7086. // non-2xx status code is an error. Response headers are in either
  7087. // *PretargetingConfig.ServerResponse.Header or (if a response was
  7088. // returned at all) in error.(*googleapi.Error).Header. Use
  7089. // googleapi.IsNotModified to check whether the returned error was
  7090. // because http.StatusNotModified was returned.
  7091. func (c *PretargetingConfigUpdateCall) Do(opts ...googleapi.CallOption) (*PretargetingConfig, error) {
  7092. gensupport.SetOptions(c.urlParams_, opts...)
  7093. res, err := c.doRequest("json")
  7094. if res != nil && res.StatusCode == http.StatusNotModified {
  7095. if res.Body != nil {
  7096. res.Body.Close()
  7097. }
  7098. return nil, &googleapi.Error{
  7099. Code: res.StatusCode,
  7100. Header: res.Header,
  7101. }
  7102. }
  7103. if err != nil {
  7104. return nil, err
  7105. }
  7106. defer googleapi.CloseBody(res)
  7107. if err := googleapi.CheckResponse(res); err != nil {
  7108. return nil, err
  7109. }
  7110. ret := &PretargetingConfig{
  7111. ServerResponse: googleapi.ServerResponse{
  7112. Header: res.Header,
  7113. HTTPStatusCode: res.StatusCode,
  7114. },
  7115. }
  7116. target := &ret
  7117. if err := gensupport.DecodeResponse(target, res); err != nil {
  7118. return nil, err
  7119. }
  7120. return ret, nil
  7121. // {
  7122. // "description": "Updates an existing pretargeting config.",
  7123. // "httpMethod": "PUT",
  7124. // "id": "adexchangebuyer.pretargetingConfig.update",
  7125. // "parameterOrder": [
  7126. // "accountId",
  7127. // "configId"
  7128. // ],
  7129. // "parameters": {
  7130. // "accountId": {
  7131. // "description": "The account id to update the pretargeting config for.",
  7132. // "format": "int64",
  7133. // "location": "path",
  7134. // "required": true,
  7135. // "type": "string"
  7136. // },
  7137. // "configId": {
  7138. // "description": "The specific id of the configuration to update.",
  7139. // "format": "int64",
  7140. // "location": "path",
  7141. // "required": true,
  7142. // "type": "string"
  7143. // }
  7144. // },
  7145. // "path": "pretargetingconfigs/{accountId}/{configId}",
  7146. // "request": {
  7147. // "$ref": "PretargetingConfig"
  7148. // },
  7149. // "response": {
  7150. // "$ref": "PretargetingConfig"
  7151. // },
  7152. // "scopes": [
  7153. // "https://www.googleapis.com/auth/adexchange.buyer"
  7154. // ]
  7155. // }
  7156. }
  7157. // method id "adexchangebuyer.products.get":
  7158. type ProductsGetCall struct {
  7159. s *Service
  7160. productId string
  7161. urlParams_ gensupport.URLParams
  7162. ifNoneMatch_ string
  7163. ctx_ context.Context
  7164. header_ http.Header
  7165. }
  7166. // Get: Gets the requested product by id.
  7167. func (r *ProductsService) Get(productId string) *ProductsGetCall {
  7168. c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7169. c.productId = productId
  7170. return c
  7171. }
  7172. // Fields allows partial responses to be retrieved. See
  7173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7174. // for more information.
  7175. func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
  7176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7177. return c
  7178. }
  7179. // IfNoneMatch sets the optional parameter which makes the operation
  7180. // fail if the object's ETag matches the given value. This is useful for
  7181. // getting updates only after the object has changed since the last
  7182. // request. Use googleapi.IsNotModified to check whether the response
  7183. // error from Do is the result of In-None-Match.
  7184. func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
  7185. c.ifNoneMatch_ = entityTag
  7186. return c
  7187. }
  7188. // Context sets the context to be used in this call's Do method. Any
  7189. // pending HTTP request will be aborted if the provided context is
  7190. // canceled.
  7191. func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
  7192. c.ctx_ = ctx
  7193. return c
  7194. }
  7195. // Header returns an http.Header that can be modified by the caller to
  7196. // add HTTP headers to the request.
  7197. func (c *ProductsGetCall) Header() http.Header {
  7198. if c.header_ == nil {
  7199. c.header_ = make(http.Header)
  7200. }
  7201. return c.header_
  7202. }
  7203. func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
  7204. reqHeaders := make(http.Header)
  7205. for k, v := range c.header_ {
  7206. reqHeaders[k] = v
  7207. }
  7208. reqHeaders.Set("User-Agent", c.s.userAgent())
  7209. if c.ifNoneMatch_ != "" {
  7210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7211. }
  7212. var body io.Reader = nil
  7213. c.urlParams_.Set("alt", alt)
  7214. c.urlParams_.Set("prettyPrint", "false")
  7215. urls := googleapi.ResolveRelative(c.s.BasePath, "products/{productId}")
  7216. urls += "?" + c.urlParams_.Encode()
  7217. req, err := http.NewRequest("GET", urls, body)
  7218. if err != nil {
  7219. return nil, err
  7220. }
  7221. req.Header = reqHeaders
  7222. googleapi.Expand(req.URL, map[string]string{
  7223. "productId": c.productId,
  7224. })
  7225. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7226. }
  7227. // Do executes the "adexchangebuyer.products.get" call.
  7228. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  7229. // code is an error. Response headers are in either
  7230. // *Product.ServerResponse.Header or (if a response was returned at all)
  7231. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7232. // check whether the returned error was because http.StatusNotModified
  7233. // was returned.
  7234. func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  7235. gensupport.SetOptions(c.urlParams_, opts...)
  7236. res, err := c.doRequest("json")
  7237. if res != nil && res.StatusCode == http.StatusNotModified {
  7238. if res.Body != nil {
  7239. res.Body.Close()
  7240. }
  7241. return nil, &googleapi.Error{
  7242. Code: res.StatusCode,
  7243. Header: res.Header,
  7244. }
  7245. }
  7246. if err != nil {
  7247. return nil, err
  7248. }
  7249. defer googleapi.CloseBody(res)
  7250. if err := googleapi.CheckResponse(res); err != nil {
  7251. return nil, err
  7252. }
  7253. ret := &Product{
  7254. ServerResponse: googleapi.ServerResponse{
  7255. Header: res.Header,
  7256. HTTPStatusCode: res.StatusCode,
  7257. },
  7258. }
  7259. target := &ret
  7260. if err := gensupport.DecodeResponse(target, res); err != nil {
  7261. return nil, err
  7262. }
  7263. return ret, nil
  7264. // {
  7265. // "description": "Gets the requested product by id.",
  7266. // "httpMethod": "GET",
  7267. // "id": "adexchangebuyer.products.get",
  7268. // "parameterOrder": [
  7269. // "productId"
  7270. // ],
  7271. // "parameters": {
  7272. // "productId": {
  7273. // "description": "The id for the product to get the head revision for.",
  7274. // "location": "path",
  7275. // "required": true,
  7276. // "type": "string"
  7277. // }
  7278. // },
  7279. // "path": "products/{productId}",
  7280. // "response": {
  7281. // "$ref": "Product"
  7282. // },
  7283. // "scopes": [
  7284. // "https://www.googleapis.com/auth/adexchange.buyer"
  7285. // ]
  7286. // }
  7287. }
  7288. // method id "adexchangebuyer.products.search":
  7289. type ProductsSearchCall struct {
  7290. s *Service
  7291. urlParams_ gensupport.URLParams
  7292. ifNoneMatch_ string
  7293. ctx_ context.Context
  7294. header_ http.Header
  7295. }
  7296. // Search: Gets the requested product.
  7297. func (r *ProductsService) Search() *ProductsSearchCall {
  7298. c := &ProductsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7299. return c
  7300. }
  7301. // PqlQuery sets the optional parameter "pqlQuery": The pql query used
  7302. // to query for products.
  7303. func (c *ProductsSearchCall) PqlQuery(pqlQuery string) *ProductsSearchCall {
  7304. c.urlParams_.Set("pqlQuery", pqlQuery)
  7305. return c
  7306. }
  7307. // Fields allows partial responses to be retrieved. See
  7308. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7309. // for more information.
  7310. func (c *ProductsSearchCall) Fields(s ...googleapi.Field) *ProductsSearchCall {
  7311. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7312. return c
  7313. }
  7314. // IfNoneMatch sets the optional parameter which makes the operation
  7315. // fail if the object's ETag matches the given value. This is useful for
  7316. // getting updates only after the object has changed since the last
  7317. // request. Use googleapi.IsNotModified to check whether the response
  7318. // error from Do is the result of In-None-Match.
  7319. func (c *ProductsSearchCall) IfNoneMatch(entityTag string) *ProductsSearchCall {
  7320. c.ifNoneMatch_ = entityTag
  7321. return c
  7322. }
  7323. // Context sets the context to be used in this call's Do method. Any
  7324. // pending HTTP request will be aborted if the provided context is
  7325. // canceled.
  7326. func (c *ProductsSearchCall) Context(ctx context.Context) *ProductsSearchCall {
  7327. c.ctx_ = ctx
  7328. return c
  7329. }
  7330. // Header returns an http.Header that can be modified by the caller to
  7331. // add HTTP headers to the request.
  7332. func (c *ProductsSearchCall) Header() http.Header {
  7333. if c.header_ == nil {
  7334. c.header_ = make(http.Header)
  7335. }
  7336. return c.header_
  7337. }
  7338. func (c *ProductsSearchCall) doRequest(alt string) (*http.Response, error) {
  7339. reqHeaders := make(http.Header)
  7340. for k, v := range c.header_ {
  7341. reqHeaders[k] = v
  7342. }
  7343. reqHeaders.Set("User-Agent", c.s.userAgent())
  7344. if c.ifNoneMatch_ != "" {
  7345. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7346. }
  7347. var body io.Reader = nil
  7348. c.urlParams_.Set("alt", alt)
  7349. c.urlParams_.Set("prettyPrint", "false")
  7350. urls := googleapi.ResolveRelative(c.s.BasePath, "products/search")
  7351. urls += "?" + c.urlParams_.Encode()
  7352. req, err := http.NewRequest("GET", urls, body)
  7353. if err != nil {
  7354. return nil, err
  7355. }
  7356. req.Header = reqHeaders
  7357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7358. }
  7359. // Do executes the "adexchangebuyer.products.search" call.
  7360. // Exactly one of *GetOffersResponse or error will be non-nil. Any
  7361. // non-2xx status code is an error. Response headers are in either
  7362. // *GetOffersResponse.ServerResponse.Header or (if a response was
  7363. // returned at all) in error.(*googleapi.Error).Header. Use
  7364. // googleapi.IsNotModified to check whether the returned error was
  7365. // because http.StatusNotModified was returned.
  7366. func (c *ProductsSearchCall) Do(opts ...googleapi.CallOption) (*GetOffersResponse, error) {
  7367. gensupport.SetOptions(c.urlParams_, opts...)
  7368. res, err := c.doRequest("json")
  7369. if res != nil && res.StatusCode == http.StatusNotModified {
  7370. if res.Body != nil {
  7371. res.Body.Close()
  7372. }
  7373. return nil, &googleapi.Error{
  7374. Code: res.StatusCode,
  7375. Header: res.Header,
  7376. }
  7377. }
  7378. if err != nil {
  7379. return nil, err
  7380. }
  7381. defer googleapi.CloseBody(res)
  7382. if err := googleapi.CheckResponse(res); err != nil {
  7383. return nil, err
  7384. }
  7385. ret := &GetOffersResponse{
  7386. ServerResponse: googleapi.ServerResponse{
  7387. Header: res.Header,
  7388. HTTPStatusCode: res.StatusCode,
  7389. },
  7390. }
  7391. target := &ret
  7392. if err := gensupport.DecodeResponse(target, res); err != nil {
  7393. return nil, err
  7394. }
  7395. return ret, nil
  7396. // {
  7397. // "description": "Gets the requested product.",
  7398. // "httpMethod": "GET",
  7399. // "id": "adexchangebuyer.products.search",
  7400. // "parameters": {
  7401. // "pqlQuery": {
  7402. // "description": "The pql query used to query for products.",
  7403. // "location": "query",
  7404. // "type": "string"
  7405. // }
  7406. // },
  7407. // "path": "products/search",
  7408. // "response": {
  7409. // "$ref": "GetOffersResponse"
  7410. // },
  7411. // "scopes": [
  7412. // "https://www.googleapis.com/auth/adexchange.buyer"
  7413. // ]
  7414. // }
  7415. }
  7416. // method id "adexchangebuyer.proposals.get":
  7417. type ProposalsGetCall struct {
  7418. s *Service
  7419. proposalId string
  7420. urlParams_ gensupport.URLParams
  7421. ifNoneMatch_ string
  7422. ctx_ context.Context
  7423. header_ http.Header
  7424. }
  7425. // Get: Get a proposal given its id
  7426. func (r *ProposalsService) Get(proposalId string) *ProposalsGetCall {
  7427. c := &ProposalsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7428. c.proposalId = proposalId
  7429. return c
  7430. }
  7431. // Fields allows partial responses to be retrieved. See
  7432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7433. // for more information.
  7434. func (c *ProposalsGetCall) Fields(s ...googleapi.Field) *ProposalsGetCall {
  7435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7436. return c
  7437. }
  7438. // IfNoneMatch sets the optional parameter which makes the operation
  7439. // fail if the object's ETag matches the given value. This is useful for
  7440. // getting updates only after the object has changed since the last
  7441. // request. Use googleapi.IsNotModified to check whether the response
  7442. // error from Do is the result of In-None-Match.
  7443. func (c *ProposalsGetCall) IfNoneMatch(entityTag string) *ProposalsGetCall {
  7444. c.ifNoneMatch_ = entityTag
  7445. return c
  7446. }
  7447. // Context sets the context to be used in this call's Do method. Any
  7448. // pending HTTP request will be aborted if the provided context is
  7449. // canceled.
  7450. func (c *ProposalsGetCall) Context(ctx context.Context) *ProposalsGetCall {
  7451. c.ctx_ = ctx
  7452. return c
  7453. }
  7454. // Header returns an http.Header that can be modified by the caller to
  7455. // add HTTP headers to the request.
  7456. func (c *ProposalsGetCall) Header() http.Header {
  7457. if c.header_ == nil {
  7458. c.header_ = make(http.Header)
  7459. }
  7460. return c.header_
  7461. }
  7462. func (c *ProposalsGetCall) doRequest(alt string) (*http.Response, error) {
  7463. reqHeaders := make(http.Header)
  7464. for k, v := range c.header_ {
  7465. reqHeaders[k] = v
  7466. }
  7467. reqHeaders.Set("User-Agent", c.s.userAgent())
  7468. if c.ifNoneMatch_ != "" {
  7469. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7470. }
  7471. var body io.Reader = nil
  7472. c.urlParams_.Set("alt", alt)
  7473. c.urlParams_.Set("prettyPrint", "false")
  7474. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}")
  7475. urls += "?" + c.urlParams_.Encode()
  7476. req, err := http.NewRequest("GET", urls, body)
  7477. if err != nil {
  7478. return nil, err
  7479. }
  7480. req.Header = reqHeaders
  7481. googleapi.Expand(req.URL, map[string]string{
  7482. "proposalId": c.proposalId,
  7483. })
  7484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7485. }
  7486. // Do executes the "adexchangebuyer.proposals.get" call.
  7487. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  7488. // code is an error. Response headers are in either
  7489. // *Proposal.ServerResponse.Header or (if a response was returned at
  7490. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7491. // to check whether the returned error was because
  7492. // http.StatusNotModified was returned.
  7493. func (c *ProposalsGetCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  7494. gensupport.SetOptions(c.urlParams_, opts...)
  7495. res, err := c.doRequest("json")
  7496. if res != nil && res.StatusCode == http.StatusNotModified {
  7497. if res.Body != nil {
  7498. res.Body.Close()
  7499. }
  7500. return nil, &googleapi.Error{
  7501. Code: res.StatusCode,
  7502. Header: res.Header,
  7503. }
  7504. }
  7505. if err != nil {
  7506. return nil, err
  7507. }
  7508. defer googleapi.CloseBody(res)
  7509. if err := googleapi.CheckResponse(res); err != nil {
  7510. return nil, err
  7511. }
  7512. ret := &Proposal{
  7513. ServerResponse: googleapi.ServerResponse{
  7514. Header: res.Header,
  7515. HTTPStatusCode: res.StatusCode,
  7516. },
  7517. }
  7518. target := &ret
  7519. if err := gensupport.DecodeResponse(target, res); err != nil {
  7520. return nil, err
  7521. }
  7522. return ret, nil
  7523. // {
  7524. // "description": "Get a proposal given its id",
  7525. // "httpMethod": "GET",
  7526. // "id": "adexchangebuyer.proposals.get",
  7527. // "parameterOrder": [
  7528. // "proposalId"
  7529. // ],
  7530. // "parameters": {
  7531. // "proposalId": {
  7532. // "description": "Id of the proposal to retrieve.",
  7533. // "location": "path",
  7534. // "required": true,
  7535. // "type": "string"
  7536. // }
  7537. // },
  7538. // "path": "proposals/{proposalId}",
  7539. // "response": {
  7540. // "$ref": "Proposal"
  7541. // },
  7542. // "scopes": [
  7543. // "https://www.googleapis.com/auth/adexchange.buyer"
  7544. // ]
  7545. // }
  7546. }
  7547. // method id "adexchangebuyer.proposals.insert":
  7548. type ProposalsInsertCall struct {
  7549. s *Service
  7550. createordersrequest *CreateOrdersRequest
  7551. urlParams_ gensupport.URLParams
  7552. ctx_ context.Context
  7553. header_ http.Header
  7554. }
  7555. // Insert: Create the given list of proposals
  7556. func (r *ProposalsService) Insert(createordersrequest *CreateOrdersRequest) *ProposalsInsertCall {
  7557. c := &ProposalsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7558. c.createordersrequest = createordersrequest
  7559. return c
  7560. }
  7561. // Fields allows partial responses to be retrieved. See
  7562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7563. // for more information.
  7564. func (c *ProposalsInsertCall) Fields(s ...googleapi.Field) *ProposalsInsertCall {
  7565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7566. return c
  7567. }
  7568. // Context sets the context to be used in this call's Do method. Any
  7569. // pending HTTP request will be aborted if the provided context is
  7570. // canceled.
  7571. func (c *ProposalsInsertCall) Context(ctx context.Context) *ProposalsInsertCall {
  7572. c.ctx_ = ctx
  7573. return c
  7574. }
  7575. // Header returns an http.Header that can be modified by the caller to
  7576. // add HTTP headers to the request.
  7577. func (c *ProposalsInsertCall) Header() http.Header {
  7578. if c.header_ == nil {
  7579. c.header_ = make(http.Header)
  7580. }
  7581. return c.header_
  7582. }
  7583. func (c *ProposalsInsertCall) doRequest(alt string) (*http.Response, error) {
  7584. reqHeaders := make(http.Header)
  7585. for k, v := range c.header_ {
  7586. reqHeaders[k] = v
  7587. }
  7588. reqHeaders.Set("User-Agent", c.s.userAgent())
  7589. var body io.Reader = nil
  7590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createordersrequest)
  7591. if err != nil {
  7592. return nil, err
  7593. }
  7594. reqHeaders.Set("Content-Type", "application/json")
  7595. c.urlParams_.Set("alt", alt)
  7596. c.urlParams_.Set("prettyPrint", "false")
  7597. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/insert")
  7598. urls += "?" + c.urlParams_.Encode()
  7599. req, err := http.NewRequest("POST", urls, body)
  7600. if err != nil {
  7601. return nil, err
  7602. }
  7603. req.Header = reqHeaders
  7604. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7605. }
  7606. // Do executes the "adexchangebuyer.proposals.insert" call.
  7607. // Exactly one of *CreateOrdersResponse or error will be non-nil. Any
  7608. // non-2xx status code is an error. Response headers are in either
  7609. // *CreateOrdersResponse.ServerResponse.Header or (if a response was
  7610. // returned at all) in error.(*googleapi.Error).Header. Use
  7611. // googleapi.IsNotModified to check whether the returned error was
  7612. // because http.StatusNotModified was returned.
  7613. func (c *ProposalsInsertCall) Do(opts ...googleapi.CallOption) (*CreateOrdersResponse, error) {
  7614. gensupport.SetOptions(c.urlParams_, opts...)
  7615. res, err := c.doRequest("json")
  7616. if res != nil && res.StatusCode == http.StatusNotModified {
  7617. if res.Body != nil {
  7618. res.Body.Close()
  7619. }
  7620. return nil, &googleapi.Error{
  7621. Code: res.StatusCode,
  7622. Header: res.Header,
  7623. }
  7624. }
  7625. if err != nil {
  7626. return nil, err
  7627. }
  7628. defer googleapi.CloseBody(res)
  7629. if err := googleapi.CheckResponse(res); err != nil {
  7630. return nil, err
  7631. }
  7632. ret := &CreateOrdersResponse{
  7633. ServerResponse: googleapi.ServerResponse{
  7634. Header: res.Header,
  7635. HTTPStatusCode: res.StatusCode,
  7636. },
  7637. }
  7638. target := &ret
  7639. if err := gensupport.DecodeResponse(target, res); err != nil {
  7640. return nil, err
  7641. }
  7642. return ret, nil
  7643. // {
  7644. // "description": "Create the given list of proposals",
  7645. // "httpMethod": "POST",
  7646. // "id": "adexchangebuyer.proposals.insert",
  7647. // "path": "proposals/insert",
  7648. // "request": {
  7649. // "$ref": "CreateOrdersRequest"
  7650. // },
  7651. // "response": {
  7652. // "$ref": "CreateOrdersResponse"
  7653. // },
  7654. // "scopes": [
  7655. // "https://www.googleapis.com/auth/adexchange.buyer"
  7656. // ]
  7657. // }
  7658. }
  7659. // method id "adexchangebuyer.proposals.patch":
  7660. type ProposalsPatchCall struct {
  7661. s *Service
  7662. proposalId string
  7663. revisionNumber int64
  7664. updateAction string
  7665. proposal *Proposal
  7666. urlParams_ gensupport.URLParams
  7667. ctx_ context.Context
  7668. header_ http.Header
  7669. }
  7670. // Patch: Update the given proposal. This method supports patch
  7671. // semantics.
  7672. func (r *ProposalsService) Patch(proposalId string, revisionNumber int64, updateAction string, proposal *Proposal) *ProposalsPatchCall {
  7673. c := &ProposalsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7674. c.proposalId = proposalId
  7675. c.revisionNumber = revisionNumber
  7676. c.updateAction = updateAction
  7677. c.proposal = proposal
  7678. return c
  7679. }
  7680. // Fields allows partial responses to be retrieved. See
  7681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7682. // for more information.
  7683. func (c *ProposalsPatchCall) Fields(s ...googleapi.Field) *ProposalsPatchCall {
  7684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7685. return c
  7686. }
  7687. // Context sets the context to be used in this call's Do method. Any
  7688. // pending HTTP request will be aborted if the provided context is
  7689. // canceled.
  7690. func (c *ProposalsPatchCall) Context(ctx context.Context) *ProposalsPatchCall {
  7691. c.ctx_ = ctx
  7692. return c
  7693. }
  7694. // Header returns an http.Header that can be modified by the caller to
  7695. // add HTTP headers to the request.
  7696. func (c *ProposalsPatchCall) Header() http.Header {
  7697. if c.header_ == nil {
  7698. c.header_ = make(http.Header)
  7699. }
  7700. return c.header_
  7701. }
  7702. func (c *ProposalsPatchCall) doRequest(alt string) (*http.Response, error) {
  7703. reqHeaders := make(http.Header)
  7704. for k, v := range c.header_ {
  7705. reqHeaders[k] = v
  7706. }
  7707. reqHeaders.Set("User-Agent", c.s.userAgent())
  7708. var body io.Reader = nil
  7709. body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
  7710. if err != nil {
  7711. return nil, err
  7712. }
  7713. reqHeaders.Set("Content-Type", "application/json")
  7714. c.urlParams_.Set("alt", alt)
  7715. c.urlParams_.Set("prettyPrint", "false")
  7716. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/{revisionNumber}/{updateAction}")
  7717. urls += "?" + c.urlParams_.Encode()
  7718. req, err := http.NewRequest("PATCH", urls, body)
  7719. if err != nil {
  7720. return nil, err
  7721. }
  7722. req.Header = reqHeaders
  7723. googleapi.Expand(req.URL, map[string]string{
  7724. "proposalId": c.proposalId,
  7725. "revisionNumber": strconv.FormatInt(c.revisionNumber, 10),
  7726. "updateAction": c.updateAction,
  7727. })
  7728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7729. }
  7730. // Do executes the "adexchangebuyer.proposals.patch" call.
  7731. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  7732. // code is an error. Response headers are in either
  7733. // *Proposal.ServerResponse.Header or (if a response was returned at
  7734. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7735. // to check whether the returned error was because
  7736. // http.StatusNotModified was returned.
  7737. func (c *ProposalsPatchCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  7738. gensupport.SetOptions(c.urlParams_, opts...)
  7739. res, err := c.doRequest("json")
  7740. if res != nil && res.StatusCode == http.StatusNotModified {
  7741. if res.Body != nil {
  7742. res.Body.Close()
  7743. }
  7744. return nil, &googleapi.Error{
  7745. Code: res.StatusCode,
  7746. Header: res.Header,
  7747. }
  7748. }
  7749. if err != nil {
  7750. return nil, err
  7751. }
  7752. defer googleapi.CloseBody(res)
  7753. if err := googleapi.CheckResponse(res); err != nil {
  7754. return nil, err
  7755. }
  7756. ret := &Proposal{
  7757. ServerResponse: googleapi.ServerResponse{
  7758. Header: res.Header,
  7759. HTTPStatusCode: res.StatusCode,
  7760. },
  7761. }
  7762. target := &ret
  7763. if err := gensupport.DecodeResponse(target, res); err != nil {
  7764. return nil, err
  7765. }
  7766. return ret, nil
  7767. // {
  7768. // "description": "Update the given proposal. This method supports patch semantics.",
  7769. // "httpMethod": "PATCH",
  7770. // "id": "adexchangebuyer.proposals.patch",
  7771. // "parameterOrder": [
  7772. // "proposalId",
  7773. // "revisionNumber",
  7774. // "updateAction"
  7775. // ],
  7776. // "parameters": {
  7777. // "proposalId": {
  7778. // "description": "The proposal id to update.",
  7779. // "location": "path",
  7780. // "required": true,
  7781. // "type": "string"
  7782. // },
  7783. // "revisionNumber": {
  7784. // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision.",
  7785. // "format": "int64",
  7786. // "location": "path",
  7787. // "required": true,
  7788. // "type": "string"
  7789. // },
  7790. // "updateAction": {
  7791. // "description": "The proposed action to take on the proposal. This field is required and it must be set when updating a proposal.",
  7792. // "enum": [
  7793. // "accept",
  7794. // "cancel",
  7795. // "propose",
  7796. // "proposeAndAccept",
  7797. // "unknownAction",
  7798. // "updateNonTerms"
  7799. // ],
  7800. // "enumDescriptions": [
  7801. // "",
  7802. // "",
  7803. // "",
  7804. // "",
  7805. // "",
  7806. // ""
  7807. // ],
  7808. // "location": "path",
  7809. // "required": true,
  7810. // "type": "string"
  7811. // }
  7812. // },
  7813. // "path": "proposals/{proposalId}/{revisionNumber}/{updateAction}",
  7814. // "request": {
  7815. // "$ref": "Proposal"
  7816. // },
  7817. // "response": {
  7818. // "$ref": "Proposal"
  7819. // },
  7820. // "scopes": [
  7821. // "https://www.googleapis.com/auth/adexchange.buyer"
  7822. // ]
  7823. // }
  7824. }
  7825. // method id "adexchangebuyer.proposals.search":
  7826. type ProposalsSearchCall struct {
  7827. s *Service
  7828. urlParams_ gensupport.URLParams
  7829. ifNoneMatch_ string
  7830. ctx_ context.Context
  7831. header_ http.Header
  7832. }
  7833. // Search: Search for proposals using pql query
  7834. func (r *ProposalsService) Search() *ProposalsSearchCall {
  7835. c := &ProposalsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7836. return c
  7837. }
  7838. // PqlQuery sets the optional parameter "pqlQuery": Query string to
  7839. // retrieve specific proposals.
  7840. func (c *ProposalsSearchCall) PqlQuery(pqlQuery string) *ProposalsSearchCall {
  7841. c.urlParams_.Set("pqlQuery", pqlQuery)
  7842. return c
  7843. }
  7844. // Fields allows partial responses to be retrieved. See
  7845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7846. // for more information.
  7847. func (c *ProposalsSearchCall) Fields(s ...googleapi.Field) *ProposalsSearchCall {
  7848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7849. return c
  7850. }
  7851. // IfNoneMatch sets the optional parameter which makes the operation
  7852. // fail if the object's ETag matches the given value. This is useful for
  7853. // getting updates only after the object has changed since the last
  7854. // request. Use googleapi.IsNotModified to check whether the response
  7855. // error from Do is the result of In-None-Match.
  7856. func (c *ProposalsSearchCall) IfNoneMatch(entityTag string) *ProposalsSearchCall {
  7857. c.ifNoneMatch_ = entityTag
  7858. return c
  7859. }
  7860. // Context sets the context to be used in this call's Do method. Any
  7861. // pending HTTP request will be aborted if the provided context is
  7862. // canceled.
  7863. func (c *ProposalsSearchCall) Context(ctx context.Context) *ProposalsSearchCall {
  7864. c.ctx_ = ctx
  7865. return c
  7866. }
  7867. // Header returns an http.Header that can be modified by the caller to
  7868. // add HTTP headers to the request.
  7869. func (c *ProposalsSearchCall) Header() http.Header {
  7870. if c.header_ == nil {
  7871. c.header_ = make(http.Header)
  7872. }
  7873. return c.header_
  7874. }
  7875. func (c *ProposalsSearchCall) doRequest(alt string) (*http.Response, error) {
  7876. reqHeaders := make(http.Header)
  7877. for k, v := range c.header_ {
  7878. reqHeaders[k] = v
  7879. }
  7880. reqHeaders.Set("User-Agent", c.s.userAgent())
  7881. if c.ifNoneMatch_ != "" {
  7882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7883. }
  7884. var body io.Reader = nil
  7885. c.urlParams_.Set("alt", alt)
  7886. c.urlParams_.Set("prettyPrint", "false")
  7887. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/search")
  7888. urls += "?" + c.urlParams_.Encode()
  7889. req, err := http.NewRequest("GET", urls, body)
  7890. if err != nil {
  7891. return nil, err
  7892. }
  7893. req.Header = reqHeaders
  7894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7895. }
  7896. // Do executes the "adexchangebuyer.proposals.search" call.
  7897. // Exactly one of *GetOrdersResponse or error will be non-nil. Any
  7898. // non-2xx status code is an error. Response headers are in either
  7899. // *GetOrdersResponse.ServerResponse.Header or (if a response was
  7900. // returned at all) in error.(*googleapi.Error).Header. Use
  7901. // googleapi.IsNotModified to check whether the returned error was
  7902. // because http.StatusNotModified was returned.
  7903. func (c *ProposalsSearchCall) Do(opts ...googleapi.CallOption) (*GetOrdersResponse, error) {
  7904. gensupport.SetOptions(c.urlParams_, opts...)
  7905. res, err := c.doRequest("json")
  7906. if res != nil && res.StatusCode == http.StatusNotModified {
  7907. if res.Body != nil {
  7908. res.Body.Close()
  7909. }
  7910. return nil, &googleapi.Error{
  7911. Code: res.StatusCode,
  7912. Header: res.Header,
  7913. }
  7914. }
  7915. if err != nil {
  7916. return nil, err
  7917. }
  7918. defer googleapi.CloseBody(res)
  7919. if err := googleapi.CheckResponse(res); err != nil {
  7920. return nil, err
  7921. }
  7922. ret := &GetOrdersResponse{
  7923. ServerResponse: googleapi.ServerResponse{
  7924. Header: res.Header,
  7925. HTTPStatusCode: res.StatusCode,
  7926. },
  7927. }
  7928. target := &ret
  7929. if err := gensupport.DecodeResponse(target, res); err != nil {
  7930. return nil, err
  7931. }
  7932. return ret, nil
  7933. // {
  7934. // "description": "Search for proposals using pql query",
  7935. // "httpMethod": "GET",
  7936. // "id": "adexchangebuyer.proposals.search",
  7937. // "parameters": {
  7938. // "pqlQuery": {
  7939. // "description": "Query string to retrieve specific proposals.",
  7940. // "location": "query",
  7941. // "type": "string"
  7942. // }
  7943. // },
  7944. // "path": "proposals/search",
  7945. // "response": {
  7946. // "$ref": "GetOrdersResponse"
  7947. // },
  7948. // "scopes": [
  7949. // "https://www.googleapis.com/auth/adexchange.buyer"
  7950. // ]
  7951. // }
  7952. }
  7953. // method id "adexchangebuyer.proposals.setupcomplete":
  7954. type ProposalsSetupcompleteCall struct {
  7955. s *Service
  7956. proposalId string
  7957. urlParams_ gensupport.URLParams
  7958. ctx_ context.Context
  7959. header_ http.Header
  7960. }
  7961. // Setupcomplete: Update the given proposal to indicate that setup has
  7962. // been completed.
  7963. func (r *ProposalsService) Setupcomplete(proposalId string) *ProposalsSetupcompleteCall {
  7964. c := &ProposalsSetupcompleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7965. c.proposalId = proposalId
  7966. return c
  7967. }
  7968. // Fields allows partial responses to be retrieved. See
  7969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7970. // for more information.
  7971. func (c *ProposalsSetupcompleteCall) Fields(s ...googleapi.Field) *ProposalsSetupcompleteCall {
  7972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7973. return c
  7974. }
  7975. // Context sets the context to be used in this call's Do method. Any
  7976. // pending HTTP request will be aborted if the provided context is
  7977. // canceled.
  7978. func (c *ProposalsSetupcompleteCall) Context(ctx context.Context) *ProposalsSetupcompleteCall {
  7979. c.ctx_ = ctx
  7980. return c
  7981. }
  7982. // Header returns an http.Header that can be modified by the caller to
  7983. // add HTTP headers to the request.
  7984. func (c *ProposalsSetupcompleteCall) Header() http.Header {
  7985. if c.header_ == nil {
  7986. c.header_ = make(http.Header)
  7987. }
  7988. return c.header_
  7989. }
  7990. func (c *ProposalsSetupcompleteCall) doRequest(alt string) (*http.Response, error) {
  7991. reqHeaders := make(http.Header)
  7992. for k, v := range c.header_ {
  7993. reqHeaders[k] = v
  7994. }
  7995. reqHeaders.Set("User-Agent", c.s.userAgent())
  7996. var body io.Reader = nil
  7997. c.urlParams_.Set("alt", alt)
  7998. c.urlParams_.Set("prettyPrint", "false")
  7999. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/setupcomplete")
  8000. urls += "?" + c.urlParams_.Encode()
  8001. req, err := http.NewRequest("POST", urls, body)
  8002. if err != nil {
  8003. return nil, err
  8004. }
  8005. req.Header = reqHeaders
  8006. googleapi.Expand(req.URL, map[string]string{
  8007. "proposalId": c.proposalId,
  8008. })
  8009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8010. }
  8011. // Do executes the "adexchangebuyer.proposals.setupcomplete" call.
  8012. func (c *ProposalsSetupcompleteCall) Do(opts ...googleapi.CallOption) error {
  8013. gensupport.SetOptions(c.urlParams_, opts...)
  8014. res, err := c.doRequest("json")
  8015. if err != nil {
  8016. return err
  8017. }
  8018. defer googleapi.CloseBody(res)
  8019. if err := googleapi.CheckResponse(res); err != nil {
  8020. return err
  8021. }
  8022. return nil
  8023. // {
  8024. // "description": "Update the given proposal to indicate that setup has been completed.",
  8025. // "httpMethod": "POST",
  8026. // "id": "adexchangebuyer.proposals.setupcomplete",
  8027. // "parameterOrder": [
  8028. // "proposalId"
  8029. // ],
  8030. // "parameters": {
  8031. // "proposalId": {
  8032. // "description": "The proposal id for which the setup is complete",
  8033. // "location": "path",
  8034. // "required": true,
  8035. // "type": "string"
  8036. // }
  8037. // },
  8038. // "path": "proposals/{proposalId}/setupcomplete",
  8039. // "scopes": [
  8040. // "https://www.googleapis.com/auth/adexchange.buyer"
  8041. // ]
  8042. // }
  8043. }
  8044. // method id "adexchangebuyer.proposals.update":
  8045. type ProposalsUpdateCall struct {
  8046. s *Service
  8047. proposalId string
  8048. revisionNumber int64
  8049. updateAction string
  8050. proposal *Proposal
  8051. urlParams_ gensupport.URLParams
  8052. ctx_ context.Context
  8053. header_ http.Header
  8054. }
  8055. // Update: Update the given proposal
  8056. func (r *ProposalsService) Update(proposalId string, revisionNumber int64, updateAction string, proposal *Proposal) *ProposalsUpdateCall {
  8057. c := &ProposalsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8058. c.proposalId = proposalId
  8059. c.revisionNumber = revisionNumber
  8060. c.updateAction = updateAction
  8061. c.proposal = proposal
  8062. return c
  8063. }
  8064. // Fields allows partial responses to be retrieved. See
  8065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8066. // for more information.
  8067. func (c *ProposalsUpdateCall) Fields(s ...googleapi.Field) *ProposalsUpdateCall {
  8068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8069. return c
  8070. }
  8071. // Context sets the context to be used in this call's Do method. Any
  8072. // pending HTTP request will be aborted if the provided context is
  8073. // canceled.
  8074. func (c *ProposalsUpdateCall) Context(ctx context.Context) *ProposalsUpdateCall {
  8075. c.ctx_ = ctx
  8076. return c
  8077. }
  8078. // Header returns an http.Header that can be modified by the caller to
  8079. // add HTTP headers to the request.
  8080. func (c *ProposalsUpdateCall) Header() http.Header {
  8081. if c.header_ == nil {
  8082. c.header_ = make(http.Header)
  8083. }
  8084. return c.header_
  8085. }
  8086. func (c *ProposalsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8087. reqHeaders := make(http.Header)
  8088. for k, v := range c.header_ {
  8089. reqHeaders[k] = v
  8090. }
  8091. reqHeaders.Set("User-Agent", c.s.userAgent())
  8092. var body io.Reader = nil
  8093. body, err := googleapi.WithoutDataWrapper.JSONReader(c.proposal)
  8094. if err != nil {
  8095. return nil, err
  8096. }
  8097. reqHeaders.Set("Content-Type", "application/json")
  8098. c.urlParams_.Set("alt", alt)
  8099. c.urlParams_.Set("prettyPrint", "false")
  8100. urls := googleapi.ResolveRelative(c.s.BasePath, "proposals/{proposalId}/{revisionNumber}/{updateAction}")
  8101. urls += "?" + c.urlParams_.Encode()
  8102. req, err := http.NewRequest("PUT", urls, body)
  8103. if err != nil {
  8104. return nil, err
  8105. }
  8106. req.Header = reqHeaders
  8107. googleapi.Expand(req.URL, map[string]string{
  8108. "proposalId": c.proposalId,
  8109. "revisionNumber": strconv.FormatInt(c.revisionNumber, 10),
  8110. "updateAction": c.updateAction,
  8111. })
  8112. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8113. }
  8114. // Do executes the "adexchangebuyer.proposals.update" call.
  8115. // Exactly one of *Proposal or error will be non-nil. Any non-2xx status
  8116. // code is an error. Response headers are in either
  8117. // *Proposal.ServerResponse.Header or (if a response was returned at
  8118. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8119. // to check whether the returned error was because
  8120. // http.StatusNotModified was returned.
  8121. func (c *ProposalsUpdateCall) Do(opts ...googleapi.CallOption) (*Proposal, error) {
  8122. gensupport.SetOptions(c.urlParams_, opts...)
  8123. res, err := c.doRequest("json")
  8124. if res != nil && res.StatusCode == http.StatusNotModified {
  8125. if res.Body != nil {
  8126. res.Body.Close()
  8127. }
  8128. return nil, &googleapi.Error{
  8129. Code: res.StatusCode,
  8130. Header: res.Header,
  8131. }
  8132. }
  8133. if err != nil {
  8134. return nil, err
  8135. }
  8136. defer googleapi.CloseBody(res)
  8137. if err := googleapi.CheckResponse(res); err != nil {
  8138. return nil, err
  8139. }
  8140. ret := &Proposal{
  8141. ServerResponse: googleapi.ServerResponse{
  8142. Header: res.Header,
  8143. HTTPStatusCode: res.StatusCode,
  8144. },
  8145. }
  8146. target := &ret
  8147. if err := gensupport.DecodeResponse(target, res); err != nil {
  8148. return nil, err
  8149. }
  8150. return ret, nil
  8151. // {
  8152. // "description": "Update the given proposal",
  8153. // "httpMethod": "PUT",
  8154. // "id": "adexchangebuyer.proposals.update",
  8155. // "parameterOrder": [
  8156. // "proposalId",
  8157. // "revisionNumber",
  8158. // "updateAction"
  8159. // ],
  8160. // "parameters": {
  8161. // "proposalId": {
  8162. // "description": "The proposal id to update.",
  8163. // "location": "path",
  8164. // "required": true,
  8165. // "type": "string"
  8166. // },
  8167. // "revisionNumber": {
  8168. // "description": "The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision.",
  8169. // "format": "int64",
  8170. // "location": "path",
  8171. // "required": true,
  8172. // "type": "string"
  8173. // },
  8174. // "updateAction": {
  8175. // "description": "The proposed action to take on the proposal. This field is required and it must be set when updating a proposal.",
  8176. // "enum": [
  8177. // "accept",
  8178. // "cancel",
  8179. // "propose",
  8180. // "proposeAndAccept",
  8181. // "unknownAction",
  8182. // "updateNonTerms"
  8183. // ],
  8184. // "enumDescriptions": [
  8185. // "",
  8186. // "",
  8187. // "",
  8188. // "",
  8189. // "",
  8190. // ""
  8191. // ],
  8192. // "location": "path",
  8193. // "required": true,
  8194. // "type": "string"
  8195. // }
  8196. // },
  8197. // "path": "proposals/{proposalId}/{revisionNumber}/{updateAction}",
  8198. // "request": {
  8199. // "$ref": "Proposal"
  8200. // },
  8201. // "response": {
  8202. // "$ref": "Proposal"
  8203. // },
  8204. // "scopes": [
  8205. // "https://www.googleapis.com/auth/adexchange.buyer"
  8206. // ]
  8207. // }
  8208. }
  8209. // method id "adexchangebuyer.pubprofiles.list":
  8210. type PubprofilesListCall struct {
  8211. s *Service
  8212. accountId int64
  8213. urlParams_ gensupport.URLParams
  8214. ifNoneMatch_ string
  8215. ctx_ context.Context
  8216. header_ http.Header
  8217. }
  8218. // List: Gets the requested publisher profile(s) by publisher accountId.
  8219. func (r *PubprofilesService) List(accountId int64) *PubprofilesListCall {
  8220. c := &PubprofilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8221. c.accountId = accountId
  8222. return c
  8223. }
  8224. // Fields allows partial responses to be retrieved. See
  8225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8226. // for more information.
  8227. func (c *PubprofilesListCall) Fields(s ...googleapi.Field) *PubprofilesListCall {
  8228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8229. return c
  8230. }
  8231. // IfNoneMatch sets the optional parameter which makes the operation
  8232. // fail if the object's ETag matches the given value. This is useful for
  8233. // getting updates only after the object has changed since the last
  8234. // request. Use googleapi.IsNotModified to check whether the response
  8235. // error from Do is the result of In-None-Match.
  8236. func (c *PubprofilesListCall) IfNoneMatch(entityTag string) *PubprofilesListCall {
  8237. c.ifNoneMatch_ = entityTag
  8238. return c
  8239. }
  8240. // Context sets the context to be used in this call's Do method. Any
  8241. // pending HTTP request will be aborted if the provided context is
  8242. // canceled.
  8243. func (c *PubprofilesListCall) Context(ctx context.Context) *PubprofilesListCall {
  8244. c.ctx_ = ctx
  8245. return c
  8246. }
  8247. // Header returns an http.Header that can be modified by the caller to
  8248. // add HTTP headers to the request.
  8249. func (c *PubprofilesListCall) Header() http.Header {
  8250. if c.header_ == nil {
  8251. c.header_ = make(http.Header)
  8252. }
  8253. return c.header_
  8254. }
  8255. func (c *PubprofilesListCall) doRequest(alt string) (*http.Response, error) {
  8256. reqHeaders := make(http.Header)
  8257. for k, v := range c.header_ {
  8258. reqHeaders[k] = v
  8259. }
  8260. reqHeaders.Set("User-Agent", c.s.userAgent())
  8261. if c.ifNoneMatch_ != "" {
  8262. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8263. }
  8264. var body io.Reader = nil
  8265. c.urlParams_.Set("alt", alt)
  8266. c.urlParams_.Set("prettyPrint", "false")
  8267. urls := googleapi.ResolveRelative(c.s.BasePath, "publisher/{accountId}/profiles")
  8268. urls += "?" + c.urlParams_.Encode()
  8269. req, err := http.NewRequest("GET", urls, body)
  8270. if err != nil {
  8271. return nil, err
  8272. }
  8273. req.Header = reqHeaders
  8274. googleapi.Expand(req.URL, map[string]string{
  8275. "accountId": strconv.FormatInt(c.accountId, 10),
  8276. })
  8277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8278. }
  8279. // Do executes the "adexchangebuyer.pubprofiles.list" call.
  8280. // Exactly one of *GetPublisherProfilesByAccountIdResponse or error will
  8281. // be non-nil. Any non-2xx status code is an error. Response headers are
  8282. // in either
  8283. // *GetPublisherProfilesByAccountIdResponse.ServerResponse.Header or (if
  8284. // a response was returned at all) in error.(*googleapi.Error).Header.
  8285. // Use googleapi.IsNotModified to check whether the returned error was
  8286. // because http.StatusNotModified was returned.
  8287. func (c *PubprofilesListCall) Do(opts ...googleapi.CallOption) (*GetPublisherProfilesByAccountIdResponse, error) {
  8288. gensupport.SetOptions(c.urlParams_, opts...)
  8289. res, err := c.doRequest("json")
  8290. if res != nil && res.StatusCode == http.StatusNotModified {
  8291. if res.Body != nil {
  8292. res.Body.Close()
  8293. }
  8294. return nil, &googleapi.Error{
  8295. Code: res.StatusCode,
  8296. Header: res.Header,
  8297. }
  8298. }
  8299. if err != nil {
  8300. return nil, err
  8301. }
  8302. defer googleapi.CloseBody(res)
  8303. if err := googleapi.CheckResponse(res); err != nil {
  8304. return nil, err
  8305. }
  8306. ret := &GetPublisherProfilesByAccountIdResponse{
  8307. ServerResponse: googleapi.ServerResponse{
  8308. Header: res.Header,
  8309. HTTPStatusCode: res.StatusCode,
  8310. },
  8311. }
  8312. target := &ret
  8313. if err := gensupport.DecodeResponse(target, res); err != nil {
  8314. return nil, err
  8315. }
  8316. return ret, nil
  8317. // {
  8318. // "description": "Gets the requested publisher profile(s) by publisher accountId.",
  8319. // "httpMethod": "GET",
  8320. // "id": "adexchangebuyer.pubprofiles.list",
  8321. // "parameterOrder": [
  8322. // "accountId"
  8323. // ],
  8324. // "parameters": {
  8325. // "accountId": {
  8326. // "description": "The accountId of the publisher to get profiles for.",
  8327. // "format": "int32",
  8328. // "location": "path",
  8329. // "required": true,
  8330. // "type": "integer"
  8331. // }
  8332. // },
  8333. // "path": "publisher/{accountId}/profiles",
  8334. // "response": {
  8335. // "$ref": "GetPublisherProfilesByAccountIdResponse"
  8336. // },
  8337. // "scopes": [
  8338. // "https://www.googleapis.com/auth/adexchange.buyer"
  8339. // ]
  8340. // }
  8341. }