You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

9209 rivejä
328 KiB

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