Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

50819 wiersze
1.7 MiB

  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // AUTO-GENERATED CODE. DO NOT EDIT.
  5. // Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API.
  6. //
  7. // See https://developers.google.com/doubleclick-advertisers/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/dfareporting/v3.0"
  12. // ...
  13. // dfareportingService, err := dfareporting.New(oauthHttpClient)
  14. package dfareporting // import "google.golang.org/api/dfareporting/v3.0"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "dfareporting:v3.0"
  43. const apiName = "dfareporting"
  44. const apiVersion = "v3.0"
  45. const basePath = "https://www.googleapis.com/dfareporting/v3.0/"
  46. // OAuth2 scopes used by this API.
  47. const (
  48. // Manage DoubleClick Digital Marketing conversions
  49. DdmconversionsScope = "https://www.googleapis.com/auth/ddmconversions"
  50. // View and manage DoubleClick for Advertisers reports
  51. DfareportingScope = "https://www.googleapis.com/auth/dfareporting"
  52. // View and manage your DoubleClick Campaign Manager's (DCM) display ad
  53. // campaigns
  54. DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking"
  55. )
  56. func New(client *http.Client) (*Service, error) {
  57. if client == nil {
  58. return nil, errors.New("client is nil")
  59. }
  60. s := &Service{client: client, BasePath: basePath}
  61. s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s)
  62. s.AccountPermissionGroups = NewAccountPermissionGroupsService(s)
  63. s.AccountPermissions = NewAccountPermissionsService(s)
  64. s.AccountUserProfiles = NewAccountUserProfilesService(s)
  65. s.Accounts = NewAccountsService(s)
  66. s.Ads = NewAdsService(s)
  67. s.AdvertiserGroups = NewAdvertiserGroupsService(s)
  68. s.AdvertiserLandingPages = NewAdvertiserLandingPagesService(s)
  69. s.Advertisers = NewAdvertisersService(s)
  70. s.Browsers = NewBrowsersService(s)
  71. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  72. s.Campaigns = NewCampaignsService(s)
  73. s.ChangeLogs = NewChangeLogsService(s)
  74. s.Cities = NewCitiesService(s)
  75. s.ConnectionTypes = NewConnectionTypesService(s)
  76. s.ContentCategories = NewContentCategoriesService(s)
  77. s.Conversions = NewConversionsService(s)
  78. s.Countries = NewCountriesService(s)
  79. s.CreativeAssets = NewCreativeAssetsService(s)
  80. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  81. s.CreativeFields = NewCreativeFieldsService(s)
  82. s.CreativeGroups = NewCreativeGroupsService(s)
  83. s.Creatives = NewCreativesService(s)
  84. s.DimensionValues = NewDimensionValuesService(s)
  85. s.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  86. s.DirectorySites = NewDirectorySitesService(s)
  87. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  88. s.EventTags = NewEventTagsService(s)
  89. s.Files = NewFilesService(s)
  90. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  91. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  92. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  93. s.InventoryItems = NewInventoryItemsService(s)
  94. s.Languages = NewLanguagesService(s)
  95. s.Metros = NewMetrosService(s)
  96. s.MobileCarriers = NewMobileCarriersService(s)
  97. s.OperatingSystemVersions = NewOperatingSystemVersionsService(s)
  98. s.OperatingSystems = NewOperatingSystemsService(s)
  99. s.OrderDocuments = NewOrderDocumentsService(s)
  100. s.Orders = NewOrdersService(s)
  101. s.PlacementGroups = NewPlacementGroupsService(s)
  102. s.PlacementStrategies = NewPlacementStrategiesService(s)
  103. s.Placements = NewPlacementsService(s)
  104. s.PlatformTypes = NewPlatformTypesService(s)
  105. s.PostalCodes = NewPostalCodesService(s)
  106. s.Projects = NewProjectsService(s)
  107. s.Regions = NewRegionsService(s)
  108. s.RemarketingListShares = NewRemarketingListSharesService(s)
  109. s.RemarketingLists = NewRemarketingListsService(s)
  110. s.Reports = NewReportsService(s)
  111. s.Sites = NewSitesService(s)
  112. s.Sizes = NewSizesService(s)
  113. s.Subaccounts = NewSubaccountsService(s)
  114. s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s)
  115. s.TargetingTemplates = NewTargetingTemplatesService(s)
  116. s.UserProfiles = NewUserProfilesService(s)
  117. s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s)
  118. s.UserRolePermissions = NewUserRolePermissionsService(s)
  119. s.UserRoles = NewUserRolesService(s)
  120. s.VideoFormats = NewVideoFormatsService(s)
  121. return s, nil
  122. }
  123. type Service struct {
  124. client *http.Client
  125. BasePath string // API endpoint base URL
  126. UserAgent string // optional additional User-Agent fragment
  127. AccountActiveAdSummaries *AccountActiveAdSummariesService
  128. AccountPermissionGroups *AccountPermissionGroupsService
  129. AccountPermissions *AccountPermissionsService
  130. AccountUserProfiles *AccountUserProfilesService
  131. Accounts *AccountsService
  132. Ads *AdsService
  133. AdvertiserGroups *AdvertiserGroupsService
  134. AdvertiserLandingPages *AdvertiserLandingPagesService
  135. Advertisers *AdvertisersService
  136. Browsers *BrowsersService
  137. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  138. Campaigns *CampaignsService
  139. ChangeLogs *ChangeLogsService
  140. Cities *CitiesService
  141. ConnectionTypes *ConnectionTypesService
  142. ContentCategories *ContentCategoriesService
  143. Conversions *ConversionsService
  144. Countries *CountriesService
  145. CreativeAssets *CreativeAssetsService
  146. CreativeFieldValues *CreativeFieldValuesService
  147. CreativeFields *CreativeFieldsService
  148. CreativeGroups *CreativeGroupsService
  149. Creatives *CreativesService
  150. DimensionValues *DimensionValuesService
  151. DirectorySiteContacts *DirectorySiteContactsService
  152. DirectorySites *DirectorySitesService
  153. DynamicTargetingKeys *DynamicTargetingKeysService
  154. EventTags *EventTagsService
  155. Files *FilesService
  156. FloodlightActivities *FloodlightActivitiesService
  157. FloodlightActivityGroups *FloodlightActivityGroupsService
  158. FloodlightConfigurations *FloodlightConfigurationsService
  159. InventoryItems *InventoryItemsService
  160. Languages *LanguagesService
  161. Metros *MetrosService
  162. MobileCarriers *MobileCarriersService
  163. OperatingSystemVersions *OperatingSystemVersionsService
  164. OperatingSystems *OperatingSystemsService
  165. OrderDocuments *OrderDocumentsService
  166. Orders *OrdersService
  167. PlacementGroups *PlacementGroupsService
  168. PlacementStrategies *PlacementStrategiesService
  169. Placements *PlacementsService
  170. PlatformTypes *PlatformTypesService
  171. PostalCodes *PostalCodesService
  172. Projects *ProjectsService
  173. Regions *RegionsService
  174. RemarketingListShares *RemarketingListSharesService
  175. RemarketingLists *RemarketingListsService
  176. Reports *ReportsService
  177. Sites *SitesService
  178. Sizes *SizesService
  179. Subaccounts *SubaccountsService
  180. TargetableRemarketingLists *TargetableRemarketingListsService
  181. TargetingTemplates *TargetingTemplatesService
  182. UserProfiles *UserProfilesService
  183. UserRolePermissionGroups *UserRolePermissionGroupsService
  184. UserRolePermissions *UserRolePermissionsService
  185. UserRoles *UserRolesService
  186. VideoFormats *VideoFormatsService
  187. }
  188. func (s *Service) userAgent() string {
  189. if s.UserAgent == "" {
  190. return googleapi.UserAgent
  191. }
  192. return googleapi.UserAgent + " " + s.UserAgent
  193. }
  194. func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService {
  195. rs := &AccountActiveAdSummariesService{s: s}
  196. return rs
  197. }
  198. type AccountActiveAdSummariesService struct {
  199. s *Service
  200. }
  201. func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService {
  202. rs := &AccountPermissionGroupsService{s: s}
  203. return rs
  204. }
  205. type AccountPermissionGroupsService struct {
  206. s *Service
  207. }
  208. func NewAccountPermissionsService(s *Service) *AccountPermissionsService {
  209. rs := &AccountPermissionsService{s: s}
  210. return rs
  211. }
  212. type AccountPermissionsService struct {
  213. s *Service
  214. }
  215. func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService {
  216. rs := &AccountUserProfilesService{s: s}
  217. return rs
  218. }
  219. type AccountUserProfilesService struct {
  220. s *Service
  221. }
  222. func NewAccountsService(s *Service) *AccountsService {
  223. rs := &AccountsService{s: s}
  224. return rs
  225. }
  226. type AccountsService struct {
  227. s *Service
  228. }
  229. func NewAdsService(s *Service) *AdsService {
  230. rs := &AdsService{s: s}
  231. return rs
  232. }
  233. type AdsService struct {
  234. s *Service
  235. }
  236. func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService {
  237. rs := &AdvertiserGroupsService{s: s}
  238. return rs
  239. }
  240. type AdvertiserGroupsService struct {
  241. s *Service
  242. }
  243. func NewAdvertiserLandingPagesService(s *Service) *AdvertiserLandingPagesService {
  244. rs := &AdvertiserLandingPagesService{s: s}
  245. return rs
  246. }
  247. type AdvertiserLandingPagesService struct {
  248. s *Service
  249. }
  250. func NewAdvertisersService(s *Service) *AdvertisersService {
  251. rs := &AdvertisersService{s: s}
  252. return rs
  253. }
  254. type AdvertisersService struct {
  255. s *Service
  256. }
  257. func NewBrowsersService(s *Service) *BrowsersService {
  258. rs := &BrowsersService{s: s}
  259. return rs
  260. }
  261. type BrowsersService struct {
  262. s *Service
  263. }
  264. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  265. rs := &CampaignCreativeAssociationsService{s: s}
  266. return rs
  267. }
  268. type CampaignCreativeAssociationsService struct {
  269. s *Service
  270. }
  271. func NewCampaignsService(s *Service) *CampaignsService {
  272. rs := &CampaignsService{s: s}
  273. return rs
  274. }
  275. type CampaignsService struct {
  276. s *Service
  277. }
  278. func NewChangeLogsService(s *Service) *ChangeLogsService {
  279. rs := &ChangeLogsService{s: s}
  280. return rs
  281. }
  282. type ChangeLogsService struct {
  283. s *Service
  284. }
  285. func NewCitiesService(s *Service) *CitiesService {
  286. rs := &CitiesService{s: s}
  287. return rs
  288. }
  289. type CitiesService struct {
  290. s *Service
  291. }
  292. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  293. rs := &ConnectionTypesService{s: s}
  294. return rs
  295. }
  296. type ConnectionTypesService struct {
  297. s *Service
  298. }
  299. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  300. rs := &ContentCategoriesService{s: s}
  301. return rs
  302. }
  303. type ContentCategoriesService struct {
  304. s *Service
  305. }
  306. func NewConversionsService(s *Service) *ConversionsService {
  307. rs := &ConversionsService{s: s}
  308. return rs
  309. }
  310. type ConversionsService struct {
  311. s *Service
  312. }
  313. func NewCountriesService(s *Service) *CountriesService {
  314. rs := &CountriesService{s: s}
  315. return rs
  316. }
  317. type CountriesService struct {
  318. s *Service
  319. }
  320. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  321. rs := &CreativeAssetsService{s: s}
  322. return rs
  323. }
  324. type CreativeAssetsService struct {
  325. s *Service
  326. }
  327. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  328. rs := &CreativeFieldValuesService{s: s}
  329. return rs
  330. }
  331. type CreativeFieldValuesService struct {
  332. s *Service
  333. }
  334. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  335. rs := &CreativeFieldsService{s: s}
  336. return rs
  337. }
  338. type CreativeFieldsService struct {
  339. s *Service
  340. }
  341. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  342. rs := &CreativeGroupsService{s: s}
  343. return rs
  344. }
  345. type CreativeGroupsService struct {
  346. s *Service
  347. }
  348. func NewCreativesService(s *Service) *CreativesService {
  349. rs := &CreativesService{s: s}
  350. return rs
  351. }
  352. type CreativesService struct {
  353. s *Service
  354. }
  355. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  356. rs := &DimensionValuesService{s: s}
  357. return rs
  358. }
  359. type DimensionValuesService struct {
  360. s *Service
  361. }
  362. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  363. rs := &DirectorySiteContactsService{s: s}
  364. return rs
  365. }
  366. type DirectorySiteContactsService struct {
  367. s *Service
  368. }
  369. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  370. rs := &DirectorySitesService{s: s}
  371. return rs
  372. }
  373. type DirectorySitesService struct {
  374. s *Service
  375. }
  376. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  377. rs := &DynamicTargetingKeysService{s: s}
  378. return rs
  379. }
  380. type DynamicTargetingKeysService struct {
  381. s *Service
  382. }
  383. func NewEventTagsService(s *Service) *EventTagsService {
  384. rs := &EventTagsService{s: s}
  385. return rs
  386. }
  387. type EventTagsService struct {
  388. s *Service
  389. }
  390. func NewFilesService(s *Service) *FilesService {
  391. rs := &FilesService{s: s}
  392. return rs
  393. }
  394. type FilesService struct {
  395. s *Service
  396. }
  397. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  398. rs := &FloodlightActivitiesService{s: s}
  399. return rs
  400. }
  401. type FloodlightActivitiesService struct {
  402. s *Service
  403. }
  404. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  405. rs := &FloodlightActivityGroupsService{s: s}
  406. return rs
  407. }
  408. type FloodlightActivityGroupsService struct {
  409. s *Service
  410. }
  411. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  412. rs := &FloodlightConfigurationsService{s: s}
  413. return rs
  414. }
  415. type FloodlightConfigurationsService struct {
  416. s *Service
  417. }
  418. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  419. rs := &InventoryItemsService{s: s}
  420. return rs
  421. }
  422. type InventoryItemsService struct {
  423. s *Service
  424. }
  425. func NewLanguagesService(s *Service) *LanguagesService {
  426. rs := &LanguagesService{s: s}
  427. return rs
  428. }
  429. type LanguagesService struct {
  430. s *Service
  431. }
  432. func NewMetrosService(s *Service) *MetrosService {
  433. rs := &MetrosService{s: s}
  434. return rs
  435. }
  436. type MetrosService struct {
  437. s *Service
  438. }
  439. func NewMobileCarriersService(s *Service) *MobileCarriersService {
  440. rs := &MobileCarriersService{s: s}
  441. return rs
  442. }
  443. type MobileCarriersService struct {
  444. s *Service
  445. }
  446. func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService {
  447. rs := &OperatingSystemVersionsService{s: s}
  448. return rs
  449. }
  450. type OperatingSystemVersionsService struct {
  451. s *Service
  452. }
  453. func NewOperatingSystemsService(s *Service) *OperatingSystemsService {
  454. rs := &OperatingSystemsService{s: s}
  455. return rs
  456. }
  457. type OperatingSystemsService struct {
  458. s *Service
  459. }
  460. func NewOrderDocumentsService(s *Service) *OrderDocumentsService {
  461. rs := &OrderDocumentsService{s: s}
  462. return rs
  463. }
  464. type OrderDocumentsService struct {
  465. s *Service
  466. }
  467. func NewOrdersService(s *Service) *OrdersService {
  468. rs := &OrdersService{s: s}
  469. return rs
  470. }
  471. type OrdersService struct {
  472. s *Service
  473. }
  474. func NewPlacementGroupsService(s *Service) *PlacementGroupsService {
  475. rs := &PlacementGroupsService{s: s}
  476. return rs
  477. }
  478. type PlacementGroupsService struct {
  479. s *Service
  480. }
  481. func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService {
  482. rs := &PlacementStrategiesService{s: s}
  483. return rs
  484. }
  485. type PlacementStrategiesService struct {
  486. s *Service
  487. }
  488. func NewPlacementsService(s *Service) *PlacementsService {
  489. rs := &PlacementsService{s: s}
  490. return rs
  491. }
  492. type PlacementsService struct {
  493. s *Service
  494. }
  495. func NewPlatformTypesService(s *Service) *PlatformTypesService {
  496. rs := &PlatformTypesService{s: s}
  497. return rs
  498. }
  499. type PlatformTypesService struct {
  500. s *Service
  501. }
  502. func NewPostalCodesService(s *Service) *PostalCodesService {
  503. rs := &PostalCodesService{s: s}
  504. return rs
  505. }
  506. type PostalCodesService struct {
  507. s *Service
  508. }
  509. func NewProjectsService(s *Service) *ProjectsService {
  510. rs := &ProjectsService{s: s}
  511. return rs
  512. }
  513. type ProjectsService struct {
  514. s *Service
  515. }
  516. func NewRegionsService(s *Service) *RegionsService {
  517. rs := &RegionsService{s: s}
  518. return rs
  519. }
  520. type RegionsService struct {
  521. s *Service
  522. }
  523. func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService {
  524. rs := &RemarketingListSharesService{s: s}
  525. return rs
  526. }
  527. type RemarketingListSharesService struct {
  528. s *Service
  529. }
  530. func NewRemarketingListsService(s *Service) *RemarketingListsService {
  531. rs := &RemarketingListsService{s: s}
  532. return rs
  533. }
  534. type RemarketingListsService struct {
  535. s *Service
  536. }
  537. func NewReportsService(s *Service) *ReportsService {
  538. rs := &ReportsService{s: s}
  539. rs.CompatibleFields = NewReportsCompatibleFieldsService(s)
  540. rs.Files = NewReportsFilesService(s)
  541. return rs
  542. }
  543. type ReportsService struct {
  544. s *Service
  545. CompatibleFields *ReportsCompatibleFieldsService
  546. Files *ReportsFilesService
  547. }
  548. func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService {
  549. rs := &ReportsCompatibleFieldsService{s: s}
  550. return rs
  551. }
  552. type ReportsCompatibleFieldsService struct {
  553. s *Service
  554. }
  555. func NewReportsFilesService(s *Service) *ReportsFilesService {
  556. rs := &ReportsFilesService{s: s}
  557. return rs
  558. }
  559. type ReportsFilesService struct {
  560. s *Service
  561. }
  562. func NewSitesService(s *Service) *SitesService {
  563. rs := &SitesService{s: s}
  564. return rs
  565. }
  566. type SitesService struct {
  567. s *Service
  568. }
  569. func NewSizesService(s *Service) *SizesService {
  570. rs := &SizesService{s: s}
  571. return rs
  572. }
  573. type SizesService struct {
  574. s *Service
  575. }
  576. func NewSubaccountsService(s *Service) *SubaccountsService {
  577. rs := &SubaccountsService{s: s}
  578. return rs
  579. }
  580. type SubaccountsService struct {
  581. s *Service
  582. }
  583. func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService {
  584. rs := &TargetableRemarketingListsService{s: s}
  585. return rs
  586. }
  587. type TargetableRemarketingListsService struct {
  588. s *Service
  589. }
  590. func NewTargetingTemplatesService(s *Service) *TargetingTemplatesService {
  591. rs := &TargetingTemplatesService{s: s}
  592. return rs
  593. }
  594. type TargetingTemplatesService struct {
  595. s *Service
  596. }
  597. func NewUserProfilesService(s *Service) *UserProfilesService {
  598. rs := &UserProfilesService{s: s}
  599. return rs
  600. }
  601. type UserProfilesService struct {
  602. s *Service
  603. }
  604. func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService {
  605. rs := &UserRolePermissionGroupsService{s: s}
  606. return rs
  607. }
  608. type UserRolePermissionGroupsService struct {
  609. s *Service
  610. }
  611. func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService {
  612. rs := &UserRolePermissionsService{s: s}
  613. return rs
  614. }
  615. type UserRolePermissionsService struct {
  616. s *Service
  617. }
  618. func NewUserRolesService(s *Service) *UserRolesService {
  619. rs := &UserRolesService{s: s}
  620. return rs
  621. }
  622. type UserRolesService struct {
  623. s *Service
  624. }
  625. func NewVideoFormatsService(s *Service) *VideoFormatsService {
  626. rs := &VideoFormatsService{s: s}
  627. return rs
  628. }
  629. type VideoFormatsService struct {
  630. s *Service
  631. }
  632. // Account: Contains properties of a Campaign Manager account.
  633. type Account struct {
  634. // AccountPermissionIds: Account permissions assigned to this account.
  635. AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"`
  636. // AccountProfile: Profile for this account. This is a read-only field
  637. // that can be left blank.
  638. //
  639. // Possible values:
  640. // "ACCOUNT_PROFILE_BASIC"
  641. // "ACCOUNT_PROFILE_STANDARD"
  642. AccountProfile string `json:"accountProfile,omitempty"`
  643. // Active: Whether this account is active.
  644. Active bool `json:"active,omitempty"`
  645. // ActiveAdsLimitTier: Maximum number of active ads allowed for this
  646. // account.
  647. //
  648. // Possible values:
  649. // "ACTIVE_ADS_TIER_100K"
  650. // "ACTIVE_ADS_TIER_1M"
  651. // "ACTIVE_ADS_TIER_200K"
  652. // "ACTIVE_ADS_TIER_300K"
  653. // "ACTIVE_ADS_TIER_40K"
  654. // "ACTIVE_ADS_TIER_500K"
  655. // "ACTIVE_ADS_TIER_750K"
  656. // "ACTIVE_ADS_TIER_75K"
  657. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  658. // ActiveViewOptOut: Whether to serve creatives with Active View tags.
  659. // If disabled, viewability data will not be available for any
  660. // impressions.
  661. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  662. // AvailablePermissionIds: User role permissions available to the user
  663. // roles of this account.
  664. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  665. // CountryId: ID of the country associated with this account.
  666. CountryId int64 `json:"countryId,omitempty,string"`
  667. // CurrencyId: ID of currency associated with this account. This is a
  668. // required field.
  669. // Acceptable values are:
  670. // - "1" for USD
  671. // - "2" for GBP
  672. // - "3" for ESP
  673. // - "4" for SEK
  674. // - "5" for CAD
  675. // - "6" for JPY
  676. // - "7" for DEM
  677. // - "8" for AUD
  678. // - "9" for FRF
  679. // - "10" for ITL
  680. // - "11" for DKK
  681. // - "12" for NOK
  682. // - "13" for FIM
  683. // - "14" for ZAR
  684. // - "15" for IEP
  685. // - "16" for NLG
  686. // - "17" for EUR
  687. // - "18" for KRW
  688. // - "19" for TWD
  689. // - "20" for SGD
  690. // - "21" for CNY
  691. // - "22" for HKD
  692. // - "23" for NZD
  693. // - "24" for MYR
  694. // - "25" for BRL
  695. // - "26" for PTE
  696. // - "27" for MXP
  697. // - "28" for CLP
  698. // - "29" for TRY
  699. // - "30" for ARS
  700. // - "31" for PEN
  701. // - "32" for ILS
  702. // - "33" for CHF
  703. // - "34" for VEF
  704. // - "35" for COP
  705. // - "36" for GTQ
  706. // - "37" for PLN
  707. // - "39" for INR
  708. // - "40" for THB
  709. // - "41" for IDR
  710. // - "42" for CZK
  711. // - "43" for RON
  712. // - "44" for HUF
  713. // - "45" for RUB
  714. // - "46" for AED
  715. // - "47" for BGN
  716. // - "48" for HRK
  717. // - "49" for MXN
  718. // - "50" for NGN
  719. CurrencyId int64 `json:"currencyId,omitempty,string"`
  720. // DefaultCreativeSizeId: Default placement dimensions for this account.
  721. DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"`
  722. // Description: Description of this account.
  723. Description string `json:"description,omitempty"`
  724. // Id: ID of this account. This is a read-only, auto-generated field.
  725. Id int64 `json:"id,omitempty,string"`
  726. // Kind: Identifies what kind of resource this is. Value: the fixed
  727. // string "dfareporting#account".
  728. Kind string `json:"kind,omitempty"`
  729. // Locale: Locale of this account.
  730. // Acceptable values are:
  731. // - "cs" (Czech)
  732. // - "de" (German)
  733. // - "en" (English)
  734. // - "en-GB" (English United Kingdom)
  735. // - "es" (Spanish)
  736. // - "fr" (French)
  737. // - "it" (Italian)
  738. // - "ja" (Japanese)
  739. // - "ko" (Korean)
  740. // - "pl" (Polish)
  741. // - "pt-BR" (Portuguese Brazil)
  742. // - "ru" (Russian)
  743. // - "sv" (Swedish)
  744. // - "tr" (Turkish)
  745. // - "zh-CN" (Chinese Simplified)
  746. // - "zh-TW" (Chinese Traditional)
  747. Locale string `json:"locale,omitempty"`
  748. // MaximumImageSize: Maximum image size allowed for this account, in
  749. // kilobytes. Value must be greater than or equal to 1.
  750. MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"`
  751. // Name: Name of this account. This is a required field, and must be
  752. // less than 128 characters long and be globally unique.
  753. Name string `json:"name,omitempty"`
  754. // NielsenOcrEnabled: Whether campaigns created in this account will be
  755. // enabled for Nielsen OCR reach ratings by default.
  756. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  757. // ReportsConfiguration: Reporting configuration of this account.
  758. ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"`
  759. // ShareReportsWithTwitter: Share Path to Conversion reports with
  760. // Twitter.
  761. ShareReportsWithTwitter bool `json:"shareReportsWithTwitter,omitempty"`
  762. // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser
  763. // creatives. Acceptable values are 1 to 10240, inclusive.
  764. TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"`
  765. // ServerResponse contains the HTTP response code and headers from the
  766. // server.
  767. googleapi.ServerResponse `json:"-"`
  768. // ForceSendFields is a list of field names (e.g.
  769. // "AccountPermissionIds") to unconditionally include in API requests.
  770. // By default, fields with empty values are omitted from API requests.
  771. // However, any non-pointer, non-interface field appearing in
  772. // ForceSendFields will be sent to the server regardless of whether the
  773. // field is empty or not. This may be used to include empty fields in
  774. // Patch requests.
  775. ForceSendFields []string `json:"-"`
  776. // NullFields is a list of field names (e.g. "AccountPermissionIds") to
  777. // include in API requests with the JSON null value. By default, fields
  778. // with empty values are omitted from API requests. However, any field
  779. // with an empty value appearing in NullFields will be sent to the
  780. // server as null. It is an error if a field in this list has a
  781. // non-empty value. This may be used to include null fields in Patch
  782. // requests.
  783. NullFields []string `json:"-"`
  784. }
  785. func (s *Account) MarshalJSON() ([]byte, error) {
  786. type NoMethod Account
  787. raw := NoMethod(*s)
  788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  789. }
  790. // AccountActiveAdSummary: Gets a summary of active ads in an account.
  791. type AccountActiveAdSummary struct {
  792. // AccountId: ID of the account.
  793. AccountId int64 `json:"accountId,omitempty,string"`
  794. // ActiveAds: Ads that have been activated for the account
  795. ActiveAds int64 `json:"activeAds,omitempty,string"`
  796. // ActiveAdsLimitTier: Maximum number of active ads allowed for the
  797. // account.
  798. //
  799. // Possible values:
  800. // "ACTIVE_ADS_TIER_100K"
  801. // "ACTIVE_ADS_TIER_1M"
  802. // "ACTIVE_ADS_TIER_200K"
  803. // "ACTIVE_ADS_TIER_300K"
  804. // "ACTIVE_ADS_TIER_40K"
  805. // "ACTIVE_ADS_TIER_500K"
  806. // "ACTIVE_ADS_TIER_750K"
  807. // "ACTIVE_ADS_TIER_75K"
  808. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  809. // AvailableAds: Ads that can be activated for the account.
  810. AvailableAds int64 `json:"availableAds,omitempty,string"`
  811. // Kind: Identifies what kind of resource this is. Value: the fixed
  812. // string "dfareporting#accountActiveAdSummary".
  813. Kind string `json:"kind,omitempty"`
  814. // ServerResponse contains the HTTP response code and headers from the
  815. // server.
  816. googleapi.ServerResponse `json:"-"`
  817. // ForceSendFields is a list of field names (e.g. "AccountId") to
  818. // unconditionally include in API requests. By default, fields with
  819. // empty values are omitted from API requests. However, any non-pointer,
  820. // non-interface field appearing in ForceSendFields will be sent to the
  821. // server regardless of whether the field is empty or not. This may be
  822. // used to include empty fields in Patch requests.
  823. ForceSendFields []string `json:"-"`
  824. // NullFields is a list of field names (e.g. "AccountId") to include in
  825. // API requests with the JSON null value. By default, fields with empty
  826. // values are omitted from API requests. However, any field with an
  827. // empty value appearing in NullFields will be sent to the server as
  828. // null. It is an error if a field in this list has a non-empty value.
  829. // This may be used to include null fields in Patch requests.
  830. NullFields []string `json:"-"`
  831. }
  832. func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) {
  833. type NoMethod AccountActiveAdSummary
  834. raw := NoMethod(*s)
  835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  836. }
  837. // AccountPermission: AccountPermissions contains information about a
  838. // particular account permission. Some features of Campaign Manager
  839. // require an account permission to be present in the account.
  840. type AccountPermission struct {
  841. // AccountProfiles: Account profiles associated with this account
  842. // permission.
  843. //
  844. // Possible values are:
  845. // - "ACCOUNT_PROFILE_BASIC"
  846. // - "ACCOUNT_PROFILE_STANDARD"
  847. //
  848. // Possible values:
  849. // "ACCOUNT_PROFILE_BASIC"
  850. // "ACCOUNT_PROFILE_STANDARD"
  851. AccountProfiles []string `json:"accountProfiles,omitempty"`
  852. // Id: ID of this account permission.
  853. Id int64 `json:"id,omitempty,string"`
  854. // Kind: Identifies what kind of resource this is. Value: the fixed
  855. // string "dfareporting#accountPermission".
  856. Kind string `json:"kind,omitempty"`
  857. // Level: Administrative level required to enable this account
  858. // permission.
  859. //
  860. // Possible values:
  861. // "ADMINISTRATOR"
  862. // "USER"
  863. Level string `json:"level,omitempty"`
  864. // Name: Name of this account permission.
  865. Name string `json:"name,omitempty"`
  866. // PermissionGroupId: Permission group of this account permission.
  867. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  868. // ServerResponse contains the HTTP response code and headers from the
  869. // server.
  870. googleapi.ServerResponse `json:"-"`
  871. // ForceSendFields is a list of field names (e.g. "AccountProfiles") to
  872. // unconditionally include in API requests. By default, fields with
  873. // empty values are omitted from API requests. However, any non-pointer,
  874. // non-interface field appearing in ForceSendFields will be sent to the
  875. // server regardless of whether the field is empty or not. This may be
  876. // used to include empty fields in Patch requests.
  877. ForceSendFields []string `json:"-"`
  878. // NullFields is a list of field names (e.g. "AccountProfiles") to
  879. // include in API requests with the JSON null value. By default, fields
  880. // with empty values are omitted from API requests. However, any field
  881. // with an empty value appearing in NullFields will be sent to the
  882. // server as null. It is an error if a field in this list has a
  883. // non-empty value. This may be used to include null fields in Patch
  884. // requests.
  885. NullFields []string `json:"-"`
  886. }
  887. func (s *AccountPermission) MarshalJSON() ([]byte, error) {
  888. type NoMethod AccountPermission
  889. raw := NoMethod(*s)
  890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  891. }
  892. // AccountPermissionGroup: AccountPermissionGroups contains a mapping of
  893. // permission group IDs to names. A permission group is a grouping of
  894. // account permissions.
  895. type AccountPermissionGroup struct {
  896. // Id: ID of this account permission group.
  897. Id int64 `json:"id,omitempty,string"`
  898. // Kind: Identifies what kind of resource this is. Value: the fixed
  899. // string "dfareporting#accountPermissionGroup".
  900. Kind string `json:"kind,omitempty"`
  901. // Name: Name of this account permission group.
  902. Name string `json:"name,omitempty"`
  903. // ServerResponse contains the HTTP response code and headers from the
  904. // server.
  905. googleapi.ServerResponse `json:"-"`
  906. // ForceSendFields is a list of field names (e.g. "Id") 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. "Id") to include in API
  914. // 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 *AccountPermissionGroup) MarshalJSON() ([]byte, error) {
  922. type NoMethod AccountPermissionGroup
  923. raw := NoMethod(*s)
  924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  925. }
  926. // AccountPermissionGroupsListResponse: Account Permission Group List
  927. // Response
  928. type AccountPermissionGroupsListResponse struct {
  929. // AccountPermissionGroups: Account permission group collection.
  930. AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"`
  931. // Kind: Identifies what kind of resource this is. Value: the fixed
  932. // string "dfareporting#accountPermissionGroupsListResponse".
  933. Kind string `json:"kind,omitempty"`
  934. // ServerResponse contains the HTTP response code and headers from the
  935. // server.
  936. googleapi.ServerResponse `json:"-"`
  937. // ForceSendFields is a list of field names (e.g.
  938. // "AccountPermissionGroups") to unconditionally include in API
  939. // requests. By default, fields with empty values are omitted from API
  940. // requests. However, any non-pointer, non-interface field appearing in
  941. // ForceSendFields will be sent to the server regardless of whether the
  942. // field is empty or not. This may be used to include empty fields in
  943. // Patch requests.
  944. ForceSendFields []string `json:"-"`
  945. // NullFields is a list of field names (e.g. "AccountPermissionGroups")
  946. // to include in API requests with the JSON null value. By default,
  947. // fields with empty values are omitted from API requests. However, any
  948. // field with an empty value appearing in NullFields will be sent to the
  949. // server as null. It is an error if a field in this list has a
  950. // non-empty value. This may be used to include null fields in Patch
  951. // requests.
  952. NullFields []string `json:"-"`
  953. }
  954. func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  955. type NoMethod AccountPermissionGroupsListResponse
  956. raw := NoMethod(*s)
  957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  958. }
  959. // AccountPermissionsListResponse: Account Permission List Response
  960. type AccountPermissionsListResponse struct {
  961. // AccountPermissions: Account permission collection.
  962. AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"`
  963. // Kind: Identifies what kind of resource this is. Value: the fixed
  964. // string "dfareporting#accountPermissionsListResponse".
  965. Kind string `json:"kind,omitempty"`
  966. // ServerResponse contains the HTTP response code and headers from the
  967. // server.
  968. googleapi.ServerResponse `json:"-"`
  969. // ForceSendFields is a list of field names (e.g. "AccountPermissions")
  970. // to 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. "AccountPermissions") to
  977. // include in API requests with the JSON null value. By default, fields
  978. // with empty values are omitted from API requests. However, any field
  979. // with an empty value appearing in NullFields will be sent to the
  980. // server as null. It is an error if a field in this list has a
  981. // non-empty value. This may be used to include null fields in Patch
  982. // requests.
  983. NullFields []string `json:"-"`
  984. }
  985. func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) {
  986. type NoMethod AccountPermissionsListResponse
  987. raw := NoMethod(*s)
  988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  989. }
  990. // AccountUserProfile: AccountUserProfiles contains properties of a
  991. // Campaign Manager user profile. This resource is specifically for
  992. // managing user profiles, whereas UserProfiles is for accessing the
  993. // API.
  994. type AccountUserProfile struct {
  995. // AccountId: Account ID of the user profile. This is a read-only field
  996. // that can be left blank.
  997. AccountId int64 `json:"accountId,omitempty,string"`
  998. // Active: Whether this user profile is active. This defaults to false,
  999. // and must be set true on insert for the user profile to be usable.
  1000. Active bool `json:"active,omitempty"`
  1001. // AdvertiserFilter: Filter that describes which advertisers are visible
  1002. // to the user profile.
  1003. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1004. // CampaignFilter: Filter that describes which campaigns are visible to
  1005. // the user profile.
  1006. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1007. // Comments: Comments for this user profile.
  1008. Comments string `json:"comments,omitempty"`
  1009. // Email: Email of the user profile. The email addresss must be linked
  1010. // to a Google Account. This field is required on insertion and is
  1011. // read-only after insertion.
  1012. Email string `json:"email,omitempty"`
  1013. // Id: ID of the user profile. This is a read-only, auto-generated
  1014. // field.
  1015. Id int64 `json:"id,omitempty,string"`
  1016. // Kind: Identifies what kind of resource this is. Value: the fixed
  1017. // string "dfareporting#accountUserProfile".
  1018. Kind string `json:"kind,omitempty"`
  1019. // Locale: Locale of the user profile. This is a required
  1020. // field.
  1021. // Acceptable values are:
  1022. // - "cs" (Czech)
  1023. // - "de" (German)
  1024. // - "en" (English)
  1025. // - "en-GB" (English United Kingdom)
  1026. // - "es" (Spanish)
  1027. // - "fr" (French)
  1028. // - "it" (Italian)
  1029. // - "ja" (Japanese)
  1030. // - "ko" (Korean)
  1031. // - "pl" (Polish)
  1032. // - "pt-BR" (Portuguese Brazil)
  1033. // - "ru" (Russian)
  1034. // - "sv" (Swedish)
  1035. // - "tr" (Turkish)
  1036. // - "zh-CN" (Chinese Simplified)
  1037. // - "zh-TW" (Chinese Traditional)
  1038. Locale string `json:"locale,omitempty"`
  1039. // Name: Name of the user profile. This is a required field. Must be
  1040. // less than 64 characters long, must be globally unique, and cannot
  1041. // contain whitespace or any of the following characters: "&;"#%,".
  1042. Name string `json:"name,omitempty"`
  1043. // SiteFilter: Filter that describes which sites are visible to the user
  1044. // profile.
  1045. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1046. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1047. // field that can be left blank.
  1048. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1049. // TraffickerType: Trafficker type of this user profile. This is a
  1050. // read-only field.
  1051. //
  1052. // Possible values:
  1053. // "EXTERNAL_TRAFFICKER"
  1054. // "INTERNAL_NON_TRAFFICKER"
  1055. // "INTERNAL_TRAFFICKER"
  1056. TraffickerType string `json:"traffickerType,omitempty"`
  1057. // UserAccessType: User type of the user profile. This is a read-only
  1058. // field that can be left blank.
  1059. //
  1060. // Possible values:
  1061. // "INTERNAL_ADMINISTRATOR"
  1062. // "NORMAL_USER"
  1063. // "READ_ONLY_SUPER_USER"
  1064. // "SUPER_USER"
  1065. UserAccessType string `json:"userAccessType,omitempty"`
  1066. // UserRoleFilter: Filter that describes which user roles are visible to
  1067. // the user profile.
  1068. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1069. // UserRoleId: User role ID of the user profile. This is a required
  1070. // field.
  1071. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1072. // ServerResponse contains the HTTP response code and headers from the
  1073. // server.
  1074. googleapi.ServerResponse `json:"-"`
  1075. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1076. // unconditionally include in API requests. By default, fields with
  1077. // empty values are omitted from API requests. However, any non-pointer,
  1078. // non-interface field appearing in ForceSendFields will be sent to the
  1079. // server regardless of whether the field is empty or not. This may be
  1080. // used to include empty fields in Patch requests.
  1081. ForceSendFields []string `json:"-"`
  1082. // NullFields is a list of field names (e.g. "AccountId") to include in
  1083. // API requests with the JSON null value. By default, fields with empty
  1084. // values are omitted from API requests. However, any field with an
  1085. // empty value appearing in NullFields will be sent to the server as
  1086. // null. It is an error if a field in this list has a non-empty value.
  1087. // This may be used to include null fields in Patch requests.
  1088. NullFields []string `json:"-"`
  1089. }
  1090. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1091. type NoMethod AccountUserProfile
  1092. raw := NoMethod(*s)
  1093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1094. }
  1095. // AccountUserProfilesListResponse: Account User Profile List Response
  1096. type AccountUserProfilesListResponse struct {
  1097. // AccountUserProfiles: Account user profile collection.
  1098. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1099. // Kind: Identifies what kind of resource this is. Value: the fixed
  1100. // string "dfareporting#accountUserProfilesListResponse".
  1101. Kind string `json:"kind,omitempty"`
  1102. // NextPageToken: Pagination token to be used for the next list
  1103. // operation.
  1104. NextPageToken string `json:"nextPageToken,omitempty"`
  1105. // ServerResponse contains the HTTP response code and headers from the
  1106. // server.
  1107. googleapi.ServerResponse `json:"-"`
  1108. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1109. // to unconditionally include in API requests. By default, fields with
  1110. // empty values are omitted from API requests. However, any non-pointer,
  1111. // non-interface field appearing in ForceSendFields will be sent to the
  1112. // server regardless of whether the field is empty or not. This may be
  1113. // used to include empty fields in Patch requests.
  1114. ForceSendFields []string `json:"-"`
  1115. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1116. // include in API requests with the JSON null value. By default, fields
  1117. // with empty values are omitted from API requests. However, any field
  1118. // with an empty value appearing in NullFields will be sent to the
  1119. // server as null. It is an error if a field in this list has a
  1120. // non-empty value. This may be used to include null fields in Patch
  1121. // requests.
  1122. NullFields []string `json:"-"`
  1123. }
  1124. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1125. type NoMethod AccountUserProfilesListResponse
  1126. raw := NoMethod(*s)
  1127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1128. }
  1129. // AccountsListResponse: Account List Response
  1130. type AccountsListResponse struct {
  1131. // Accounts: Account collection.
  1132. Accounts []*Account `json:"accounts,omitempty"`
  1133. // Kind: Identifies what kind of resource this is. Value: the fixed
  1134. // string "dfareporting#accountsListResponse".
  1135. Kind string `json:"kind,omitempty"`
  1136. // NextPageToken: Pagination token to be used for the next list
  1137. // operation.
  1138. NextPageToken string `json:"nextPageToken,omitempty"`
  1139. // ServerResponse contains the HTTP response code and headers from the
  1140. // server.
  1141. googleapi.ServerResponse `json:"-"`
  1142. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1143. // unconditionally include in API requests. By default, fields with
  1144. // empty values are omitted from API requests. However, any non-pointer,
  1145. // non-interface field appearing in ForceSendFields will be sent to the
  1146. // server regardless of whether the field is empty or not. This may be
  1147. // used to include empty fields in Patch requests.
  1148. ForceSendFields []string `json:"-"`
  1149. // NullFields is a list of field names (e.g. "Accounts") to include in
  1150. // API requests with the JSON null value. By default, fields with empty
  1151. // values are omitted from API requests. However, any field with an
  1152. // empty value appearing in NullFields will be sent to the server as
  1153. // null. It is an error if a field in this list has a non-empty value.
  1154. // This may be used to include null fields in Patch requests.
  1155. NullFields []string `json:"-"`
  1156. }
  1157. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1158. type NoMethod AccountsListResponse
  1159. raw := NoMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1161. }
  1162. // Activities: Represents an activity group.
  1163. type Activities struct {
  1164. // Filters: List of activity filters. The dimension values need to be
  1165. // all either of type "dfa:activity" or "dfa:activityGroup".
  1166. Filters []*DimensionValue `json:"filters,omitempty"`
  1167. // Kind: The kind of resource this is, in this case
  1168. // dfareporting#activities.
  1169. Kind string `json:"kind,omitempty"`
  1170. // MetricNames: List of names of floodlight activity metrics.
  1171. MetricNames []string `json:"metricNames,omitempty"`
  1172. // ForceSendFields is a list of field names (e.g. "Filters") to
  1173. // unconditionally include in API requests. By default, fields with
  1174. // empty values are omitted from API requests. However, any non-pointer,
  1175. // non-interface field appearing in ForceSendFields will be sent to the
  1176. // server regardless of whether the field is empty or not. This may be
  1177. // used to include empty fields in Patch requests.
  1178. ForceSendFields []string `json:"-"`
  1179. // NullFields is a list of field names (e.g. "Filters") to include in
  1180. // API requests with the JSON null value. By default, fields with empty
  1181. // values are omitted from API requests. However, any field with an
  1182. // empty value appearing in NullFields will be sent to the server as
  1183. // null. It is an error if a field in this list has a non-empty value.
  1184. // This may be used to include null fields in Patch requests.
  1185. NullFields []string `json:"-"`
  1186. }
  1187. func (s *Activities) MarshalJSON() ([]byte, error) {
  1188. type NoMethod Activities
  1189. raw := NoMethod(*s)
  1190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1191. }
  1192. // Ad: Contains properties of a Campaign Manager ad.
  1193. type Ad struct {
  1194. // AccountId: Account ID of this ad. This is a read-only field that can
  1195. // be left blank.
  1196. AccountId int64 `json:"accountId,omitempty,string"`
  1197. // Active: Whether this ad is active. When true, archived must be false.
  1198. Active bool `json:"active,omitempty"`
  1199. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1200. // insertion.
  1201. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1202. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1203. // advertiser. This is a read-only, auto-generated field.
  1204. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1205. // Archived: Whether this ad is archived. When true, active must be
  1206. // false.
  1207. Archived bool `json:"archived,omitempty"`
  1208. // AudienceSegmentId: Audience segment ID that is being targeted for
  1209. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1210. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1211. // CampaignId: Campaign ID of this ad. This is a required field on
  1212. // insertion.
  1213. CampaignId int64 `json:"campaignId,omitempty,string"`
  1214. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1215. // This is a read-only, auto-generated field.
  1216. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1217. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1218. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1219. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1220. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1221. // for this ad. Applies to the URL in the ad or (if overriding ad
  1222. // properties) the URL in the creative.
  1223. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1224. // Comments: Comments for this ad.
  1225. Comments string `json:"comments,omitempty"`
  1226. // Compatibility: Compatibility of this ad. Applicable when type is
  1227. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1228. // either rendering on desktop or on mobile devices or in mobile apps
  1229. // for regular or interstitial ads, respectively. APP and
  1230. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1231. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1232. // default ads created for those placements will be limited to those
  1233. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1234. // video ads developed with the VAST standard.
  1235. //
  1236. // Possible values:
  1237. // "APP"
  1238. // "APP_INTERSTITIAL"
  1239. // "DISPLAY"
  1240. // "DISPLAY_INTERSTITIAL"
  1241. // "IN_STREAM_AUDIO"
  1242. // "IN_STREAM_VIDEO"
  1243. Compatibility string `json:"compatibility,omitempty"`
  1244. // CreateInfo: Information about the creation of this ad. This is a
  1245. // read-only field.
  1246. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1247. // CreativeGroupAssignments: Creative group assignments for this ad.
  1248. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1249. // per creative group number is allowed for a maximum of two
  1250. // assignments.
  1251. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1252. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1253. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1254. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1255. // should have exactly one creativeAssignment.
  1256. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1257. // DayPartTargeting: Time and day targeting information for this ad.
  1258. // This field must be left blank if the ad is using a targeting
  1259. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1260. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1261. // DefaultClickThroughEventTagProperties: Default click-through event
  1262. // tag properties for this ad.
  1263. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1264. // DeliverySchedule: Delivery schedule information for this ad.
  1265. // Applicable when type is AD_SERVING_STANDARD_AD or
  1266. // AD_SERVING_TRACKING. This field along with subfields priority and
  1267. // impressionRatio are required on insertion when type is
  1268. // AD_SERVING_STANDARD_AD.
  1269. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1270. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1271. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1272. // field on insert, and is read-only after insert.
  1273. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1274. // EndTime: Date and time that this ad should stop serving. Must be
  1275. // later than the start time. This is a required field on insertion.
  1276. EndTime string `json:"endTime,omitempty"`
  1277. // EventTagOverrides: Event tag overrides for this ad.
  1278. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1279. // GeoTargeting: Geographical targeting information for this ad. This
  1280. // field must be left blank if the ad is using a targeting template.
  1281. // Applicable when type is AD_SERVING_STANDARD_AD.
  1282. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1283. // Id: ID of this ad. This is a read-only, auto-generated field.
  1284. Id int64 `json:"id,omitempty,string"`
  1285. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1286. // read-only, auto-generated field.
  1287. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1288. // KeyValueTargetingExpression: Key-value targeting information for this
  1289. // ad. This field must be left blank if the ad is using a targeting
  1290. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1291. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1292. // Kind: Identifies what kind of resource this is. Value: the fixed
  1293. // string "dfareporting#ad".
  1294. Kind string `json:"kind,omitempty"`
  1295. // LanguageTargeting: Language targeting information for this ad. This
  1296. // field must be left blank if the ad is using a targeting template.
  1297. // Applicable when type is AD_SERVING_STANDARD_AD.
  1298. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1299. // LastModifiedInfo: Information about the most recent modification of
  1300. // this ad. This is a read-only field.
  1301. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1302. // Name: Name of this ad. This is a required field and must be less than
  1303. // 256 characters long.
  1304. Name string `json:"name,omitempty"`
  1305. // PlacementAssignments: Placement assignments for this ad.
  1306. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1307. // RemarketingListExpression: Remarketing list targeting expression for
  1308. // this ad. This field must be left blank if the ad is using a targeting
  1309. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1310. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1311. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1312. Size *Size `json:"size,omitempty"`
  1313. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1314. // field that is auto-generated when the ad is inserted or updated.
  1315. SslCompliant bool `json:"sslCompliant,omitempty"`
  1316. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1317. // that is auto-generated when the ad is inserted or updated.
  1318. SslRequired bool `json:"sslRequired,omitempty"`
  1319. // StartTime: Date and time that this ad should start serving. If
  1320. // creating an ad, this field must be a time in the future. This is a
  1321. // required field on insertion.
  1322. StartTime string `json:"startTime,omitempty"`
  1323. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1324. // that can be left blank.
  1325. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1326. // TargetingTemplateId: Targeting template ID, used to apply
  1327. // preconfigured targeting information to this ad. This cannot be set
  1328. // while any of dayPartTargeting, geoTargeting,
  1329. // keyValueTargetingExpression, languageTargeting,
  1330. // remarketingListExpression, or technologyTargeting are set. Applicable
  1331. // when type is AD_SERVING_STANDARD_AD.
  1332. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1333. // TechnologyTargeting: Technology platform targeting information for
  1334. // this ad. This field must be left blank if the ad is using a targeting
  1335. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1336. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1337. // Type: Type of ad. This is a required field on insertion. Note that
  1338. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1339. // Creative resource).
  1340. //
  1341. // Possible values:
  1342. // "AD_SERVING_CLICK_TRACKER"
  1343. // "AD_SERVING_DEFAULT_AD"
  1344. // "AD_SERVING_STANDARD_AD"
  1345. // "AD_SERVING_TRACKING"
  1346. Type string `json:"type,omitempty"`
  1347. // ServerResponse contains the HTTP response code and headers from the
  1348. // server.
  1349. googleapi.ServerResponse `json:"-"`
  1350. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1351. // unconditionally include in API requests. By default, fields with
  1352. // empty values are omitted from API requests. However, any non-pointer,
  1353. // non-interface field appearing in ForceSendFields will be sent to the
  1354. // server regardless of whether the field is empty or not. This may be
  1355. // used to include empty fields in Patch requests.
  1356. ForceSendFields []string `json:"-"`
  1357. // NullFields is a list of field names (e.g. "AccountId") to include in
  1358. // API requests with the JSON null value. By default, fields with empty
  1359. // values are omitted from API requests. However, any field with an
  1360. // empty value appearing in NullFields will be sent to the server as
  1361. // null. It is an error if a field in this list has a non-empty value.
  1362. // This may be used to include null fields in Patch requests.
  1363. NullFields []string `json:"-"`
  1364. }
  1365. func (s *Ad) MarshalJSON() ([]byte, error) {
  1366. type NoMethod Ad
  1367. raw := NoMethod(*s)
  1368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1369. }
  1370. // AdBlockingConfiguration: Campaign ad blocking settings.
  1371. type AdBlockingConfiguration struct {
  1372. // ClickThroughUrl: Click-through URL used by brand-neutral ads. This is
  1373. // a required field when overrideClickThroughUrl is set to true.
  1374. ClickThroughUrl string `json:"clickThroughUrl,omitempty"`
  1375. // CreativeBundleId: ID of a creative bundle to use for this campaign.
  1376. // If set, brand-neutral ads will select creatives from this bundle.
  1377. // Otherwise, a default transparent pixel will be used.
  1378. CreativeBundleId int64 `json:"creativeBundleId,omitempty,string"`
  1379. // Enabled: Whether this campaign has enabled ad blocking. When true, ad
  1380. // blocking is enabled for placements in the campaign, but this may be
  1381. // overridden by site and placement settings. When false, ad blocking is
  1382. // disabled for all placements under the campaign, regardless of site
  1383. // and placement settings.
  1384. Enabled bool `json:"enabled,omitempty"`
  1385. // OverrideClickThroughUrl: Whether the brand-neutral ad's click-through
  1386. // URL comes from the campaign's creative bundle or the override URL.
  1387. // Must be set to true if ad blocking is enabled and no creative bundle
  1388. // is configured.
  1389. OverrideClickThroughUrl bool `json:"overrideClickThroughUrl,omitempty"`
  1390. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  1391. // unconditionally include in API requests. By default, fields with
  1392. // empty values are omitted from API requests. However, any non-pointer,
  1393. // non-interface field appearing in ForceSendFields will be sent to the
  1394. // server regardless of whether the field is empty or not. This may be
  1395. // used to include empty fields in Patch requests.
  1396. ForceSendFields []string `json:"-"`
  1397. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  1398. // include in API requests with the JSON null value. By default, fields
  1399. // with empty values are omitted from API requests. However, any field
  1400. // with an empty value appearing in NullFields will be sent to the
  1401. // server as null. It is an error if a field in this list has a
  1402. // non-empty value. This may be used to include null fields in Patch
  1403. // requests.
  1404. NullFields []string `json:"-"`
  1405. }
  1406. func (s *AdBlockingConfiguration) MarshalJSON() ([]byte, error) {
  1407. type NoMethod AdBlockingConfiguration
  1408. raw := NoMethod(*s)
  1409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1410. }
  1411. // AdSlot: Ad Slot
  1412. type AdSlot struct {
  1413. // Comment: Comment for this ad slot.
  1414. Comment string `json:"comment,omitempty"`
  1415. // Compatibility: Ad slot compatibility. DISPLAY and
  1416. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1417. // devices or in mobile apps for regular or interstitial ads
  1418. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1419. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1420. // developed with the VAST standard.
  1421. //
  1422. // Possible values:
  1423. // "APP"
  1424. // "APP_INTERSTITIAL"
  1425. // "DISPLAY"
  1426. // "DISPLAY_INTERSTITIAL"
  1427. // "IN_STREAM_AUDIO"
  1428. // "IN_STREAM_VIDEO"
  1429. Compatibility string `json:"compatibility,omitempty"`
  1430. // Height: Height of this ad slot.
  1431. Height int64 `json:"height,omitempty,string"`
  1432. // LinkedPlacementId: ID of the placement from an external platform that
  1433. // is linked to this ad slot.
  1434. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1435. // Name: Name of this ad slot.
  1436. Name string `json:"name,omitempty"`
  1437. // PaymentSourceType: Payment source type of this ad slot.
  1438. //
  1439. // Possible values:
  1440. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1441. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1442. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1443. // Primary: Primary ad slot of a roadblock inventory item.
  1444. Primary bool `json:"primary,omitempty"`
  1445. // Width: Width of this ad slot.
  1446. Width int64 `json:"width,omitempty,string"`
  1447. // ForceSendFields is a list of field names (e.g. "Comment") to
  1448. // unconditionally include in API requests. By default, fields with
  1449. // empty values are omitted from API requests. However, any non-pointer,
  1450. // non-interface field appearing in ForceSendFields will be sent to the
  1451. // server regardless of whether the field is empty or not. This may be
  1452. // used to include empty fields in Patch requests.
  1453. ForceSendFields []string `json:"-"`
  1454. // NullFields is a list of field names (e.g. "Comment") to include in
  1455. // API requests with the JSON null value. By default, fields with empty
  1456. // values are omitted from API requests. However, any field with an
  1457. // empty value appearing in NullFields will be sent to the server as
  1458. // null. It is an error if a field in this list has a non-empty value.
  1459. // This may be used to include null fields in Patch requests.
  1460. NullFields []string `json:"-"`
  1461. }
  1462. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1463. type NoMethod AdSlot
  1464. raw := NoMethod(*s)
  1465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1466. }
  1467. // AdsListResponse: Ad List Response
  1468. type AdsListResponse struct {
  1469. // Ads: Ad collection.
  1470. Ads []*Ad `json:"ads,omitempty"`
  1471. // Kind: Identifies what kind of resource this is. Value: the fixed
  1472. // string "dfareporting#adsListResponse".
  1473. Kind string `json:"kind,omitempty"`
  1474. // NextPageToken: Pagination token to be used for the next list
  1475. // operation.
  1476. NextPageToken string `json:"nextPageToken,omitempty"`
  1477. // ServerResponse contains the HTTP response code and headers from the
  1478. // server.
  1479. googleapi.ServerResponse `json:"-"`
  1480. // ForceSendFields is a list of field names (e.g. "Ads") to
  1481. // unconditionally include in API requests. By default, fields with
  1482. // empty values are omitted from API requests. However, any non-pointer,
  1483. // non-interface field appearing in ForceSendFields will be sent to the
  1484. // server regardless of whether the field is empty or not. This may be
  1485. // used to include empty fields in Patch requests.
  1486. ForceSendFields []string `json:"-"`
  1487. // NullFields is a list of field names (e.g. "Ads") to include in API
  1488. // requests with the JSON null value. By default, fields with empty
  1489. // values are omitted from API requests. However, any field with an
  1490. // empty value appearing in NullFields will be sent to the server as
  1491. // null. It is an error if a field in this list has a non-empty value.
  1492. // This may be used to include null fields in Patch requests.
  1493. NullFields []string `json:"-"`
  1494. }
  1495. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1496. type NoMethod AdsListResponse
  1497. raw := NoMethod(*s)
  1498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1499. }
  1500. // Advertiser: Contains properties of a Campaign Manager advertiser.
  1501. type Advertiser struct {
  1502. // AccountId: Account ID of this advertiser.This is a read-only field
  1503. // that can be left blank.
  1504. AccountId int64 `json:"accountId,omitempty,string"`
  1505. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1506. // to. You can group advertisers for reporting purposes, allowing you to
  1507. // see aggregated information for all advertisers in each group.
  1508. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1509. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1510. // creative associations under this advertiser. Must be less than 129
  1511. // characters long.
  1512. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1513. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1514. // apply by default to the landing pages of this advertiser's campaigns.
  1515. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1516. // DefaultEmail: Default email address used in sender field for tag
  1517. // emails.
  1518. DefaultEmail string `json:"defaultEmail,omitempty"`
  1519. // FloodlightConfigurationId: Floodlight configuration ID of this
  1520. // advertiser. The floodlight configuration ID will be created
  1521. // automatically, so on insert this field should be left blank. This
  1522. // field can be set to another advertiser's floodlight configuration ID
  1523. // in order to share that advertiser's floodlight configuration with
  1524. // this advertiser, so long as:
  1525. // - This advertiser's original floodlight configuration is not already
  1526. // associated with floodlight activities or floodlight activity groups.
  1527. //
  1528. // - This advertiser's original floodlight configuration is not already
  1529. // shared with another advertiser.
  1530. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1531. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1532. // of the floodlight configuration. This is a read-only, auto-generated
  1533. // field.
  1534. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1535. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1536. Id int64 `json:"id,omitempty,string"`
  1537. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1538. // is a read-only, auto-generated field.
  1539. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1540. // Kind: Identifies what kind of resource this is. Value: the fixed
  1541. // string "dfareporting#advertiser".
  1542. Kind string `json:"kind,omitempty"`
  1543. // Name: Name of this advertiser. This is a required field and must be
  1544. // less than 256 characters long and unique among advertisers of the
  1545. // same account.
  1546. Name string `json:"name,omitempty"`
  1547. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1548. // before any sharing occurred. Set the floodlightConfigurationId of
  1549. // this advertiser to originalFloodlightConfigurationId to unshare the
  1550. // advertiser's current floodlight configuration. You cannot unshare an
  1551. // advertiser's floodlight configuration if the shared configuration has
  1552. // activities associated with any campaign or placement.
  1553. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1554. // Status: Status of this advertiser.
  1555. //
  1556. // Possible values:
  1557. // "APPROVED"
  1558. // "ON_HOLD"
  1559. Status string `json:"status,omitempty"`
  1560. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1561. // field that can be left blank.
  1562. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1563. // Suspended: Suspension status of this advertiser.
  1564. Suspended bool `json:"suspended,omitempty"`
  1565. // ServerResponse contains the HTTP response code and headers from the
  1566. // server.
  1567. googleapi.ServerResponse `json:"-"`
  1568. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1569. // unconditionally include in API requests. By default, fields with
  1570. // empty values are omitted from API requests. However, any non-pointer,
  1571. // non-interface field appearing in ForceSendFields will be sent to the
  1572. // server regardless of whether the field is empty or not. This may be
  1573. // used to include empty fields in Patch requests.
  1574. ForceSendFields []string `json:"-"`
  1575. // NullFields is a list of field names (e.g. "AccountId") to include in
  1576. // API requests with the JSON null value. By default, fields with empty
  1577. // values are omitted from API requests. However, any field with an
  1578. // empty value appearing in NullFields will be sent to the server as
  1579. // null. It is an error if a field in this list has a non-empty value.
  1580. // This may be used to include null fields in Patch requests.
  1581. NullFields []string `json:"-"`
  1582. }
  1583. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1584. type NoMethod Advertiser
  1585. raw := NoMethod(*s)
  1586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1587. }
  1588. // AdvertiserGroup: Groups advertisers together so that reports can be
  1589. // generated for the entire group at once.
  1590. type AdvertiserGroup struct {
  1591. // AccountId: Account ID of this advertiser group. This is a read-only
  1592. // field that can be left blank.
  1593. AccountId int64 `json:"accountId,omitempty,string"`
  1594. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1595. // field.
  1596. Id int64 `json:"id,omitempty,string"`
  1597. // Kind: Identifies what kind of resource this is. Value: the fixed
  1598. // string "dfareporting#advertiserGroup".
  1599. Kind string `json:"kind,omitempty"`
  1600. // Name: Name of this advertiser group. This is a required field and
  1601. // must be less than 256 characters long and unique among advertiser
  1602. // groups of the same account.
  1603. Name string `json:"name,omitempty"`
  1604. // ServerResponse contains the HTTP response code and headers from the
  1605. // server.
  1606. googleapi.ServerResponse `json:"-"`
  1607. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1608. // unconditionally include in API requests. By default, fields with
  1609. // empty values are omitted from API requests. However, any non-pointer,
  1610. // non-interface field appearing in ForceSendFields will be sent to the
  1611. // server regardless of whether the field is empty or not. This may be
  1612. // used to include empty fields in Patch requests.
  1613. ForceSendFields []string `json:"-"`
  1614. // NullFields is a list of field names (e.g. "AccountId") to include in
  1615. // API requests with the JSON null value. By default, fields with empty
  1616. // values are omitted from API requests. However, any field with an
  1617. // empty value appearing in NullFields will be sent to the server as
  1618. // null. It is an error if a field in this list has a non-empty value.
  1619. // This may be used to include null fields in Patch requests.
  1620. NullFields []string `json:"-"`
  1621. }
  1622. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1623. type NoMethod AdvertiserGroup
  1624. raw := NoMethod(*s)
  1625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1626. }
  1627. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1628. type AdvertiserGroupsListResponse struct {
  1629. // AdvertiserGroups: Advertiser group collection.
  1630. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1631. // Kind: Identifies what kind of resource this is. Value: the fixed
  1632. // string "dfareporting#advertiserGroupsListResponse".
  1633. Kind string `json:"kind,omitempty"`
  1634. // NextPageToken: Pagination token to be used for the next list
  1635. // operation.
  1636. NextPageToken string `json:"nextPageToken,omitempty"`
  1637. // ServerResponse contains the HTTP response code and headers from the
  1638. // server.
  1639. googleapi.ServerResponse `json:"-"`
  1640. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1641. // unconditionally include in API requests. By default, fields with
  1642. // empty values are omitted from API requests. However, any non-pointer,
  1643. // non-interface field appearing in ForceSendFields will be sent to the
  1644. // server regardless of whether the field is empty or not. This may be
  1645. // used to include empty fields in Patch requests.
  1646. ForceSendFields []string `json:"-"`
  1647. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1648. // include in API requests with the JSON null value. By default, fields
  1649. // with empty values are omitted from API requests. However, any field
  1650. // with an empty value appearing in NullFields will be sent to the
  1651. // server as null. It is an error if a field in this list has a
  1652. // non-empty value. This may be used to include null fields in Patch
  1653. // requests.
  1654. NullFields []string `json:"-"`
  1655. }
  1656. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1657. type NoMethod AdvertiserGroupsListResponse
  1658. raw := NoMethod(*s)
  1659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1660. }
  1661. // AdvertiserLandingPagesListResponse: Landing Page List Response
  1662. type AdvertiserLandingPagesListResponse struct {
  1663. // Kind: Identifies what kind of resource this is. Value: the fixed
  1664. // string "dfareporting#advertiserLandingPagesListResponse".
  1665. Kind string `json:"kind,omitempty"`
  1666. // LandingPages: Landing page collection
  1667. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  1668. // NextPageToken: Pagination token to be used for the next list
  1669. // operation.
  1670. NextPageToken string `json:"nextPageToken,omitempty"`
  1671. // ServerResponse contains the HTTP response code and headers from the
  1672. // server.
  1673. googleapi.ServerResponse `json:"-"`
  1674. // ForceSendFields is a list of field names (e.g. "Kind") to
  1675. // unconditionally include in API requests. By default, fields with
  1676. // empty values are omitted from API requests. However, any non-pointer,
  1677. // non-interface field appearing in ForceSendFields will be sent to the
  1678. // server regardless of whether the field is empty or not. This may be
  1679. // used to include empty fields in Patch requests.
  1680. ForceSendFields []string `json:"-"`
  1681. // NullFields is a list of field names (e.g. "Kind") to include in API
  1682. // requests with the JSON null value. By default, fields with empty
  1683. // values are omitted from API requests. However, any field with an
  1684. // empty value appearing in NullFields will be sent to the server as
  1685. // null. It is an error if a field in this list has a non-empty value.
  1686. // This may be used to include null fields in Patch requests.
  1687. NullFields []string `json:"-"`
  1688. }
  1689. func (s *AdvertiserLandingPagesListResponse) MarshalJSON() ([]byte, error) {
  1690. type NoMethod AdvertiserLandingPagesListResponse
  1691. raw := NoMethod(*s)
  1692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1693. }
  1694. // AdvertisersListResponse: Advertiser List Response
  1695. type AdvertisersListResponse struct {
  1696. // Advertisers: Advertiser collection.
  1697. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1698. // Kind: Identifies what kind of resource this is. Value: the fixed
  1699. // string "dfareporting#advertisersListResponse".
  1700. Kind string `json:"kind,omitempty"`
  1701. // NextPageToken: Pagination token to be used for the next list
  1702. // operation.
  1703. NextPageToken string `json:"nextPageToken,omitempty"`
  1704. // ServerResponse contains the HTTP response code and headers from the
  1705. // server.
  1706. googleapi.ServerResponse `json:"-"`
  1707. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1708. // unconditionally include in API requests. By default, fields with
  1709. // empty values are omitted from API requests. However, any non-pointer,
  1710. // non-interface field appearing in ForceSendFields will be sent to the
  1711. // server regardless of whether the field is empty or not. This may be
  1712. // used to include empty fields in Patch requests.
  1713. ForceSendFields []string `json:"-"`
  1714. // NullFields is a list of field names (e.g. "Advertisers") to include
  1715. // in API requests with the JSON null value. By default, fields with
  1716. // empty values are omitted from API requests. However, any field with
  1717. // an empty value appearing in NullFields will be sent to the server as
  1718. // null. It is an error if a field in this list has a non-empty value.
  1719. // This may be used to include null fields in Patch requests.
  1720. NullFields []string `json:"-"`
  1721. }
  1722. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1723. type NoMethod AdvertisersListResponse
  1724. raw := NoMethod(*s)
  1725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1726. }
  1727. // AudienceSegment: Audience Segment.
  1728. type AudienceSegment struct {
  1729. // Allocation: Weight allocated to this segment. The weight assigned
  1730. // will be understood in proportion to the weights assigned to other
  1731. // segments in the same segment group. Acceptable values are 1 to 1000,
  1732. // inclusive.
  1733. Allocation int64 `json:"allocation,omitempty"`
  1734. // Id: ID of this audience segment. This is a read-only, auto-generated
  1735. // field.
  1736. Id int64 `json:"id,omitempty,string"`
  1737. // Name: Name of this audience segment. This is a required field and
  1738. // must be less than 65 characters long.
  1739. Name string `json:"name,omitempty"`
  1740. // ForceSendFields is a list of field names (e.g. "Allocation") 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. "Allocation") to include in
  1748. // API 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 *AudienceSegment) MarshalJSON() ([]byte, error) {
  1756. type NoMethod AudienceSegment
  1757. raw := NoMethod(*s)
  1758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1759. }
  1760. // AudienceSegmentGroup: Audience Segment Group.
  1761. type AudienceSegmentGroup struct {
  1762. // AudienceSegments: Audience segments assigned to this group. The
  1763. // number of segments must be between 2 and 100.
  1764. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1765. // Id: ID of this audience segment group. This is a read-only,
  1766. // auto-generated field.
  1767. Id int64 `json:"id,omitempty,string"`
  1768. // Name: Name of this audience segment group. This is a required field
  1769. // and must be less than 65 characters long.
  1770. Name string `json:"name,omitempty"`
  1771. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1772. // unconditionally include in API requests. By default, fields with
  1773. // empty values are omitted from API requests. However, any non-pointer,
  1774. // non-interface field appearing in ForceSendFields will be sent to the
  1775. // server regardless of whether the field is empty or not. This may be
  1776. // used to include empty fields in Patch requests.
  1777. ForceSendFields []string `json:"-"`
  1778. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1779. // include in API requests with the JSON null value. By default, fields
  1780. // with empty values are omitted from API requests. However, any field
  1781. // with an empty value appearing in NullFields will be sent to the
  1782. // server as null. It is an error if a field in this list has a
  1783. // non-empty value. This may be used to include null fields in Patch
  1784. // requests.
  1785. NullFields []string `json:"-"`
  1786. }
  1787. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1788. type NoMethod AudienceSegmentGroup
  1789. raw := NoMethod(*s)
  1790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1791. }
  1792. // Browser: Contains information about a browser that can be targeted by
  1793. // ads.
  1794. type Browser struct {
  1795. // BrowserVersionId: ID referring to this grouping of browser and
  1796. // version numbers. This is the ID used for targeting.
  1797. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1798. // DartId: DART ID of this browser. This is the ID used when generating
  1799. // reports.
  1800. DartId int64 `json:"dartId,omitempty,string"`
  1801. // Kind: Identifies what kind of resource this is. Value: the fixed
  1802. // string "dfareporting#browser".
  1803. Kind string `json:"kind,omitempty"`
  1804. // MajorVersion: Major version number (leftmost number) of this browser.
  1805. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1806. // 5. An asterisk (*) may be used to target any version number, and a
  1807. // question mark (?) may be used to target cases where the version
  1808. // number cannot be identified. For example, Chrome *.* targets any
  1809. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1810. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1811. // server knows the browser is Firefox but can't tell which version it
  1812. // is.
  1813. MajorVersion string `json:"majorVersion,omitempty"`
  1814. // MinorVersion: Minor version number (number after first dot on left)
  1815. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1816. // should be set to 0. An asterisk (*) may be used to target any version
  1817. // number, and a question mark (?) may be used to target cases where the
  1818. // version number cannot be identified. For example, Chrome *.* targets
  1819. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1820. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1821. // server knows the browser is Firefox but can't tell which version it
  1822. // is.
  1823. MinorVersion string `json:"minorVersion,omitempty"`
  1824. // Name: Name of this browser.
  1825. Name string `json:"name,omitempty"`
  1826. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1827. // unconditionally include in API requests. By default, fields with
  1828. // empty values are omitted from API requests. However, any non-pointer,
  1829. // non-interface field appearing in ForceSendFields will be sent to the
  1830. // server regardless of whether the field is empty or not. This may be
  1831. // used to include empty fields in Patch requests.
  1832. ForceSendFields []string `json:"-"`
  1833. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1834. // include in API requests with the JSON null value. By default, fields
  1835. // with empty values are omitted from API requests. However, any field
  1836. // with an empty value appearing in NullFields will be sent to the
  1837. // server as null. It is an error if a field in this list has a
  1838. // non-empty value. This may be used to include null fields in Patch
  1839. // requests.
  1840. NullFields []string `json:"-"`
  1841. }
  1842. func (s *Browser) MarshalJSON() ([]byte, error) {
  1843. type NoMethod Browser
  1844. raw := NoMethod(*s)
  1845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1846. }
  1847. // BrowsersListResponse: Browser List Response
  1848. type BrowsersListResponse struct {
  1849. // Browsers: Browser collection.
  1850. Browsers []*Browser `json:"browsers,omitempty"`
  1851. // Kind: Identifies what kind of resource this is. Value: the fixed
  1852. // string "dfareporting#browsersListResponse".
  1853. Kind string `json:"kind,omitempty"`
  1854. // ServerResponse contains the HTTP response code and headers from the
  1855. // server.
  1856. googleapi.ServerResponse `json:"-"`
  1857. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1858. // unconditionally include in API requests. By default, fields with
  1859. // empty values are omitted from API requests. However, any non-pointer,
  1860. // non-interface field appearing in ForceSendFields will be sent to the
  1861. // server regardless of whether the field is empty or not. This may be
  1862. // used to include empty fields in Patch requests.
  1863. ForceSendFields []string `json:"-"`
  1864. // NullFields is a list of field names (e.g. "Browsers") to include in
  1865. // API requests with the JSON null value. By default, fields with empty
  1866. // values are omitted from API requests. However, any field with an
  1867. // empty value appearing in NullFields will be sent to the server as
  1868. // null. It is an error if a field in this list has a non-empty value.
  1869. // This may be used to include null fields in Patch requests.
  1870. NullFields []string `json:"-"`
  1871. }
  1872. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1873. type NoMethod BrowsersListResponse
  1874. raw := NoMethod(*s)
  1875. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1876. }
  1877. // Campaign: Contains properties of a Campaign Manager campaign.
  1878. type Campaign struct {
  1879. // AccountId: Account ID of this campaign. This is a read-only field
  1880. // that can be left blank.
  1881. AccountId int64 `json:"accountId,omitempty,string"`
  1882. // AdBlockingConfiguration: Ad blocking settings for this campaign.
  1883. AdBlockingConfiguration *AdBlockingConfiguration `json:"adBlockingConfiguration,omitempty"`
  1884. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1885. // optimization configurations for the campaign.
  1886. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1887. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1888. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1889. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1890. // field.
  1891. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1892. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1893. // this campaign. This is a read-only, auto-generated field.
  1894. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1895. // Archived: Whether this campaign has been archived.
  1896. Archived bool `json:"archived,omitempty"`
  1897. // AudienceSegmentGroups: Audience segment groups assigned to this
  1898. // campaign. Cannot have more than 300 segment groups.
  1899. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1900. // BillingInvoiceCode: Billing invoice code included in the Campaign
  1901. // Manager client billing invoices associated with the campaign.
  1902. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1903. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1904. // properties for this campaign.
  1905. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1906. // Comment: Arbitrary comments about this campaign. Must be less than
  1907. // 256 characters long.
  1908. Comment string `json:"comment,omitempty"`
  1909. // CreateInfo: Information about the creation of this campaign. This is
  1910. // a read-only field.
  1911. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1912. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1913. // campaign.
  1914. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1915. // CreativeOptimizationConfiguration: Creative optimization
  1916. // configuration for the campaign.
  1917. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1918. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1919. // override properties for this campaign.
  1920. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1921. // DefaultLandingPageId: The default landing page ID for this campaign.
  1922. DefaultLandingPageId int64 `json:"defaultLandingPageId,omitempty,string"`
  1923. // EndDate: Date on which the campaign will stop running. On insert, the
  1924. // end date must be today or a future date. The end date must be later
  1925. // than or be the same as the start date. If, for example, you set
  1926. // 6/25/2015 as both the start and end dates, the effective campaign run
  1927. // date is just that day only, 6/25/2015. The hours, minutes, and
  1928. // seconds of the end date should not be set, as doing so will result in
  1929. // an error. This is a required field.
  1930. EndDate string `json:"endDate,omitempty"`
  1931. // EventTagOverrides: Overrides that can be used to activate or
  1932. // deactivate advertiser event tags.
  1933. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1934. // ExternalId: External ID for this campaign.
  1935. ExternalId string `json:"externalId,omitempty"`
  1936. // Id: ID of this campaign. This is a read-only auto-generated field.
  1937. Id int64 `json:"id,omitempty,string"`
  1938. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1939. // is a read-only, auto-generated field.
  1940. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1941. // Kind: Identifies what kind of resource this is. Value: the fixed
  1942. // string "dfareporting#campaign".
  1943. Kind string `json:"kind,omitempty"`
  1944. // LastModifiedInfo: Information about the most recent modification of
  1945. // this campaign. This is a read-only field.
  1946. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1947. // LookbackConfiguration: Lookback window settings for the campaign.
  1948. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  1949. // Name: Name of this campaign. This is a required field and must be
  1950. // less than 256 characters long and unique among campaigns of the same
  1951. // advertiser.
  1952. Name string `json:"name,omitempty"`
  1953. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  1954. // campaign.
  1955. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  1956. // StartDate: Date on which the campaign starts running. The start date
  1957. // can be any date. The hours, minutes, and seconds of the start date
  1958. // should not be set, as doing so will result in an error. This is a
  1959. // required field.
  1960. StartDate string `json:"startDate,omitempty"`
  1961. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  1962. // field that can be left blank.
  1963. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1964. // TraffickerEmails: Campaign trafficker contact emails.
  1965. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  1966. // ServerResponse contains the HTTP response code and headers from the
  1967. // server.
  1968. googleapi.ServerResponse `json:"-"`
  1969. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1970. // unconditionally include in API requests. By default, fields with
  1971. // empty values are omitted from API requests. However, any non-pointer,
  1972. // non-interface field appearing in ForceSendFields will be sent to the
  1973. // server regardless of whether the field is empty or not. This may be
  1974. // used to include empty fields in Patch requests.
  1975. ForceSendFields []string `json:"-"`
  1976. // NullFields is a list of field names (e.g. "AccountId") to include in
  1977. // API requests with the JSON null value. By default, fields with empty
  1978. // values are omitted from API requests. However, any field with an
  1979. // empty value appearing in NullFields will be sent to the server as
  1980. // null. It is an error if a field in this list has a non-empty value.
  1981. // This may be used to include null fields in Patch requests.
  1982. NullFields []string `json:"-"`
  1983. }
  1984. func (s *Campaign) MarshalJSON() ([]byte, error) {
  1985. type NoMethod Campaign
  1986. raw := NoMethod(*s)
  1987. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1988. }
  1989. // CampaignCreativeAssociation: Identifies a creative which has been
  1990. // associated with a given campaign.
  1991. type CampaignCreativeAssociation struct {
  1992. // CreativeId: ID of the creative associated with the campaign. This is
  1993. // a required field.
  1994. CreativeId int64 `json:"creativeId,omitempty,string"`
  1995. // Kind: Identifies what kind of resource this is. Value: the fixed
  1996. // string "dfareporting#campaignCreativeAssociation".
  1997. Kind string `json:"kind,omitempty"`
  1998. // ServerResponse contains the HTTP response code and headers from the
  1999. // server.
  2000. googleapi.ServerResponse `json:"-"`
  2001. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  2002. // unconditionally include in API requests. By default, fields with
  2003. // empty values are omitted from API requests. However, any non-pointer,
  2004. // non-interface field appearing in ForceSendFields will be sent to the
  2005. // server regardless of whether the field is empty or not. This may be
  2006. // used to include empty fields in Patch requests.
  2007. ForceSendFields []string `json:"-"`
  2008. // NullFields is a list of field names (e.g. "CreativeId") to include in
  2009. // API requests with the JSON null value. By default, fields with empty
  2010. // values are omitted from API requests. However, any field with an
  2011. // empty value appearing in NullFields will be sent to the server as
  2012. // null. It is an error if a field in this list has a non-empty value.
  2013. // This may be used to include null fields in Patch requests.
  2014. NullFields []string `json:"-"`
  2015. }
  2016. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  2017. type NoMethod CampaignCreativeAssociation
  2018. raw := NoMethod(*s)
  2019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2020. }
  2021. // CampaignCreativeAssociationsListResponse: Campaign Creative
  2022. // Association List Response
  2023. type CampaignCreativeAssociationsListResponse struct {
  2024. // CampaignCreativeAssociations: Campaign creative association
  2025. // collection
  2026. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  2027. // Kind: Identifies what kind of resource this is. Value: the fixed
  2028. // string "dfareporting#campaignCreativeAssociationsListResponse".
  2029. Kind string `json:"kind,omitempty"`
  2030. // NextPageToken: Pagination token to be used for the next list
  2031. // operation.
  2032. NextPageToken string `json:"nextPageToken,omitempty"`
  2033. // ServerResponse contains the HTTP response code and headers from the
  2034. // server.
  2035. googleapi.ServerResponse `json:"-"`
  2036. // ForceSendFields is a list of field names (e.g.
  2037. // "CampaignCreativeAssociations") to unconditionally include in API
  2038. // requests. By default, fields with empty values are omitted from API
  2039. // requests. However, any non-pointer, non-interface field appearing in
  2040. // ForceSendFields will be sent to the server regardless of whether the
  2041. // field is empty or not. This may be used to include empty fields in
  2042. // Patch requests.
  2043. ForceSendFields []string `json:"-"`
  2044. // NullFields is a list of field names (e.g.
  2045. // "CampaignCreativeAssociations") to include in API requests with the
  2046. // JSON null value. By default, fields with empty values are omitted
  2047. // from API requests. However, any field with an empty value appearing
  2048. // in NullFields will be sent to the server as null. It is an error if a
  2049. // field in this list has a non-empty value. This may be used to include
  2050. // null fields in Patch requests.
  2051. NullFields []string `json:"-"`
  2052. }
  2053. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  2054. type NoMethod CampaignCreativeAssociationsListResponse
  2055. raw := NoMethod(*s)
  2056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2057. }
  2058. // CampaignsListResponse: Campaign List Response
  2059. type CampaignsListResponse struct {
  2060. // Campaigns: Campaign collection.
  2061. Campaigns []*Campaign `json:"campaigns,omitempty"`
  2062. // Kind: Identifies what kind of resource this is. Value: the fixed
  2063. // string "dfareporting#campaignsListResponse".
  2064. Kind string `json:"kind,omitempty"`
  2065. // NextPageToken: Pagination token to be used for the next list
  2066. // operation.
  2067. NextPageToken string `json:"nextPageToken,omitempty"`
  2068. // ServerResponse contains the HTTP response code and headers from the
  2069. // server.
  2070. googleapi.ServerResponse `json:"-"`
  2071. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  2072. // unconditionally include in API requests. By default, fields with
  2073. // empty values are omitted from API requests. However, any non-pointer,
  2074. // non-interface field appearing in ForceSendFields will be sent to the
  2075. // server regardless of whether the field is empty or not. This may be
  2076. // used to include empty fields in Patch requests.
  2077. ForceSendFields []string `json:"-"`
  2078. // NullFields is a list of field names (e.g. "Campaigns") to include in
  2079. // API requests with the JSON null value. By default, fields with empty
  2080. // values are omitted from API requests. However, any field with an
  2081. // empty value appearing in NullFields will be sent to the server as
  2082. // null. It is an error if a field in this list has a non-empty value.
  2083. // This may be used to include null fields in Patch requests.
  2084. NullFields []string `json:"-"`
  2085. }
  2086. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2087. type NoMethod CampaignsListResponse
  2088. raw := NoMethod(*s)
  2089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2090. }
  2091. // ChangeLog: Describes a change that a user has made to a resource.
  2092. type ChangeLog struct {
  2093. // AccountId: Account ID of the modified object.
  2094. AccountId int64 `json:"accountId,omitempty,string"`
  2095. // Action: Action which caused the change.
  2096. Action string `json:"action,omitempty"`
  2097. // ChangeTime: Time when the object was modified.
  2098. ChangeTime string `json:"changeTime,omitempty"`
  2099. // FieldName: Field name of the object which changed.
  2100. FieldName string `json:"fieldName,omitempty"`
  2101. // Id: ID of this change log.
  2102. Id int64 `json:"id,omitempty,string"`
  2103. // Kind: Identifies what kind of resource this is. Value: the fixed
  2104. // string "dfareporting#changeLog".
  2105. Kind string `json:"kind,omitempty"`
  2106. // NewValue: New value of the object field.
  2107. NewValue string `json:"newValue,omitempty"`
  2108. // ObjectId: ID of the object of this change log. The object could be a
  2109. // campaign, placement, ad, or other type.
  2110. ObjectId int64 `json:"objectId,omitempty,string"`
  2111. // ObjectType: Object type of the change log.
  2112. ObjectType string `json:"objectType,omitempty"`
  2113. // OldValue: Old value of the object field.
  2114. OldValue string `json:"oldValue,omitempty"`
  2115. // SubaccountId: Subaccount ID of the modified object.
  2116. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2117. // TransactionId: Transaction ID of this change log. When a single API
  2118. // call results in many changes, each change will have a separate ID in
  2119. // the change log but will share the same transactionId.
  2120. TransactionId int64 `json:"transactionId,omitempty,string"`
  2121. // UserProfileId: ID of the user who modified the object.
  2122. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2123. // UserProfileName: User profile name of the user who modified the
  2124. // object.
  2125. UserProfileName string `json:"userProfileName,omitempty"`
  2126. // ServerResponse contains the HTTP response code and headers from the
  2127. // server.
  2128. googleapi.ServerResponse `json:"-"`
  2129. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2130. // unconditionally include in API requests. By default, fields with
  2131. // empty values are omitted from API requests. However, any non-pointer,
  2132. // non-interface field appearing in ForceSendFields will be sent to the
  2133. // server regardless of whether the field is empty or not. This may be
  2134. // used to include empty fields in Patch requests.
  2135. ForceSendFields []string `json:"-"`
  2136. // NullFields is a list of field names (e.g. "AccountId") to include in
  2137. // API requests with the JSON null value. By default, fields with empty
  2138. // values are omitted from API requests. However, any field with an
  2139. // empty value appearing in NullFields will be sent to the server as
  2140. // null. It is an error if a field in this list has a non-empty value.
  2141. // This may be used to include null fields in Patch requests.
  2142. NullFields []string `json:"-"`
  2143. }
  2144. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2145. type NoMethod ChangeLog
  2146. raw := NoMethod(*s)
  2147. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2148. }
  2149. // ChangeLogsListResponse: Change Log List Response
  2150. type ChangeLogsListResponse struct {
  2151. // ChangeLogs: Change log collection.
  2152. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2153. // Kind: Identifies what kind of resource this is. Value: the fixed
  2154. // string "dfareporting#changeLogsListResponse".
  2155. Kind string `json:"kind,omitempty"`
  2156. // NextPageToken: Pagination token to be used for the next list
  2157. // operation.
  2158. NextPageToken string `json:"nextPageToken,omitempty"`
  2159. // ServerResponse contains the HTTP response code and headers from the
  2160. // server.
  2161. googleapi.ServerResponse `json:"-"`
  2162. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2163. // unconditionally include in API requests. By default, fields with
  2164. // empty values are omitted from API requests. However, any non-pointer,
  2165. // non-interface field appearing in ForceSendFields will be sent to the
  2166. // server regardless of whether the field is empty or not. This may be
  2167. // used to include empty fields in Patch requests.
  2168. ForceSendFields []string `json:"-"`
  2169. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2170. // API requests with the JSON null value. By default, fields with empty
  2171. // values are omitted from API requests. However, any field with an
  2172. // empty value appearing in NullFields will be sent to the server as
  2173. // null. It is an error if a field in this list has a non-empty value.
  2174. // This may be used to include null fields in Patch requests.
  2175. NullFields []string `json:"-"`
  2176. }
  2177. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2178. type NoMethod ChangeLogsListResponse
  2179. raw := NoMethod(*s)
  2180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2181. }
  2182. // CitiesListResponse: City List Response
  2183. type CitiesListResponse struct {
  2184. // Cities: City collection.
  2185. Cities []*City `json:"cities,omitempty"`
  2186. // Kind: Identifies what kind of resource this is. Value: the fixed
  2187. // string "dfareporting#citiesListResponse".
  2188. Kind string `json:"kind,omitempty"`
  2189. // ServerResponse contains the HTTP response code and headers from the
  2190. // server.
  2191. googleapi.ServerResponse `json:"-"`
  2192. // ForceSendFields is a list of field names (e.g. "Cities") to
  2193. // unconditionally include in API requests. By default, fields with
  2194. // empty values are omitted from API requests. However, any non-pointer,
  2195. // non-interface field appearing in ForceSendFields will be sent to the
  2196. // server regardless of whether the field is empty or not. This may be
  2197. // used to include empty fields in Patch requests.
  2198. ForceSendFields []string `json:"-"`
  2199. // NullFields is a list of field names (e.g. "Cities") to include in API
  2200. // requests with the JSON null value. By default, fields with empty
  2201. // values are omitted from API requests. However, any field with an
  2202. // empty value appearing in NullFields will be sent to the server as
  2203. // null. It is an error if a field in this list has a non-empty value.
  2204. // This may be used to include null fields in Patch requests.
  2205. NullFields []string `json:"-"`
  2206. }
  2207. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2208. type NoMethod CitiesListResponse
  2209. raw := NoMethod(*s)
  2210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2211. }
  2212. // City: Contains information about a city that can be targeted by ads.
  2213. type City struct {
  2214. // CountryCode: Country code of the country to which this city belongs.
  2215. CountryCode string `json:"countryCode,omitempty"`
  2216. // CountryDartId: DART ID of the country to which this city belongs.
  2217. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2218. // DartId: DART ID of this city. This is the ID used for targeting and
  2219. // generating reports.
  2220. DartId int64 `json:"dartId,omitempty,string"`
  2221. // Kind: Identifies what kind of resource this is. Value: the fixed
  2222. // string "dfareporting#city".
  2223. Kind string `json:"kind,omitempty"`
  2224. // MetroCode: Metro region code of the metro region (DMA) to which this
  2225. // city belongs.
  2226. MetroCode string `json:"metroCode,omitempty"`
  2227. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2228. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2229. // Name: Name of this city.
  2230. Name string `json:"name,omitempty"`
  2231. // RegionCode: Region code of the region to which this city belongs.
  2232. RegionCode string `json:"regionCode,omitempty"`
  2233. // RegionDartId: DART ID of the region to which this city belongs.
  2234. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2235. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2236. // unconditionally include in API requests. By default, fields with
  2237. // empty values are omitted from API requests. However, any non-pointer,
  2238. // non-interface field appearing in ForceSendFields will be sent to the
  2239. // server regardless of whether the field is empty or not. This may be
  2240. // used to include empty fields in Patch requests.
  2241. ForceSendFields []string `json:"-"`
  2242. // NullFields is a list of field names (e.g. "CountryCode") to include
  2243. // in API requests with the JSON null value. By default, fields with
  2244. // empty values are omitted from API requests. However, any field with
  2245. // an empty value appearing in NullFields will be sent to the server as
  2246. // null. It is an error if a field in this list has a non-empty value.
  2247. // This may be used to include null fields in Patch requests.
  2248. NullFields []string `json:"-"`
  2249. }
  2250. func (s *City) MarshalJSON() ([]byte, error) {
  2251. type NoMethod City
  2252. raw := NoMethod(*s)
  2253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2254. }
  2255. // ClickTag: Creative Click Tag.
  2256. type ClickTag struct {
  2257. // ClickThroughUrl: Parameter value for the specified click tag. This
  2258. // field contains a click-through url.
  2259. ClickThroughUrl *CreativeClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2260. // EventName: Advertiser event name associated with the click tag. This
  2261. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2262. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2263. EventName string `json:"eventName,omitempty"`
  2264. // Name: Parameter name for the specified click tag. For
  2265. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2266. // value of the creative asset's creativeAssetId.name field.
  2267. Name string `json:"name,omitempty"`
  2268. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2269. // unconditionally include in API requests. By default, fields with
  2270. // empty values are omitted from API requests. However, any non-pointer,
  2271. // non-interface field appearing in ForceSendFields will be sent to the
  2272. // server regardless of whether the field is empty or not. This may be
  2273. // used to include empty fields in Patch requests.
  2274. ForceSendFields []string `json:"-"`
  2275. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2276. // include in API requests with the JSON null value. By default, fields
  2277. // with empty values are omitted from API requests. However, any field
  2278. // with an empty value appearing in NullFields will be sent to the
  2279. // server as null. It is an error if a field in this list has a
  2280. // non-empty value. This may be used to include null fields in Patch
  2281. // requests.
  2282. NullFields []string `json:"-"`
  2283. }
  2284. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2285. type NoMethod ClickTag
  2286. raw := NoMethod(*s)
  2287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2288. }
  2289. // ClickThroughUrl: Click-through URL
  2290. type ClickThroughUrl struct {
  2291. // ComputedClickThroughUrl: Read-only convenience field representing the
  2292. // actual URL that will be used for this click-through. The URL is
  2293. // computed as follows:
  2294. // - If defaultLandingPage is enabled then the campaign's default
  2295. // landing page URL is assigned to this field.
  2296. // - If defaultLandingPage is not enabled and a landingPageId is
  2297. // specified then that landing page's URL is assigned to this field.
  2298. // - If neither of the above cases apply, then the customClickThroughUrl
  2299. // is assigned to this field.
  2300. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2301. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2302. // defaultLandingPage field is set to false and the landingPageId field
  2303. // is left unset.
  2304. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2305. // DefaultLandingPage: Whether the campaign default landing page is
  2306. // used.
  2307. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2308. // LandingPageId: ID of the landing page for the click-through URL.
  2309. // Applicable if the defaultLandingPage field is set to false.
  2310. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2311. // ForceSendFields is a list of field names (e.g.
  2312. // "ComputedClickThroughUrl") to unconditionally include in API
  2313. // requests. By default, fields with empty values are omitted from API
  2314. // requests. However, any non-pointer, non-interface field appearing in
  2315. // ForceSendFields will be sent to the server regardless of whether the
  2316. // field is empty or not. This may be used to include empty fields in
  2317. // Patch requests.
  2318. ForceSendFields []string `json:"-"`
  2319. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2320. // to include in API requests with the JSON null value. By default,
  2321. // fields with empty values are omitted from API requests. However, any
  2322. // field with an empty value appearing in NullFields will be sent to the
  2323. // server as null. It is an error if a field in this list has a
  2324. // non-empty value. This may be used to include null fields in Patch
  2325. // requests.
  2326. NullFields []string `json:"-"`
  2327. }
  2328. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2329. type NoMethod ClickThroughUrl
  2330. raw := NoMethod(*s)
  2331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2332. }
  2333. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2334. type ClickThroughUrlSuffixProperties struct {
  2335. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2336. // in this entity's scope. Must be less than 128 characters long.
  2337. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2338. // OverrideInheritedSuffix: Whether this entity should override the
  2339. // inherited click-through URL suffix with its own defined value.
  2340. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2341. // ForceSendFields is a list of field names (e.g.
  2342. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2343. // By default, fields with empty values are omitted from API requests.
  2344. // However, any non-pointer, non-interface field appearing in
  2345. // ForceSendFields will be sent to the server regardless of whether the
  2346. // field is empty or not. This may be used to include empty fields in
  2347. // Patch requests.
  2348. ForceSendFields []string `json:"-"`
  2349. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2350. // include in API requests with the JSON null value. By default, fields
  2351. // with empty values are omitted from API requests. However, any field
  2352. // with an empty value appearing in NullFields will be sent to the
  2353. // server as null. It is an error if a field in this list has a
  2354. // non-empty value. This may be used to include null fields in Patch
  2355. // requests.
  2356. NullFields []string `json:"-"`
  2357. }
  2358. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2359. type NoMethod ClickThroughUrlSuffixProperties
  2360. raw := NoMethod(*s)
  2361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2362. }
  2363. // CompanionClickThroughOverride: Companion Click-through override.
  2364. type CompanionClickThroughOverride struct {
  2365. // ClickThroughUrl: Click-through URL of this companion click-through
  2366. // override.
  2367. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2368. // CreativeId: ID of the creative for this companion click-through
  2369. // override.
  2370. CreativeId int64 `json:"creativeId,omitempty,string"`
  2371. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2372. // unconditionally include in API requests. By default, fields with
  2373. // empty values are omitted from API requests. However, any non-pointer,
  2374. // non-interface field appearing in ForceSendFields will be sent to the
  2375. // server regardless of whether the field is empty or not. This may be
  2376. // used to include empty fields in Patch requests.
  2377. ForceSendFields []string `json:"-"`
  2378. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2379. // include in API requests with the JSON null value. By default, fields
  2380. // with empty values are omitted from API requests. However, any field
  2381. // with an empty value appearing in NullFields will be sent to the
  2382. // server as null. It is an error if a field in this list has a
  2383. // non-empty value. This may be used to include null fields in Patch
  2384. // requests.
  2385. NullFields []string `json:"-"`
  2386. }
  2387. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2388. type NoMethod CompanionClickThroughOverride
  2389. raw := NoMethod(*s)
  2390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2391. }
  2392. // CompanionSetting: Companion Settings
  2393. type CompanionSetting struct {
  2394. // CompanionsDisabled: Whether companions are disabled for this
  2395. // placement.
  2396. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2397. // EnabledSizes: Whitelist of companion sizes to be served to this
  2398. // placement. Set this list to null or empty to serve all companion
  2399. // sizes.
  2400. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2401. // ImageOnly: Whether to serve only static images as companions.
  2402. ImageOnly bool `json:"imageOnly,omitempty"`
  2403. // Kind: Identifies what kind of resource this is. Value: the fixed
  2404. // string "dfareporting#companionSetting".
  2405. Kind string `json:"kind,omitempty"`
  2406. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2407. // to unconditionally include in API requests. By default, fields with
  2408. // empty values are omitted from API requests. However, any non-pointer,
  2409. // non-interface field appearing in ForceSendFields will be sent to the
  2410. // server regardless of whether the field is empty or not. This may be
  2411. // used to include empty fields in Patch requests.
  2412. ForceSendFields []string `json:"-"`
  2413. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2414. // include in API requests with the JSON null value. By default, fields
  2415. // with empty values are omitted from API requests. However, any field
  2416. // with an empty value appearing in NullFields will be sent to the
  2417. // server as null. It is an error if a field in this list has a
  2418. // non-empty value. This may be used to include null fields in Patch
  2419. // requests.
  2420. NullFields []string `json:"-"`
  2421. }
  2422. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2423. type NoMethod CompanionSetting
  2424. raw := NoMethod(*s)
  2425. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2426. }
  2427. // CompatibleFields: Represents a response to the queryCompatibleFields
  2428. // method.
  2429. type CompatibleFields struct {
  2430. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2431. // compatible to be selected for a report of type
  2432. // "CROSS_DIMENSION_REACH".
  2433. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2434. // FloodlightReportCompatibleFields: Contains items that are compatible
  2435. // to be selected for a report of type "FLOODLIGHT".
  2436. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2437. // Kind: The kind of resource this is, in this case
  2438. // dfareporting#compatibleFields.
  2439. Kind string `json:"kind,omitempty"`
  2440. // PathToConversionReportCompatibleFields: Contains items that are
  2441. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2442. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2443. // ReachReportCompatibleFields: Contains items that are compatible to be
  2444. // selected for a report of type "REACH".
  2445. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2446. // ReportCompatibleFields: Contains items that are compatible to be
  2447. // selected for a report of type "STANDARD".
  2448. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2449. // ServerResponse contains the HTTP response code and headers from the
  2450. // server.
  2451. googleapi.ServerResponse `json:"-"`
  2452. // ForceSendFields is a list of field names (e.g.
  2453. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2454. // include in API requests. By default, fields with empty values are
  2455. // omitted from API requests. However, any non-pointer, non-interface
  2456. // field appearing in ForceSendFields will be sent to the server
  2457. // regardless of whether the field is empty or not. This may be used to
  2458. // include empty fields in Patch requests.
  2459. ForceSendFields []string `json:"-"`
  2460. // NullFields is a list of field names (e.g.
  2461. // "CrossDimensionReachReportCompatibleFields") to include in API
  2462. // requests with the JSON null value. By default, fields with empty
  2463. // values are omitted from API requests. However, any field with an
  2464. // empty value appearing in NullFields will be sent to the server as
  2465. // null. It is an error if a field in this list has a non-empty value.
  2466. // This may be used to include null fields in Patch requests.
  2467. NullFields []string `json:"-"`
  2468. }
  2469. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2470. type NoMethod CompatibleFields
  2471. raw := NoMethod(*s)
  2472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2473. }
  2474. // ConnectionType: Contains information about an internet connection
  2475. // type that can be targeted by ads. Clients can use the connection type
  2476. // to target mobile vs. broadband users.
  2477. type ConnectionType struct {
  2478. // Id: ID of this connection type.
  2479. Id int64 `json:"id,omitempty,string"`
  2480. // Kind: Identifies what kind of resource this is. Value: the fixed
  2481. // string "dfareporting#connectionType".
  2482. Kind string `json:"kind,omitempty"`
  2483. // Name: Name of this connection type.
  2484. Name string `json:"name,omitempty"`
  2485. // ServerResponse contains the HTTP response code and headers from the
  2486. // server.
  2487. googleapi.ServerResponse `json:"-"`
  2488. // ForceSendFields is a list of field names (e.g. "Id") to
  2489. // unconditionally include in API requests. By default, fields with
  2490. // empty values are omitted from API requests. However, any non-pointer,
  2491. // non-interface field appearing in ForceSendFields will be sent to the
  2492. // server regardless of whether the field is empty or not. This may be
  2493. // used to include empty fields in Patch requests.
  2494. ForceSendFields []string `json:"-"`
  2495. // NullFields is a list of field names (e.g. "Id") to include in API
  2496. // requests with the JSON null value. By default, fields with empty
  2497. // values are omitted from API requests. However, any field with an
  2498. // empty value appearing in NullFields will be sent to the server as
  2499. // null. It is an error if a field in this list has a non-empty value.
  2500. // This may be used to include null fields in Patch requests.
  2501. NullFields []string `json:"-"`
  2502. }
  2503. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2504. type NoMethod ConnectionType
  2505. raw := NoMethod(*s)
  2506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2507. }
  2508. // ConnectionTypesListResponse: Connection Type List Response
  2509. type ConnectionTypesListResponse struct {
  2510. // ConnectionTypes: Collection of connection types such as broadband and
  2511. // mobile.
  2512. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2513. // Kind: Identifies what kind of resource this is. Value: the fixed
  2514. // string "dfareporting#connectionTypesListResponse".
  2515. Kind string `json:"kind,omitempty"`
  2516. // ServerResponse contains the HTTP response code and headers from the
  2517. // server.
  2518. googleapi.ServerResponse `json:"-"`
  2519. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2520. // unconditionally include in API requests. By default, fields with
  2521. // empty values are omitted from API requests. However, any non-pointer,
  2522. // non-interface field appearing in ForceSendFields will be sent to the
  2523. // server regardless of whether the field is empty or not. This may be
  2524. // used to include empty fields in Patch requests.
  2525. ForceSendFields []string `json:"-"`
  2526. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2527. // include in API requests with the JSON null value. By default, fields
  2528. // with empty values are omitted from API requests. However, any field
  2529. // with an empty value appearing in NullFields will be sent to the
  2530. // server as null. It is an error if a field in this list has a
  2531. // non-empty value. This may be used to include null fields in Patch
  2532. // requests.
  2533. NullFields []string `json:"-"`
  2534. }
  2535. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2536. type NoMethod ConnectionTypesListResponse
  2537. raw := NoMethod(*s)
  2538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2539. }
  2540. // ContentCategoriesListResponse: Content Category List Response
  2541. type ContentCategoriesListResponse struct {
  2542. // ContentCategories: Content category collection.
  2543. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2544. // Kind: Identifies what kind of resource this is. Value: the fixed
  2545. // string "dfareporting#contentCategoriesListResponse".
  2546. Kind string `json:"kind,omitempty"`
  2547. // NextPageToken: Pagination token to be used for the next list
  2548. // operation.
  2549. NextPageToken string `json:"nextPageToken,omitempty"`
  2550. // ServerResponse contains the HTTP response code and headers from the
  2551. // server.
  2552. googleapi.ServerResponse `json:"-"`
  2553. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2554. // to unconditionally include in API requests. By default, fields with
  2555. // empty values are omitted from API requests. However, any non-pointer,
  2556. // non-interface field appearing in ForceSendFields will be sent to the
  2557. // server regardless of whether the field is empty or not. This may be
  2558. // used to include empty fields in Patch requests.
  2559. ForceSendFields []string `json:"-"`
  2560. // NullFields is a list of field names (e.g. "ContentCategories") to
  2561. // include in API requests with the JSON null value. By default, fields
  2562. // with empty values are omitted from API requests. However, any field
  2563. // with an empty value appearing in NullFields will be sent to the
  2564. // server as null. It is an error if a field in this list has a
  2565. // non-empty value. This may be used to include null fields in Patch
  2566. // requests.
  2567. NullFields []string `json:"-"`
  2568. }
  2569. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2570. type NoMethod ContentCategoriesListResponse
  2571. raw := NoMethod(*s)
  2572. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2573. }
  2574. // ContentCategory: Organizes placements according to the contents of
  2575. // their associated webpages.
  2576. type ContentCategory struct {
  2577. // AccountId: Account ID of this content category. This is a read-only
  2578. // field that can be left blank.
  2579. AccountId int64 `json:"accountId,omitempty,string"`
  2580. // Id: ID of this content category. This is a read-only, auto-generated
  2581. // field.
  2582. Id int64 `json:"id,omitempty,string"`
  2583. // Kind: Identifies what kind of resource this is. Value: the fixed
  2584. // string "dfareporting#contentCategory".
  2585. Kind string `json:"kind,omitempty"`
  2586. // Name: Name of this content category. This is a required field and
  2587. // must be less than 256 characters long and unique among content
  2588. // categories of the same account.
  2589. Name string `json:"name,omitempty"`
  2590. // ServerResponse contains the HTTP response code and headers from the
  2591. // server.
  2592. googleapi.ServerResponse `json:"-"`
  2593. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2594. // unconditionally include in API requests. By default, fields with
  2595. // empty values are omitted from API requests. However, any non-pointer,
  2596. // non-interface field appearing in ForceSendFields will be sent to the
  2597. // server regardless of whether the field is empty or not. This may be
  2598. // used to include empty fields in Patch requests.
  2599. ForceSendFields []string `json:"-"`
  2600. // NullFields is a list of field names (e.g. "AccountId") to include in
  2601. // API requests with the JSON null value. By default, fields with empty
  2602. // values are omitted from API requests. However, any field with an
  2603. // empty value appearing in NullFields will be sent to the server as
  2604. // null. It is an error if a field in this list has a non-empty value.
  2605. // This may be used to include null fields in Patch requests.
  2606. NullFields []string `json:"-"`
  2607. }
  2608. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2609. type NoMethod ContentCategory
  2610. raw := NoMethod(*s)
  2611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2612. }
  2613. // Conversion: A Conversion represents when a user successfully performs
  2614. // a desired action after seeing an ad.
  2615. type Conversion struct {
  2616. // ChildDirectedTreatment: Whether the conversion was directed toward
  2617. // children.
  2618. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2619. // CustomVariables: Custom floodlight variables.
  2620. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2621. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2622. // encryptionInfo should also be specified. This field is mutually
  2623. // exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid.
  2624. // This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a
  2625. // required field.
  2626. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2627. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2628. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2629. // be used in the inserted conversion. If no such user ID is found then
  2630. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2631. // When set, encryptionInfo should also be specified. This field may
  2632. // only be used when calling batchinsert; it is not supported by
  2633. // batchupdate. This field is mutually exclusive with encryptedUserId,
  2634. // mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId
  2635. // or gclid is a required field.
  2636. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2637. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2638. // is a required field.
  2639. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2640. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2641. // conversion. This is a required field.
  2642. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2643. // Gclid: The Google click ID. This field is mutually exclusive with
  2644. // encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This
  2645. // or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId
  2646. // is a required field.
  2647. Gclid string `json:"gclid,omitempty"`
  2648. // Kind: Identifies what kind of resource this is. Value: the fixed
  2649. // string "dfareporting#conversion".
  2650. Kind string `json:"kind,omitempty"`
  2651. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2652. // true, the conversion will be used for reporting but not targeting.
  2653. // This will prevent remarketing.
  2654. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2655. // MobileDeviceId: The mobile device ID. This field is mutually
  2656. // exclusive with encryptedUserId, encryptedUserIdCandidates[] and
  2657. // gclid. This or encryptedUserId or encryptedUserIdCandidates[] or
  2658. // gclid is a required field.
  2659. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2660. // Ordinal: The ordinal of the conversion. Use this field to control how
  2661. // conversions of the same user and day are de-duplicated. This is a
  2662. // required field.
  2663. Ordinal string `json:"ordinal,omitempty"`
  2664. // Quantity: The quantity of the conversion.
  2665. Quantity int64 `json:"quantity,omitempty,string"`
  2666. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2667. // This is a required field.
  2668. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2669. // Value: The value of the conversion.
  2670. Value float64 `json:"value,omitempty"`
  2671. // ForceSendFields is a list of field names (e.g.
  2672. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2673. // By default, fields with empty values are omitted from API requests.
  2674. // However, any non-pointer, non-interface field appearing in
  2675. // ForceSendFields will be sent to the server regardless of whether the
  2676. // field is empty or not. This may be used to include empty fields in
  2677. // Patch requests.
  2678. ForceSendFields []string `json:"-"`
  2679. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2680. // to include in API requests with the JSON null value. By default,
  2681. // fields with empty values are omitted from API requests. However, any
  2682. // field with an empty value appearing in NullFields will be sent to the
  2683. // server as null. It is an error if a field in this list has a
  2684. // non-empty value. This may be used to include null fields in Patch
  2685. // requests.
  2686. NullFields []string `json:"-"`
  2687. }
  2688. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2689. type NoMethod Conversion
  2690. raw := NoMethod(*s)
  2691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2692. }
  2693. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2694. type NoMethod Conversion
  2695. var s1 struct {
  2696. Value gensupport.JSONFloat64 `json:"value"`
  2697. *NoMethod
  2698. }
  2699. s1.NoMethod = (*NoMethod)(s)
  2700. if err := json.Unmarshal(data, &s1); err != nil {
  2701. return err
  2702. }
  2703. s.Value = float64(s1.Value)
  2704. return nil
  2705. }
  2706. // ConversionError: The error code and description for a conversion that
  2707. // failed to insert or update.
  2708. type ConversionError struct {
  2709. // Code: The error code.
  2710. //
  2711. // Possible values:
  2712. // "INTERNAL"
  2713. // "INVALID_ARGUMENT"
  2714. // "NOT_FOUND"
  2715. // "PERMISSION_DENIED"
  2716. Code string `json:"code,omitempty"`
  2717. // Kind: Identifies what kind of resource this is. Value: the fixed
  2718. // string "dfareporting#conversionError".
  2719. Kind string `json:"kind,omitempty"`
  2720. // Message: A description of the error.
  2721. Message string `json:"message,omitempty"`
  2722. // ForceSendFields is a list of field names (e.g. "Code") to
  2723. // unconditionally include in API requests. By default, fields with
  2724. // empty values are omitted from API requests. However, any non-pointer,
  2725. // non-interface field appearing in ForceSendFields will be sent to the
  2726. // server regardless of whether the field is empty or not. This may be
  2727. // used to include empty fields in Patch requests.
  2728. ForceSendFields []string `json:"-"`
  2729. // NullFields is a list of field names (e.g. "Code") to include in API
  2730. // requests with the JSON null value. By default, fields with empty
  2731. // values are omitted from API requests. However, any field with an
  2732. // empty value appearing in NullFields will be sent to the server as
  2733. // null. It is an error if a field in this list has a non-empty value.
  2734. // This may be used to include null fields in Patch requests.
  2735. NullFields []string `json:"-"`
  2736. }
  2737. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2738. type NoMethod ConversionError
  2739. raw := NoMethod(*s)
  2740. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2741. }
  2742. // ConversionStatus: The original conversion that was inserted or
  2743. // updated and whether there were any errors.
  2744. type ConversionStatus struct {
  2745. // Conversion: The original conversion that was inserted or updated.
  2746. Conversion *Conversion `json:"conversion,omitempty"`
  2747. // Errors: A list of errors related to this conversion.
  2748. Errors []*ConversionError `json:"errors,omitempty"`
  2749. // Kind: Identifies what kind of resource this is. Value: the fixed
  2750. // string "dfareporting#conversionStatus".
  2751. Kind string `json:"kind,omitempty"`
  2752. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2753. // unconditionally include in API requests. By default, fields with
  2754. // empty values are omitted from API requests. However, any non-pointer,
  2755. // non-interface field appearing in ForceSendFields will be sent to the
  2756. // server regardless of whether the field is empty or not. This may be
  2757. // used to include empty fields in Patch requests.
  2758. ForceSendFields []string `json:"-"`
  2759. // NullFields is a list of field names (e.g. "Conversion") to include in
  2760. // API requests with the JSON null value. By default, fields with empty
  2761. // values are omitted from API requests. However, any field with an
  2762. // empty value appearing in NullFields will be sent to the server as
  2763. // null. It is an error if a field in this list has a non-empty value.
  2764. // This may be used to include null fields in Patch requests.
  2765. NullFields []string `json:"-"`
  2766. }
  2767. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2768. type NoMethod ConversionStatus
  2769. raw := NoMethod(*s)
  2770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2771. }
  2772. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2773. type ConversionsBatchInsertRequest struct {
  2774. // Conversions: The set of conversions to insert.
  2775. Conversions []*Conversion `json:"conversions,omitempty"`
  2776. // EncryptionInfo: Describes how encryptedUserId or
  2777. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2778. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2779. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2780. // Kind: Identifies what kind of resource this is. Value: the fixed
  2781. // string "dfareporting#conversionsBatchInsertRequest".
  2782. Kind string `json:"kind,omitempty"`
  2783. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2784. // unconditionally include in API requests. By default, fields with
  2785. // empty values are omitted from API requests. However, any non-pointer,
  2786. // non-interface field appearing in ForceSendFields will be sent to the
  2787. // server regardless of whether the field is empty or not. This may be
  2788. // used to include empty fields in Patch requests.
  2789. ForceSendFields []string `json:"-"`
  2790. // NullFields is a list of field names (e.g. "Conversions") to include
  2791. // in API requests with the JSON null value. By default, fields with
  2792. // empty values are omitted from API requests. However, any field with
  2793. // an empty value appearing in NullFields will be sent to the server as
  2794. // null. It is an error if a field in this list has a non-empty value.
  2795. // This may be used to include null fields in Patch requests.
  2796. NullFields []string `json:"-"`
  2797. }
  2798. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2799. type NoMethod ConversionsBatchInsertRequest
  2800. raw := NoMethod(*s)
  2801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2802. }
  2803. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2804. type ConversionsBatchInsertResponse struct {
  2805. // HasFailures: Indicates that some or all conversions failed to insert.
  2806. HasFailures bool `json:"hasFailures,omitempty"`
  2807. // Kind: Identifies what kind of resource this is. Value: the fixed
  2808. // string "dfareporting#conversionsBatchInsertResponse".
  2809. Kind string `json:"kind,omitempty"`
  2810. // Status: The insert status of each conversion. Statuses are returned
  2811. // in the same order that conversions are inserted.
  2812. Status []*ConversionStatus `json:"status,omitempty"`
  2813. // ServerResponse contains the HTTP response code and headers from the
  2814. // server.
  2815. googleapi.ServerResponse `json:"-"`
  2816. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2817. // unconditionally include in API requests. By default, fields with
  2818. // empty values are omitted from API requests. However, any non-pointer,
  2819. // non-interface field appearing in ForceSendFields will be sent to the
  2820. // server regardless of whether the field is empty or not. This may be
  2821. // used to include empty fields in Patch requests.
  2822. ForceSendFields []string `json:"-"`
  2823. // NullFields is a list of field names (e.g. "HasFailures") to include
  2824. // in API requests with the JSON null value. By default, fields with
  2825. // empty values are omitted from API requests. However, any field with
  2826. // an empty value appearing in NullFields will be sent to the server as
  2827. // null. It is an error if a field in this list has a non-empty value.
  2828. // This may be used to include null fields in Patch requests.
  2829. NullFields []string `json:"-"`
  2830. }
  2831. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2832. type NoMethod ConversionsBatchInsertResponse
  2833. raw := NoMethod(*s)
  2834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2835. }
  2836. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2837. type ConversionsBatchUpdateRequest struct {
  2838. // Conversions: The set of conversions to update.
  2839. Conversions []*Conversion `json:"conversions,omitempty"`
  2840. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2841. // required field if encryptedUserId is used.
  2842. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2843. // Kind: Identifies what kind of resource this is. Value: the fixed
  2844. // string "dfareporting#conversionsBatchUpdateRequest".
  2845. Kind string `json:"kind,omitempty"`
  2846. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2847. // unconditionally include in API requests. By default, fields with
  2848. // empty values are omitted from API requests. However, any non-pointer,
  2849. // non-interface field appearing in ForceSendFields will be sent to the
  2850. // server regardless of whether the field is empty or not. This may be
  2851. // used to include empty fields in Patch requests.
  2852. ForceSendFields []string `json:"-"`
  2853. // NullFields is a list of field names (e.g. "Conversions") to include
  2854. // in API requests with the JSON null value. By default, fields with
  2855. // empty values are omitted from API requests. However, any field with
  2856. // an empty value appearing in NullFields will be sent to the server as
  2857. // null. It is an error if a field in this list has a non-empty value.
  2858. // This may be used to include null fields in Patch requests.
  2859. NullFields []string `json:"-"`
  2860. }
  2861. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2862. type NoMethod ConversionsBatchUpdateRequest
  2863. raw := NoMethod(*s)
  2864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2865. }
  2866. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2867. type ConversionsBatchUpdateResponse struct {
  2868. // HasFailures: Indicates that some or all conversions failed to update.
  2869. HasFailures bool `json:"hasFailures,omitempty"`
  2870. // Kind: Identifies what kind of resource this is. Value: the fixed
  2871. // string "dfareporting#conversionsBatchUpdateResponse".
  2872. Kind string `json:"kind,omitempty"`
  2873. // Status: The update status of each conversion. Statuses are returned
  2874. // in the same order that conversions are updated.
  2875. Status []*ConversionStatus `json:"status,omitempty"`
  2876. // ServerResponse contains the HTTP response code and headers from the
  2877. // server.
  2878. googleapi.ServerResponse `json:"-"`
  2879. // ForceSendFields is a list of field names (e.g. "HasFailures") 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. "HasFailures") to include
  2887. // in API requests with the JSON null value. By default, fields with
  2888. // empty values are omitted from API requests. However, any field with
  2889. // an 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 *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2895. type NoMethod ConversionsBatchUpdateResponse
  2896. raw := NoMethod(*s)
  2897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2898. }
  2899. // CountriesListResponse: Country List Response
  2900. type CountriesListResponse struct {
  2901. // Countries: Country collection.
  2902. Countries []*Country `json:"countries,omitempty"`
  2903. // Kind: Identifies what kind of resource this is. Value: the fixed
  2904. // string "dfareporting#countriesListResponse".
  2905. Kind string `json:"kind,omitempty"`
  2906. // ServerResponse contains the HTTP response code and headers from the
  2907. // server.
  2908. googleapi.ServerResponse `json:"-"`
  2909. // ForceSendFields is a list of field names (e.g. "Countries") to
  2910. // unconditionally include in API requests. By default, fields with
  2911. // empty values are omitted from API requests. However, any non-pointer,
  2912. // non-interface field appearing in ForceSendFields will be sent to the
  2913. // server regardless of whether the field is empty or not. This may be
  2914. // used to include empty fields in Patch requests.
  2915. ForceSendFields []string `json:"-"`
  2916. // NullFields is a list of field names (e.g. "Countries") to include in
  2917. // API requests with the JSON null value. By default, fields with empty
  2918. // values are omitted from API requests. However, any field with an
  2919. // empty value appearing in NullFields will be sent to the server as
  2920. // null. It is an error if a field in this list has a non-empty value.
  2921. // This may be used to include null fields in Patch requests.
  2922. NullFields []string `json:"-"`
  2923. }
  2924. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2925. type NoMethod CountriesListResponse
  2926. raw := NoMethod(*s)
  2927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2928. }
  2929. // Country: Contains information about a country that can be targeted by
  2930. // ads.
  2931. type Country struct {
  2932. // CountryCode: Country code.
  2933. CountryCode string `json:"countryCode,omitempty"`
  2934. // DartId: DART ID of this country. This is the ID used for targeting
  2935. // and generating reports.
  2936. DartId int64 `json:"dartId,omitempty,string"`
  2937. // Kind: Identifies what kind of resource this is. Value: the fixed
  2938. // string "dfareporting#country".
  2939. Kind string `json:"kind,omitempty"`
  2940. // Name: Name of this country.
  2941. Name string `json:"name,omitempty"`
  2942. // SslEnabled: Whether ad serving supports secure servers in this
  2943. // country.
  2944. SslEnabled bool `json:"sslEnabled,omitempty"`
  2945. // ServerResponse contains the HTTP response code and headers from the
  2946. // server.
  2947. googleapi.ServerResponse `json:"-"`
  2948. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2949. // unconditionally include in API requests. By default, fields with
  2950. // empty values are omitted from API requests. However, any non-pointer,
  2951. // non-interface field appearing in ForceSendFields will be sent to the
  2952. // server regardless of whether the field is empty or not. This may be
  2953. // used to include empty fields in Patch requests.
  2954. ForceSendFields []string `json:"-"`
  2955. // NullFields is a list of field names (e.g. "CountryCode") to include
  2956. // in API requests with the JSON null value. By default, fields with
  2957. // empty values are omitted from API requests. However, any field with
  2958. // an empty value appearing in NullFields will be sent to the server as
  2959. // null. It is an error if a field in this list has a non-empty value.
  2960. // This may be used to include null fields in Patch requests.
  2961. NullFields []string `json:"-"`
  2962. }
  2963. func (s *Country) MarshalJSON() ([]byte, error) {
  2964. type NoMethod Country
  2965. raw := NoMethod(*s)
  2966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2967. }
  2968. // Creative: Contains properties of a Creative.
  2969. type Creative struct {
  2970. // AccountId: Account ID of this creative. This field, if left unset,
  2971. // will be auto-generated for both insert and update operations.
  2972. // Applicable to all creative types.
  2973. AccountId int64 `json:"accountId,omitempty,string"`
  2974. // Active: Whether the creative is active. Applicable to all creative
  2975. // types.
  2976. Active bool `json:"active,omitempty"`
  2977. // AdParameters: Ad parameters user for VPAID creative. This is a
  2978. // read-only field. Applicable to the following creative types: all
  2979. // VPAID.
  2980. AdParameters string `json:"adParameters,omitempty"`
  2981. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  2982. // customize the creative settings of a Rich Media ad running on your
  2983. // site without having to contact the advertiser. You can use keywords
  2984. // to dynamically change the look or functionality of a creative.
  2985. // Applicable to the following creative types: all RICH_MEDIA, and all
  2986. // VPAID.
  2987. AdTagKeys []string `json:"adTagKeys,omitempty"`
  2988. // AdvertiserId: Advertiser ID of this creative. This is a required
  2989. // field. Applicable to all creative types.
  2990. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  2991. // AllowScriptAccess: Whether script access is allowed for this
  2992. // creative. This is a read-only and deprecated field which will
  2993. // automatically be set to true on update. Applicable to the following
  2994. // creative types: FLASH_INPAGE.
  2995. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  2996. // Archived: Whether the creative is archived. Applicable to all
  2997. // creative types.
  2998. Archived bool `json:"archived,omitempty"`
  2999. // ArtworkType: Type of artwork used for the creative. This is a
  3000. // read-only field. Applicable to the following creative types: all
  3001. // RICH_MEDIA, and all VPAID.
  3002. //
  3003. // Possible values:
  3004. // "ARTWORK_TYPE_FLASH"
  3005. // "ARTWORK_TYPE_HTML5"
  3006. // "ARTWORK_TYPE_IMAGE"
  3007. // "ARTWORK_TYPE_MIXED"
  3008. ArtworkType string `json:"artworkType,omitempty"`
  3009. // AuthoringSource: Source application where creative was authored.
  3010. // Presently, only DBM authored creatives will have this field set.
  3011. // Applicable to all creative types.
  3012. //
  3013. // Possible values:
  3014. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3015. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3016. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3017. AuthoringSource string `json:"authoringSource,omitempty"`
  3018. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3019. // read-only field. Applicable to the following creative types:
  3020. // HTML5_BANNER.
  3021. //
  3022. // Possible values:
  3023. // "NINJA"
  3024. // "SWIFFY"
  3025. AuthoringTool string `json:"authoringTool,omitempty"`
  3026. // AutoAdvanceImages: Whether images are automatically advanced for
  3027. // image gallery creatives. Applicable to the following creative types:
  3028. // DISPLAY_IMAGE_GALLERY.
  3029. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3030. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3031. // for the background of the window area where the Flash file is
  3032. // displayed. Default is white. Applicable to the following creative
  3033. // types: FLASH_INPAGE.
  3034. BackgroundColor string `json:"backgroundColor,omitempty"`
  3035. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3036. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3037. // HTML_IMAGE.
  3038. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3039. // BackupImageFeatures: List of feature dependencies that will cause a
  3040. // backup image to be served if the browser that serves the ad does not
  3041. // support them. Feature dependencies are features that a browser must
  3042. // be able to support in order to render your HTML5 creative asset
  3043. // correctly. This field is initially auto-generated to contain all
  3044. // features detected by Campaign Manager for all the assets of this
  3045. // creative and can then be modified by the client. To reset this field,
  3046. // copy over all the creativeAssets' detected features. Applicable to
  3047. // the following creative types: HTML5_BANNER. Applicable to DISPLAY
  3048. // when the primary asset type is not HTML_IMAGE.
  3049. //
  3050. // Possible values:
  3051. // "APPLICATION_CACHE"
  3052. // "AUDIO"
  3053. // "CANVAS"
  3054. // "CANVAS_TEXT"
  3055. // "CSS_ANIMATIONS"
  3056. // "CSS_BACKGROUND_SIZE"
  3057. // "CSS_BORDER_IMAGE"
  3058. // "CSS_BORDER_RADIUS"
  3059. // "CSS_BOX_SHADOW"
  3060. // "CSS_COLUMNS"
  3061. // "CSS_FLEX_BOX"
  3062. // "CSS_FONT_FACE"
  3063. // "CSS_GENERATED_CONTENT"
  3064. // "CSS_GRADIENTS"
  3065. // "CSS_HSLA"
  3066. // "CSS_MULTIPLE_BGS"
  3067. // "CSS_OPACITY"
  3068. // "CSS_REFLECTIONS"
  3069. // "CSS_RGBA"
  3070. // "CSS_TEXT_SHADOW"
  3071. // "CSS_TRANSFORMS"
  3072. // "CSS_TRANSFORMS3D"
  3073. // "CSS_TRANSITIONS"
  3074. // "DRAG_AND_DROP"
  3075. // "GEO_LOCATION"
  3076. // "HASH_CHANGE"
  3077. // "HISTORY"
  3078. // "INDEXED_DB"
  3079. // "INLINE_SVG"
  3080. // "INPUT_ATTR_AUTOCOMPLETE"
  3081. // "INPUT_ATTR_AUTOFOCUS"
  3082. // "INPUT_ATTR_LIST"
  3083. // "INPUT_ATTR_MAX"
  3084. // "INPUT_ATTR_MIN"
  3085. // "INPUT_ATTR_MULTIPLE"
  3086. // "INPUT_ATTR_PATTERN"
  3087. // "INPUT_ATTR_PLACEHOLDER"
  3088. // "INPUT_ATTR_REQUIRED"
  3089. // "INPUT_ATTR_STEP"
  3090. // "INPUT_TYPE_COLOR"
  3091. // "INPUT_TYPE_DATE"
  3092. // "INPUT_TYPE_DATETIME"
  3093. // "INPUT_TYPE_DATETIME_LOCAL"
  3094. // "INPUT_TYPE_EMAIL"
  3095. // "INPUT_TYPE_MONTH"
  3096. // "INPUT_TYPE_NUMBER"
  3097. // "INPUT_TYPE_RANGE"
  3098. // "INPUT_TYPE_SEARCH"
  3099. // "INPUT_TYPE_TEL"
  3100. // "INPUT_TYPE_TIME"
  3101. // "INPUT_TYPE_URL"
  3102. // "INPUT_TYPE_WEEK"
  3103. // "LOCAL_STORAGE"
  3104. // "POST_MESSAGE"
  3105. // "SESSION_STORAGE"
  3106. // "SMIL"
  3107. // "SVG_CLIP_PATHS"
  3108. // "SVG_FE_IMAGE"
  3109. // "SVG_FILTERS"
  3110. // "SVG_HREF"
  3111. // "TOUCH"
  3112. // "VIDEO"
  3113. // "WEBGL"
  3114. // "WEB_SOCKETS"
  3115. // "WEB_SQL_DATABASE"
  3116. // "WEB_WORKERS"
  3117. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3118. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3119. // backup image. Applicable to the following creative types: DISPLAY
  3120. // when the primary asset type is not HTML_IMAGE.
  3121. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3122. // BackupImageTargetWindow: Target window for backup image. Applicable
  3123. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3124. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3125. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3126. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3127. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3128. // the assets associated with this creative. After creating a flash
  3129. // asset, detected click tags will be returned in the
  3130. // creativeAssetMetadata. When inserting the creative, populate the
  3131. // creative clickTags field using the creativeAssetMetadata.clickTags
  3132. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3133. // one entry in this list for each image creative asset. A click tag is
  3134. // matched with a corresponding creative asset by matching the
  3135. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3136. // field. Applicable to the following creative types:
  3137. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3138. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3139. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3140. // CommercialId: Industry standard ID assigned to creative for reach and
  3141. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3142. CommercialId string `json:"commercialId,omitempty"`
  3143. // CompanionCreatives: List of companion creatives assigned to an
  3144. // in-Stream video creative. Acceptable values include IDs of existing
  3145. // flash and image creatives. Applicable to the following creative
  3146. // types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection
  3147. // set to false.
  3148. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3149. // Compatibility: Compatibilities associated with this creative. This is
  3150. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3151. // rendering either on desktop or on mobile devices or in mobile apps
  3152. // for regular or interstitial ads, respectively. APP and
  3153. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3154. // creatives may have these compatibilities since new creatives will
  3155. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3156. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3157. // with the VAST standard. Applicable to all creative types.
  3158. //
  3159. // Acceptable values are:
  3160. // - "APP"
  3161. // - "APP_INTERSTITIAL"
  3162. // - "IN_STREAM_VIDEO"
  3163. // - "DISPLAY"
  3164. // - "DISPLAY_INTERSTITIAL"
  3165. //
  3166. // Possible values:
  3167. // "APP"
  3168. // "APP_INTERSTITIAL"
  3169. // "DISPLAY"
  3170. // "DISPLAY_INTERSTITIAL"
  3171. // "IN_STREAM_AUDIO"
  3172. // "IN_STREAM_VIDEO"
  3173. Compatibility []string `json:"compatibility,omitempty"`
  3174. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3175. // creative need to be automatically converted to HTML5. This flag is
  3176. // enabled by default and users can choose to disable it if they don't
  3177. // want the system to generate and use HTML5 asset for this creative.
  3178. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3179. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3180. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3181. // CounterCustomEvents: List of counter events configured for the
  3182. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3183. // and auto-generated from clickTags. Applicable to the following
  3184. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3185. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3186. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3187. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3188. // CreativeAssets: Assets associated with a creative. Applicable to all
  3189. // but the following creative types: INTERNAL_REDIRECT,
  3190. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3191. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3192. // CreativeFieldAssignments: Creative field assignments for this
  3193. // creative. Applicable to all creative types.
  3194. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3195. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3196. // Key-values let you customize the creative settings of a Rich Media ad
  3197. // running on your site without having to contact the advertiser. You
  3198. // can use key-values to dynamically change the look or functionality of
  3199. // a creative. Applicable to the following creative types: all
  3200. // RICH_MEDIA, and all VPAID.
  3201. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3202. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3203. // target individual assets in this creative. When set to true
  3204. // creativeAssetSelection must be set. This also controls asset-level
  3205. // companions. When this is true, companion creatives should be assigned
  3206. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3207. // creatives.
  3208. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3209. // ExitCustomEvents: List of exit events configured for the creative.
  3210. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3211. // and auto-generated from clickTags, For DISPLAY, an event is also
  3212. // created from the backupImageReportingLabel. Applicable to the
  3213. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3214. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3215. // HTML_IMAGE.
  3216. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3217. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3218. // file communicate with either Flash Player or the program hosting
  3219. // Flash Player, such as a web browser. This is only triggered if
  3220. // allowScriptAccess field is true. Applicable to the following creative
  3221. // types: FLASH_INPAGE.
  3222. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3223. // HtmlCode: HTML code for the creative. This is a required field when
  3224. // applicable. This field is ignored if htmlCodeLocked is true.
  3225. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3226. // and HTML5_BANNER, and all RICH_MEDIA.
  3227. HtmlCode string `json:"htmlCode,omitempty"`
  3228. // HtmlCodeLocked: Whether HTML code is generated by Campaign Manager or
  3229. // manually entered. Set to true to ignore changes to htmlCode.
  3230. // Applicable to the following creative types: FLASH_INPAGE and
  3231. // HTML5_BANNER.
  3232. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3233. // Id: ID of this creative. This is a read-only, auto-generated field.
  3234. // Applicable to all creative types.
  3235. Id int64 `json:"id,omitempty,string"`
  3236. // IdDimensionValue: Dimension value for the ID of this creative. This
  3237. // is a read-only field. Applicable to all creative types.
  3238. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3239. // Kind: Identifies what kind of resource this is. Value: the fixed
  3240. // string "dfareporting#creative".
  3241. Kind string `json:"kind,omitempty"`
  3242. // LastModifiedInfo: Creative last modification information. This is a
  3243. // read-only field. Applicable to all creative types.
  3244. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3245. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3246. // associated with rich media and VPAID creatives. This is a read-only
  3247. // field. Applicable to the following creative types: all RICH_MEDIA,
  3248. // and all VPAID.
  3249. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3250. // Name: Name of the creative. This is a required field and must be less
  3251. // than 256 characters long. Applicable to all creative types.
  3252. Name string `json:"name,omitempty"`
  3253. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3254. // to the following creative types: all RICH_MEDIA.
  3255. OverrideCss string `json:"overrideCss,omitempty"`
  3256. // PoliteLoadAssetId: The asset ID of the polite load image asset.
  3257. // Applicable to the creative type: DISPLAY.
  3258. PoliteLoadAssetId int64 `json:"politeLoadAssetId,omitempty,string"`
  3259. // ProgressOffset: Amount of time to play the video before counting a
  3260. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3261. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3262. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3263. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3264. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3265. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3266. // This is a required field when applicable. Applicable to the following
  3267. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3268. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3269. RedirectUrl string `json:"redirectUrl,omitempty"`
  3270. // RenderingId: ID of current rendering version. This is a read-only
  3271. // field. Applicable to all creative types.
  3272. RenderingId int64 `json:"renderingId,omitempty,string"`
  3273. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3274. // this creative. This is a read-only field. Applicable to all creative
  3275. // types.
  3276. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3277. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3278. // for this creative. For example, 11.2.202.235. This is a read-only
  3279. // field. Applicable to the following creative types: all RICH_MEDIA,
  3280. // and all VPAID.
  3281. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3282. // RequiredFlashVersion: The internal Flash version for this creative as
  3283. // calculated by Studio. This is a read-only field. Applicable to the
  3284. // following creative types: FLASH_INPAGE all RICH_MEDIA, and all VPAID.
  3285. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3286. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3287. // Size: Size associated with this creative. When inserting or updating
  3288. // a creative either the size ID field or size width and height fields
  3289. // can be used. This is a required field when applicable; however for
  3290. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3291. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3292. // automatically set using the actual size of the associated image
  3293. // assets. Applicable to the following creative types: DISPLAY,
  3294. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3295. // RICH_MEDIA.
  3296. Size *Size `json:"size,omitempty"`
  3297. // SkipOffset: Amount of time to play the video before the skip button
  3298. // appears. Applicable to the following creative types: all
  3299. // INSTREAM_VIDEO.
  3300. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3301. // Skippable: Whether the user can choose to skip the creative.
  3302. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3303. // all VPAID.
  3304. Skippable bool `json:"skippable,omitempty"`
  3305. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3306. // read-only field. Applicable to all creative types.
  3307. SslCompliant bool `json:"sslCompliant,omitempty"`
  3308. // SslOverride: Whether creative should be treated as SSL compliant even
  3309. // if the system scan shows it's not. Applicable to all creative types.
  3310. SslOverride bool `json:"sslOverride,omitempty"`
  3311. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3312. // and VPAID creatives. This is a read-only field. Applicable to the
  3313. // following creative types: all RICH_MEDIA, and all VPAID.
  3314. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3315. // StudioCreativeId: Studio creative ID associated with rich media and
  3316. // VPAID creatives. This is a read-only field. Applicable to the
  3317. // following creative types: all RICH_MEDIA, and all VPAID.
  3318. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3319. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3320. // with rich media and VPAID creatives. This is a read-only field.
  3321. // Applicable to the following creative types: all RICH_MEDIA, and all
  3322. // VPAID.
  3323. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3324. // SubaccountId: Subaccount ID of this creative. This field, if left
  3325. // unset, will be auto-generated for both insert and update operations.
  3326. // Applicable to all creative types.
  3327. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3328. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3329. // backup image impressions. Applicable to the following creative types:
  3330. // all RICH_MEDIA.
  3331. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3332. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3333. // rich media impressions. Applicable to the following creative types:
  3334. // all RICH_MEDIA.
  3335. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3336. // ThirdPartyUrls: Third-party URLs for tracking in-stream video
  3337. // creative events. Applicable to the following creative types: all
  3338. // INSTREAM_VIDEO and all VPAID.
  3339. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3340. // TimerCustomEvents: List of timer events configured for the creative.
  3341. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3342. // auto-generated from clickTags. Applicable to the following creative
  3343. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3344. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3345. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3346. // TotalFileSize: Combined size of all creative assets. This is a
  3347. // read-only field. Applicable to the following creative types: all
  3348. // RICH_MEDIA, and all VPAID.
  3349. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3350. // Type: Type of this creative. This is a required field. Applicable to
  3351. // all creative types.
  3352. //
  3353. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3354. // existing creatives. New creatives should use DISPLAY as a replacement
  3355. // for these types.
  3356. //
  3357. // Possible values:
  3358. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3359. // "CUSTOM_DISPLAY"
  3360. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3361. // "DISPLAY"
  3362. // "DISPLAY_IMAGE_GALLERY"
  3363. // "DISPLAY_REDIRECT"
  3364. // "FLASH_INPAGE"
  3365. // "HTML5_BANNER"
  3366. // "IMAGE"
  3367. // "INSTREAM_AUDIO"
  3368. // "INSTREAM_VIDEO"
  3369. // "INSTREAM_VIDEO_REDIRECT"
  3370. // "INTERNAL_REDIRECT"
  3371. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3372. // "RICH_MEDIA_DISPLAY_BANNER"
  3373. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3374. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3375. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3376. // "RICH_MEDIA_IM_EXPAND"
  3377. // "RICH_MEDIA_INPAGE_FLOATING"
  3378. // "RICH_MEDIA_MOBILE_IN_APP"
  3379. // "RICH_MEDIA_PEEL_DOWN"
  3380. // "TRACKING_TEXT"
  3381. // "VPAID_LINEAR_VIDEO"
  3382. // "VPAID_NON_LINEAR_VIDEO"
  3383. Type string `json:"type,omitempty"`
  3384. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3385. // to the following creative types: INSTREAM_VIDEO and VPAID.
  3386. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3387. // Version: The version number helps you keep track of multiple versions
  3388. // of your creative in your reports. The version number will always be
  3389. // auto-generated during insert operations to start at 1. For tracking
  3390. // creatives the version cannot be incremented and will always remain at
  3391. // 1. For all other creative types the version can be incremented only
  3392. // by 1 during update operations. In addition, the version will be
  3393. // automatically incremented by 1 when undergoing Rich Media creative
  3394. // merging. Applicable to all creative types.
  3395. Version int64 `json:"version,omitempty"`
  3396. // VideoDescription: Description of the video ad. Applicable to the
  3397. // following creative types: all INSTREAM_VIDEO and all VPAID.
  3398. VideoDescription string `json:"videoDescription,omitempty"`
  3399. // VideoDuration: Creative video duration in seconds. This is a
  3400. // read-only field. Applicable to the following creative types:
  3401. // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.
  3402. VideoDuration float64 `json:"videoDuration,omitempty"`
  3403. // ServerResponse contains the HTTP response code and headers from the
  3404. // server.
  3405. googleapi.ServerResponse `json:"-"`
  3406. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3407. // unconditionally include in API requests. By default, fields with
  3408. // empty values are omitted from API requests. However, any non-pointer,
  3409. // non-interface field appearing in ForceSendFields will be sent to the
  3410. // server regardless of whether the field is empty or not. This may be
  3411. // used to include empty fields in Patch requests.
  3412. ForceSendFields []string `json:"-"`
  3413. // NullFields is a list of field names (e.g. "AccountId") to include in
  3414. // API requests with the JSON null value. By default, fields with empty
  3415. // values are omitted from API requests. However, any field with an
  3416. // empty value appearing in NullFields will be sent to the server as
  3417. // null. It is an error if a field in this list has a non-empty value.
  3418. // This may be used to include null fields in Patch requests.
  3419. NullFields []string `json:"-"`
  3420. }
  3421. func (s *Creative) MarshalJSON() ([]byte, error) {
  3422. type NoMethod Creative
  3423. raw := NoMethod(*s)
  3424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3425. }
  3426. func (s *Creative) UnmarshalJSON(data []byte) error {
  3427. type NoMethod Creative
  3428. var s1 struct {
  3429. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3430. *NoMethod
  3431. }
  3432. s1.NoMethod = (*NoMethod)(s)
  3433. if err := json.Unmarshal(data, &s1); err != nil {
  3434. return err
  3435. }
  3436. s.VideoDuration = float64(s1.VideoDuration)
  3437. return nil
  3438. }
  3439. // CreativeAsset: Creative Asset.
  3440. type CreativeAsset struct {
  3441. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3442. // This is a read-only field. Applicable to the following creative type:
  3443. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3444. // not HTML_IMAGE.
  3445. ActionScript3 bool `json:"actionScript3,omitempty"`
  3446. // Active: Whether the video asset is active. This is a read-only field
  3447. // for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following
  3448. // creative types: INSTREAM_VIDEO and all VPAID.
  3449. Active bool `json:"active,omitempty"`
  3450. // Alignment: Possible alignments for an asset. This is a read-only
  3451. // field. Applicable to the following creative types:
  3452. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3453. //
  3454. // Possible values:
  3455. // "ALIGNMENT_BOTTOM"
  3456. // "ALIGNMENT_LEFT"
  3457. // "ALIGNMENT_RIGHT"
  3458. // "ALIGNMENT_TOP"
  3459. Alignment string `json:"alignment,omitempty"`
  3460. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3461. // field. Applicable to the following creative types: all RICH_MEDIA.
  3462. //
  3463. // Possible values:
  3464. // "ARTWORK_TYPE_FLASH"
  3465. // "ARTWORK_TYPE_HTML5"
  3466. // "ARTWORK_TYPE_IMAGE"
  3467. // "ARTWORK_TYPE_MIXED"
  3468. ArtworkType string `json:"artworkType,omitempty"`
  3469. // AssetIdentifier: Identifier of this asset. This is the same
  3470. // identifier returned during creative asset insert operation. This is a
  3471. // required field. Applicable to all but the following creative types:
  3472. // all REDIRECT and TRACKING_TEXT.
  3473. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3474. // BackupImageExit: Exit event configured for the backup image.
  3475. // Applicable to the following creative types: all RICH_MEDIA.
  3476. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3477. // BitRate: Detected bit-rate for video asset. This is a read-only
  3478. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3479. // all VPAID.
  3480. BitRate int64 `json:"bitRate,omitempty"`
  3481. // ChildAssetType: Rich media child asset type. This is a read-only
  3482. // field. Applicable to the following creative types: all VPAID.
  3483. //
  3484. // Possible values:
  3485. // "CHILD_ASSET_TYPE_DATA"
  3486. // "CHILD_ASSET_TYPE_FLASH"
  3487. // "CHILD_ASSET_TYPE_IMAGE"
  3488. // "CHILD_ASSET_TYPE_VIDEO"
  3489. ChildAssetType string `json:"childAssetType,omitempty"`
  3490. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3491. // field. Applicable to the following creative types: all RICH_MEDIA and
  3492. // all VPAID. Additionally, applicable to assets whose displayType is
  3493. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3494. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3495. // CompanionCreativeIds: List of companion creatives assigned to an
  3496. // in-stream video creative asset. Acceptable values include IDs of
  3497. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3498. // creative type with dynamicAssetSelection set to true.
  3499. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3500. // CustomStartTimeValue: Custom start time in seconds for making the
  3501. // asset visible. Applicable to the following creative types: all
  3502. // RICH_MEDIA. Value must be greater than or equal to 0.
  3503. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3504. // DetectedFeatures: List of feature dependencies for the creative asset
  3505. // that are detected by Campaign Manager. Feature dependencies are
  3506. // features that a browser must be able to support in order to render
  3507. // your HTML5 creative correctly. This is a read-only, auto-generated
  3508. // field. Applicable to the following creative types: HTML5_BANNER.
  3509. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3510. //
  3511. // Possible values:
  3512. // "APPLICATION_CACHE"
  3513. // "AUDIO"
  3514. // "CANVAS"
  3515. // "CANVAS_TEXT"
  3516. // "CSS_ANIMATIONS"
  3517. // "CSS_BACKGROUND_SIZE"
  3518. // "CSS_BORDER_IMAGE"
  3519. // "CSS_BORDER_RADIUS"
  3520. // "CSS_BOX_SHADOW"
  3521. // "CSS_COLUMNS"
  3522. // "CSS_FLEX_BOX"
  3523. // "CSS_FONT_FACE"
  3524. // "CSS_GENERATED_CONTENT"
  3525. // "CSS_GRADIENTS"
  3526. // "CSS_HSLA"
  3527. // "CSS_MULTIPLE_BGS"
  3528. // "CSS_OPACITY"
  3529. // "CSS_REFLECTIONS"
  3530. // "CSS_RGBA"
  3531. // "CSS_TEXT_SHADOW"
  3532. // "CSS_TRANSFORMS"
  3533. // "CSS_TRANSFORMS3D"
  3534. // "CSS_TRANSITIONS"
  3535. // "DRAG_AND_DROP"
  3536. // "GEO_LOCATION"
  3537. // "HASH_CHANGE"
  3538. // "HISTORY"
  3539. // "INDEXED_DB"
  3540. // "INLINE_SVG"
  3541. // "INPUT_ATTR_AUTOCOMPLETE"
  3542. // "INPUT_ATTR_AUTOFOCUS"
  3543. // "INPUT_ATTR_LIST"
  3544. // "INPUT_ATTR_MAX"
  3545. // "INPUT_ATTR_MIN"
  3546. // "INPUT_ATTR_MULTIPLE"
  3547. // "INPUT_ATTR_PATTERN"
  3548. // "INPUT_ATTR_PLACEHOLDER"
  3549. // "INPUT_ATTR_REQUIRED"
  3550. // "INPUT_ATTR_STEP"
  3551. // "INPUT_TYPE_COLOR"
  3552. // "INPUT_TYPE_DATE"
  3553. // "INPUT_TYPE_DATETIME"
  3554. // "INPUT_TYPE_DATETIME_LOCAL"
  3555. // "INPUT_TYPE_EMAIL"
  3556. // "INPUT_TYPE_MONTH"
  3557. // "INPUT_TYPE_NUMBER"
  3558. // "INPUT_TYPE_RANGE"
  3559. // "INPUT_TYPE_SEARCH"
  3560. // "INPUT_TYPE_TEL"
  3561. // "INPUT_TYPE_TIME"
  3562. // "INPUT_TYPE_URL"
  3563. // "INPUT_TYPE_WEEK"
  3564. // "LOCAL_STORAGE"
  3565. // "POST_MESSAGE"
  3566. // "SESSION_STORAGE"
  3567. // "SMIL"
  3568. // "SVG_CLIP_PATHS"
  3569. // "SVG_FE_IMAGE"
  3570. // "SVG_FILTERS"
  3571. // "SVG_HREF"
  3572. // "TOUCH"
  3573. // "VIDEO"
  3574. // "WEBGL"
  3575. // "WEB_SOCKETS"
  3576. // "WEB_SQL_DATABASE"
  3577. // "WEB_WORKERS"
  3578. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3579. // DisplayType: Type of rich media asset. This is a read-only field.
  3580. // Applicable to the following creative types: all RICH_MEDIA.
  3581. //
  3582. // Possible values:
  3583. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3584. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3585. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3586. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3587. // "ASSET_DISPLAY_TYPE_FLOATING"
  3588. // "ASSET_DISPLAY_TYPE_INPAGE"
  3589. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3590. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3591. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3592. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3593. DisplayType string `json:"displayType,omitempty"`
  3594. // Duration: Duration in seconds for which an asset will be displayed.
  3595. // Applicable to the following creative types: INSTREAM_VIDEO and
  3596. // VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1.
  3597. Duration int64 `json:"duration,omitempty"`
  3598. // DurationType: Duration type for which an asset will be displayed.
  3599. // Applicable to the following creative types: all RICH_MEDIA.
  3600. //
  3601. // Possible values:
  3602. // "ASSET_DURATION_TYPE_AUTO"
  3603. // "ASSET_DURATION_TYPE_CUSTOM"
  3604. // "ASSET_DURATION_TYPE_NONE"
  3605. DurationType string `json:"durationType,omitempty"`
  3606. // ExpandedDimension: Detected expanded dimension for video asset. This
  3607. // is a read-only field. Applicable to the following creative types:
  3608. // INSTREAM_VIDEO and all VPAID.
  3609. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3610. // FileSize: File size associated with this creative asset. This is a
  3611. // read-only field. Applicable to all but the following creative types:
  3612. // all REDIRECT and TRACKING_TEXT.
  3613. FileSize int64 `json:"fileSize,omitempty,string"`
  3614. // FlashVersion: Flash version of the asset. This is a read-only field.
  3615. // Applicable to the following creative types: FLASH_INPAGE, all
  3616. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3617. // asset type is not HTML_IMAGE.
  3618. FlashVersion int64 `json:"flashVersion,omitempty"`
  3619. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3620. // Applicable to the following creative types: all RICH_MEDIA.
  3621. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3622. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3623. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3624. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3625. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3626. // a read-only field. Applicable to the following creative types: all
  3627. // RICH_MEDIA.
  3628. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3629. // Id: Numeric ID of this creative asset. This is a required field and
  3630. // should not be modified. Applicable to all but the following creative
  3631. // types: all REDIRECT and TRACKING_TEXT.
  3632. Id int64 `json:"id,omitempty,string"`
  3633. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3634. // read-only, auto-generated field.
  3635. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3636. // MimeType: Detected MIME type for video asset. This is a read-only
  3637. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3638. // all VPAID.
  3639. MimeType string `json:"mimeType,omitempty"`
  3640. // Offset: Offset position for an asset in collapsed mode. This is a
  3641. // read-only field. Applicable to the following creative types: all
  3642. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3643. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3644. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3645. Offset *OffsetPosition `json:"offset,omitempty"`
  3646. // Orientation: Orientation of video asset. This is a read-only,
  3647. // auto-generated field.
  3648. //
  3649. // Possible values:
  3650. // "LANDSCAPE"
  3651. // "PORTRAIT"
  3652. // "SQUARE"
  3653. Orientation string `json:"orientation,omitempty"`
  3654. // OriginalBackup: Whether the backup asset is original or changed by
  3655. // the user in Campaign Manager. Applicable to the following creative
  3656. // types: all RICH_MEDIA.
  3657. OriginalBackup bool `json:"originalBackup,omitempty"`
  3658. // Position: Offset position for an asset. Applicable to the following
  3659. // creative types: all RICH_MEDIA.
  3660. Position *OffsetPosition `json:"position,omitempty"`
  3661. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3662. // field. Applicable to the following creative types: all RICH_MEDIA.
  3663. //
  3664. // Possible values:
  3665. // "OFFSET_UNIT_PERCENT"
  3666. // "OFFSET_UNIT_PIXEL"
  3667. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3668. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3669. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3670. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3671. // Applicable to the following creative types: all RICH_MEDIA.
  3672. //
  3673. // Possible values:
  3674. // "OFFSET_UNIT_PERCENT"
  3675. // "OFFSET_UNIT_PIXEL"
  3676. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3677. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3678. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3679. // read-only field. Applicable to the following creative types:
  3680. // INSTREAM_VIDEO and all VPAID.
  3681. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3682. // Pushdown: Whether the asset pushes down other content. Applicable to
  3683. // the following creative types: all RICH_MEDIA. Additionally, only
  3684. // applicable when the asset offsets are 0, the collapsedSize.width
  3685. // matches size.width, and the collapsedSize.height is less than
  3686. // size.height.
  3687. Pushdown bool `json:"pushdown,omitempty"`
  3688. // PushdownDuration: Pushdown duration in seconds for an asset.
  3689. // Applicable to the following creative types: all
  3690. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3691. // field is true, the offsets are 0, the collapsedSize.width matches
  3692. // size.width, and the collapsedSize.height is less than size.height.
  3693. // Acceptable values are 0 to 9.99, inclusive.
  3694. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3695. // Role: Role of the asset in relation to creative. Applicable to all
  3696. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3697. // This is a required field.
  3698. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3699. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3700. // primary assets), and all VPAID creatives.
  3701. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3702. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3703. // type is not HTML_IMAGE.
  3704. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3705. // creatives.
  3706. // OTHER refers to assets from sources other than Campaign Manager, such
  3707. // as Studio uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3708. // creatives.
  3709. // PARENT_VIDEO refers to videos uploaded by the user in Campaign
  3710. // Manager and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3711. // creatives.
  3712. // TRANSCODED_VIDEO refers to videos transcoded by Campaign Manager from
  3713. // PARENT_VIDEO assets and is applicable to INSTREAM_VIDEO and
  3714. // VPAID_LINEAR_VIDEO creatives.
  3715. // ALTERNATE_VIDEO refers to the Campaign Manager representation of
  3716. // child asset videos from Studio, and is applicable to
  3717. // VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within
  3718. // Campaign Manager.
  3719. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3720. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3721. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3722. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3723. // creative.
  3724. //
  3725. // Possible values:
  3726. // "ADDITIONAL_FLASH"
  3727. // "ADDITIONAL_IMAGE"
  3728. // "ALTERNATE_VIDEO"
  3729. // "BACKUP_IMAGE"
  3730. // "OTHER"
  3731. // "PARENT_VIDEO"
  3732. // "PRIMARY"
  3733. // "TRANSCODED_VIDEO"
  3734. Role string `json:"role,omitempty"`
  3735. // Size: Size associated with this creative asset. This is a required
  3736. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3737. // if left blank, this field will be automatically set using the actual
  3738. // size of the associated image asset. Applicable to the following
  3739. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3740. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3741. // asset type is not HTML_IMAGE.
  3742. Size *Size `json:"size,omitempty"`
  3743. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3744. // field. Applicable to all but the following creative types: all
  3745. // REDIRECT and TRACKING_TEXT.
  3746. SslCompliant bool `json:"sslCompliant,omitempty"`
  3747. // StartTimeType: Initial wait time type before making the asset
  3748. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3749. //
  3750. // Possible values:
  3751. // "ASSET_START_TIME_TYPE_CUSTOM"
  3752. // "ASSET_START_TIME_TYPE_NONE"
  3753. StartTimeType string `json:"startTimeType,omitempty"`
  3754. // StreamingServingUrl: Streaming URL for video asset. This is a
  3755. // read-only field. Applicable to the following creative types:
  3756. // INSTREAM_VIDEO and all VPAID.
  3757. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3758. // Transparency: Whether the asset is transparent. Applicable to the
  3759. // following creative types: all RICH_MEDIA. Additionally, only
  3760. // applicable to HTML5 assets.
  3761. Transparency bool `json:"transparency,omitempty"`
  3762. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3763. // read-only field. Applicable to the following creative types: all
  3764. // RICH_MEDIA.
  3765. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3766. // VideoDuration: Detected video duration for video asset. This is a
  3767. // read-only field. Applicable to the following creative types:
  3768. // INSTREAM_VIDEO and all VPAID.
  3769. VideoDuration float64 `json:"videoDuration,omitempty"`
  3770. // WindowMode: Window mode options for flash assets. Applicable to the
  3771. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3772. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3773. // RICH_MEDIA_INPAGE_FLOATING.
  3774. //
  3775. // Possible values:
  3776. // "OPAQUE"
  3777. // "TRANSPARENT"
  3778. // "WINDOW"
  3779. WindowMode string `json:"windowMode,omitempty"`
  3780. // ZIndex: zIndex value of an asset. Applicable to the following
  3781. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3782. // assets whose displayType is NOT one of the following types:
  3783. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3784. // values are -999999999 to 999999999, inclusive.
  3785. ZIndex int64 `json:"zIndex,omitempty"`
  3786. // ZipFilename: File name of zip file. This is a read-only field.
  3787. // Applicable to the following creative types: HTML5_BANNER.
  3788. ZipFilename string `json:"zipFilename,omitempty"`
  3789. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3790. // to the following creative types: HTML5_BANNER.
  3791. ZipFilesize string `json:"zipFilesize,omitempty"`
  3792. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3793. // unconditionally include in API requests. By default, fields with
  3794. // empty values are omitted from API requests. However, any non-pointer,
  3795. // non-interface field appearing in ForceSendFields will be sent to the
  3796. // server regardless of whether the field is empty or not. This may be
  3797. // used to include empty fields in Patch requests.
  3798. ForceSendFields []string `json:"-"`
  3799. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3800. // in API requests with the JSON null value. By default, fields with
  3801. // empty values are omitted from API requests. However, any field with
  3802. // an empty value appearing in NullFields will be sent to the server as
  3803. // null. It is an error if a field in this list has a non-empty value.
  3804. // This may be used to include null fields in Patch requests.
  3805. NullFields []string `json:"-"`
  3806. }
  3807. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3808. type NoMethod CreativeAsset
  3809. raw := NoMethod(*s)
  3810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3811. }
  3812. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3813. type NoMethod CreativeAsset
  3814. var s1 struct {
  3815. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3816. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3817. *NoMethod
  3818. }
  3819. s1.NoMethod = (*NoMethod)(s)
  3820. if err := json.Unmarshal(data, &s1); err != nil {
  3821. return err
  3822. }
  3823. s.PushdownDuration = float64(s1.PushdownDuration)
  3824. s.VideoDuration = float64(s1.VideoDuration)
  3825. return nil
  3826. }
  3827. // CreativeAssetId: Creative Asset ID.
  3828. type CreativeAssetId struct {
  3829. // Name: Name of the creative asset. This is a required field while
  3830. // inserting an asset. After insertion, this assetIdentifier is used to
  3831. // identify the uploaded asset. Characters in the name must be
  3832. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3833. Name string `json:"name,omitempty"`
  3834. // Type: Type of asset to upload. This is a required field. FLASH and
  3835. // IMAGE are no longer supported for new uploads. All image assets
  3836. // should use HTML_IMAGE.
  3837. //
  3838. // Possible values:
  3839. // "FLASH"
  3840. // "HTML"
  3841. // "HTML_IMAGE"
  3842. // "IMAGE"
  3843. // "VIDEO"
  3844. Type string `json:"type,omitempty"`
  3845. // ForceSendFields is a list of field names (e.g. "Name") to
  3846. // unconditionally include in API requests. By default, fields with
  3847. // empty values are omitted from API requests. However, any non-pointer,
  3848. // non-interface field appearing in ForceSendFields will be sent to the
  3849. // server regardless of whether the field is empty or not. This may be
  3850. // used to include empty fields in Patch requests.
  3851. ForceSendFields []string `json:"-"`
  3852. // NullFields is a list of field names (e.g. "Name") to include in API
  3853. // requests with the JSON null value. By default, fields with empty
  3854. // values are omitted from API requests. However, any field with an
  3855. // empty value appearing in NullFields will be sent to the server as
  3856. // null. It is an error if a field in this list has a non-empty value.
  3857. // This may be used to include null fields in Patch requests.
  3858. NullFields []string `json:"-"`
  3859. }
  3860. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3861. type NoMethod CreativeAssetId
  3862. raw := NoMethod(*s)
  3863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3864. }
  3865. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3866. // creative asset file which will be uploaded or has already been
  3867. // uploaded. Refer to the creative sample code for how to upload assets
  3868. // and insert a creative.
  3869. type CreativeAssetMetadata struct {
  3870. // AssetIdentifier: ID of the creative asset. This is a required field.
  3871. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3872. // ClickTags: List of detected click tags for assets. This is a
  3873. // read-only auto-generated field.
  3874. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3875. // DetectedFeatures: List of feature dependencies for the creative asset
  3876. // that are detected by Campaign Manager. Feature dependencies are
  3877. // features that a browser must be able to support in order to render
  3878. // your HTML5 creative correctly. This is a read-only, auto-generated
  3879. // field.
  3880. //
  3881. // Possible values:
  3882. // "APPLICATION_CACHE"
  3883. // "AUDIO"
  3884. // "CANVAS"
  3885. // "CANVAS_TEXT"
  3886. // "CSS_ANIMATIONS"
  3887. // "CSS_BACKGROUND_SIZE"
  3888. // "CSS_BORDER_IMAGE"
  3889. // "CSS_BORDER_RADIUS"
  3890. // "CSS_BOX_SHADOW"
  3891. // "CSS_COLUMNS"
  3892. // "CSS_FLEX_BOX"
  3893. // "CSS_FONT_FACE"
  3894. // "CSS_GENERATED_CONTENT"
  3895. // "CSS_GRADIENTS"
  3896. // "CSS_HSLA"
  3897. // "CSS_MULTIPLE_BGS"
  3898. // "CSS_OPACITY"
  3899. // "CSS_REFLECTIONS"
  3900. // "CSS_RGBA"
  3901. // "CSS_TEXT_SHADOW"
  3902. // "CSS_TRANSFORMS"
  3903. // "CSS_TRANSFORMS3D"
  3904. // "CSS_TRANSITIONS"
  3905. // "DRAG_AND_DROP"
  3906. // "GEO_LOCATION"
  3907. // "HASH_CHANGE"
  3908. // "HISTORY"
  3909. // "INDEXED_DB"
  3910. // "INLINE_SVG"
  3911. // "INPUT_ATTR_AUTOCOMPLETE"
  3912. // "INPUT_ATTR_AUTOFOCUS"
  3913. // "INPUT_ATTR_LIST"
  3914. // "INPUT_ATTR_MAX"
  3915. // "INPUT_ATTR_MIN"
  3916. // "INPUT_ATTR_MULTIPLE"
  3917. // "INPUT_ATTR_PATTERN"
  3918. // "INPUT_ATTR_PLACEHOLDER"
  3919. // "INPUT_ATTR_REQUIRED"
  3920. // "INPUT_ATTR_STEP"
  3921. // "INPUT_TYPE_COLOR"
  3922. // "INPUT_TYPE_DATE"
  3923. // "INPUT_TYPE_DATETIME"
  3924. // "INPUT_TYPE_DATETIME_LOCAL"
  3925. // "INPUT_TYPE_EMAIL"
  3926. // "INPUT_TYPE_MONTH"
  3927. // "INPUT_TYPE_NUMBER"
  3928. // "INPUT_TYPE_RANGE"
  3929. // "INPUT_TYPE_SEARCH"
  3930. // "INPUT_TYPE_TEL"
  3931. // "INPUT_TYPE_TIME"
  3932. // "INPUT_TYPE_URL"
  3933. // "INPUT_TYPE_WEEK"
  3934. // "LOCAL_STORAGE"
  3935. // "POST_MESSAGE"
  3936. // "SESSION_STORAGE"
  3937. // "SMIL"
  3938. // "SVG_CLIP_PATHS"
  3939. // "SVG_FE_IMAGE"
  3940. // "SVG_FILTERS"
  3941. // "SVG_HREF"
  3942. // "TOUCH"
  3943. // "VIDEO"
  3944. // "WEBGL"
  3945. // "WEB_SOCKETS"
  3946. // "WEB_SQL_DATABASE"
  3947. // "WEB_WORKERS"
  3948. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3949. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  3950. // field.
  3951. Id int64 `json:"id,omitempty,string"`
  3952. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  3953. // This is a read-only, auto-generated field.
  3954. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3955. // Kind: Identifies what kind of resource this is. Value: the fixed
  3956. // string "dfareporting#creativeAssetMetadata".
  3957. Kind string `json:"kind,omitempty"`
  3958. // WarnedValidationRules: Rules validated during code generation that
  3959. // generated a warning. This is a read-only, auto-generated
  3960. // field.
  3961. //
  3962. // Possible values are:
  3963. // - "ADMOB_REFERENCED"
  3964. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  3965. // - "ASSET_INVALID"
  3966. // - "CLICK_TAG_HARD_CODED"
  3967. // - "CLICK_TAG_INVALID"
  3968. // - "CLICK_TAG_IN_GWD"
  3969. // - "CLICK_TAG_MISSING"
  3970. // - "CLICK_TAG_MORE_THAN_ONE"
  3971. // - "CLICK_TAG_NON_TOP_LEVEL"
  3972. // - "COMPONENT_UNSUPPORTED_DCM"
  3973. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  3974. // - "EXTERNAL_FILE_REFERENCED"
  3975. // - "FILE_DETAIL_EMPTY"
  3976. // - "FILE_TYPE_INVALID"
  3977. // - "GWD_PROPERTIES_INVALID"
  3978. // - "HTML5_FEATURE_UNSUPPORTED"
  3979. // - "LINKED_FILE_NOT_FOUND"
  3980. // - "MAX_FLASH_VERSION_11"
  3981. // - "MRAID_REFERENCED"
  3982. // - "NOT_SSL_COMPLIANT"
  3983. // - "ORPHANED_ASSET"
  3984. // - "PRIMARY_HTML_MISSING"
  3985. // - "SVG_INVALID"
  3986. // - "ZIP_INVALID"
  3987. //
  3988. // Possible values:
  3989. // "ADMOB_REFERENCED"
  3990. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  3991. // "ASSET_INVALID"
  3992. // "CLICK_TAG_HARD_CODED"
  3993. // "CLICK_TAG_INVALID"
  3994. // "CLICK_TAG_IN_GWD"
  3995. // "CLICK_TAG_MISSING"
  3996. // "CLICK_TAG_MORE_THAN_ONE"
  3997. // "CLICK_TAG_NON_TOP_LEVEL"
  3998. // "COMPONENT_UNSUPPORTED_DCM"
  3999. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  4000. // "EXTERNAL_FILE_REFERENCED"
  4001. // "FILE_DETAIL_EMPTY"
  4002. // "FILE_TYPE_INVALID"
  4003. // "GWD_PROPERTIES_INVALID"
  4004. // "HTML5_FEATURE_UNSUPPORTED"
  4005. // "LINKED_FILE_NOT_FOUND"
  4006. // "MAX_FLASH_VERSION_11"
  4007. // "MRAID_REFERENCED"
  4008. // "NOT_SSL_COMPLIANT"
  4009. // "ORPHANED_ASSET"
  4010. // "PRIMARY_HTML_MISSING"
  4011. // "SVG_INVALID"
  4012. // "ZIP_INVALID"
  4013. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4014. // ServerResponse contains the HTTP response code and headers from the
  4015. // server.
  4016. googleapi.ServerResponse `json:"-"`
  4017. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4018. // unconditionally include in API requests. By default, fields with
  4019. // empty values are omitted from API requests. However, any non-pointer,
  4020. // non-interface field appearing in ForceSendFields will be sent to the
  4021. // server regardless of whether the field is empty or not. This may be
  4022. // used to include empty fields in Patch requests.
  4023. ForceSendFields []string `json:"-"`
  4024. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4025. // include in API requests with the JSON null value. By default, fields
  4026. // with empty values are omitted from API requests. However, any field
  4027. // with an empty value appearing in NullFields will be sent to the
  4028. // server as null. It is an error if a field in this list has a
  4029. // non-empty value. This may be used to include null fields in Patch
  4030. // requests.
  4031. NullFields []string `json:"-"`
  4032. }
  4033. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4034. type NoMethod CreativeAssetMetadata
  4035. raw := NoMethod(*s)
  4036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4037. }
  4038. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4039. // selection and a default asset in case none of the rules match.
  4040. // Applicable to INSTREAM_VIDEO creatives.
  4041. type CreativeAssetSelection struct {
  4042. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4043. // the parent assets in this creative, and will be served if none of the
  4044. // rules match. This is a required field.
  4045. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4046. // Rules: Rules determine which asset will be served to a viewer. Rules
  4047. // will be evaluated in the order in which they are stored in this list.
  4048. // This list must contain at least one rule. Applicable to
  4049. // INSTREAM_VIDEO creatives.
  4050. Rules []*Rule `json:"rules,omitempty"`
  4051. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4052. // unconditionally include in API requests. By default, fields with
  4053. // empty values are omitted from API requests. However, any non-pointer,
  4054. // non-interface field appearing in ForceSendFields will be sent to the
  4055. // server regardless of whether the field is empty or not. This may be
  4056. // used to include empty fields in Patch requests.
  4057. ForceSendFields []string `json:"-"`
  4058. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4059. // include in API requests with the JSON null value. By default, fields
  4060. // with empty values are omitted from API requests. However, any field
  4061. // with an empty value appearing in NullFields will be sent to the
  4062. // server as null. It is an error if a field in this list has a
  4063. // non-empty value. This may be used to include null fields in Patch
  4064. // requests.
  4065. NullFields []string `json:"-"`
  4066. }
  4067. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4068. type NoMethod CreativeAssetSelection
  4069. raw := NoMethod(*s)
  4070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4071. }
  4072. // CreativeAssignment: Creative Assignment.
  4073. type CreativeAssignment struct {
  4074. // Active: Whether this creative assignment is active. When true, the
  4075. // creative will be included in the ad's rotation.
  4076. Active bool `json:"active,omitempty"`
  4077. // ApplyEventTags: Whether applicable event tags should fire when this
  4078. // creative assignment is rendered. If this value is unset when the ad
  4079. // is inserted or updated, it will default to true for all creative
  4080. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4081. // and INSTREAM_VIDEO.
  4082. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4083. // ClickThroughUrl: Click-through URL of the creative assignment.
  4084. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4085. // CompanionCreativeOverrides: Companion creative overrides for this
  4086. // creative assignment. Applicable to video ads.
  4087. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4088. // CreativeGroupAssignments: Creative group assignments for this
  4089. // creative assignment. Only one assignment per creative group number is
  4090. // allowed for a maximum of two assignments.
  4091. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4092. // CreativeId: ID of the creative to be assigned. This is a required
  4093. // field.
  4094. CreativeId int64 `json:"creativeId,omitempty,string"`
  4095. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4096. // This is a read-only, auto-generated field.
  4097. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4098. // EndTime: Date and time that the assigned creative should stop
  4099. // serving. Must be later than the start time.
  4100. EndTime string `json:"endTime,omitempty"`
  4101. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4102. // assignment.
  4103. // Applicable when the creative type is any of the following:
  4104. // - DISPLAY
  4105. // - RICH_MEDIA_INPAGE
  4106. // - RICH_MEDIA_INPAGE_FLOATING
  4107. // - RICH_MEDIA_IM_EXPAND
  4108. // - RICH_MEDIA_EXPANDING
  4109. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4110. // - RICH_MEDIA_MOBILE_IN_APP
  4111. // - RICH_MEDIA_MULTI_FLOATING
  4112. // - RICH_MEDIA_PEEL_DOWN
  4113. // - VPAID_LINEAR
  4114. // - VPAID_NON_LINEAR
  4115. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4116. // Sequence: Sequence number of the creative assignment, applicable when
  4117. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4118. // values are 1 to 65535, inclusive.
  4119. Sequence int64 `json:"sequence,omitempty"`
  4120. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4121. // This is a read-only field that is auto-generated when the ad is
  4122. // inserted or updated.
  4123. SslCompliant bool `json:"sslCompliant,omitempty"`
  4124. // StartTime: Date and time that the assigned creative should start
  4125. // serving.
  4126. StartTime string `json:"startTime,omitempty"`
  4127. // Weight: Weight of the creative assignment, applicable when the
  4128. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4129. // than or equal to 1.
  4130. Weight int64 `json:"weight,omitempty"`
  4131. // ForceSendFields is a list of field names (e.g. "Active") to
  4132. // unconditionally include in API requests. By default, fields with
  4133. // empty values are omitted from API requests. However, any non-pointer,
  4134. // non-interface field appearing in ForceSendFields will be sent to the
  4135. // server regardless of whether the field is empty or not. This may be
  4136. // used to include empty fields in Patch requests.
  4137. ForceSendFields []string `json:"-"`
  4138. // NullFields is a list of field names (e.g. "Active") to include in API
  4139. // requests with the JSON null value. By default, fields with empty
  4140. // values are omitted from API requests. However, any field with an
  4141. // empty value appearing in NullFields will be sent to the server as
  4142. // null. It is an error if a field in this list has a non-empty value.
  4143. // This may be used to include null fields in Patch requests.
  4144. NullFields []string `json:"-"`
  4145. }
  4146. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4147. type NoMethod CreativeAssignment
  4148. raw := NoMethod(*s)
  4149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4150. }
  4151. // CreativeClickThroughUrl: Click-through URL
  4152. type CreativeClickThroughUrl struct {
  4153. // ComputedClickThroughUrl: Read-only convenience field representing the
  4154. // actual URL that will be used for this click-through. The URL is
  4155. // computed as follows:
  4156. // - If landingPageId is specified then that landing page's URL is
  4157. // assigned to this field.
  4158. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4159. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4160. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4161. // landingPageId field is left unset.
  4162. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4163. // LandingPageId: ID of the landing page for the click-through URL.
  4164. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4165. // ForceSendFields is a list of field names (e.g.
  4166. // "ComputedClickThroughUrl") to unconditionally include in API
  4167. // requests. By default, fields with empty values are omitted from API
  4168. // requests. However, any non-pointer, non-interface field appearing in
  4169. // ForceSendFields will be sent to the server regardless of whether the
  4170. // field is empty or not. This may be used to include empty fields in
  4171. // Patch requests.
  4172. ForceSendFields []string `json:"-"`
  4173. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4174. // to include in API requests with the JSON null value. By default,
  4175. // fields with empty values are omitted from API requests. However, any
  4176. // field with an empty value appearing in NullFields will be sent to the
  4177. // server as null. It is an error if a field in this list has a
  4178. // non-empty value. This may be used to include null fields in Patch
  4179. // requests.
  4180. NullFields []string `json:"-"`
  4181. }
  4182. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4183. type NoMethod CreativeClickThroughUrl
  4184. raw := NoMethod(*s)
  4185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4186. }
  4187. // CreativeCustomEvent: Creative Custom Event.
  4188. type CreativeCustomEvent struct {
  4189. // AdvertiserCustomEventId: Unique ID of this event used by Reporting
  4190. // and Data Transfer. This is a read-only field.
  4191. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4192. // AdvertiserCustomEventName: User-entered name for the event.
  4193. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4194. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4195. // field.
  4196. //
  4197. // Possible values:
  4198. // "ADVERTISER_EVENT_COUNTER"
  4199. // "ADVERTISER_EVENT_EXIT"
  4200. // "ADVERTISER_EVENT_TIMER"
  4201. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4202. // ArtworkLabel: Artwork label column, used to link events in Campaign
  4203. // Manager back to events in Studio. This is a required field and should
  4204. // not be modified after insertion.
  4205. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4206. // ArtworkType: Artwork type used by the creative.This is a read-only
  4207. // field.
  4208. //
  4209. // Possible values:
  4210. // "ARTWORK_TYPE_FLASH"
  4211. // "ARTWORK_TYPE_HTML5"
  4212. // "ARTWORK_TYPE_IMAGE"
  4213. // "ARTWORK_TYPE_MIXED"
  4214. ArtworkType string `json:"artworkType,omitempty"`
  4215. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4216. // is used only for exit events.
  4217. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4218. // Id: ID of this event. This is a required field and should not be
  4219. // modified after insertion.
  4220. Id int64 `json:"id,omitempty,string"`
  4221. // PopupWindowProperties: Properties for rich media popup windows. This
  4222. // field is used only for exit events.
  4223. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4224. // TargetType: Target type used by the event.
  4225. //
  4226. // Possible values:
  4227. // "TARGET_BLANK"
  4228. // "TARGET_PARENT"
  4229. // "TARGET_POPUP"
  4230. // "TARGET_SELF"
  4231. // "TARGET_TOP"
  4232. TargetType string `json:"targetType,omitempty"`
  4233. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4234. // videos in a single creative. This is a read-only field.
  4235. VideoReportingId string `json:"videoReportingId,omitempty"`
  4236. // ForceSendFields is a list of field names (e.g.
  4237. // "AdvertiserCustomEventId") to unconditionally include in API
  4238. // requests. By default, fields with empty values are omitted from API
  4239. // requests. However, any non-pointer, non-interface field appearing in
  4240. // ForceSendFields will be sent to the server regardless of whether the
  4241. // field is empty or not. This may be used to include empty fields in
  4242. // Patch requests.
  4243. ForceSendFields []string `json:"-"`
  4244. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4245. // to include in API requests with the JSON null value. By default,
  4246. // fields with empty values are omitted from API requests. However, any
  4247. // field with an empty value appearing in NullFields will be sent to the
  4248. // server as null. It is an error if a field in this list has a
  4249. // non-empty value. This may be used to include null fields in Patch
  4250. // requests.
  4251. NullFields []string `json:"-"`
  4252. }
  4253. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4254. type NoMethod CreativeCustomEvent
  4255. raw := NoMethod(*s)
  4256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4257. }
  4258. // CreativeField: Contains properties of a creative field.
  4259. type CreativeField struct {
  4260. // AccountId: Account ID of this creative field. This is a read-only
  4261. // field that can be left blank.
  4262. AccountId int64 `json:"accountId,omitempty,string"`
  4263. // AdvertiserId: Advertiser ID of this creative field. This is a
  4264. // required field on insertion.
  4265. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4266. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4267. // advertiser. This is a read-only, auto-generated field.
  4268. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4269. // Id: ID of this creative field. This is a read-only, auto-generated
  4270. // field.
  4271. Id int64 `json:"id,omitempty,string"`
  4272. // Kind: Identifies what kind of resource this is. Value: the fixed
  4273. // string "dfareporting#creativeField".
  4274. Kind string `json:"kind,omitempty"`
  4275. // Name: Name of this creative field. This is a required field and must
  4276. // be less than 256 characters long and unique among creative fields of
  4277. // the same advertiser.
  4278. Name string `json:"name,omitempty"`
  4279. // SubaccountId: Subaccount ID of this creative field. This is a
  4280. // read-only field that can be left blank.
  4281. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4282. // ServerResponse contains the HTTP response code and headers from the
  4283. // server.
  4284. googleapi.ServerResponse `json:"-"`
  4285. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4286. // unconditionally include in API requests. By default, fields with
  4287. // empty values are omitted from API requests. However, any non-pointer,
  4288. // non-interface field appearing in ForceSendFields will be sent to the
  4289. // server regardless of whether the field is empty or not. This may be
  4290. // used to include empty fields in Patch requests.
  4291. ForceSendFields []string `json:"-"`
  4292. // NullFields is a list of field names (e.g. "AccountId") to include in
  4293. // API requests with the JSON null value. By default, fields with empty
  4294. // values are omitted from API requests. However, any field with an
  4295. // empty value appearing in NullFields will be sent to the server as
  4296. // null. It is an error if a field in this list has a non-empty value.
  4297. // This may be used to include null fields in Patch requests.
  4298. NullFields []string `json:"-"`
  4299. }
  4300. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4301. type NoMethod CreativeField
  4302. raw := NoMethod(*s)
  4303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4304. }
  4305. // CreativeFieldAssignment: Creative Field Assignment.
  4306. type CreativeFieldAssignment struct {
  4307. // CreativeFieldId: ID of the creative field.
  4308. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4309. // CreativeFieldValueId: ID of the creative field value.
  4310. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4311. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4312. // unconditionally include in API requests. By default, fields with
  4313. // empty values are omitted from API requests. However, any non-pointer,
  4314. // non-interface field appearing in ForceSendFields will be sent to the
  4315. // server regardless of whether the field is empty or not. This may be
  4316. // used to include empty fields in Patch requests.
  4317. ForceSendFields []string `json:"-"`
  4318. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4319. // include in API requests with the JSON null value. By default, fields
  4320. // with empty values are omitted from API requests. However, any field
  4321. // with an empty value appearing in NullFields will be sent to the
  4322. // server as null. It is an error if a field in this list has a
  4323. // non-empty value. This may be used to include null fields in Patch
  4324. // requests.
  4325. NullFields []string `json:"-"`
  4326. }
  4327. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4328. type NoMethod CreativeFieldAssignment
  4329. raw := NoMethod(*s)
  4330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4331. }
  4332. // CreativeFieldValue: Contains properties of a creative field value.
  4333. type CreativeFieldValue struct {
  4334. // Id: ID of this creative field value. This is a read-only,
  4335. // auto-generated field.
  4336. Id int64 `json:"id,omitempty,string"`
  4337. // Kind: Identifies what kind of resource this is. Value: the fixed
  4338. // string "dfareporting#creativeFieldValue".
  4339. Kind string `json:"kind,omitempty"`
  4340. // Value: Value of this creative field value. It needs to be less than
  4341. // 256 characters in length and unique per creative field.
  4342. Value string `json:"value,omitempty"`
  4343. // ServerResponse contains the HTTP response code and headers from the
  4344. // server.
  4345. googleapi.ServerResponse `json:"-"`
  4346. // ForceSendFields is a list of field names (e.g. "Id") to
  4347. // unconditionally include in API requests. By default, fields with
  4348. // empty values are omitted from API requests. However, any non-pointer,
  4349. // non-interface field appearing in ForceSendFields will be sent to the
  4350. // server regardless of whether the field is empty or not. This may be
  4351. // used to include empty fields in Patch requests.
  4352. ForceSendFields []string `json:"-"`
  4353. // NullFields is a list of field names (e.g. "Id") to include in API
  4354. // requests with the JSON null value. By default, fields with empty
  4355. // values are omitted from API requests. However, any field with an
  4356. // empty value appearing in NullFields will be sent to the server as
  4357. // null. It is an error if a field in this list has a non-empty value.
  4358. // This may be used to include null fields in Patch requests.
  4359. NullFields []string `json:"-"`
  4360. }
  4361. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4362. type NoMethod CreativeFieldValue
  4363. raw := NoMethod(*s)
  4364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4365. }
  4366. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4367. type CreativeFieldValuesListResponse struct {
  4368. // CreativeFieldValues: Creative field value collection.
  4369. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4370. // Kind: Identifies what kind of resource this is. Value: the fixed
  4371. // string "dfareporting#creativeFieldValuesListResponse".
  4372. Kind string `json:"kind,omitempty"`
  4373. // NextPageToken: Pagination token to be used for the next list
  4374. // operation.
  4375. NextPageToken string `json:"nextPageToken,omitempty"`
  4376. // ServerResponse contains the HTTP response code and headers from the
  4377. // server.
  4378. googleapi.ServerResponse `json:"-"`
  4379. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4380. // to unconditionally include in API requests. By default, fields with
  4381. // empty values are omitted from API requests. However, any non-pointer,
  4382. // non-interface field appearing in ForceSendFields will be sent to the
  4383. // server regardless of whether the field is empty or not. This may be
  4384. // used to include empty fields in Patch requests.
  4385. ForceSendFields []string `json:"-"`
  4386. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4387. // include in API requests with the JSON null value. By default, fields
  4388. // with empty values are omitted from API requests. However, any field
  4389. // with an empty value appearing in NullFields will be sent to the
  4390. // server as null. It is an error if a field in this list has a
  4391. // non-empty value. This may be used to include null fields in Patch
  4392. // requests.
  4393. NullFields []string `json:"-"`
  4394. }
  4395. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4396. type NoMethod CreativeFieldValuesListResponse
  4397. raw := NoMethod(*s)
  4398. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4399. }
  4400. // CreativeFieldsListResponse: Creative Field List Response
  4401. type CreativeFieldsListResponse struct {
  4402. // CreativeFields: Creative field collection.
  4403. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4404. // Kind: Identifies what kind of resource this is. Value: the fixed
  4405. // string "dfareporting#creativeFieldsListResponse".
  4406. Kind string `json:"kind,omitempty"`
  4407. // NextPageToken: Pagination token to be used for the next list
  4408. // operation.
  4409. NextPageToken string `json:"nextPageToken,omitempty"`
  4410. // ServerResponse contains the HTTP response code and headers from the
  4411. // server.
  4412. googleapi.ServerResponse `json:"-"`
  4413. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4414. // unconditionally include in API requests. By default, fields with
  4415. // empty values are omitted from API requests. However, any non-pointer,
  4416. // non-interface field appearing in ForceSendFields will be sent to the
  4417. // server regardless of whether the field is empty or not. This may be
  4418. // used to include empty fields in Patch requests.
  4419. ForceSendFields []string `json:"-"`
  4420. // NullFields is a list of field names (e.g. "CreativeFields") to
  4421. // include in API requests with the JSON null value. By default, fields
  4422. // with empty values are omitted from API requests. However, any field
  4423. // with an empty value appearing in NullFields will be sent to the
  4424. // server as null. It is an error if a field in this list has a
  4425. // non-empty value. This may be used to include null fields in Patch
  4426. // requests.
  4427. NullFields []string `json:"-"`
  4428. }
  4429. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4430. type NoMethod CreativeFieldsListResponse
  4431. raw := NoMethod(*s)
  4432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4433. }
  4434. // CreativeGroup: Contains properties of a creative group.
  4435. type CreativeGroup struct {
  4436. // AccountId: Account ID of this creative group. This is a read-only
  4437. // field that can be left blank.
  4438. AccountId int64 `json:"accountId,omitempty,string"`
  4439. // AdvertiserId: Advertiser ID of this creative group. This is a
  4440. // required field on insertion.
  4441. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4442. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4443. // advertiser. This is a read-only, auto-generated field.
  4444. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4445. // GroupNumber: Subgroup of the creative group. Assign your creative
  4446. // groups to a subgroup in order to filter or manage them more easily.
  4447. // This field is required on insertion and is read-only after insertion.
  4448. // Acceptable values are 1 to 2, inclusive.
  4449. GroupNumber int64 `json:"groupNumber,omitempty"`
  4450. // Id: ID of this creative group. This is a read-only, auto-generated
  4451. // field.
  4452. Id int64 `json:"id,omitempty,string"`
  4453. // Kind: Identifies what kind of resource this is. Value: the fixed
  4454. // string "dfareporting#creativeGroup".
  4455. Kind string `json:"kind,omitempty"`
  4456. // Name: Name of this creative group. This is a required field and must
  4457. // be less than 256 characters long and unique among creative groups of
  4458. // the same advertiser.
  4459. Name string `json:"name,omitempty"`
  4460. // SubaccountId: Subaccount ID of this creative group. This is a
  4461. // read-only field that can be left blank.
  4462. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4463. // ServerResponse contains the HTTP response code and headers from the
  4464. // server.
  4465. googleapi.ServerResponse `json:"-"`
  4466. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4467. // unconditionally include in API requests. By default, fields with
  4468. // empty values are omitted from API requests. However, any non-pointer,
  4469. // non-interface field appearing in ForceSendFields will be sent to the
  4470. // server regardless of whether the field is empty or not. This may be
  4471. // used to include empty fields in Patch requests.
  4472. ForceSendFields []string `json:"-"`
  4473. // NullFields is a list of field names (e.g. "AccountId") to include in
  4474. // API requests with the JSON null value. By default, fields with empty
  4475. // values are omitted from API requests. However, any field with an
  4476. // empty value appearing in NullFields will be sent to the server as
  4477. // null. It is an error if a field in this list has a non-empty value.
  4478. // This may be used to include null fields in Patch requests.
  4479. NullFields []string `json:"-"`
  4480. }
  4481. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4482. type NoMethod CreativeGroup
  4483. raw := NoMethod(*s)
  4484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4485. }
  4486. // CreativeGroupAssignment: Creative Group Assignment.
  4487. type CreativeGroupAssignment struct {
  4488. // CreativeGroupId: ID of the creative group to be assigned.
  4489. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4490. // CreativeGroupNumber: Creative group number of the creative group
  4491. // assignment.
  4492. //
  4493. // Possible values:
  4494. // "CREATIVE_GROUP_ONE"
  4495. // "CREATIVE_GROUP_TWO"
  4496. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4497. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4505. // include in API requests with the JSON null value. By default, fields
  4506. // with empty values are omitted from API requests. However, any field
  4507. // with an empty value appearing in NullFields will be sent to the
  4508. // server as null. It is an error if a field in this list has a
  4509. // non-empty value. This may be used to include null fields in Patch
  4510. // requests.
  4511. NullFields []string `json:"-"`
  4512. }
  4513. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4514. type NoMethod CreativeGroupAssignment
  4515. raw := NoMethod(*s)
  4516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4517. }
  4518. // CreativeGroupsListResponse: Creative Group List Response
  4519. type CreativeGroupsListResponse struct {
  4520. // CreativeGroups: Creative group collection.
  4521. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4522. // Kind: Identifies what kind of resource this is. Value: the fixed
  4523. // string "dfareporting#creativeGroupsListResponse".
  4524. Kind string `json:"kind,omitempty"`
  4525. // NextPageToken: Pagination token to be used for the next list
  4526. // operation.
  4527. NextPageToken string `json:"nextPageToken,omitempty"`
  4528. // ServerResponse contains the HTTP response code and headers from the
  4529. // server.
  4530. googleapi.ServerResponse `json:"-"`
  4531. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4532. // unconditionally include in API requests. By default, fields with
  4533. // empty values are omitted from API requests. However, any non-pointer,
  4534. // non-interface field appearing in ForceSendFields will be sent to the
  4535. // server regardless of whether the field is empty or not. This may be
  4536. // used to include empty fields in Patch requests.
  4537. ForceSendFields []string `json:"-"`
  4538. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4539. // include in API requests with the JSON null value. By default, fields
  4540. // with empty values are omitted from API requests. However, any field
  4541. // with an empty value appearing in NullFields will be sent to the
  4542. // server as null. It is an error if a field in this list has a
  4543. // non-empty value. This may be used to include null fields in Patch
  4544. // requests.
  4545. NullFields []string `json:"-"`
  4546. }
  4547. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4548. type NoMethod CreativeGroupsListResponse
  4549. raw := NoMethod(*s)
  4550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4551. }
  4552. // CreativeOptimizationConfiguration: Creative optimization settings.
  4553. type CreativeOptimizationConfiguration struct {
  4554. // Id: ID of this creative optimization config. This field is
  4555. // auto-generated when the campaign is inserted or updated. It can be
  4556. // null for existing campaigns.
  4557. Id int64 `json:"id,omitempty,string"`
  4558. // Name: Name of this creative optimization config. This is a required
  4559. // field and must be less than 129 characters long.
  4560. Name string `json:"name,omitempty"`
  4561. // OptimizationActivitys: List of optimization activities associated
  4562. // with this configuration.
  4563. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4564. // OptimizationModel: Optimization model for this configuration.
  4565. //
  4566. // Possible values:
  4567. // "CLICK"
  4568. // "POST_CLICK"
  4569. // "POST_CLICK_AND_IMPRESSION"
  4570. // "POST_IMPRESSION"
  4571. // "VIDEO_COMPLETION"
  4572. OptimizationModel string `json:"optimizationModel,omitempty"`
  4573. // ForceSendFields is a list of field names (e.g. "Id") to
  4574. // unconditionally include in API requests. By default, fields with
  4575. // empty values are omitted from API requests. However, any non-pointer,
  4576. // non-interface field appearing in ForceSendFields will be sent to the
  4577. // server regardless of whether the field is empty or not. This may be
  4578. // used to include empty fields in Patch requests.
  4579. ForceSendFields []string `json:"-"`
  4580. // NullFields is a list of field names (e.g. "Id") to include in API
  4581. // requests with the JSON null value. By default, fields with empty
  4582. // values are omitted from API requests. However, any field with an
  4583. // empty value appearing in NullFields will be sent to the server as
  4584. // null. It is an error if a field in this list has a non-empty value.
  4585. // This may be used to include null fields in Patch requests.
  4586. NullFields []string `json:"-"`
  4587. }
  4588. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4589. type NoMethod CreativeOptimizationConfiguration
  4590. raw := NoMethod(*s)
  4591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4592. }
  4593. // CreativeRotation: Creative Rotation.
  4594. type CreativeRotation struct {
  4595. // CreativeAssignments: Creative assignments in this creative rotation.
  4596. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4597. // CreativeOptimizationConfigurationId: Creative optimization
  4598. // configuration that is used by this ad. It should refer to one of the
  4599. // existing optimization configurations in the ad's campaign. If it is
  4600. // unset or set to 0, then the campaign's default optimization
  4601. // configuration will be used for this ad.
  4602. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4603. // Type: Type of creative rotation. Can be used to specify whether to
  4604. // use sequential or random rotation.
  4605. //
  4606. // Possible values:
  4607. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4608. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4609. Type string `json:"type,omitempty"`
  4610. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4611. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4612. //
  4613. // Possible values:
  4614. // "WEIGHT_STRATEGY_CUSTOM"
  4615. // "WEIGHT_STRATEGY_EQUAL"
  4616. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4617. // "WEIGHT_STRATEGY_OPTIMIZED"
  4618. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4619. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4620. // to unconditionally include in API requests. By default, fields with
  4621. // empty values are omitted from API requests. However, any non-pointer,
  4622. // non-interface field appearing in ForceSendFields will be sent to the
  4623. // server regardless of whether the field is empty or not. This may be
  4624. // used to include empty fields in Patch requests.
  4625. ForceSendFields []string `json:"-"`
  4626. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4627. // include in API requests with the JSON null value. By default, fields
  4628. // with empty values are omitted from API requests. However, any field
  4629. // with an empty value appearing in NullFields will be sent to the
  4630. // server as null. It is an error if a field in this list has a
  4631. // non-empty value. This may be used to include null fields in Patch
  4632. // requests.
  4633. NullFields []string `json:"-"`
  4634. }
  4635. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4636. type NoMethod CreativeRotation
  4637. raw := NoMethod(*s)
  4638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4639. }
  4640. // CreativeSettings: Creative Settings
  4641. type CreativeSettings struct {
  4642. // IFrameFooter: Header text for iFrames for this site. Must be less
  4643. // than or equal to 2000 characters long.
  4644. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4645. // IFrameHeader: Header text for iFrames for this site. Must be less
  4646. // than or equal to 2000 characters long.
  4647. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4648. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4649. // unconditionally include in API requests. By default, fields with
  4650. // empty values are omitted from API requests. However, any non-pointer,
  4651. // non-interface field appearing in ForceSendFields will be sent to the
  4652. // server regardless of whether the field is empty or not. This may be
  4653. // used to include empty fields in Patch requests.
  4654. ForceSendFields []string `json:"-"`
  4655. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4656. // in API requests with the JSON null value. By default, fields with
  4657. // empty values are omitted from API requests. However, any field with
  4658. // an empty value appearing in NullFields will be sent to the server as
  4659. // null. It is an error if a field in this list has a non-empty value.
  4660. // This may be used to include null fields in Patch requests.
  4661. NullFields []string `json:"-"`
  4662. }
  4663. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4664. type NoMethod CreativeSettings
  4665. raw := NoMethod(*s)
  4666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4667. }
  4668. // CreativesListResponse: Creative List Response
  4669. type CreativesListResponse struct {
  4670. // Creatives: Creative collection.
  4671. Creatives []*Creative `json:"creatives,omitempty"`
  4672. // Kind: Identifies what kind of resource this is. Value: the fixed
  4673. // string "dfareporting#creativesListResponse".
  4674. Kind string `json:"kind,omitempty"`
  4675. // NextPageToken: Pagination token to be used for the next list
  4676. // operation.
  4677. NextPageToken string `json:"nextPageToken,omitempty"`
  4678. // ServerResponse contains the HTTP response code and headers from the
  4679. // server.
  4680. googleapi.ServerResponse `json:"-"`
  4681. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4682. // unconditionally include in API requests. By default, fields with
  4683. // empty values are omitted from API requests. However, any non-pointer,
  4684. // non-interface field appearing in ForceSendFields will be sent to the
  4685. // server regardless of whether the field is empty or not. This may be
  4686. // used to include empty fields in Patch requests.
  4687. ForceSendFields []string `json:"-"`
  4688. // NullFields is a list of field names (e.g. "Creatives") to include in
  4689. // API requests with the JSON null value. By default, fields with empty
  4690. // values are omitted from API requests. However, any field with an
  4691. // empty value appearing in NullFields will be sent to the server as
  4692. // null. It is an error if a field in this list has a non-empty value.
  4693. // This may be used to include null fields in Patch requests.
  4694. NullFields []string `json:"-"`
  4695. }
  4696. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4697. type NoMethod CreativesListResponse
  4698. raw := NoMethod(*s)
  4699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4700. }
  4701. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4702. // compatible to be selected for a report of type
  4703. // "CROSS_DIMENSION_REACH".
  4704. type CrossDimensionReachReportCompatibleFields struct {
  4705. // Breakdown: Dimensions which are compatible to be selected in the
  4706. // "breakdown" section of the report.
  4707. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4708. // DimensionFilters: Dimensions which are compatible to be selected in
  4709. // the "dimensionFilters" section of the report.
  4710. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4711. // Kind: The kind of resource this is, in this case
  4712. // dfareporting#crossDimensionReachReportCompatibleFields.
  4713. Kind string `json:"kind,omitempty"`
  4714. // Metrics: Metrics which are compatible to be selected in the
  4715. // "metricNames" section of the report.
  4716. Metrics []*Metric `json:"metrics,omitempty"`
  4717. // OverlapMetrics: Metrics which are compatible to be selected in the
  4718. // "overlapMetricNames" section of the report.
  4719. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4720. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4721. // unconditionally include in API requests. By default, fields with
  4722. // empty values are omitted from API requests. However, any non-pointer,
  4723. // non-interface field appearing in ForceSendFields will be sent to the
  4724. // server regardless of whether the field is empty or not. This may be
  4725. // used to include empty fields in Patch requests.
  4726. ForceSendFields []string `json:"-"`
  4727. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4728. // API requests with the JSON null value. By default, fields with empty
  4729. // values are omitted from API requests. However, any field with an
  4730. // empty value appearing in NullFields will be sent to the server as
  4731. // null. It is an error if a field in this list has a non-empty value.
  4732. // This may be used to include null fields in Patch requests.
  4733. NullFields []string `json:"-"`
  4734. }
  4735. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4736. type NoMethod CrossDimensionReachReportCompatibleFields
  4737. raw := NoMethod(*s)
  4738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4739. }
  4740. // CustomFloodlightVariable: A custom floodlight variable.
  4741. type CustomFloodlightVariable struct {
  4742. // Kind: Identifies what kind of resource this is. Value: the fixed
  4743. // string "dfareporting#customFloodlightVariable".
  4744. Kind string `json:"kind,omitempty"`
  4745. // Type: The type of custom floodlight variable to supply a value for.
  4746. // These map to the "u[1-20]=" in the tags.
  4747. //
  4748. // Possible values:
  4749. // "U1"
  4750. // "U10"
  4751. // "U100"
  4752. // "U11"
  4753. // "U12"
  4754. // "U13"
  4755. // "U14"
  4756. // "U15"
  4757. // "U16"
  4758. // "U17"
  4759. // "U18"
  4760. // "U19"
  4761. // "U2"
  4762. // "U20"
  4763. // "U21"
  4764. // "U22"
  4765. // "U23"
  4766. // "U24"
  4767. // "U25"
  4768. // "U26"
  4769. // "U27"
  4770. // "U28"
  4771. // "U29"
  4772. // "U3"
  4773. // "U30"
  4774. // "U31"
  4775. // "U32"
  4776. // "U33"
  4777. // "U34"
  4778. // "U35"
  4779. // "U36"
  4780. // "U37"
  4781. // "U38"
  4782. // "U39"
  4783. // "U4"
  4784. // "U40"
  4785. // "U41"
  4786. // "U42"
  4787. // "U43"
  4788. // "U44"
  4789. // "U45"
  4790. // "U46"
  4791. // "U47"
  4792. // "U48"
  4793. // "U49"
  4794. // "U5"
  4795. // "U50"
  4796. // "U51"
  4797. // "U52"
  4798. // "U53"
  4799. // "U54"
  4800. // "U55"
  4801. // "U56"
  4802. // "U57"
  4803. // "U58"
  4804. // "U59"
  4805. // "U6"
  4806. // "U60"
  4807. // "U61"
  4808. // "U62"
  4809. // "U63"
  4810. // "U64"
  4811. // "U65"
  4812. // "U66"
  4813. // "U67"
  4814. // "U68"
  4815. // "U69"
  4816. // "U7"
  4817. // "U70"
  4818. // "U71"
  4819. // "U72"
  4820. // "U73"
  4821. // "U74"
  4822. // "U75"
  4823. // "U76"
  4824. // "U77"
  4825. // "U78"
  4826. // "U79"
  4827. // "U8"
  4828. // "U80"
  4829. // "U81"
  4830. // "U82"
  4831. // "U83"
  4832. // "U84"
  4833. // "U85"
  4834. // "U86"
  4835. // "U87"
  4836. // "U88"
  4837. // "U89"
  4838. // "U9"
  4839. // "U90"
  4840. // "U91"
  4841. // "U92"
  4842. // "U93"
  4843. // "U94"
  4844. // "U95"
  4845. // "U96"
  4846. // "U97"
  4847. // "U98"
  4848. // "U99"
  4849. Type string `json:"type,omitempty"`
  4850. // Value: The value of the custom floodlight variable. The length of
  4851. // string must not exceed 50 characters.
  4852. Value string `json:"value,omitempty"`
  4853. // ForceSendFields is a list of field names (e.g. "Kind") to
  4854. // unconditionally include in API requests. By default, fields with
  4855. // empty values are omitted from API requests. However, any non-pointer,
  4856. // non-interface field appearing in ForceSendFields will be sent to the
  4857. // server regardless of whether the field is empty or not. This may be
  4858. // used to include empty fields in Patch requests.
  4859. ForceSendFields []string `json:"-"`
  4860. // NullFields is a list of field names (e.g. "Kind") to include in API
  4861. // requests with the JSON null value. By default, fields with empty
  4862. // values are omitted from API requests. However, any field with an
  4863. // empty value appearing in NullFields will be sent to the server as
  4864. // null. It is an error if a field in this list has a non-empty value.
  4865. // This may be used to include null fields in Patch requests.
  4866. NullFields []string `json:"-"`
  4867. }
  4868. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4869. type NoMethod CustomFloodlightVariable
  4870. raw := NoMethod(*s)
  4871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4872. }
  4873. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4874. type CustomRichMediaEvents struct {
  4875. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4876. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4877. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4878. // Kind: The kind of resource this is, in this case
  4879. // dfareporting#customRichMediaEvents.
  4880. Kind string `json:"kind,omitempty"`
  4881. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4882. // unconditionally include in API requests. By default, fields with
  4883. // empty values are omitted from API requests. However, any non-pointer,
  4884. // non-interface field appearing in ForceSendFields will be sent to the
  4885. // server regardless of whether the field is empty or not. This may be
  4886. // used to include empty fields in Patch requests.
  4887. ForceSendFields []string `json:"-"`
  4888. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4889. // include in API requests with the JSON null value. By default, fields
  4890. // with empty values are omitted from API requests. However, any field
  4891. // with an empty value appearing in NullFields will be sent to the
  4892. // server as null. It is an error if a field in this list has a
  4893. // non-empty value. This may be used to include null fields in Patch
  4894. // requests.
  4895. NullFields []string `json:"-"`
  4896. }
  4897. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4898. type NoMethod CustomRichMediaEvents
  4899. raw := NoMethod(*s)
  4900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4901. }
  4902. // DateRange: Represents a date range.
  4903. type DateRange struct {
  4904. // EndDate: The end date of the date range, inclusive. A string of the
  4905. // format: "yyyy-MM-dd".
  4906. EndDate string `json:"endDate,omitempty"`
  4907. // Kind: The kind of resource this is, in this case
  4908. // dfareporting#dateRange.
  4909. Kind string `json:"kind,omitempty"`
  4910. // RelativeDateRange: The date range relative to the date of when the
  4911. // report is run.
  4912. //
  4913. // Possible values:
  4914. // "LAST_14_DAYS"
  4915. // "LAST_24_MONTHS"
  4916. // "LAST_30_DAYS"
  4917. // "LAST_365_DAYS"
  4918. // "LAST_60_DAYS"
  4919. // "LAST_7_DAYS"
  4920. // "LAST_90_DAYS"
  4921. // "MONTH_TO_DATE"
  4922. // "PREVIOUS_MONTH"
  4923. // "PREVIOUS_QUARTER"
  4924. // "PREVIOUS_WEEK"
  4925. // "PREVIOUS_YEAR"
  4926. // "QUARTER_TO_DATE"
  4927. // "TODAY"
  4928. // "WEEK_TO_DATE"
  4929. // "YEAR_TO_DATE"
  4930. // "YESTERDAY"
  4931. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  4932. // StartDate: The start date of the date range, inclusive. A string of
  4933. // the format: "yyyy-MM-dd".
  4934. StartDate string `json:"startDate,omitempty"`
  4935. // ForceSendFields is a list of field names (e.g. "EndDate") to
  4936. // unconditionally include in API requests. By default, fields with
  4937. // empty values are omitted from API requests. However, any non-pointer,
  4938. // non-interface field appearing in ForceSendFields will be sent to the
  4939. // server regardless of whether the field is empty or not. This may be
  4940. // used to include empty fields in Patch requests.
  4941. ForceSendFields []string `json:"-"`
  4942. // NullFields is a list of field names (e.g. "EndDate") to include in
  4943. // API requests with the JSON null value. By default, fields with empty
  4944. // values are omitted from API requests. However, any field with an
  4945. // empty value appearing in NullFields will be sent to the server as
  4946. // null. It is an error if a field in this list has a non-empty value.
  4947. // This may be used to include null fields in Patch requests.
  4948. NullFields []string `json:"-"`
  4949. }
  4950. func (s *DateRange) MarshalJSON() ([]byte, error) {
  4951. type NoMethod DateRange
  4952. raw := NoMethod(*s)
  4953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4954. }
  4955. // DayPartTargeting: Day Part Targeting.
  4956. type DayPartTargeting struct {
  4957. // DaysOfWeek: Days of the week when the ad will serve.
  4958. //
  4959. // Acceptable values are:
  4960. // - "SUNDAY"
  4961. // - "MONDAY"
  4962. // - "TUESDAY"
  4963. // - "WEDNESDAY"
  4964. // - "THURSDAY"
  4965. // - "FRIDAY"
  4966. // - "SATURDAY"
  4967. //
  4968. // Possible values:
  4969. // "FRIDAY"
  4970. // "MONDAY"
  4971. // "SATURDAY"
  4972. // "SUNDAY"
  4973. // "THURSDAY"
  4974. // "TUESDAY"
  4975. // "WEDNESDAY"
  4976. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  4977. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  4978. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  4979. // days of week, in which case the ad would serve during these hours on
  4980. // the specified days. For example if Monday, Wednesday, Friday are the
  4981. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  4982. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  4983. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  4984. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  4985. // UserLocalTime: Whether or not to use the user's local time. If false,
  4986. // the America/New York time zone applies.
  4987. UserLocalTime bool `json:"userLocalTime,omitempty"`
  4988. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  4989. // unconditionally include in API requests. By default, fields with
  4990. // empty values are omitted from API requests. However, any non-pointer,
  4991. // non-interface field appearing in ForceSendFields will be sent to the
  4992. // server regardless of whether the field is empty or not. This may be
  4993. // used to include empty fields in Patch requests.
  4994. ForceSendFields []string `json:"-"`
  4995. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  4996. // API requests with the JSON null value. By default, fields with empty
  4997. // values are omitted from API requests. However, any field with an
  4998. // empty value appearing in NullFields will be sent to the server as
  4999. // null. It is an error if a field in this list has a non-empty value.
  5000. // This may be used to include null fields in Patch requests.
  5001. NullFields []string `json:"-"`
  5002. }
  5003. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  5004. type NoMethod DayPartTargeting
  5005. raw := NoMethod(*s)
  5006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5007. }
  5008. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5009. // overriding the default click-through event tag. A campaign may
  5010. // override the event tag defined at the advertiser level, and an ad may
  5011. // also override the campaign's setting further.
  5012. type DefaultClickThroughEventTagProperties struct {
  5013. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5014. // apply to all ads in this entity's scope.
  5015. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5016. // OverrideInheritedEventTag: Whether this entity should override the
  5017. // inherited default click-through event tag with its own defined value.
  5018. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5019. // ForceSendFields is a list of field names (e.g.
  5020. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5021. // requests. By default, fields with empty values are omitted from API
  5022. // requests. However, any non-pointer, non-interface field appearing in
  5023. // ForceSendFields will be sent to the server regardless of whether the
  5024. // field is empty or not. This may be used to include empty fields in
  5025. // Patch requests.
  5026. ForceSendFields []string `json:"-"`
  5027. // NullFields is a list of field names (e.g.
  5028. // "DefaultClickThroughEventTagId") to include in API requests with the
  5029. // JSON null value. By default, fields with empty values are omitted
  5030. // from API requests. However, any field with an empty value appearing
  5031. // in NullFields will be sent to the server as null. It is an error if a
  5032. // field in this list has a non-empty value. This may be used to include
  5033. // null fields in Patch requests.
  5034. NullFields []string `json:"-"`
  5035. }
  5036. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5037. type NoMethod DefaultClickThroughEventTagProperties
  5038. raw := NoMethod(*s)
  5039. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5040. }
  5041. // DeliverySchedule: Delivery Schedule.
  5042. type DeliverySchedule struct {
  5043. // FrequencyCap: Limit on the number of times an individual user can be
  5044. // served the ad within a specified period of time.
  5045. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5046. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5047. // will not serve after the end date and time. Otherwise the ad will
  5048. // continue to be served until it has reached its delivery goals.
  5049. HardCutoff bool `json:"hardCutoff,omitempty"`
  5050. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5051. // how often each ad is served relative to the others. For example, if
  5052. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5053. // 3, then Campaign Manager will serve ad B three times as often as ad
  5054. // A. Acceptable values are 1 to 10, inclusive.
  5055. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5056. // Priority: Serving priority of an ad, with respect to other ads. The
  5057. // lower the priority number, the greater the priority with which it is
  5058. // served.
  5059. //
  5060. // Possible values:
  5061. // "AD_PRIORITY_01"
  5062. // "AD_PRIORITY_02"
  5063. // "AD_PRIORITY_03"
  5064. // "AD_PRIORITY_04"
  5065. // "AD_PRIORITY_05"
  5066. // "AD_PRIORITY_06"
  5067. // "AD_PRIORITY_07"
  5068. // "AD_PRIORITY_08"
  5069. // "AD_PRIORITY_09"
  5070. // "AD_PRIORITY_10"
  5071. // "AD_PRIORITY_11"
  5072. // "AD_PRIORITY_12"
  5073. // "AD_PRIORITY_13"
  5074. // "AD_PRIORITY_14"
  5075. // "AD_PRIORITY_15"
  5076. // "AD_PRIORITY_16"
  5077. Priority string `json:"priority,omitempty"`
  5078. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5079. // unconditionally include in API requests. By default, fields with
  5080. // empty values are omitted from API requests. However, any non-pointer,
  5081. // non-interface field appearing in ForceSendFields will be sent to the
  5082. // server regardless of whether the field is empty or not. This may be
  5083. // used to include empty fields in Patch requests.
  5084. ForceSendFields []string `json:"-"`
  5085. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5086. // in API requests with the JSON null value. By default, fields with
  5087. // empty values are omitted from API requests. However, any field with
  5088. // an empty value appearing in NullFields will be sent to the server as
  5089. // null. It is an error if a field in this list has a non-empty value.
  5090. // This may be used to include null fields in Patch requests.
  5091. NullFields []string `json:"-"`
  5092. }
  5093. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5094. type NoMethod DeliverySchedule
  5095. raw := NoMethod(*s)
  5096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5097. }
  5098. // DfpSettings: Google Ad Manager Settings
  5099. type DfpSettings struct {
  5100. // DfpNetworkCode: Ad Manager network code for this directory site.
  5101. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5102. // DfpNetworkName: Ad Manager network name for this directory site.
  5103. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5104. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5105. // programmatic placements.
  5106. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5107. // PubPaidPlacementAccepted: Whether this directory site accepts
  5108. // publisher-paid tags.
  5109. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5110. // PublisherPortalOnly: Whether this directory site is available only
  5111. // via Publisher Portal.
  5112. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5113. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5114. // unconditionally include in API requests. By default, fields with
  5115. // empty values are omitted from API requests. However, any non-pointer,
  5116. // non-interface field appearing in ForceSendFields will be sent to the
  5117. // server regardless of whether the field is empty or not. This may be
  5118. // used to include empty fields in Patch requests.
  5119. ForceSendFields []string `json:"-"`
  5120. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5121. // include in API requests with the JSON null value. By default, fields
  5122. // with empty values are omitted from API requests. However, any field
  5123. // with an empty value appearing in NullFields will be sent to the
  5124. // server as null. It is an error if a field in this list has a
  5125. // non-empty value. This may be used to include null fields in Patch
  5126. // requests.
  5127. NullFields []string `json:"-"`
  5128. }
  5129. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5130. type NoMethod DfpSettings
  5131. raw := NoMethod(*s)
  5132. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5133. }
  5134. // Dimension: Represents a dimension.
  5135. type Dimension struct {
  5136. // Kind: The kind of resource this is, in this case
  5137. // dfareporting#dimension.
  5138. Kind string `json:"kind,omitempty"`
  5139. // Name: The dimension name, e.g. dfa:advertiser
  5140. Name string `json:"name,omitempty"`
  5141. // ForceSendFields is a list of field names (e.g. "Kind") to
  5142. // unconditionally include in API requests. By default, fields with
  5143. // empty values are omitted from API requests. However, any non-pointer,
  5144. // non-interface field appearing in ForceSendFields will be sent to the
  5145. // server regardless of whether the field is empty or not. This may be
  5146. // used to include empty fields in Patch requests.
  5147. ForceSendFields []string `json:"-"`
  5148. // NullFields is a list of field names (e.g. "Kind") to include in API
  5149. // requests with the JSON null value. By default, fields with empty
  5150. // values are omitted from API requests. However, any field with an
  5151. // empty value appearing in NullFields will be sent to the server as
  5152. // null. It is an error if a field in this list has a non-empty value.
  5153. // This may be used to include null fields in Patch requests.
  5154. NullFields []string `json:"-"`
  5155. }
  5156. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5157. type NoMethod Dimension
  5158. raw := NoMethod(*s)
  5159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5160. }
  5161. // DimensionFilter: Represents a dimension filter.
  5162. type DimensionFilter struct {
  5163. // DimensionName: The name of the dimension to filter.
  5164. DimensionName string `json:"dimensionName,omitempty"`
  5165. // Kind: The kind of resource this is, in this case
  5166. // dfareporting#dimensionFilter.
  5167. Kind string `json:"kind,omitempty"`
  5168. // Value: The value of the dimension to filter.
  5169. Value string `json:"value,omitempty"`
  5170. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5171. // unconditionally include in API requests. By default, fields with
  5172. // empty values are omitted from API requests. However, any non-pointer,
  5173. // non-interface field appearing in ForceSendFields will be sent to the
  5174. // server regardless of whether the field is empty or not. This may be
  5175. // used to include empty fields in Patch requests.
  5176. ForceSendFields []string `json:"-"`
  5177. // NullFields is a list of field names (e.g. "DimensionName") to include
  5178. // in API requests with the JSON null value. By default, fields with
  5179. // empty values are omitted from API requests. However, any field with
  5180. // an empty value appearing in NullFields will be sent to the server as
  5181. // null. It is an error if a field in this list has a non-empty value.
  5182. // This may be used to include null fields in Patch requests.
  5183. NullFields []string `json:"-"`
  5184. }
  5185. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5186. type NoMethod DimensionFilter
  5187. raw := NoMethod(*s)
  5188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5189. }
  5190. // DimensionValue: Represents a DimensionValue resource.
  5191. type DimensionValue struct {
  5192. // DimensionName: The name of the dimension.
  5193. DimensionName string `json:"dimensionName,omitempty"`
  5194. // Etag: The eTag of this response for caching purposes.
  5195. Etag string `json:"etag,omitempty"`
  5196. // Id: The ID associated with the value if available.
  5197. Id string `json:"id,omitempty"`
  5198. // Kind: The kind of resource this is, in this case
  5199. // dfareporting#dimensionValue.
  5200. Kind string `json:"kind,omitempty"`
  5201. // MatchType: Determines how the 'value' field is matched when
  5202. // filtering. If not specified, defaults to EXACT. If set to
  5203. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5204. // length character sequences, and it can be escaped with a backslash.
  5205. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5206. // matchType other than EXACT.
  5207. //
  5208. // Possible values:
  5209. // "BEGINS_WITH"
  5210. // "CONTAINS"
  5211. // "EXACT"
  5212. // "WILDCARD_EXPRESSION"
  5213. MatchType string `json:"matchType,omitempty"`
  5214. // Value: The value of the dimension.
  5215. Value string `json:"value,omitempty"`
  5216. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5217. // unconditionally include in API requests. By default, fields with
  5218. // empty values are omitted from API requests. However, any non-pointer,
  5219. // non-interface field appearing in ForceSendFields will be sent to the
  5220. // server regardless of whether the field is empty or not. This may be
  5221. // used to include empty fields in Patch requests.
  5222. ForceSendFields []string `json:"-"`
  5223. // NullFields is a list of field names (e.g. "DimensionName") to include
  5224. // in API requests with the JSON null value. By default, fields with
  5225. // empty values are omitted from API requests. However, any field with
  5226. // an empty value appearing in NullFields will be sent to the server as
  5227. // null. It is an error if a field in this list has a non-empty value.
  5228. // This may be used to include null fields in Patch requests.
  5229. NullFields []string `json:"-"`
  5230. }
  5231. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5232. type NoMethod DimensionValue
  5233. raw := NoMethod(*s)
  5234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5235. }
  5236. // DimensionValueList: Represents the list of DimensionValue resources.
  5237. type DimensionValueList struct {
  5238. // Etag: The eTag of this response for caching purposes.
  5239. Etag string `json:"etag,omitempty"`
  5240. // Items: The dimension values returned in this response.
  5241. Items []*DimensionValue `json:"items,omitempty"`
  5242. // Kind: The kind of list this is, in this case
  5243. // dfareporting#dimensionValueList.
  5244. Kind string `json:"kind,omitempty"`
  5245. // NextPageToken: Continuation token used to page through dimension
  5246. // values. To retrieve the next page of results, set the next request's
  5247. // "pageToken" to the value of this field. The page token is only valid
  5248. // for a limited amount of time and should not be persisted.
  5249. NextPageToken string `json:"nextPageToken,omitempty"`
  5250. // ServerResponse contains the HTTP response code and headers from the
  5251. // server.
  5252. googleapi.ServerResponse `json:"-"`
  5253. // ForceSendFields is a list of field names (e.g. "Etag") to
  5254. // unconditionally include in API requests. By default, fields with
  5255. // empty values are omitted from API requests. However, any non-pointer,
  5256. // non-interface field appearing in ForceSendFields will be sent to the
  5257. // server regardless of whether the field is empty or not. This may be
  5258. // used to include empty fields in Patch requests.
  5259. ForceSendFields []string `json:"-"`
  5260. // NullFields is a list of field names (e.g. "Etag") to include in API
  5261. // requests with the JSON null value. By default, fields with empty
  5262. // values are omitted from API requests. However, any field with an
  5263. // empty value appearing in NullFields will be sent to the server as
  5264. // null. It is an error if a field in this list has a non-empty value.
  5265. // This may be used to include null fields in Patch requests.
  5266. NullFields []string `json:"-"`
  5267. }
  5268. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5269. type NoMethod DimensionValueList
  5270. raw := NoMethod(*s)
  5271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5272. }
  5273. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5274. type DimensionValueRequest struct {
  5275. // DimensionName: The name of the dimension for which values should be
  5276. // requested.
  5277. DimensionName string `json:"dimensionName,omitempty"`
  5278. // EndDate: The end date of the date range for which to retrieve
  5279. // dimension values. A string of the format "yyyy-MM-dd".
  5280. EndDate string `json:"endDate,omitempty"`
  5281. // Filters: The list of filters by which to filter values. The filters
  5282. // are ANDed.
  5283. Filters []*DimensionFilter `json:"filters,omitempty"`
  5284. // Kind: The kind of request this is, in this case
  5285. // dfareporting#dimensionValueRequest.
  5286. Kind string `json:"kind,omitempty"`
  5287. // StartDate: The start date of the date range for which to retrieve
  5288. // dimension values. A string of the format "yyyy-MM-dd".
  5289. StartDate string `json:"startDate,omitempty"`
  5290. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5291. // unconditionally include in API requests. By default, fields with
  5292. // empty values are omitted from API requests. However, any non-pointer,
  5293. // non-interface field appearing in ForceSendFields will be sent to the
  5294. // server regardless of whether the field is empty or not. This may be
  5295. // used to include empty fields in Patch requests.
  5296. ForceSendFields []string `json:"-"`
  5297. // NullFields is a list of field names (e.g. "DimensionName") to include
  5298. // in API requests with the JSON null value. By default, fields with
  5299. // empty values are omitted from API requests. However, any field with
  5300. // an empty value appearing in NullFields will be sent to the server as
  5301. // null. It is an error if a field in this list has a non-empty value.
  5302. // This may be used to include null fields in Patch requests.
  5303. NullFields []string `json:"-"`
  5304. }
  5305. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5306. type NoMethod DimensionValueRequest
  5307. raw := NoMethod(*s)
  5308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5309. }
  5310. // DirectorySite: DirectorySites contains properties of a website from
  5311. // the Site Directory. Sites need to be added to an account via the
  5312. // Sites resource before they can be assigned to a placement.
  5313. type DirectorySite struct {
  5314. // Active: Whether this directory site is active.
  5315. Active bool `json:"active,omitempty"`
  5316. // ContactAssignments: Directory site contacts.
  5317. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5318. // CountryId: Country ID of this directory site. This is a read-only
  5319. // field.
  5320. CountryId int64 `json:"countryId,omitempty,string"`
  5321. // CurrencyId: Currency ID of this directory site. This is a read-only
  5322. // field.
  5323. // Possible values are:
  5324. // - "1" for USD
  5325. // - "2" for GBP
  5326. // - "3" for ESP
  5327. // - "4" for SEK
  5328. // - "5" for CAD
  5329. // - "6" for JPY
  5330. // - "7" for DEM
  5331. // - "8" for AUD
  5332. // - "9" for FRF
  5333. // - "10" for ITL
  5334. // - "11" for DKK
  5335. // - "12" for NOK
  5336. // - "13" for FIM
  5337. // - "14" for ZAR
  5338. // - "15" for IEP
  5339. // - "16" for NLG
  5340. // - "17" for EUR
  5341. // - "18" for KRW
  5342. // - "19" for TWD
  5343. // - "20" for SGD
  5344. // - "21" for CNY
  5345. // - "22" for HKD
  5346. // - "23" for NZD
  5347. // - "24" for MYR
  5348. // - "25" for BRL
  5349. // - "26" for PTE
  5350. // - "27" for MXP
  5351. // - "28" for CLP
  5352. // - "29" for TRY
  5353. // - "30" for ARS
  5354. // - "31" for PEN
  5355. // - "32" for ILS
  5356. // - "33" for CHF
  5357. // - "34" for VEF
  5358. // - "35" for COP
  5359. // - "36" for GTQ
  5360. // - "37" for PLN
  5361. // - "39" for INR
  5362. // - "40" for THB
  5363. // - "41" for IDR
  5364. // - "42" for CZK
  5365. // - "43" for RON
  5366. // - "44" for HUF
  5367. // - "45" for RUB
  5368. // - "46" for AED
  5369. // - "47" for BGN
  5370. // - "48" for HRK
  5371. // - "49" for MXN
  5372. // - "50" for NGN
  5373. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5374. // Description: Description of this directory site. This is a read-only
  5375. // field.
  5376. Description string `json:"description,omitempty"`
  5377. // Id: ID of this directory site. This is a read-only, auto-generated
  5378. // field.
  5379. Id int64 `json:"id,omitempty,string"`
  5380. // IdDimensionValue: Dimension value for the ID of this directory site.
  5381. // This is a read-only, auto-generated field.
  5382. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5383. // InpageTagFormats: Tag types for regular placements.
  5384. //
  5385. // Acceptable values are:
  5386. // - "STANDARD"
  5387. // - "IFRAME_JAVASCRIPT_INPAGE"
  5388. // - "INTERNAL_REDIRECT_INPAGE"
  5389. // - "JAVASCRIPT_INPAGE"
  5390. //
  5391. // Possible values:
  5392. // "IFRAME_JAVASCRIPT_INPAGE"
  5393. // "INTERNAL_REDIRECT_INPAGE"
  5394. // "JAVASCRIPT_INPAGE"
  5395. // "STANDARD"
  5396. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5397. // InterstitialTagFormats: Tag types for interstitial
  5398. // placements.
  5399. //
  5400. // Acceptable values are:
  5401. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5402. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5403. // - "JAVASCRIPT_INTERSTITIAL"
  5404. //
  5405. // Possible values:
  5406. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5407. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5408. // "JAVASCRIPT_INTERSTITIAL"
  5409. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5410. // Kind: Identifies what kind of resource this is. Value: the fixed
  5411. // string "dfareporting#directorySite".
  5412. Kind string `json:"kind,omitempty"`
  5413. // Name: Name of this directory site.
  5414. Name string `json:"name,omitempty"`
  5415. // ParentId: Parent directory site ID.
  5416. ParentId int64 `json:"parentId,omitempty,string"`
  5417. // Settings: Directory site settings.
  5418. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5419. // Url: URL of this directory site.
  5420. Url string `json:"url,omitempty"`
  5421. // ServerResponse contains the HTTP response code and headers from the
  5422. // server.
  5423. googleapi.ServerResponse `json:"-"`
  5424. // ForceSendFields is a list of field names (e.g. "Active") to
  5425. // unconditionally include in API requests. By default, fields with
  5426. // empty values are omitted from API requests. However, any non-pointer,
  5427. // non-interface field appearing in ForceSendFields will be sent to the
  5428. // server regardless of whether the field is empty or not. This may be
  5429. // used to include empty fields in Patch requests.
  5430. ForceSendFields []string `json:"-"`
  5431. // NullFields is a list of field names (e.g. "Active") to include in API
  5432. // requests with the JSON null value. By default, fields with empty
  5433. // values are omitted from API requests. However, any field with an
  5434. // empty value appearing in NullFields will be sent to the server as
  5435. // null. It is an error if a field in this list has a non-empty value.
  5436. // This may be used to include null fields in Patch requests.
  5437. NullFields []string `json:"-"`
  5438. }
  5439. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5440. type NoMethod DirectorySite
  5441. raw := NoMethod(*s)
  5442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5443. }
  5444. // DirectorySiteContact: Contains properties of a Site Directory
  5445. // contact.
  5446. type DirectorySiteContact struct {
  5447. // Address: Address of this directory site contact.
  5448. Address string `json:"address,omitempty"`
  5449. // Email: Email address of this directory site contact.
  5450. Email string `json:"email,omitempty"`
  5451. // FirstName: First name of this directory site contact.
  5452. FirstName string `json:"firstName,omitempty"`
  5453. // Id: ID of this directory site contact. This is a read-only,
  5454. // auto-generated field.
  5455. Id int64 `json:"id,omitempty,string"`
  5456. // Kind: Identifies what kind of resource this is. Value: the fixed
  5457. // string "dfareporting#directorySiteContact".
  5458. Kind string `json:"kind,omitempty"`
  5459. // LastName: Last name of this directory site contact.
  5460. LastName string `json:"lastName,omitempty"`
  5461. // Phone: Phone number of this directory site contact.
  5462. Phone string `json:"phone,omitempty"`
  5463. // Role: Directory site contact role.
  5464. //
  5465. // Possible values:
  5466. // "ADMIN"
  5467. // "EDIT"
  5468. // "VIEW"
  5469. Role string `json:"role,omitempty"`
  5470. // Title: Title or designation of this directory site contact.
  5471. Title string `json:"title,omitempty"`
  5472. // Type: Directory site contact type.
  5473. //
  5474. // Possible values:
  5475. // "BILLING"
  5476. // "OTHER"
  5477. // "SALES"
  5478. // "TECHNICAL"
  5479. Type string `json:"type,omitempty"`
  5480. // ServerResponse contains the HTTP response code and headers from the
  5481. // server.
  5482. googleapi.ServerResponse `json:"-"`
  5483. // ForceSendFields is a list of field names (e.g. "Address") to
  5484. // unconditionally include in API requests. By default, fields with
  5485. // empty values are omitted from API requests. However, any non-pointer,
  5486. // non-interface field appearing in ForceSendFields will be sent to the
  5487. // server regardless of whether the field is empty or not. This may be
  5488. // used to include empty fields in Patch requests.
  5489. ForceSendFields []string `json:"-"`
  5490. // NullFields is a list of field names (e.g. "Address") to include in
  5491. // API requests with the JSON null value. By default, fields with empty
  5492. // values are omitted from API requests. However, any field with an
  5493. // empty value appearing in NullFields will be sent to the server as
  5494. // null. It is an error if a field in this list has a non-empty value.
  5495. // This may be used to include null fields in Patch requests.
  5496. NullFields []string `json:"-"`
  5497. }
  5498. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5499. type NoMethod DirectorySiteContact
  5500. raw := NoMethod(*s)
  5501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5502. }
  5503. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5504. type DirectorySiteContactAssignment struct {
  5505. // ContactId: ID of this directory site contact. This is a read-only,
  5506. // auto-generated field.
  5507. ContactId int64 `json:"contactId,omitempty,string"`
  5508. // Visibility: Visibility of this directory site contact assignment.
  5509. // When set to PUBLIC this contact assignment is visible to all account
  5510. // and agency users; when set to PRIVATE it is visible only to the site.
  5511. //
  5512. // Possible values:
  5513. // "PRIVATE"
  5514. // "PUBLIC"
  5515. Visibility string `json:"visibility,omitempty"`
  5516. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5517. // unconditionally include in API requests. By default, fields with
  5518. // empty values are omitted from API requests. However, any non-pointer,
  5519. // non-interface field appearing in ForceSendFields will be sent to the
  5520. // server regardless of whether the field is empty or not. This may be
  5521. // used to include empty fields in Patch requests.
  5522. ForceSendFields []string `json:"-"`
  5523. // NullFields is a list of field names (e.g. "ContactId") to include in
  5524. // API requests with the JSON null value. By default, fields with empty
  5525. // values are omitted from API requests. However, any field with an
  5526. // empty value appearing in NullFields will be sent to the server as
  5527. // null. It is an error if a field in this list has a non-empty value.
  5528. // This may be used to include null fields in Patch requests.
  5529. NullFields []string `json:"-"`
  5530. }
  5531. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5532. type NoMethod DirectorySiteContactAssignment
  5533. raw := NoMethod(*s)
  5534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5535. }
  5536. // DirectorySiteContactsListResponse: Directory Site Contact List
  5537. // Response
  5538. type DirectorySiteContactsListResponse struct {
  5539. // DirectorySiteContacts: Directory site contact collection
  5540. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5541. // Kind: Identifies what kind of resource this is. Value: the fixed
  5542. // string "dfareporting#directorySiteContactsListResponse".
  5543. Kind string `json:"kind,omitempty"`
  5544. // NextPageToken: Pagination token to be used for the next list
  5545. // operation.
  5546. NextPageToken string `json:"nextPageToken,omitempty"`
  5547. // ServerResponse contains the HTTP response code and headers from the
  5548. // server.
  5549. googleapi.ServerResponse `json:"-"`
  5550. // ForceSendFields is a list of field names (e.g.
  5551. // "DirectorySiteContacts") to unconditionally include in API requests.
  5552. // By default, fields with empty values are omitted from API requests.
  5553. // However, any non-pointer, non-interface field appearing in
  5554. // ForceSendFields will be sent to the server regardless of whether the
  5555. // field is empty or not. This may be used to include empty fields in
  5556. // Patch requests.
  5557. ForceSendFields []string `json:"-"`
  5558. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5559. // include in API requests with the JSON null value. By default, fields
  5560. // with empty values are omitted from API requests. However, any field
  5561. // with an empty value appearing in NullFields will be sent to the
  5562. // server as null. It is an error if a field in this list has a
  5563. // non-empty value. This may be used to include null fields in Patch
  5564. // requests.
  5565. NullFields []string `json:"-"`
  5566. }
  5567. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5568. type NoMethod DirectorySiteContactsListResponse
  5569. raw := NoMethod(*s)
  5570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5571. }
  5572. // DirectorySiteSettings: Directory Site Settings
  5573. type DirectorySiteSettings struct {
  5574. // ActiveViewOptOut: Whether this directory site has disabled active
  5575. // view creatives.
  5576. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5577. // DfpSettings: Directory site Ad Manager settings.
  5578. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5579. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5580. // video ads.
  5581. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5582. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5583. // ads.
  5584. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5585. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5586. // OCR reach ratings.
  5587. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5588. // VerificationTagOptOut: Whether this directory site has disabled
  5589. // generation of Verification ins tags.
  5590. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5591. // VideoActiveViewOptOut: Whether this directory site has disabled
  5592. // active view for in-stream video creatives. This is a read-only field.
  5593. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5594. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5595. // unconditionally include in API requests. By default, fields with
  5596. // empty values are omitted from API requests. However, any non-pointer,
  5597. // non-interface field appearing in ForceSendFields will be sent to the
  5598. // server regardless of whether the field is empty or not. This may be
  5599. // used to include empty fields in Patch requests.
  5600. ForceSendFields []string `json:"-"`
  5601. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5602. // include in API requests with the JSON null value. By default, fields
  5603. // with empty values are omitted from API requests. However, any field
  5604. // with an empty value appearing in NullFields will be sent to the
  5605. // server as null. It is an error if a field in this list has a
  5606. // non-empty value. This may be used to include null fields in Patch
  5607. // requests.
  5608. NullFields []string `json:"-"`
  5609. }
  5610. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5611. type NoMethod DirectorySiteSettings
  5612. raw := NoMethod(*s)
  5613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5614. }
  5615. // DirectorySitesListResponse: Directory Site List Response
  5616. type DirectorySitesListResponse struct {
  5617. // DirectorySites: Directory site collection.
  5618. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5619. // Kind: Identifies what kind of resource this is. Value: the fixed
  5620. // string "dfareporting#directorySitesListResponse".
  5621. Kind string `json:"kind,omitempty"`
  5622. // NextPageToken: Pagination token to be used for the next list
  5623. // operation.
  5624. NextPageToken string `json:"nextPageToken,omitempty"`
  5625. // ServerResponse contains the HTTP response code and headers from the
  5626. // server.
  5627. googleapi.ServerResponse `json:"-"`
  5628. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5629. // unconditionally include in API requests. By default, fields with
  5630. // empty values are omitted from API requests. However, any non-pointer,
  5631. // non-interface field appearing in ForceSendFields will be sent to the
  5632. // server regardless of whether the field is empty or not. This may be
  5633. // used to include empty fields in Patch requests.
  5634. ForceSendFields []string `json:"-"`
  5635. // NullFields is a list of field names (e.g. "DirectorySites") to
  5636. // include in API requests with the JSON null value. By default, fields
  5637. // with empty values are omitted from API requests. However, any field
  5638. // with an empty value appearing in NullFields will be sent to the
  5639. // server as null. It is an error if a field in this list has a
  5640. // non-empty value. This may be used to include null fields in Patch
  5641. // requests.
  5642. NullFields []string `json:"-"`
  5643. }
  5644. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5645. type NoMethod DirectorySitesListResponse
  5646. raw := NoMethod(*s)
  5647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5648. }
  5649. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5650. // Dynamic targeting keys are unique, user-friendly labels, created at
  5651. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5652. // and placements and used for targeting with Studio dynamic creatives.
  5653. // Use these labels instead of numeric Campaign Manager IDs (such as
  5654. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5655. type DynamicTargetingKey struct {
  5656. // Kind: Identifies what kind of resource this is. Value: the fixed
  5657. // string "dfareporting#dynamicTargetingKey".
  5658. Kind string `json:"kind,omitempty"`
  5659. // Name: Name of this dynamic targeting key. This is a required field.
  5660. // Must be less than 256 characters long and cannot contain commas. All
  5661. // characters are converted to lowercase.
  5662. Name string `json:"name,omitempty"`
  5663. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5664. // required field.
  5665. ObjectId int64 `json:"objectId,omitempty,string"`
  5666. // ObjectType: Type of the object of this dynamic targeting key. This is
  5667. // a required field.
  5668. //
  5669. // Possible values:
  5670. // "OBJECT_AD"
  5671. // "OBJECT_ADVERTISER"
  5672. // "OBJECT_CREATIVE"
  5673. // "OBJECT_PLACEMENT"
  5674. ObjectType string `json:"objectType,omitempty"`
  5675. // ServerResponse contains the HTTP response code and headers from the
  5676. // server.
  5677. googleapi.ServerResponse `json:"-"`
  5678. // ForceSendFields is a list of field names (e.g. "Kind") to
  5679. // unconditionally include in API requests. By default, fields with
  5680. // empty values are omitted from API requests. However, any non-pointer,
  5681. // non-interface field appearing in ForceSendFields will be sent to the
  5682. // server regardless of whether the field is empty or not. This may be
  5683. // used to include empty fields in Patch requests.
  5684. ForceSendFields []string `json:"-"`
  5685. // NullFields is a list of field names (e.g. "Kind") to include in API
  5686. // requests with the JSON null value. By default, fields with empty
  5687. // values are omitted from API requests. However, any field with an
  5688. // empty value appearing in NullFields will be sent to the server as
  5689. // null. It is an error if a field in this list has a non-empty value.
  5690. // This may be used to include null fields in Patch requests.
  5691. NullFields []string `json:"-"`
  5692. }
  5693. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5694. type NoMethod DynamicTargetingKey
  5695. raw := NoMethod(*s)
  5696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5697. }
  5698. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5699. type DynamicTargetingKeysListResponse struct {
  5700. // DynamicTargetingKeys: Dynamic targeting key collection.
  5701. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5702. // Kind: Identifies what kind of resource this is. Value: the fixed
  5703. // string "dfareporting#dynamicTargetingKeysListResponse".
  5704. Kind string `json:"kind,omitempty"`
  5705. // ServerResponse contains the HTTP response code and headers from the
  5706. // server.
  5707. googleapi.ServerResponse `json:"-"`
  5708. // ForceSendFields is a list of field names (e.g.
  5709. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5710. // By default, fields with empty values are omitted from API requests.
  5711. // However, any non-pointer, non-interface field appearing in
  5712. // ForceSendFields will be sent to the server regardless of whether the
  5713. // field is empty or not. This may be used to include empty fields in
  5714. // Patch requests.
  5715. ForceSendFields []string `json:"-"`
  5716. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5717. // include in API requests with the JSON null value. By default, fields
  5718. // with empty values are omitted from API requests. However, any field
  5719. // with an empty value appearing in NullFields will be sent to the
  5720. // server as null. It is an error if a field in this list has a
  5721. // non-empty value. This may be used to include null fields in Patch
  5722. // requests.
  5723. NullFields []string `json:"-"`
  5724. }
  5725. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5726. type NoMethod DynamicTargetingKeysListResponse
  5727. raw := NoMethod(*s)
  5728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5729. }
  5730. // EncryptionInfo: A description of how user IDs are encrypted.
  5731. type EncryptionInfo struct {
  5732. // EncryptionEntityId: The encryption entity ID. This should match the
  5733. // encryption configuration for ad serving or Data Transfer.
  5734. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5735. // EncryptionEntityType: The encryption entity type. This should match
  5736. // the encryption configuration for ad serving or Data Transfer.
  5737. //
  5738. // Possible values:
  5739. // "ADWORDS_CUSTOMER"
  5740. // "DBM_ADVERTISER"
  5741. // "DBM_PARTNER"
  5742. // "DCM_ACCOUNT"
  5743. // "DCM_ADVERTISER"
  5744. // "DFP_NETWORK_CODE"
  5745. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5746. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5747. // EncryptionSource: Describes whether the encrypted cookie was received
  5748. // from ad serving (the %m macro) or from Data Transfer.
  5749. //
  5750. // Possible values:
  5751. // "AD_SERVING"
  5752. // "DATA_TRANSFER"
  5753. // "ENCRYPTION_SCOPE_UNKNOWN"
  5754. EncryptionSource string `json:"encryptionSource,omitempty"`
  5755. // Kind: Identifies what kind of resource this is. Value: the fixed
  5756. // string "dfareporting#encryptionInfo".
  5757. Kind string `json:"kind,omitempty"`
  5758. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5759. // to unconditionally include in API requests. By default, fields with
  5760. // empty values are omitted from API requests. However, any non-pointer,
  5761. // non-interface field appearing in ForceSendFields will be sent to the
  5762. // server regardless of whether the field is empty or not. This may be
  5763. // used to include empty fields in Patch requests.
  5764. ForceSendFields []string `json:"-"`
  5765. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5766. // include in API requests with the JSON null value. By default, fields
  5767. // with empty values are omitted from API requests. However, any field
  5768. // with an empty value appearing in NullFields will be sent to the
  5769. // server as null. It is an error if a field in this list has a
  5770. // non-empty value. This may be used to include null fields in Patch
  5771. // requests.
  5772. NullFields []string `json:"-"`
  5773. }
  5774. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5775. type NoMethod EncryptionInfo
  5776. raw := NoMethod(*s)
  5777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5778. }
  5779. // EventTag: Contains properties of an event tag.
  5780. type EventTag struct {
  5781. // AccountId: Account ID of this event tag. This is a read-only field
  5782. // that can be left blank.
  5783. AccountId int64 `json:"accountId,omitempty,string"`
  5784. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5785. // campaignId field is required on insertion.
  5786. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5787. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5788. // advertiser. This is a read-only, auto-generated field.
  5789. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5790. // CampaignId: Campaign ID of this event tag. This field or the
  5791. // advertiserId field is required on insertion.
  5792. CampaignId int64 `json:"campaignId,omitempty,string"`
  5793. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5794. // This is a read-only, auto-generated field.
  5795. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5796. // EnabledByDefault: Whether this event tag should be automatically
  5797. // enabled for all of the advertiser's campaigns and ads.
  5798. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5799. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5800. // that are trafficked through Display & Video 360 to Ad Exchange. This
  5801. // may be useful if the event tag uses a pixel that is unapproved for Ad
  5802. // Exchange bids on one or more networks, such as the Google Display
  5803. // Network.
  5804. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5805. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5806. Id int64 `json:"id,omitempty,string"`
  5807. // Kind: Identifies what kind of resource this is. Value: the fixed
  5808. // string "dfareporting#eventTag".
  5809. Kind string `json:"kind,omitempty"`
  5810. // Name: Name of this event tag. This is a required field and must be
  5811. // less than 256 characters long.
  5812. Name string `json:"name,omitempty"`
  5813. // SiteFilterType: Site filter type for this event tag. If no type is
  5814. // specified then the event tag will be applied to all sites.
  5815. //
  5816. // Possible values:
  5817. // "BLACKLIST"
  5818. // "WHITELIST"
  5819. SiteFilterType string `json:"siteFilterType,omitempty"`
  5820. // SiteIds: Filter list of site IDs associated with this event tag. The
  5821. // siteFilterType determines whether this is a whitelist or blacklist
  5822. // filter.
  5823. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5824. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5825. // read-only field.
  5826. SslCompliant bool `json:"sslCompliant,omitempty"`
  5827. // Status: Status of this event tag. Must be ENABLED for this event tag
  5828. // to fire. This is a required field.
  5829. //
  5830. // Possible values:
  5831. // "DISABLED"
  5832. // "ENABLED"
  5833. Status string `json:"status,omitempty"`
  5834. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5835. // field that can be left blank.
  5836. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5837. // Type: Event tag type. Can be used to specify whether to use a
  5838. // third-party pixel, a third-party JavaScript URL, or a third-party
  5839. // click-through URL for either impression or click tracking. This is a
  5840. // required field.
  5841. //
  5842. // Possible values:
  5843. // "CLICK_THROUGH_EVENT_TAG"
  5844. // "IMPRESSION_IMAGE_EVENT_TAG"
  5845. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5846. Type string `json:"type,omitempty"`
  5847. // Url: Payload URL for this event tag. The URL on a click-through event
  5848. // tag should have a landing page URL appended to the end of it. This
  5849. // field is required on insertion.
  5850. Url string `json:"url,omitempty"`
  5851. // UrlEscapeLevels: Number of times the landing page URL should be
  5852. // URL-escaped before being appended to the click-through event tag URL.
  5853. // Only applies to click-through event tags as specified by the event
  5854. // tag type.
  5855. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5856. // ServerResponse contains the HTTP response code and headers from the
  5857. // server.
  5858. googleapi.ServerResponse `json:"-"`
  5859. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5860. // unconditionally include in API requests. By default, fields with
  5861. // empty values are omitted from API requests. However, any non-pointer,
  5862. // non-interface field appearing in ForceSendFields will be sent to the
  5863. // server regardless of whether the field is empty or not. This may be
  5864. // used to include empty fields in Patch requests.
  5865. ForceSendFields []string `json:"-"`
  5866. // NullFields is a list of field names (e.g. "AccountId") to include in
  5867. // API requests with the JSON null value. By default, fields with empty
  5868. // values are omitted from API requests. However, any field with an
  5869. // empty value appearing in NullFields will be sent to the server as
  5870. // null. It is an error if a field in this list has a non-empty value.
  5871. // This may be used to include null fields in Patch requests.
  5872. NullFields []string `json:"-"`
  5873. }
  5874. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5875. type NoMethod EventTag
  5876. raw := NoMethod(*s)
  5877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5878. }
  5879. // EventTagOverride: Event tag override information.
  5880. type EventTagOverride struct {
  5881. // Enabled: Whether this override is enabled.
  5882. Enabled bool `json:"enabled,omitempty"`
  5883. // Id: ID of this event tag override. This is a read-only,
  5884. // auto-generated field.
  5885. Id int64 `json:"id,omitempty,string"`
  5886. // ForceSendFields is a list of field names (e.g. "Enabled") to
  5887. // unconditionally include in API requests. By default, fields with
  5888. // empty values are omitted from API requests. However, any non-pointer,
  5889. // non-interface field appearing in ForceSendFields will be sent to the
  5890. // server regardless of whether the field is empty or not. This may be
  5891. // used to include empty fields in Patch requests.
  5892. ForceSendFields []string `json:"-"`
  5893. // NullFields is a list of field names (e.g. "Enabled") to include in
  5894. // API requests with the JSON null value. By default, fields with empty
  5895. // values are omitted from API requests. However, any field with an
  5896. // empty value appearing in NullFields will be sent to the server as
  5897. // null. It is an error if a field in this list has a non-empty value.
  5898. // This may be used to include null fields in Patch requests.
  5899. NullFields []string `json:"-"`
  5900. }
  5901. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  5902. type NoMethod EventTagOverride
  5903. raw := NoMethod(*s)
  5904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5905. }
  5906. // EventTagsListResponse: Event Tag List Response
  5907. type EventTagsListResponse struct {
  5908. // EventTags: Event tag collection.
  5909. EventTags []*EventTag `json:"eventTags,omitempty"`
  5910. // Kind: Identifies what kind of resource this is. Value: the fixed
  5911. // string "dfareporting#eventTagsListResponse".
  5912. Kind string `json:"kind,omitempty"`
  5913. // ServerResponse contains the HTTP response code and headers from the
  5914. // server.
  5915. googleapi.ServerResponse `json:"-"`
  5916. // ForceSendFields is a list of field names (e.g. "EventTags") to
  5917. // unconditionally include in API requests. By default, fields with
  5918. // empty values are omitted from API requests. However, any non-pointer,
  5919. // non-interface field appearing in ForceSendFields will be sent to the
  5920. // server regardless of whether the field is empty or not. This may be
  5921. // used to include empty fields in Patch requests.
  5922. ForceSendFields []string `json:"-"`
  5923. // NullFields is a list of field names (e.g. "EventTags") to include in
  5924. // API requests with the JSON null value. By default, fields with empty
  5925. // values are omitted from API requests. However, any field with an
  5926. // empty value appearing in NullFields will be sent to the server as
  5927. // null. It is an error if a field in this list has a non-empty value.
  5928. // This may be used to include null fields in Patch requests.
  5929. NullFields []string `json:"-"`
  5930. }
  5931. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5932. type NoMethod EventTagsListResponse
  5933. raw := NoMethod(*s)
  5934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5935. }
  5936. // File: Represents a File resource. A file contains the metadata for a
  5937. // report run. It shows the status of the run and holds the URLs to the
  5938. // generated report data if the run is finished and the status is
  5939. // "REPORT_AVAILABLE".
  5940. type File struct {
  5941. // DateRange: The date range for which the file has report data. The
  5942. // date range will always be the absolute date range for which the
  5943. // report is run.
  5944. DateRange *DateRange `json:"dateRange,omitempty"`
  5945. // Etag: The eTag of this response for caching purposes.
  5946. Etag string `json:"etag,omitempty"`
  5947. // FileName: The filename of the file.
  5948. FileName string `json:"fileName,omitempty"`
  5949. // Format: The output format of the report. Only available once the file
  5950. // is available.
  5951. //
  5952. // Possible values:
  5953. // "CSV"
  5954. // "EXCEL"
  5955. Format string `json:"format,omitempty"`
  5956. // Id: The unique ID of this report file.
  5957. Id int64 `json:"id,omitempty,string"`
  5958. // Kind: The kind of resource this is, in this case dfareporting#file.
  5959. Kind string `json:"kind,omitempty"`
  5960. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  5961. // file was last modified.
  5962. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  5963. // ReportId: The ID of the report this file was generated from.
  5964. ReportId int64 `json:"reportId,omitempty,string"`
  5965. // Status: The status of the report file.
  5966. //
  5967. // Possible values:
  5968. // "CANCELLED"
  5969. // "FAILED"
  5970. // "PROCESSING"
  5971. // "REPORT_AVAILABLE"
  5972. Status string `json:"status,omitempty"`
  5973. // Urls: The URLs where the completed report file can be downloaded.
  5974. Urls *FileUrls `json:"urls,omitempty"`
  5975. // ServerResponse contains the HTTP response code and headers from the
  5976. // server.
  5977. googleapi.ServerResponse `json:"-"`
  5978. // ForceSendFields is a list of field names (e.g. "DateRange") to
  5979. // unconditionally include in API requests. By default, fields with
  5980. // empty values are omitted from API requests. However, any non-pointer,
  5981. // non-interface field appearing in ForceSendFields will be sent to the
  5982. // server regardless of whether the field is empty or not. This may be
  5983. // used to include empty fields in Patch requests.
  5984. ForceSendFields []string `json:"-"`
  5985. // NullFields is a list of field names (e.g. "DateRange") to include in
  5986. // API requests with the JSON null value. By default, fields with empty
  5987. // values are omitted from API requests. However, any field with an
  5988. // empty value appearing in NullFields will be sent to the server as
  5989. // null. It is an error if a field in this list has a non-empty value.
  5990. // This may be used to include null fields in Patch requests.
  5991. NullFields []string `json:"-"`
  5992. }
  5993. func (s *File) MarshalJSON() ([]byte, error) {
  5994. type NoMethod File
  5995. raw := NoMethod(*s)
  5996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5997. }
  5998. // FileUrls: The URLs where the completed report file can be downloaded.
  5999. type FileUrls struct {
  6000. // ApiUrl: The URL for downloading the report data through the API.
  6001. ApiUrl string `json:"apiUrl,omitempty"`
  6002. // BrowserUrl: The URL for downloading the report data through a
  6003. // browser.
  6004. BrowserUrl string `json:"browserUrl,omitempty"`
  6005. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  6006. // unconditionally include in API requests. By default, fields with
  6007. // empty values are omitted from API requests. However, any non-pointer,
  6008. // non-interface field appearing in ForceSendFields will be sent to the
  6009. // server regardless of whether the field is empty or not. This may be
  6010. // used to include empty fields in Patch requests.
  6011. ForceSendFields []string `json:"-"`
  6012. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  6013. // requests with the JSON null value. By default, fields with empty
  6014. // values are omitted from API requests. However, any field with an
  6015. // empty value appearing in NullFields will be sent to the server as
  6016. // null. It is an error if a field in this list has a non-empty value.
  6017. // This may be used to include null fields in Patch requests.
  6018. NullFields []string `json:"-"`
  6019. }
  6020. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  6021. type NoMethod FileUrls
  6022. raw := NoMethod(*s)
  6023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6024. }
  6025. // FileList: Represents the list of File resources.
  6026. type FileList struct {
  6027. // Etag: The eTag of this response for caching purposes.
  6028. Etag string `json:"etag,omitempty"`
  6029. // Items: The files returned in this response.
  6030. Items []*File `json:"items,omitempty"`
  6031. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6032. Kind string `json:"kind,omitempty"`
  6033. // NextPageToken: Continuation token used to page through files. To
  6034. // retrieve the next page of results, set the next request's "pageToken"
  6035. // to the value of this field. The page token is only valid for a
  6036. // limited amount of time and should not be persisted.
  6037. NextPageToken string `json:"nextPageToken,omitempty"`
  6038. // ServerResponse contains the HTTP response code and headers from the
  6039. // server.
  6040. googleapi.ServerResponse `json:"-"`
  6041. // ForceSendFields is a list of field names (e.g. "Etag") to
  6042. // unconditionally include in API requests. By default, fields with
  6043. // empty values are omitted from API requests. However, any non-pointer,
  6044. // non-interface field appearing in ForceSendFields will be sent to the
  6045. // server regardless of whether the field is empty or not. This may be
  6046. // used to include empty fields in Patch requests.
  6047. ForceSendFields []string `json:"-"`
  6048. // NullFields is a list of field names (e.g. "Etag") to include in API
  6049. // requests with the JSON null value. By default, fields with empty
  6050. // values are omitted from API requests. However, any field with an
  6051. // empty value appearing in NullFields will be sent to the server as
  6052. // null. It is an error if a field in this list has a non-empty value.
  6053. // This may be used to include null fields in Patch requests.
  6054. NullFields []string `json:"-"`
  6055. }
  6056. func (s *FileList) MarshalJSON() ([]byte, error) {
  6057. type NoMethod FileList
  6058. raw := NoMethod(*s)
  6059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6060. }
  6061. // Flight: Flight
  6062. type Flight struct {
  6063. // EndDate: Inventory item flight end date.
  6064. EndDate string `json:"endDate,omitempty"`
  6065. // RateOrCost: Rate or cost of this flight.
  6066. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6067. // StartDate: Inventory item flight start date.
  6068. StartDate string `json:"startDate,omitempty"`
  6069. // Units: Units of this flight.
  6070. Units int64 `json:"units,omitempty,string"`
  6071. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6072. // unconditionally include in API requests. By default, fields with
  6073. // empty values are omitted from API requests. However, any non-pointer,
  6074. // non-interface field appearing in ForceSendFields will be sent to the
  6075. // server regardless of whether the field is empty or not. This may be
  6076. // used to include empty fields in Patch requests.
  6077. ForceSendFields []string `json:"-"`
  6078. // NullFields is a list of field names (e.g. "EndDate") to include in
  6079. // API requests with the JSON null value. By default, fields with empty
  6080. // values are omitted from API requests. However, any field with an
  6081. // empty value appearing in NullFields will be sent to the server as
  6082. // null. It is an error if a field in this list has a non-empty value.
  6083. // This may be used to include null fields in Patch requests.
  6084. NullFields []string `json:"-"`
  6085. }
  6086. func (s *Flight) MarshalJSON() ([]byte, error) {
  6087. type NoMethod Flight
  6088. raw := NoMethod(*s)
  6089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6090. }
  6091. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6092. // GenerateTag Response
  6093. type FloodlightActivitiesGenerateTagResponse struct {
  6094. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6095. // For global site tags, this is the event snippet.
  6096. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6097. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6098. // site tag. The global site tag sets new cookies on your domain, which
  6099. // will store a unique identifier for a user or the ad click that
  6100. // brought the user to your site. Learn more.
  6101. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6102. // Kind: Identifies what kind of resource this is. Value: the fixed
  6103. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6104. Kind string `json:"kind,omitempty"`
  6105. // ServerResponse contains the HTTP response code and headers from the
  6106. // server.
  6107. googleapi.ServerResponse `json:"-"`
  6108. // ForceSendFields is a list of field names (e.g.
  6109. // "FloodlightActivityTag") to unconditionally include in API requests.
  6110. // By default, fields with empty values are omitted from API requests.
  6111. // However, any non-pointer, non-interface field appearing in
  6112. // ForceSendFields will be sent to the server regardless of whether the
  6113. // field is empty or not. This may be used to include empty fields in
  6114. // Patch requests.
  6115. ForceSendFields []string `json:"-"`
  6116. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6117. // include in API requests with the JSON null value. By default, fields
  6118. // with empty values are omitted from API requests. However, any field
  6119. // with an empty value appearing in NullFields will be sent to the
  6120. // server as null. It is an error if a field in this list has a
  6121. // non-empty value. This may be used to include null fields in Patch
  6122. // requests.
  6123. NullFields []string `json:"-"`
  6124. }
  6125. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6126. type NoMethod FloodlightActivitiesGenerateTagResponse
  6127. raw := NoMethod(*s)
  6128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6129. }
  6130. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6131. type FloodlightActivitiesListResponse struct {
  6132. // FloodlightActivities: Floodlight activity collection.
  6133. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6134. // Kind: Identifies what kind of resource this is. Value: the fixed
  6135. // string "dfareporting#floodlightActivitiesListResponse".
  6136. Kind string `json:"kind,omitempty"`
  6137. // NextPageToken: Pagination token to be used for the next list
  6138. // operation.
  6139. NextPageToken string `json:"nextPageToken,omitempty"`
  6140. // ServerResponse contains the HTTP response code and headers from the
  6141. // server.
  6142. googleapi.ServerResponse `json:"-"`
  6143. // ForceSendFields is a list of field names (e.g.
  6144. // "FloodlightActivities") to unconditionally include in API requests.
  6145. // By default, fields with empty values are omitted from API requests.
  6146. // However, any non-pointer, non-interface field appearing in
  6147. // ForceSendFields will be sent to the server regardless of whether the
  6148. // field is empty or not. This may be used to include empty fields in
  6149. // Patch requests.
  6150. ForceSendFields []string `json:"-"`
  6151. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6152. // include in API requests with the JSON null value. By default, fields
  6153. // with empty values are omitted from API requests. However, any field
  6154. // with an empty value appearing in NullFields will be sent to the
  6155. // server as null. It is an error if a field in this list has a
  6156. // non-empty value. This may be used to include null fields in Patch
  6157. // requests.
  6158. NullFields []string `json:"-"`
  6159. }
  6160. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6161. type NoMethod FloodlightActivitiesListResponse
  6162. raw := NoMethod(*s)
  6163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6164. }
  6165. // FloodlightActivity: Contains properties of a Floodlight activity.
  6166. type FloodlightActivity struct {
  6167. // AccountId: Account ID of this floodlight activity. This is a
  6168. // read-only field that can be left blank.
  6169. AccountId int64 `json:"accountId,omitempty,string"`
  6170. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6171. // field is left blank, the value will be copied over either from the
  6172. // activity group's advertiser or the existing activity's advertiser.
  6173. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6174. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6175. // advertiser. This is a read-only, auto-generated field.
  6176. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6177. // CacheBustingType: Code type used for cache busting in the generated
  6178. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6179. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6180. //
  6181. // Possible values:
  6182. // "ACTIVE_SERVER_PAGE"
  6183. // "COLD_FUSION"
  6184. // "JAVASCRIPT"
  6185. // "JSP"
  6186. // "PHP"
  6187. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6188. // CountingMethod: Counting method for conversions for this floodlight
  6189. // activity. This is a required field.
  6190. //
  6191. // Possible values:
  6192. // "ITEMS_SOLD_COUNTING"
  6193. // "SESSION_COUNTING"
  6194. // "STANDARD_COUNTING"
  6195. // "TRANSACTIONS_COUNTING"
  6196. // "UNIQUE_COUNTING"
  6197. CountingMethod string `json:"countingMethod,omitempty"`
  6198. // DefaultTags: Dynamic floodlight tags.
  6199. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6200. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6201. // be less than 256 characters long.
  6202. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6203. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6204. // floodlight activity. This is a required field.
  6205. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6206. // FloodlightActivityGroupName: Name of the associated floodlight
  6207. // activity group. This is a read-only field.
  6208. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6209. // FloodlightActivityGroupTagString: Tag string of the associated
  6210. // floodlight activity group. This is a read-only field.
  6211. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6212. // FloodlightActivityGroupType: Type of the associated floodlight
  6213. // activity group. This is a read-only field.
  6214. //
  6215. // Possible values:
  6216. // "COUNTER"
  6217. // "SALE"
  6218. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6219. // FloodlightConfigurationId: Floodlight configuration ID of this
  6220. // floodlight activity. If this field is left blank, the value will be
  6221. // copied over either from the activity group's floodlight configuration
  6222. // or from the existing activity's floodlight configuration.
  6223. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6224. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6225. // of the floodlight configuration. This is a read-only, auto-generated
  6226. // field.
  6227. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6228. // FloodlightTagType: The type of Floodlight tag this activity will
  6229. // generate. This is a required field.
  6230. //
  6231. // Possible values:
  6232. // "GLOBAL_SITE_TAG"
  6233. // "IFRAME"
  6234. // "IMAGE"
  6235. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6236. // Hidden: Whether this activity is archived.
  6237. Hidden bool `json:"hidden,omitempty"`
  6238. // Id: ID of this floodlight activity. This is a read-only,
  6239. // auto-generated field.
  6240. Id int64 `json:"id,omitempty,string"`
  6241. // IdDimensionValue: Dimension value for the ID of this floodlight
  6242. // activity. This is a read-only, auto-generated field.
  6243. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6244. // Kind: Identifies what kind of resource this is. Value: the fixed
  6245. // string "dfareporting#floodlightActivity".
  6246. Kind string `json:"kind,omitempty"`
  6247. // Name: Name of this floodlight activity. This is a required field.
  6248. // Must be less than 129 characters long and cannot contain quotes.
  6249. Name string `json:"name,omitempty"`
  6250. // Notes: General notes or implementation instructions for the tag.
  6251. Notes string `json:"notes,omitempty"`
  6252. // PublisherTags: Publisher dynamic floodlight tags.
  6253. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6254. // Secure: Whether this tag should use SSL.
  6255. Secure bool `json:"secure,omitempty"`
  6256. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6257. // is a read-only field, its value detected by the system from the
  6258. // floodlight tags.
  6259. SslCompliant bool `json:"sslCompliant,omitempty"`
  6260. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6261. SslRequired bool `json:"sslRequired,omitempty"`
  6262. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6263. // read-only field that can be left blank.
  6264. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6265. // TagFormat: Tag format type for the floodlight activity. If left
  6266. // blank, the tag format will default to HTML.
  6267. //
  6268. // Possible values:
  6269. // "HTML"
  6270. // "XHTML"
  6271. TagFormat string `json:"tagFormat,omitempty"`
  6272. // TagString: Value of the cat= parameter in the floodlight tag, which
  6273. // the ad servers use to identify the activity. This is optional: if
  6274. // empty, a new tag string will be generated for you. This string must
  6275. // be 1 to 8 characters long, with valid characters being
  6276. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6277. // activities of the same activity group. This field is read-only after
  6278. // insertion.
  6279. TagString string `json:"tagString,omitempty"`
  6280. // UserDefinedVariableTypes: List of the user-defined variables used by
  6281. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6282. // of these can have a user defined type.
  6283. // Acceptable values are U1 to U100, inclusive.
  6284. //
  6285. // Possible values:
  6286. // "U1"
  6287. // "U10"
  6288. // "U100"
  6289. // "U11"
  6290. // "U12"
  6291. // "U13"
  6292. // "U14"
  6293. // "U15"
  6294. // "U16"
  6295. // "U17"
  6296. // "U18"
  6297. // "U19"
  6298. // "U2"
  6299. // "U20"
  6300. // "U21"
  6301. // "U22"
  6302. // "U23"
  6303. // "U24"
  6304. // "U25"
  6305. // "U26"
  6306. // "U27"
  6307. // "U28"
  6308. // "U29"
  6309. // "U3"
  6310. // "U30"
  6311. // "U31"
  6312. // "U32"
  6313. // "U33"
  6314. // "U34"
  6315. // "U35"
  6316. // "U36"
  6317. // "U37"
  6318. // "U38"
  6319. // "U39"
  6320. // "U4"
  6321. // "U40"
  6322. // "U41"
  6323. // "U42"
  6324. // "U43"
  6325. // "U44"
  6326. // "U45"
  6327. // "U46"
  6328. // "U47"
  6329. // "U48"
  6330. // "U49"
  6331. // "U5"
  6332. // "U50"
  6333. // "U51"
  6334. // "U52"
  6335. // "U53"
  6336. // "U54"
  6337. // "U55"
  6338. // "U56"
  6339. // "U57"
  6340. // "U58"
  6341. // "U59"
  6342. // "U6"
  6343. // "U60"
  6344. // "U61"
  6345. // "U62"
  6346. // "U63"
  6347. // "U64"
  6348. // "U65"
  6349. // "U66"
  6350. // "U67"
  6351. // "U68"
  6352. // "U69"
  6353. // "U7"
  6354. // "U70"
  6355. // "U71"
  6356. // "U72"
  6357. // "U73"
  6358. // "U74"
  6359. // "U75"
  6360. // "U76"
  6361. // "U77"
  6362. // "U78"
  6363. // "U79"
  6364. // "U8"
  6365. // "U80"
  6366. // "U81"
  6367. // "U82"
  6368. // "U83"
  6369. // "U84"
  6370. // "U85"
  6371. // "U86"
  6372. // "U87"
  6373. // "U88"
  6374. // "U89"
  6375. // "U9"
  6376. // "U90"
  6377. // "U91"
  6378. // "U92"
  6379. // "U93"
  6380. // "U94"
  6381. // "U95"
  6382. // "U96"
  6383. // "U97"
  6384. // "U98"
  6385. // "U99"
  6386. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6387. // ServerResponse contains the HTTP response code and headers from the
  6388. // server.
  6389. googleapi.ServerResponse `json:"-"`
  6390. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6391. // unconditionally include in API requests. By default, fields with
  6392. // empty values are omitted from API requests. However, any non-pointer,
  6393. // non-interface field appearing in ForceSendFields will be sent to the
  6394. // server regardless of whether the field is empty or not. This may be
  6395. // used to include empty fields in Patch requests.
  6396. ForceSendFields []string `json:"-"`
  6397. // NullFields is a list of field names (e.g. "AccountId") to include in
  6398. // API requests with the JSON null value. By default, fields with empty
  6399. // values are omitted from API requests. However, any field with an
  6400. // empty value appearing in NullFields will be sent to the server as
  6401. // null. It is an error if a field in this list has a non-empty value.
  6402. // This may be used to include null fields in Patch requests.
  6403. NullFields []string `json:"-"`
  6404. }
  6405. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6406. type NoMethod FloodlightActivity
  6407. raw := NoMethod(*s)
  6408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6409. }
  6410. // FloodlightActivityDynamicTag: Dynamic Tag
  6411. type FloodlightActivityDynamicTag struct {
  6412. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6413. // field.
  6414. Id int64 `json:"id,omitempty,string"`
  6415. // Name: Name of this tag.
  6416. Name string `json:"name,omitempty"`
  6417. // Tag: Tag code.
  6418. Tag string `json:"tag,omitempty"`
  6419. // ForceSendFields is a list of field names (e.g. "Id") to
  6420. // unconditionally include in API requests. By default, fields with
  6421. // empty values are omitted from API requests. However, any non-pointer,
  6422. // non-interface field appearing in ForceSendFields will be sent to the
  6423. // server regardless of whether the field is empty or not. This may be
  6424. // used to include empty fields in Patch requests.
  6425. ForceSendFields []string `json:"-"`
  6426. // NullFields is a list of field names (e.g. "Id") to include in API
  6427. // requests with the JSON null value. By default, fields with empty
  6428. // values are omitted from API requests. However, any field with an
  6429. // empty value appearing in NullFields will be sent to the server as
  6430. // null. It is an error if a field in this list has a non-empty value.
  6431. // This may be used to include null fields in Patch requests.
  6432. NullFields []string `json:"-"`
  6433. }
  6434. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6435. type NoMethod FloodlightActivityDynamicTag
  6436. raw := NoMethod(*s)
  6437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6438. }
  6439. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6440. // group.
  6441. type FloodlightActivityGroup struct {
  6442. // AccountId: Account ID of this floodlight activity group. This is a
  6443. // read-only field that can be left blank.
  6444. AccountId int64 `json:"accountId,omitempty,string"`
  6445. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6446. // this field is left blank, the value will be copied over either from
  6447. // the floodlight configuration's advertiser or from the existing
  6448. // activity group's advertiser.
  6449. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6450. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6451. // advertiser. This is a read-only, auto-generated field.
  6452. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6453. // FloodlightConfigurationId: Floodlight configuration ID of this
  6454. // floodlight activity group. This is a required field.
  6455. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6456. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6457. // of the floodlight configuration. This is a read-only, auto-generated
  6458. // field.
  6459. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6460. // Id: ID of this floodlight activity group. This is a read-only,
  6461. // auto-generated field.
  6462. Id int64 `json:"id,omitempty,string"`
  6463. // IdDimensionValue: Dimension value for the ID of this floodlight
  6464. // activity group. This is a read-only, auto-generated field.
  6465. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6466. // Kind: Identifies what kind of resource this is. Value: the fixed
  6467. // string "dfareporting#floodlightActivityGroup".
  6468. Kind string `json:"kind,omitempty"`
  6469. // Name: Name of this floodlight activity group. This is a required
  6470. // field. Must be less than 65 characters long and cannot contain
  6471. // quotes.
  6472. Name string `json:"name,omitempty"`
  6473. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6474. // is a read-only field that can be left blank.
  6475. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6476. // TagString: Value of the type= parameter in the floodlight tag, which
  6477. // the ad servers use to identify the activity group that the activity
  6478. // belongs to. This is optional: if empty, a new tag string will be
  6479. // generated for you. This string must be 1 to 8 characters long, with
  6480. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6481. // also be unique among activity groups of the same floodlight
  6482. // configuration. This field is read-only after insertion.
  6483. TagString string `json:"tagString,omitempty"`
  6484. // Type: Type of the floodlight activity group. This is a required field
  6485. // that is read-only after insertion.
  6486. //
  6487. // Possible values:
  6488. // "COUNTER"
  6489. // "SALE"
  6490. Type string `json:"type,omitempty"`
  6491. // ServerResponse contains the HTTP response code and headers from the
  6492. // server.
  6493. googleapi.ServerResponse `json:"-"`
  6494. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6495. // unconditionally include in API requests. By default, fields with
  6496. // empty values are omitted from API requests. However, any non-pointer,
  6497. // non-interface field appearing in ForceSendFields will be sent to the
  6498. // server regardless of whether the field is empty or not. This may be
  6499. // used to include empty fields in Patch requests.
  6500. ForceSendFields []string `json:"-"`
  6501. // NullFields is a list of field names (e.g. "AccountId") to include in
  6502. // API requests with the JSON null value. By default, fields with empty
  6503. // values are omitted from API requests. However, any field with an
  6504. // empty value appearing in NullFields will be sent to the server as
  6505. // null. It is an error if a field in this list has a non-empty value.
  6506. // This may be used to include null fields in Patch requests.
  6507. NullFields []string `json:"-"`
  6508. }
  6509. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6510. type NoMethod FloodlightActivityGroup
  6511. raw := NoMethod(*s)
  6512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6513. }
  6514. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6515. // Response
  6516. type FloodlightActivityGroupsListResponse struct {
  6517. // FloodlightActivityGroups: Floodlight activity group collection.
  6518. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6519. // Kind: Identifies what kind of resource this is. Value: the fixed
  6520. // string "dfareporting#floodlightActivityGroupsListResponse".
  6521. Kind string `json:"kind,omitempty"`
  6522. // NextPageToken: Pagination token to be used for the next list
  6523. // operation.
  6524. NextPageToken string `json:"nextPageToken,omitempty"`
  6525. // ServerResponse contains the HTTP response code and headers from the
  6526. // server.
  6527. googleapi.ServerResponse `json:"-"`
  6528. // ForceSendFields is a list of field names (e.g.
  6529. // "FloodlightActivityGroups") to unconditionally include in API
  6530. // requests. By default, fields with empty values are omitted from API
  6531. // requests. However, any non-pointer, non-interface field appearing in
  6532. // ForceSendFields will be sent to the server regardless of whether the
  6533. // field is empty or not. This may be used to include empty fields in
  6534. // Patch requests.
  6535. ForceSendFields []string `json:"-"`
  6536. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6537. // to include in API requests with the JSON null value. By default,
  6538. // fields with empty values are omitted from API requests. However, any
  6539. // field with an empty value appearing in NullFields will be sent to the
  6540. // server as null. It is an error if a field in this list has a
  6541. // non-empty value. This may be used to include null fields in Patch
  6542. // requests.
  6543. NullFields []string `json:"-"`
  6544. }
  6545. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6546. type NoMethod FloodlightActivityGroupsListResponse
  6547. raw := NoMethod(*s)
  6548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6549. }
  6550. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6551. type FloodlightActivityPublisherDynamicTag struct {
  6552. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6553. ClickThrough bool `json:"clickThrough,omitempty"`
  6554. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6555. // write-only field that can be used as an alternative to the siteId
  6556. // field. When this resource is retrieved, only the siteId field will be
  6557. // populated.
  6558. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6559. // DynamicTag: Dynamic floodlight tag.
  6560. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6561. // SiteId: Site ID of this dynamic tag.
  6562. SiteId int64 `json:"siteId,omitempty,string"`
  6563. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6564. // a read-only, auto-generated field.
  6565. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6566. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6567. ViewThrough bool `json:"viewThrough,omitempty"`
  6568. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6569. // unconditionally include in API requests. By default, fields with
  6570. // empty values are omitted from API requests. However, any non-pointer,
  6571. // non-interface field appearing in ForceSendFields will be sent to the
  6572. // server regardless of whether the field is empty or not. This may be
  6573. // used to include empty fields in Patch requests.
  6574. ForceSendFields []string `json:"-"`
  6575. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6576. // in API requests with the JSON null value. By default, fields with
  6577. // empty values are omitted from API requests. However, any field with
  6578. // an empty value appearing in NullFields will be sent to the server as
  6579. // null. It is an error if a field in this list has a non-empty value.
  6580. // This may be used to include null fields in Patch requests.
  6581. NullFields []string `json:"-"`
  6582. }
  6583. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6584. type NoMethod FloodlightActivityPublisherDynamicTag
  6585. raw := NoMethod(*s)
  6586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6587. }
  6588. // FloodlightConfiguration: Contains properties of a Floodlight
  6589. // configuration.
  6590. type FloodlightConfiguration struct {
  6591. // AccountId: Account ID of this floodlight configuration. This is a
  6592. // read-only field that can be left blank.
  6593. AccountId int64 `json:"accountId,omitempty,string"`
  6594. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6595. // floodlight configuration.
  6596. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6597. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6598. // advertiser. This is a read-only, auto-generated field.
  6599. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6600. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6601. // Google Analytics.
  6602. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6603. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6604. // report is enabled. This report shows detailed pathway information on
  6605. // up to 10 of the most recent ad exposures seen by a user before
  6606. // converting.
  6607. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6608. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6609. // in reports. This is a required field.
  6610. //
  6611. // Possible values:
  6612. // "MONDAY"
  6613. // "SUNDAY"
  6614. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6615. // Id: ID of this floodlight configuration. This is a read-only,
  6616. // auto-generated field.
  6617. Id int64 `json:"id,omitempty,string"`
  6618. // IdDimensionValue: Dimension value for the ID of this floodlight
  6619. // configuration. This is a read-only, auto-generated field.
  6620. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6621. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6622. // is enabled.
  6623. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6624. // Kind: Identifies what kind of resource this is. Value: the fixed
  6625. // string "dfareporting#floodlightConfiguration".
  6626. Kind string `json:"kind,omitempty"`
  6627. // LookbackConfiguration: Lookback window settings for this floodlight
  6628. // configuration.
  6629. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6630. // NaturalSearchConversionAttributionOption: Types of attribution
  6631. // options for natural search conversions.
  6632. //
  6633. // Possible values:
  6634. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6635. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6636. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6637. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6638. // OmnitureSettings: Settings for Campaign Manager Omniture integration.
  6639. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6640. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6641. // a read-only field that can be left blank.
  6642. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6643. // TagSettings: Configuration settings for dynamic and image floodlight
  6644. // tags.
  6645. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6646. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6647. // tokens enabled for this configuration.
  6648. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6649. // UserDefinedVariableConfigurations: List of user defined variables
  6650. // enabled for this configuration.
  6651. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6652. // ServerResponse contains the HTTP response code and headers from the
  6653. // server.
  6654. googleapi.ServerResponse `json:"-"`
  6655. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6656. // unconditionally include in API requests. By default, fields with
  6657. // empty values are omitted from API requests. However, any non-pointer,
  6658. // non-interface field appearing in ForceSendFields will be sent to the
  6659. // server regardless of whether the field is empty or not. This may be
  6660. // used to include empty fields in Patch requests.
  6661. ForceSendFields []string `json:"-"`
  6662. // NullFields is a list of field names (e.g. "AccountId") to include in
  6663. // API requests with the JSON null value. By default, fields with empty
  6664. // values are omitted from API requests. However, any field with an
  6665. // empty value appearing in NullFields will be sent to the server as
  6666. // null. It is an error if a field in this list has a non-empty value.
  6667. // This may be used to include null fields in Patch requests.
  6668. NullFields []string `json:"-"`
  6669. }
  6670. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6671. type NoMethod FloodlightConfiguration
  6672. raw := NoMethod(*s)
  6673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6674. }
  6675. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6676. // Response
  6677. type FloodlightConfigurationsListResponse struct {
  6678. // FloodlightConfigurations: Floodlight configuration collection.
  6679. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6680. // Kind: Identifies what kind of resource this is. Value: the fixed
  6681. // string "dfareporting#floodlightConfigurationsListResponse".
  6682. Kind string `json:"kind,omitempty"`
  6683. // ServerResponse contains the HTTP response code and headers from the
  6684. // server.
  6685. googleapi.ServerResponse `json:"-"`
  6686. // ForceSendFields is a list of field names (e.g.
  6687. // "FloodlightConfigurations") to unconditionally include in API
  6688. // requests. By default, fields with empty values are omitted from API
  6689. // requests. However, any non-pointer, non-interface field appearing in
  6690. // ForceSendFields will be sent to the server regardless of whether the
  6691. // field is empty or not. This may be used to include empty fields in
  6692. // Patch requests.
  6693. ForceSendFields []string `json:"-"`
  6694. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6695. // to include in API requests with the JSON null value. By default,
  6696. // fields with empty values are omitted from API requests. However, any
  6697. // field with an empty value appearing in NullFields will be sent to the
  6698. // server as null. It is an error if a field in this list has a
  6699. // non-empty value. This may be used to include null fields in Patch
  6700. // requests.
  6701. NullFields []string `json:"-"`
  6702. }
  6703. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6704. type NoMethod FloodlightConfigurationsListResponse
  6705. raw := NoMethod(*s)
  6706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6707. }
  6708. // FloodlightReportCompatibleFields: Represents fields that are
  6709. // compatible to be selected for a report of type "FlOODLIGHT".
  6710. type FloodlightReportCompatibleFields struct {
  6711. // DimensionFilters: Dimensions which are compatible to be selected in
  6712. // the "dimensionFilters" section of the report.
  6713. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6714. // Dimensions: Dimensions which are compatible to be selected in the
  6715. // "dimensions" section of the report.
  6716. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6717. // Kind: The kind of resource this is, in this case
  6718. // dfareporting#floodlightReportCompatibleFields.
  6719. Kind string `json:"kind,omitempty"`
  6720. // Metrics: Metrics which are compatible to be selected in the
  6721. // "metricNames" section of the report.
  6722. Metrics []*Metric `json:"metrics,omitempty"`
  6723. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6724. // unconditionally include in API requests. By default, fields with
  6725. // empty values are omitted from API requests. However, any non-pointer,
  6726. // non-interface field appearing in ForceSendFields will be sent to the
  6727. // server regardless of whether the field is empty or not. This may be
  6728. // used to include empty fields in Patch requests.
  6729. ForceSendFields []string `json:"-"`
  6730. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6731. // include in API requests with the JSON null value. By default, fields
  6732. // with empty values are omitted from API requests. However, any field
  6733. // with an empty value appearing in NullFields will be sent to the
  6734. // server as null. It is an error if a field in this list has a
  6735. // non-empty value. This may be used to include null fields in Patch
  6736. // requests.
  6737. NullFields []string `json:"-"`
  6738. }
  6739. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6740. type NoMethod FloodlightReportCompatibleFields
  6741. raw := NoMethod(*s)
  6742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6743. }
  6744. // FrequencyCap: Frequency Cap.
  6745. type FrequencyCap struct {
  6746. // Duration: Duration of time, in seconds, for this frequency cap. The
  6747. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6748. // inclusive.
  6749. Duration int64 `json:"duration,omitempty,string"`
  6750. // Impressions: Number of times an individual user can be served the ad
  6751. // within the specified duration. Acceptable values are 1 to 15,
  6752. // inclusive.
  6753. Impressions int64 `json:"impressions,omitempty,string"`
  6754. // ForceSendFields is a list of field names (e.g. "Duration") to
  6755. // unconditionally include in API requests. By default, fields with
  6756. // empty values are omitted from API requests. However, any non-pointer,
  6757. // non-interface field appearing in ForceSendFields will be sent to the
  6758. // server regardless of whether the field is empty or not. This may be
  6759. // used to include empty fields in Patch requests.
  6760. ForceSendFields []string `json:"-"`
  6761. // NullFields is a list of field names (e.g. "Duration") to include in
  6762. // API requests with the JSON null value. By default, fields with empty
  6763. // values are omitted from API requests. However, any field with an
  6764. // empty value appearing in NullFields will be sent to the server as
  6765. // null. It is an error if a field in this list has a non-empty value.
  6766. // This may be used to include null fields in Patch requests.
  6767. NullFields []string `json:"-"`
  6768. }
  6769. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6770. type NoMethod FrequencyCap
  6771. raw := NoMethod(*s)
  6772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6773. }
  6774. // FsCommand: FsCommand.
  6775. type FsCommand struct {
  6776. // Left: Distance from the left of the browser.Applicable when
  6777. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6778. Left int64 `json:"left,omitempty"`
  6779. // PositionOption: Position in the browser where the window will open.
  6780. //
  6781. // Possible values:
  6782. // "CENTERED"
  6783. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6784. PositionOption string `json:"positionOption,omitempty"`
  6785. // Top: Distance from the top of the browser. Applicable when
  6786. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6787. Top int64 `json:"top,omitempty"`
  6788. // WindowHeight: Height of the window.
  6789. WindowHeight int64 `json:"windowHeight,omitempty"`
  6790. // WindowWidth: Width of the window.
  6791. WindowWidth int64 `json:"windowWidth,omitempty"`
  6792. // ForceSendFields is a list of field names (e.g. "Left") to
  6793. // unconditionally include in API requests. By default, fields with
  6794. // empty values are omitted from API requests. However, any non-pointer,
  6795. // non-interface field appearing in ForceSendFields will be sent to the
  6796. // server regardless of whether the field is empty or not. This may be
  6797. // used to include empty fields in Patch requests.
  6798. ForceSendFields []string `json:"-"`
  6799. // NullFields is a list of field names (e.g. "Left") to include in API
  6800. // requests with the JSON null value. By default, fields with empty
  6801. // values are omitted from API requests. However, any field with an
  6802. // empty value appearing in NullFields will be sent to the server as
  6803. // null. It is an error if a field in this list has a non-empty value.
  6804. // This may be used to include null fields in Patch requests.
  6805. NullFields []string `json:"-"`
  6806. }
  6807. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6808. type NoMethod FsCommand
  6809. raw := NoMethod(*s)
  6810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6811. }
  6812. // GeoTargeting: Geographical Targeting.
  6813. type GeoTargeting struct {
  6814. // Cities: Cities to be targeted. For each city only dartId is required.
  6815. // The other fields are populated automatically when the ad is inserted
  6816. // or updated. If targeting a city, do not target or exclude the country
  6817. // of the city, and do not target the metro or region of the city.
  6818. Cities []*City `json:"cities,omitempty"`
  6819. // Countries: Countries to be targeted or excluded from targeting,
  6820. // depending on the setting of the excludeCountries field. For each
  6821. // country only dartId is required. The other fields are populated
  6822. // automatically when the ad is inserted or updated. If targeting or
  6823. // excluding a country, do not target regions, cities, metros, or postal
  6824. // codes in the same country.
  6825. Countries []*Country `json:"countries,omitempty"`
  6826. // ExcludeCountries: Whether or not to exclude the countries in the
  6827. // countries field from targeting. If false, the countries field refers
  6828. // to countries which will be targeted by the ad.
  6829. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6830. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6831. // The other fields are populated automatically when the ad is inserted
  6832. // or updated. If targeting a metro, do not target or exclude the
  6833. // country of the metro.
  6834. Metros []*Metro `json:"metros,omitempty"`
  6835. // PostalCodes: Postal codes to be targeted. For each postal code only
  6836. // id is required. The other fields are populated automatically when the
  6837. // ad is inserted or updated. If targeting a postal code, do not target
  6838. // or exclude the country of the postal code.
  6839. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6840. // Regions: Regions to be targeted. For each region only dartId is
  6841. // required. The other fields are populated automatically when the ad is
  6842. // inserted or updated. If targeting a region, do not target or exclude
  6843. // the country of the region.
  6844. Regions []*Region `json:"regions,omitempty"`
  6845. // ForceSendFields is a list of field names (e.g. "Cities") to
  6846. // unconditionally include in API requests. By default, fields with
  6847. // empty values are omitted from API requests. However, any non-pointer,
  6848. // non-interface field appearing in ForceSendFields will be sent to the
  6849. // server regardless of whether the field is empty or not. This may be
  6850. // used to include empty fields in Patch requests.
  6851. ForceSendFields []string `json:"-"`
  6852. // NullFields is a list of field names (e.g. "Cities") to include in API
  6853. // requests with the JSON null value. By default, fields with empty
  6854. // values are omitted from API requests. However, any field with an
  6855. // empty value appearing in NullFields will be sent to the server as
  6856. // null. It is an error if a field in this list has a non-empty value.
  6857. // This may be used to include null fields in Patch requests.
  6858. NullFields []string `json:"-"`
  6859. }
  6860. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6861. type NoMethod GeoTargeting
  6862. raw := NoMethod(*s)
  6863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6864. }
  6865. // InventoryItem: Represents a buy from the Planning inventory store.
  6866. type InventoryItem struct {
  6867. // AccountId: Account ID of this inventory item.
  6868. AccountId int64 `json:"accountId,omitempty,string"`
  6869. // AdSlots: Ad slots of this inventory item. If this inventory item
  6870. // represents a standalone placement, there will be exactly one ad slot.
  6871. // If this inventory item represents a placement group, there will be
  6872. // more than one ad slot, each representing one child placement in that
  6873. // placement group.
  6874. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6875. // AdvertiserId: Advertiser ID of this inventory item.
  6876. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6877. // ContentCategoryId: Content category ID of this inventory item.
  6878. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6879. // EstimatedClickThroughRate: Estimated click-through rate of this
  6880. // inventory item.
  6881. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6882. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6883. // item.
  6884. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6885. // Id: ID of this inventory item.
  6886. Id int64 `json:"id,omitempty,string"`
  6887. // InPlan: Whether this inventory item is in plan.
  6888. InPlan bool `json:"inPlan,omitempty"`
  6889. // Kind: Identifies what kind of resource this is. Value: the fixed
  6890. // string "dfareporting#inventoryItem".
  6891. Kind string `json:"kind,omitempty"`
  6892. // LastModifiedInfo: Information about the most recent modification of
  6893. // this inventory item.
  6894. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6895. // Name: Name of this inventory item. For standalone inventory items,
  6896. // this is the same name as that of its only ad slot. For group
  6897. // inventory items, this can differ from the name of any of its ad
  6898. // slots.
  6899. Name string `json:"name,omitempty"`
  6900. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6901. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6902. // OrderId: Order ID of this inventory item.
  6903. OrderId int64 `json:"orderId,omitempty,string"`
  6904. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6905. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6906. // Pricing: Pricing of this inventory item.
  6907. Pricing *Pricing `json:"pricing,omitempty"`
  6908. // ProjectId: Project ID of this inventory item.
  6909. ProjectId int64 `json:"projectId,omitempty,string"`
  6910. // RfpId: RFP ID of this inventory item.
  6911. RfpId int64 `json:"rfpId,omitempty,string"`
  6912. // SiteId: ID of the site this inventory item is associated with.
  6913. SiteId int64 `json:"siteId,omitempty,string"`
  6914. // SubaccountId: Subaccount ID of this inventory item.
  6915. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6916. // Type: Type of inventory item.
  6917. //
  6918. // Possible values:
  6919. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6920. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6921. Type string `json:"type,omitempty"`
  6922. // ServerResponse contains the HTTP response code and headers from the
  6923. // server.
  6924. googleapi.ServerResponse `json:"-"`
  6925. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6926. // unconditionally include in API requests. By default, fields with
  6927. // empty values are omitted from API requests. However, any non-pointer,
  6928. // non-interface field appearing in ForceSendFields will be sent to the
  6929. // server regardless of whether the field is empty or not. This may be
  6930. // used to include empty fields in Patch requests.
  6931. ForceSendFields []string `json:"-"`
  6932. // NullFields is a list of field names (e.g. "AccountId") to include in
  6933. // API requests with the JSON null value. By default, fields with empty
  6934. // values are omitted from API requests. However, any field with an
  6935. // empty value appearing in NullFields will be sent to the server as
  6936. // null. It is an error if a field in this list has a non-empty value.
  6937. // This may be used to include null fields in Patch requests.
  6938. NullFields []string `json:"-"`
  6939. }
  6940. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6941. type NoMethod InventoryItem
  6942. raw := NoMethod(*s)
  6943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6944. }
  6945. // InventoryItemsListResponse: Inventory item List Response
  6946. type InventoryItemsListResponse struct {
  6947. // InventoryItems: Inventory item collection
  6948. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  6949. // Kind: Identifies what kind of resource this is. Value: the fixed
  6950. // string "dfareporting#inventoryItemsListResponse".
  6951. Kind string `json:"kind,omitempty"`
  6952. // NextPageToken: Pagination token to be used for the next list
  6953. // operation.
  6954. NextPageToken string `json:"nextPageToken,omitempty"`
  6955. // ServerResponse contains the HTTP response code and headers from the
  6956. // server.
  6957. googleapi.ServerResponse `json:"-"`
  6958. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  6959. // unconditionally include in API requests. By default, fields with
  6960. // empty values are omitted from API requests. However, any non-pointer,
  6961. // non-interface field appearing in ForceSendFields will be sent to the
  6962. // server regardless of whether the field is empty or not. This may be
  6963. // used to include empty fields in Patch requests.
  6964. ForceSendFields []string `json:"-"`
  6965. // NullFields is a list of field names (e.g. "InventoryItems") to
  6966. // include in API requests with the JSON null value. By default, fields
  6967. // with empty values are omitted from API requests. However, any field
  6968. // with an empty value appearing in NullFields will be sent to the
  6969. // server as null. It is an error if a field in this list has a
  6970. // non-empty value. This may be used to include null fields in Patch
  6971. // requests.
  6972. NullFields []string `json:"-"`
  6973. }
  6974. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  6975. type NoMethod InventoryItemsListResponse
  6976. raw := NoMethod(*s)
  6977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6978. }
  6979. // KeyValueTargetingExpression: Key Value Targeting Expression.
  6980. type KeyValueTargetingExpression struct {
  6981. // Expression: Keyword expression being targeted by the ad.
  6982. Expression string `json:"expression,omitempty"`
  6983. // ForceSendFields is a list of field names (e.g. "Expression") to
  6984. // unconditionally include in API requests. By default, fields with
  6985. // empty values are omitted from API requests. However, any non-pointer,
  6986. // non-interface field appearing in ForceSendFields will be sent to the
  6987. // server regardless of whether the field is empty or not. This may be
  6988. // used to include empty fields in Patch requests.
  6989. ForceSendFields []string `json:"-"`
  6990. // NullFields is a list of field names (e.g. "Expression") to include in
  6991. // API requests with the JSON null value. By default, fields with empty
  6992. // values are omitted from API requests. However, any field with an
  6993. // empty value appearing in NullFields will be sent to the server as
  6994. // null. It is an error if a field in this list has a non-empty value.
  6995. // This may be used to include null fields in Patch requests.
  6996. NullFields []string `json:"-"`
  6997. }
  6998. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  6999. type NoMethod KeyValueTargetingExpression
  7000. raw := NoMethod(*s)
  7001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7002. }
  7003. // LandingPage: Contains information about where a user's browser is
  7004. // taken after the user clicks an ad.
  7005. type LandingPage struct {
  7006. // AdvertiserId: Advertiser ID of this landing page. This is a required
  7007. // field.
  7008. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7009. // Archived: Whether this landing page has been archived.
  7010. Archived bool `json:"archived,omitempty"`
  7011. // Id: ID of this landing page. This is a read-only, auto-generated
  7012. // field.
  7013. Id int64 `json:"id,omitempty,string"`
  7014. // Kind: Identifies what kind of resource this is. Value: the fixed
  7015. // string "dfareporting#landingPage".
  7016. Kind string `json:"kind,omitempty"`
  7017. // Name: Name of this landing page. This is a required field. It must be
  7018. // less than 256 characters long.
  7019. Name string `json:"name,omitempty"`
  7020. // Url: URL of this landing page. This is a required field.
  7021. Url string `json:"url,omitempty"`
  7022. // ServerResponse contains the HTTP response code and headers from the
  7023. // server.
  7024. googleapi.ServerResponse `json:"-"`
  7025. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7026. // unconditionally include in API requests. By default, fields with
  7027. // empty values are omitted from API requests. However, any non-pointer,
  7028. // non-interface field appearing in ForceSendFields will be sent to the
  7029. // server regardless of whether the field is empty or not. This may be
  7030. // used to include empty fields in Patch requests.
  7031. ForceSendFields []string `json:"-"`
  7032. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7033. // in API requests with the JSON null value. By default, fields with
  7034. // empty values are omitted from API requests. However, any field with
  7035. // an empty value appearing in NullFields will be sent to the server as
  7036. // null. It is an error if a field in this list has a non-empty value.
  7037. // This may be used to include null fields in Patch requests.
  7038. NullFields []string `json:"-"`
  7039. }
  7040. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7041. type NoMethod LandingPage
  7042. raw := NoMethod(*s)
  7043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7044. }
  7045. // Language: Contains information about a language that can be targeted
  7046. // by ads.
  7047. type Language struct {
  7048. // Id: Language ID of this language. This is the ID used for targeting
  7049. // and generating reports.
  7050. Id int64 `json:"id,omitempty,string"`
  7051. // Kind: Identifies what kind of resource this is. Value: the fixed
  7052. // string "dfareporting#language".
  7053. Kind string `json:"kind,omitempty"`
  7054. // LanguageCode: Format of language code is an ISO 639 two-letter
  7055. // language code optionally followed by an underscore followed by an ISO
  7056. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7057. // Chinese.
  7058. LanguageCode string `json:"languageCode,omitempty"`
  7059. // Name: Name of this language.
  7060. Name string `json:"name,omitempty"`
  7061. // ForceSendFields is a list of field names (e.g. "Id") to
  7062. // unconditionally include in API requests. By default, fields with
  7063. // empty values are omitted from API requests. However, any non-pointer,
  7064. // non-interface field appearing in ForceSendFields will be sent to the
  7065. // server regardless of whether the field is empty or not. This may be
  7066. // used to include empty fields in Patch requests.
  7067. ForceSendFields []string `json:"-"`
  7068. // NullFields is a list of field names (e.g. "Id") to include in API
  7069. // requests with the JSON null value. By default, fields with empty
  7070. // values are omitted from API requests. However, any field with an
  7071. // empty value appearing in NullFields will be sent to the server as
  7072. // null. It is an error if a field in this list has a non-empty value.
  7073. // This may be used to include null fields in Patch requests.
  7074. NullFields []string `json:"-"`
  7075. }
  7076. func (s *Language) MarshalJSON() ([]byte, error) {
  7077. type NoMethod Language
  7078. raw := NoMethod(*s)
  7079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7080. }
  7081. // LanguageTargeting: Language Targeting.
  7082. type LanguageTargeting struct {
  7083. // Languages: Languages that this ad targets. For each language only
  7084. // languageId is required. The other fields are populated automatically
  7085. // when the ad is inserted or updated.
  7086. Languages []*Language `json:"languages,omitempty"`
  7087. // ForceSendFields is a list of field names (e.g. "Languages") to
  7088. // unconditionally include in API requests. By default, fields with
  7089. // empty values are omitted from API requests. However, any non-pointer,
  7090. // non-interface field appearing in ForceSendFields will be sent to the
  7091. // server regardless of whether the field is empty or not. This may be
  7092. // used to include empty fields in Patch requests.
  7093. ForceSendFields []string `json:"-"`
  7094. // NullFields is a list of field names (e.g. "Languages") to include in
  7095. // API requests with the JSON null value. By default, fields with empty
  7096. // values are omitted from API requests. However, any field with an
  7097. // empty value appearing in NullFields will be sent to the server as
  7098. // null. It is an error if a field in this list has a non-empty value.
  7099. // This may be used to include null fields in Patch requests.
  7100. NullFields []string `json:"-"`
  7101. }
  7102. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7103. type NoMethod LanguageTargeting
  7104. raw := NoMethod(*s)
  7105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7106. }
  7107. // LanguagesListResponse: Language List Response
  7108. type LanguagesListResponse struct {
  7109. // Kind: Identifies what kind of resource this is. Value: the fixed
  7110. // string "dfareporting#languagesListResponse".
  7111. Kind string `json:"kind,omitempty"`
  7112. // Languages: Language collection.
  7113. Languages []*Language `json:"languages,omitempty"`
  7114. // ServerResponse contains the HTTP response code and headers from the
  7115. // server.
  7116. googleapi.ServerResponse `json:"-"`
  7117. // ForceSendFields is a list of field names (e.g. "Kind") to
  7118. // unconditionally include in API requests. By default, fields with
  7119. // empty values are omitted from API requests. However, any non-pointer,
  7120. // non-interface field appearing in ForceSendFields will be sent to the
  7121. // server regardless of whether the field is empty or not. This may be
  7122. // used to include empty fields in Patch requests.
  7123. ForceSendFields []string `json:"-"`
  7124. // NullFields is a list of field names (e.g. "Kind") to include in API
  7125. // requests with the JSON null value. By default, fields with empty
  7126. // values are omitted from API requests. However, any field with an
  7127. // empty value appearing in NullFields will be sent to the server as
  7128. // null. It is an error if a field in this list has a non-empty value.
  7129. // This may be used to include null fields in Patch requests.
  7130. NullFields []string `json:"-"`
  7131. }
  7132. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7133. type NoMethod LanguagesListResponse
  7134. raw := NoMethod(*s)
  7135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7136. }
  7137. // LastModifiedInfo: Modification timestamp.
  7138. type LastModifiedInfo struct {
  7139. // Time: Timestamp of the last change in milliseconds since epoch.
  7140. Time int64 `json:"time,omitempty,string"`
  7141. // ForceSendFields is a list of field names (e.g. "Time") to
  7142. // unconditionally include in API requests. By default, fields with
  7143. // empty values are omitted from API requests. However, any non-pointer,
  7144. // non-interface field appearing in ForceSendFields will be sent to the
  7145. // server regardless of whether the field is empty or not. This may be
  7146. // used to include empty fields in Patch requests.
  7147. ForceSendFields []string `json:"-"`
  7148. // NullFields is a list of field names (e.g. "Time") to include in API
  7149. // requests with the JSON null value. By default, fields with empty
  7150. // values are omitted from API requests. However, any field with an
  7151. // empty value appearing in NullFields will be sent to the server as
  7152. // null. It is an error if a field in this list has a non-empty value.
  7153. // This may be used to include null fields in Patch requests.
  7154. NullFields []string `json:"-"`
  7155. }
  7156. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7157. type NoMethod LastModifiedInfo
  7158. raw := NoMethod(*s)
  7159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7160. }
  7161. // ListPopulationClause: A group clause made up of list population terms
  7162. // representing constraints joined by ORs.
  7163. type ListPopulationClause struct {
  7164. // Terms: Terms of this list population clause. Each clause is made up
  7165. // of list population terms representing constraints and are joined by
  7166. // ORs.
  7167. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7168. // ForceSendFields is a list of field names (e.g. "Terms") to
  7169. // unconditionally include in API requests. By default, fields with
  7170. // empty values are omitted from API requests. However, any non-pointer,
  7171. // non-interface field appearing in ForceSendFields will be sent to the
  7172. // server regardless of whether the field is empty or not. This may be
  7173. // used to include empty fields in Patch requests.
  7174. ForceSendFields []string `json:"-"`
  7175. // NullFields is a list of field names (e.g. "Terms") to include in API
  7176. // requests with the JSON null value. By default, fields with empty
  7177. // values are omitted from API requests. However, any field with an
  7178. // empty value appearing in NullFields will be sent to the server as
  7179. // null. It is an error if a field in this list has a non-empty value.
  7180. // This may be used to include null fields in Patch requests.
  7181. NullFields []string `json:"-"`
  7182. }
  7183. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7184. type NoMethod ListPopulationClause
  7185. raw := NoMethod(*s)
  7186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7187. }
  7188. // ListPopulationRule: Remarketing List Population Rule.
  7189. type ListPopulationRule struct {
  7190. // FloodlightActivityId: Floodlight activity ID associated with this
  7191. // rule. This field can be left blank.
  7192. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7193. // FloodlightActivityName: Name of floodlight activity associated with
  7194. // this rule. This is a read-only, auto-generated field.
  7195. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7196. // ListPopulationClauses: Clauses that make up this list population
  7197. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7198. // up of list population terms which are joined by ORs.
  7199. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7200. // ForceSendFields is a list of field names (e.g.
  7201. // "FloodlightActivityId") to unconditionally include in API requests.
  7202. // By default, fields with empty values are omitted from API requests.
  7203. // However, any non-pointer, non-interface field appearing in
  7204. // ForceSendFields will be sent to the server regardless of whether the
  7205. // field is empty or not. This may be used to include empty fields in
  7206. // Patch requests.
  7207. ForceSendFields []string `json:"-"`
  7208. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7209. // include in API requests with the JSON null value. By default, fields
  7210. // with empty values are omitted from API requests. However, any field
  7211. // with an empty value appearing in NullFields will be sent to the
  7212. // server as null. It is an error if a field in this list has a
  7213. // non-empty value. This may be used to include null fields in Patch
  7214. // requests.
  7215. NullFields []string `json:"-"`
  7216. }
  7217. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7218. type NoMethod ListPopulationRule
  7219. raw := NoMethod(*s)
  7220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7221. }
  7222. // ListPopulationTerm: Remarketing List Population Rule Term.
  7223. type ListPopulationTerm struct {
  7224. // Contains: Will be true if the term should check if the user is in the
  7225. // list and false if the term should check if the user is not in the
  7226. // list. This field is only relevant when type is set to
  7227. // LIST_MEMBERSHIP_TERM. False by default.
  7228. Contains bool `json:"contains,omitempty"`
  7229. // Negation: Whether to negate the comparison result of this term during
  7230. // rule evaluation. This field is only relevant when type is left unset
  7231. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7232. Negation bool `json:"negation,omitempty"`
  7233. // Operator: Comparison operator of this term. This field is only
  7234. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7235. // REFERRER_TERM.
  7236. //
  7237. // Possible values:
  7238. // "NUM_EQUALS"
  7239. // "NUM_GREATER_THAN"
  7240. // "NUM_GREATER_THAN_EQUAL"
  7241. // "NUM_LESS_THAN"
  7242. // "NUM_LESS_THAN_EQUAL"
  7243. // "STRING_CONTAINS"
  7244. // "STRING_EQUALS"
  7245. Operator string `json:"operator,omitempty"`
  7246. // RemarketingListId: ID of the list in question. This field is only
  7247. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7248. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7249. // Type: List population term type determines the applicable fields in
  7250. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7251. // variableName, variableFriendlyName, operator, value, and negation are
  7252. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7253. // contains are applicable. If set to REFERRER_TERM then operator,
  7254. // value, and negation are applicable.
  7255. //
  7256. // Possible values:
  7257. // "CUSTOM_VARIABLE_TERM"
  7258. // "LIST_MEMBERSHIP_TERM"
  7259. // "REFERRER_TERM"
  7260. Type string `json:"type,omitempty"`
  7261. // Value: Literal to compare the variable to. This field is only
  7262. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7263. // REFERRER_TERM.
  7264. Value string `json:"value,omitempty"`
  7265. // VariableFriendlyName: Friendly name of this term's variable. This is
  7266. // a read-only, auto-generated field. This field is only relevant when
  7267. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7268. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7269. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7270. // this term. This field is only relevant when type is set to null,
  7271. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7272. VariableName string `json:"variableName,omitempty"`
  7273. // ForceSendFields is a list of field names (e.g. "Contains") to
  7274. // unconditionally include in API requests. By default, fields with
  7275. // empty values are omitted from API requests. However, any non-pointer,
  7276. // non-interface field appearing in ForceSendFields will be sent to the
  7277. // server regardless of whether the field is empty or not. This may be
  7278. // used to include empty fields in Patch requests.
  7279. ForceSendFields []string `json:"-"`
  7280. // NullFields is a list of field names (e.g. "Contains") to include in
  7281. // API requests with the JSON null value. By default, fields with empty
  7282. // values are omitted from API requests. However, any field with an
  7283. // empty value appearing in NullFields will be sent to the server as
  7284. // null. It is an error if a field in this list has a non-empty value.
  7285. // This may be used to include null fields in Patch requests.
  7286. NullFields []string `json:"-"`
  7287. }
  7288. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7289. type NoMethod ListPopulationTerm
  7290. raw := NoMethod(*s)
  7291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7292. }
  7293. // ListTargetingExpression: Remarketing List Targeting Expression.
  7294. type ListTargetingExpression struct {
  7295. // Expression: Expression describing which lists are being targeted by
  7296. // the ad.
  7297. Expression string `json:"expression,omitempty"`
  7298. // ForceSendFields is a list of field names (e.g. "Expression") to
  7299. // unconditionally include in API requests. By default, fields with
  7300. // empty values are omitted from API requests. However, any non-pointer,
  7301. // non-interface field appearing in ForceSendFields will be sent to the
  7302. // server regardless of whether the field is empty or not. This may be
  7303. // used to include empty fields in Patch requests.
  7304. ForceSendFields []string `json:"-"`
  7305. // NullFields is a list of field names (e.g. "Expression") to include in
  7306. // API requests with the JSON null value. By default, fields with empty
  7307. // values are omitted from API requests. However, any field with an
  7308. // empty value appearing in NullFields will be sent to the server as
  7309. // null. It is an error if a field in this list has a non-empty value.
  7310. // This may be used to include null fields in Patch requests.
  7311. NullFields []string `json:"-"`
  7312. }
  7313. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7314. type NoMethod ListTargetingExpression
  7315. raw := NoMethod(*s)
  7316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7317. }
  7318. // LookbackConfiguration: Lookback configuration settings.
  7319. type LookbackConfiguration struct {
  7320. // ClickDuration: Lookback window, in days, from the last time a given
  7321. // user clicked on one of your ads. If you enter 0, clicks will not be
  7322. // considered as triggering events for floodlight tracking. If you leave
  7323. // this field blank, the default value for your account will be used.
  7324. // Acceptable values are 0 to 90, inclusive.
  7325. ClickDuration int64 `json:"clickDuration,omitempty"`
  7326. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7327. // last time a given user viewed one of your ads. If you enter 0,
  7328. // impressions will not be considered as triggering events for
  7329. // floodlight tracking. If you leave this field blank, the default value
  7330. // for your account will be used. Acceptable values are 0 to 90,
  7331. // inclusive.
  7332. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7333. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7334. // unconditionally include in API requests. By default, fields with
  7335. // empty values are omitted from API requests. However, any non-pointer,
  7336. // non-interface field appearing in ForceSendFields will be sent to the
  7337. // server regardless of whether the field is empty or not. This may be
  7338. // used to include empty fields in Patch requests.
  7339. ForceSendFields []string `json:"-"`
  7340. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7341. // in API requests with the JSON null value. By default, fields with
  7342. // empty values are omitted from API requests. However, any field with
  7343. // an empty value appearing in NullFields will be sent to the server as
  7344. // null. It is an error if a field in this list has a non-empty value.
  7345. // This may be used to include null fields in Patch requests.
  7346. NullFields []string `json:"-"`
  7347. }
  7348. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7349. type NoMethod LookbackConfiguration
  7350. raw := NoMethod(*s)
  7351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7352. }
  7353. // Metric: Represents a metric.
  7354. type Metric struct {
  7355. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7356. Kind string `json:"kind,omitempty"`
  7357. // Name: The metric name, e.g. dfa:impressions
  7358. Name string `json:"name,omitempty"`
  7359. // ForceSendFields is a list of field names (e.g. "Kind") to
  7360. // unconditionally include in API requests. By default, fields with
  7361. // empty values are omitted from API requests. However, any non-pointer,
  7362. // non-interface field appearing in ForceSendFields will be sent to the
  7363. // server regardless of whether the field is empty or not. This may be
  7364. // used to include empty fields in Patch requests.
  7365. ForceSendFields []string `json:"-"`
  7366. // NullFields is a list of field names (e.g. "Kind") to include in API
  7367. // requests with the JSON null value. By default, fields with empty
  7368. // values are omitted from API requests. However, any field with an
  7369. // empty value appearing in NullFields will be sent to the server as
  7370. // null. It is an error if a field in this list has a non-empty value.
  7371. // This may be used to include null fields in Patch requests.
  7372. NullFields []string `json:"-"`
  7373. }
  7374. func (s *Metric) MarshalJSON() ([]byte, error) {
  7375. type NoMethod Metric
  7376. raw := NoMethod(*s)
  7377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7378. }
  7379. // Metro: Contains information about a metro region that can be targeted
  7380. // by ads.
  7381. type Metro struct {
  7382. // CountryCode: Country code of the country to which this metro region
  7383. // belongs.
  7384. CountryCode string `json:"countryCode,omitempty"`
  7385. // CountryDartId: DART ID of the country to which this metro region
  7386. // belongs.
  7387. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7388. // DartId: DART ID of this metro region.
  7389. DartId int64 `json:"dartId,omitempty,string"`
  7390. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7391. // and generating reports, and is equivalent to metro_code.
  7392. DmaId int64 `json:"dmaId,omitempty,string"`
  7393. // Kind: Identifies what kind of resource this is. Value: the fixed
  7394. // string "dfareporting#metro".
  7395. Kind string `json:"kind,omitempty"`
  7396. // MetroCode: Metro code of this metro region. This is equivalent to
  7397. // dma_id.
  7398. MetroCode string `json:"metroCode,omitempty"`
  7399. // Name: Name of this metro region.
  7400. Name string `json:"name,omitempty"`
  7401. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7402. // unconditionally include in API requests. By default, fields with
  7403. // empty values are omitted from API requests. However, any non-pointer,
  7404. // non-interface field appearing in ForceSendFields will be sent to the
  7405. // server regardless of whether the field is empty or not. This may be
  7406. // used to include empty fields in Patch requests.
  7407. ForceSendFields []string `json:"-"`
  7408. // NullFields is a list of field names (e.g. "CountryCode") to include
  7409. // in API requests with the JSON null value. By default, fields with
  7410. // empty values are omitted from API requests. However, any field with
  7411. // an empty value appearing in NullFields will be sent to the server as
  7412. // null. It is an error if a field in this list has a non-empty value.
  7413. // This may be used to include null fields in Patch requests.
  7414. NullFields []string `json:"-"`
  7415. }
  7416. func (s *Metro) MarshalJSON() ([]byte, error) {
  7417. type NoMethod Metro
  7418. raw := NoMethod(*s)
  7419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7420. }
  7421. // MetrosListResponse: Metro List Response
  7422. type MetrosListResponse struct {
  7423. // Kind: Identifies what kind of resource this is. Value: the fixed
  7424. // string "dfareporting#metrosListResponse".
  7425. Kind string `json:"kind,omitempty"`
  7426. // Metros: Metro collection.
  7427. Metros []*Metro `json:"metros,omitempty"`
  7428. // ServerResponse contains the HTTP response code and headers from the
  7429. // server.
  7430. googleapi.ServerResponse `json:"-"`
  7431. // ForceSendFields is a list of field names (e.g. "Kind") to
  7432. // unconditionally include in API requests. By default, fields with
  7433. // empty values are omitted from API requests. However, any non-pointer,
  7434. // non-interface field appearing in ForceSendFields will be sent to the
  7435. // server regardless of whether the field is empty or not. This may be
  7436. // used to include empty fields in Patch requests.
  7437. ForceSendFields []string `json:"-"`
  7438. // NullFields is a list of field names (e.g. "Kind") to include in API
  7439. // requests with the JSON null value. By default, fields with empty
  7440. // values are omitted from API requests. However, any field with an
  7441. // empty value appearing in NullFields will be sent to the server as
  7442. // null. It is an error if a field in this list has a non-empty value.
  7443. // This may be used to include null fields in Patch requests.
  7444. NullFields []string `json:"-"`
  7445. }
  7446. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7447. type NoMethod MetrosListResponse
  7448. raw := NoMethod(*s)
  7449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7450. }
  7451. // MobileCarrier: Contains information about a mobile carrier that can
  7452. // be targeted by ads.
  7453. type MobileCarrier struct {
  7454. // CountryCode: Country code of the country to which this mobile carrier
  7455. // belongs.
  7456. CountryCode string `json:"countryCode,omitempty"`
  7457. // CountryDartId: DART ID of the country to which this mobile carrier
  7458. // belongs.
  7459. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7460. // Id: ID of this mobile carrier.
  7461. Id int64 `json:"id,omitempty,string"`
  7462. // Kind: Identifies what kind of resource this is. Value: the fixed
  7463. // string "dfareporting#mobileCarrier".
  7464. Kind string `json:"kind,omitempty"`
  7465. // Name: Name of this mobile carrier.
  7466. Name string `json:"name,omitempty"`
  7467. // ServerResponse contains the HTTP response code and headers from the
  7468. // server.
  7469. googleapi.ServerResponse `json:"-"`
  7470. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7471. // unconditionally include in API requests. By default, fields with
  7472. // empty values are omitted from API requests. However, any non-pointer,
  7473. // non-interface field appearing in ForceSendFields will be sent to the
  7474. // server regardless of whether the field is empty or not. This may be
  7475. // used to include empty fields in Patch requests.
  7476. ForceSendFields []string `json:"-"`
  7477. // NullFields is a list of field names (e.g. "CountryCode") to include
  7478. // in API requests with the JSON null value. By default, fields with
  7479. // empty values are omitted from API requests. However, any field with
  7480. // an empty value appearing in NullFields will be sent to the server as
  7481. // null. It is an error if a field in this list has a non-empty value.
  7482. // This may be used to include null fields in Patch requests.
  7483. NullFields []string `json:"-"`
  7484. }
  7485. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7486. type NoMethod MobileCarrier
  7487. raw := NoMethod(*s)
  7488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7489. }
  7490. // MobileCarriersListResponse: Mobile Carrier List Response
  7491. type MobileCarriersListResponse struct {
  7492. // Kind: Identifies what kind of resource this is. Value: the fixed
  7493. // string "dfareporting#mobileCarriersListResponse".
  7494. Kind string `json:"kind,omitempty"`
  7495. // MobileCarriers: Mobile carrier collection.
  7496. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7497. // ServerResponse contains the HTTP response code and headers from the
  7498. // server.
  7499. googleapi.ServerResponse `json:"-"`
  7500. // ForceSendFields is a list of field names (e.g. "Kind") to
  7501. // unconditionally include in API requests. By default, fields with
  7502. // empty values are omitted from API requests. However, any non-pointer,
  7503. // non-interface field appearing in ForceSendFields will be sent to the
  7504. // server regardless of whether the field is empty or not. This may be
  7505. // used to include empty fields in Patch requests.
  7506. ForceSendFields []string `json:"-"`
  7507. // NullFields is a list of field names (e.g. "Kind") to include in API
  7508. // requests with the JSON null value. By default, fields with empty
  7509. // values are omitted from API requests. However, any field with an
  7510. // empty value appearing in NullFields will be sent to the server as
  7511. // null. It is an error if a field in this list has a non-empty value.
  7512. // This may be used to include null fields in Patch requests.
  7513. NullFields []string `json:"-"`
  7514. }
  7515. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7516. type NoMethod MobileCarriersListResponse
  7517. raw := NoMethod(*s)
  7518. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7519. }
  7520. // ObjectFilter: Object Filter.
  7521. type ObjectFilter struct {
  7522. // Kind: Identifies what kind of resource this is. Value: the fixed
  7523. // string "dfareporting#objectFilter".
  7524. Kind string `json:"kind,omitempty"`
  7525. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7526. // objects with these object IDs.
  7527. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7528. // Status: Status of the filter. NONE means the user has access to none
  7529. // of the objects. ALL means the user has access to all objects.
  7530. // ASSIGNED means the user has access to the objects with IDs in the
  7531. // objectIds list.
  7532. //
  7533. // Possible values:
  7534. // "ALL"
  7535. // "ASSIGNED"
  7536. // "NONE"
  7537. Status string `json:"status,omitempty"`
  7538. // ForceSendFields is a list of field names (e.g. "Kind") to
  7539. // unconditionally include in API requests. By default, fields with
  7540. // empty values are omitted from API requests. However, any non-pointer,
  7541. // non-interface field appearing in ForceSendFields will be sent to the
  7542. // server regardless of whether the field is empty or not. This may be
  7543. // used to include empty fields in Patch requests.
  7544. ForceSendFields []string `json:"-"`
  7545. // NullFields is a list of field names (e.g. "Kind") to include in API
  7546. // requests with the JSON null value. By default, fields with empty
  7547. // values are omitted from API requests. However, any field with an
  7548. // empty value appearing in NullFields will be sent to the server as
  7549. // null. It is an error if a field in this list has a non-empty value.
  7550. // This may be used to include null fields in Patch requests.
  7551. NullFields []string `json:"-"`
  7552. }
  7553. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7554. type NoMethod ObjectFilter
  7555. raw := NoMethod(*s)
  7556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7557. }
  7558. // OffsetPosition: Offset Position.
  7559. type OffsetPosition struct {
  7560. // Left: Offset distance from left side of an asset or a window.
  7561. Left int64 `json:"left,omitempty"`
  7562. // Top: Offset distance from top side of an asset or a window.
  7563. Top int64 `json:"top,omitempty"`
  7564. // ForceSendFields is a list of field names (e.g. "Left") to
  7565. // unconditionally include in API requests. By default, fields with
  7566. // empty values are omitted from API requests. However, any non-pointer,
  7567. // non-interface field appearing in ForceSendFields will be sent to the
  7568. // server regardless of whether the field is empty or not. This may be
  7569. // used to include empty fields in Patch requests.
  7570. ForceSendFields []string `json:"-"`
  7571. // NullFields is a list of field names (e.g. "Left") to include in API
  7572. // requests with the JSON null value. By default, fields with empty
  7573. // values are omitted from API requests. However, any field with an
  7574. // empty value appearing in NullFields will be sent to the server as
  7575. // null. It is an error if a field in this list has a non-empty value.
  7576. // This may be used to include null fields in Patch requests.
  7577. NullFields []string `json:"-"`
  7578. }
  7579. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7580. type NoMethod OffsetPosition
  7581. raw := NoMethod(*s)
  7582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7583. }
  7584. // OmnitureSettings: Omniture Integration Settings.
  7585. type OmnitureSettings struct {
  7586. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7587. // Omniture. This property can be enabled only if
  7588. // omnitureIntegrationEnabled is true.
  7589. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7590. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7591. // This property can be enabled only when the "Advanced Ad Serving"
  7592. // account setting is enabled.
  7593. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7594. // ForceSendFields is a list of field names (e.g.
  7595. // "OmnitureCostDataEnabled") to unconditionally include in API
  7596. // requests. By default, fields with empty values are omitted from API
  7597. // requests. However, any non-pointer, non-interface field appearing in
  7598. // ForceSendFields will be sent to the server regardless of whether the
  7599. // field is empty or not. This may be used to include empty fields in
  7600. // Patch requests.
  7601. ForceSendFields []string `json:"-"`
  7602. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7603. // to include in API requests with the JSON null value. By default,
  7604. // fields with empty values are omitted from API requests. However, any
  7605. // field with an empty value appearing in NullFields will be sent to the
  7606. // server as null. It is an error if a field in this list has a
  7607. // non-empty value. This may be used to include null fields in Patch
  7608. // requests.
  7609. NullFields []string `json:"-"`
  7610. }
  7611. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7612. type NoMethod OmnitureSettings
  7613. raw := NoMethod(*s)
  7614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7615. }
  7616. // OperatingSystem: Contains information about an operating system that
  7617. // can be targeted by ads.
  7618. type OperatingSystem struct {
  7619. // DartId: DART ID of this operating system. This is the ID used for
  7620. // targeting.
  7621. DartId int64 `json:"dartId,omitempty,string"`
  7622. // Desktop: Whether this operating system is for desktop.
  7623. Desktop bool `json:"desktop,omitempty"`
  7624. // Kind: Identifies what kind of resource this is. Value: the fixed
  7625. // string "dfareporting#operatingSystem".
  7626. Kind string `json:"kind,omitempty"`
  7627. // Mobile: Whether this operating system is for mobile.
  7628. Mobile bool `json:"mobile,omitempty"`
  7629. // Name: Name of this operating system.
  7630. Name string `json:"name,omitempty"`
  7631. // ServerResponse contains the HTTP response code and headers from the
  7632. // server.
  7633. googleapi.ServerResponse `json:"-"`
  7634. // ForceSendFields is a list of field names (e.g. "DartId") to
  7635. // unconditionally include in API requests. By default, fields with
  7636. // empty values are omitted from API requests. However, any non-pointer,
  7637. // non-interface field appearing in ForceSendFields will be sent to the
  7638. // server regardless of whether the field is empty or not. This may be
  7639. // used to include empty fields in Patch requests.
  7640. ForceSendFields []string `json:"-"`
  7641. // NullFields is a list of field names (e.g. "DartId") to include in API
  7642. // requests with the JSON null value. By default, fields with empty
  7643. // values are omitted from API requests. However, any field with an
  7644. // empty value appearing in NullFields will be sent to the server as
  7645. // null. It is an error if a field in this list has a non-empty value.
  7646. // This may be used to include null fields in Patch requests.
  7647. NullFields []string `json:"-"`
  7648. }
  7649. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7650. type NoMethod OperatingSystem
  7651. raw := NoMethod(*s)
  7652. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7653. }
  7654. // OperatingSystemVersion: Contains information about a particular
  7655. // version of an operating system that can be targeted by ads.
  7656. type OperatingSystemVersion struct {
  7657. // Id: ID of this operating system version.
  7658. Id int64 `json:"id,omitempty,string"`
  7659. // Kind: Identifies what kind of resource this is. Value: the fixed
  7660. // string "dfareporting#operatingSystemVersion".
  7661. Kind string `json:"kind,omitempty"`
  7662. // MajorVersion: Major version (leftmost number) of this operating
  7663. // system version.
  7664. MajorVersion string `json:"majorVersion,omitempty"`
  7665. // MinorVersion: Minor version (number after the first dot) of this
  7666. // operating system version.
  7667. MinorVersion string `json:"minorVersion,omitempty"`
  7668. // Name: Name of this operating system version.
  7669. Name string `json:"name,omitempty"`
  7670. // OperatingSystem: Operating system of this operating system version.
  7671. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7672. // ServerResponse contains the HTTP response code and headers from the
  7673. // server.
  7674. googleapi.ServerResponse `json:"-"`
  7675. // ForceSendFields is a list of field names (e.g. "Id") to
  7676. // unconditionally include in API requests. By default, fields with
  7677. // empty values are omitted from API requests. However, any non-pointer,
  7678. // non-interface field appearing in ForceSendFields will be sent to the
  7679. // server regardless of whether the field is empty or not. This may be
  7680. // used to include empty fields in Patch requests.
  7681. ForceSendFields []string `json:"-"`
  7682. // NullFields is a list of field names (e.g. "Id") to include in API
  7683. // requests with the JSON null value. By default, fields with empty
  7684. // values are omitted from API requests. However, any field with an
  7685. // empty value appearing in NullFields will be sent to the server as
  7686. // null. It is an error if a field in this list has a non-empty value.
  7687. // This may be used to include null fields in Patch requests.
  7688. NullFields []string `json:"-"`
  7689. }
  7690. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7691. type NoMethod OperatingSystemVersion
  7692. raw := NoMethod(*s)
  7693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7694. }
  7695. // OperatingSystemVersionsListResponse: Operating System Version List
  7696. // Response
  7697. type OperatingSystemVersionsListResponse struct {
  7698. // Kind: Identifies what kind of resource this is. Value: the fixed
  7699. // string "dfareporting#operatingSystemVersionsListResponse".
  7700. Kind string `json:"kind,omitempty"`
  7701. // OperatingSystemVersions: Operating system version collection.
  7702. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7703. // ServerResponse contains the HTTP response code and headers from the
  7704. // server.
  7705. googleapi.ServerResponse `json:"-"`
  7706. // ForceSendFields is a list of field names (e.g. "Kind") to
  7707. // unconditionally include in API requests. By default, fields with
  7708. // empty values are omitted from API requests. However, any non-pointer,
  7709. // non-interface field appearing in ForceSendFields will be sent to the
  7710. // server regardless of whether the field is empty or not. This may be
  7711. // used to include empty fields in Patch requests.
  7712. ForceSendFields []string `json:"-"`
  7713. // NullFields is a list of field names (e.g. "Kind") to include in API
  7714. // requests with the JSON null value. By default, fields with empty
  7715. // values are omitted from API requests. However, any field with an
  7716. // empty value appearing in NullFields will be sent to the server as
  7717. // null. It is an error if a field in this list has a non-empty value.
  7718. // This may be used to include null fields in Patch requests.
  7719. NullFields []string `json:"-"`
  7720. }
  7721. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7722. type NoMethod OperatingSystemVersionsListResponse
  7723. raw := NoMethod(*s)
  7724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7725. }
  7726. // OperatingSystemsListResponse: Operating System List Response
  7727. type OperatingSystemsListResponse struct {
  7728. // Kind: Identifies what kind of resource this is. Value: the fixed
  7729. // string "dfareporting#operatingSystemsListResponse".
  7730. Kind string `json:"kind,omitempty"`
  7731. // OperatingSystems: Operating system collection.
  7732. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7733. // ServerResponse contains the HTTP response code and headers from the
  7734. // server.
  7735. googleapi.ServerResponse `json:"-"`
  7736. // ForceSendFields is a list of field names (e.g. "Kind") to
  7737. // unconditionally include in API requests. By default, fields with
  7738. // empty values are omitted from API requests. However, any non-pointer,
  7739. // non-interface field appearing in ForceSendFields will be sent to the
  7740. // server regardless of whether the field is empty or not. This may be
  7741. // used to include empty fields in Patch requests.
  7742. ForceSendFields []string `json:"-"`
  7743. // NullFields is a list of field names (e.g. "Kind") to include in API
  7744. // requests with the JSON null value. By default, fields with empty
  7745. // values are omitted from API requests. However, any field with an
  7746. // empty value appearing in NullFields will be sent to the server as
  7747. // null. It is an error if a field in this list has a non-empty value.
  7748. // This may be used to include null fields in Patch requests.
  7749. NullFields []string `json:"-"`
  7750. }
  7751. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7752. type NoMethod OperatingSystemsListResponse
  7753. raw := NoMethod(*s)
  7754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7755. }
  7756. // OptimizationActivity: Creative optimization activity.
  7757. type OptimizationActivity struct {
  7758. // FloodlightActivityId: Floodlight activity ID of this optimization
  7759. // activity. This is a required field.
  7760. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7761. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7762. // floodlight activity. This is a read-only, auto-generated field.
  7763. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7764. // Weight: Weight associated with this optimization. The weight assigned
  7765. // will be understood in proportion to the weights assigned to the other
  7766. // optimization activities. Value must be greater than or equal to 1.
  7767. Weight int64 `json:"weight,omitempty"`
  7768. // ForceSendFields is a list of field names (e.g.
  7769. // "FloodlightActivityId") to unconditionally include in API requests.
  7770. // By default, fields with empty values are omitted from API requests.
  7771. // However, any non-pointer, non-interface field appearing in
  7772. // ForceSendFields will be sent to the server regardless of whether the
  7773. // field is empty or not. This may be used to include empty fields in
  7774. // Patch requests.
  7775. ForceSendFields []string `json:"-"`
  7776. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7777. // include in API requests with the JSON null value. By default, fields
  7778. // with empty values are omitted from API requests. However, any field
  7779. // with an empty value appearing in NullFields will be sent to the
  7780. // server as null. It is an error if a field in this list has a
  7781. // non-empty value. This may be used to include null fields in Patch
  7782. // requests.
  7783. NullFields []string `json:"-"`
  7784. }
  7785. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7786. type NoMethod OptimizationActivity
  7787. raw := NoMethod(*s)
  7788. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7789. }
  7790. // Order: Describes properties of a Planning order.
  7791. type Order struct {
  7792. // AccountId: Account ID of this order.
  7793. AccountId int64 `json:"accountId,omitempty,string"`
  7794. // AdvertiserId: Advertiser ID of this order.
  7795. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7796. // ApproverUserProfileIds: IDs for users that have to approve documents
  7797. // created for this order.
  7798. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7799. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7800. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7801. // BuyerOrganizationName: Name of the buyer organization.
  7802. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7803. // Comments: Comments in this order.
  7804. Comments string `json:"comments,omitempty"`
  7805. // Contacts: Contacts for this order.
  7806. Contacts []*OrderContact `json:"contacts,omitempty"`
  7807. // Id: ID of this order. This is a read-only, auto-generated field.
  7808. Id int64 `json:"id,omitempty,string"`
  7809. // Kind: Identifies what kind of resource this is. Value: the fixed
  7810. // string "dfareporting#order".
  7811. Kind string `json:"kind,omitempty"`
  7812. // LastModifiedInfo: Information about the most recent modification of
  7813. // this order.
  7814. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7815. // Name: Name of this order.
  7816. Name string `json:"name,omitempty"`
  7817. // Notes: Notes of this order.
  7818. Notes string `json:"notes,omitempty"`
  7819. // PlanningTermId: ID of the terms and conditions template used in this
  7820. // order.
  7821. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7822. // ProjectId: Project ID of this order.
  7823. ProjectId int64 `json:"projectId,omitempty,string"`
  7824. // SellerOrderId: Seller order ID associated with this order.
  7825. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7826. // SellerOrganizationName: Name of the seller organization.
  7827. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7828. // SiteId: Site IDs this order is associated with.
  7829. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7830. // SiteNames: Free-form site names this order is associated with.
  7831. SiteNames []string `json:"siteNames,omitempty"`
  7832. // SubaccountId: Subaccount ID of this order.
  7833. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7834. // TermsAndConditions: Terms and conditions of this order.
  7835. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7836. // ServerResponse contains the HTTP response code and headers from the
  7837. // server.
  7838. googleapi.ServerResponse `json:"-"`
  7839. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7840. // unconditionally include in API requests. By default, fields with
  7841. // empty values are omitted from API requests. However, any non-pointer,
  7842. // non-interface field appearing in ForceSendFields will be sent to the
  7843. // server regardless of whether the field is empty or not. This may be
  7844. // used to include empty fields in Patch requests.
  7845. ForceSendFields []string `json:"-"`
  7846. // NullFields is a list of field names (e.g. "AccountId") to include in
  7847. // API requests with the JSON null value. By default, fields with empty
  7848. // values are omitted from API requests. However, any field with an
  7849. // empty value appearing in NullFields will be sent to the server as
  7850. // null. It is an error if a field in this list has a non-empty value.
  7851. // This may be used to include null fields in Patch requests.
  7852. NullFields []string `json:"-"`
  7853. }
  7854. func (s *Order) MarshalJSON() ([]byte, error) {
  7855. type NoMethod Order
  7856. raw := NoMethod(*s)
  7857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7858. }
  7859. // OrderContact: Contact of an order.
  7860. type OrderContact struct {
  7861. // ContactInfo: Free-form information about this contact. It could be
  7862. // any information related to this contact in addition to type, title,
  7863. // name, and signature user profile ID.
  7864. ContactInfo string `json:"contactInfo,omitempty"`
  7865. // ContactName: Name of this contact.
  7866. ContactName string `json:"contactName,omitempty"`
  7867. // ContactTitle: Title of this contact.
  7868. ContactTitle string `json:"contactTitle,omitempty"`
  7869. // ContactType: Type of this contact.
  7870. //
  7871. // Possible values:
  7872. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  7873. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  7874. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  7875. ContactType string `json:"contactType,omitempty"`
  7876. // SignatureUserProfileId: ID of the user profile containing the
  7877. // signature that will be embedded into order documents.
  7878. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  7879. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  7880. // unconditionally include in API requests. By default, fields with
  7881. // empty values are omitted from API requests. However, any non-pointer,
  7882. // non-interface field appearing in ForceSendFields will be sent to the
  7883. // server regardless of whether the field is empty or not. This may be
  7884. // used to include empty fields in Patch requests.
  7885. ForceSendFields []string `json:"-"`
  7886. // NullFields is a list of field names (e.g. "ContactInfo") to include
  7887. // in API requests with the JSON null value. By default, fields with
  7888. // empty values are omitted from API requests. However, any field with
  7889. // an empty value appearing in NullFields will be sent to the server as
  7890. // null. It is an error if a field in this list has a non-empty value.
  7891. // This may be used to include null fields in Patch requests.
  7892. NullFields []string `json:"-"`
  7893. }
  7894. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  7895. type NoMethod OrderContact
  7896. raw := NoMethod(*s)
  7897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7898. }
  7899. // OrderDocument: Contains properties of a Planning order document.
  7900. type OrderDocument struct {
  7901. // AccountId: Account ID of this order document.
  7902. AccountId int64 `json:"accountId,omitempty,string"`
  7903. // AdvertiserId: Advertiser ID of this order document.
  7904. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7905. // AmendedOrderDocumentId: The amended order document ID of this order
  7906. // document. An order document can be created by optionally amending
  7907. // another order document so that the change history can be preserved.
  7908. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  7909. // ApprovedByUserProfileIds: IDs of users who have approved this order
  7910. // document.
  7911. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  7912. // Cancelled: Whether this order document is cancelled.
  7913. Cancelled bool `json:"cancelled,omitempty"`
  7914. // CreatedInfo: Information about the creation of this order document.
  7915. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  7916. // EffectiveDate: Effective date of this order document.
  7917. EffectiveDate string `json:"effectiveDate,omitempty"`
  7918. // Id: ID of this order document.
  7919. Id int64 `json:"id,omitempty,string"`
  7920. // Kind: Identifies what kind of resource this is. Value: the fixed
  7921. // string "dfareporting#orderDocument".
  7922. Kind string `json:"kind,omitempty"`
  7923. // LastSentRecipients: List of email addresses that received the last
  7924. // sent document.
  7925. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  7926. // LastSentTime: Timestamp of the last email sent with this order
  7927. // document.
  7928. LastSentTime string `json:"lastSentTime,omitempty"`
  7929. // OrderId: ID of the order from which this order document is created.
  7930. OrderId int64 `json:"orderId,omitempty,string"`
  7931. // ProjectId: Project ID of this order document.
  7932. ProjectId int64 `json:"projectId,omitempty,string"`
  7933. // Signed: Whether this order document has been signed.
  7934. Signed bool `json:"signed,omitempty"`
  7935. // SubaccountId: Subaccount ID of this order document.
  7936. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7937. // Title: Title of this order document.
  7938. Title string `json:"title,omitempty"`
  7939. // Type: Type of this order document
  7940. //
  7941. // Possible values:
  7942. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  7943. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  7944. Type string `json:"type,omitempty"`
  7945. // ServerResponse contains the HTTP response code and headers from the
  7946. // server.
  7947. googleapi.ServerResponse `json:"-"`
  7948. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7949. // unconditionally include in API requests. By default, fields with
  7950. // empty values are omitted from API requests. However, any non-pointer,
  7951. // non-interface field appearing in ForceSendFields will be sent to the
  7952. // server regardless of whether the field is empty or not. This may be
  7953. // used to include empty fields in Patch requests.
  7954. ForceSendFields []string `json:"-"`
  7955. // NullFields is a list of field names (e.g. "AccountId") to include in
  7956. // API requests with the JSON null value. By default, fields with empty
  7957. // values are omitted from API requests. However, any field with an
  7958. // empty value appearing in NullFields will be sent to the server as
  7959. // null. It is an error if a field in this list has a non-empty value.
  7960. // This may be used to include null fields in Patch requests.
  7961. NullFields []string `json:"-"`
  7962. }
  7963. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  7964. type NoMethod OrderDocument
  7965. raw := NoMethod(*s)
  7966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7967. }
  7968. // OrderDocumentsListResponse: Order document List Response
  7969. type OrderDocumentsListResponse struct {
  7970. // Kind: Identifies what kind of resource this is. Value: the fixed
  7971. // string "dfareporting#orderDocumentsListResponse".
  7972. Kind string `json:"kind,omitempty"`
  7973. // NextPageToken: Pagination token to be used for the next list
  7974. // operation.
  7975. NextPageToken string `json:"nextPageToken,omitempty"`
  7976. // OrderDocuments: Order document collection
  7977. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  7978. // ServerResponse contains the HTTP response code and headers from the
  7979. // server.
  7980. googleapi.ServerResponse `json:"-"`
  7981. // ForceSendFields is a list of field names (e.g. "Kind") to
  7982. // unconditionally include in API requests. By default, fields with
  7983. // empty values are omitted from API requests. However, any non-pointer,
  7984. // non-interface field appearing in ForceSendFields will be sent to the
  7985. // server regardless of whether the field is empty or not. This may be
  7986. // used to include empty fields in Patch requests.
  7987. ForceSendFields []string `json:"-"`
  7988. // NullFields is a list of field names (e.g. "Kind") to include in API
  7989. // requests with the JSON null value. By default, fields with empty
  7990. // values are omitted from API requests. However, any field with an
  7991. // empty value appearing in NullFields will be sent to the server as
  7992. // null. It is an error if a field in this list has a non-empty value.
  7993. // This may be used to include null fields in Patch requests.
  7994. NullFields []string `json:"-"`
  7995. }
  7996. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  7997. type NoMethod OrderDocumentsListResponse
  7998. raw := NoMethod(*s)
  7999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8000. }
  8001. // OrdersListResponse: Order List Response
  8002. type OrdersListResponse struct {
  8003. // Kind: Identifies what kind of resource this is. Value: the fixed
  8004. // string "dfareporting#ordersListResponse".
  8005. Kind string `json:"kind,omitempty"`
  8006. // NextPageToken: Pagination token to be used for the next list
  8007. // operation.
  8008. NextPageToken string `json:"nextPageToken,omitempty"`
  8009. // Orders: Order collection.
  8010. Orders []*Order `json:"orders,omitempty"`
  8011. // ServerResponse contains the HTTP response code and headers from the
  8012. // server.
  8013. googleapi.ServerResponse `json:"-"`
  8014. // ForceSendFields is a list of field names (e.g. "Kind") to
  8015. // unconditionally include in API requests. By default, fields with
  8016. // empty values are omitted from API requests. However, any non-pointer,
  8017. // non-interface field appearing in ForceSendFields will be sent to the
  8018. // server regardless of whether the field is empty or not. This may be
  8019. // used to include empty fields in Patch requests.
  8020. ForceSendFields []string `json:"-"`
  8021. // NullFields is a list of field names (e.g. "Kind") to include in API
  8022. // requests with the JSON null value. By default, fields with empty
  8023. // values are omitted from API requests. However, any field with an
  8024. // empty value appearing in NullFields will be sent to the server as
  8025. // null. It is an error if a field in this list has a non-empty value.
  8026. // This may be used to include null fields in Patch requests.
  8027. NullFields []string `json:"-"`
  8028. }
  8029. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8030. type NoMethod OrdersListResponse
  8031. raw := NoMethod(*s)
  8032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8033. }
  8034. // PathToConversionReportCompatibleFields: Represents fields that are
  8035. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8036. type PathToConversionReportCompatibleFields struct {
  8037. // ConversionDimensions: Conversion dimensions which are compatible to
  8038. // be selected in the "conversionDimensions" section of the report.
  8039. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8040. // CustomFloodlightVariables: Custom floodlight variables which are
  8041. // compatible to be selected in the "customFloodlightVariables" section
  8042. // of the report.
  8043. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8044. // Kind: The kind of resource this is, in this case
  8045. // dfareporting#pathToConversionReportCompatibleFields.
  8046. Kind string `json:"kind,omitempty"`
  8047. // Metrics: Metrics which are compatible to be selected in the
  8048. // "metricNames" section of the report.
  8049. Metrics []*Metric `json:"metrics,omitempty"`
  8050. // PerInteractionDimensions: Per-interaction dimensions which are
  8051. // compatible to be selected in the "perInteractionDimensions" section
  8052. // of the report.
  8053. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8054. // ForceSendFields is a list of field names (e.g.
  8055. // "ConversionDimensions") to unconditionally include in API requests.
  8056. // By default, fields with empty values are omitted from API requests.
  8057. // However, any non-pointer, non-interface field appearing in
  8058. // ForceSendFields will be sent to the server regardless of whether the
  8059. // field is empty or not. This may be used to include empty fields in
  8060. // Patch requests.
  8061. ForceSendFields []string `json:"-"`
  8062. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8063. // include in API requests with the JSON null value. By default, fields
  8064. // with empty values are omitted from API requests. However, any field
  8065. // with an empty value appearing in NullFields will be sent to the
  8066. // server as null. It is an error if a field in this list has a
  8067. // non-empty value. This may be used to include null fields in Patch
  8068. // requests.
  8069. NullFields []string `json:"-"`
  8070. }
  8071. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8072. type NoMethod PathToConversionReportCompatibleFields
  8073. raw := NoMethod(*s)
  8074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8075. }
  8076. // Placement: Contains properties of a placement.
  8077. type Placement struct {
  8078. // AccountId: Account ID of this placement. This field can be left
  8079. // blank.
  8080. AccountId int64 `json:"accountId,omitempty,string"`
  8081. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8082. // When true, ad blocking is disabled for this placement. When false,
  8083. // the campaign and site settings take effect.
  8084. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8085. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8086. // blank.
  8087. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8088. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8089. // advertiser. This is a read-only, auto-generated field.
  8090. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8091. // Archived: Whether this placement is archived.
  8092. Archived bool `json:"archived,omitempty"`
  8093. // CampaignId: Campaign ID of this placement. This field is a required
  8094. // field on insertion.
  8095. CampaignId int64 `json:"campaignId,omitempty,string"`
  8096. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8097. // This is a read-only, auto-generated field.
  8098. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8099. // Comment: Comments for this placement.
  8100. Comment string `json:"comment,omitempty"`
  8101. // Compatibility: Placement compatibility. DISPLAY and
  8102. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8103. // or in mobile apps for regular or interstitial ads respectively. APP
  8104. // and APP_INTERSTITIAL are no longer allowed for new placement
  8105. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8106. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8107. // with the VAST standard. This field is required on insertion.
  8108. //
  8109. // Possible values:
  8110. // "APP"
  8111. // "APP_INTERSTITIAL"
  8112. // "DISPLAY"
  8113. // "DISPLAY_INTERSTITIAL"
  8114. // "IN_STREAM_AUDIO"
  8115. // "IN_STREAM_VIDEO"
  8116. Compatibility string `json:"compatibility,omitempty"`
  8117. // ContentCategoryId: ID of the content category assigned to this
  8118. // placement.
  8119. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8120. // CreateInfo: Information about the creation of this placement. This is
  8121. // a read-only field.
  8122. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8123. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8124. // must set either this field or the siteId field to specify the site
  8125. // associated with this placement. This is a required field that is
  8126. // read-only after insertion.
  8127. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8128. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8129. // directory site. This is a read-only, auto-generated field.
  8130. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8131. // ExternalId: External ID for this placement.
  8132. ExternalId string `json:"externalId,omitempty"`
  8133. // Id: ID of this placement. This is a read-only, auto-generated field.
  8134. Id int64 `json:"id,omitempty,string"`
  8135. // IdDimensionValue: Dimension value for the ID of this placement. This
  8136. // is a read-only, auto-generated field.
  8137. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8138. // KeyName: Key name of this placement. This is a read-only,
  8139. // auto-generated field.
  8140. KeyName string `json:"keyName,omitempty"`
  8141. // Kind: Identifies what kind of resource this is. Value: the fixed
  8142. // string "dfareporting#placement".
  8143. Kind string `json:"kind,omitempty"`
  8144. // LastModifiedInfo: Information about the most recent modification of
  8145. // this placement. This is a read-only field.
  8146. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8147. // LookbackConfiguration: Lookback window settings for this placement.
  8148. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8149. // Name: Name of this placement.This is a required field and must be
  8150. // less than 256 characters long.
  8151. Name string `json:"name,omitempty"`
  8152. // PaymentApproved: Whether payment was approved for this placement.
  8153. // This is a read-only field relevant only to publisher-paid placements.
  8154. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8155. // PaymentSource: Payment source for this placement. This is a required
  8156. // field that is read-only after insertion.
  8157. //
  8158. // Possible values:
  8159. // "PLACEMENT_AGENCY_PAID"
  8160. // "PLACEMENT_PUBLISHER_PAID"
  8161. PaymentSource string `json:"paymentSource,omitempty"`
  8162. // PlacementGroupId: ID of this placement's group, if applicable.
  8163. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8164. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8165. // placement group. This is a read-only, auto-generated field.
  8166. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8167. // PlacementStrategyId: ID of the placement strategy assigned to this
  8168. // placement.
  8169. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8170. // PricingSchedule: Pricing schedule of this placement. This field is
  8171. // required on insertion, specifically subfields startDate, endDate and
  8172. // pricingType.
  8173. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8174. // Primary: Whether this placement is the primary placement of a
  8175. // roadblock (placement group). You cannot change this field from true
  8176. // to false. Setting this field to true will automatically set the
  8177. // primary field on the original primary placement of the roadblock to
  8178. // false, and it will automatically set the roadblock's
  8179. // primaryPlacementId field to the ID of this placement.
  8180. Primary bool `json:"primary,omitempty"`
  8181. // PublisherUpdateInfo: Information about the last publisher update.
  8182. // This is a read-only field.
  8183. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8184. // SiteId: Site ID associated with this placement. On insert, you must
  8185. // set either this field or the directorySiteId field to specify the
  8186. // site associated with this placement. This is a required field that is
  8187. // read-only after insertion.
  8188. SiteId int64 `json:"siteId,omitempty,string"`
  8189. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8190. // a read-only, auto-generated field.
  8191. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8192. // Size: Size associated with this placement. When inserting or updating
  8193. // a placement, only the size ID field is used. This field is required
  8194. // on insertion.
  8195. Size *Size `json:"size,omitempty"`
  8196. // SslRequired: Whether creatives assigned to this placement must be
  8197. // SSL-compliant.
  8198. SslRequired bool `json:"sslRequired,omitempty"`
  8199. // Status: Third-party placement status.
  8200. //
  8201. // Possible values:
  8202. // "ACKNOWLEDGE_ACCEPTANCE"
  8203. // "ACKNOWLEDGE_REJECTION"
  8204. // "DRAFT"
  8205. // "PAYMENT_ACCEPTED"
  8206. // "PAYMENT_REJECTED"
  8207. // "PENDING_REVIEW"
  8208. Status string `json:"status,omitempty"`
  8209. // SubaccountId: Subaccount ID of this placement. This field can be left
  8210. // blank.
  8211. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8212. // TagFormats: Tag formats to generate for this placement. This field is
  8213. // required on insertion.
  8214. // Acceptable values are:
  8215. // - "PLACEMENT_TAG_STANDARD"
  8216. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8217. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8218. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8219. // - "PLACEMENT_TAG_JAVASCRIPT"
  8220. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8221. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8222. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8223. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8224. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8225. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8226. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8227. // - "PLACEMENT_TAG_TRACKING"
  8228. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8229. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8230. //
  8231. // Possible values:
  8232. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8233. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8234. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8235. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8236. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8237. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8238. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8239. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8240. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8241. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8242. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8243. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8244. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8245. // "PLACEMENT_TAG_JAVASCRIPT"
  8246. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8247. // "PLACEMENT_TAG_STANDARD"
  8248. // "PLACEMENT_TAG_TRACKING"
  8249. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8250. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8251. TagFormats []string `json:"tagFormats,omitempty"`
  8252. // TagSetting: Tag settings for this placement.
  8253. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8254. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8255. // disabled for in-stream video creatives for this placement. The same
  8256. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8257. // occurs if either of these settings are true. These settings are
  8258. // distinct from DirectorySites.settings.activeViewOptOut or
  8259. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8260. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8261. // well as display ads, from Verification and ActiveView.
  8262. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8263. // VideoSettings: A collection of settings which affect video creatives
  8264. // served through this placement. Applicable to placements with
  8265. // IN_STREAM_VIDEO compatibility.
  8266. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8267. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8268. // Controls which VPAID format the measurement adapter will use for
  8269. // in-stream video creatives assigned to this placement.
  8270. //
  8271. // Note: Flash is no longer supported. This field now defaults to HTML5
  8272. // when the following values are provided: FLASH, BOTH.
  8273. //
  8274. // Possible values:
  8275. // "BOTH"
  8276. // "DEFAULT"
  8277. // "FLASH"
  8278. // "HTML5"
  8279. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8280. // ServerResponse contains the HTTP response code and headers from the
  8281. // server.
  8282. googleapi.ServerResponse `json:"-"`
  8283. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8284. // unconditionally include in API requests. By default, fields with
  8285. // empty values are omitted from API requests. However, any non-pointer,
  8286. // non-interface field appearing in ForceSendFields will be sent to the
  8287. // server regardless of whether the field is empty or not. This may be
  8288. // used to include empty fields in Patch requests.
  8289. ForceSendFields []string `json:"-"`
  8290. // NullFields is a list of field names (e.g. "AccountId") to include in
  8291. // API requests with the JSON null value. By default, fields with empty
  8292. // values are omitted from API requests. However, any field with an
  8293. // empty value appearing in NullFields will be sent to the server as
  8294. // null. It is an error if a field in this list has a non-empty value.
  8295. // This may be used to include null fields in Patch requests.
  8296. NullFields []string `json:"-"`
  8297. }
  8298. func (s *Placement) MarshalJSON() ([]byte, error) {
  8299. type NoMethod Placement
  8300. raw := NoMethod(*s)
  8301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8302. }
  8303. // PlacementAssignment: Placement Assignment.
  8304. type PlacementAssignment struct {
  8305. // Active: Whether this placement assignment is active. When true, the
  8306. // placement will be included in the ad's rotation.
  8307. Active bool `json:"active,omitempty"`
  8308. // PlacementId: ID of the placement to be assigned. This is a required
  8309. // field.
  8310. PlacementId int64 `json:"placementId,omitempty,string"`
  8311. // PlacementIdDimensionValue: Dimension value for the ID of the
  8312. // placement. This is a read-only, auto-generated field.
  8313. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8314. // SslRequired: Whether the placement to be assigned requires SSL. This
  8315. // is a read-only field that is auto-generated when the ad is inserted
  8316. // or updated.
  8317. SslRequired bool `json:"sslRequired,omitempty"`
  8318. // ForceSendFields is a list of field names (e.g. "Active") to
  8319. // unconditionally include in API requests. By default, fields with
  8320. // empty values are omitted from API requests. However, any non-pointer,
  8321. // non-interface field appearing in ForceSendFields will be sent to the
  8322. // server regardless of whether the field is empty or not. This may be
  8323. // used to include empty fields in Patch requests.
  8324. ForceSendFields []string `json:"-"`
  8325. // NullFields is a list of field names (e.g. "Active") to include in API
  8326. // requests with the JSON null value. By default, fields with empty
  8327. // values are omitted from API requests. However, any field with an
  8328. // empty value appearing in NullFields will be sent to the server as
  8329. // null. It is an error if a field in this list has a non-empty value.
  8330. // This may be used to include null fields in Patch requests.
  8331. NullFields []string `json:"-"`
  8332. }
  8333. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8334. type NoMethod PlacementAssignment
  8335. raw := NoMethod(*s)
  8336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8337. }
  8338. // PlacementGroup: Contains properties of a package or roadblock.
  8339. type PlacementGroup struct {
  8340. // AccountId: Account ID of this placement group. This is a read-only
  8341. // field that can be left blank.
  8342. AccountId int64 `json:"accountId,omitempty,string"`
  8343. // AdvertiserId: Advertiser ID of this placement group. This is a
  8344. // required field on insertion.
  8345. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8346. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8347. // advertiser. This is a read-only, auto-generated field.
  8348. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8349. // Archived: Whether this placement group is archived.
  8350. Archived bool `json:"archived,omitempty"`
  8351. // CampaignId: Campaign ID of this placement group. This field is
  8352. // required on insertion.
  8353. CampaignId int64 `json:"campaignId,omitempty,string"`
  8354. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8355. // This is a read-only, auto-generated field.
  8356. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8357. // ChildPlacementIds: IDs of placements which are assigned to this
  8358. // placement group. This is a read-only, auto-generated field.
  8359. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8360. // Comment: Comments for this placement group.
  8361. Comment string `json:"comment,omitempty"`
  8362. // ContentCategoryId: ID of the content category assigned to this
  8363. // placement group.
  8364. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8365. // CreateInfo: Information about the creation of this placement group.
  8366. // This is a read-only field.
  8367. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8368. // DirectorySiteId: Directory site ID associated with this placement
  8369. // group. On insert, you must set either this field or the site_id field
  8370. // to specify the site associated with this placement group. This is a
  8371. // required field that is read-only after insertion.
  8372. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8373. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8374. // directory site. This is a read-only, auto-generated field.
  8375. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8376. // ExternalId: External ID for this placement.
  8377. ExternalId string `json:"externalId,omitempty"`
  8378. // Id: ID of this placement group. This is a read-only, auto-generated
  8379. // field.
  8380. Id int64 `json:"id,omitempty,string"`
  8381. // IdDimensionValue: Dimension value for the ID of this placement group.
  8382. // This is a read-only, auto-generated field.
  8383. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8384. // Kind: Identifies what kind of resource this is. Value: the fixed
  8385. // string "dfareporting#placementGroup".
  8386. Kind string `json:"kind,omitempty"`
  8387. // LastModifiedInfo: Information about the most recent modification of
  8388. // this placement group. This is a read-only field.
  8389. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8390. // Name: Name of this placement group. This is a required field and must
  8391. // be less than 256 characters long.
  8392. Name string `json:"name,omitempty"`
  8393. // PlacementGroupType: Type of this placement group. A package is a
  8394. // simple group of placements that acts as a single pricing point for a
  8395. // group of tags. A roadblock is a group of placements that not only
  8396. // acts as a single pricing point, but also assumes that all the tags in
  8397. // it will be served at the same time. A roadblock requires one of its
  8398. // assigned placements to be marked as primary for reporting. This field
  8399. // is required on insertion.
  8400. //
  8401. // Possible values:
  8402. // "PLACEMENT_PACKAGE"
  8403. // "PLACEMENT_ROADBLOCK"
  8404. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8405. // PlacementStrategyId: ID of the placement strategy assigned to this
  8406. // placement group.
  8407. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8408. // PricingSchedule: Pricing schedule of this placement group. This field
  8409. // is required on insertion.
  8410. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8411. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8412. // the media cost of a roadblock (placement group). Modifying this field
  8413. // will automatically modify the primary field on all affected roadblock
  8414. // child placements.
  8415. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8416. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8417. // primary placement. This is a read-only, auto-generated field.
  8418. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8419. // SiteId: Site ID associated with this placement group. On insert, you
  8420. // must set either this field or the directorySiteId field to specify
  8421. // the site associated with this placement group. This is a required
  8422. // field that is read-only after insertion.
  8423. SiteId int64 `json:"siteId,omitempty,string"`
  8424. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8425. // a read-only, auto-generated field.
  8426. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8427. // SubaccountId: Subaccount ID of this placement group. This is a
  8428. // read-only field that can be left blank.
  8429. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8430. // ServerResponse contains the HTTP response code and headers from the
  8431. // server.
  8432. googleapi.ServerResponse `json:"-"`
  8433. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8434. // unconditionally include in API requests. By default, fields with
  8435. // empty values are omitted from API requests. However, any non-pointer,
  8436. // non-interface field appearing in ForceSendFields will be sent to the
  8437. // server regardless of whether the field is empty or not. This may be
  8438. // used to include empty fields in Patch requests.
  8439. ForceSendFields []string `json:"-"`
  8440. // NullFields is a list of field names (e.g. "AccountId") to include in
  8441. // API requests with the JSON null value. By default, fields with empty
  8442. // values are omitted from API requests. However, any field with an
  8443. // empty value appearing in NullFields will be sent to the server as
  8444. // null. It is an error if a field in this list has a non-empty value.
  8445. // This may be used to include null fields in Patch requests.
  8446. NullFields []string `json:"-"`
  8447. }
  8448. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8449. type NoMethod PlacementGroup
  8450. raw := NoMethod(*s)
  8451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8452. }
  8453. // PlacementGroupsListResponse: Placement Group List Response
  8454. type PlacementGroupsListResponse struct {
  8455. // Kind: Identifies what kind of resource this is. Value: the fixed
  8456. // string "dfareporting#placementGroupsListResponse".
  8457. Kind string `json:"kind,omitempty"`
  8458. // NextPageToken: Pagination token to be used for the next list
  8459. // operation.
  8460. NextPageToken string `json:"nextPageToken,omitempty"`
  8461. // PlacementGroups: Placement group collection.
  8462. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8463. // ServerResponse contains the HTTP response code and headers from the
  8464. // server.
  8465. googleapi.ServerResponse `json:"-"`
  8466. // ForceSendFields is a list of field names (e.g. "Kind") to
  8467. // unconditionally include in API requests. By default, fields with
  8468. // empty values are omitted from API requests. However, any non-pointer,
  8469. // non-interface field appearing in ForceSendFields will be sent to the
  8470. // server regardless of whether the field is empty or not. This may be
  8471. // used to include empty fields in Patch requests.
  8472. ForceSendFields []string `json:"-"`
  8473. // NullFields is a list of field names (e.g. "Kind") to include in API
  8474. // requests with the JSON null value. By default, fields with empty
  8475. // values are omitted from API requests. However, any field with an
  8476. // empty value appearing in NullFields will be sent to the server as
  8477. // null. It is an error if a field in this list has a non-empty value.
  8478. // This may be used to include null fields in Patch requests.
  8479. NullFields []string `json:"-"`
  8480. }
  8481. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8482. type NoMethod PlacementGroupsListResponse
  8483. raw := NoMethod(*s)
  8484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8485. }
  8486. // PlacementStrategiesListResponse: Placement Strategy List Response
  8487. type PlacementStrategiesListResponse struct {
  8488. // Kind: Identifies what kind of resource this is. Value: the fixed
  8489. // string "dfareporting#placementStrategiesListResponse".
  8490. Kind string `json:"kind,omitempty"`
  8491. // NextPageToken: Pagination token to be used for the next list
  8492. // operation.
  8493. NextPageToken string `json:"nextPageToken,omitempty"`
  8494. // PlacementStrategies: Placement strategy collection.
  8495. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8496. // ServerResponse contains the HTTP response code and headers from the
  8497. // server.
  8498. googleapi.ServerResponse `json:"-"`
  8499. // ForceSendFields is a list of field names (e.g. "Kind") to
  8500. // unconditionally include in API requests. By default, fields with
  8501. // empty values are omitted from API requests. However, any non-pointer,
  8502. // non-interface field appearing in ForceSendFields will be sent to the
  8503. // server regardless of whether the field is empty or not. This may be
  8504. // used to include empty fields in Patch requests.
  8505. ForceSendFields []string `json:"-"`
  8506. // NullFields is a list of field names (e.g. "Kind") to include in API
  8507. // requests with the JSON null value. By default, fields with empty
  8508. // values are omitted from API requests. However, any field with an
  8509. // empty value appearing in NullFields will be sent to the server as
  8510. // null. It is an error if a field in this list has a non-empty value.
  8511. // This may be used to include null fields in Patch requests.
  8512. NullFields []string `json:"-"`
  8513. }
  8514. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8515. type NoMethod PlacementStrategiesListResponse
  8516. raw := NoMethod(*s)
  8517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8518. }
  8519. // PlacementStrategy: Contains properties of a placement strategy.
  8520. type PlacementStrategy struct {
  8521. // AccountId: Account ID of this placement strategy.This is a read-only
  8522. // field that can be left blank.
  8523. AccountId int64 `json:"accountId,omitempty,string"`
  8524. // Id: ID of this placement strategy. This is a read-only,
  8525. // auto-generated field.
  8526. Id int64 `json:"id,omitempty,string"`
  8527. // Kind: Identifies what kind of resource this is. Value: the fixed
  8528. // string "dfareporting#placementStrategy".
  8529. Kind string `json:"kind,omitempty"`
  8530. // Name: Name of this placement strategy. This is a required field. It
  8531. // must be less than 256 characters long and unique among placement
  8532. // strategies of the same account.
  8533. Name string `json:"name,omitempty"`
  8534. // ServerResponse contains the HTTP response code and headers from the
  8535. // server.
  8536. googleapi.ServerResponse `json:"-"`
  8537. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8538. // unconditionally include in API requests. By default, fields with
  8539. // empty values are omitted from API requests. However, any non-pointer,
  8540. // non-interface field appearing in ForceSendFields will be sent to the
  8541. // server regardless of whether the field is empty or not. This may be
  8542. // used to include empty fields in Patch requests.
  8543. ForceSendFields []string `json:"-"`
  8544. // NullFields is a list of field names (e.g. "AccountId") to include in
  8545. // API requests with the JSON null value. By default, fields with empty
  8546. // values are omitted from API requests. However, any field with an
  8547. // empty value appearing in NullFields will be sent to the server as
  8548. // null. It is an error if a field in this list has a non-empty value.
  8549. // This may be used to include null fields in Patch requests.
  8550. NullFields []string `json:"-"`
  8551. }
  8552. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8553. type NoMethod PlacementStrategy
  8554. raw := NoMethod(*s)
  8555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8556. }
  8557. // PlacementTag: Placement Tag
  8558. type PlacementTag struct {
  8559. // PlacementId: Placement ID
  8560. PlacementId int64 `json:"placementId,omitempty,string"`
  8561. // TagDatas: Tags generated for this placement.
  8562. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8563. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8564. // unconditionally include in API requests. By default, fields with
  8565. // empty values are omitted from API requests. However, any non-pointer,
  8566. // non-interface field appearing in ForceSendFields will be sent to the
  8567. // server regardless of whether the field is empty or not. This may be
  8568. // used to include empty fields in Patch requests.
  8569. ForceSendFields []string `json:"-"`
  8570. // NullFields is a list of field names (e.g. "PlacementId") to include
  8571. // in API requests with the JSON null value. By default, fields with
  8572. // empty values are omitted from API requests. However, any field with
  8573. // an empty value appearing in NullFields will be sent to the server as
  8574. // null. It is an error if a field in this list has a non-empty value.
  8575. // This may be used to include null fields in Patch requests.
  8576. NullFields []string `json:"-"`
  8577. }
  8578. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8579. type NoMethod PlacementTag
  8580. raw := NoMethod(*s)
  8581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8582. }
  8583. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8584. type PlacementsGenerateTagsResponse struct {
  8585. // Kind: Identifies what kind of resource this is. Value: the fixed
  8586. // string "dfareporting#placementsGenerateTagsResponse".
  8587. Kind string `json:"kind,omitempty"`
  8588. // PlacementTags: Set of generated tags for the specified placements.
  8589. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8590. // ServerResponse contains the HTTP response code and headers from the
  8591. // server.
  8592. googleapi.ServerResponse `json:"-"`
  8593. // ForceSendFields is a list of field names (e.g. "Kind") to
  8594. // unconditionally include in API requests. By default, fields with
  8595. // empty values are omitted from API requests. However, any non-pointer,
  8596. // non-interface field appearing in ForceSendFields will be sent to the
  8597. // server regardless of whether the field is empty or not. This may be
  8598. // used to include empty fields in Patch requests.
  8599. ForceSendFields []string `json:"-"`
  8600. // NullFields is a list of field names (e.g. "Kind") to include in API
  8601. // requests with the JSON null value. By default, fields with empty
  8602. // values are omitted from API requests. However, any field with an
  8603. // empty value appearing in NullFields will be sent to the server as
  8604. // null. It is an error if a field in this list has a non-empty value.
  8605. // This may be used to include null fields in Patch requests.
  8606. NullFields []string `json:"-"`
  8607. }
  8608. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8609. type NoMethod PlacementsGenerateTagsResponse
  8610. raw := NoMethod(*s)
  8611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8612. }
  8613. // PlacementsListResponse: Placement List Response
  8614. type PlacementsListResponse struct {
  8615. // Kind: Identifies what kind of resource this is. Value: the fixed
  8616. // string "dfareporting#placementsListResponse".
  8617. Kind string `json:"kind,omitempty"`
  8618. // NextPageToken: Pagination token to be used for the next list
  8619. // operation.
  8620. NextPageToken string `json:"nextPageToken,omitempty"`
  8621. // Placements: Placement collection.
  8622. Placements []*Placement `json:"placements,omitempty"`
  8623. // ServerResponse contains the HTTP response code and headers from the
  8624. // server.
  8625. googleapi.ServerResponse `json:"-"`
  8626. // ForceSendFields is a list of field names (e.g. "Kind") to
  8627. // unconditionally include in API requests. By default, fields with
  8628. // empty values are omitted from API requests. However, any non-pointer,
  8629. // non-interface field appearing in ForceSendFields will be sent to the
  8630. // server regardless of whether the field is empty or not. This may be
  8631. // used to include empty fields in Patch requests.
  8632. ForceSendFields []string `json:"-"`
  8633. // NullFields is a list of field names (e.g. "Kind") to include in API
  8634. // requests with the JSON null value. By default, fields with empty
  8635. // values are omitted from API requests. However, any field with an
  8636. // empty value appearing in NullFields will be sent to the server as
  8637. // null. It is an error if a field in this list has a non-empty value.
  8638. // This may be used to include null fields in Patch requests.
  8639. NullFields []string `json:"-"`
  8640. }
  8641. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8642. type NoMethod PlacementsListResponse
  8643. raw := NoMethod(*s)
  8644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8645. }
  8646. // PlatformType: Contains information about a platform type that can be
  8647. // targeted by ads.
  8648. type PlatformType struct {
  8649. // Id: ID of this platform type.
  8650. Id int64 `json:"id,omitempty,string"`
  8651. // Kind: Identifies what kind of resource this is. Value: the fixed
  8652. // string "dfareporting#platformType".
  8653. Kind string `json:"kind,omitempty"`
  8654. // Name: Name of this platform type.
  8655. Name string `json:"name,omitempty"`
  8656. // ServerResponse contains the HTTP response code and headers from the
  8657. // server.
  8658. googleapi.ServerResponse `json:"-"`
  8659. // ForceSendFields is a list of field names (e.g. "Id") to
  8660. // unconditionally include in API requests. By default, fields with
  8661. // empty values are omitted from API requests. However, any non-pointer,
  8662. // non-interface field appearing in ForceSendFields will be sent to the
  8663. // server regardless of whether the field is empty or not. This may be
  8664. // used to include empty fields in Patch requests.
  8665. ForceSendFields []string `json:"-"`
  8666. // NullFields is a list of field names (e.g. "Id") to include in API
  8667. // requests with the JSON null value. By default, fields with empty
  8668. // values are omitted from API requests. However, any field with an
  8669. // empty value appearing in NullFields will be sent to the server as
  8670. // null. It is an error if a field in this list has a non-empty value.
  8671. // This may be used to include null fields in Patch requests.
  8672. NullFields []string `json:"-"`
  8673. }
  8674. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8675. type NoMethod PlatformType
  8676. raw := NoMethod(*s)
  8677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8678. }
  8679. // PlatformTypesListResponse: Platform Type List Response
  8680. type PlatformTypesListResponse struct {
  8681. // Kind: Identifies what kind of resource this is. Value: the fixed
  8682. // string "dfareporting#platformTypesListResponse".
  8683. Kind string `json:"kind,omitempty"`
  8684. // PlatformTypes: Platform type collection.
  8685. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8686. // ServerResponse contains the HTTP response code and headers from the
  8687. // server.
  8688. googleapi.ServerResponse `json:"-"`
  8689. // ForceSendFields is a list of field names (e.g. "Kind") to
  8690. // unconditionally include in API requests. By default, fields with
  8691. // empty values are omitted from API requests. However, any non-pointer,
  8692. // non-interface field appearing in ForceSendFields will be sent to the
  8693. // server regardless of whether the field is empty or not. This may be
  8694. // used to include empty fields in Patch requests.
  8695. ForceSendFields []string `json:"-"`
  8696. // NullFields is a list of field names (e.g. "Kind") to include in API
  8697. // requests with the JSON null value. By default, fields with empty
  8698. // values are omitted from API requests. However, any field with an
  8699. // empty value appearing in NullFields will be sent to the server as
  8700. // null. It is an error if a field in this list has a non-empty value.
  8701. // This may be used to include null fields in Patch requests.
  8702. NullFields []string `json:"-"`
  8703. }
  8704. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8705. type NoMethod PlatformTypesListResponse
  8706. raw := NoMethod(*s)
  8707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8708. }
  8709. // PopupWindowProperties: Popup Window Properties.
  8710. type PopupWindowProperties struct {
  8711. // Dimension: Popup dimension for a creative. This is a read-only field.
  8712. // Applicable to the following creative types: all RICH_MEDIA and all
  8713. // VPAID
  8714. Dimension *Size `json:"dimension,omitempty"`
  8715. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8716. // if positionType is COORDINATES.
  8717. Offset *OffsetPosition `json:"offset,omitempty"`
  8718. // PositionType: Popup window position either centered or at specific
  8719. // coordinate.
  8720. //
  8721. // Possible values:
  8722. // "CENTER"
  8723. // "COORDINATES"
  8724. PositionType string `json:"positionType,omitempty"`
  8725. // ShowAddressBar: Whether to display the browser address bar.
  8726. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8727. // ShowMenuBar: Whether to display the browser menu bar.
  8728. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8729. // ShowScrollBar: Whether to display the browser scroll bar.
  8730. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8731. // ShowStatusBar: Whether to display the browser status bar.
  8732. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8733. // ShowToolBar: Whether to display the browser tool bar.
  8734. ShowToolBar bool `json:"showToolBar,omitempty"`
  8735. // Title: Title of popup window.
  8736. Title string `json:"title,omitempty"`
  8737. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8738. // unconditionally include in API requests. By default, fields with
  8739. // empty values are omitted from API requests. However, any non-pointer,
  8740. // non-interface field appearing in ForceSendFields will be sent to the
  8741. // server regardless of whether the field is empty or not. This may be
  8742. // used to include empty fields in Patch requests.
  8743. ForceSendFields []string `json:"-"`
  8744. // NullFields is a list of field names (e.g. "Dimension") to include in
  8745. // API requests with the JSON null value. By default, fields with empty
  8746. // values are omitted from API requests. However, any field with an
  8747. // empty value appearing in NullFields will be sent to the server as
  8748. // null. It is an error if a field in this list has a non-empty value.
  8749. // This may be used to include null fields in Patch requests.
  8750. NullFields []string `json:"-"`
  8751. }
  8752. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8753. type NoMethod PopupWindowProperties
  8754. raw := NoMethod(*s)
  8755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8756. }
  8757. // PostalCode: Contains information about a postal code that can be
  8758. // targeted by ads.
  8759. type PostalCode struct {
  8760. // Code: Postal code. This is equivalent to the id field.
  8761. Code string `json:"code,omitempty"`
  8762. // CountryCode: Country code of the country to which this postal code
  8763. // belongs.
  8764. CountryCode string `json:"countryCode,omitempty"`
  8765. // CountryDartId: DART ID of the country to which this postal code
  8766. // belongs.
  8767. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8768. // Id: ID of this postal code.
  8769. Id string `json:"id,omitempty"`
  8770. // Kind: Identifies what kind of resource this is. Value: the fixed
  8771. // string "dfareporting#postalCode".
  8772. Kind string `json:"kind,omitempty"`
  8773. // ServerResponse contains the HTTP response code and headers from the
  8774. // server.
  8775. googleapi.ServerResponse `json:"-"`
  8776. // ForceSendFields is a list of field names (e.g. "Code") to
  8777. // unconditionally include in API requests. By default, fields with
  8778. // empty values are omitted from API requests. However, any non-pointer,
  8779. // non-interface field appearing in ForceSendFields will be sent to the
  8780. // server regardless of whether the field is empty or not. This may be
  8781. // used to include empty fields in Patch requests.
  8782. ForceSendFields []string `json:"-"`
  8783. // NullFields is a list of field names (e.g. "Code") to include in API
  8784. // requests with the JSON null value. By default, fields with empty
  8785. // values are omitted from API requests. However, any field with an
  8786. // empty value appearing in NullFields will be sent to the server as
  8787. // null. It is an error if a field in this list has a non-empty value.
  8788. // This may be used to include null fields in Patch requests.
  8789. NullFields []string `json:"-"`
  8790. }
  8791. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8792. type NoMethod PostalCode
  8793. raw := NoMethod(*s)
  8794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8795. }
  8796. // PostalCodesListResponse: Postal Code List Response
  8797. type PostalCodesListResponse struct {
  8798. // Kind: Identifies what kind of resource this is. Value: the fixed
  8799. // string "dfareporting#postalCodesListResponse".
  8800. Kind string `json:"kind,omitempty"`
  8801. // PostalCodes: Postal code collection.
  8802. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8803. // ServerResponse contains the HTTP response code and headers from the
  8804. // server.
  8805. googleapi.ServerResponse `json:"-"`
  8806. // ForceSendFields is a list of field names (e.g. "Kind") to
  8807. // unconditionally include in API requests. By default, fields with
  8808. // empty values are omitted from API requests. However, any non-pointer,
  8809. // non-interface field appearing in ForceSendFields will be sent to the
  8810. // server regardless of whether the field is empty or not. This may be
  8811. // used to include empty fields in Patch requests.
  8812. ForceSendFields []string `json:"-"`
  8813. // NullFields is a list of field names (e.g. "Kind") to include in API
  8814. // requests with the JSON null value. By default, fields with empty
  8815. // values are omitted from API requests. However, any field with an
  8816. // empty value appearing in NullFields will be sent to the server as
  8817. // null. It is an error if a field in this list has a non-empty value.
  8818. // This may be used to include null fields in Patch requests.
  8819. NullFields []string `json:"-"`
  8820. }
  8821. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8822. type NoMethod PostalCodesListResponse
  8823. raw := NoMethod(*s)
  8824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8825. }
  8826. // Pricing: Pricing Information
  8827. type Pricing struct {
  8828. // CapCostType: Cap cost type of this inventory item.
  8829. //
  8830. // Possible values:
  8831. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8832. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8833. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8834. CapCostType string `json:"capCostType,omitempty"`
  8835. // EndDate: End date of this inventory item.
  8836. EndDate string `json:"endDate,omitempty"`
  8837. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8838. // period) represents the inventory item pricing information for a
  8839. // specific period of time.
  8840. Flights []*Flight `json:"flights,omitempty"`
  8841. // GroupType: Group type of this inventory item if it represents a
  8842. // placement group. Is null otherwise. There are two type of placement
  8843. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8844. // inventory items that acts as a single pricing point for a group of
  8845. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8846. // items that not only acts as a single pricing point, but also assumes
  8847. // that all the tags in it will be served at the same time. A roadblock
  8848. // requires one of its assigned inventory items to be marked as primary.
  8849. //
  8850. // Possible values:
  8851. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8852. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8853. GroupType string `json:"groupType,omitempty"`
  8854. // PricingType: Pricing type of this inventory item.
  8855. //
  8856. // Possible values:
  8857. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8858. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8859. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8860. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8861. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8862. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8863. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8864. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8865. PricingType string `json:"pricingType,omitempty"`
  8866. // StartDate: Start date of this inventory item.
  8867. StartDate string `json:"startDate,omitempty"`
  8868. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  8869. // unconditionally include in API requests. By default, fields with
  8870. // empty values are omitted from API requests. However, any non-pointer,
  8871. // non-interface field appearing in ForceSendFields will be sent to the
  8872. // server regardless of whether the field is empty or not. This may be
  8873. // used to include empty fields in Patch requests.
  8874. ForceSendFields []string `json:"-"`
  8875. // NullFields is a list of field names (e.g. "CapCostType") to include
  8876. // in API requests with the JSON null value. By default, fields with
  8877. // empty values are omitted from API requests. However, any field with
  8878. // an empty value appearing in NullFields will be sent to the server as
  8879. // null. It is an error if a field in this list has a non-empty value.
  8880. // This may be used to include null fields in Patch requests.
  8881. NullFields []string `json:"-"`
  8882. }
  8883. func (s *Pricing) MarshalJSON() ([]byte, error) {
  8884. type NoMethod Pricing
  8885. raw := NoMethod(*s)
  8886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8887. }
  8888. // PricingSchedule: Pricing Schedule
  8889. type PricingSchedule struct {
  8890. // CapCostOption: Placement cap cost option.
  8891. //
  8892. // Possible values:
  8893. // "CAP_COST_CUMULATIVE"
  8894. // "CAP_COST_MONTHLY"
  8895. // "CAP_COST_NONE"
  8896. CapCostOption string `json:"capCostOption,omitempty"`
  8897. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  8898. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  8899. // EndDate: Placement end date. This date must be later than, or the
  8900. // same day as, the placement start date, but not later than the
  8901. // campaign end date. If, for example, you set 6/25/2015 as both the
  8902. // start and end dates, the effective placement date is just that day
  8903. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  8904. // should not be set, as doing so will result in an error. This field is
  8905. // required on insertion.
  8906. EndDate string `json:"endDate,omitempty"`
  8907. // Flighted: Whether this placement is flighted. If true, pricing
  8908. // periods will be computed automatically.
  8909. Flighted bool `json:"flighted,omitempty"`
  8910. // FloodlightActivityId: Floodlight activity ID associated with this
  8911. // placement. This field should be set when placement pricing type is
  8912. // set to PRICING_TYPE_CPA.
  8913. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  8914. // PricingPeriods: Pricing periods for this placement.
  8915. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  8916. // PricingType: Placement pricing type. This field is required on
  8917. // insertion.
  8918. //
  8919. // Possible values:
  8920. // "PRICING_TYPE_CPA"
  8921. // "PRICING_TYPE_CPC"
  8922. // "PRICING_TYPE_CPM"
  8923. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  8924. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  8925. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8926. PricingType string `json:"pricingType,omitempty"`
  8927. // StartDate: Placement start date. This date must be later than, or the
  8928. // same day as, the campaign start date. The hours, minutes, and seconds
  8929. // of the start date should not be set, as doing so will result in an
  8930. // error. This field is required on insertion.
  8931. StartDate string `json:"startDate,omitempty"`
  8932. // TestingStartDate: Testing start date of this placement. The hours,
  8933. // minutes, and seconds of the start date should not be set, as doing so
  8934. // will result in an error.
  8935. TestingStartDate string `json:"testingStartDate,omitempty"`
  8936. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  8937. // unconditionally include in API requests. By default, fields with
  8938. // empty values are omitted from API requests. However, any non-pointer,
  8939. // non-interface field appearing in ForceSendFields will be sent to the
  8940. // server regardless of whether the field is empty or not. This may be
  8941. // used to include empty fields in Patch requests.
  8942. ForceSendFields []string `json:"-"`
  8943. // NullFields is a list of field names (e.g. "CapCostOption") to include
  8944. // in API requests with the JSON null value. By default, fields with
  8945. // empty values are omitted from API requests. However, any field with
  8946. // an empty value appearing in NullFields will be sent to the server as
  8947. // null. It is an error if a field in this list has a non-empty value.
  8948. // This may be used to include null fields in Patch requests.
  8949. NullFields []string `json:"-"`
  8950. }
  8951. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  8952. type NoMethod PricingSchedule
  8953. raw := NoMethod(*s)
  8954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8955. }
  8956. // PricingSchedulePricingPeriod: Pricing Period
  8957. type PricingSchedulePricingPeriod struct {
  8958. // EndDate: Pricing period end date. This date must be later than, or
  8959. // the same day as, the pricing period start date, but not later than
  8960. // the placement end date. The period end date can be the same date as
  8961. // the period start date. If, for example, you set 6/25/2015 as both the
  8962. // start and end dates, the effective pricing period date is just that
  8963. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  8964. // should not be set, as doing so will result in an error.
  8965. EndDate string `json:"endDate,omitempty"`
  8966. // PricingComment: Comments for this pricing period.
  8967. PricingComment string `json:"pricingComment,omitempty"`
  8968. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  8969. // multipled by 1000000000). Acceptable values are 0 to
  8970. // 1000000000000000000, inclusive.
  8971. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  8972. // StartDate: Pricing period start date. This date must be later than,
  8973. // or the same day as, the placement start date. The hours, minutes, and
  8974. // seconds of the start date should not be set, as doing so will result
  8975. // in an error.
  8976. StartDate string `json:"startDate,omitempty"`
  8977. // Units: Units of this pricing period. Acceptable values are 0 to
  8978. // 10000000000, inclusive.
  8979. Units int64 `json:"units,omitempty,string"`
  8980. // ForceSendFields is a list of field names (e.g. "EndDate") to
  8981. // unconditionally include in API requests. By default, fields with
  8982. // empty values are omitted from API requests. However, any non-pointer,
  8983. // non-interface field appearing in ForceSendFields will be sent to the
  8984. // server regardless of whether the field is empty or not. This may be
  8985. // used to include empty fields in Patch requests.
  8986. ForceSendFields []string `json:"-"`
  8987. // NullFields is a list of field names (e.g. "EndDate") to include in
  8988. // API requests with the JSON null value. By default, fields with empty
  8989. // values are omitted from API requests. However, any field with an
  8990. // empty value appearing in NullFields will be sent to the server as
  8991. // null. It is an error if a field in this list has a non-empty value.
  8992. // This may be used to include null fields in Patch requests.
  8993. NullFields []string `json:"-"`
  8994. }
  8995. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  8996. type NoMethod PricingSchedulePricingPeriod
  8997. raw := NoMethod(*s)
  8998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8999. }
  9000. // Project: Contains properties of a Planning project.
  9001. type Project struct {
  9002. // AccountId: Account ID of this project.
  9003. AccountId int64 `json:"accountId,omitempty,string"`
  9004. // AdvertiserId: Advertiser ID of this project.
  9005. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9006. // AudienceAgeGroup: Audience age group of this project.
  9007. //
  9008. // Possible values:
  9009. // "PLANNING_AUDIENCE_AGE_18_24"
  9010. // "PLANNING_AUDIENCE_AGE_25_34"
  9011. // "PLANNING_AUDIENCE_AGE_35_44"
  9012. // "PLANNING_AUDIENCE_AGE_45_54"
  9013. // "PLANNING_AUDIENCE_AGE_55_64"
  9014. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9015. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9016. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9017. // AudienceGender: Audience gender of this project.
  9018. //
  9019. // Possible values:
  9020. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9021. // "PLANNING_AUDIENCE_GENDER_MALE"
  9022. AudienceGender string `json:"audienceGender,omitempty"`
  9023. // Budget: Budget of this project in the currency specified by the
  9024. // current account. The value stored in this field represents only the
  9025. // non-fractional amount. For example, for USD, the smallest value that
  9026. // can be represented by this field is 1 US dollar.
  9027. Budget int64 `json:"budget,omitempty,string"`
  9028. // ClientBillingCode: Client billing code of this project.
  9029. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9030. // ClientName: Name of the project client.
  9031. ClientName string `json:"clientName,omitempty"`
  9032. // EndDate: End date of the project.
  9033. EndDate string `json:"endDate,omitempty"`
  9034. // Id: ID of this project. This is a read-only, auto-generated field.
  9035. Id int64 `json:"id,omitempty,string"`
  9036. // Kind: Identifies what kind of resource this is. Value: the fixed
  9037. // string "dfareporting#project".
  9038. Kind string `json:"kind,omitempty"`
  9039. // LastModifiedInfo: Information about the most recent modification of
  9040. // this project.
  9041. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9042. // Name: Name of this project.
  9043. Name string `json:"name,omitempty"`
  9044. // Overview: Overview of this project.
  9045. Overview string `json:"overview,omitempty"`
  9046. // StartDate: Start date of the project.
  9047. StartDate string `json:"startDate,omitempty"`
  9048. // SubaccountId: Subaccount ID of this project.
  9049. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9050. // TargetClicks: Number of clicks that the advertiser is targeting.
  9051. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9052. // TargetConversions: Number of conversions that the advertiser is
  9053. // targeting.
  9054. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9055. // TargetCpaNanos: CPA that the advertiser is targeting.
  9056. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9057. // TargetCpcNanos: CPC that the advertiser is targeting.
  9058. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9059. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9060. // is targeting.
  9061. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9062. // TargetCpmNanos: CPM that the advertiser is targeting.
  9063. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9064. // TargetImpressions: Number of impressions that the advertiser is
  9065. // targeting.
  9066. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9067. // ServerResponse contains the HTTP response code and headers from the
  9068. // server.
  9069. googleapi.ServerResponse `json:"-"`
  9070. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9071. // unconditionally include in API requests. By default, fields with
  9072. // empty values are omitted from API requests. However, any non-pointer,
  9073. // non-interface field appearing in ForceSendFields will be sent to the
  9074. // server regardless of whether the field is empty or not. This may be
  9075. // used to include empty fields in Patch requests.
  9076. ForceSendFields []string `json:"-"`
  9077. // NullFields is a list of field names (e.g. "AccountId") to include in
  9078. // API requests with the JSON null value. By default, fields with empty
  9079. // values are omitted from API requests. However, any field with an
  9080. // empty value appearing in NullFields will be sent to the server as
  9081. // null. It is an error if a field in this list has a non-empty value.
  9082. // This may be used to include null fields in Patch requests.
  9083. NullFields []string `json:"-"`
  9084. }
  9085. func (s *Project) MarshalJSON() ([]byte, error) {
  9086. type NoMethod Project
  9087. raw := NoMethod(*s)
  9088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9089. }
  9090. // ProjectsListResponse: Project List Response
  9091. type ProjectsListResponse struct {
  9092. // Kind: Identifies what kind of resource this is. Value: the fixed
  9093. // string "dfareporting#projectsListResponse".
  9094. Kind string `json:"kind,omitempty"`
  9095. // NextPageToken: Pagination token to be used for the next list
  9096. // operation.
  9097. NextPageToken string `json:"nextPageToken,omitempty"`
  9098. // Projects: Project collection.
  9099. Projects []*Project `json:"projects,omitempty"`
  9100. // ServerResponse contains the HTTP response code and headers from the
  9101. // server.
  9102. googleapi.ServerResponse `json:"-"`
  9103. // ForceSendFields is a list of field names (e.g. "Kind") to
  9104. // unconditionally include in API requests. By default, fields with
  9105. // empty values are omitted from API requests. However, any non-pointer,
  9106. // non-interface field appearing in ForceSendFields will be sent to the
  9107. // server regardless of whether the field is empty or not. This may be
  9108. // used to include empty fields in Patch requests.
  9109. ForceSendFields []string `json:"-"`
  9110. // NullFields is a list of field names (e.g. "Kind") to include in API
  9111. // requests with the JSON null value. By default, fields with empty
  9112. // values are omitted from API requests. However, any field with an
  9113. // empty value appearing in NullFields will be sent to the server as
  9114. // null. It is an error if a field in this list has a non-empty value.
  9115. // This may be used to include null fields in Patch requests.
  9116. NullFields []string `json:"-"`
  9117. }
  9118. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9119. type NoMethod ProjectsListResponse
  9120. raw := NoMethod(*s)
  9121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9122. }
  9123. // ReachReportCompatibleFields: Represents fields that are compatible to
  9124. // be selected for a report of type "REACH".
  9125. type ReachReportCompatibleFields struct {
  9126. // DimensionFilters: Dimensions which are compatible to be selected in
  9127. // the "dimensionFilters" section of the report.
  9128. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9129. // Dimensions: Dimensions which are compatible to be selected in the
  9130. // "dimensions" section of the report.
  9131. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9132. // Kind: The kind of resource this is, in this case
  9133. // dfareporting#reachReportCompatibleFields.
  9134. Kind string `json:"kind,omitempty"`
  9135. // Metrics: Metrics which are compatible to be selected in the
  9136. // "metricNames" section of the report.
  9137. Metrics []*Metric `json:"metrics,omitempty"`
  9138. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9139. // as activity metrics to pivot on in the "activities" section of the
  9140. // report.
  9141. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9142. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9143. // in the "reachByFrequencyMetricNames" section of the report.
  9144. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9145. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9146. // unconditionally include in API requests. By default, fields with
  9147. // empty values are omitted from API requests. However, any non-pointer,
  9148. // non-interface field appearing in ForceSendFields will be sent to the
  9149. // server regardless of whether the field is empty or not. This may be
  9150. // used to include empty fields in Patch requests.
  9151. ForceSendFields []string `json:"-"`
  9152. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9153. // include in API requests with the JSON null value. By default, fields
  9154. // with empty values are omitted from API requests. However, any field
  9155. // with an empty value appearing in NullFields will be sent to the
  9156. // server as null. It is an error if a field in this list has a
  9157. // non-empty value. This may be used to include null fields in Patch
  9158. // requests.
  9159. NullFields []string `json:"-"`
  9160. }
  9161. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9162. type NoMethod ReachReportCompatibleFields
  9163. raw := NoMethod(*s)
  9164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9165. }
  9166. // Recipient: Represents a recipient.
  9167. type Recipient struct {
  9168. // DeliveryType: The delivery type for the recipient.
  9169. //
  9170. // Possible values:
  9171. // "ATTACHMENT"
  9172. // "LINK"
  9173. DeliveryType string `json:"deliveryType,omitempty"`
  9174. // Email: The email address of the recipient.
  9175. Email string `json:"email,omitempty"`
  9176. // Kind: The kind of resource this is, in this case
  9177. // dfareporting#recipient.
  9178. Kind string `json:"kind,omitempty"`
  9179. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9180. // unconditionally include in API requests. By default, fields with
  9181. // empty values are omitted from API requests. However, any non-pointer,
  9182. // non-interface field appearing in ForceSendFields will be sent to the
  9183. // server regardless of whether the field is empty or not. This may be
  9184. // used to include empty fields in Patch requests.
  9185. ForceSendFields []string `json:"-"`
  9186. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9187. // in API requests with the JSON null value. By default, fields with
  9188. // empty values are omitted from API requests. However, any field with
  9189. // an empty value appearing in NullFields will be sent to the server as
  9190. // null. It is an error if a field in this list has a non-empty value.
  9191. // This may be used to include null fields in Patch requests.
  9192. NullFields []string `json:"-"`
  9193. }
  9194. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9195. type NoMethod Recipient
  9196. raw := NoMethod(*s)
  9197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9198. }
  9199. // Region: Contains information about a region that can be targeted by
  9200. // ads.
  9201. type Region struct {
  9202. // CountryCode: Country code of the country to which this region
  9203. // belongs.
  9204. CountryCode string `json:"countryCode,omitempty"`
  9205. // CountryDartId: DART ID of the country to which this region belongs.
  9206. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9207. // DartId: DART ID of this region.
  9208. DartId int64 `json:"dartId,omitempty,string"`
  9209. // Kind: Identifies what kind of resource this is. Value: the fixed
  9210. // string "dfareporting#region".
  9211. Kind string `json:"kind,omitempty"`
  9212. // Name: Name of this region.
  9213. Name string `json:"name,omitempty"`
  9214. // RegionCode: Region code.
  9215. RegionCode string `json:"regionCode,omitempty"`
  9216. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9217. // unconditionally include in API requests. By default, fields with
  9218. // empty values are omitted from API requests. However, any non-pointer,
  9219. // non-interface field appearing in ForceSendFields will be sent to the
  9220. // server regardless of whether the field is empty or not. This may be
  9221. // used to include empty fields in Patch requests.
  9222. ForceSendFields []string `json:"-"`
  9223. // NullFields is a list of field names (e.g. "CountryCode") to include
  9224. // in API requests with the JSON null value. By default, fields with
  9225. // empty values are omitted from API requests. However, any field with
  9226. // an empty value appearing in NullFields will be sent to the server as
  9227. // null. It is an error if a field in this list has a non-empty value.
  9228. // This may be used to include null fields in Patch requests.
  9229. NullFields []string `json:"-"`
  9230. }
  9231. func (s *Region) MarshalJSON() ([]byte, error) {
  9232. type NoMethod Region
  9233. raw := NoMethod(*s)
  9234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9235. }
  9236. // RegionsListResponse: Region List Response
  9237. type RegionsListResponse struct {
  9238. // Kind: Identifies what kind of resource this is. Value: the fixed
  9239. // string "dfareporting#regionsListResponse".
  9240. Kind string `json:"kind,omitempty"`
  9241. // Regions: Region collection.
  9242. Regions []*Region `json:"regions,omitempty"`
  9243. // ServerResponse contains the HTTP response code and headers from the
  9244. // server.
  9245. googleapi.ServerResponse `json:"-"`
  9246. // ForceSendFields is a list of field names (e.g. "Kind") to
  9247. // unconditionally include in API requests. By default, fields with
  9248. // empty values are omitted from API requests. However, any non-pointer,
  9249. // non-interface field appearing in ForceSendFields will be sent to the
  9250. // server regardless of whether the field is empty or not. This may be
  9251. // used to include empty fields in Patch requests.
  9252. ForceSendFields []string `json:"-"`
  9253. // NullFields is a list of field names (e.g. "Kind") to include in API
  9254. // requests with the JSON null value. By default, fields with empty
  9255. // values are omitted from API requests. However, any field with an
  9256. // empty value appearing in NullFields will be sent to the server as
  9257. // null. It is an error if a field in this list has a non-empty value.
  9258. // This may be used to include null fields in Patch requests.
  9259. NullFields []string `json:"-"`
  9260. }
  9261. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9262. type NoMethod RegionsListResponse
  9263. raw := NoMethod(*s)
  9264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9265. }
  9266. // RemarketingList: Contains properties of a remarketing list.
  9267. // Remarketing enables you to create lists of users who have performed
  9268. // specific actions on a site, then target ads to members of those
  9269. // lists. This resource can be used to manage remarketing lists that are
  9270. // owned by your advertisers. To see all remarketing lists that are
  9271. // visible to your advertisers, including those that are shared to your
  9272. // advertiser or account, use the TargetableRemarketingLists resource.
  9273. type RemarketingList struct {
  9274. // AccountId: Account ID of this remarketing list. This is a read-only,
  9275. // auto-generated field that is only returned in GET requests.
  9276. AccountId int64 `json:"accountId,omitempty,string"`
  9277. // Active: Whether this remarketing list is active.
  9278. Active bool `json:"active,omitempty"`
  9279. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9280. // remarketing list. This is a required field.
  9281. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9282. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9283. // advertiser. This is a read-only, auto-generated field.
  9284. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9285. // Description: Remarketing list description.
  9286. Description string `json:"description,omitempty"`
  9287. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9288. Id int64 `json:"id,omitempty,string"`
  9289. // Kind: Identifies what kind of resource this is. Value: the fixed
  9290. // string "dfareporting#remarketingList".
  9291. Kind string `json:"kind,omitempty"`
  9292. // LifeSpan: Number of days that a user should remain in the remarketing
  9293. // list without an impression. Acceptable values are 1 to 540,
  9294. // inclusive.
  9295. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9296. // ListPopulationRule: Rule used to populate the remarketing list with
  9297. // users.
  9298. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9299. // ListSize: Number of users currently in the list. This is a read-only
  9300. // field.
  9301. ListSize int64 `json:"listSize,omitempty,string"`
  9302. // ListSource: Product from which this remarketing list was originated.
  9303. //
  9304. // Possible values:
  9305. // "REMARKETING_LIST_SOURCE_ADX"
  9306. // "REMARKETING_LIST_SOURCE_DBM"
  9307. // "REMARKETING_LIST_SOURCE_DFA"
  9308. // "REMARKETING_LIST_SOURCE_DFP"
  9309. // "REMARKETING_LIST_SOURCE_DMP"
  9310. // "REMARKETING_LIST_SOURCE_GA"
  9311. // "REMARKETING_LIST_SOURCE_GPLUS"
  9312. // "REMARKETING_LIST_SOURCE_OTHER"
  9313. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9314. // "REMARKETING_LIST_SOURCE_XFP"
  9315. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9316. ListSource string `json:"listSource,omitempty"`
  9317. // Name: Name of the remarketing list. This is a required field. Must be
  9318. // no greater than 128 characters long.
  9319. Name string `json:"name,omitempty"`
  9320. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9321. // read-only, auto-generated field that is only returned in GET
  9322. // requests.
  9323. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9324. // ServerResponse contains the HTTP response code and headers from the
  9325. // server.
  9326. googleapi.ServerResponse `json:"-"`
  9327. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9328. // unconditionally include in API requests. By default, fields with
  9329. // empty values are omitted from API requests. However, any non-pointer,
  9330. // non-interface field appearing in ForceSendFields will be sent to the
  9331. // server regardless of whether the field is empty or not. This may be
  9332. // used to include empty fields in Patch requests.
  9333. ForceSendFields []string `json:"-"`
  9334. // NullFields is a list of field names (e.g. "AccountId") to include in
  9335. // API requests with the JSON null value. By default, fields with empty
  9336. // values are omitted from API requests. However, any field with an
  9337. // empty value appearing in NullFields will be sent to the server as
  9338. // null. It is an error if a field in this list has a non-empty value.
  9339. // This may be used to include null fields in Patch requests.
  9340. NullFields []string `json:"-"`
  9341. }
  9342. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9343. type NoMethod RemarketingList
  9344. raw := NoMethod(*s)
  9345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9346. }
  9347. // RemarketingListShare: Contains properties of a remarketing list's
  9348. // sharing information. Sharing allows other accounts or advertisers to
  9349. // target to your remarketing lists. This resource can be used to manage
  9350. // remarketing list sharing to other accounts and advertisers.
  9351. type RemarketingListShare struct {
  9352. // Kind: Identifies what kind of resource this is. Value: the fixed
  9353. // string "dfareporting#remarketingListShare".
  9354. Kind string `json:"kind,omitempty"`
  9355. // RemarketingListId: Remarketing list ID. This is a read-only,
  9356. // auto-generated field.
  9357. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9358. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9359. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9360. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9361. // with.
  9362. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9363. // ServerResponse contains the HTTP response code and headers from the
  9364. // server.
  9365. googleapi.ServerResponse `json:"-"`
  9366. // ForceSendFields is a list of field names (e.g. "Kind") to
  9367. // unconditionally include in API requests. By default, fields with
  9368. // empty values are omitted from API requests. However, any non-pointer,
  9369. // non-interface field appearing in ForceSendFields will be sent to the
  9370. // server regardless of whether the field is empty or not. This may be
  9371. // used to include empty fields in Patch requests.
  9372. ForceSendFields []string `json:"-"`
  9373. // NullFields is a list of field names (e.g. "Kind") to include in API
  9374. // requests with the JSON null value. By default, fields with empty
  9375. // values are omitted from API requests. However, any field with an
  9376. // empty value appearing in NullFields will be sent to the server as
  9377. // null. It is an error if a field in this list has a non-empty value.
  9378. // This may be used to include null fields in Patch requests.
  9379. NullFields []string `json:"-"`
  9380. }
  9381. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9382. type NoMethod RemarketingListShare
  9383. raw := NoMethod(*s)
  9384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9385. }
  9386. // RemarketingListsListResponse: Remarketing list response
  9387. type RemarketingListsListResponse struct {
  9388. // Kind: Identifies what kind of resource this is. Value: the fixed
  9389. // string "dfareporting#remarketingListsListResponse".
  9390. Kind string `json:"kind,omitempty"`
  9391. // NextPageToken: Pagination token to be used for the next list
  9392. // operation.
  9393. NextPageToken string `json:"nextPageToken,omitempty"`
  9394. // RemarketingLists: Remarketing list collection.
  9395. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9396. // ServerResponse contains the HTTP response code and headers from the
  9397. // server.
  9398. googleapi.ServerResponse `json:"-"`
  9399. // ForceSendFields is a list of field names (e.g. "Kind") to
  9400. // unconditionally include in API requests. By default, fields with
  9401. // empty values are omitted from API requests. However, any non-pointer,
  9402. // non-interface field appearing in ForceSendFields will be sent to the
  9403. // server regardless of whether the field is empty or not. This may be
  9404. // used to include empty fields in Patch requests.
  9405. ForceSendFields []string `json:"-"`
  9406. // NullFields is a list of field names (e.g. "Kind") to include in API
  9407. // requests with the JSON null value. By default, fields with empty
  9408. // values are omitted from API requests. However, any field with an
  9409. // empty value appearing in NullFields will be sent to the server as
  9410. // null. It is an error if a field in this list has a non-empty value.
  9411. // This may be used to include null fields in Patch requests.
  9412. NullFields []string `json:"-"`
  9413. }
  9414. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9415. type NoMethod RemarketingListsListResponse
  9416. raw := NoMethod(*s)
  9417. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9418. }
  9419. // Report: Represents a Report resource.
  9420. type Report struct {
  9421. // AccountId: The account ID to which this report belongs.
  9422. AccountId int64 `json:"accountId,omitempty,string"`
  9423. // Criteria: The report criteria for a report of type "STANDARD".
  9424. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9425. // CrossDimensionReachCriteria: The report criteria for a report of type
  9426. // "CROSS_DIMENSION_REACH".
  9427. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9428. // Delivery: The report's email delivery settings.
  9429. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9430. // Etag: The eTag of this response for caching purposes.
  9431. Etag string `json:"etag,omitempty"`
  9432. // FileName: The filename used when generating report files for this
  9433. // report.
  9434. FileName string `json:"fileName,omitempty"`
  9435. // FloodlightCriteria: The report criteria for a report of type
  9436. // "FLOODLIGHT".
  9437. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9438. // Format: The output format of the report. If not specified, default
  9439. // format is "CSV". Note that the actual format in the completed report
  9440. // file might differ if for instance the report's size exceeds the
  9441. // format's capabilities. "CSV" will then be the fallback format.
  9442. //
  9443. // Possible values:
  9444. // "CSV"
  9445. // "EXCEL"
  9446. Format string `json:"format,omitempty"`
  9447. // Id: The unique ID identifying this report resource.
  9448. Id int64 `json:"id,omitempty,string"`
  9449. // Kind: The kind of resource this is, in this case dfareporting#report.
  9450. Kind string `json:"kind,omitempty"`
  9451. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9452. // this report was last modified.
  9453. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9454. // Name: The name of the report.
  9455. Name string `json:"name,omitempty"`
  9456. // OwnerProfileId: The user profile id of the owner of this report.
  9457. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9458. // PathToConversionCriteria: The report criteria for a report of type
  9459. // "PATH_TO_CONVERSION".
  9460. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9461. // ReachCriteria: The report criteria for a report of type "REACH".
  9462. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9463. // Schedule: The report's schedule. Can only be set if the report's
  9464. // 'dateRange' is a relative date range and the relative date range is
  9465. // not "TODAY".
  9466. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9467. // SubAccountId: The subaccount ID to which this report belongs if
  9468. // applicable.
  9469. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9470. // Type: The type of the report.
  9471. //
  9472. // Possible values:
  9473. // "CROSS_DIMENSION_REACH"
  9474. // "FLOODLIGHT"
  9475. // "PATH_TO_CONVERSION"
  9476. // "REACH"
  9477. // "STANDARD"
  9478. Type string `json:"type,omitempty"`
  9479. // ServerResponse contains the HTTP response code and headers from the
  9480. // server.
  9481. googleapi.ServerResponse `json:"-"`
  9482. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9483. // unconditionally include in API requests. By default, fields with
  9484. // empty values are omitted from API requests. However, any non-pointer,
  9485. // non-interface field appearing in ForceSendFields will be sent to the
  9486. // server regardless of whether the field is empty or not. This may be
  9487. // used to include empty fields in Patch requests.
  9488. ForceSendFields []string `json:"-"`
  9489. // NullFields is a list of field names (e.g. "AccountId") to include in
  9490. // API requests with the JSON null value. By default, fields with empty
  9491. // values are omitted from API requests. However, any field with an
  9492. // empty value appearing in NullFields will be sent to the server as
  9493. // null. It is an error if a field in this list has a non-empty value.
  9494. // This may be used to include null fields in Patch requests.
  9495. NullFields []string `json:"-"`
  9496. }
  9497. func (s *Report) MarshalJSON() ([]byte, error) {
  9498. type NoMethod Report
  9499. raw := NoMethod(*s)
  9500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9501. }
  9502. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9503. type ReportCriteria struct {
  9504. // Activities: Activity group.
  9505. Activities *Activities `json:"activities,omitempty"`
  9506. // CustomRichMediaEvents: Custom Rich Media Events group.
  9507. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9508. // DateRange: The date range for which this report should be run.
  9509. DateRange *DateRange `json:"dateRange,omitempty"`
  9510. // DimensionFilters: The list of filters on which dimensions are
  9511. // filtered.
  9512. // Filters for different dimensions are ANDed, filters for the same
  9513. // dimension are grouped together and ORed.
  9514. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9515. // Dimensions: The list of standard dimensions the report should
  9516. // include.
  9517. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9518. // MetricNames: The list of names of metrics the report should include.
  9519. MetricNames []string `json:"metricNames,omitempty"`
  9520. // ForceSendFields is a list of field names (e.g. "Activities") to
  9521. // unconditionally include in API requests. By default, fields with
  9522. // empty values are omitted from API requests. However, any non-pointer,
  9523. // non-interface field appearing in ForceSendFields will be sent to the
  9524. // server regardless of whether the field is empty or not. This may be
  9525. // used to include empty fields in Patch requests.
  9526. ForceSendFields []string `json:"-"`
  9527. // NullFields is a list of field names (e.g. "Activities") to include in
  9528. // API requests with the JSON null value. By default, fields with empty
  9529. // values are omitted from API requests. However, any field with an
  9530. // empty value appearing in NullFields will be sent to the server as
  9531. // null. It is an error if a field in this list has a non-empty value.
  9532. // This may be used to include null fields in Patch requests.
  9533. NullFields []string `json:"-"`
  9534. }
  9535. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9536. type NoMethod ReportCriteria
  9537. raw := NoMethod(*s)
  9538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9539. }
  9540. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9541. // of type "CROSS_DIMENSION_REACH".
  9542. type ReportCrossDimensionReachCriteria struct {
  9543. // Breakdown: The list of dimensions the report should include.
  9544. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9545. // DateRange: The date range this report should be run for.
  9546. DateRange *DateRange `json:"dateRange,omitempty"`
  9547. // Dimension: The dimension option.
  9548. //
  9549. // Possible values:
  9550. // "ADVERTISER"
  9551. // "CAMPAIGN"
  9552. // "SITE_BY_ADVERTISER"
  9553. // "SITE_BY_CAMPAIGN"
  9554. Dimension string `json:"dimension,omitempty"`
  9555. // DimensionFilters: The list of filters on which dimensions are
  9556. // filtered.
  9557. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9558. // MetricNames: The list of names of metrics the report should include.
  9559. MetricNames []string `json:"metricNames,omitempty"`
  9560. // OverlapMetricNames: The list of names of overlap metrics the report
  9561. // should include.
  9562. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9563. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9564. Pivoted bool `json:"pivoted,omitempty"`
  9565. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9566. // unconditionally include in API requests. By default, fields with
  9567. // empty values are omitted from API requests. However, any non-pointer,
  9568. // non-interface field appearing in ForceSendFields will be sent to the
  9569. // server regardless of whether the field is empty or not. This may be
  9570. // used to include empty fields in Patch requests.
  9571. ForceSendFields []string `json:"-"`
  9572. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9573. // API requests with the JSON null value. By default, fields with empty
  9574. // values are omitted from API requests. However, any field with an
  9575. // empty value appearing in NullFields will be sent to the server as
  9576. // null. It is an error if a field in this list has a non-empty value.
  9577. // This may be used to include null fields in Patch requests.
  9578. NullFields []string `json:"-"`
  9579. }
  9580. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9581. type NoMethod ReportCrossDimensionReachCriteria
  9582. raw := NoMethod(*s)
  9583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9584. }
  9585. // ReportDelivery: The report's email delivery settings.
  9586. type ReportDelivery struct {
  9587. // EmailOwner: Whether the report should be emailed to the report owner.
  9588. EmailOwner bool `json:"emailOwner,omitempty"`
  9589. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9590. // receive, if enabled.
  9591. //
  9592. // Possible values:
  9593. // "ATTACHMENT"
  9594. // "LINK"
  9595. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9596. // Message: The message to be sent with each email.
  9597. Message string `json:"message,omitempty"`
  9598. // Recipients: The list of recipients to which to email the report.
  9599. Recipients []*Recipient `json:"recipients,omitempty"`
  9600. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9601. // unconditionally include in API requests. By default, fields with
  9602. // empty values are omitted from API requests. However, any non-pointer,
  9603. // non-interface field appearing in ForceSendFields will be sent to the
  9604. // server regardless of whether the field is empty or not. This may be
  9605. // used to include empty fields in Patch requests.
  9606. ForceSendFields []string `json:"-"`
  9607. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9608. // API requests with the JSON null value. By default, fields with empty
  9609. // values are omitted from API requests. However, any field with an
  9610. // empty value appearing in NullFields will be sent to the server as
  9611. // null. It is an error if a field in this list has a non-empty value.
  9612. // This may be used to include null fields in Patch requests.
  9613. NullFields []string `json:"-"`
  9614. }
  9615. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9616. type NoMethod ReportDelivery
  9617. raw := NoMethod(*s)
  9618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9619. }
  9620. // ReportFloodlightCriteria: The report criteria for a report of type
  9621. // "FLOODLIGHT".
  9622. type ReportFloodlightCriteria struct {
  9623. // CustomRichMediaEvents: The list of custom rich media events to
  9624. // include.
  9625. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9626. // DateRange: The date range this report should be run for.
  9627. DateRange *DateRange `json:"dateRange,omitempty"`
  9628. // DimensionFilters: The list of filters on which dimensions are
  9629. // filtered.
  9630. // Filters for different dimensions are ANDed, filters for the same
  9631. // dimension are grouped together and ORed.
  9632. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9633. // Dimensions: The list of dimensions the report should include.
  9634. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9635. // FloodlightConfigId: The floodlight ID for which to show data in this
  9636. // report. All advertisers associated with that ID will automatically be
  9637. // added. The dimension of the value needs to be
  9638. // 'dfa:floodlightConfigId'.
  9639. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9640. // MetricNames: The list of names of metrics the report should include.
  9641. MetricNames []string `json:"metricNames,omitempty"`
  9642. // ReportProperties: The properties of the report.
  9643. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9644. // ForceSendFields is a list of field names (e.g.
  9645. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9646. // By default, fields with empty values are omitted from API requests.
  9647. // However, any non-pointer, non-interface field appearing in
  9648. // ForceSendFields will be sent to the server regardless of whether the
  9649. // field is empty or not. This may be used to include empty fields in
  9650. // Patch requests.
  9651. ForceSendFields []string `json:"-"`
  9652. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9653. // include in API requests with the JSON null value. By default, fields
  9654. // with empty values are omitted from API requests. However, any field
  9655. // with an empty value appearing in NullFields will be sent to the
  9656. // server as null. It is an error if a field in this list has a
  9657. // non-empty value. This may be used to include null fields in Patch
  9658. // requests.
  9659. NullFields []string `json:"-"`
  9660. }
  9661. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9662. type NoMethod ReportFloodlightCriteria
  9663. raw := NoMethod(*s)
  9664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9665. }
  9666. // ReportFloodlightCriteriaReportProperties: The properties of the
  9667. // report.
  9668. type ReportFloodlightCriteriaReportProperties struct {
  9669. // IncludeAttributedIPConversions: Include conversions that have no
  9670. // cookie, but do have an exposure path.
  9671. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9672. // IncludeUnattributedCookieConversions: Include conversions of users
  9673. // with a DoubleClick cookie but without an exposure. That means the
  9674. // user did not click or see an ad from the advertiser within the
  9675. // Floodlight group, or that the interaction happened outside the
  9676. // lookback window.
  9677. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9678. // IncludeUnattributedIPConversions: Include conversions that have no
  9679. // associated cookies and no exposures. It’s therefore impossible to
  9680. // know how the user was exposed to your ads during the lookback window
  9681. // prior to a conversion.
  9682. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9683. // ForceSendFields is a list of field names (e.g.
  9684. // "IncludeAttributedIPConversions") to unconditionally include in API
  9685. // requests. By default, fields with empty values are omitted from API
  9686. // requests. However, any non-pointer, non-interface field appearing in
  9687. // ForceSendFields will be sent to the server regardless of whether the
  9688. // field is empty or not. This may be used to include empty fields in
  9689. // Patch requests.
  9690. ForceSendFields []string `json:"-"`
  9691. // NullFields is a list of field names (e.g.
  9692. // "IncludeAttributedIPConversions") to include in API requests with the
  9693. // JSON null value. By default, fields with empty values are omitted
  9694. // from API requests. However, any field with an empty value appearing
  9695. // in NullFields will be sent to the server as null. It is an error if a
  9696. // field in this list has a non-empty value. This may be used to include
  9697. // null fields in Patch requests.
  9698. NullFields []string `json:"-"`
  9699. }
  9700. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9701. type NoMethod ReportFloodlightCriteriaReportProperties
  9702. raw := NoMethod(*s)
  9703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9704. }
  9705. // ReportPathToConversionCriteria: The report criteria for a report of
  9706. // type "PATH_TO_CONVERSION".
  9707. type ReportPathToConversionCriteria struct {
  9708. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9709. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9710. // ConversionDimensions: The list of conversion dimensions the report
  9711. // should include.
  9712. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9713. // CustomFloodlightVariables: The list of custom floodlight variables
  9714. // the report should include.
  9715. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9716. // CustomRichMediaEvents: The list of custom rich media events to
  9717. // include.
  9718. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9719. // DateRange: The date range this report should be run for.
  9720. DateRange *DateRange `json:"dateRange,omitempty"`
  9721. // FloodlightConfigId: The floodlight ID for which to show data in this
  9722. // report. All advertisers associated with that ID will automatically be
  9723. // added. The dimension of the value needs to be
  9724. // 'dfa:floodlightConfigId'.
  9725. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9726. // MetricNames: The list of names of metrics the report should include.
  9727. MetricNames []string `json:"metricNames,omitempty"`
  9728. // PerInteractionDimensions: The list of per interaction dimensions the
  9729. // report should include.
  9730. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9731. // ReportProperties: The properties of the report.
  9732. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9733. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9734. // unconditionally include in API requests. By default, fields with
  9735. // empty values are omitted from API requests. However, any non-pointer,
  9736. // non-interface field appearing in ForceSendFields will be sent to the
  9737. // server regardless of whether the field is empty or not. This may be
  9738. // used to include empty fields in Patch requests.
  9739. ForceSendFields []string `json:"-"`
  9740. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9741. // include in API requests with the JSON null value. By default, fields
  9742. // with empty values are omitted from API requests. However, any field
  9743. // with an empty value appearing in NullFields will be sent to the
  9744. // server as null. It is an error if a field in this list has a
  9745. // non-empty value. This may be used to include null fields in Patch
  9746. // requests.
  9747. NullFields []string `json:"-"`
  9748. }
  9749. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9750. type NoMethod ReportPathToConversionCriteria
  9751. raw := NoMethod(*s)
  9752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9753. }
  9754. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9755. // report.
  9756. type ReportPathToConversionCriteriaReportProperties struct {
  9757. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9758. // occurred within the specified period of time before a conversion. By
  9759. // default the value is pulled from Floodlight or you can manually enter
  9760. // a custom value. Valid values: 1-90.
  9761. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9762. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9763. // interaction occurred within the specified period of time before a
  9764. // conversion. By default the value is pulled from Floodlight or you can
  9765. // manually enter a custom value. Valid values: 1-90.
  9766. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9767. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9768. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9769. // IncludeUnattributedCookieConversions: Include conversions of users
  9770. // with a DoubleClick cookie but without an exposure. That means the
  9771. // user did not click or see an ad from the advertiser within the
  9772. // Floodlight group, or that the interaction happened outside the
  9773. // lookback window.
  9774. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9775. // IncludeUnattributedIPConversions: Include conversions that have no
  9776. // associated cookies and no exposures. It’s therefore impossible to
  9777. // know how the user was exposed to your ads during the lookback window
  9778. // prior to a conversion.
  9779. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9780. // MaximumClickInteractions: The maximum number of click interactions to
  9781. // include in the report. Advertisers currently paying for E2C reports
  9782. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9783. // your network is paying for E2C, you can have up to 5 total exposures
  9784. // per report.
  9785. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9786. // MaximumImpressionInteractions: The maximum number of click
  9787. // interactions to include in the report. Advertisers currently paying
  9788. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9789. // another advertiser in your network is paying for E2C, you can have up
  9790. // to 5 total exposures per report.
  9791. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9792. // MaximumInteractionGap: The maximum amount of time that can take place
  9793. // between interactions (clicks or impressions) by the same user. Valid
  9794. // values: 1-90.
  9795. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9796. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9797. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9798. // ForceSendFields is a list of field names (e.g.
  9799. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9800. // By default, fields with empty values are omitted from API requests.
  9801. // However, any non-pointer, non-interface field appearing in
  9802. // ForceSendFields will be sent to the server regardless of whether the
  9803. // field is empty or not. This may be used to include empty fields in
  9804. // Patch requests.
  9805. ForceSendFields []string `json:"-"`
  9806. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9807. // include in API requests with the JSON null value. By default, fields
  9808. // with empty values are omitted from API requests. However, any field
  9809. // with an empty value appearing in NullFields will be sent to the
  9810. // server as null. It is an error if a field in this list has a
  9811. // non-empty value. This may be used to include null fields in Patch
  9812. // requests.
  9813. NullFields []string `json:"-"`
  9814. }
  9815. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9816. type NoMethod ReportPathToConversionCriteriaReportProperties
  9817. raw := NoMethod(*s)
  9818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9819. }
  9820. // ReportReachCriteria: The report criteria for a report of type
  9821. // "REACH".
  9822. type ReportReachCriteria struct {
  9823. // Activities: Activity group.
  9824. Activities *Activities `json:"activities,omitempty"`
  9825. // CustomRichMediaEvents: Custom Rich Media Events group.
  9826. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9827. // DateRange: The date range this report should be run for.
  9828. DateRange *DateRange `json:"dateRange,omitempty"`
  9829. // DimensionFilters: The list of filters on which dimensions are
  9830. // filtered.
  9831. // Filters for different dimensions are ANDed, filters for the same
  9832. // dimension are grouped together and ORed.
  9833. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9834. // Dimensions: The list of dimensions the report should include.
  9835. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9836. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9837. // combinations in the report. Defaults to false. If enabled, the date
  9838. // range of the report should be within the last 42 days.
  9839. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9840. // MetricNames: The list of names of metrics the report should include.
  9841. MetricNames []string `json:"metricNames,omitempty"`
  9842. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9843. // metrics the report should include.
  9844. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9845. // ForceSendFields is a list of field names (e.g. "Activities") to
  9846. // unconditionally include in API requests. By default, fields with
  9847. // empty values are omitted from API requests. However, any non-pointer,
  9848. // non-interface field appearing in ForceSendFields will be sent to the
  9849. // server regardless of whether the field is empty or not. This may be
  9850. // used to include empty fields in Patch requests.
  9851. ForceSendFields []string `json:"-"`
  9852. // NullFields is a list of field names (e.g. "Activities") to include in
  9853. // API requests with the JSON null value. By default, fields with empty
  9854. // values are omitted from API requests. However, any field with an
  9855. // empty value appearing in NullFields will be sent to the server as
  9856. // null. It is an error if a field in this list has a non-empty value.
  9857. // This may be used to include null fields in Patch requests.
  9858. NullFields []string `json:"-"`
  9859. }
  9860. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9861. type NoMethod ReportReachCriteria
  9862. raw := NoMethod(*s)
  9863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9864. }
  9865. // ReportSchedule: The report's schedule. Can only be set if the
  9866. // report's 'dateRange' is a relative date range and the relative date
  9867. // range is not "TODAY".
  9868. type ReportSchedule struct {
  9869. // Active: Whether the schedule is active or not. Must be set to either
  9870. // true or false.
  9871. Active bool `json:"active,omitempty"`
  9872. // Every: Defines every how many days, weeks or months the report should
  9873. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  9874. // "MONTHLY".
  9875. Every int64 `json:"every,omitempty"`
  9876. // ExpirationDate: The expiration date when the scheduled report stops
  9877. // running.
  9878. ExpirationDate string `json:"expirationDate,omitempty"`
  9879. // Repeats: The interval for which the report is repeated. Note:
  9880. // - "DAILY" also requires field "every" to be set.
  9881. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  9882. // set.
  9883. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  9884. // set.
  9885. Repeats string `json:"repeats,omitempty"`
  9886. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  9887. // reports should run.
  9888. //
  9889. // Possible values:
  9890. // "FRIDAY"
  9891. // "MONDAY"
  9892. // "SATURDAY"
  9893. // "SUNDAY"
  9894. // "THURSDAY"
  9895. // "TUESDAY"
  9896. // "WEDNESDAY"
  9897. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  9898. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  9899. // whether reports should be repeated on the same day of the month as
  9900. // "startDate" or the same day of the week of the month.
  9901. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  9902. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  9903. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  9904. // Monday of the month.
  9905. //
  9906. // Possible values:
  9907. // "DAY_OF_MONTH"
  9908. // "WEEK_OF_MONTH"
  9909. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  9910. // StartDate: Start date of date range for which scheduled reports
  9911. // should be run.
  9912. StartDate string `json:"startDate,omitempty"`
  9913. // ForceSendFields is a list of field names (e.g. "Active") to
  9914. // unconditionally include in API requests. By default, fields with
  9915. // empty values are omitted from API requests. However, any non-pointer,
  9916. // non-interface field appearing in ForceSendFields will be sent to the
  9917. // server regardless of whether the field is empty or not. This may be
  9918. // used to include empty fields in Patch requests.
  9919. ForceSendFields []string `json:"-"`
  9920. // NullFields is a list of field names (e.g. "Active") to include in API
  9921. // requests with the JSON null value. By default, fields with empty
  9922. // values are omitted from API requests. However, any field with an
  9923. // empty value appearing in NullFields will be sent to the server as
  9924. // null. It is an error if a field in this list has a non-empty value.
  9925. // This may be used to include null fields in Patch requests.
  9926. NullFields []string `json:"-"`
  9927. }
  9928. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  9929. type NoMethod ReportSchedule
  9930. raw := NoMethod(*s)
  9931. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9932. }
  9933. // ReportCompatibleFields: Represents fields that are compatible to be
  9934. // selected for a report of type "STANDARD".
  9935. type ReportCompatibleFields struct {
  9936. // DimensionFilters: Dimensions which are compatible to be selected in
  9937. // the "dimensionFilters" section of the report.
  9938. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9939. // Dimensions: Dimensions which are compatible to be selected in the
  9940. // "dimensions" section of the report.
  9941. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9942. // Kind: The kind of resource this is, in this case
  9943. // dfareporting#reportCompatibleFields.
  9944. Kind string `json:"kind,omitempty"`
  9945. // Metrics: Metrics which are compatible to be selected in the
  9946. // "metricNames" section of the report.
  9947. Metrics []*Metric `json:"metrics,omitempty"`
  9948. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9949. // as activity metrics to pivot on in the "activities" section of the
  9950. // report.
  9951. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9952. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9953. // unconditionally include in API requests. By default, fields with
  9954. // empty values are omitted from API requests. However, any non-pointer,
  9955. // non-interface field appearing in ForceSendFields will be sent to the
  9956. // server regardless of whether the field is empty or not. This may be
  9957. // used to include empty fields in Patch requests.
  9958. ForceSendFields []string `json:"-"`
  9959. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9960. // include in API requests with the JSON null value. By default, fields
  9961. // with empty values are omitted from API requests. However, any field
  9962. // with an empty value appearing in NullFields will be sent to the
  9963. // server as null. It is an error if a field in this list has a
  9964. // non-empty value. This may be used to include null fields in Patch
  9965. // requests.
  9966. NullFields []string `json:"-"`
  9967. }
  9968. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9969. type NoMethod ReportCompatibleFields
  9970. raw := NoMethod(*s)
  9971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9972. }
  9973. // ReportList: Represents the list of reports.
  9974. type ReportList struct {
  9975. // Etag: The eTag of this response for caching purposes.
  9976. Etag string `json:"etag,omitempty"`
  9977. // Items: The reports returned in this response.
  9978. Items []*Report `json:"items,omitempty"`
  9979. // Kind: The kind of list this is, in this case dfareporting#reportList.
  9980. Kind string `json:"kind,omitempty"`
  9981. // NextPageToken: Continuation token used to page through reports. To
  9982. // retrieve the next page of results, set the next request's "pageToken"
  9983. // to the value of this field. The page token is only valid for a
  9984. // limited amount of time and should not be persisted.
  9985. NextPageToken string `json:"nextPageToken,omitempty"`
  9986. // ServerResponse contains the HTTP response code and headers from the
  9987. // server.
  9988. googleapi.ServerResponse `json:"-"`
  9989. // ForceSendFields is a list of field names (e.g. "Etag") to
  9990. // unconditionally include in API requests. By default, fields with
  9991. // empty values are omitted from API requests. However, any non-pointer,
  9992. // non-interface field appearing in ForceSendFields will be sent to the
  9993. // server regardless of whether the field is empty or not. This may be
  9994. // used to include empty fields in Patch requests.
  9995. ForceSendFields []string `json:"-"`
  9996. // NullFields is a list of field names (e.g. "Etag") to include in API
  9997. // requests with the JSON null value. By default, fields with empty
  9998. // values are omitted from API requests. However, any field with an
  9999. // empty value appearing in NullFields will be sent to the server as
  10000. // null. It is an error if a field in this list has a non-empty value.
  10001. // This may be used to include null fields in Patch requests.
  10002. NullFields []string `json:"-"`
  10003. }
  10004. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10005. type NoMethod ReportList
  10006. raw := NoMethod(*s)
  10007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10008. }
  10009. // ReportsConfiguration: Reporting Configuration
  10010. type ReportsConfiguration struct {
  10011. // ExposureToConversionEnabled: Whether the exposure to conversion
  10012. // report is enabled. This report shows detailed pathway information on
  10013. // up to 10 of the most recent ad exposures seen by a user before
  10014. // converting.
  10015. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10016. // LookbackConfiguration: Default lookback windows for new advertisers
  10017. // in this account.
  10018. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10019. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10020. // account. This is a required field that can only be changed by a
  10021. // superuser.
  10022. // Acceptable values are:
  10023. //
  10024. // - "1" for "America/New_York"
  10025. // - "2" for "Europe/London"
  10026. // - "3" for "Europe/Paris"
  10027. // - "4" for "Africa/Johannesburg"
  10028. // - "5" for "Asia/Jerusalem"
  10029. // - "6" for "Asia/Shanghai"
  10030. // - "7" for "Asia/Hong_Kong"
  10031. // - "8" for "Asia/Tokyo"
  10032. // - "9" for "Australia/Sydney"
  10033. // - "10" for "Asia/Dubai"
  10034. // - "11" for "America/Los_Angeles"
  10035. // - "12" for "Pacific/Auckland"
  10036. // - "13" for "America/Sao_Paulo"
  10037. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10038. // ForceSendFields is a list of field names (e.g.
  10039. // "ExposureToConversionEnabled") to unconditionally include in API
  10040. // requests. By default, fields with empty values are omitted from API
  10041. // requests. However, any non-pointer, non-interface field appearing in
  10042. // ForceSendFields will be sent to the server regardless of whether the
  10043. // field is empty or not. This may be used to include empty fields in
  10044. // Patch requests.
  10045. ForceSendFields []string `json:"-"`
  10046. // NullFields is a list of field names (e.g.
  10047. // "ExposureToConversionEnabled") to include in API requests with the
  10048. // JSON null value. By default, fields with empty values are omitted
  10049. // from API requests. However, any field with an empty value appearing
  10050. // in NullFields will be sent to the server as null. It is an error if a
  10051. // field in this list has a non-empty value. This may be used to include
  10052. // null fields in Patch requests.
  10053. NullFields []string `json:"-"`
  10054. }
  10055. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10056. type NoMethod ReportsConfiguration
  10057. raw := NoMethod(*s)
  10058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10059. }
  10060. // RichMediaExitOverride: Rich Media Exit Override.
  10061. type RichMediaExitOverride struct {
  10062. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10063. // Applicable if the enabled field is set to true.
  10064. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10065. // Enabled: Whether to use the clickThroughUrl. If false, the
  10066. // creative-level exit will be used.
  10067. Enabled bool `json:"enabled,omitempty"`
  10068. // ExitId: ID for the override to refer to a specific exit in the
  10069. // creative.
  10070. ExitId int64 `json:"exitId,omitempty,string"`
  10071. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10072. // unconditionally include in API requests. By default, fields with
  10073. // empty values are omitted from API requests. However, any non-pointer,
  10074. // non-interface field appearing in ForceSendFields will be sent to the
  10075. // server regardless of whether the field is empty or not. This may be
  10076. // used to include empty fields in Patch requests.
  10077. ForceSendFields []string `json:"-"`
  10078. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10079. // include in API requests with the JSON null value. By default, fields
  10080. // with empty values are omitted from API requests. However, any field
  10081. // with an empty value appearing in NullFields will be sent to the
  10082. // server as null. It is an error if a field in this list has a
  10083. // non-empty value. This may be used to include null fields in Patch
  10084. // requests.
  10085. NullFields []string `json:"-"`
  10086. }
  10087. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10088. type NoMethod RichMediaExitOverride
  10089. raw := NoMethod(*s)
  10090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10091. }
  10092. // Rule: A rule associates an asset with a targeting template for
  10093. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10094. type Rule struct {
  10095. // AssetId: A creativeAssets[].id. This should refer to one of the
  10096. // parent assets in this creative. This is a required field.
  10097. AssetId int64 `json:"assetId,omitempty,string"`
  10098. // Name: A user-friendly name for this rule. This is a required field.
  10099. Name string `json:"name,omitempty"`
  10100. // TargetingTemplateId: A targeting template ID. The targeting from the
  10101. // targeting template will be used to determine whether this asset
  10102. // should be served. This is a required field.
  10103. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10104. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10105. // unconditionally include in API requests. By default, fields with
  10106. // empty values are omitted from API requests. However, any non-pointer,
  10107. // non-interface field appearing in ForceSendFields will be sent to the
  10108. // server regardless of whether the field is empty or not. This may be
  10109. // used to include empty fields in Patch requests.
  10110. ForceSendFields []string `json:"-"`
  10111. // NullFields is a list of field names (e.g. "AssetId") to include in
  10112. // API requests with the JSON null value. By default, fields with empty
  10113. // values are omitted from API requests. However, any field with an
  10114. // empty value appearing in NullFields will be sent to the server as
  10115. // null. It is an error if a field in this list has a non-empty value.
  10116. // This may be used to include null fields in Patch requests.
  10117. NullFields []string `json:"-"`
  10118. }
  10119. func (s *Rule) MarshalJSON() ([]byte, error) {
  10120. type NoMethod Rule
  10121. raw := NoMethod(*s)
  10122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10123. }
  10124. // Site: Contains properties of a site.
  10125. type Site struct {
  10126. // AccountId: Account ID of this site. This is a read-only field that
  10127. // can be left blank.
  10128. AccountId int64 `json:"accountId,omitempty,string"`
  10129. // Approved: Whether this site is approved.
  10130. Approved bool `json:"approved,omitempty"`
  10131. // DirectorySiteId: Directory site associated with this site. This is a
  10132. // required field that is read-only after insertion.
  10133. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10134. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10135. // directory site. This is a read-only, auto-generated field.
  10136. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10137. // Id: ID of this site. This is a read-only, auto-generated field.
  10138. Id int64 `json:"id,omitempty,string"`
  10139. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10140. // read-only, auto-generated field.
  10141. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10142. // KeyName: Key name of this site. This is a read-only, auto-generated
  10143. // field.
  10144. KeyName string `json:"keyName,omitempty"`
  10145. // Kind: Identifies what kind of resource this is. Value: the fixed
  10146. // string "dfareporting#site".
  10147. Kind string `json:"kind,omitempty"`
  10148. // Name: Name of this site.This is a required field. Must be less than
  10149. // 128 characters long. If this site is under a subaccount, the name
  10150. // must be unique among sites of the same subaccount. Otherwise, this
  10151. // site is a top-level site, and the name must be unique among top-level
  10152. // sites of the same account.
  10153. Name string `json:"name,omitempty"`
  10154. // SiteContacts: Site contacts.
  10155. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10156. // SiteSettings: Site-wide settings.
  10157. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10158. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10159. // that can be left blank.
  10160. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10161. // ServerResponse contains the HTTP response code and headers from the
  10162. // server.
  10163. googleapi.ServerResponse `json:"-"`
  10164. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10165. // unconditionally include in API requests. By default, fields with
  10166. // empty values are omitted from API requests. However, any non-pointer,
  10167. // non-interface field appearing in ForceSendFields will be sent to the
  10168. // server regardless of whether the field is empty or not. This may be
  10169. // used to include empty fields in Patch requests.
  10170. ForceSendFields []string `json:"-"`
  10171. // NullFields is a list of field names (e.g. "AccountId") to include in
  10172. // API requests with the JSON null value. By default, fields with empty
  10173. // values are omitted from API requests. However, any field with an
  10174. // empty value appearing in NullFields will be sent to the server as
  10175. // null. It is an error if a field in this list has a non-empty value.
  10176. // This may be used to include null fields in Patch requests.
  10177. NullFields []string `json:"-"`
  10178. }
  10179. func (s *Site) MarshalJSON() ([]byte, error) {
  10180. type NoMethod Site
  10181. raw := NoMethod(*s)
  10182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10183. }
  10184. // SiteContact: Site Contact
  10185. type SiteContact struct {
  10186. // Address: Address of this site contact.
  10187. Address string `json:"address,omitempty"`
  10188. // ContactType: Site contact type.
  10189. //
  10190. // Possible values:
  10191. // "SALES_PERSON"
  10192. // "TRAFFICKER"
  10193. ContactType string `json:"contactType,omitempty"`
  10194. // Email: Email address of this site contact. This is a required field.
  10195. Email string `json:"email,omitempty"`
  10196. // FirstName: First name of this site contact.
  10197. FirstName string `json:"firstName,omitempty"`
  10198. // Id: ID of this site contact. This is a read-only, auto-generated
  10199. // field.
  10200. Id int64 `json:"id,omitempty,string"`
  10201. // LastName: Last name of this site contact.
  10202. LastName string `json:"lastName,omitempty"`
  10203. // Phone: Primary phone number of this site contact.
  10204. Phone string `json:"phone,omitempty"`
  10205. // Title: Title or designation of this site contact.
  10206. Title string `json:"title,omitempty"`
  10207. // ForceSendFields is a list of field names (e.g. "Address") to
  10208. // unconditionally include in API requests. By default, fields with
  10209. // empty values are omitted from API requests. However, any non-pointer,
  10210. // non-interface field appearing in ForceSendFields will be sent to the
  10211. // server regardless of whether the field is empty or not. This may be
  10212. // used to include empty fields in Patch requests.
  10213. ForceSendFields []string `json:"-"`
  10214. // NullFields is a list of field names (e.g. "Address") to include in
  10215. // API requests with the JSON null value. By default, fields with empty
  10216. // values are omitted from API requests. However, any field with an
  10217. // empty value appearing in NullFields will be sent to the server as
  10218. // null. It is an error if a field in this list has a non-empty value.
  10219. // This may be used to include null fields in Patch requests.
  10220. NullFields []string `json:"-"`
  10221. }
  10222. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10223. type NoMethod SiteContact
  10224. raw := NoMethod(*s)
  10225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10226. }
  10227. // SiteSettings: Site Settings
  10228. type SiteSettings struct {
  10229. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10230. // site.
  10231. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10232. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10233. // true, ad blocking is disabled for all placements under the site,
  10234. // regardless of the individual placement settings. When false, the
  10235. // campaign and placement settings take effect.
  10236. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10237. // CreativeSettings: Site-wide creative settings.
  10238. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10239. // DisableNewCookie: Whether new cookies are disabled for this site.
  10240. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10241. // LookbackConfiguration: Lookback window settings for this site.
  10242. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10243. // TagSetting: Configuration settings for dynamic and image floodlight
  10244. // tags.
  10245. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10246. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10247. // for in-stream video creatives are disabled by default for new
  10248. // placements created under this site. This value will be used to
  10249. // populate the placement.videoActiveViewOptOut field, when no value is
  10250. // specified for the new placement.
  10251. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10252. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10253. // placements created under this site. This value will be used to
  10254. // populate the placements.vpaidAdapterChoice field, when no value is
  10255. // specified for the new placement. Controls which VPAID format the
  10256. // measurement adapter will use for in-stream video creatives assigned
  10257. // to the placement. The publisher's specifications will typically
  10258. // determine this setting. For VPAID creatives, the adapter format will
  10259. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10260. // adapter).
  10261. //
  10262. // Note: Flash is no longer supported. This field now defaults to HTML5
  10263. // when the following values are provided: FLASH, BOTH.
  10264. //
  10265. // Possible values:
  10266. // "BOTH"
  10267. // "DEFAULT"
  10268. // "FLASH"
  10269. // "HTML5"
  10270. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10271. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10272. // unconditionally include in API requests. By default, fields with
  10273. // empty values are omitted from API requests. However, any non-pointer,
  10274. // non-interface field appearing in ForceSendFields will be sent to the
  10275. // server regardless of whether the field is empty or not. This may be
  10276. // used to include empty fields in Patch requests.
  10277. ForceSendFields []string `json:"-"`
  10278. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10279. // include in API requests with the JSON null value. By default, fields
  10280. // with empty values are omitted from API requests. However, any field
  10281. // with an empty value appearing in NullFields will be sent to the
  10282. // server as null. It is an error if a field in this list has a
  10283. // non-empty value. This may be used to include null fields in Patch
  10284. // requests.
  10285. NullFields []string `json:"-"`
  10286. }
  10287. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10288. type NoMethod SiteSettings
  10289. raw := NoMethod(*s)
  10290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10291. }
  10292. // SitesListResponse: Site List Response
  10293. type SitesListResponse struct {
  10294. // Kind: Identifies what kind of resource this is. Value: the fixed
  10295. // string "dfareporting#sitesListResponse".
  10296. Kind string `json:"kind,omitempty"`
  10297. // NextPageToken: Pagination token to be used for the next list
  10298. // operation.
  10299. NextPageToken string `json:"nextPageToken,omitempty"`
  10300. // Sites: Site collection.
  10301. Sites []*Site `json:"sites,omitempty"`
  10302. // ServerResponse contains the HTTP response code and headers from the
  10303. // server.
  10304. googleapi.ServerResponse `json:"-"`
  10305. // ForceSendFields is a list of field names (e.g. "Kind") to
  10306. // unconditionally include in API requests. By default, fields with
  10307. // empty values are omitted from API requests. However, any non-pointer,
  10308. // non-interface field appearing in ForceSendFields will be sent to the
  10309. // server regardless of whether the field is empty or not. This may be
  10310. // used to include empty fields in Patch requests.
  10311. ForceSendFields []string `json:"-"`
  10312. // NullFields is a list of field names (e.g. "Kind") to include in API
  10313. // requests with the JSON null value. By default, fields with empty
  10314. // values are omitted from API requests. However, any field with an
  10315. // empty value appearing in NullFields will be sent to the server as
  10316. // null. It is an error if a field in this list has a non-empty value.
  10317. // This may be used to include null fields in Patch requests.
  10318. NullFields []string `json:"-"`
  10319. }
  10320. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10321. type NoMethod SitesListResponse
  10322. raw := NoMethod(*s)
  10323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10324. }
  10325. // Size: Represents the dimensions of ads, placements, creatives, or
  10326. // creative assets.
  10327. type Size struct {
  10328. // Height: Height of this size. Acceptable values are 0 to 32767,
  10329. // inclusive.
  10330. Height int64 `json:"height,omitempty"`
  10331. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10332. Iab bool `json:"iab,omitempty"`
  10333. // Id: ID of this size. This is a read-only, auto-generated field.
  10334. Id int64 `json:"id,omitempty,string"`
  10335. // Kind: Identifies what kind of resource this is. Value: the fixed
  10336. // string "dfareporting#size".
  10337. Kind string `json:"kind,omitempty"`
  10338. // Width: Width of this size. Acceptable values are 0 to 32767,
  10339. // inclusive.
  10340. Width int64 `json:"width,omitempty"`
  10341. // ServerResponse contains the HTTP response code and headers from the
  10342. // server.
  10343. googleapi.ServerResponse `json:"-"`
  10344. // ForceSendFields is a list of field names (e.g. "Height") to
  10345. // unconditionally include in API requests. By default, fields with
  10346. // empty values are omitted from API requests. However, any non-pointer,
  10347. // non-interface field appearing in ForceSendFields will be sent to the
  10348. // server regardless of whether the field is empty or not. This may be
  10349. // used to include empty fields in Patch requests.
  10350. ForceSendFields []string `json:"-"`
  10351. // NullFields is a list of field names (e.g. "Height") to include in API
  10352. // requests with the JSON null value. By default, fields with empty
  10353. // values are omitted from API requests. However, any field with an
  10354. // empty value appearing in NullFields will be sent to the server as
  10355. // null. It is an error if a field in this list has a non-empty value.
  10356. // This may be used to include null fields in Patch requests.
  10357. NullFields []string `json:"-"`
  10358. }
  10359. func (s *Size) MarshalJSON() ([]byte, error) {
  10360. type NoMethod Size
  10361. raw := NoMethod(*s)
  10362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10363. }
  10364. // SizesListResponse: Size List Response
  10365. type SizesListResponse struct {
  10366. // Kind: Identifies what kind of resource this is. Value: the fixed
  10367. // string "dfareporting#sizesListResponse".
  10368. Kind string `json:"kind,omitempty"`
  10369. // Sizes: Size collection.
  10370. Sizes []*Size `json:"sizes,omitempty"`
  10371. // ServerResponse contains the HTTP response code and headers from the
  10372. // server.
  10373. googleapi.ServerResponse `json:"-"`
  10374. // ForceSendFields is a list of field names (e.g. "Kind") to
  10375. // unconditionally include in API requests. By default, fields with
  10376. // empty values are omitted from API requests. However, any non-pointer,
  10377. // non-interface field appearing in ForceSendFields will be sent to the
  10378. // server regardless of whether the field is empty or not. This may be
  10379. // used to include empty fields in Patch requests.
  10380. ForceSendFields []string `json:"-"`
  10381. // NullFields is a list of field names (e.g. "Kind") to include in API
  10382. // requests with the JSON null value. By default, fields with empty
  10383. // values are omitted from API requests. However, any field with an
  10384. // empty value appearing in NullFields will be sent to the server as
  10385. // null. It is an error if a field in this list has a non-empty value.
  10386. // This may be used to include null fields in Patch requests.
  10387. NullFields []string `json:"-"`
  10388. }
  10389. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10390. type NoMethod SizesListResponse
  10391. raw := NoMethod(*s)
  10392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10393. }
  10394. // SkippableSetting: Skippable Settings
  10395. type SkippableSetting struct {
  10396. // Kind: Identifies what kind of resource this is. Value: the fixed
  10397. // string "dfareporting#skippableSetting".
  10398. Kind string `json:"kind,omitempty"`
  10399. // ProgressOffset: Amount of time to play videos served to this
  10400. // placement before counting a view. Applicable when skippable is true.
  10401. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10402. // SkipOffset: Amount of time to play videos served to this placement
  10403. // before the skip button should appear. Applicable when skippable is
  10404. // true.
  10405. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10406. // Skippable: Whether the user can skip creatives served to this
  10407. // placement.
  10408. Skippable bool `json:"skippable,omitempty"`
  10409. // ForceSendFields is a list of field names (e.g. "Kind") to
  10410. // unconditionally include in API requests. By default, fields with
  10411. // empty values are omitted from API requests. However, any non-pointer,
  10412. // non-interface field appearing in ForceSendFields will be sent to the
  10413. // server regardless of whether the field is empty or not. This may be
  10414. // used to include empty fields in Patch requests.
  10415. ForceSendFields []string `json:"-"`
  10416. // NullFields is a list of field names (e.g. "Kind") to include in API
  10417. // requests with the JSON null value. By default, fields with empty
  10418. // values are omitted from API requests. However, any field with an
  10419. // empty value appearing in NullFields will be sent to the server as
  10420. // null. It is an error if a field in this list has a non-empty value.
  10421. // This may be used to include null fields in Patch requests.
  10422. NullFields []string `json:"-"`
  10423. }
  10424. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10425. type NoMethod SkippableSetting
  10426. raw := NoMethod(*s)
  10427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10428. }
  10429. // SortedDimension: Represents a sorted dimension.
  10430. type SortedDimension struct {
  10431. // Kind: The kind of resource this is, in this case
  10432. // dfareporting#sortedDimension.
  10433. Kind string `json:"kind,omitempty"`
  10434. // Name: The name of the dimension.
  10435. Name string `json:"name,omitempty"`
  10436. // SortOrder: An optional sort order for the dimension column.
  10437. //
  10438. // Possible values:
  10439. // "ASCENDING"
  10440. // "DESCENDING"
  10441. SortOrder string `json:"sortOrder,omitempty"`
  10442. // ForceSendFields is a list of field names (e.g. "Kind") to
  10443. // unconditionally include in API requests. By default, fields with
  10444. // empty values are omitted from API requests. However, any non-pointer,
  10445. // non-interface field appearing in ForceSendFields will be sent to the
  10446. // server regardless of whether the field is empty or not. This may be
  10447. // used to include empty fields in Patch requests.
  10448. ForceSendFields []string `json:"-"`
  10449. // NullFields is a list of field names (e.g. "Kind") to include in API
  10450. // requests with the JSON null value. By default, fields with empty
  10451. // values are omitted from API requests. However, any field with an
  10452. // empty value appearing in NullFields will be sent to the server as
  10453. // null. It is an error if a field in this list has a non-empty value.
  10454. // This may be used to include null fields in Patch requests.
  10455. NullFields []string `json:"-"`
  10456. }
  10457. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10458. type NoMethod SortedDimension
  10459. raw := NoMethod(*s)
  10460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10461. }
  10462. // Subaccount: Contains properties of a Campaign Manager subaccount.
  10463. type Subaccount struct {
  10464. // AccountId: ID of the account that contains this subaccount. This is a
  10465. // read-only field that can be left blank.
  10466. AccountId int64 `json:"accountId,omitempty,string"`
  10467. // AvailablePermissionIds: IDs of the available user role permissions
  10468. // for this subaccount.
  10469. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10470. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10471. Id int64 `json:"id,omitempty,string"`
  10472. // Kind: Identifies what kind of resource this is. Value: the fixed
  10473. // string "dfareporting#subaccount".
  10474. Kind string `json:"kind,omitempty"`
  10475. // Name: Name of this subaccount. This is a required field. Must be less
  10476. // than 128 characters long and be unique among subaccounts of the same
  10477. // account.
  10478. Name string `json:"name,omitempty"`
  10479. // ServerResponse contains the HTTP response code and headers from the
  10480. // server.
  10481. googleapi.ServerResponse `json:"-"`
  10482. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10483. // unconditionally include in API requests. By default, fields with
  10484. // empty values are omitted from API requests. However, any non-pointer,
  10485. // non-interface field appearing in ForceSendFields will be sent to the
  10486. // server regardless of whether the field is empty or not. This may be
  10487. // used to include empty fields in Patch requests.
  10488. ForceSendFields []string `json:"-"`
  10489. // NullFields is a list of field names (e.g. "AccountId") to include in
  10490. // API requests with the JSON null value. By default, fields with empty
  10491. // values are omitted from API requests. However, any field with an
  10492. // empty value appearing in NullFields will be sent to the server as
  10493. // null. It is an error if a field in this list has a non-empty value.
  10494. // This may be used to include null fields in Patch requests.
  10495. NullFields []string `json:"-"`
  10496. }
  10497. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10498. type NoMethod Subaccount
  10499. raw := NoMethod(*s)
  10500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10501. }
  10502. // SubaccountsListResponse: Subaccount List Response
  10503. type SubaccountsListResponse struct {
  10504. // Kind: Identifies what kind of resource this is. Value: the fixed
  10505. // string "dfareporting#subaccountsListResponse".
  10506. Kind string `json:"kind,omitempty"`
  10507. // NextPageToken: Pagination token to be used for the next list
  10508. // operation.
  10509. NextPageToken string `json:"nextPageToken,omitempty"`
  10510. // Subaccounts: Subaccount collection.
  10511. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10512. // ServerResponse contains the HTTP response code and headers from the
  10513. // server.
  10514. googleapi.ServerResponse `json:"-"`
  10515. // ForceSendFields is a list of field names (e.g. "Kind") to
  10516. // unconditionally include in API requests. By default, fields with
  10517. // empty values are omitted from API requests. However, any non-pointer,
  10518. // non-interface field appearing in ForceSendFields will be sent to the
  10519. // server regardless of whether the field is empty or not. This may be
  10520. // used to include empty fields in Patch requests.
  10521. ForceSendFields []string `json:"-"`
  10522. // NullFields is a list of field names (e.g. "Kind") to include in API
  10523. // requests with the JSON null value. By default, fields with empty
  10524. // values are omitted from API requests. However, any field with an
  10525. // empty value appearing in NullFields will be sent to the server as
  10526. // null. It is an error if a field in this list has a non-empty value.
  10527. // This may be used to include null fields in Patch requests.
  10528. NullFields []string `json:"-"`
  10529. }
  10530. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10531. type NoMethod SubaccountsListResponse
  10532. raw := NoMethod(*s)
  10533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10534. }
  10535. // TagData: Placement Tag Data
  10536. type TagData struct {
  10537. // AdId: Ad associated with this placement tag. Applicable only when
  10538. // format is PLACEMENT_TAG_TRACKING.
  10539. AdId int64 `json:"adId,omitempty,string"`
  10540. // ClickTag: Tag string to record a click.
  10541. ClickTag string `json:"clickTag,omitempty"`
  10542. // CreativeId: Creative associated with this placement tag. Applicable
  10543. // only when format is PLACEMENT_TAG_TRACKING.
  10544. CreativeId int64 `json:"creativeId,omitempty,string"`
  10545. // Format: TagData tag format of this tag.
  10546. //
  10547. // Possible values:
  10548. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10549. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10550. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10551. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10552. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10553. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10554. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10555. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10556. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10557. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10558. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10559. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10560. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10561. // "PLACEMENT_TAG_JAVASCRIPT"
  10562. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10563. // "PLACEMENT_TAG_STANDARD"
  10564. // "PLACEMENT_TAG_TRACKING"
  10565. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10566. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10567. Format string `json:"format,omitempty"`
  10568. // ImpressionTag: Tag string for serving an ad.
  10569. ImpressionTag string `json:"impressionTag,omitempty"`
  10570. // ForceSendFields is a list of field names (e.g. "AdId") to
  10571. // unconditionally include in API requests. By default, fields with
  10572. // empty values are omitted from API requests. However, any non-pointer,
  10573. // non-interface field appearing in ForceSendFields will be sent to the
  10574. // server regardless of whether the field is empty or not. This may be
  10575. // used to include empty fields in Patch requests.
  10576. ForceSendFields []string `json:"-"`
  10577. // NullFields is a list of field names (e.g. "AdId") to include in API
  10578. // requests with the JSON null value. By default, fields with empty
  10579. // values are omitted from API requests. However, any field with an
  10580. // empty value appearing in NullFields will be sent to the server as
  10581. // null. It is an error if a field in this list has a non-empty value.
  10582. // This may be used to include null fields in Patch requests.
  10583. NullFields []string `json:"-"`
  10584. }
  10585. func (s *TagData) MarshalJSON() ([]byte, error) {
  10586. type NoMethod TagData
  10587. raw := NoMethod(*s)
  10588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10589. }
  10590. // TagSetting: Tag Settings
  10591. type TagSetting struct {
  10592. // AdditionalKeyValues: Additional key-values to be included in tags.
  10593. // Each key-value pair must be of the form key=value, and pairs must be
  10594. // separated by a semicolon (;). Keys and values must not contain
  10595. // commas. For example, id=2;color=red is a valid value for this field.
  10596. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10597. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10598. // included in the tags. This setting applies only to placements.
  10599. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10600. // IncludeClickTracking: Whether click-tracking string should be
  10601. // included in the tags.
  10602. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10603. // KeywordOption: Option specifying how keywords are embedded in ad
  10604. // tags. This setting can be used to specify whether keyword
  10605. // placeholders are inserted in placement tags for this site. Publishers
  10606. // can then add keywords to those placeholders.
  10607. //
  10608. // Possible values:
  10609. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10610. // "IGNORE"
  10611. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10612. KeywordOption string `json:"keywordOption,omitempty"`
  10613. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10614. // to unconditionally include in API requests. By default, fields with
  10615. // empty values are omitted from API requests. However, any non-pointer,
  10616. // non-interface field appearing in ForceSendFields will be sent to the
  10617. // server regardless of whether the field is empty or not. This may be
  10618. // used to include empty fields in Patch requests.
  10619. ForceSendFields []string `json:"-"`
  10620. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10621. // include in API requests with the JSON null value. By default, fields
  10622. // with empty values are omitted from API requests. However, any field
  10623. // with an empty value appearing in NullFields will be sent to the
  10624. // server as null. It is an error if a field in this list has a
  10625. // non-empty value. This may be used to include null fields in Patch
  10626. // requests.
  10627. NullFields []string `json:"-"`
  10628. }
  10629. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10630. type NoMethod TagSetting
  10631. raw := NoMethod(*s)
  10632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10633. }
  10634. // TagSettings: Dynamic and Image Tag Settings.
  10635. type TagSettings struct {
  10636. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10637. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10638. // ImageTagEnabled: Whether image tags are enabled.
  10639. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10640. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10641. // to unconditionally include in API requests. By default, fields with
  10642. // empty values are omitted from API requests. However, any non-pointer,
  10643. // non-interface field appearing in ForceSendFields will be sent to the
  10644. // server regardless of whether the field is empty or not. This may be
  10645. // used to include empty fields in Patch requests.
  10646. ForceSendFields []string `json:"-"`
  10647. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10648. // include in API requests with the JSON null value. By default, fields
  10649. // with empty values are omitted from API requests. However, any field
  10650. // with an empty value appearing in NullFields will be sent to the
  10651. // server as null. It is an error if a field in this list has a
  10652. // non-empty value. This may be used to include null fields in Patch
  10653. // requests.
  10654. NullFields []string `json:"-"`
  10655. }
  10656. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10657. type NoMethod TagSettings
  10658. raw := NoMethod(*s)
  10659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10660. }
  10661. // TargetWindow: Target Window.
  10662. type TargetWindow struct {
  10663. // CustomHtml: User-entered value.
  10664. CustomHtml string `json:"customHtml,omitempty"`
  10665. // TargetWindowOption: Type of browser window for which the backup image
  10666. // of the flash creative can be displayed.
  10667. //
  10668. // Possible values:
  10669. // "CURRENT_WINDOW"
  10670. // "CUSTOM"
  10671. // "NEW_WINDOW"
  10672. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10673. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10674. // unconditionally include in API requests. By default, fields with
  10675. // empty values are omitted from API requests. However, any non-pointer,
  10676. // non-interface field appearing in ForceSendFields will be sent to the
  10677. // server regardless of whether the field is empty or not. This may be
  10678. // used to include empty fields in Patch requests.
  10679. ForceSendFields []string `json:"-"`
  10680. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10681. // API requests with the JSON null value. By default, fields with empty
  10682. // values are omitted from API requests. However, any field with an
  10683. // empty value appearing in NullFields will be sent to the server as
  10684. // null. It is an error if a field in this list has a non-empty value.
  10685. // This may be used to include null fields in Patch requests.
  10686. NullFields []string `json:"-"`
  10687. }
  10688. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10689. type NoMethod TargetWindow
  10690. raw := NoMethod(*s)
  10691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10692. }
  10693. // TargetableRemarketingList: Contains properties of a targetable
  10694. // remarketing list. Remarketing enables you to create lists of users
  10695. // who have performed specific actions on a site, then target ads to
  10696. // members of those lists. This resource is a read-only view of a
  10697. // remarketing list to be used to faciliate targeting ads to specific
  10698. // lists. Remarketing lists that are owned by your advertisers and those
  10699. // that are shared to your advertisers or account are accessible via
  10700. // this resource. To manage remarketing lists that are owned by your
  10701. // advertisers, use the RemarketingLists resource.
  10702. type TargetableRemarketingList struct {
  10703. // AccountId: Account ID of this remarketing list. This is a read-only,
  10704. // auto-generated field that is only returned in GET requests.
  10705. AccountId int64 `json:"accountId,omitempty,string"`
  10706. // Active: Whether this targetable remarketing list is active.
  10707. Active bool `json:"active,omitempty"`
  10708. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10709. // targetable remarketing list.
  10710. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10711. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10712. // advertiser.
  10713. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10714. // Description: Targetable remarketing list description.
  10715. Description string `json:"description,omitempty"`
  10716. // Id: Targetable remarketing list ID.
  10717. Id int64 `json:"id,omitempty,string"`
  10718. // Kind: Identifies what kind of resource this is. Value: the fixed
  10719. // string "dfareporting#targetableRemarketingList".
  10720. Kind string `json:"kind,omitempty"`
  10721. // LifeSpan: Number of days that a user should remain in the targetable
  10722. // remarketing list without an impression.
  10723. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10724. // ListSize: Number of users currently in the list. This is a read-only
  10725. // field.
  10726. ListSize int64 `json:"listSize,omitempty,string"`
  10727. // ListSource: Product from which this targetable remarketing list was
  10728. // originated.
  10729. //
  10730. // Possible values:
  10731. // "REMARKETING_LIST_SOURCE_ADX"
  10732. // "REMARKETING_LIST_SOURCE_DBM"
  10733. // "REMARKETING_LIST_SOURCE_DFA"
  10734. // "REMARKETING_LIST_SOURCE_DFP"
  10735. // "REMARKETING_LIST_SOURCE_DMP"
  10736. // "REMARKETING_LIST_SOURCE_GA"
  10737. // "REMARKETING_LIST_SOURCE_GPLUS"
  10738. // "REMARKETING_LIST_SOURCE_OTHER"
  10739. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10740. // "REMARKETING_LIST_SOURCE_XFP"
  10741. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10742. ListSource string `json:"listSource,omitempty"`
  10743. // Name: Name of the targetable remarketing list. Is no greater than 128
  10744. // characters long.
  10745. Name string `json:"name,omitempty"`
  10746. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10747. // read-only, auto-generated field that is only returned in GET
  10748. // requests.
  10749. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10750. // ServerResponse contains the HTTP response code and headers from the
  10751. // server.
  10752. googleapi.ServerResponse `json:"-"`
  10753. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10754. // unconditionally include in API requests. By default, fields with
  10755. // empty values are omitted from API requests. However, any non-pointer,
  10756. // non-interface field appearing in ForceSendFields will be sent to the
  10757. // server regardless of whether the field is empty or not. This may be
  10758. // used to include empty fields in Patch requests.
  10759. ForceSendFields []string `json:"-"`
  10760. // NullFields is a list of field names (e.g. "AccountId") to include in
  10761. // API requests with the JSON null value. By default, fields with empty
  10762. // values are omitted from API requests. However, any field with an
  10763. // empty value appearing in NullFields will be sent to the server as
  10764. // null. It is an error if a field in this list has a non-empty value.
  10765. // This may be used to include null fields in Patch requests.
  10766. NullFields []string `json:"-"`
  10767. }
  10768. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10769. type NoMethod TargetableRemarketingList
  10770. raw := NoMethod(*s)
  10771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10772. }
  10773. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10774. // response
  10775. type TargetableRemarketingListsListResponse struct {
  10776. // Kind: Identifies what kind of resource this is. Value: the fixed
  10777. // string "dfareporting#targetableRemarketingListsListResponse".
  10778. Kind string `json:"kind,omitempty"`
  10779. // NextPageToken: Pagination token to be used for the next list
  10780. // operation.
  10781. NextPageToken string `json:"nextPageToken,omitempty"`
  10782. // TargetableRemarketingLists: Targetable remarketing list collection.
  10783. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10784. // ServerResponse contains the HTTP response code and headers from the
  10785. // server.
  10786. googleapi.ServerResponse `json:"-"`
  10787. // ForceSendFields is a list of field names (e.g. "Kind") to
  10788. // unconditionally include in API requests. By default, fields with
  10789. // empty values are omitted from API requests. However, any non-pointer,
  10790. // non-interface field appearing in ForceSendFields will be sent to the
  10791. // server regardless of whether the field is empty or not. This may be
  10792. // used to include empty fields in Patch requests.
  10793. ForceSendFields []string `json:"-"`
  10794. // NullFields is a list of field names (e.g. "Kind") to include in API
  10795. // requests with the JSON null value. By default, fields with empty
  10796. // values are omitted from API requests. However, any field with an
  10797. // empty value appearing in NullFields will be sent to the server as
  10798. // null. It is an error if a field in this list has a non-empty value.
  10799. // This may be used to include null fields in Patch requests.
  10800. NullFields []string `json:"-"`
  10801. }
  10802. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10803. type NoMethod TargetableRemarketingListsListResponse
  10804. raw := NoMethod(*s)
  10805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10806. }
  10807. // TargetingTemplate: Contains properties of a targeting template. A
  10808. // targeting template encapsulates targeting information which can be
  10809. // reused across multiple ads.
  10810. type TargetingTemplate struct {
  10811. // AccountId: Account ID of this targeting template. This field, if left
  10812. // unset, will be auto-generated on insert and is read-only after
  10813. // insert.
  10814. AccountId int64 `json:"accountId,omitempty,string"`
  10815. // AdvertiserId: Advertiser ID of this targeting template. This is a
  10816. // required field on insert and is read-only after insert.
  10817. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10818. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10819. // advertiser. This is a read-only, auto-generated field.
  10820. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10821. // DayPartTargeting: Time and day targeting criteria.
  10822. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  10823. // GeoTargeting: Geographical targeting criteria.
  10824. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  10825. // Id: ID of this targeting template. This is a read-only,
  10826. // auto-generated field.
  10827. Id int64 `json:"id,omitempty,string"`
  10828. // KeyValueTargetingExpression: Key-value targeting criteria.
  10829. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  10830. // Kind: Identifies what kind of resource this is. Value: the fixed
  10831. // string "dfareporting#targetingTemplate".
  10832. Kind string `json:"kind,omitempty"`
  10833. // LanguageTargeting: Language targeting criteria.
  10834. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  10835. // ListTargetingExpression: Remarketing list targeting criteria.
  10836. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  10837. // Name: Name of this targeting template. This field is required. It
  10838. // must be less than 256 characters long and unique within an
  10839. // advertiser.
  10840. Name string `json:"name,omitempty"`
  10841. // SubaccountId: Subaccount ID of this targeting template. This field,
  10842. // if left unset, will be auto-generated on insert and is read-only
  10843. // after insert.
  10844. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10845. // TechnologyTargeting: Technology platform targeting criteria.
  10846. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  10847. // ServerResponse contains the HTTP response code and headers from the
  10848. // server.
  10849. googleapi.ServerResponse `json:"-"`
  10850. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10851. // unconditionally include in API requests. By default, fields with
  10852. // empty values are omitted from API requests. However, any non-pointer,
  10853. // non-interface field appearing in ForceSendFields will be sent to the
  10854. // server regardless of whether the field is empty or not. This may be
  10855. // used to include empty fields in Patch requests.
  10856. ForceSendFields []string `json:"-"`
  10857. // NullFields is a list of field names (e.g. "AccountId") to include in
  10858. // API requests with the JSON null value. By default, fields with empty
  10859. // values are omitted from API requests. However, any field with an
  10860. // empty value appearing in NullFields will be sent to the server as
  10861. // null. It is an error if a field in this list has a non-empty value.
  10862. // This may be used to include null fields in Patch requests.
  10863. NullFields []string `json:"-"`
  10864. }
  10865. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  10866. type NoMethod TargetingTemplate
  10867. raw := NoMethod(*s)
  10868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10869. }
  10870. // TargetingTemplatesListResponse: Targeting Template List Response
  10871. type TargetingTemplatesListResponse struct {
  10872. // Kind: Identifies what kind of resource this is. Value: the fixed
  10873. // string "dfareporting#targetingTemplatesListResponse".
  10874. Kind string `json:"kind,omitempty"`
  10875. // NextPageToken: Pagination token to be used for the next list
  10876. // operation.
  10877. NextPageToken string `json:"nextPageToken,omitempty"`
  10878. // TargetingTemplates: Targeting template collection.
  10879. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  10880. // ServerResponse contains the HTTP response code and headers from the
  10881. // server.
  10882. googleapi.ServerResponse `json:"-"`
  10883. // ForceSendFields is a list of field names (e.g. "Kind") to
  10884. // unconditionally include in API requests. By default, fields with
  10885. // empty values are omitted from API requests. However, any non-pointer,
  10886. // non-interface field appearing in ForceSendFields will be sent to the
  10887. // server regardless of whether the field is empty or not. This may be
  10888. // used to include empty fields in Patch requests.
  10889. ForceSendFields []string `json:"-"`
  10890. // NullFields is a list of field names (e.g. "Kind") to include in API
  10891. // requests with the JSON null value. By default, fields with empty
  10892. // values are omitted from API requests. However, any field with an
  10893. // empty value appearing in NullFields will be sent to the server as
  10894. // null. It is an error if a field in this list has a non-empty value.
  10895. // This may be used to include null fields in Patch requests.
  10896. NullFields []string `json:"-"`
  10897. }
  10898. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  10899. type NoMethod TargetingTemplatesListResponse
  10900. raw := NoMethod(*s)
  10901. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10902. }
  10903. // TechnologyTargeting: Technology Targeting.
  10904. type TechnologyTargeting struct {
  10905. // Browsers: Browsers that this ad targets. For each browser either set
  10906. // browserVersionId or dartId along with the version numbers. If both
  10907. // are specified, only browserVersionId will be used. The other fields
  10908. // are populated automatically when the ad is inserted or updated.
  10909. Browsers []*Browser `json:"browsers,omitempty"`
  10910. // ConnectionTypes: Connection types that this ad targets. For each
  10911. // connection type only id is required. The other fields are populated
  10912. // automatically when the ad is inserted or updated.
  10913. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  10914. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  10915. // carrier only id is required, and the other fields are populated
  10916. // automatically when the ad is inserted or updated. If targeting a
  10917. // mobile carrier, do not set targeting for any zip codes.
  10918. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  10919. // OperatingSystemVersions: Operating system versions that this ad
  10920. // targets. To target all versions, use operatingSystems. For each
  10921. // operating system version, only id is required. The other fields are
  10922. // populated automatically when the ad is inserted or updated. If
  10923. // targeting an operating system version, do not set targeting for the
  10924. // corresponding operating system in operatingSystems.
  10925. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  10926. // OperatingSystems: Operating systems that this ad targets. To target
  10927. // specific versions, use operatingSystemVersions. For each operating
  10928. // system only dartId is required. The other fields are populated
  10929. // automatically when the ad is inserted or updated. If targeting an
  10930. // operating system, do not set targeting for operating system versions
  10931. // for the same operating system.
  10932. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  10933. // PlatformTypes: Platform types that this ad targets. For example,
  10934. // desktop, mobile, or tablet. For each platform type, only id is
  10935. // required, and the other fields are populated automatically when the
  10936. // ad is inserted or updated.
  10937. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  10938. // ForceSendFields is a list of field names (e.g. "Browsers") to
  10939. // unconditionally include in API requests. By default, fields with
  10940. // empty values are omitted from API requests. However, any non-pointer,
  10941. // non-interface field appearing in ForceSendFields will be sent to the
  10942. // server regardless of whether the field is empty or not. This may be
  10943. // used to include empty fields in Patch requests.
  10944. ForceSendFields []string `json:"-"`
  10945. // NullFields is a list of field names (e.g. "Browsers") to include in
  10946. // API requests with the JSON null value. By default, fields with empty
  10947. // values are omitted from API requests. However, any field with an
  10948. // empty value appearing in NullFields will be sent to the server as
  10949. // null. It is an error if a field in this list has a non-empty value.
  10950. // This may be used to include null fields in Patch requests.
  10951. NullFields []string `json:"-"`
  10952. }
  10953. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  10954. type NoMethod TechnologyTargeting
  10955. raw := NoMethod(*s)
  10956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10957. }
  10958. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  10959. type ThirdPartyAuthenticationToken struct {
  10960. // Name: Name of the third-party authentication token.
  10961. Name string `json:"name,omitempty"`
  10962. // Value: Value of the third-party authentication token. This is a
  10963. // read-only, auto-generated field.
  10964. Value string `json:"value,omitempty"`
  10965. // ForceSendFields is a list of field names (e.g. "Name") to
  10966. // unconditionally include in API requests. By default, fields with
  10967. // empty values are omitted from API requests. However, any non-pointer,
  10968. // non-interface field appearing in ForceSendFields will be sent to the
  10969. // server regardless of whether the field is empty or not. This may be
  10970. // used to include empty fields in Patch requests.
  10971. ForceSendFields []string `json:"-"`
  10972. // NullFields is a list of field names (e.g. "Name") to include in API
  10973. // requests with the JSON null value. By default, fields with empty
  10974. // values are omitted from API requests. However, any field with an
  10975. // empty value appearing in NullFields will be sent to the server as
  10976. // null. It is an error if a field in this list has a non-empty value.
  10977. // This may be used to include null fields in Patch requests.
  10978. NullFields []string `json:"-"`
  10979. }
  10980. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  10981. type NoMethod ThirdPartyAuthenticationToken
  10982. raw := NoMethod(*s)
  10983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10984. }
  10985. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  10986. type ThirdPartyTrackingUrl struct {
  10987. // ThirdPartyUrlType: Third-party URL type for in-stream video
  10988. // creatives.
  10989. //
  10990. // Possible values:
  10991. // "CLICK_TRACKING"
  10992. // "IMPRESSION"
  10993. // "RICH_MEDIA_BACKUP_IMPRESSION"
  10994. // "RICH_MEDIA_IMPRESSION"
  10995. // "RICH_MEDIA_RM_IMPRESSION"
  10996. // "SURVEY"
  10997. // "VIDEO_COMPLETE"
  10998. // "VIDEO_CUSTOM"
  10999. // "VIDEO_FIRST_QUARTILE"
  11000. // "VIDEO_FULLSCREEN"
  11001. // "VIDEO_MIDPOINT"
  11002. // "VIDEO_MUTE"
  11003. // "VIDEO_PAUSE"
  11004. // "VIDEO_PROGRESS"
  11005. // "VIDEO_REWIND"
  11006. // "VIDEO_SKIP"
  11007. // "VIDEO_START"
  11008. // "VIDEO_STOP"
  11009. // "VIDEO_THIRD_QUARTILE"
  11010. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11011. // Url: URL for the specified third-party URL type.
  11012. Url string `json:"url,omitempty"`
  11013. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11014. // to unconditionally include in API requests. By default, fields with
  11015. // empty values are omitted from API requests. However, any non-pointer,
  11016. // non-interface field appearing in ForceSendFields will be sent to the
  11017. // server regardless of whether the field is empty or not. This may be
  11018. // used to include empty fields in Patch requests.
  11019. ForceSendFields []string `json:"-"`
  11020. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11021. // include in API requests with the JSON null value. By default, fields
  11022. // with empty values are omitted from API requests. However, any field
  11023. // with an empty value appearing in NullFields will be sent to the
  11024. // server as null. It is an error if a field in this list has a
  11025. // non-empty value. This may be used to include null fields in Patch
  11026. // requests.
  11027. NullFields []string `json:"-"`
  11028. }
  11029. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11030. type NoMethod ThirdPartyTrackingUrl
  11031. raw := NoMethod(*s)
  11032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11033. }
  11034. // TranscodeSetting: Transcode Settings
  11035. type TranscodeSetting struct {
  11036. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11037. // placement. Set this list to null or empty to serve all video formats.
  11038. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11039. // Kind: Identifies what kind of resource this is. Value: the fixed
  11040. // string "dfareporting#transcodeSetting".
  11041. Kind string `json:"kind,omitempty"`
  11042. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11043. // to unconditionally include in API requests. By default, fields with
  11044. // empty values are omitted from API requests. However, any non-pointer,
  11045. // non-interface field appearing in ForceSendFields will be sent to the
  11046. // server regardless of whether the field is empty or not. This may be
  11047. // used to include empty fields in Patch requests.
  11048. ForceSendFields []string `json:"-"`
  11049. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11050. // include in API requests with the JSON null value. By default, fields
  11051. // with empty values are omitted from API requests. However, any field
  11052. // with an empty value appearing in NullFields will be sent to the
  11053. // server as null. It is an error if a field in this list has a
  11054. // non-empty value. This may be used to include null fields in Patch
  11055. // requests.
  11056. NullFields []string `json:"-"`
  11057. }
  11058. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11059. type NoMethod TranscodeSetting
  11060. raw := NoMethod(*s)
  11061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11062. }
  11063. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11064. // to the following creative types: INSTREAM_VIDEO and VPAID.
  11065. type UniversalAdId struct {
  11066. // Registry: Registry used for the Ad ID value.
  11067. //
  11068. // Possible values:
  11069. // "AD_ID.ORG"
  11070. // "CLEARCAST"
  11071. // "DCM"
  11072. // "OTHER"
  11073. Registry string `json:"registry,omitempty"`
  11074. // Value: ID value for this creative. Only alphanumeric characters and
  11075. // the following symbols are valid: "_/\-". Maximum length is 64
  11076. // characters. Read only when registry is DCM.
  11077. Value string `json:"value,omitempty"`
  11078. // ForceSendFields is a list of field names (e.g. "Registry") to
  11079. // unconditionally include in API requests. By default, fields with
  11080. // empty values are omitted from API requests. However, any non-pointer,
  11081. // non-interface field appearing in ForceSendFields will be sent to the
  11082. // server regardless of whether the field is empty or not. This may be
  11083. // used to include empty fields in Patch requests.
  11084. ForceSendFields []string `json:"-"`
  11085. // NullFields is a list of field names (e.g. "Registry") to include in
  11086. // API requests with the JSON null value. By default, fields with empty
  11087. // values are omitted from API requests. However, any field with an
  11088. // empty value appearing in NullFields will be sent to the server as
  11089. // null. It is an error if a field in this list has a non-empty value.
  11090. // This may be used to include null fields in Patch requests.
  11091. NullFields []string `json:"-"`
  11092. }
  11093. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11094. type NoMethod UniversalAdId
  11095. raw := NoMethod(*s)
  11096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11097. }
  11098. // UserDefinedVariableConfiguration: User Defined Variable
  11099. // configuration.
  11100. type UserDefinedVariableConfiguration struct {
  11101. // DataType: Data type for the variable. This is a required field.
  11102. //
  11103. // Possible values:
  11104. // "NUMBER"
  11105. // "STRING"
  11106. DataType string `json:"dataType,omitempty"`
  11107. // ReportName: User-friendly name for the variable which will appear in
  11108. // reports. This is a required field, must be less than 64 characters
  11109. // long, and cannot contain the following characters: ""<>".
  11110. ReportName string `json:"reportName,omitempty"`
  11111. // VariableType: Variable name in the tag. This is a required field.
  11112. //
  11113. // Possible values:
  11114. // "U1"
  11115. // "U10"
  11116. // "U100"
  11117. // "U11"
  11118. // "U12"
  11119. // "U13"
  11120. // "U14"
  11121. // "U15"
  11122. // "U16"
  11123. // "U17"
  11124. // "U18"
  11125. // "U19"
  11126. // "U2"
  11127. // "U20"
  11128. // "U21"
  11129. // "U22"
  11130. // "U23"
  11131. // "U24"
  11132. // "U25"
  11133. // "U26"
  11134. // "U27"
  11135. // "U28"
  11136. // "U29"
  11137. // "U3"
  11138. // "U30"
  11139. // "U31"
  11140. // "U32"
  11141. // "U33"
  11142. // "U34"
  11143. // "U35"
  11144. // "U36"
  11145. // "U37"
  11146. // "U38"
  11147. // "U39"
  11148. // "U4"
  11149. // "U40"
  11150. // "U41"
  11151. // "U42"
  11152. // "U43"
  11153. // "U44"
  11154. // "U45"
  11155. // "U46"
  11156. // "U47"
  11157. // "U48"
  11158. // "U49"
  11159. // "U5"
  11160. // "U50"
  11161. // "U51"
  11162. // "U52"
  11163. // "U53"
  11164. // "U54"
  11165. // "U55"
  11166. // "U56"
  11167. // "U57"
  11168. // "U58"
  11169. // "U59"
  11170. // "U6"
  11171. // "U60"
  11172. // "U61"
  11173. // "U62"
  11174. // "U63"
  11175. // "U64"
  11176. // "U65"
  11177. // "U66"
  11178. // "U67"
  11179. // "U68"
  11180. // "U69"
  11181. // "U7"
  11182. // "U70"
  11183. // "U71"
  11184. // "U72"
  11185. // "U73"
  11186. // "U74"
  11187. // "U75"
  11188. // "U76"
  11189. // "U77"
  11190. // "U78"
  11191. // "U79"
  11192. // "U8"
  11193. // "U80"
  11194. // "U81"
  11195. // "U82"
  11196. // "U83"
  11197. // "U84"
  11198. // "U85"
  11199. // "U86"
  11200. // "U87"
  11201. // "U88"
  11202. // "U89"
  11203. // "U9"
  11204. // "U90"
  11205. // "U91"
  11206. // "U92"
  11207. // "U93"
  11208. // "U94"
  11209. // "U95"
  11210. // "U96"
  11211. // "U97"
  11212. // "U98"
  11213. // "U99"
  11214. VariableType string `json:"variableType,omitempty"`
  11215. // ForceSendFields is a list of field names (e.g. "DataType") to
  11216. // unconditionally include in API requests. By default, fields with
  11217. // empty values are omitted from API requests. However, any non-pointer,
  11218. // non-interface field appearing in ForceSendFields will be sent to the
  11219. // server regardless of whether the field is empty or not. This may be
  11220. // used to include empty fields in Patch requests.
  11221. ForceSendFields []string `json:"-"`
  11222. // NullFields is a list of field names (e.g. "DataType") to include in
  11223. // API requests with the JSON null value. By default, fields with empty
  11224. // values are omitted from API requests. However, any field with an
  11225. // empty value appearing in NullFields will be sent to the server as
  11226. // null. It is an error if a field in this list has a non-empty value.
  11227. // This may be used to include null fields in Patch requests.
  11228. NullFields []string `json:"-"`
  11229. }
  11230. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11231. type NoMethod UserDefinedVariableConfiguration
  11232. raw := NoMethod(*s)
  11233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11234. }
  11235. // UserProfile: Represents a UserProfile resource.
  11236. type UserProfile struct {
  11237. // AccountId: The account ID to which this profile belongs.
  11238. AccountId int64 `json:"accountId,omitempty,string"`
  11239. // AccountName: The account name this profile belongs to.
  11240. AccountName string `json:"accountName,omitempty"`
  11241. // Etag: The eTag of this response for caching purposes.
  11242. Etag string `json:"etag,omitempty"`
  11243. // Kind: The kind of resource this is, in this case
  11244. // dfareporting#userProfile.
  11245. Kind string `json:"kind,omitempty"`
  11246. // ProfileId: The unique ID of the user profile.
  11247. ProfileId int64 `json:"profileId,omitempty,string"`
  11248. // SubAccountId: The sub account ID this profile belongs to if
  11249. // applicable.
  11250. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11251. // SubAccountName: The sub account name this profile belongs to if
  11252. // applicable.
  11253. SubAccountName string `json:"subAccountName,omitempty"`
  11254. // UserName: The user name.
  11255. UserName string `json:"userName,omitempty"`
  11256. // ServerResponse contains the HTTP response code and headers from the
  11257. // server.
  11258. googleapi.ServerResponse `json:"-"`
  11259. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11260. // unconditionally include in API requests. By default, fields with
  11261. // empty values are omitted from API requests. However, any non-pointer,
  11262. // non-interface field appearing in ForceSendFields will be sent to the
  11263. // server regardless of whether the field is empty or not. This may be
  11264. // used to include empty fields in Patch requests.
  11265. ForceSendFields []string `json:"-"`
  11266. // NullFields is a list of field names (e.g. "AccountId") to include in
  11267. // API requests with the JSON null value. By default, fields with empty
  11268. // values are omitted from API requests. However, any field with an
  11269. // empty value appearing in NullFields will be sent to the server as
  11270. // null. It is an error if a field in this list has a non-empty value.
  11271. // This may be used to include null fields in Patch requests.
  11272. NullFields []string `json:"-"`
  11273. }
  11274. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11275. type NoMethod UserProfile
  11276. raw := NoMethod(*s)
  11277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11278. }
  11279. // UserProfileList: Represents the list of user profiles.
  11280. type UserProfileList struct {
  11281. // Etag: The eTag of this response for caching purposes.
  11282. Etag string `json:"etag,omitempty"`
  11283. // Items: The user profiles returned in this response.
  11284. Items []*UserProfile `json:"items,omitempty"`
  11285. // Kind: The kind of list this is, in this case
  11286. // dfareporting#userProfileList.
  11287. Kind string `json:"kind,omitempty"`
  11288. // ServerResponse contains the HTTP response code and headers from the
  11289. // server.
  11290. googleapi.ServerResponse `json:"-"`
  11291. // ForceSendFields is a list of field names (e.g. "Etag") to
  11292. // unconditionally include in API requests. By default, fields with
  11293. // empty values are omitted from API requests. However, any non-pointer,
  11294. // non-interface field appearing in ForceSendFields will be sent to the
  11295. // server regardless of whether the field is empty or not. This may be
  11296. // used to include empty fields in Patch requests.
  11297. ForceSendFields []string `json:"-"`
  11298. // NullFields is a list of field names (e.g. "Etag") to include in API
  11299. // requests with the JSON null value. By default, fields with empty
  11300. // values are omitted from API requests. However, any field with an
  11301. // empty value appearing in NullFields will be sent to the server as
  11302. // null. It is an error if a field in this list has a non-empty value.
  11303. // This may be used to include null fields in Patch requests.
  11304. NullFields []string `json:"-"`
  11305. }
  11306. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11307. type NoMethod UserProfileList
  11308. raw := NoMethod(*s)
  11309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11310. }
  11311. // UserRole: Contains properties of auser role, which is used to manage
  11312. // user access.
  11313. type UserRole struct {
  11314. // AccountId: Account ID of this user role. This is a read-only field
  11315. // that can be left blank.
  11316. AccountId int64 `json:"accountId,omitempty,string"`
  11317. // DefaultUserRole: Whether this is a default user role. Default user
  11318. // roles are created by the system for the account/subaccount and cannot
  11319. // be modified or deleted. Each default user role comes with a basic set
  11320. // of preassigned permissions.
  11321. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11322. // Id: ID of this user role. This is a read-only, auto-generated field.
  11323. Id int64 `json:"id,omitempty,string"`
  11324. // Kind: Identifies what kind of resource this is. Value: the fixed
  11325. // string "dfareporting#userRole".
  11326. Kind string `json:"kind,omitempty"`
  11327. // Name: Name of this user role. This is a required field. Must be less
  11328. // than 256 characters long. If this user role is under a subaccount,
  11329. // the name must be unique among sites of the same subaccount.
  11330. // Otherwise, this user role is a top-level user role, and the name must
  11331. // be unique among top-level user roles of the same account.
  11332. Name string `json:"name,omitempty"`
  11333. // ParentUserRoleId: ID of the user role that this user role is based on
  11334. // or copied from. This is a required field.
  11335. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11336. // Permissions: List of permissions associated with this user role.
  11337. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11338. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11339. // field that can be left blank.
  11340. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11341. // ServerResponse contains the HTTP response code and headers from the
  11342. // server.
  11343. googleapi.ServerResponse `json:"-"`
  11344. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11345. // unconditionally include in API requests. By default, fields with
  11346. // empty values are omitted from API requests. However, any non-pointer,
  11347. // non-interface field appearing in ForceSendFields will be sent to the
  11348. // server regardless of whether the field is empty or not. This may be
  11349. // used to include empty fields in Patch requests.
  11350. ForceSendFields []string `json:"-"`
  11351. // NullFields is a list of field names (e.g. "AccountId") to include in
  11352. // API requests with the JSON null value. By default, fields with empty
  11353. // values are omitted from API requests. However, any field with an
  11354. // empty value appearing in NullFields will be sent to the server as
  11355. // null. It is an error if a field in this list has a non-empty value.
  11356. // This may be used to include null fields in Patch requests.
  11357. NullFields []string `json:"-"`
  11358. }
  11359. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11360. type NoMethod UserRole
  11361. raw := NoMethod(*s)
  11362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11363. }
  11364. // UserRolePermission: Contains properties of a user role permission.
  11365. type UserRolePermission struct {
  11366. // Availability: Levels of availability for a user role permission.
  11367. //
  11368. // Possible values:
  11369. // "ACCOUNT_ALWAYS"
  11370. // "ACCOUNT_BY_DEFAULT"
  11371. // "NOT_AVAILABLE_BY_DEFAULT"
  11372. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11373. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11374. Availability string `json:"availability,omitempty"`
  11375. // Id: ID of this user role permission.
  11376. Id int64 `json:"id,omitempty,string"`
  11377. // Kind: Identifies what kind of resource this is. Value: the fixed
  11378. // string "dfareporting#userRolePermission".
  11379. Kind string `json:"kind,omitempty"`
  11380. // Name: Name of this user role permission.
  11381. Name string `json:"name,omitempty"`
  11382. // PermissionGroupId: ID of the permission group that this user role
  11383. // permission belongs to.
  11384. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11385. // ServerResponse contains the HTTP response code and headers from the
  11386. // server.
  11387. googleapi.ServerResponse `json:"-"`
  11388. // ForceSendFields is a list of field names (e.g. "Availability") to
  11389. // unconditionally include in API requests. By default, fields with
  11390. // empty values are omitted from API requests. However, any non-pointer,
  11391. // non-interface field appearing in ForceSendFields will be sent to the
  11392. // server regardless of whether the field is empty or not. This may be
  11393. // used to include empty fields in Patch requests.
  11394. ForceSendFields []string `json:"-"`
  11395. // NullFields is a list of field names (e.g. "Availability") to include
  11396. // in API requests with the JSON null value. By default, fields with
  11397. // empty values are omitted from API requests. However, any field with
  11398. // an empty value appearing in NullFields will be sent to the server as
  11399. // null. It is an error if a field in this list has a non-empty value.
  11400. // This may be used to include null fields in Patch requests.
  11401. NullFields []string `json:"-"`
  11402. }
  11403. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11404. type NoMethod UserRolePermission
  11405. raw := NoMethod(*s)
  11406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11407. }
  11408. // UserRolePermissionGroup: Represents a grouping of related user role
  11409. // permissions.
  11410. type UserRolePermissionGroup struct {
  11411. // Id: ID of this user role permission.
  11412. Id int64 `json:"id,omitempty,string"`
  11413. // Kind: Identifies what kind of resource this is. Value: the fixed
  11414. // string "dfareporting#userRolePermissionGroup".
  11415. Kind string `json:"kind,omitempty"`
  11416. // Name: Name of this user role permission group.
  11417. Name string `json:"name,omitempty"`
  11418. // ServerResponse contains the HTTP response code and headers from the
  11419. // server.
  11420. googleapi.ServerResponse `json:"-"`
  11421. // ForceSendFields is a list of field names (e.g. "Id") to
  11422. // unconditionally include in API requests. By default, fields with
  11423. // empty values are omitted from API requests. However, any non-pointer,
  11424. // non-interface field appearing in ForceSendFields will be sent to the
  11425. // server regardless of whether the field is empty or not. This may be
  11426. // used to include empty fields in Patch requests.
  11427. ForceSendFields []string `json:"-"`
  11428. // NullFields is a list of field names (e.g. "Id") to include in API
  11429. // requests with the JSON null value. By default, fields with empty
  11430. // values are omitted from API requests. However, any field with an
  11431. // empty value appearing in NullFields will be sent to the server as
  11432. // null. It is an error if a field in this list has a non-empty value.
  11433. // This may be used to include null fields in Patch requests.
  11434. NullFields []string `json:"-"`
  11435. }
  11436. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11437. type NoMethod UserRolePermissionGroup
  11438. raw := NoMethod(*s)
  11439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11440. }
  11441. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11442. // Response
  11443. type UserRolePermissionGroupsListResponse struct {
  11444. // Kind: Identifies what kind of resource this is. Value: the fixed
  11445. // string "dfareporting#userRolePermissionGroupsListResponse".
  11446. Kind string `json:"kind,omitempty"`
  11447. // UserRolePermissionGroups: User role permission group collection.
  11448. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11449. // ServerResponse contains the HTTP response code and headers from the
  11450. // server.
  11451. googleapi.ServerResponse `json:"-"`
  11452. // ForceSendFields is a list of field names (e.g. "Kind") to
  11453. // unconditionally include in API requests. By default, fields with
  11454. // empty values are omitted from API requests. However, any non-pointer,
  11455. // non-interface field appearing in ForceSendFields will be sent to the
  11456. // server regardless of whether the field is empty or not. This may be
  11457. // used to include empty fields in Patch requests.
  11458. ForceSendFields []string `json:"-"`
  11459. // NullFields is a list of field names (e.g. "Kind") to include in API
  11460. // requests with the JSON null value. By default, fields with empty
  11461. // values are omitted from API requests. However, any field with an
  11462. // empty value appearing in NullFields will be sent to the server as
  11463. // null. It is an error if a field in this list has a non-empty value.
  11464. // This may be used to include null fields in Patch requests.
  11465. NullFields []string `json:"-"`
  11466. }
  11467. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11468. type NoMethod UserRolePermissionGroupsListResponse
  11469. raw := NoMethod(*s)
  11470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11471. }
  11472. // UserRolePermissionsListResponse: User Role Permission List Response
  11473. type UserRolePermissionsListResponse struct {
  11474. // Kind: Identifies what kind of resource this is. Value: the fixed
  11475. // string "dfareporting#userRolePermissionsListResponse".
  11476. Kind string `json:"kind,omitempty"`
  11477. // UserRolePermissions: User role permission collection.
  11478. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11479. // ServerResponse contains the HTTP response code and headers from the
  11480. // server.
  11481. googleapi.ServerResponse `json:"-"`
  11482. // ForceSendFields is a list of field names (e.g. "Kind") to
  11483. // unconditionally include in API requests. By default, fields with
  11484. // empty values are omitted from API requests. However, any non-pointer,
  11485. // non-interface field appearing in ForceSendFields will be sent to the
  11486. // server regardless of whether the field is empty or not. This may be
  11487. // used to include empty fields in Patch requests.
  11488. ForceSendFields []string `json:"-"`
  11489. // NullFields is a list of field names (e.g. "Kind") to include in API
  11490. // requests with the JSON null value. By default, fields with empty
  11491. // values are omitted from API requests. However, any field with an
  11492. // empty value appearing in NullFields will be sent to the server as
  11493. // null. It is an error if a field in this list has a non-empty value.
  11494. // This may be used to include null fields in Patch requests.
  11495. NullFields []string `json:"-"`
  11496. }
  11497. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11498. type NoMethod UserRolePermissionsListResponse
  11499. raw := NoMethod(*s)
  11500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11501. }
  11502. // UserRolesListResponse: User Role List Response
  11503. type UserRolesListResponse struct {
  11504. // Kind: Identifies what kind of resource this is. Value: the fixed
  11505. // string "dfareporting#userRolesListResponse".
  11506. Kind string `json:"kind,omitempty"`
  11507. // NextPageToken: Pagination token to be used for the next list
  11508. // operation.
  11509. NextPageToken string `json:"nextPageToken,omitempty"`
  11510. // UserRoles: User role collection.
  11511. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11512. // ServerResponse contains the HTTP response code and headers from the
  11513. // server.
  11514. googleapi.ServerResponse `json:"-"`
  11515. // ForceSendFields is a list of field names (e.g. "Kind") to
  11516. // unconditionally include in API requests. By default, fields with
  11517. // empty values are omitted from API requests. However, any non-pointer,
  11518. // non-interface field appearing in ForceSendFields will be sent to the
  11519. // server regardless of whether the field is empty or not. This may be
  11520. // used to include empty fields in Patch requests.
  11521. ForceSendFields []string `json:"-"`
  11522. // NullFields is a list of field names (e.g. "Kind") to include in API
  11523. // requests with the JSON null value. By default, fields with empty
  11524. // values are omitted from API requests. However, any field with an
  11525. // empty value appearing in NullFields will be sent to the server as
  11526. // null. It is an error if a field in this list has a non-empty value.
  11527. // This may be used to include null fields in Patch requests.
  11528. NullFields []string `json:"-"`
  11529. }
  11530. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11531. type NoMethod UserRolesListResponse
  11532. raw := NoMethod(*s)
  11533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11534. }
  11535. // VideoFormat: Contains information about supported video formats.
  11536. type VideoFormat struct {
  11537. // FileType: File type of the video format.
  11538. //
  11539. // Possible values:
  11540. // "FLV"
  11541. // "M3U8"
  11542. // "MP4"
  11543. // "THREEGPP"
  11544. // "WEBM"
  11545. FileType string `json:"fileType,omitempty"`
  11546. // Id: ID of the video format.
  11547. Id int64 `json:"id,omitempty"`
  11548. // Kind: Identifies what kind of resource this is. Value: the fixed
  11549. // string "dfareporting#videoFormat".
  11550. Kind string `json:"kind,omitempty"`
  11551. // Resolution: The resolution of this video format.
  11552. Resolution *Size `json:"resolution,omitempty"`
  11553. // TargetBitRate: The target bit rate of this video format.
  11554. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11555. // ServerResponse contains the HTTP response code and headers from the
  11556. // server.
  11557. googleapi.ServerResponse `json:"-"`
  11558. // ForceSendFields is a list of field names (e.g. "FileType") to
  11559. // unconditionally include in API requests. By default, fields with
  11560. // empty values are omitted from API requests. However, any non-pointer,
  11561. // non-interface field appearing in ForceSendFields will be sent to the
  11562. // server regardless of whether the field is empty or not. This may be
  11563. // used to include empty fields in Patch requests.
  11564. ForceSendFields []string `json:"-"`
  11565. // NullFields is a list of field names (e.g. "FileType") to include in
  11566. // API requests with the JSON null value. By default, fields with empty
  11567. // values are omitted from API requests. However, any field with an
  11568. // empty value appearing in NullFields will be sent to the server as
  11569. // null. It is an error if a field in this list has a non-empty value.
  11570. // This may be used to include null fields in Patch requests.
  11571. NullFields []string `json:"-"`
  11572. }
  11573. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11574. type NoMethod VideoFormat
  11575. raw := NoMethod(*s)
  11576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11577. }
  11578. // VideoFormatsListResponse: Video Format List Response
  11579. type VideoFormatsListResponse struct {
  11580. // Kind: Identifies what kind of resource this is. Value: the fixed
  11581. // string "dfareporting#videoFormatsListResponse".
  11582. Kind string `json:"kind,omitempty"`
  11583. // VideoFormats: Video format collection.
  11584. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11585. // ServerResponse contains the HTTP response code and headers from the
  11586. // server.
  11587. googleapi.ServerResponse `json:"-"`
  11588. // ForceSendFields is a list of field names (e.g. "Kind") to
  11589. // unconditionally include in API requests. By default, fields with
  11590. // empty values are omitted from API requests. However, any non-pointer,
  11591. // non-interface field appearing in ForceSendFields will be sent to the
  11592. // server regardless of whether the field is empty or not. This may be
  11593. // used to include empty fields in Patch requests.
  11594. ForceSendFields []string `json:"-"`
  11595. // NullFields is a list of field names (e.g. "Kind") to include in API
  11596. // requests with the JSON null value. By default, fields with empty
  11597. // values are omitted from API requests. However, any field with an
  11598. // empty value appearing in NullFields will be sent to the server as
  11599. // null. It is an error if a field in this list has a non-empty value.
  11600. // This may be used to include null fields in Patch requests.
  11601. NullFields []string `json:"-"`
  11602. }
  11603. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11604. type NoMethod VideoFormatsListResponse
  11605. raw := NoMethod(*s)
  11606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11607. }
  11608. // VideoOffset: Video Offset
  11609. type VideoOffset struct {
  11610. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11611. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11612. // inclusive.
  11613. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11614. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11615. // is set. Acceptable values are 0 to 86399, inclusive.
  11616. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11617. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11618. // unconditionally include in API requests. By default, fields with
  11619. // empty values are omitted from API requests. However, any non-pointer,
  11620. // non-interface field appearing in ForceSendFields will be sent to the
  11621. // server regardless of whether the field is empty or not. This may be
  11622. // used to include empty fields in Patch requests.
  11623. ForceSendFields []string `json:"-"`
  11624. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11625. // include in API requests with the JSON null value. By default, fields
  11626. // with empty values are omitted from API requests. However, any field
  11627. // with an empty value appearing in NullFields will be sent to the
  11628. // server as null. It is an error if a field in this list has a
  11629. // non-empty value. This may be used to include null fields in Patch
  11630. // requests.
  11631. NullFields []string `json:"-"`
  11632. }
  11633. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11634. type NoMethod VideoOffset
  11635. raw := NoMethod(*s)
  11636. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11637. }
  11638. // VideoSettings: Video Settings
  11639. type VideoSettings struct {
  11640. // CompanionSettings: Settings for the companion creatives of video
  11641. // creatives served to this placement.
  11642. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11643. // Kind: Identifies what kind of resource this is. Value: the fixed
  11644. // string "dfareporting#videoSettings".
  11645. Kind string `json:"kind,omitempty"`
  11646. // Orientation: Orientation of a video placement. If this value is set,
  11647. // placement will return assets matching the specified orientation.
  11648. //
  11649. // Possible values:
  11650. // "ANY"
  11651. // "LANDSCAPE"
  11652. // "PORTRAIT"
  11653. Orientation string `json:"orientation,omitempty"`
  11654. // SkippableSettings: Settings for the skippability of video creatives
  11655. // served to this placement. If this object is provided, the
  11656. // creative-level skippable settings will be overridden.
  11657. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11658. // TranscodeSettings: Settings for the transcodes of video creatives
  11659. // served to this placement. If this object is provided, the
  11660. // creative-level transcode settings will be overridden.
  11661. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11662. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11663. // to unconditionally include in API requests. By default, fields with
  11664. // empty values are omitted from API requests. However, any non-pointer,
  11665. // non-interface field appearing in ForceSendFields will be sent to the
  11666. // server regardless of whether the field is empty or not. This may be
  11667. // used to include empty fields in Patch requests.
  11668. ForceSendFields []string `json:"-"`
  11669. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11670. // include in API requests with the JSON null value. By default, fields
  11671. // with empty values are omitted from API requests. However, any field
  11672. // with an empty value appearing in NullFields will be sent to the
  11673. // server as null. It is an error if a field in this list has a
  11674. // non-empty value. This may be used to include null fields in Patch
  11675. // requests.
  11676. NullFields []string `json:"-"`
  11677. }
  11678. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11679. type NoMethod VideoSettings
  11680. raw := NoMethod(*s)
  11681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11682. }
  11683. // method id "dfareporting.accountActiveAdSummaries.get":
  11684. type AccountActiveAdSummariesGetCall struct {
  11685. s *Service
  11686. profileId int64
  11687. summaryAccountId int64
  11688. urlParams_ gensupport.URLParams
  11689. ifNoneMatch_ string
  11690. ctx_ context.Context
  11691. header_ http.Header
  11692. }
  11693. // Get: Gets the account's active ad summary by account ID.
  11694. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11695. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11696. c.profileId = profileId
  11697. c.summaryAccountId = summaryAccountId
  11698. return c
  11699. }
  11700. // Fields allows partial responses to be retrieved. See
  11701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11702. // for more information.
  11703. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11705. return c
  11706. }
  11707. // IfNoneMatch sets the optional parameter which makes the operation
  11708. // fail if the object's ETag matches the given value. This is useful for
  11709. // getting updates only after the object has changed since the last
  11710. // request. Use googleapi.IsNotModified to check whether the response
  11711. // error from Do is the result of In-None-Match.
  11712. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11713. c.ifNoneMatch_ = entityTag
  11714. return c
  11715. }
  11716. // Context sets the context to be used in this call's Do method. Any
  11717. // pending HTTP request will be aborted if the provided context is
  11718. // canceled.
  11719. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11720. c.ctx_ = ctx
  11721. return c
  11722. }
  11723. // Header returns an http.Header that can be modified by the caller to
  11724. // add HTTP headers to the request.
  11725. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11726. if c.header_ == nil {
  11727. c.header_ = make(http.Header)
  11728. }
  11729. return c.header_
  11730. }
  11731. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11732. reqHeaders := make(http.Header)
  11733. for k, v := range c.header_ {
  11734. reqHeaders[k] = v
  11735. }
  11736. reqHeaders.Set("User-Agent", c.s.userAgent())
  11737. if c.ifNoneMatch_ != "" {
  11738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11739. }
  11740. var body io.Reader = nil
  11741. c.urlParams_.Set("alt", alt)
  11742. c.urlParams_.Set("prettyPrint", "false")
  11743. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11744. urls += "?" + c.urlParams_.Encode()
  11745. req, err := http.NewRequest("GET", urls, body)
  11746. if err != nil {
  11747. return nil, err
  11748. }
  11749. req.Header = reqHeaders
  11750. googleapi.Expand(req.URL, map[string]string{
  11751. "profileId": strconv.FormatInt(c.profileId, 10),
  11752. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11753. })
  11754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11755. }
  11756. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11757. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11758. // non-2xx status code is an error. Response headers are in either
  11759. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11760. // returned at all) in error.(*googleapi.Error).Header. Use
  11761. // googleapi.IsNotModified to check whether the returned error was
  11762. // because http.StatusNotModified was returned.
  11763. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11764. gensupport.SetOptions(c.urlParams_, opts...)
  11765. res, err := c.doRequest("json")
  11766. if res != nil && res.StatusCode == http.StatusNotModified {
  11767. if res.Body != nil {
  11768. res.Body.Close()
  11769. }
  11770. return nil, &googleapi.Error{
  11771. Code: res.StatusCode,
  11772. Header: res.Header,
  11773. }
  11774. }
  11775. if err != nil {
  11776. return nil, err
  11777. }
  11778. defer googleapi.CloseBody(res)
  11779. if err := googleapi.CheckResponse(res); err != nil {
  11780. return nil, err
  11781. }
  11782. ret := &AccountActiveAdSummary{
  11783. ServerResponse: googleapi.ServerResponse{
  11784. Header: res.Header,
  11785. HTTPStatusCode: res.StatusCode,
  11786. },
  11787. }
  11788. target := &ret
  11789. if err := gensupport.DecodeResponse(target, res); err != nil {
  11790. return nil, err
  11791. }
  11792. return ret, nil
  11793. // {
  11794. // "description": "Gets the account's active ad summary by account ID.",
  11795. // "httpMethod": "GET",
  11796. // "id": "dfareporting.accountActiveAdSummaries.get",
  11797. // "parameterOrder": [
  11798. // "profileId",
  11799. // "summaryAccountId"
  11800. // ],
  11801. // "parameters": {
  11802. // "profileId": {
  11803. // "description": "User profile ID associated with this request.",
  11804. // "format": "int64",
  11805. // "location": "path",
  11806. // "required": true,
  11807. // "type": "string"
  11808. // },
  11809. // "summaryAccountId": {
  11810. // "description": "Account ID.",
  11811. // "format": "int64",
  11812. // "location": "path",
  11813. // "required": true,
  11814. // "type": "string"
  11815. // }
  11816. // },
  11817. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  11818. // "response": {
  11819. // "$ref": "AccountActiveAdSummary"
  11820. // },
  11821. // "scopes": [
  11822. // "https://www.googleapis.com/auth/dfatrafficking"
  11823. // ]
  11824. // }
  11825. }
  11826. // method id "dfareporting.accountPermissionGroups.get":
  11827. type AccountPermissionGroupsGetCall struct {
  11828. s *Service
  11829. profileId int64
  11830. id int64
  11831. urlParams_ gensupport.URLParams
  11832. ifNoneMatch_ string
  11833. ctx_ context.Context
  11834. header_ http.Header
  11835. }
  11836. // Get: Gets one account permission group by ID.
  11837. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  11838. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11839. c.profileId = profileId
  11840. c.id = id
  11841. return c
  11842. }
  11843. // Fields allows partial responses to be retrieved. See
  11844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11845. // for more information.
  11846. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  11847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11848. return c
  11849. }
  11850. // IfNoneMatch sets the optional parameter which makes the operation
  11851. // fail if the object's ETag matches the given value. This is useful for
  11852. // getting updates only after the object has changed since the last
  11853. // request. Use googleapi.IsNotModified to check whether the response
  11854. // error from Do is the result of In-None-Match.
  11855. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  11856. c.ifNoneMatch_ = entityTag
  11857. return c
  11858. }
  11859. // Context sets the context to be used in this call's Do method. Any
  11860. // pending HTTP request will be aborted if the provided context is
  11861. // canceled.
  11862. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  11863. c.ctx_ = ctx
  11864. return c
  11865. }
  11866. // Header returns an http.Header that can be modified by the caller to
  11867. // add HTTP headers to the request.
  11868. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  11869. if c.header_ == nil {
  11870. c.header_ = make(http.Header)
  11871. }
  11872. return c.header_
  11873. }
  11874. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  11875. reqHeaders := make(http.Header)
  11876. for k, v := range c.header_ {
  11877. reqHeaders[k] = v
  11878. }
  11879. reqHeaders.Set("User-Agent", c.s.userAgent())
  11880. if c.ifNoneMatch_ != "" {
  11881. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11882. }
  11883. var body io.Reader = nil
  11884. c.urlParams_.Set("alt", alt)
  11885. c.urlParams_.Set("prettyPrint", "false")
  11886. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  11887. urls += "?" + c.urlParams_.Encode()
  11888. req, err := http.NewRequest("GET", urls, body)
  11889. if err != nil {
  11890. return nil, err
  11891. }
  11892. req.Header = reqHeaders
  11893. googleapi.Expand(req.URL, map[string]string{
  11894. "profileId": strconv.FormatInt(c.profileId, 10),
  11895. "id": strconv.FormatInt(c.id, 10),
  11896. })
  11897. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11898. }
  11899. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  11900. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  11901. // non-2xx status code is an error. Response headers are in either
  11902. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  11903. // returned at all) in error.(*googleapi.Error).Header. Use
  11904. // googleapi.IsNotModified to check whether the returned error was
  11905. // because http.StatusNotModified was returned.
  11906. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  11907. gensupport.SetOptions(c.urlParams_, opts...)
  11908. res, err := c.doRequest("json")
  11909. if res != nil && res.StatusCode == http.StatusNotModified {
  11910. if res.Body != nil {
  11911. res.Body.Close()
  11912. }
  11913. return nil, &googleapi.Error{
  11914. Code: res.StatusCode,
  11915. Header: res.Header,
  11916. }
  11917. }
  11918. if err != nil {
  11919. return nil, err
  11920. }
  11921. defer googleapi.CloseBody(res)
  11922. if err := googleapi.CheckResponse(res); err != nil {
  11923. return nil, err
  11924. }
  11925. ret := &AccountPermissionGroup{
  11926. ServerResponse: googleapi.ServerResponse{
  11927. Header: res.Header,
  11928. HTTPStatusCode: res.StatusCode,
  11929. },
  11930. }
  11931. target := &ret
  11932. if err := gensupport.DecodeResponse(target, res); err != nil {
  11933. return nil, err
  11934. }
  11935. return ret, nil
  11936. // {
  11937. // "description": "Gets one account permission group by ID.",
  11938. // "httpMethod": "GET",
  11939. // "id": "dfareporting.accountPermissionGroups.get",
  11940. // "parameterOrder": [
  11941. // "profileId",
  11942. // "id"
  11943. // ],
  11944. // "parameters": {
  11945. // "id": {
  11946. // "description": "Account permission group ID.",
  11947. // "format": "int64",
  11948. // "location": "path",
  11949. // "required": true,
  11950. // "type": "string"
  11951. // },
  11952. // "profileId": {
  11953. // "description": "User profile ID associated with this request.",
  11954. // "format": "int64",
  11955. // "location": "path",
  11956. // "required": true,
  11957. // "type": "string"
  11958. // }
  11959. // },
  11960. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  11961. // "response": {
  11962. // "$ref": "AccountPermissionGroup"
  11963. // },
  11964. // "scopes": [
  11965. // "https://www.googleapis.com/auth/dfatrafficking"
  11966. // ]
  11967. // }
  11968. }
  11969. // method id "dfareporting.accountPermissionGroups.list":
  11970. type AccountPermissionGroupsListCall struct {
  11971. s *Service
  11972. profileId int64
  11973. urlParams_ gensupport.URLParams
  11974. ifNoneMatch_ string
  11975. ctx_ context.Context
  11976. header_ http.Header
  11977. }
  11978. // List: Retrieves the list of account permission groups.
  11979. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  11980. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11981. c.profileId = profileId
  11982. return c
  11983. }
  11984. // Fields allows partial responses to be retrieved. See
  11985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11986. // for more information.
  11987. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  11988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11989. return c
  11990. }
  11991. // IfNoneMatch sets the optional parameter which makes the operation
  11992. // fail if the object's ETag matches the given value. This is useful for
  11993. // getting updates only after the object has changed since the last
  11994. // request. Use googleapi.IsNotModified to check whether the response
  11995. // error from Do is the result of In-None-Match.
  11996. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  11997. c.ifNoneMatch_ = entityTag
  11998. return c
  11999. }
  12000. // Context sets the context to be used in this call's Do method. Any
  12001. // pending HTTP request will be aborted if the provided context is
  12002. // canceled.
  12003. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  12004. c.ctx_ = ctx
  12005. return c
  12006. }
  12007. // Header returns an http.Header that can be modified by the caller to
  12008. // add HTTP headers to the request.
  12009. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  12010. if c.header_ == nil {
  12011. c.header_ = make(http.Header)
  12012. }
  12013. return c.header_
  12014. }
  12015. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12016. reqHeaders := make(http.Header)
  12017. for k, v := range c.header_ {
  12018. reqHeaders[k] = v
  12019. }
  12020. reqHeaders.Set("User-Agent", c.s.userAgent())
  12021. if c.ifNoneMatch_ != "" {
  12022. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12023. }
  12024. var body io.Reader = nil
  12025. c.urlParams_.Set("alt", alt)
  12026. c.urlParams_.Set("prettyPrint", "false")
  12027. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12028. urls += "?" + c.urlParams_.Encode()
  12029. req, err := http.NewRequest("GET", urls, body)
  12030. if err != nil {
  12031. return nil, err
  12032. }
  12033. req.Header = reqHeaders
  12034. googleapi.Expand(req.URL, map[string]string{
  12035. "profileId": strconv.FormatInt(c.profileId, 10),
  12036. })
  12037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12038. }
  12039. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12040. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12041. // non-nil. Any non-2xx status code is an error. Response headers are in
  12042. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12043. // (if a response was returned at all) in
  12044. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12045. // whether the returned error was because http.StatusNotModified was
  12046. // returned.
  12047. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12048. gensupport.SetOptions(c.urlParams_, opts...)
  12049. res, err := c.doRequest("json")
  12050. if res != nil && res.StatusCode == http.StatusNotModified {
  12051. if res.Body != nil {
  12052. res.Body.Close()
  12053. }
  12054. return nil, &googleapi.Error{
  12055. Code: res.StatusCode,
  12056. Header: res.Header,
  12057. }
  12058. }
  12059. if err != nil {
  12060. return nil, err
  12061. }
  12062. defer googleapi.CloseBody(res)
  12063. if err := googleapi.CheckResponse(res); err != nil {
  12064. return nil, err
  12065. }
  12066. ret := &AccountPermissionGroupsListResponse{
  12067. ServerResponse: googleapi.ServerResponse{
  12068. Header: res.Header,
  12069. HTTPStatusCode: res.StatusCode,
  12070. },
  12071. }
  12072. target := &ret
  12073. if err := gensupport.DecodeResponse(target, res); err != nil {
  12074. return nil, err
  12075. }
  12076. return ret, nil
  12077. // {
  12078. // "description": "Retrieves the list of account permission groups.",
  12079. // "httpMethod": "GET",
  12080. // "id": "dfareporting.accountPermissionGroups.list",
  12081. // "parameterOrder": [
  12082. // "profileId"
  12083. // ],
  12084. // "parameters": {
  12085. // "profileId": {
  12086. // "description": "User profile ID associated with this request.",
  12087. // "format": "int64",
  12088. // "location": "path",
  12089. // "required": true,
  12090. // "type": "string"
  12091. // }
  12092. // },
  12093. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12094. // "response": {
  12095. // "$ref": "AccountPermissionGroupsListResponse"
  12096. // },
  12097. // "scopes": [
  12098. // "https://www.googleapis.com/auth/dfatrafficking"
  12099. // ]
  12100. // }
  12101. }
  12102. // method id "dfareporting.accountPermissions.get":
  12103. type AccountPermissionsGetCall struct {
  12104. s *Service
  12105. profileId int64
  12106. id int64
  12107. urlParams_ gensupport.URLParams
  12108. ifNoneMatch_ string
  12109. ctx_ context.Context
  12110. header_ http.Header
  12111. }
  12112. // Get: Gets one account permission by ID.
  12113. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12114. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12115. c.profileId = profileId
  12116. c.id = id
  12117. return c
  12118. }
  12119. // Fields allows partial responses to be retrieved. See
  12120. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12121. // for more information.
  12122. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12123. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12124. return c
  12125. }
  12126. // IfNoneMatch sets the optional parameter which makes the operation
  12127. // fail if the object's ETag matches the given value. This is useful for
  12128. // getting updates only after the object has changed since the last
  12129. // request. Use googleapi.IsNotModified to check whether the response
  12130. // error from Do is the result of In-None-Match.
  12131. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12132. c.ifNoneMatch_ = entityTag
  12133. return c
  12134. }
  12135. // Context sets the context to be used in this call's Do method. Any
  12136. // pending HTTP request will be aborted if the provided context is
  12137. // canceled.
  12138. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12139. c.ctx_ = ctx
  12140. return c
  12141. }
  12142. // Header returns an http.Header that can be modified by the caller to
  12143. // add HTTP headers to the request.
  12144. func (c *AccountPermissionsGetCall) Header() http.Header {
  12145. if c.header_ == nil {
  12146. c.header_ = make(http.Header)
  12147. }
  12148. return c.header_
  12149. }
  12150. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12151. reqHeaders := make(http.Header)
  12152. for k, v := range c.header_ {
  12153. reqHeaders[k] = v
  12154. }
  12155. reqHeaders.Set("User-Agent", c.s.userAgent())
  12156. if c.ifNoneMatch_ != "" {
  12157. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12158. }
  12159. var body io.Reader = nil
  12160. c.urlParams_.Set("alt", alt)
  12161. c.urlParams_.Set("prettyPrint", "false")
  12162. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12163. urls += "?" + c.urlParams_.Encode()
  12164. req, err := http.NewRequest("GET", urls, body)
  12165. if err != nil {
  12166. return nil, err
  12167. }
  12168. req.Header = reqHeaders
  12169. googleapi.Expand(req.URL, map[string]string{
  12170. "profileId": strconv.FormatInt(c.profileId, 10),
  12171. "id": strconv.FormatInt(c.id, 10),
  12172. })
  12173. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12174. }
  12175. // Do executes the "dfareporting.accountPermissions.get" call.
  12176. // Exactly one of *AccountPermission or error will be non-nil. Any
  12177. // non-2xx status code is an error. Response headers are in either
  12178. // *AccountPermission.ServerResponse.Header or (if a response was
  12179. // returned at all) in error.(*googleapi.Error).Header. Use
  12180. // googleapi.IsNotModified to check whether the returned error was
  12181. // because http.StatusNotModified was returned.
  12182. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12183. gensupport.SetOptions(c.urlParams_, opts...)
  12184. res, err := c.doRequest("json")
  12185. if res != nil && res.StatusCode == http.StatusNotModified {
  12186. if res.Body != nil {
  12187. res.Body.Close()
  12188. }
  12189. return nil, &googleapi.Error{
  12190. Code: res.StatusCode,
  12191. Header: res.Header,
  12192. }
  12193. }
  12194. if err != nil {
  12195. return nil, err
  12196. }
  12197. defer googleapi.CloseBody(res)
  12198. if err := googleapi.CheckResponse(res); err != nil {
  12199. return nil, err
  12200. }
  12201. ret := &AccountPermission{
  12202. ServerResponse: googleapi.ServerResponse{
  12203. Header: res.Header,
  12204. HTTPStatusCode: res.StatusCode,
  12205. },
  12206. }
  12207. target := &ret
  12208. if err := gensupport.DecodeResponse(target, res); err != nil {
  12209. return nil, err
  12210. }
  12211. return ret, nil
  12212. // {
  12213. // "description": "Gets one account permission by ID.",
  12214. // "httpMethod": "GET",
  12215. // "id": "dfareporting.accountPermissions.get",
  12216. // "parameterOrder": [
  12217. // "profileId",
  12218. // "id"
  12219. // ],
  12220. // "parameters": {
  12221. // "id": {
  12222. // "description": "Account permission ID.",
  12223. // "format": "int64",
  12224. // "location": "path",
  12225. // "required": true,
  12226. // "type": "string"
  12227. // },
  12228. // "profileId": {
  12229. // "description": "User profile ID associated with this request.",
  12230. // "format": "int64",
  12231. // "location": "path",
  12232. // "required": true,
  12233. // "type": "string"
  12234. // }
  12235. // },
  12236. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12237. // "response": {
  12238. // "$ref": "AccountPermission"
  12239. // },
  12240. // "scopes": [
  12241. // "https://www.googleapis.com/auth/dfatrafficking"
  12242. // ]
  12243. // }
  12244. }
  12245. // method id "dfareporting.accountPermissions.list":
  12246. type AccountPermissionsListCall struct {
  12247. s *Service
  12248. profileId int64
  12249. urlParams_ gensupport.URLParams
  12250. ifNoneMatch_ string
  12251. ctx_ context.Context
  12252. header_ http.Header
  12253. }
  12254. // List: Retrieves the list of account permissions.
  12255. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12256. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12257. c.profileId = profileId
  12258. return c
  12259. }
  12260. // Fields allows partial responses to be retrieved. See
  12261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12262. // for more information.
  12263. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12265. return c
  12266. }
  12267. // IfNoneMatch sets the optional parameter which makes the operation
  12268. // fail if the object's ETag matches the given value. This is useful for
  12269. // getting updates only after the object has changed since the last
  12270. // request. Use googleapi.IsNotModified to check whether the response
  12271. // error from Do is the result of In-None-Match.
  12272. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12273. c.ifNoneMatch_ = entityTag
  12274. return c
  12275. }
  12276. // Context sets the context to be used in this call's Do method. Any
  12277. // pending HTTP request will be aborted if the provided context is
  12278. // canceled.
  12279. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12280. c.ctx_ = ctx
  12281. return c
  12282. }
  12283. // Header returns an http.Header that can be modified by the caller to
  12284. // add HTTP headers to the request.
  12285. func (c *AccountPermissionsListCall) Header() http.Header {
  12286. if c.header_ == nil {
  12287. c.header_ = make(http.Header)
  12288. }
  12289. return c.header_
  12290. }
  12291. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12292. reqHeaders := make(http.Header)
  12293. for k, v := range c.header_ {
  12294. reqHeaders[k] = v
  12295. }
  12296. reqHeaders.Set("User-Agent", c.s.userAgent())
  12297. if c.ifNoneMatch_ != "" {
  12298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12299. }
  12300. var body io.Reader = nil
  12301. c.urlParams_.Set("alt", alt)
  12302. c.urlParams_.Set("prettyPrint", "false")
  12303. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12304. urls += "?" + c.urlParams_.Encode()
  12305. req, err := http.NewRequest("GET", urls, body)
  12306. if err != nil {
  12307. return nil, err
  12308. }
  12309. req.Header = reqHeaders
  12310. googleapi.Expand(req.URL, map[string]string{
  12311. "profileId": strconv.FormatInt(c.profileId, 10),
  12312. })
  12313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12314. }
  12315. // Do executes the "dfareporting.accountPermissions.list" call.
  12316. // Exactly one of *AccountPermissionsListResponse or error will be
  12317. // non-nil. Any non-2xx status code is an error. Response headers are in
  12318. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12319. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12320. // googleapi.IsNotModified to check whether the returned error was
  12321. // because http.StatusNotModified was returned.
  12322. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12323. gensupport.SetOptions(c.urlParams_, opts...)
  12324. res, err := c.doRequest("json")
  12325. if res != nil && res.StatusCode == http.StatusNotModified {
  12326. if res.Body != nil {
  12327. res.Body.Close()
  12328. }
  12329. return nil, &googleapi.Error{
  12330. Code: res.StatusCode,
  12331. Header: res.Header,
  12332. }
  12333. }
  12334. if err != nil {
  12335. return nil, err
  12336. }
  12337. defer googleapi.CloseBody(res)
  12338. if err := googleapi.CheckResponse(res); err != nil {
  12339. return nil, err
  12340. }
  12341. ret := &AccountPermissionsListResponse{
  12342. ServerResponse: googleapi.ServerResponse{
  12343. Header: res.Header,
  12344. HTTPStatusCode: res.StatusCode,
  12345. },
  12346. }
  12347. target := &ret
  12348. if err := gensupport.DecodeResponse(target, res); err != nil {
  12349. return nil, err
  12350. }
  12351. return ret, nil
  12352. // {
  12353. // "description": "Retrieves the list of account permissions.",
  12354. // "httpMethod": "GET",
  12355. // "id": "dfareporting.accountPermissions.list",
  12356. // "parameterOrder": [
  12357. // "profileId"
  12358. // ],
  12359. // "parameters": {
  12360. // "profileId": {
  12361. // "description": "User profile ID associated with this request.",
  12362. // "format": "int64",
  12363. // "location": "path",
  12364. // "required": true,
  12365. // "type": "string"
  12366. // }
  12367. // },
  12368. // "path": "userprofiles/{profileId}/accountPermissions",
  12369. // "response": {
  12370. // "$ref": "AccountPermissionsListResponse"
  12371. // },
  12372. // "scopes": [
  12373. // "https://www.googleapis.com/auth/dfatrafficking"
  12374. // ]
  12375. // }
  12376. }
  12377. // method id "dfareporting.accountUserProfiles.get":
  12378. type AccountUserProfilesGetCall struct {
  12379. s *Service
  12380. profileId int64
  12381. id int64
  12382. urlParams_ gensupport.URLParams
  12383. ifNoneMatch_ string
  12384. ctx_ context.Context
  12385. header_ http.Header
  12386. }
  12387. // Get: Gets one account user profile by ID.
  12388. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12389. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12390. c.profileId = profileId
  12391. c.id = id
  12392. return c
  12393. }
  12394. // Fields allows partial responses to be retrieved. See
  12395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12396. // for more information.
  12397. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12399. return c
  12400. }
  12401. // IfNoneMatch sets the optional parameter which makes the operation
  12402. // fail if the object's ETag matches the given value. This is useful for
  12403. // getting updates only after the object has changed since the last
  12404. // request. Use googleapi.IsNotModified to check whether the response
  12405. // error from Do is the result of In-None-Match.
  12406. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12407. c.ifNoneMatch_ = entityTag
  12408. return c
  12409. }
  12410. // Context sets the context to be used in this call's Do method. Any
  12411. // pending HTTP request will be aborted if the provided context is
  12412. // canceled.
  12413. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12414. c.ctx_ = ctx
  12415. return c
  12416. }
  12417. // Header returns an http.Header that can be modified by the caller to
  12418. // add HTTP headers to the request.
  12419. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12420. if c.header_ == nil {
  12421. c.header_ = make(http.Header)
  12422. }
  12423. return c.header_
  12424. }
  12425. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12426. reqHeaders := make(http.Header)
  12427. for k, v := range c.header_ {
  12428. reqHeaders[k] = v
  12429. }
  12430. reqHeaders.Set("User-Agent", c.s.userAgent())
  12431. if c.ifNoneMatch_ != "" {
  12432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12433. }
  12434. var body io.Reader = nil
  12435. c.urlParams_.Set("alt", alt)
  12436. c.urlParams_.Set("prettyPrint", "false")
  12437. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12438. urls += "?" + c.urlParams_.Encode()
  12439. req, err := http.NewRequest("GET", urls, body)
  12440. if err != nil {
  12441. return nil, err
  12442. }
  12443. req.Header = reqHeaders
  12444. googleapi.Expand(req.URL, map[string]string{
  12445. "profileId": strconv.FormatInt(c.profileId, 10),
  12446. "id": strconv.FormatInt(c.id, 10),
  12447. })
  12448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12449. }
  12450. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12451. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12452. // non-2xx status code is an error. Response headers are in either
  12453. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12454. // returned at all) in error.(*googleapi.Error).Header. Use
  12455. // googleapi.IsNotModified to check whether the returned error was
  12456. // because http.StatusNotModified was returned.
  12457. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12458. gensupport.SetOptions(c.urlParams_, opts...)
  12459. res, err := c.doRequest("json")
  12460. if res != nil && res.StatusCode == http.StatusNotModified {
  12461. if res.Body != nil {
  12462. res.Body.Close()
  12463. }
  12464. return nil, &googleapi.Error{
  12465. Code: res.StatusCode,
  12466. Header: res.Header,
  12467. }
  12468. }
  12469. if err != nil {
  12470. return nil, err
  12471. }
  12472. defer googleapi.CloseBody(res)
  12473. if err := googleapi.CheckResponse(res); err != nil {
  12474. return nil, err
  12475. }
  12476. ret := &AccountUserProfile{
  12477. ServerResponse: googleapi.ServerResponse{
  12478. Header: res.Header,
  12479. HTTPStatusCode: res.StatusCode,
  12480. },
  12481. }
  12482. target := &ret
  12483. if err := gensupport.DecodeResponse(target, res); err != nil {
  12484. return nil, err
  12485. }
  12486. return ret, nil
  12487. // {
  12488. // "description": "Gets one account user profile by ID.",
  12489. // "httpMethod": "GET",
  12490. // "id": "dfareporting.accountUserProfiles.get",
  12491. // "parameterOrder": [
  12492. // "profileId",
  12493. // "id"
  12494. // ],
  12495. // "parameters": {
  12496. // "id": {
  12497. // "description": "User profile ID.",
  12498. // "format": "int64",
  12499. // "location": "path",
  12500. // "required": true,
  12501. // "type": "string"
  12502. // },
  12503. // "profileId": {
  12504. // "description": "User profile ID associated with this request.",
  12505. // "format": "int64",
  12506. // "location": "path",
  12507. // "required": true,
  12508. // "type": "string"
  12509. // }
  12510. // },
  12511. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12512. // "response": {
  12513. // "$ref": "AccountUserProfile"
  12514. // },
  12515. // "scopes": [
  12516. // "https://www.googleapis.com/auth/dfatrafficking"
  12517. // ]
  12518. // }
  12519. }
  12520. // method id "dfareporting.accountUserProfiles.insert":
  12521. type AccountUserProfilesInsertCall struct {
  12522. s *Service
  12523. profileId int64
  12524. accountuserprofile *AccountUserProfile
  12525. urlParams_ gensupport.URLParams
  12526. ctx_ context.Context
  12527. header_ http.Header
  12528. }
  12529. // Insert: Inserts a new account user profile.
  12530. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12531. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12532. c.profileId = profileId
  12533. c.accountuserprofile = accountuserprofile
  12534. return c
  12535. }
  12536. // Fields allows partial responses to be retrieved. See
  12537. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12538. // for more information.
  12539. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12540. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12541. return c
  12542. }
  12543. // Context sets the context to be used in this call's Do method. Any
  12544. // pending HTTP request will be aborted if the provided context is
  12545. // canceled.
  12546. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12547. c.ctx_ = ctx
  12548. return c
  12549. }
  12550. // Header returns an http.Header that can be modified by the caller to
  12551. // add HTTP headers to the request.
  12552. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12553. if c.header_ == nil {
  12554. c.header_ = make(http.Header)
  12555. }
  12556. return c.header_
  12557. }
  12558. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12559. reqHeaders := make(http.Header)
  12560. for k, v := range c.header_ {
  12561. reqHeaders[k] = v
  12562. }
  12563. reqHeaders.Set("User-Agent", c.s.userAgent())
  12564. var body io.Reader = nil
  12565. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12566. if err != nil {
  12567. return nil, err
  12568. }
  12569. reqHeaders.Set("Content-Type", "application/json")
  12570. c.urlParams_.Set("alt", alt)
  12571. c.urlParams_.Set("prettyPrint", "false")
  12572. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12573. urls += "?" + c.urlParams_.Encode()
  12574. req, err := http.NewRequest("POST", urls, body)
  12575. if err != nil {
  12576. return nil, err
  12577. }
  12578. req.Header = reqHeaders
  12579. googleapi.Expand(req.URL, map[string]string{
  12580. "profileId": strconv.FormatInt(c.profileId, 10),
  12581. })
  12582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12583. }
  12584. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12585. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12586. // non-2xx status code is an error. Response headers are in either
  12587. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12588. // returned at all) in error.(*googleapi.Error).Header. Use
  12589. // googleapi.IsNotModified to check whether the returned error was
  12590. // because http.StatusNotModified was returned.
  12591. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12592. gensupport.SetOptions(c.urlParams_, opts...)
  12593. res, err := c.doRequest("json")
  12594. if res != nil && res.StatusCode == http.StatusNotModified {
  12595. if res.Body != nil {
  12596. res.Body.Close()
  12597. }
  12598. return nil, &googleapi.Error{
  12599. Code: res.StatusCode,
  12600. Header: res.Header,
  12601. }
  12602. }
  12603. if err != nil {
  12604. return nil, err
  12605. }
  12606. defer googleapi.CloseBody(res)
  12607. if err := googleapi.CheckResponse(res); err != nil {
  12608. return nil, err
  12609. }
  12610. ret := &AccountUserProfile{
  12611. ServerResponse: googleapi.ServerResponse{
  12612. Header: res.Header,
  12613. HTTPStatusCode: res.StatusCode,
  12614. },
  12615. }
  12616. target := &ret
  12617. if err := gensupport.DecodeResponse(target, res); err != nil {
  12618. return nil, err
  12619. }
  12620. return ret, nil
  12621. // {
  12622. // "description": "Inserts a new account user profile.",
  12623. // "httpMethod": "POST",
  12624. // "id": "dfareporting.accountUserProfiles.insert",
  12625. // "parameterOrder": [
  12626. // "profileId"
  12627. // ],
  12628. // "parameters": {
  12629. // "profileId": {
  12630. // "description": "User profile ID associated with this request.",
  12631. // "format": "int64",
  12632. // "location": "path",
  12633. // "required": true,
  12634. // "type": "string"
  12635. // }
  12636. // },
  12637. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12638. // "request": {
  12639. // "$ref": "AccountUserProfile"
  12640. // },
  12641. // "response": {
  12642. // "$ref": "AccountUserProfile"
  12643. // },
  12644. // "scopes": [
  12645. // "https://www.googleapis.com/auth/dfatrafficking"
  12646. // ]
  12647. // }
  12648. }
  12649. // method id "dfareporting.accountUserProfiles.list":
  12650. type AccountUserProfilesListCall struct {
  12651. s *Service
  12652. profileId int64
  12653. urlParams_ gensupport.URLParams
  12654. ifNoneMatch_ string
  12655. ctx_ context.Context
  12656. header_ http.Header
  12657. }
  12658. // List: Retrieves a list of account user profiles, possibly filtered.
  12659. // This method supports paging.
  12660. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12661. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12662. c.profileId = profileId
  12663. return c
  12664. }
  12665. // Active sets the optional parameter "active": Select only active user
  12666. // profiles.
  12667. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12668. c.urlParams_.Set("active", fmt.Sprint(active))
  12669. return c
  12670. }
  12671. // Ids sets the optional parameter "ids": Select only user profiles with
  12672. // these IDs.
  12673. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12674. var ids_ []string
  12675. for _, v := range ids {
  12676. ids_ = append(ids_, fmt.Sprint(v))
  12677. }
  12678. c.urlParams_.SetMulti("ids", ids_)
  12679. return c
  12680. }
  12681. // MaxResults sets the optional parameter "maxResults": Maximum number
  12682. // of results to return.
  12683. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12684. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12685. return c
  12686. }
  12687. // PageToken sets the optional parameter "pageToken": Value of the
  12688. // nextPageToken from the previous result page.
  12689. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12690. c.urlParams_.Set("pageToken", pageToken)
  12691. return c
  12692. }
  12693. // SearchString sets the optional parameter "searchString": Allows
  12694. // searching for objects by name, ID or email. Wildcards (*) are
  12695. // allowed. For example, "user profile*2015" will return objects with
  12696. // names like "user profile June 2015", "user profile April 2015", or
  12697. // simply "user profile 2015". Most of the searches also add wildcards
  12698. // implicitly at the start and the end of the search string. For
  12699. // example, a search string of "user profile" will match objects with
  12700. // name "my user profile", "user profile 2015", or simply "user
  12701. // profile".
  12702. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12703. c.urlParams_.Set("searchString", searchString)
  12704. return c
  12705. }
  12706. // SortField sets the optional parameter "sortField": Field by which to
  12707. // sort the list.
  12708. //
  12709. // Possible values:
  12710. // "ID" (default)
  12711. // "NAME"
  12712. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12713. c.urlParams_.Set("sortField", sortField)
  12714. return c
  12715. }
  12716. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12717. // results.
  12718. //
  12719. // Possible values:
  12720. // "ASCENDING" (default)
  12721. // "DESCENDING"
  12722. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12723. c.urlParams_.Set("sortOrder", sortOrder)
  12724. return c
  12725. }
  12726. // SubaccountId sets the optional parameter "subaccountId": Select only
  12727. // user profiles with the specified subaccount ID.
  12728. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12729. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12730. return c
  12731. }
  12732. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12733. // profiles with the specified user role ID.
  12734. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12735. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12736. return c
  12737. }
  12738. // Fields allows partial responses to be retrieved. See
  12739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12740. // for more information.
  12741. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12743. return c
  12744. }
  12745. // IfNoneMatch sets the optional parameter which makes the operation
  12746. // fail if the object's ETag matches the given value. This is useful for
  12747. // getting updates only after the object has changed since the last
  12748. // request. Use googleapi.IsNotModified to check whether the response
  12749. // error from Do is the result of In-None-Match.
  12750. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12751. c.ifNoneMatch_ = entityTag
  12752. return c
  12753. }
  12754. // Context sets the context to be used in this call's Do method. Any
  12755. // pending HTTP request will be aborted if the provided context is
  12756. // canceled.
  12757. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12758. c.ctx_ = ctx
  12759. return c
  12760. }
  12761. // Header returns an http.Header that can be modified by the caller to
  12762. // add HTTP headers to the request.
  12763. func (c *AccountUserProfilesListCall) Header() http.Header {
  12764. if c.header_ == nil {
  12765. c.header_ = make(http.Header)
  12766. }
  12767. return c.header_
  12768. }
  12769. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12770. reqHeaders := make(http.Header)
  12771. for k, v := range c.header_ {
  12772. reqHeaders[k] = v
  12773. }
  12774. reqHeaders.Set("User-Agent", c.s.userAgent())
  12775. if c.ifNoneMatch_ != "" {
  12776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12777. }
  12778. var body io.Reader = nil
  12779. c.urlParams_.Set("alt", alt)
  12780. c.urlParams_.Set("prettyPrint", "false")
  12781. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12782. urls += "?" + c.urlParams_.Encode()
  12783. req, err := http.NewRequest("GET", urls, body)
  12784. if err != nil {
  12785. return nil, err
  12786. }
  12787. req.Header = reqHeaders
  12788. googleapi.Expand(req.URL, map[string]string{
  12789. "profileId": strconv.FormatInt(c.profileId, 10),
  12790. })
  12791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12792. }
  12793. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12794. // Exactly one of *AccountUserProfilesListResponse or error will be
  12795. // non-nil. Any non-2xx status code is an error. Response headers are in
  12796. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12797. // a response was returned at all) in error.(*googleapi.Error).Header.
  12798. // Use googleapi.IsNotModified to check whether the returned error was
  12799. // because http.StatusNotModified was returned.
  12800. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12801. gensupport.SetOptions(c.urlParams_, opts...)
  12802. res, err := c.doRequest("json")
  12803. if res != nil && res.StatusCode == http.StatusNotModified {
  12804. if res.Body != nil {
  12805. res.Body.Close()
  12806. }
  12807. return nil, &googleapi.Error{
  12808. Code: res.StatusCode,
  12809. Header: res.Header,
  12810. }
  12811. }
  12812. if err != nil {
  12813. return nil, err
  12814. }
  12815. defer googleapi.CloseBody(res)
  12816. if err := googleapi.CheckResponse(res); err != nil {
  12817. return nil, err
  12818. }
  12819. ret := &AccountUserProfilesListResponse{
  12820. ServerResponse: googleapi.ServerResponse{
  12821. Header: res.Header,
  12822. HTTPStatusCode: res.StatusCode,
  12823. },
  12824. }
  12825. target := &ret
  12826. if err := gensupport.DecodeResponse(target, res); err != nil {
  12827. return nil, err
  12828. }
  12829. return ret, nil
  12830. // {
  12831. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  12832. // "httpMethod": "GET",
  12833. // "id": "dfareporting.accountUserProfiles.list",
  12834. // "parameterOrder": [
  12835. // "profileId"
  12836. // ],
  12837. // "parameters": {
  12838. // "active": {
  12839. // "description": "Select only active user profiles.",
  12840. // "location": "query",
  12841. // "type": "boolean"
  12842. // },
  12843. // "ids": {
  12844. // "description": "Select only user profiles with these IDs.",
  12845. // "format": "int64",
  12846. // "location": "query",
  12847. // "repeated": true,
  12848. // "type": "string"
  12849. // },
  12850. // "maxResults": {
  12851. // "default": "1000",
  12852. // "description": "Maximum number of results to return.",
  12853. // "format": "int32",
  12854. // "location": "query",
  12855. // "maximum": "1000",
  12856. // "minimum": "0",
  12857. // "type": "integer"
  12858. // },
  12859. // "pageToken": {
  12860. // "description": "Value of the nextPageToken from the previous result page.",
  12861. // "location": "query",
  12862. // "type": "string"
  12863. // },
  12864. // "profileId": {
  12865. // "description": "User profile ID associated with this request.",
  12866. // "format": "int64",
  12867. // "location": "path",
  12868. // "required": true,
  12869. // "type": "string"
  12870. // },
  12871. // "searchString": {
  12872. // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"user profile*2015\" will return objects with names like \"user profile June 2015\", \"user profile April 2015\", or simply \"user profile 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"user profile\" will match objects with name \"my user profile\", \"user profile 2015\", or simply \"user profile\".",
  12873. // "location": "query",
  12874. // "type": "string"
  12875. // },
  12876. // "sortField": {
  12877. // "default": "ID",
  12878. // "description": "Field by which to sort the list.",
  12879. // "enum": [
  12880. // "ID",
  12881. // "NAME"
  12882. // ],
  12883. // "enumDescriptions": [
  12884. // "",
  12885. // ""
  12886. // ],
  12887. // "location": "query",
  12888. // "type": "string"
  12889. // },
  12890. // "sortOrder": {
  12891. // "default": "ASCENDING",
  12892. // "description": "Order of sorted results.",
  12893. // "enum": [
  12894. // "ASCENDING",
  12895. // "DESCENDING"
  12896. // ],
  12897. // "enumDescriptions": [
  12898. // "",
  12899. // ""
  12900. // ],
  12901. // "location": "query",
  12902. // "type": "string"
  12903. // },
  12904. // "subaccountId": {
  12905. // "description": "Select only user profiles with the specified subaccount ID.",
  12906. // "format": "int64",
  12907. // "location": "query",
  12908. // "type": "string"
  12909. // },
  12910. // "userRoleId": {
  12911. // "description": "Select only user profiles with the specified user role ID.",
  12912. // "format": "int64",
  12913. // "location": "query",
  12914. // "type": "string"
  12915. // }
  12916. // },
  12917. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12918. // "response": {
  12919. // "$ref": "AccountUserProfilesListResponse"
  12920. // },
  12921. // "scopes": [
  12922. // "https://www.googleapis.com/auth/dfatrafficking"
  12923. // ]
  12924. // }
  12925. }
  12926. // Pages invokes f for each page of results.
  12927. // A non-nil error returned from f will halt the iteration.
  12928. // The provided context supersedes any context provided to the Context method.
  12929. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  12930. c.ctx_ = ctx
  12931. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12932. for {
  12933. x, err := c.Do()
  12934. if err != nil {
  12935. return err
  12936. }
  12937. if err := f(x); err != nil {
  12938. return err
  12939. }
  12940. if x.NextPageToken == "" {
  12941. return nil
  12942. }
  12943. c.PageToken(x.NextPageToken)
  12944. }
  12945. }
  12946. // method id "dfareporting.accountUserProfiles.patch":
  12947. type AccountUserProfilesPatchCall struct {
  12948. s *Service
  12949. profileId int64
  12950. accountuserprofile *AccountUserProfile
  12951. urlParams_ gensupport.URLParams
  12952. ctx_ context.Context
  12953. header_ http.Header
  12954. }
  12955. // Patch: Updates an existing account user profile. This method supports
  12956. // patch semantics.
  12957. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  12958. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12959. c.profileId = profileId
  12960. c.urlParams_.Set("id", fmt.Sprint(id))
  12961. c.accountuserprofile = accountuserprofile
  12962. return c
  12963. }
  12964. // Fields allows partial responses to be retrieved. See
  12965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12966. // for more information.
  12967. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  12968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12969. return c
  12970. }
  12971. // Context sets the context to be used in this call's Do method. Any
  12972. // pending HTTP request will be aborted if the provided context is
  12973. // canceled.
  12974. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  12975. c.ctx_ = ctx
  12976. return c
  12977. }
  12978. // Header returns an http.Header that can be modified by the caller to
  12979. // add HTTP headers to the request.
  12980. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  12981. if c.header_ == nil {
  12982. c.header_ = make(http.Header)
  12983. }
  12984. return c.header_
  12985. }
  12986. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12987. reqHeaders := make(http.Header)
  12988. for k, v := range c.header_ {
  12989. reqHeaders[k] = v
  12990. }
  12991. reqHeaders.Set("User-Agent", c.s.userAgent())
  12992. var body io.Reader = nil
  12993. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12994. if err != nil {
  12995. return nil, err
  12996. }
  12997. reqHeaders.Set("Content-Type", "application/json")
  12998. c.urlParams_.Set("alt", alt)
  12999. c.urlParams_.Set("prettyPrint", "false")
  13000. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13001. urls += "?" + c.urlParams_.Encode()
  13002. req, err := http.NewRequest("PATCH", urls, body)
  13003. if err != nil {
  13004. return nil, err
  13005. }
  13006. req.Header = reqHeaders
  13007. googleapi.Expand(req.URL, map[string]string{
  13008. "profileId": strconv.FormatInt(c.profileId, 10),
  13009. })
  13010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13011. }
  13012. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  13013. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13014. // non-2xx status code is an error. Response headers are in either
  13015. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13016. // returned at all) in error.(*googleapi.Error).Header. Use
  13017. // googleapi.IsNotModified to check whether the returned error was
  13018. // because http.StatusNotModified was returned.
  13019. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13020. gensupport.SetOptions(c.urlParams_, opts...)
  13021. res, err := c.doRequest("json")
  13022. if res != nil && res.StatusCode == http.StatusNotModified {
  13023. if res.Body != nil {
  13024. res.Body.Close()
  13025. }
  13026. return nil, &googleapi.Error{
  13027. Code: res.StatusCode,
  13028. Header: res.Header,
  13029. }
  13030. }
  13031. if err != nil {
  13032. return nil, err
  13033. }
  13034. defer googleapi.CloseBody(res)
  13035. if err := googleapi.CheckResponse(res); err != nil {
  13036. return nil, err
  13037. }
  13038. ret := &AccountUserProfile{
  13039. ServerResponse: googleapi.ServerResponse{
  13040. Header: res.Header,
  13041. HTTPStatusCode: res.StatusCode,
  13042. },
  13043. }
  13044. target := &ret
  13045. if err := gensupport.DecodeResponse(target, res); err != nil {
  13046. return nil, err
  13047. }
  13048. return ret, nil
  13049. // {
  13050. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13051. // "httpMethod": "PATCH",
  13052. // "id": "dfareporting.accountUserProfiles.patch",
  13053. // "parameterOrder": [
  13054. // "profileId",
  13055. // "id"
  13056. // ],
  13057. // "parameters": {
  13058. // "id": {
  13059. // "description": "User profile ID.",
  13060. // "format": "int64",
  13061. // "location": "query",
  13062. // "required": true,
  13063. // "type": "string"
  13064. // },
  13065. // "profileId": {
  13066. // "description": "User profile ID associated with this request.",
  13067. // "format": "int64",
  13068. // "location": "path",
  13069. // "required": true,
  13070. // "type": "string"
  13071. // }
  13072. // },
  13073. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13074. // "request": {
  13075. // "$ref": "AccountUserProfile"
  13076. // },
  13077. // "response": {
  13078. // "$ref": "AccountUserProfile"
  13079. // },
  13080. // "scopes": [
  13081. // "https://www.googleapis.com/auth/dfatrafficking"
  13082. // ]
  13083. // }
  13084. }
  13085. // method id "dfareporting.accountUserProfiles.update":
  13086. type AccountUserProfilesUpdateCall struct {
  13087. s *Service
  13088. profileId int64
  13089. accountuserprofile *AccountUserProfile
  13090. urlParams_ gensupport.URLParams
  13091. ctx_ context.Context
  13092. header_ http.Header
  13093. }
  13094. // Update: Updates an existing account user profile.
  13095. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13096. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13097. c.profileId = profileId
  13098. c.accountuserprofile = accountuserprofile
  13099. return c
  13100. }
  13101. // Fields allows partial responses to be retrieved. See
  13102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13103. // for more information.
  13104. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13106. return c
  13107. }
  13108. // Context sets the context to be used in this call's Do method. Any
  13109. // pending HTTP request will be aborted if the provided context is
  13110. // canceled.
  13111. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13112. c.ctx_ = ctx
  13113. return c
  13114. }
  13115. // Header returns an http.Header that can be modified by the caller to
  13116. // add HTTP headers to the request.
  13117. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13118. if c.header_ == nil {
  13119. c.header_ = make(http.Header)
  13120. }
  13121. return c.header_
  13122. }
  13123. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13124. reqHeaders := make(http.Header)
  13125. for k, v := range c.header_ {
  13126. reqHeaders[k] = v
  13127. }
  13128. reqHeaders.Set("User-Agent", c.s.userAgent())
  13129. var body io.Reader = nil
  13130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13131. if err != nil {
  13132. return nil, err
  13133. }
  13134. reqHeaders.Set("Content-Type", "application/json")
  13135. c.urlParams_.Set("alt", alt)
  13136. c.urlParams_.Set("prettyPrint", "false")
  13137. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13138. urls += "?" + c.urlParams_.Encode()
  13139. req, err := http.NewRequest("PUT", urls, body)
  13140. if err != nil {
  13141. return nil, err
  13142. }
  13143. req.Header = reqHeaders
  13144. googleapi.Expand(req.URL, map[string]string{
  13145. "profileId": strconv.FormatInt(c.profileId, 10),
  13146. })
  13147. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13148. }
  13149. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13150. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13151. // non-2xx status code is an error. Response headers are in either
  13152. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13153. // returned at all) in error.(*googleapi.Error).Header. Use
  13154. // googleapi.IsNotModified to check whether the returned error was
  13155. // because http.StatusNotModified was returned.
  13156. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13157. gensupport.SetOptions(c.urlParams_, opts...)
  13158. res, err := c.doRequest("json")
  13159. if res != nil && res.StatusCode == http.StatusNotModified {
  13160. if res.Body != nil {
  13161. res.Body.Close()
  13162. }
  13163. return nil, &googleapi.Error{
  13164. Code: res.StatusCode,
  13165. Header: res.Header,
  13166. }
  13167. }
  13168. if err != nil {
  13169. return nil, err
  13170. }
  13171. defer googleapi.CloseBody(res)
  13172. if err := googleapi.CheckResponse(res); err != nil {
  13173. return nil, err
  13174. }
  13175. ret := &AccountUserProfile{
  13176. ServerResponse: googleapi.ServerResponse{
  13177. Header: res.Header,
  13178. HTTPStatusCode: res.StatusCode,
  13179. },
  13180. }
  13181. target := &ret
  13182. if err := gensupport.DecodeResponse(target, res); err != nil {
  13183. return nil, err
  13184. }
  13185. return ret, nil
  13186. // {
  13187. // "description": "Updates an existing account user profile.",
  13188. // "httpMethod": "PUT",
  13189. // "id": "dfareporting.accountUserProfiles.update",
  13190. // "parameterOrder": [
  13191. // "profileId"
  13192. // ],
  13193. // "parameters": {
  13194. // "profileId": {
  13195. // "description": "User profile ID associated with this request.",
  13196. // "format": "int64",
  13197. // "location": "path",
  13198. // "required": true,
  13199. // "type": "string"
  13200. // }
  13201. // },
  13202. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13203. // "request": {
  13204. // "$ref": "AccountUserProfile"
  13205. // },
  13206. // "response": {
  13207. // "$ref": "AccountUserProfile"
  13208. // },
  13209. // "scopes": [
  13210. // "https://www.googleapis.com/auth/dfatrafficking"
  13211. // ]
  13212. // }
  13213. }
  13214. // method id "dfareporting.accounts.get":
  13215. type AccountsGetCall struct {
  13216. s *Service
  13217. profileId int64
  13218. id int64
  13219. urlParams_ gensupport.URLParams
  13220. ifNoneMatch_ string
  13221. ctx_ context.Context
  13222. header_ http.Header
  13223. }
  13224. // Get: Gets one account by ID.
  13225. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13226. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13227. c.profileId = profileId
  13228. c.id = id
  13229. return c
  13230. }
  13231. // Fields allows partial responses to be retrieved. See
  13232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13233. // for more information.
  13234. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13236. return c
  13237. }
  13238. // IfNoneMatch sets the optional parameter which makes the operation
  13239. // fail if the object's ETag matches the given value. This is useful for
  13240. // getting updates only after the object has changed since the last
  13241. // request. Use googleapi.IsNotModified to check whether the response
  13242. // error from Do is the result of In-None-Match.
  13243. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13244. c.ifNoneMatch_ = entityTag
  13245. return c
  13246. }
  13247. // Context sets the context to be used in this call's Do method. Any
  13248. // pending HTTP request will be aborted if the provided context is
  13249. // canceled.
  13250. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13251. c.ctx_ = ctx
  13252. return c
  13253. }
  13254. // Header returns an http.Header that can be modified by the caller to
  13255. // add HTTP headers to the request.
  13256. func (c *AccountsGetCall) Header() http.Header {
  13257. if c.header_ == nil {
  13258. c.header_ = make(http.Header)
  13259. }
  13260. return c.header_
  13261. }
  13262. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13263. reqHeaders := make(http.Header)
  13264. for k, v := range c.header_ {
  13265. reqHeaders[k] = v
  13266. }
  13267. reqHeaders.Set("User-Agent", c.s.userAgent())
  13268. if c.ifNoneMatch_ != "" {
  13269. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13270. }
  13271. var body io.Reader = nil
  13272. c.urlParams_.Set("alt", alt)
  13273. c.urlParams_.Set("prettyPrint", "false")
  13274. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13275. urls += "?" + c.urlParams_.Encode()
  13276. req, err := http.NewRequest("GET", urls, body)
  13277. if err != nil {
  13278. return nil, err
  13279. }
  13280. req.Header = reqHeaders
  13281. googleapi.Expand(req.URL, map[string]string{
  13282. "profileId": strconv.FormatInt(c.profileId, 10),
  13283. "id": strconv.FormatInt(c.id, 10),
  13284. })
  13285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13286. }
  13287. // Do executes the "dfareporting.accounts.get" call.
  13288. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13289. // code is an error. Response headers are in either
  13290. // *Account.ServerResponse.Header or (if a response was returned at all)
  13291. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13292. // check whether the returned error was because http.StatusNotModified
  13293. // was returned.
  13294. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13295. gensupport.SetOptions(c.urlParams_, opts...)
  13296. res, err := c.doRequest("json")
  13297. if res != nil && res.StatusCode == http.StatusNotModified {
  13298. if res.Body != nil {
  13299. res.Body.Close()
  13300. }
  13301. return nil, &googleapi.Error{
  13302. Code: res.StatusCode,
  13303. Header: res.Header,
  13304. }
  13305. }
  13306. if err != nil {
  13307. return nil, err
  13308. }
  13309. defer googleapi.CloseBody(res)
  13310. if err := googleapi.CheckResponse(res); err != nil {
  13311. return nil, err
  13312. }
  13313. ret := &Account{
  13314. ServerResponse: googleapi.ServerResponse{
  13315. Header: res.Header,
  13316. HTTPStatusCode: res.StatusCode,
  13317. },
  13318. }
  13319. target := &ret
  13320. if err := gensupport.DecodeResponse(target, res); err != nil {
  13321. return nil, err
  13322. }
  13323. return ret, nil
  13324. // {
  13325. // "description": "Gets one account by ID.",
  13326. // "httpMethod": "GET",
  13327. // "id": "dfareporting.accounts.get",
  13328. // "parameterOrder": [
  13329. // "profileId",
  13330. // "id"
  13331. // ],
  13332. // "parameters": {
  13333. // "id": {
  13334. // "description": "Account ID.",
  13335. // "format": "int64",
  13336. // "location": "path",
  13337. // "required": true,
  13338. // "type": "string"
  13339. // },
  13340. // "profileId": {
  13341. // "description": "User profile ID associated with this request.",
  13342. // "format": "int64",
  13343. // "location": "path",
  13344. // "required": true,
  13345. // "type": "string"
  13346. // }
  13347. // },
  13348. // "path": "userprofiles/{profileId}/accounts/{id}",
  13349. // "response": {
  13350. // "$ref": "Account"
  13351. // },
  13352. // "scopes": [
  13353. // "https://www.googleapis.com/auth/dfatrafficking"
  13354. // ]
  13355. // }
  13356. }
  13357. // method id "dfareporting.accounts.list":
  13358. type AccountsListCall struct {
  13359. s *Service
  13360. profileId int64
  13361. urlParams_ gensupport.URLParams
  13362. ifNoneMatch_ string
  13363. ctx_ context.Context
  13364. header_ http.Header
  13365. }
  13366. // List: Retrieves the list of accounts, possibly filtered. This method
  13367. // supports paging.
  13368. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13369. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13370. c.profileId = profileId
  13371. return c
  13372. }
  13373. // Active sets the optional parameter "active": Select only active
  13374. // accounts. Don't set this field to select both active and non-active
  13375. // accounts.
  13376. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13377. c.urlParams_.Set("active", fmt.Sprint(active))
  13378. return c
  13379. }
  13380. // Ids sets the optional parameter "ids": Select only accounts with
  13381. // these IDs.
  13382. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13383. var ids_ []string
  13384. for _, v := range ids {
  13385. ids_ = append(ids_, fmt.Sprint(v))
  13386. }
  13387. c.urlParams_.SetMulti("ids", ids_)
  13388. return c
  13389. }
  13390. // MaxResults sets the optional parameter "maxResults": Maximum number
  13391. // of results to return.
  13392. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13393. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13394. return c
  13395. }
  13396. // PageToken sets the optional parameter "pageToken": Value of the
  13397. // nextPageToken from the previous result page.
  13398. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13399. c.urlParams_.Set("pageToken", pageToken)
  13400. return c
  13401. }
  13402. // SearchString sets the optional parameter "searchString": Allows
  13403. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13404. // example, "account*2015" will return objects with names like "account
  13405. // June 2015", "account April 2015", or simply "account 2015". Most of
  13406. // the searches also add wildcards implicitly at the start and the end
  13407. // of the search string. For example, a search string of "account" will
  13408. // match objects with name "my account", "account 2015", or simply
  13409. // "account".
  13410. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13411. c.urlParams_.Set("searchString", searchString)
  13412. return c
  13413. }
  13414. // SortField sets the optional parameter "sortField": Field by which to
  13415. // sort the list.
  13416. //
  13417. // Possible values:
  13418. // "ID" (default)
  13419. // "NAME"
  13420. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13421. c.urlParams_.Set("sortField", sortField)
  13422. return c
  13423. }
  13424. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13425. // results.
  13426. //
  13427. // Possible values:
  13428. // "ASCENDING" (default)
  13429. // "DESCENDING"
  13430. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13431. c.urlParams_.Set("sortOrder", sortOrder)
  13432. return c
  13433. }
  13434. // Fields allows partial responses to be retrieved. See
  13435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13436. // for more information.
  13437. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13439. return c
  13440. }
  13441. // IfNoneMatch sets the optional parameter which makes the operation
  13442. // fail if the object's ETag matches the given value. This is useful for
  13443. // getting updates only after the object has changed since the last
  13444. // request. Use googleapi.IsNotModified to check whether the response
  13445. // error from Do is the result of In-None-Match.
  13446. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13447. c.ifNoneMatch_ = entityTag
  13448. return c
  13449. }
  13450. // Context sets the context to be used in this call's Do method. Any
  13451. // pending HTTP request will be aborted if the provided context is
  13452. // canceled.
  13453. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13454. c.ctx_ = ctx
  13455. return c
  13456. }
  13457. // Header returns an http.Header that can be modified by the caller to
  13458. // add HTTP headers to the request.
  13459. func (c *AccountsListCall) Header() http.Header {
  13460. if c.header_ == nil {
  13461. c.header_ = make(http.Header)
  13462. }
  13463. return c.header_
  13464. }
  13465. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13466. reqHeaders := make(http.Header)
  13467. for k, v := range c.header_ {
  13468. reqHeaders[k] = v
  13469. }
  13470. reqHeaders.Set("User-Agent", c.s.userAgent())
  13471. if c.ifNoneMatch_ != "" {
  13472. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13473. }
  13474. var body io.Reader = nil
  13475. c.urlParams_.Set("alt", alt)
  13476. c.urlParams_.Set("prettyPrint", "false")
  13477. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13478. urls += "?" + c.urlParams_.Encode()
  13479. req, err := http.NewRequest("GET", urls, body)
  13480. if err != nil {
  13481. return nil, err
  13482. }
  13483. req.Header = reqHeaders
  13484. googleapi.Expand(req.URL, map[string]string{
  13485. "profileId": strconv.FormatInt(c.profileId, 10),
  13486. })
  13487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13488. }
  13489. // Do executes the "dfareporting.accounts.list" call.
  13490. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13491. // non-2xx status code is an error. Response headers are in either
  13492. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13493. // returned at all) in error.(*googleapi.Error).Header. Use
  13494. // googleapi.IsNotModified to check whether the returned error was
  13495. // because http.StatusNotModified was returned.
  13496. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13497. gensupport.SetOptions(c.urlParams_, opts...)
  13498. res, err := c.doRequest("json")
  13499. if res != nil && res.StatusCode == http.StatusNotModified {
  13500. if res.Body != nil {
  13501. res.Body.Close()
  13502. }
  13503. return nil, &googleapi.Error{
  13504. Code: res.StatusCode,
  13505. Header: res.Header,
  13506. }
  13507. }
  13508. if err != nil {
  13509. return nil, err
  13510. }
  13511. defer googleapi.CloseBody(res)
  13512. if err := googleapi.CheckResponse(res); err != nil {
  13513. return nil, err
  13514. }
  13515. ret := &AccountsListResponse{
  13516. ServerResponse: googleapi.ServerResponse{
  13517. Header: res.Header,
  13518. HTTPStatusCode: res.StatusCode,
  13519. },
  13520. }
  13521. target := &ret
  13522. if err := gensupport.DecodeResponse(target, res); err != nil {
  13523. return nil, err
  13524. }
  13525. return ret, nil
  13526. // {
  13527. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13528. // "httpMethod": "GET",
  13529. // "id": "dfareporting.accounts.list",
  13530. // "parameterOrder": [
  13531. // "profileId"
  13532. // ],
  13533. // "parameters": {
  13534. // "active": {
  13535. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13536. // "location": "query",
  13537. // "type": "boolean"
  13538. // },
  13539. // "ids": {
  13540. // "description": "Select only accounts with these IDs.",
  13541. // "format": "int64",
  13542. // "location": "query",
  13543. // "repeated": true,
  13544. // "type": "string"
  13545. // },
  13546. // "maxResults": {
  13547. // "default": "1000",
  13548. // "description": "Maximum number of results to return.",
  13549. // "format": "int32",
  13550. // "location": "query",
  13551. // "maximum": "1000",
  13552. // "minimum": "0",
  13553. // "type": "integer"
  13554. // },
  13555. // "pageToken": {
  13556. // "description": "Value of the nextPageToken from the previous result page.",
  13557. // "location": "query",
  13558. // "type": "string"
  13559. // },
  13560. // "profileId": {
  13561. // "description": "User profile ID associated with this request.",
  13562. // "format": "int64",
  13563. // "location": "path",
  13564. // "required": true,
  13565. // "type": "string"
  13566. // },
  13567. // "searchString": {
  13568. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"account*2015\" will return objects with names like \"account June 2015\", \"account April 2015\", or simply \"account 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"account\" will match objects with name \"my account\", \"account 2015\", or simply \"account\".",
  13569. // "location": "query",
  13570. // "type": "string"
  13571. // },
  13572. // "sortField": {
  13573. // "default": "ID",
  13574. // "description": "Field by which to sort the list.",
  13575. // "enum": [
  13576. // "ID",
  13577. // "NAME"
  13578. // ],
  13579. // "enumDescriptions": [
  13580. // "",
  13581. // ""
  13582. // ],
  13583. // "location": "query",
  13584. // "type": "string"
  13585. // },
  13586. // "sortOrder": {
  13587. // "default": "ASCENDING",
  13588. // "description": "Order of sorted results.",
  13589. // "enum": [
  13590. // "ASCENDING",
  13591. // "DESCENDING"
  13592. // ],
  13593. // "enumDescriptions": [
  13594. // "",
  13595. // ""
  13596. // ],
  13597. // "location": "query",
  13598. // "type": "string"
  13599. // }
  13600. // },
  13601. // "path": "userprofiles/{profileId}/accounts",
  13602. // "response": {
  13603. // "$ref": "AccountsListResponse"
  13604. // },
  13605. // "scopes": [
  13606. // "https://www.googleapis.com/auth/dfatrafficking"
  13607. // ]
  13608. // }
  13609. }
  13610. // Pages invokes f for each page of results.
  13611. // A non-nil error returned from f will halt the iteration.
  13612. // The provided context supersedes any context provided to the Context method.
  13613. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13614. c.ctx_ = ctx
  13615. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13616. for {
  13617. x, err := c.Do()
  13618. if err != nil {
  13619. return err
  13620. }
  13621. if err := f(x); err != nil {
  13622. return err
  13623. }
  13624. if x.NextPageToken == "" {
  13625. return nil
  13626. }
  13627. c.PageToken(x.NextPageToken)
  13628. }
  13629. }
  13630. // method id "dfareporting.accounts.patch":
  13631. type AccountsPatchCall struct {
  13632. s *Service
  13633. profileId int64
  13634. account *Account
  13635. urlParams_ gensupport.URLParams
  13636. ctx_ context.Context
  13637. header_ http.Header
  13638. }
  13639. // Patch: Updates an existing account. This method supports patch
  13640. // semantics.
  13641. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13642. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13643. c.profileId = profileId
  13644. c.urlParams_.Set("id", fmt.Sprint(id))
  13645. c.account = account
  13646. return c
  13647. }
  13648. // Fields allows partial responses to be retrieved. See
  13649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13650. // for more information.
  13651. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13653. return c
  13654. }
  13655. // Context sets the context to be used in this call's Do method. Any
  13656. // pending HTTP request will be aborted if the provided context is
  13657. // canceled.
  13658. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13659. c.ctx_ = ctx
  13660. return c
  13661. }
  13662. // Header returns an http.Header that can be modified by the caller to
  13663. // add HTTP headers to the request.
  13664. func (c *AccountsPatchCall) Header() http.Header {
  13665. if c.header_ == nil {
  13666. c.header_ = make(http.Header)
  13667. }
  13668. return c.header_
  13669. }
  13670. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13671. reqHeaders := make(http.Header)
  13672. for k, v := range c.header_ {
  13673. reqHeaders[k] = v
  13674. }
  13675. reqHeaders.Set("User-Agent", c.s.userAgent())
  13676. var body io.Reader = nil
  13677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13678. if err != nil {
  13679. return nil, err
  13680. }
  13681. reqHeaders.Set("Content-Type", "application/json")
  13682. c.urlParams_.Set("alt", alt)
  13683. c.urlParams_.Set("prettyPrint", "false")
  13684. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13685. urls += "?" + c.urlParams_.Encode()
  13686. req, err := http.NewRequest("PATCH", urls, body)
  13687. if err != nil {
  13688. return nil, err
  13689. }
  13690. req.Header = reqHeaders
  13691. googleapi.Expand(req.URL, map[string]string{
  13692. "profileId": strconv.FormatInt(c.profileId, 10),
  13693. })
  13694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13695. }
  13696. // Do executes the "dfareporting.accounts.patch" call.
  13697. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13698. // code is an error. Response headers are in either
  13699. // *Account.ServerResponse.Header or (if a response was returned at all)
  13700. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13701. // check whether the returned error was because http.StatusNotModified
  13702. // was returned.
  13703. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13704. gensupport.SetOptions(c.urlParams_, opts...)
  13705. res, err := c.doRequest("json")
  13706. if res != nil && res.StatusCode == http.StatusNotModified {
  13707. if res.Body != nil {
  13708. res.Body.Close()
  13709. }
  13710. return nil, &googleapi.Error{
  13711. Code: res.StatusCode,
  13712. Header: res.Header,
  13713. }
  13714. }
  13715. if err != nil {
  13716. return nil, err
  13717. }
  13718. defer googleapi.CloseBody(res)
  13719. if err := googleapi.CheckResponse(res); err != nil {
  13720. return nil, err
  13721. }
  13722. ret := &Account{
  13723. ServerResponse: googleapi.ServerResponse{
  13724. Header: res.Header,
  13725. HTTPStatusCode: res.StatusCode,
  13726. },
  13727. }
  13728. target := &ret
  13729. if err := gensupport.DecodeResponse(target, res); err != nil {
  13730. return nil, err
  13731. }
  13732. return ret, nil
  13733. // {
  13734. // "description": "Updates an existing account. This method supports patch semantics.",
  13735. // "httpMethod": "PATCH",
  13736. // "id": "dfareporting.accounts.patch",
  13737. // "parameterOrder": [
  13738. // "profileId",
  13739. // "id"
  13740. // ],
  13741. // "parameters": {
  13742. // "id": {
  13743. // "description": "Account ID.",
  13744. // "format": "int64",
  13745. // "location": "query",
  13746. // "required": true,
  13747. // "type": "string"
  13748. // },
  13749. // "profileId": {
  13750. // "description": "User profile ID associated with this request.",
  13751. // "format": "int64",
  13752. // "location": "path",
  13753. // "required": true,
  13754. // "type": "string"
  13755. // }
  13756. // },
  13757. // "path": "userprofiles/{profileId}/accounts",
  13758. // "request": {
  13759. // "$ref": "Account"
  13760. // },
  13761. // "response": {
  13762. // "$ref": "Account"
  13763. // },
  13764. // "scopes": [
  13765. // "https://www.googleapis.com/auth/dfatrafficking"
  13766. // ]
  13767. // }
  13768. }
  13769. // method id "dfareporting.accounts.update":
  13770. type AccountsUpdateCall struct {
  13771. s *Service
  13772. profileId int64
  13773. account *Account
  13774. urlParams_ gensupport.URLParams
  13775. ctx_ context.Context
  13776. header_ http.Header
  13777. }
  13778. // Update: Updates an existing account.
  13779. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13780. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13781. c.profileId = profileId
  13782. c.account = account
  13783. return c
  13784. }
  13785. // Fields allows partial responses to be retrieved. See
  13786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13787. // for more information.
  13788. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13790. return c
  13791. }
  13792. // Context sets the context to be used in this call's Do method. Any
  13793. // pending HTTP request will be aborted if the provided context is
  13794. // canceled.
  13795. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13796. c.ctx_ = ctx
  13797. return c
  13798. }
  13799. // Header returns an http.Header that can be modified by the caller to
  13800. // add HTTP headers to the request.
  13801. func (c *AccountsUpdateCall) Header() http.Header {
  13802. if c.header_ == nil {
  13803. c.header_ = make(http.Header)
  13804. }
  13805. return c.header_
  13806. }
  13807. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13808. reqHeaders := make(http.Header)
  13809. for k, v := range c.header_ {
  13810. reqHeaders[k] = v
  13811. }
  13812. reqHeaders.Set("User-Agent", c.s.userAgent())
  13813. var body io.Reader = nil
  13814. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13815. if err != nil {
  13816. return nil, err
  13817. }
  13818. reqHeaders.Set("Content-Type", "application/json")
  13819. c.urlParams_.Set("alt", alt)
  13820. c.urlParams_.Set("prettyPrint", "false")
  13821. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13822. urls += "?" + c.urlParams_.Encode()
  13823. req, err := http.NewRequest("PUT", urls, body)
  13824. if err != nil {
  13825. return nil, err
  13826. }
  13827. req.Header = reqHeaders
  13828. googleapi.Expand(req.URL, map[string]string{
  13829. "profileId": strconv.FormatInt(c.profileId, 10),
  13830. })
  13831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13832. }
  13833. // Do executes the "dfareporting.accounts.update" call.
  13834. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13835. // code is an error. Response headers are in either
  13836. // *Account.ServerResponse.Header or (if a response was returned at all)
  13837. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13838. // check whether the returned error was because http.StatusNotModified
  13839. // was returned.
  13840. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13841. gensupport.SetOptions(c.urlParams_, opts...)
  13842. res, err := c.doRequest("json")
  13843. if res != nil && res.StatusCode == http.StatusNotModified {
  13844. if res.Body != nil {
  13845. res.Body.Close()
  13846. }
  13847. return nil, &googleapi.Error{
  13848. Code: res.StatusCode,
  13849. Header: res.Header,
  13850. }
  13851. }
  13852. if err != nil {
  13853. return nil, err
  13854. }
  13855. defer googleapi.CloseBody(res)
  13856. if err := googleapi.CheckResponse(res); err != nil {
  13857. return nil, err
  13858. }
  13859. ret := &Account{
  13860. ServerResponse: googleapi.ServerResponse{
  13861. Header: res.Header,
  13862. HTTPStatusCode: res.StatusCode,
  13863. },
  13864. }
  13865. target := &ret
  13866. if err := gensupport.DecodeResponse(target, res); err != nil {
  13867. return nil, err
  13868. }
  13869. return ret, nil
  13870. // {
  13871. // "description": "Updates an existing account.",
  13872. // "httpMethod": "PUT",
  13873. // "id": "dfareporting.accounts.update",
  13874. // "parameterOrder": [
  13875. // "profileId"
  13876. // ],
  13877. // "parameters": {
  13878. // "profileId": {
  13879. // "description": "User profile ID associated with this request.",
  13880. // "format": "int64",
  13881. // "location": "path",
  13882. // "required": true,
  13883. // "type": "string"
  13884. // }
  13885. // },
  13886. // "path": "userprofiles/{profileId}/accounts",
  13887. // "request": {
  13888. // "$ref": "Account"
  13889. // },
  13890. // "response": {
  13891. // "$ref": "Account"
  13892. // },
  13893. // "scopes": [
  13894. // "https://www.googleapis.com/auth/dfatrafficking"
  13895. // ]
  13896. // }
  13897. }
  13898. // method id "dfareporting.ads.get":
  13899. type AdsGetCall struct {
  13900. s *Service
  13901. profileId int64
  13902. id int64
  13903. urlParams_ gensupport.URLParams
  13904. ifNoneMatch_ string
  13905. ctx_ context.Context
  13906. header_ http.Header
  13907. }
  13908. // Get: Gets one ad by ID.
  13909. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  13910. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13911. c.profileId = profileId
  13912. c.id = id
  13913. return c
  13914. }
  13915. // Fields allows partial responses to be retrieved. See
  13916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13917. // for more information.
  13918. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  13919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13920. return c
  13921. }
  13922. // IfNoneMatch sets the optional parameter which makes the operation
  13923. // fail if the object's ETag matches the given value. This is useful for
  13924. // getting updates only after the object has changed since the last
  13925. // request. Use googleapi.IsNotModified to check whether the response
  13926. // error from Do is the result of In-None-Match.
  13927. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  13928. c.ifNoneMatch_ = entityTag
  13929. return c
  13930. }
  13931. // Context sets the context to be used in this call's Do method. Any
  13932. // pending HTTP request will be aborted if the provided context is
  13933. // canceled.
  13934. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  13935. c.ctx_ = ctx
  13936. return c
  13937. }
  13938. // Header returns an http.Header that can be modified by the caller to
  13939. // add HTTP headers to the request.
  13940. func (c *AdsGetCall) Header() http.Header {
  13941. if c.header_ == nil {
  13942. c.header_ = make(http.Header)
  13943. }
  13944. return c.header_
  13945. }
  13946. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  13947. reqHeaders := make(http.Header)
  13948. for k, v := range c.header_ {
  13949. reqHeaders[k] = v
  13950. }
  13951. reqHeaders.Set("User-Agent", c.s.userAgent())
  13952. if c.ifNoneMatch_ != "" {
  13953. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13954. }
  13955. var body io.Reader = nil
  13956. c.urlParams_.Set("alt", alt)
  13957. c.urlParams_.Set("prettyPrint", "false")
  13958. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  13959. urls += "?" + c.urlParams_.Encode()
  13960. req, err := http.NewRequest("GET", urls, body)
  13961. if err != nil {
  13962. return nil, err
  13963. }
  13964. req.Header = reqHeaders
  13965. googleapi.Expand(req.URL, map[string]string{
  13966. "profileId": strconv.FormatInt(c.profileId, 10),
  13967. "id": strconv.FormatInt(c.id, 10),
  13968. })
  13969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13970. }
  13971. // Do executes the "dfareporting.ads.get" call.
  13972. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13973. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13974. // or (if a response was returned at all) in
  13975. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13976. // whether the returned error was because http.StatusNotModified was
  13977. // returned.
  13978. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13979. gensupport.SetOptions(c.urlParams_, opts...)
  13980. res, err := c.doRequest("json")
  13981. if res != nil && res.StatusCode == http.StatusNotModified {
  13982. if res.Body != nil {
  13983. res.Body.Close()
  13984. }
  13985. return nil, &googleapi.Error{
  13986. Code: res.StatusCode,
  13987. Header: res.Header,
  13988. }
  13989. }
  13990. if err != nil {
  13991. return nil, err
  13992. }
  13993. defer googleapi.CloseBody(res)
  13994. if err := googleapi.CheckResponse(res); err != nil {
  13995. return nil, err
  13996. }
  13997. ret := &Ad{
  13998. ServerResponse: googleapi.ServerResponse{
  13999. Header: res.Header,
  14000. HTTPStatusCode: res.StatusCode,
  14001. },
  14002. }
  14003. target := &ret
  14004. if err := gensupport.DecodeResponse(target, res); err != nil {
  14005. return nil, err
  14006. }
  14007. return ret, nil
  14008. // {
  14009. // "description": "Gets one ad by ID.",
  14010. // "httpMethod": "GET",
  14011. // "id": "dfareporting.ads.get",
  14012. // "parameterOrder": [
  14013. // "profileId",
  14014. // "id"
  14015. // ],
  14016. // "parameters": {
  14017. // "id": {
  14018. // "description": "Ad ID.",
  14019. // "format": "int64",
  14020. // "location": "path",
  14021. // "required": true,
  14022. // "type": "string"
  14023. // },
  14024. // "profileId": {
  14025. // "description": "User profile ID associated with this request.",
  14026. // "format": "int64",
  14027. // "location": "path",
  14028. // "required": true,
  14029. // "type": "string"
  14030. // }
  14031. // },
  14032. // "path": "userprofiles/{profileId}/ads/{id}",
  14033. // "response": {
  14034. // "$ref": "Ad"
  14035. // },
  14036. // "scopes": [
  14037. // "https://www.googleapis.com/auth/dfatrafficking"
  14038. // ]
  14039. // }
  14040. }
  14041. // method id "dfareporting.ads.insert":
  14042. type AdsInsertCall struct {
  14043. s *Service
  14044. profileId int64
  14045. ad *Ad
  14046. urlParams_ gensupport.URLParams
  14047. ctx_ context.Context
  14048. header_ http.Header
  14049. }
  14050. // Insert: Inserts a new ad.
  14051. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  14052. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14053. c.profileId = profileId
  14054. c.ad = ad
  14055. return c
  14056. }
  14057. // Fields allows partial responses to be retrieved. See
  14058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14059. // for more information.
  14060. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  14061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14062. return c
  14063. }
  14064. // Context sets the context to be used in this call's Do method. Any
  14065. // pending HTTP request will be aborted if the provided context is
  14066. // canceled.
  14067. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14068. c.ctx_ = ctx
  14069. return c
  14070. }
  14071. // Header returns an http.Header that can be modified by the caller to
  14072. // add HTTP headers to the request.
  14073. func (c *AdsInsertCall) Header() http.Header {
  14074. if c.header_ == nil {
  14075. c.header_ = make(http.Header)
  14076. }
  14077. return c.header_
  14078. }
  14079. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14080. reqHeaders := make(http.Header)
  14081. for k, v := range c.header_ {
  14082. reqHeaders[k] = v
  14083. }
  14084. reqHeaders.Set("User-Agent", c.s.userAgent())
  14085. var body io.Reader = nil
  14086. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14087. if err != nil {
  14088. return nil, err
  14089. }
  14090. reqHeaders.Set("Content-Type", "application/json")
  14091. c.urlParams_.Set("alt", alt)
  14092. c.urlParams_.Set("prettyPrint", "false")
  14093. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14094. urls += "?" + c.urlParams_.Encode()
  14095. req, err := http.NewRequest("POST", urls, body)
  14096. if err != nil {
  14097. return nil, err
  14098. }
  14099. req.Header = reqHeaders
  14100. googleapi.Expand(req.URL, map[string]string{
  14101. "profileId": strconv.FormatInt(c.profileId, 10),
  14102. })
  14103. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14104. }
  14105. // Do executes the "dfareporting.ads.insert" call.
  14106. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14107. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14108. // or (if a response was returned at all) in
  14109. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14110. // whether the returned error was because http.StatusNotModified was
  14111. // returned.
  14112. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14113. gensupport.SetOptions(c.urlParams_, opts...)
  14114. res, err := c.doRequest("json")
  14115. if res != nil && res.StatusCode == http.StatusNotModified {
  14116. if res.Body != nil {
  14117. res.Body.Close()
  14118. }
  14119. return nil, &googleapi.Error{
  14120. Code: res.StatusCode,
  14121. Header: res.Header,
  14122. }
  14123. }
  14124. if err != nil {
  14125. return nil, err
  14126. }
  14127. defer googleapi.CloseBody(res)
  14128. if err := googleapi.CheckResponse(res); err != nil {
  14129. return nil, err
  14130. }
  14131. ret := &Ad{
  14132. ServerResponse: googleapi.ServerResponse{
  14133. Header: res.Header,
  14134. HTTPStatusCode: res.StatusCode,
  14135. },
  14136. }
  14137. target := &ret
  14138. if err := gensupport.DecodeResponse(target, res); err != nil {
  14139. return nil, err
  14140. }
  14141. return ret, nil
  14142. // {
  14143. // "description": "Inserts a new ad.",
  14144. // "httpMethod": "POST",
  14145. // "id": "dfareporting.ads.insert",
  14146. // "parameterOrder": [
  14147. // "profileId"
  14148. // ],
  14149. // "parameters": {
  14150. // "profileId": {
  14151. // "description": "User profile ID associated with this request.",
  14152. // "format": "int64",
  14153. // "location": "path",
  14154. // "required": true,
  14155. // "type": "string"
  14156. // }
  14157. // },
  14158. // "path": "userprofiles/{profileId}/ads",
  14159. // "request": {
  14160. // "$ref": "Ad"
  14161. // },
  14162. // "response": {
  14163. // "$ref": "Ad"
  14164. // },
  14165. // "scopes": [
  14166. // "https://www.googleapis.com/auth/dfatrafficking"
  14167. // ]
  14168. // }
  14169. }
  14170. // method id "dfareporting.ads.list":
  14171. type AdsListCall struct {
  14172. s *Service
  14173. profileId int64
  14174. urlParams_ gensupport.URLParams
  14175. ifNoneMatch_ string
  14176. ctx_ context.Context
  14177. header_ http.Header
  14178. }
  14179. // List: Retrieves a list of ads, possibly filtered. This method
  14180. // supports paging.
  14181. func (r *AdsService) List(profileId int64) *AdsListCall {
  14182. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14183. c.profileId = profileId
  14184. return c
  14185. }
  14186. // Active sets the optional parameter "active": Select only active ads.
  14187. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14188. c.urlParams_.Set("active", fmt.Sprint(active))
  14189. return c
  14190. }
  14191. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14192. // ads with this advertiser ID.
  14193. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14194. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14195. return c
  14196. }
  14197. // Archived sets the optional parameter "archived": Select only archived
  14198. // ads.
  14199. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14200. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14201. return c
  14202. }
  14203. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14204. // Select only ads with these audience segment IDs.
  14205. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14206. var audienceSegmentIds_ []string
  14207. for _, v := range audienceSegmentIds {
  14208. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14209. }
  14210. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14211. return c
  14212. }
  14213. // CampaignIds sets the optional parameter "campaignIds": Select only
  14214. // ads with these campaign IDs.
  14215. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14216. var campaignIds_ []string
  14217. for _, v := range campaignIds {
  14218. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14219. }
  14220. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14221. return c
  14222. }
  14223. // Compatibility sets the optional parameter "compatibility": Select
  14224. // default ads with the specified compatibility. Applicable when type is
  14225. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14226. // rendering either on desktop or on mobile devices for regular or
  14227. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14228. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14229. // in-stream video ads developed with the VAST standard.
  14230. //
  14231. // Possible values:
  14232. // "APP"
  14233. // "APP_INTERSTITIAL"
  14234. // "DISPLAY"
  14235. // "DISPLAY_INTERSTITIAL"
  14236. // "IN_STREAM_AUDIO"
  14237. // "IN_STREAM_VIDEO"
  14238. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14239. c.urlParams_.Set("compatibility", compatibility)
  14240. return c
  14241. }
  14242. // CreativeIds sets the optional parameter "creativeIds": Select only
  14243. // ads with these creative IDs assigned.
  14244. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14245. var creativeIds_ []string
  14246. for _, v := range creativeIds {
  14247. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14248. }
  14249. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14250. return c
  14251. }
  14252. // CreativeOptimizationConfigurationIds sets the optional parameter
  14253. // "creativeOptimizationConfigurationIds": Select only ads with these
  14254. // creative optimization configuration IDs.
  14255. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14256. var creativeOptimizationConfigurationIds_ []string
  14257. for _, v := range creativeOptimizationConfigurationIds {
  14258. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14259. }
  14260. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14261. return c
  14262. }
  14263. // DynamicClickTracker sets the optional parameter
  14264. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14265. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14266. // trackers. If false, select static click trackers. Leave unset to
  14267. // select both.
  14268. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14269. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14270. return c
  14271. }
  14272. // Ids sets the optional parameter "ids": Select only ads with these
  14273. // IDs.
  14274. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14275. var ids_ []string
  14276. for _, v := range ids {
  14277. ids_ = append(ids_, fmt.Sprint(v))
  14278. }
  14279. c.urlParams_.SetMulti("ids", ids_)
  14280. return c
  14281. }
  14282. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14283. // only ads with these landing page IDs.
  14284. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14285. var landingPageIds_ []string
  14286. for _, v := range landingPageIds {
  14287. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14288. }
  14289. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14290. return c
  14291. }
  14292. // MaxResults sets the optional parameter "maxResults": Maximum number
  14293. // of results to return.
  14294. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14295. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14296. return c
  14297. }
  14298. // OverriddenEventTagId sets the optional parameter
  14299. // "overriddenEventTagId": Select only ads with this event tag override
  14300. // ID.
  14301. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14302. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14303. return c
  14304. }
  14305. // PageToken sets the optional parameter "pageToken": Value of the
  14306. // nextPageToken from the previous result page.
  14307. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14308. c.urlParams_.Set("pageToken", pageToken)
  14309. return c
  14310. }
  14311. // PlacementIds sets the optional parameter "placementIds": Select only
  14312. // ads with these placement IDs assigned.
  14313. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14314. var placementIds_ []string
  14315. for _, v := range placementIds {
  14316. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14317. }
  14318. c.urlParams_.SetMulti("placementIds", placementIds_)
  14319. return c
  14320. }
  14321. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14322. // Select only ads whose list targeting expression use these remarketing
  14323. // list IDs.
  14324. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14325. var remarketingListIds_ []string
  14326. for _, v := range remarketingListIds {
  14327. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14328. }
  14329. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14330. return c
  14331. }
  14332. // SearchString sets the optional parameter "searchString": Allows
  14333. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14334. // example, "ad*2015" will return objects with names like "ad June
  14335. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14336. // also add wildcards implicitly at the start and the end of the search
  14337. // string. For example, a search string of "ad" will match objects with
  14338. // name "my ad", "ad 2015", or simply "ad".
  14339. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14340. c.urlParams_.Set("searchString", searchString)
  14341. return c
  14342. }
  14343. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14344. // these size IDs.
  14345. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14346. var sizeIds_ []string
  14347. for _, v := range sizeIds {
  14348. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14349. }
  14350. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14351. return c
  14352. }
  14353. // SortField sets the optional parameter "sortField": Field by which to
  14354. // sort the list.
  14355. //
  14356. // Possible values:
  14357. // "ID" (default)
  14358. // "NAME"
  14359. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14360. c.urlParams_.Set("sortField", sortField)
  14361. return c
  14362. }
  14363. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14364. // results.
  14365. //
  14366. // Possible values:
  14367. // "ASCENDING" (default)
  14368. // "DESCENDING"
  14369. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14370. c.urlParams_.Set("sortOrder", sortOrder)
  14371. return c
  14372. }
  14373. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14374. // ads that are SSL-compliant.
  14375. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14376. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14377. return c
  14378. }
  14379. // SslRequired sets the optional parameter "sslRequired": Select only
  14380. // ads that require SSL.
  14381. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14382. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14383. return c
  14384. }
  14385. // Type sets the optional parameter "type": Select only ads with these
  14386. // types.
  14387. //
  14388. // Possible values:
  14389. // "AD_SERVING_CLICK_TRACKER"
  14390. // "AD_SERVING_DEFAULT_AD"
  14391. // "AD_SERVING_STANDARD_AD"
  14392. // "AD_SERVING_TRACKING"
  14393. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14394. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14395. return c
  14396. }
  14397. // Fields allows partial responses to be retrieved. See
  14398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14399. // for more information.
  14400. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14402. return c
  14403. }
  14404. // IfNoneMatch sets the optional parameter which makes the operation
  14405. // fail if the object's ETag matches the given value. This is useful for
  14406. // getting updates only after the object has changed since the last
  14407. // request. Use googleapi.IsNotModified to check whether the response
  14408. // error from Do is the result of In-None-Match.
  14409. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14410. c.ifNoneMatch_ = entityTag
  14411. return c
  14412. }
  14413. // Context sets the context to be used in this call's Do method. Any
  14414. // pending HTTP request will be aborted if the provided context is
  14415. // canceled.
  14416. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14417. c.ctx_ = ctx
  14418. return c
  14419. }
  14420. // Header returns an http.Header that can be modified by the caller to
  14421. // add HTTP headers to the request.
  14422. func (c *AdsListCall) Header() http.Header {
  14423. if c.header_ == nil {
  14424. c.header_ = make(http.Header)
  14425. }
  14426. return c.header_
  14427. }
  14428. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14429. reqHeaders := make(http.Header)
  14430. for k, v := range c.header_ {
  14431. reqHeaders[k] = v
  14432. }
  14433. reqHeaders.Set("User-Agent", c.s.userAgent())
  14434. if c.ifNoneMatch_ != "" {
  14435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14436. }
  14437. var body io.Reader = nil
  14438. c.urlParams_.Set("alt", alt)
  14439. c.urlParams_.Set("prettyPrint", "false")
  14440. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14441. urls += "?" + c.urlParams_.Encode()
  14442. req, err := http.NewRequest("GET", urls, body)
  14443. if err != nil {
  14444. return nil, err
  14445. }
  14446. req.Header = reqHeaders
  14447. googleapi.Expand(req.URL, map[string]string{
  14448. "profileId": strconv.FormatInt(c.profileId, 10),
  14449. })
  14450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14451. }
  14452. // Do executes the "dfareporting.ads.list" call.
  14453. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14454. // status code is an error. Response headers are in either
  14455. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14456. // at all) in error.(*googleapi.Error).Header. Use
  14457. // googleapi.IsNotModified to check whether the returned error was
  14458. // because http.StatusNotModified was returned.
  14459. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14460. gensupport.SetOptions(c.urlParams_, opts...)
  14461. res, err := c.doRequest("json")
  14462. if res != nil && res.StatusCode == http.StatusNotModified {
  14463. if res.Body != nil {
  14464. res.Body.Close()
  14465. }
  14466. return nil, &googleapi.Error{
  14467. Code: res.StatusCode,
  14468. Header: res.Header,
  14469. }
  14470. }
  14471. if err != nil {
  14472. return nil, err
  14473. }
  14474. defer googleapi.CloseBody(res)
  14475. if err := googleapi.CheckResponse(res); err != nil {
  14476. return nil, err
  14477. }
  14478. ret := &AdsListResponse{
  14479. ServerResponse: googleapi.ServerResponse{
  14480. Header: res.Header,
  14481. HTTPStatusCode: res.StatusCode,
  14482. },
  14483. }
  14484. target := &ret
  14485. if err := gensupport.DecodeResponse(target, res); err != nil {
  14486. return nil, err
  14487. }
  14488. return ret, nil
  14489. // {
  14490. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14491. // "httpMethod": "GET",
  14492. // "id": "dfareporting.ads.list",
  14493. // "parameterOrder": [
  14494. // "profileId"
  14495. // ],
  14496. // "parameters": {
  14497. // "active": {
  14498. // "description": "Select only active ads.",
  14499. // "location": "query",
  14500. // "type": "boolean"
  14501. // },
  14502. // "advertiserId": {
  14503. // "description": "Select only ads with this advertiser ID.",
  14504. // "format": "int64",
  14505. // "location": "query",
  14506. // "type": "string"
  14507. // },
  14508. // "archived": {
  14509. // "description": "Select only archived ads.",
  14510. // "location": "query",
  14511. // "type": "boolean"
  14512. // },
  14513. // "audienceSegmentIds": {
  14514. // "description": "Select only ads with these audience segment IDs.",
  14515. // "format": "int64",
  14516. // "location": "query",
  14517. // "repeated": true,
  14518. // "type": "string"
  14519. // },
  14520. // "campaignIds": {
  14521. // "description": "Select only ads with these campaign IDs.",
  14522. // "format": "int64",
  14523. // "location": "query",
  14524. // "repeated": true,
  14525. // "type": "string"
  14526. // },
  14527. // "compatibility": {
  14528. // "description": "Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard.",
  14529. // "enum": [
  14530. // "APP",
  14531. // "APP_INTERSTITIAL",
  14532. // "DISPLAY",
  14533. // "DISPLAY_INTERSTITIAL",
  14534. // "IN_STREAM_AUDIO",
  14535. // "IN_STREAM_VIDEO"
  14536. // ],
  14537. // "enumDescriptions": [
  14538. // "",
  14539. // "",
  14540. // "",
  14541. // "",
  14542. // "",
  14543. // ""
  14544. // ],
  14545. // "location": "query",
  14546. // "type": "string"
  14547. // },
  14548. // "creativeIds": {
  14549. // "description": "Select only ads with these creative IDs assigned.",
  14550. // "format": "int64",
  14551. // "location": "query",
  14552. // "repeated": true,
  14553. // "type": "string"
  14554. // },
  14555. // "creativeOptimizationConfigurationIds": {
  14556. // "description": "Select only ads with these creative optimization configuration IDs.",
  14557. // "format": "int64",
  14558. // "location": "query",
  14559. // "repeated": true,
  14560. // "type": "string"
  14561. // },
  14562. // "dynamicClickTracker": {
  14563. // "description": "Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both.",
  14564. // "location": "query",
  14565. // "type": "boolean"
  14566. // },
  14567. // "ids": {
  14568. // "description": "Select only ads with these IDs.",
  14569. // "format": "int64",
  14570. // "location": "query",
  14571. // "repeated": true,
  14572. // "type": "string"
  14573. // },
  14574. // "landingPageIds": {
  14575. // "description": "Select only ads with these landing page IDs.",
  14576. // "format": "int64",
  14577. // "location": "query",
  14578. // "repeated": true,
  14579. // "type": "string"
  14580. // },
  14581. // "maxResults": {
  14582. // "default": "1000",
  14583. // "description": "Maximum number of results to return.",
  14584. // "format": "int32",
  14585. // "location": "query",
  14586. // "maximum": "1000",
  14587. // "minimum": "0",
  14588. // "type": "integer"
  14589. // },
  14590. // "overriddenEventTagId": {
  14591. // "description": "Select only ads with this event tag override ID.",
  14592. // "format": "int64",
  14593. // "location": "query",
  14594. // "type": "string"
  14595. // },
  14596. // "pageToken": {
  14597. // "description": "Value of the nextPageToken from the previous result page.",
  14598. // "location": "query",
  14599. // "type": "string"
  14600. // },
  14601. // "placementIds": {
  14602. // "description": "Select only ads with these placement IDs assigned.",
  14603. // "format": "int64",
  14604. // "location": "query",
  14605. // "repeated": true,
  14606. // "type": "string"
  14607. // },
  14608. // "profileId": {
  14609. // "description": "User profile ID associated with this request.",
  14610. // "format": "int64",
  14611. // "location": "path",
  14612. // "required": true,
  14613. // "type": "string"
  14614. // },
  14615. // "remarketingListIds": {
  14616. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14617. // "format": "int64",
  14618. // "location": "query",
  14619. // "repeated": true,
  14620. // "type": "string"
  14621. // },
  14622. // "searchString": {
  14623. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"ad*2015\" will return objects with names like \"ad June 2015\", \"ad April 2015\", or simply \"ad 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"ad\" will match objects with name \"my ad\", \"ad 2015\", or simply \"ad\".",
  14624. // "location": "query",
  14625. // "type": "string"
  14626. // },
  14627. // "sizeIds": {
  14628. // "description": "Select only ads with these size IDs.",
  14629. // "format": "int64",
  14630. // "location": "query",
  14631. // "repeated": true,
  14632. // "type": "string"
  14633. // },
  14634. // "sortField": {
  14635. // "default": "ID",
  14636. // "description": "Field by which to sort the list.",
  14637. // "enum": [
  14638. // "ID",
  14639. // "NAME"
  14640. // ],
  14641. // "enumDescriptions": [
  14642. // "",
  14643. // ""
  14644. // ],
  14645. // "location": "query",
  14646. // "type": "string"
  14647. // },
  14648. // "sortOrder": {
  14649. // "default": "ASCENDING",
  14650. // "description": "Order of sorted results.",
  14651. // "enum": [
  14652. // "ASCENDING",
  14653. // "DESCENDING"
  14654. // ],
  14655. // "enumDescriptions": [
  14656. // "",
  14657. // ""
  14658. // ],
  14659. // "location": "query",
  14660. // "type": "string"
  14661. // },
  14662. // "sslCompliant": {
  14663. // "description": "Select only ads that are SSL-compliant.",
  14664. // "location": "query",
  14665. // "type": "boolean"
  14666. // },
  14667. // "sslRequired": {
  14668. // "description": "Select only ads that require SSL.",
  14669. // "location": "query",
  14670. // "type": "boolean"
  14671. // },
  14672. // "type": {
  14673. // "description": "Select only ads with these types.",
  14674. // "enum": [
  14675. // "AD_SERVING_CLICK_TRACKER",
  14676. // "AD_SERVING_DEFAULT_AD",
  14677. // "AD_SERVING_STANDARD_AD",
  14678. // "AD_SERVING_TRACKING"
  14679. // ],
  14680. // "enumDescriptions": [
  14681. // "",
  14682. // "",
  14683. // "",
  14684. // ""
  14685. // ],
  14686. // "location": "query",
  14687. // "repeated": true,
  14688. // "type": "string"
  14689. // }
  14690. // },
  14691. // "path": "userprofiles/{profileId}/ads",
  14692. // "response": {
  14693. // "$ref": "AdsListResponse"
  14694. // },
  14695. // "scopes": [
  14696. // "https://www.googleapis.com/auth/dfatrafficking"
  14697. // ]
  14698. // }
  14699. }
  14700. // Pages invokes f for each page of results.
  14701. // A non-nil error returned from f will halt the iteration.
  14702. // The provided context supersedes any context provided to the Context method.
  14703. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14704. c.ctx_ = ctx
  14705. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14706. for {
  14707. x, err := c.Do()
  14708. if err != nil {
  14709. return err
  14710. }
  14711. if err := f(x); err != nil {
  14712. return err
  14713. }
  14714. if x.NextPageToken == "" {
  14715. return nil
  14716. }
  14717. c.PageToken(x.NextPageToken)
  14718. }
  14719. }
  14720. // method id "dfareporting.ads.patch":
  14721. type AdsPatchCall struct {
  14722. s *Service
  14723. profileId int64
  14724. ad *Ad
  14725. urlParams_ gensupport.URLParams
  14726. ctx_ context.Context
  14727. header_ http.Header
  14728. }
  14729. // Patch: Updates an existing ad. This method supports patch semantics.
  14730. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14731. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14732. c.profileId = profileId
  14733. c.urlParams_.Set("id", fmt.Sprint(id))
  14734. c.ad = ad
  14735. return c
  14736. }
  14737. // Fields allows partial responses to be retrieved. See
  14738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14739. // for more information.
  14740. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14742. return c
  14743. }
  14744. // Context sets the context to be used in this call's Do method. Any
  14745. // pending HTTP request will be aborted if the provided context is
  14746. // canceled.
  14747. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14748. c.ctx_ = ctx
  14749. return c
  14750. }
  14751. // Header returns an http.Header that can be modified by the caller to
  14752. // add HTTP headers to the request.
  14753. func (c *AdsPatchCall) Header() http.Header {
  14754. if c.header_ == nil {
  14755. c.header_ = make(http.Header)
  14756. }
  14757. return c.header_
  14758. }
  14759. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14760. reqHeaders := make(http.Header)
  14761. for k, v := range c.header_ {
  14762. reqHeaders[k] = v
  14763. }
  14764. reqHeaders.Set("User-Agent", c.s.userAgent())
  14765. var body io.Reader = nil
  14766. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14767. if err != nil {
  14768. return nil, err
  14769. }
  14770. reqHeaders.Set("Content-Type", "application/json")
  14771. c.urlParams_.Set("alt", alt)
  14772. c.urlParams_.Set("prettyPrint", "false")
  14773. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14774. urls += "?" + c.urlParams_.Encode()
  14775. req, err := http.NewRequest("PATCH", urls, body)
  14776. if err != nil {
  14777. return nil, err
  14778. }
  14779. req.Header = reqHeaders
  14780. googleapi.Expand(req.URL, map[string]string{
  14781. "profileId": strconv.FormatInt(c.profileId, 10),
  14782. })
  14783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14784. }
  14785. // Do executes the "dfareporting.ads.patch" call.
  14786. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14787. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14788. // or (if a response was returned at all) in
  14789. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14790. // whether the returned error was because http.StatusNotModified was
  14791. // returned.
  14792. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14793. gensupport.SetOptions(c.urlParams_, opts...)
  14794. res, err := c.doRequest("json")
  14795. if res != nil && res.StatusCode == http.StatusNotModified {
  14796. if res.Body != nil {
  14797. res.Body.Close()
  14798. }
  14799. return nil, &googleapi.Error{
  14800. Code: res.StatusCode,
  14801. Header: res.Header,
  14802. }
  14803. }
  14804. if err != nil {
  14805. return nil, err
  14806. }
  14807. defer googleapi.CloseBody(res)
  14808. if err := googleapi.CheckResponse(res); err != nil {
  14809. return nil, err
  14810. }
  14811. ret := &Ad{
  14812. ServerResponse: googleapi.ServerResponse{
  14813. Header: res.Header,
  14814. HTTPStatusCode: res.StatusCode,
  14815. },
  14816. }
  14817. target := &ret
  14818. if err := gensupport.DecodeResponse(target, res); err != nil {
  14819. return nil, err
  14820. }
  14821. return ret, nil
  14822. // {
  14823. // "description": "Updates an existing ad. This method supports patch semantics.",
  14824. // "httpMethod": "PATCH",
  14825. // "id": "dfareporting.ads.patch",
  14826. // "parameterOrder": [
  14827. // "profileId",
  14828. // "id"
  14829. // ],
  14830. // "parameters": {
  14831. // "id": {
  14832. // "description": "Ad ID.",
  14833. // "format": "int64",
  14834. // "location": "query",
  14835. // "required": true,
  14836. // "type": "string"
  14837. // },
  14838. // "profileId": {
  14839. // "description": "User profile ID associated with this request.",
  14840. // "format": "int64",
  14841. // "location": "path",
  14842. // "required": true,
  14843. // "type": "string"
  14844. // }
  14845. // },
  14846. // "path": "userprofiles/{profileId}/ads",
  14847. // "request": {
  14848. // "$ref": "Ad"
  14849. // },
  14850. // "response": {
  14851. // "$ref": "Ad"
  14852. // },
  14853. // "scopes": [
  14854. // "https://www.googleapis.com/auth/dfatrafficking"
  14855. // ]
  14856. // }
  14857. }
  14858. // method id "dfareporting.ads.update":
  14859. type AdsUpdateCall struct {
  14860. s *Service
  14861. profileId int64
  14862. ad *Ad
  14863. urlParams_ gensupport.URLParams
  14864. ctx_ context.Context
  14865. header_ http.Header
  14866. }
  14867. // Update: Updates an existing ad.
  14868. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  14869. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14870. c.profileId = profileId
  14871. c.ad = ad
  14872. return c
  14873. }
  14874. // Fields allows partial responses to be retrieved. See
  14875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14876. // for more information.
  14877. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  14878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14879. return c
  14880. }
  14881. // Context sets the context to be used in this call's Do method. Any
  14882. // pending HTTP request will be aborted if the provided context is
  14883. // canceled.
  14884. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  14885. c.ctx_ = ctx
  14886. return c
  14887. }
  14888. // Header returns an http.Header that can be modified by the caller to
  14889. // add HTTP headers to the request.
  14890. func (c *AdsUpdateCall) Header() http.Header {
  14891. if c.header_ == nil {
  14892. c.header_ = make(http.Header)
  14893. }
  14894. return c.header_
  14895. }
  14896. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14897. reqHeaders := make(http.Header)
  14898. for k, v := range c.header_ {
  14899. reqHeaders[k] = v
  14900. }
  14901. reqHeaders.Set("User-Agent", c.s.userAgent())
  14902. var body io.Reader = nil
  14903. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14904. if err != nil {
  14905. return nil, err
  14906. }
  14907. reqHeaders.Set("Content-Type", "application/json")
  14908. c.urlParams_.Set("alt", alt)
  14909. c.urlParams_.Set("prettyPrint", "false")
  14910. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14911. urls += "?" + c.urlParams_.Encode()
  14912. req, err := http.NewRequest("PUT", urls, body)
  14913. if err != nil {
  14914. return nil, err
  14915. }
  14916. req.Header = reqHeaders
  14917. googleapi.Expand(req.URL, map[string]string{
  14918. "profileId": strconv.FormatInt(c.profileId, 10),
  14919. })
  14920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14921. }
  14922. // Do executes the "dfareporting.ads.update" call.
  14923. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14924. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14925. // or (if a response was returned at all) in
  14926. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14927. // whether the returned error was because http.StatusNotModified was
  14928. // returned.
  14929. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14930. gensupport.SetOptions(c.urlParams_, opts...)
  14931. res, err := c.doRequest("json")
  14932. if res != nil && res.StatusCode == http.StatusNotModified {
  14933. if res.Body != nil {
  14934. res.Body.Close()
  14935. }
  14936. return nil, &googleapi.Error{
  14937. Code: res.StatusCode,
  14938. Header: res.Header,
  14939. }
  14940. }
  14941. if err != nil {
  14942. return nil, err
  14943. }
  14944. defer googleapi.CloseBody(res)
  14945. if err := googleapi.CheckResponse(res); err != nil {
  14946. return nil, err
  14947. }
  14948. ret := &Ad{
  14949. ServerResponse: googleapi.ServerResponse{
  14950. Header: res.Header,
  14951. HTTPStatusCode: res.StatusCode,
  14952. },
  14953. }
  14954. target := &ret
  14955. if err := gensupport.DecodeResponse(target, res); err != nil {
  14956. return nil, err
  14957. }
  14958. return ret, nil
  14959. // {
  14960. // "description": "Updates an existing ad.",
  14961. // "httpMethod": "PUT",
  14962. // "id": "dfareporting.ads.update",
  14963. // "parameterOrder": [
  14964. // "profileId"
  14965. // ],
  14966. // "parameters": {
  14967. // "profileId": {
  14968. // "description": "User profile ID associated with this request.",
  14969. // "format": "int64",
  14970. // "location": "path",
  14971. // "required": true,
  14972. // "type": "string"
  14973. // }
  14974. // },
  14975. // "path": "userprofiles/{profileId}/ads",
  14976. // "request": {
  14977. // "$ref": "Ad"
  14978. // },
  14979. // "response": {
  14980. // "$ref": "Ad"
  14981. // },
  14982. // "scopes": [
  14983. // "https://www.googleapis.com/auth/dfatrafficking"
  14984. // ]
  14985. // }
  14986. }
  14987. // method id "dfareporting.advertiserGroups.delete":
  14988. type AdvertiserGroupsDeleteCall struct {
  14989. s *Service
  14990. profileId int64
  14991. id int64
  14992. urlParams_ gensupport.URLParams
  14993. ctx_ context.Context
  14994. header_ http.Header
  14995. }
  14996. // Delete: Deletes an existing advertiser group.
  14997. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  14998. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14999. c.profileId = profileId
  15000. c.id = id
  15001. return c
  15002. }
  15003. // Fields allows partial responses to be retrieved. See
  15004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15005. // for more information.
  15006. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  15007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15008. return c
  15009. }
  15010. // Context sets the context to be used in this call's Do method. Any
  15011. // pending HTTP request will be aborted if the provided context is
  15012. // canceled.
  15013. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  15014. c.ctx_ = ctx
  15015. return c
  15016. }
  15017. // Header returns an http.Header that can be modified by the caller to
  15018. // add HTTP headers to the request.
  15019. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  15020. if c.header_ == nil {
  15021. c.header_ = make(http.Header)
  15022. }
  15023. return c.header_
  15024. }
  15025. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15026. reqHeaders := make(http.Header)
  15027. for k, v := range c.header_ {
  15028. reqHeaders[k] = v
  15029. }
  15030. reqHeaders.Set("User-Agent", c.s.userAgent())
  15031. var body io.Reader = nil
  15032. c.urlParams_.Set("alt", alt)
  15033. c.urlParams_.Set("prettyPrint", "false")
  15034. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15035. urls += "?" + c.urlParams_.Encode()
  15036. req, err := http.NewRequest("DELETE", urls, body)
  15037. if err != nil {
  15038. return nil, err
  15039. }
  15040. req.Header = reqHeaders
  15041. googleapi.Expand(req.URL, map[string]string{
  15042. "profileId": strconv.FormatInt(c.profileId, 10),
  15043. "id": strconv.FormatInt(c.id, 10),
  15044. })
  15045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15046. }
  15047. // Do executes the "dfareporting.advertiserGroups.delete" call.
  15048. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15049. gensupport.SetOptions(c.urlParams_, opts...)
  15050. res, err := c.doRequest("json")
  15051. if err != nil {
  15052. return err
  15053. }
  15054. defer googleapi.CloseBody(res)
  15055. if err := googleapi.CheckResponse(res); err != nil {
  15056. return err
  15057. }
  15058. return nil
  15059. // {
  15060. // "description": "Deletes an existing advertiser group.",
  15061. // "httpMethod": "DELETE",
  15062. // "id": "dfareporting.advertiserGroups.delete",
  15063. // "parameterOrder": [
  15064. // "profileId",
  15065. // "id"
  15066. // ],
  15067. // "parameters": {
  15068. // "id": {
  15069. // "description": "Advertiser group ID.",
  15070. // "format": "int64",
  15071. // "location": "path",
  15072. // "required": true,
  15073. // "type": "string"
  15074. // },
  15075. // "profileId": {
  15076. // "description": "User profile ID associated with this request.",
  15077. // "format": "int64",
  15078. // "location": "path",
  15079. // "required": true,
  15080. // "type": "string"
  15081. // }
  15082. // },
  15083. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15084. // "scopes": [
  15085. // "https://www.googleapis.com/auth/dfatrafficking"
  15086. // ]
  15087. // }
  15088. }
  15089. // method id "dfareporting.advertiserGroups.get":
  15090. type AdvertiserGroupsGetCall struct {
  15091. s *Service
  15092. profileId int64
  15093. id int64
  15094. urlParams_ gensupport.URLParams
  15095. ifNoneMatch_ string
  15096. ctx_ context.Context
  15097. header_ http.Header
  15098. }
  15099. // Get: Gets one advertiser group by ID.
  15100. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15101. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15102. c.profileId = profileId
  15103. c.id = id
  15104. return c
  15105. }
  15106. // Fields allows partial responses to be retrieved. See
  15107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15108. // for more information.
  15109. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15111. return c
  15112. }
  15113. // IfNoneMatch sets the optional parameter which makes the operation
  15114. // fail if the object's ETag matches the given value. This is useful for
  15115. // getting updates only after the object has changed since the last
  15116. // request. Use googleapi.IsNotModified to check whether the response
  15117. // error from Do is the result of In-None-Match.
  15118. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15119. c.ifNoneMatch_ = entityTag
  15120. return c
  15121. }
  15122. // Context sets the context to be used in this call's Do method. Any
  15123. // pending HTTP request will be aborted if the provided context is
  15124. // canceled.
  15125. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15126. c.ctx_ = ctx
  15127. return c
  15128. }
  15129. // Header returns an http.Header that can be modified by the caller to
  15130. // add HTTP headers to the request.
  15131. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15132. if c.header_ == nil {
  15133. c.header_ = make(http.Header)
  15134. }
  15135. return c.header_
  15136. }
  15137. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15138. reqHeaders := make(http.Header)
  15139. for k, v := range c.header_ {
  15140. reqHeaders[k] = v
  15141. }
  15142. reqHeaders.Set("User-Agent", c.s.userAgent())
  15143. if c.ifNoneMatch_ != "" {
  15144. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15145. }
  15146. var body io.Reader = nil
  15147. c.urlParams_.Set("alt", alt)
  15148. c.urlParams_.Set("prettyPrint", "false")
  15149. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15150. urls += "?" + c.urlParams_.Encode()
  15151. req, err := http.NewRequest("GET", urls, body)
  15152. if err != nil {
  15153. return nil, err
  15154. }
  15155. req.Header = reqHeaders
  15156. googleapi.Expand(req.URL, map[string]string{
  15157. "profileId": strconv.FormatInt(c.profileId, 10),
  15158. "id": strconv.FormatInt(c.id, 10),
  15159. })
  15160. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15161. }
  15162. // Do executes the "dfareporting.advertiserGroups.get" call.
  15163. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15164. // status code is an error. Response headers are in either
  15165. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15166. // at all) in error.(*googleapi.Error).Header. Use
  15167. // googleapi.IsNotModified to check whether the returned error was
  15168. // because http.StatusNotModified was returned.
  15169. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15170. gensupport.SetOptions(c.urlParams_, opts...)
  15171. res, err := c.doRequest("json")
  15172. if res != nil && res.StatusCode == http.StatusNotModified {
  15173. if res.Body != nil {
  15174. res.Body.Close()
  15175. }
  15176. return nil, &googleapi.Error{
  15177. Code: res.StatusCode,
  15178. Header: res.Header,
  15179. }
  15180. }
  15181. if err != nil {
  15182. return nil, err
  15183. }
  15184. defer googleapi.CloseBody(res)
  15185. if err := googleapi.CheckResponse(res); err != nil {
  15186. return nil, err
  15187. }
  15188. ret := &AdvertiserGroup{
  15189. ServerResponse: googleapi.ServerResponse{
  15190. Header: res.Header,
  15191. HTTPStatusCode: res.StatusCode,
  15192. },
  15193. }
  15194. target := &ret
  15195. if err := gensupport.DecodeResponse(target, res); err != nil {
  15196. return nil, err
  15197. }
  15198. return ret, nil
  15199. // {
  15200. // "description": "Gets one advertiser group by ID.",
  15201. // "httpMethod": "GET",
  15202. // "id": "dfareporting.advertiserGroups.get",
  15203. // "parameterOrder": [
  15204. // "profileId",
  15205. // "id"
  15206. // ],
  15207. // "parameters": {
  15208. // "id": {
  15209. // "description": "Advertiser group ID.",
  15210. // "format": "int64",
  15211. // "location": "path",
  15212. // "required": true,
  15213. // "type": "string"
  15214. // },
  15215. // "profileId": {
  15216. // "description": "User profile ID associated with this request.",
  15217. // "format": "int64",
  15218. // "location": "path",
  15219. // "required": true,
  15220. // "type": "string"
  15221. // }
  15222. // },
  15223. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15224. // "response": {
  15225. // "$ref": "AdvertiserGroup"
  15226. // },
  15227. // "scopes": [
  15228. // "https://www.googleapis.com/auth/dfatrafficking"
  15229. // ]
  15230. // }
  15231. }
  15232. // method id "dfareporting.advertiserGroups.insert":
  15233. type AdvertiserGroupsInsertCall struct {
  15234. s *Service
  15235. profileId int64
  15236. advertisergroup *AdvertiserGroup
  15237. urlParams_ gensupport.URLParams
  15238. ctx_ context.Context
  15239. header_ http.Header
  15240. }
  15241. // Insert: Inserts a new advertiser group.
  15242. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15243. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15244. c.profileId = profileId
  15245. c.advertisergroup = advertisergroup
  15246. return c
  15247. }
  15248. // Fields allows partial responses to be retrieved. See
  15249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15250. // for more information.
  15251. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15253. return c
  15254. }
  15255. // Context sets the context to be used in this call's Do method. Any
  15256. // pending HTTP request will be aborted if the provided context is
  15257. // canceled.
  15258. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15259. c.ctx_ = ctx
  15260. return c
  15261. }
  15262. // Header returns an http.Header that can be modified by the caller to
  15263. // add HTTP headers to the request.
  15264. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15265. if c.header_ == nil {
  15266. c.header_ = make(http.Header)
  15267. }
  15268. return c.header_
  15269. }
  15270. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15271. reqHeaders := make(http.Header)
  15272. for k, v := range c.header_ {
  15273. reqHeaders[k] = v
  15274. }
  15275. reqHeaders.Set("User-Agent", c.s.userAgent())
  15276. var body io.Reader = nil
  15277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15278. if err != nil {
  15279. return nil, err
  15280. }
  15281. reqHeaders.Set("Content-Type", "application/json")
  15282. c.urlParams_.Set("alt", alt)
  15283. c.urlParams_.Set("prettyPrint", "false")
  15284. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15285. urls += "?" + c.urlParams_.Encode()
  15286. req, err := http.NewRequest("POST", urls, body)
  15287. if err != nil {
  15288. return nil, err
  15289. }
  15290. req.Header = reqHeaders
  15291. googleapi.Expand(req.URL, map[string]string{
  15292. "profileId": strconv.FormatInt(c.profileId, 10),
  15293. })
  15294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15295. }
  15296. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15297. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15298. // status code is an error. Response headers are in either
  15299. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15300. // at all) in error.(*googleapi.Error).Header. Use
  15301. // googleapi.IsNotModified to check whether the returned error was
  15302. // because http.StatusNotModified was returned.
  15303. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15304. gensupport.SetOptions(c.urlParams_, opts...)
  15305. res, err := c.doRequest("json")
  15306. if res != nil && res.StatusCode == http.StatusNotModified {
  15307. if res.Body != nil {
  15308. res.Body.Close()
  15309. }
  15310. return nil, &googleapi.Error{
  15311. Code: res.StatusCode,
  15312. Header: res.Header,
  15313. }
  15314. }
  15315. if err != nil {
  15316. return nil, err
  15317. }
  15318. defer googleapi.CloseBody(res)
  15319. if err := googleapi.CheckResponse(res); err != nil {
  15320. return nil, err
  15321. }
  15322. ret := &AdvertiserGroup{
  15323. ServerResponse: googleapi.ServerResponse{
  15324. Header: res.Header,
  15325. HTTPStatusCode: res.StatusCode,
  15326. },
  15327. }
  15328. target := &ret
  15329. if err := gensupport.DecodeResponse(target, res); err != nil {
  15330. return nil, err
  15331. }
  15332. return ret, nil
  15333. // {
  15334. // "description": "Inserts a new advertiser group.",
  15335. // "httpMethod": "POST",
  15336. // "id": "dfareporting.advertiserGroups.insert",
  15337. // "parameterOrder": [
  15338. // "profileId"
  15339. // ],
  15340. // "parameters": {
  15341. // "profileId": {
  15342. // "description": "User profile ID associated with this request.",
  15343. // "format": "int64",
  15344. // "location": "path",
  15345. // "required": true,
  15346. // "type": "string"
  15347. // }
  15348. // },
  15349. // "path": "userprofiles/{profileId}/advertiserGroups",
  15350. // "request": {
  15351. // "$ref": "AdvertiserGroup"
  15352. // },
  15353. // "response": {
  15354. // "$ref": "AdvertiserGroup"
  15355. // },
  15356. // "scopes": [
  15357. // "https://www.googleapis.com/auth/dfatrafficking"
  15358. // ]
  15359. // }
  15360. }
  15361. // method id "dfareporting.advertiserGroups.list":
  15362. type AdvertiserGroupsListCall struct {
  15363. s *Service
  15364. profileId int64
  15365. urlParams_ gensupport.URLParams
  15366. ifNoneMatch_ string
  15367. ctx_ context.Context
  15368. header_ http.Header
  15369. }
  15370. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15371. // method supports paging.
  15372. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15373. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15374. c.profileId = profileId
  15375. return c
  15376. }
  15377. // Ids sets the optional parameter "ids": Select only advertiser groups
  15378. // with these IDs.
  15379. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15380. var ids_ []string
  15381. for _, v := range ids {
  15382. ids_ = append(ids_, fmt.Sprint(v))
  15383. }
  15384. c.urlParams_.SetMulti("ids", ids_)
  15385. return c
  15386. }
  15387. // MaxResults sets the optional parameter "maxResults": Maximum number
  15388. // of results to return.
  15389. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15390. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15391. return c
  15392. }
  15393. // PageToken sets the optional parameter "pageToken": Value of the
  15394. // nextPageToken from the previous result page.
  15395. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15396. c.urlParams_.Set("pageToken", pageToken)
  15397. return c
  15398. }
  15399. // SearchString sets the optional parameter "searchString": Allows
  15400. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15401. // example, "advertiser*2015" will return objects with names like
  15402. // "advertiser group June 2015", "advertiser group April 2015", or
  15403. // simply "advertiser group 2015". Most of the searches also add
  15404. // wildcards implicitly at the start and the end of the search string.
  15405. // For example, a search string of "advertisergroup" will match objects
  15406. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15407. // "advertisergroup".
  15408. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15409. c.urlParams_.Set("searchString", searchString)
  15410. return c
  15411. }
  15412. // SortField sets the optional parameter "sortField": Field by which to
  15413. // sort the list.
  15414. //
  15415. // Possible values:
  15416. // "ID" (default)
  15417. // "NAME"
  15418. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15419. c.urlParams_.Set("sortField", sortField)
  15420. return c
  15421. }
  15422. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15423. // results.
  15424. //
  15425. // Possible values:
  15426. // "ASCENDING" (default)
  15427. // "DESCENDING"
  15428. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15429. c.urlParams_.Set("sortOrder", sortOrder)
  15430. return c
  15431. }
  15432. // Fields allows partial responses to be retrieved. See
  15433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15434. // for more information.
  15435. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15437. return c
  15438. }
  15439. // IfNoneMatch sets the optional parameter which makes the operation
  15440. // fail if the object's ETag matches the given value. This is useful for
  15441. // getting updates only after the object has changed since the last
  15442. // request. Use googleapi.IsNotModified to check whether the response
  15443. // error from Do is the result of In-None-Match.
  15444. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15445. c.ifNoneMatch_ = entityTag
  15446. return c
  15447. }
  15448. // Context sets the context to be used in this call's Do method. Any
  15449. // pending HTTP request will be aborted if the provided context is
  15450. // canceled.
  15451. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15452. c.ctx_ = ctx
  15453. return c
  15454. }
  15455. // Header returns an http.Header that can be modified by the caller to
  15456. // add HTTP headers to the request.
  15457. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15458. if c.header_ == nil {
  15459. c.header_ = make(http.Header)
  15460. }
  15461. return c.header_
  15462. }
  15463. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15464. reqHeaders := make(http.Header)
  15465. for k, v := range c.header_ {
  15466. reqHeaders[k] = v
  15467. }
  15468. reqHeaders.Set("User-Agent", c.s.userAgent())
  15469. if c.ifNoneMatch_ != "" {
  15470. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15471. }
  15472. var body io.Reader = nil
  15473. c.urlParams_.Set("alt", alt)
  15474. c.urlParams_.Set("prettyPrint", "false")
  15475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15476. urls += "?" + c.urlParams_.Encode()
  15477. req, err := http.NewRequest("GET", urls, body)
  15478. if err != nil {
  15479. return nil, err
  15480. }
  15481. req.Header = reqHeaders
  15482. googleapi.Expand(req.URL, map[string]string{
  15483. "profileId": strconv.FormatInt(c.profileId, 10),
  15484. })
  15485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15486. }
  15487. // Do executes the "dfareporting.advertiserGroups.list" call.
  15488. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15489. // non-nil. Any non-2xx status code is an error. Response headers are in
  15490. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15491. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15492. // googleapi.IsNotModified to check whether the returned error was
  15493. // because http.StatusNotModified was returned.
  15494. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15495. gensupport.SetOptions(c.urlParams_, opts...)
  15496. res, err := c.doRequest("json")
  15497. if res != nil && res.StatusCode == http.StatusNotModified {
  15498. if res.Body != nil {
  15499. res.Body.Close()
  15500. }
  15501. return nil, &googleapi.Error{
  15502. Code: res.StatusCode,
  15503. Header: res.Header,
  15504. }
  15505. }
  15506. if err != nil {
  15507. return nil, err
  15508. }
  15509. defer googleapi.CloseBody(res)
  15510. if err := googleapi.CheckResponse(res); err != nil {
  15511. return nil, err
  15512. }
  15513. ret := &AdvertiserGroupsListResponse{
  15514. ServerResponse: googleapi.ServerResponse{
  15515. Header: res.Header,
  15516. HTTPStatusCode: res.StatusCode,
  15517. },
  15518. }
  15519. target := &ret
  15520. if err := gensupport.DecodeResponse(target, res); err != nil {
  15521. return nil, err
  15522. }
  15523. return ret, nil
  15524. // {
  15525. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15526. // "httpMethod": "GET",
  15527. // "id": "dfareporting.advertiserGroups.list",
  15528. // "parameterOrder": [
  15529. // "profileId"
  15530. // ],
  15531. // "parameters": {
  15532. // "ids": {
  15533. // "description": "Select only advertiser groups with these IDs.",
  15534. // "format": "int64",
  15535. // "location": "query",
  15536. // "repeated": true,
  15537. // "type": "string"
  15538. // },
  15539. // "maxResults": {
  15540. // "default": "1000",
  15541. // "description": "Maximum number of results to return.",
  15542. // "format": "int32",
  15543. // "location": "query",
  15544. // "maximum": "1000",
  15545. // "minimum": "0",
  15546. // "type": "integer"
  15547. // },
  15548. // "pageToken": {
  15549. // "description": "Value of the nextPageToken from the previous result page.",
  15550. // "location": "query",
  15551. // "type": "string"
  15552. // },
  15553. // "profileId": {
  15554. // "description": "User profile ID associated with this request.",
  15555. // "format": "int64",
  15556. // "location": "path",
  15557. // "required": true,
  15558. // "type": "string"
  15559. // },
  15560. // "searchString": {
  15561. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser group June 2015\", \"advertiser group April 2015\", or simply \"advertiser group 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertisergroup\" will match objects with name \"my advertisergroup\", \"advertisergroup 2015\", or simply \"advertisergroup\".",
  15562. // "location": "query",
  15563. // "type": "string"
  15564. // },
  15565. // "sortField": {
  15566. // "default": "ID",
  15567. // "description": "Field by which to sort the list.",
  15568. // "enum": [
  15569. // "ID",
  15570. // "NAME"
  15571. // ],
  15572. // "enumDescriptions": [
  15573. // "",
  15574. // ""
  15575. // ],
  15576. // "location": "query",
  15577. // "type": "string"
  15578. // },
  15579. // "sortOrder": {
  15580. // "default": "ASCENDING",
  15581. // "description": "Order of sorted results.",
  15582. // "enum": [
  15583. // "ASCENDING",
  15584. // "DESCENDING"
  15585. // ],
  15586. // "enumDescriptions": [
  15587. // "",
  15588. // ""
  15589. // ],
  15590. // "location": "query",
  15591. // "type": "string"
  15592. // }
  15593. // },
  15594. // "path": "userprofiles/{profileId}/advertiserGroups",
  15595. // "response": {
  15596. // "$ref": "AdvertiserGroupsListResponse"
  15597. // },
  15598. // "scopes": [
  15599. // "https://www.googleapis.com/auth/dfatrafficking"
  15600. // ]
  15601. // }
  15602. }
  15603. // Pages invokes f for each page of results.
  15604. // A non-nil error returned from f will halt the iteration.
  15605. // The provided context supersedes any context provided to the Context method.
  15606. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15607. c.ctx_ = ctx
  15608. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15609. for {
  15610. x, err := c.Do()
  15611. if err != nil {
  15612. return err
  15613. }
  15614. if err := f(x); err != nil {
  15615. return err
  15616. }
  15617. if x.NextPageToken == "" {
  15618. return nil
  15619. }
  15620. c.PageToken(x.NextPageToken)
  15621. }
  15622. }
  15623. // method id "dfareporting.advertiserGroups.patch":
  15624. type AdvertiserGroupsPatchCall struct {
  15625. s *Service
  15626. profileId int64
  15627. advertisergroup *AdvertiserGroup
  15628. urlParams_ gensupport.URLParams
  15629. ctx_ context.Context
  15630. header_ http.Header
  15631. }
  15632. // Patch: Updates an existing advertiser group. This method supports
  15633. // patch semantics.
  15634. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15635. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15636. c.profileId = profileId
  15637. c.urlParams_.Set("id", fmt.Sprint(id))
  15638. c.advertisergroup = advertisergroup
  15639. return c
  15640. }
  15641. // Fields allows partial responses to be retrieved. See
  15642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15643. // for more information.
  15644. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15646. return c
  15647. }
  15648. // Context sets the context to be used in this call's Do method. Any
  15649. // pending HTTP request will be aborted if the provided context is
  15650. // canceled.
  15651. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15652. c.ctx_ = ctx
  15653. return c
  15654. }
  15655. // Header returns an http.Header that can be modified by the caller to
  15656. // add HTTP headers to the request.
  15657. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15658. if c.header_ == nil {
  15659. c.header_ = make(http.Header)
  15660. }
  15661. return c.header_
  15662. }
  15663. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15664. reqHeaders := make(http.Header)
  15665. for k, v := range c.header_ {
  15666. reqHeaders[k] = v
  15667. }
  15668. reqHeaders.Set("User-Agent", c.s.userAgent())
  15669. var body io.Reader = nil
  15670. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15671. if err != nil {
  15672. return nil, err
  15673. }
  15674. reqHeaders.Set("Content-Type", "application/json")
  15675. c.urlParams_.Set("alt", alt)
  15676. c.urlParams_.Set("prettyPrint", "false")
  15677. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15678. urls += "?" + c.urlParams_.Encode()
  15679. req, err := http.NewRequest("PATCH", urls, body)
  15680. if err != nil {
  15681. return nil, err
  15682. }
  15683. req.Header = reqHeaders
  15684. googleapi.Expand(req.URL, map[string]string{
  15685. "profileId": strconv.FormatInt(c.profileId, 10),
  15686. })
  15687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15688. }
  15689. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15690. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15691. // status code is an error. Response headers are in either
  15692. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15693. // at all) in error.(*googleapi.Error).Header. Use
  15694. // googleapi.IsNotModified to check whether the returned error was
  15695. // because http.StatusNotModified was returned.
  15696. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15697. gensupport.SetOptions(c.urlParams_, opts...)
  15698. res, err := c.doRequest("json")
  15699. if res != nil && res.StatusCode == http.StatusNotModified {
  15700. if res.Body != nil {
  15701. res.Body.Close()
  15702. }
  15703. return nil, &googleapi.Error{
  15704. Code: res.StatusCode,
  15705. Header: res.Header,
  15706. }
  15707. }
  15708. if err != nil {
  15709. return nil, err
  15710. }
  15711. defer googleapi.CloseBody(res)
  15712. if err := googleapi.CheckResponse(res); err != nil {
  15713. return nil, err
  15714. }
  15715. ret := &AdvertiserGroup{
  15716. ServerResponse: googleapi.ServerResponse{
  15717. Header: res.Header,
  15718. HTTPStatusCode: res.StatusCode,
  15719. },
  15720. }
  15721. target := &ret
  15722. if err := gensupport.DecodeResponse(target, res); err != nil {
  15723. return nil, err
  15724. }
  15725. return ret, nil
  15726. // {
  15727. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15728. // "httpMethod": "PATCH",
  15729. // "id": "dfareporting.advertiserGroups.patch",
  15730. // "parameterOrder": [
  15731. // "profileId",
  15732. // "id"
  15733. // ],
  15734. // "parameters": {
  15735. // "id": {
  15736. // "description": "Advertiser group ID.",
  15737. // "format": "int64",
  15738. // "location": "query",
  15739. // "required": true,
  15740. // "type": "string"
  15741. // },
  15742. // "profileId": {
  15743. // "description": "User profile ID associated with this request.",
  15744. // "format": "int64",
  15745. // "location": "path",
  15746. // "required": true,
  15747. // "type": "string"
  15748. // }
  15749. // },
  15750. // "path": "userprofiles/{profileId}/advertiserGroups",
  15751. // "request": {
  15752. // "$ref": "AdvertiserGroup"
  15753. // },
  15754. // "response": {
  15755. // "$ref": "AdvertiserGroup"
  15756. // },
  15757. // "scopes": [
  15758. // "https://www.googleapis.com/auth/dfatrafficking"
  15759. // ]
  15760. // }
  15761. }
  15762. // method id "dfareporting.advertiserGroups.update":
  15763. type AdvertiserGroupsUpdateCall struct {
  15764. s *Service
  15765. profileId int64
  15766. advertisergroup *AdvertiserGroup
  15767. urlParams_ gensupport.URLParams
  15768. ctx_ context.Context
  15769. header_ http.Header
  15770. }
  15771. // Update: Updates an existing advertiser group.
  15772. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15773. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15774. c.profileId = profileId
  15775. c.advertisergroup = advertisergroup
  15776. return c
  15777. }
  15778. // Fields allows partial responses to be retrieved. See
  15779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15780. // for more information.
  15781. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15783. return c
  15784. }
  15785. // Context sets the context to be used in this call's Do method. Any
  15786. // pending HTTP request will be aborted if the provided context is
  15787. // canceled.
  15788. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15789. c.ctx_ = ctx
  15790. return c
  15791. }
  15792. // Header returns an http.Header that can be modified by the caller to
  15793. // add HTTP headers to the request.
  15794. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15795. if c.header_ == nil {
  15796. c.header_ = make(http.Header)
  15797. }
  15798. return c.header_
  15799. }
  15800. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15801. reqHeaders := make(http.Header)
  15802. for k, v := range c.header_ {
  15803. reqHeaders[k] = v
  15804. }
  15805. reqHeaders.Set("User-Agent", c.s.userAgent())
  15806. var body io.Reader = nil
  15807. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15808. if err != nil {
  15809. return nil, err
  15810. }
  15811. reqHeaders.Set("Content-Type", "application/json")
  15812. c.urlParams_.Set("alt", alt)
  15813. c.urlParams_.Set("prettyPrint", "false")
  15814. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15815. urls += "?" + c.urlParams_.Encode()
  15816. req, err := http.NewRequest("PUT", urls, body)
  15817. if err != nil {
  15818. return nil, err
  15819. }
  15820. req.Header = reqHeaders
  15821. googleapi.Expand(req.URL, map[string]string{
  15822. "profileId": strconv.FormatInt(c.profileId, 10),
  15823. })
  15824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15825. }
  15826. // Do executes the "dfareporting.advertiserGroups.update" call.
  15827. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15828. // status code is an error. Response headers are in either
  15829. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15830. // at all) in error.(*googleapi.Error).Header. Use
  15831. // googleapi.IsNotModified to check whether the returned error was
  15832. // because http.StatusNotModified was returned.
  15833. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15834. gensupport.SetOptions(c.urlParams_, opts...)
  15835. res, err := c.doRequest("json")
  15836. if res != nil && res.StatusCode == http.StatusNotModified {
  15837. if res.Body != nil {
  15838. res.Body.Close()
  15839. }
  15840. return nil, &googleapi.Error{
  15841. Code: res.StatusCode,
  15842. Header: res.Header,
  15843. }
  15844. }
  15845. if err != nil {
  15846. return nil, err
  15847. }
  15848. defer googleapi.CloseBody(res)
  15849. if err := googleapi.CheckResponse(res); err != nil {
  15850. return nil, err
  15851. }
  15852. ret := &AdvertiserGroup{
  15853. ServerResponse: googleapi.ServerResponse{
  15854. Header: res.Header,
  15855. HTTPStatusCode: res.StatusCode,
  15856. },
  15857. }
  15858. target := &ret
  15859. if err := gensupport.DecodeResponse(target, res); err != nil {
  15860. return nil, err
  15861. }
  15862. return ret, nil
  15863. // {
  15864. // "description": "Updates an existing advertiser group.",
  15865. // "httpMethod": "PUT",
  15866. // "id": "dfareporting.advertiserGroups.update",
  15867. // "parameterOrder": [
  15868. // "profileId"
  15869. // ],
  15870. // "parameters": {
  15871. // "profileId": {
  15872. // "description": "User profile ID associated with this request.",
  15873. // "format": "int64",
  15874. // "location": "path",
  15875. // "required": true,
  15876. // "type": "string"
  15877. // }
  15878. // },
  15879. // "path": "userprofiles/{profileId}/advertiserGroups",
  15880. // "request": {
  15881. // "$ref": "AdvertiserGroup"
  15882. // },
  15883. // "response": {
  15884. // "$ref": "AdvertiserGroup"
  15885. // },
  15886. // "scopes": [
  15887. // "https://www.googleapis.com/auth/dfatrafficking"
  15888. // ]
  15889. // }
  15890. }
  15891. // method id "dfareporting.advertiserLandingPages.get":
  15892. type AdvertiserLandingPagesGetCall struct {
  15893. s *Service
  15894. profileId int64
  15895. id int64
  15896. urlParams_ gensupport.URLParams
  15897. ifNoneMatch_ string
  15898. ctx_ context.Context
  15899. header_ http.Header
  15900. }
  15901. // Get: Gets one landing page by ID.
  15902. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  15903. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15904. c.profileId = profileId
  15905. c.id = id
  15906. return c
  15907. }
  15908. // Fields allows partial responses to be retrieved. See
  15909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15910. // for more information.
  15911. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  15912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15913. return c
  15914. }
  15915. // IfNoneMatch sets the optional parameter which makes the operation
  15916. // fail if the object's ETag matches the given value. This is useful for
  15917. // getting updates only after the object has changed since the last
  15918. // request. Use googleapi.IsNotModified to check whether the response
  15919. // error from Do is the result of In-None-Match.
  15920. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  15921. c.ifNoneMatch_ = entityTag
  15922. return c
  15923. }
  15924. // Context sets the context to be used in this call's Do method. Any
  15925. // pending HTTP request will be aborted if the provided context is
  15926. // canceled.
  15927. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  15928. c.ctx_ = ctx
  15929. return c
  15930. }
  15931. // Header returns an http.Header that can be modified by the caller to
  15932. // add HTTP headers to the request.
  15933. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  15934. if c.header_ == nil {
  15935. c.header_ = make(http.Header)
  15936. }
  15937. return c.header_
  15938. }
  15939. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  15940. reqHeaders := make(http.Header)
  15941. for k, v := range c.header_ {
  15942. reqHeaders[k] = v
  15943. }
  15944. reqHeaders.Set("User-Agent", c.s.userAgent())
  15945. if c.ifNoneMatch_ != "" {
  15946. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15947. }
  15948. var body io.Reader = nil
  15949. c.urlParams_.Set("alt", alt)
  15950. c.urlParams_.Set("prettyPrint", "false")
  15951. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  15952. urls += "?" + c.urlParams_.Encode()
  15953. req, err := http.NewRequest("GET", urls, body)
  15954. if err != nil {
  15955. return nil, err
  15956. }
  15957. req.Header = reqHeaders
  15958. googleapi.Expand(req.URL, map[string]string{
  15959. "profileId": strconv.FormatInt(c.profileId, 10),
  15960. "id": strconv.FormatInt(c.id, 10),
  15961. })
  15962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15963. }
  15964. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  15965. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  15966. // status code is an error. Response headers are in either
  15967. // *LandingPage.ServerResponse.Header or (if a response was returned at
  15968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15969. // to check whether the returned error was because
  15970. // http.StatusNotModified was returned.
  15971. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  15972. gensupport.SetOptions(c.urlParams_, opts...)
  15973. res, err := c.doRequest("json")
  15974. if res != nil && res.StatusCode == http.StatusNotModified {
  15975. if res.Body != nil {
  15976. res.Body.Close()
  15977. }
  15978. return nil, &googleapi.Error{
  15979. Code: res.StatusCode,
  15980. Header: res.Header,
  15981. }
  15982. }
  15983. if err != nil {
  15984. return nil, err
  15985. }
  15986. defer googleapi.CloseBody(res)
  15987. if err := googleapi.CheckResponse(res); err != nil {
  15988. return nil, err
  15989. }
  15990. ret := &LandingPage{
  15991. ServerResponse: googleapi.ServerResponse{
  15992. Header: res.Header,
  15993. HTTPStatusCode: res.StatusCode,
  15994. },
  15995. }
  15996. target := &ret
  15997. if err := gensupport.DecodeResponse(target, res); err != nil {
  15998. return nil, err
  15999. }
  16000. return ret, nil
  16001. // {
  16002. // "description": "Gets one landing page by ID.",
  16003. // "httpMethod": "GET",
  16004. // "id": "dfareporting.advertiserLandingPages.get",
  16005. // "parameterOrder": [
  16006. // "profileId",
  16007. // "id"
  16008. // ],
  16009. // "parameters": {
  16010. // "id": {
  16011. // "description": "Landing page ID.",
  16012. // "format": "int64",
  16013. // "location": "path",
  16014. // "required": true,
  16015. // "type": "string"
  16016. // },
  16017. // "profileId": {
  16018. // "description": "User profile ID associated with this request.",
  16019. // "format": "int64",
  16020. // "location": "path",
  16021. // "required": true,
  16022. // "type": "string"
  16023. // }
  16024. // },
  16025. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  16026. // "response": {
  16027. // "$ref": "LandingPage"
  16028. // },
  16029. // "scopes": [
  16030. // "https://www.googleapis.com/auth/dfatrafficking"
  16031. // ]
  16032. // }
  16033. }
  16034. // method id "dfareporting.advertiserLandingPages.insert":
  16035. type AdvertiserLandingPagesInsertCall struct {
  16036. s *Service
  16037. profileId int64
  16038. landingpage *LandingPage
  16039. urlParams_ gensupport.URLParams
  16040. ctx_ context.Context
  16041. header_ http.Header
  16042. }
  16043. // Insert: Inserts a new landing page.
  16044. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  16045. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16046. c.profileId = profileId
  16047. c.landingpage = landingpage
  16048. return c
  16049. }
  16050. // Fields allows partial responses to be retrieved. See
  16051. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16052. // for more information.
  16053. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  16054. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16055. return c
  16056. }
  16057. // Context sets the context to be used in this call's Do method. Any
  16058. // pending HTTP request will be aborted if the provided context is
  16059. // canceled.
  16060. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  16061. c.ctx_ = ctx
  16062. return c
  16063. }
  16064. // Header returns an http.Header that can be modified by the caller to
  16065. // add HTTP headers to the request.
  16066. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  16067. if c.header_ == nil {
  16068. c.header_ = make(http.Header)
  16069. }
  16070. return c.header_
  16071. }
  16072. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  16073. reqHeaders := make(http.Header)
  16074. for k, v := range c.header_ {
  16075. reqHeaders[k] = v
  16076. }
  16077. reqHeaders.Set("User-Agent", c.s.userAgent())
  16078. var body io.Reader = nil
  16079. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16080. if err != nil {
  16081. return nil, err
  16082. }
  16083. reqHeaders.Set("Content-Type", "application/json")
  16084. c.urlParams_.Set("alt", alt)
  16085. c.urlParams_.Set("prettyPrint", "false")
  16086. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16087. urls += "?" + c.urlParams_.Encode()
  16088. req, err := http.NewRequest("POST", urls, body)
  16089. if err != nil {
  16090. return nil, err
  16091. }
  16092. req.Header = reqHeaders
  16093. googleapi.Expand(req.URL, map[string]string{
  16094. "profileId": strconv.FormatInt(c.profileId, 10),
  16095. })
  16096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16097. }
  16098. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  16099. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16100. // status code is an error. Response headers are in either
  16101. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16103. // to check whether the returned error was because
  16104. // http.StatusNotModified was returned.
  16105. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16106. gensupport.SetOptions(c.urlParams_, opts...)
  16107. res, err := c.doRequest("json")
  16108. if res != nil && res.StatusCode == http.StatusNotModified {
  16109. if res.Body != nil {
  16110. res.Body.Close()
  16111. }
  16112. return nil, &googleapi.Error{
  16113. Code: res.StatusCode,
  16114. Header: res.Header,
  16115. }
  16116. }
  16117. if err != nil {
  16118. return nil, err
  16119. }
  16120. defer googleapi.CloseBody(res)
  16121. if err := googleapi.CheckResponse(res); err != nil {
  16122. return nil, err
  16123. }
  16124. ret := &LandingPage{
  16125. ServerResponse: googleapi.ServerResponse{
  16126. Header: res.Header,
  16127. HTTPStatusCode: res.StatusCode,
  16128. },
  16129. }
  16130. target := &ret
  16131. if err := gensupport.DecodeResponse(target, res); err != nil {
  16132. return nil, err
  16133. }
  16134. return ret, nil
  16135. // {
  16136. // "description": "Inserts a new landing page.",
  16137. // "httpMethod": "POST",
  16138. // "id": "dfareporting.advertiserLandingPages.insert",
  16139. // "parameterOrder": [
  16140. // "profileId"
  16141. // ],
  16142. // "parameters": {
  16143. // "profileId": {
  16144. // "description": "User profile ID associated with this request.",
  16145. // "format": "int64",
  16146. // "location": "path",
  16147. // "required": true,
  16148. // "type": "string"
  16149. // }
  16150. // },
  16151. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16152. // "request": {
  16153. // "$ref": "LandingPage"
  16154. // },
  16155. // "response": {
  16156. // "$ref": "LandingPage"
  16157. // },
  16158. // "scopes": [
  16159. // "https://www.googleapis.com/auth/dfatrafficking"
  16160. // ]
  16161. // }
  16162. }
  16163. // method id "dfareporting.advertiserLandingPages.list":
  16164. type AdvertiserLandingPagesListCall struct {
  16165. s *Service
  16166. profileId int64
  16167. urlParams_ gensupport.URLParams
  16168. ifNoneMatch_ string
  16169. ctx_ context.Context
  16170. header_ http.Header
  16171. }
  16172. // List: Retrieves a list of landing pages.
  16173. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16174. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16175. c.profileId = profileId
  16176. return c
  16177. }
  16178. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16179. // only landing pages that belong to these advertisers.
  16180. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16181. var advertiserIds_ []string
  16182. for _, v := range advertiserIds {
  16183. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16184. }
  16185. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16186. return c
  16187. }
  16188. // Archived sets the optional parameter "archived": Select only archived
  16189. // landing pages. Don't set this field to select both archived and
  16190. // non-archived landing pages.
  16191. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16192. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16193. return c
  16194. }
  16195. // Ids sets the optional parameter "ids": Select only landing pages with
  16196. // these IDs.
  16197. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16198. var ids_ []string
  16199. for _, v := range ids {
  16200. ids_ = append(ids_, fmt.Sprint(v))
  16201. }
  16202. c.urlParams_.SetMulti("ids", ids_)
  16203. return c
  16204. }
  16205. // MaxResults sets the optional parameter "maxResults": Maximum number
  16206. // of results to return.
  16207. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16208. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16209. return c
  16210. }
  16211. // PageToken sets the optional parameter "pageToken": Value of the
  16212. // nextPageToken from the previous result page.
  16213. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16214. c.urlParams_.Set("pageToken", pageToken)
  16215. return c
  16216. }
  16217. // SearchString sets the optional parameter "searchString": Allows
  16218. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16219. // For example, "landingpage*2017" will return landing pages with names
  16220. // like "landingpage July 2017", "landingpage March 2017", or simply
  16221. // "landingpage 2017". Most of the searches also add wildcards
  16222. // implicitly at the start and the end of the search string. For
  16223. // example, a search string of "landingpage" will match campaigns with
  16224. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16225. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16226. c.urlParams_.Set("searchString", searchString)
  16227. return c
  16228. }
  16229. // SortField sets the optional parameter "sortField": Field by which to
  16230. // sort the list.
  16231. //
  16232. // Possible values:
  16233. // "ID" (default)
  16234. // "NAME"
  16235. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16236. c.urlParams_.Set("sortField", sortField)
  16237. return c
  16238. }
  16239. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16240. // results.
  16241. //
  16242. // Possible values:
  16243. // "ASCENDING" (default)
  16244. // "DESCENDING"
  16245. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16246. c.urlParams_.Set("sortOrder", sortOrder)
  16247. return c
  16248. }
  16249. // SubaccountId sets the optional parameter "subaccountId": Select only
  16250. // landing pages that belong to this subaccount.
  16251. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16252. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16253. return c
  16254. }
  16255. // Fields allows partial responses to be retrieved. See
  16256. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16257. // for more information.
  16258. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16259. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16260. return c
  16261. }
  16262. // IfNoneMatch sets the optional parameter which makes the operation
  16263. // fail if the object's ETag matches the given value. This is useful for
  16264. // getting updates only after the object has changed since the last
  16265. // request. Use googleapi.IsNotModified to check whether the response
  16266. // error from Do is the result of In-None-Match.
  16267. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16268. c.ifNoneMatch_ = entityTag
  16269. return c
  16270. }
  16271. // Context sets the context to be used in this call's Do method. Any
  16272. // pending HTTP request will be aborted if the provided context is
  16273. // canceled.
  16274. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16275. c.ctx_ = ctx
  16276. return c
  16277. }
  16278. // Header returns an http.Header that can be modified by the caller to
  16279. // add HTTP headers to the request.
  16280. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16281. if c.header_ == nil {
  16282. c.header_ = make(http.Header)
  16283. }
  16284. return c.header_
  16285. }
  16286. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16287. reqHeaders := make(http.Header)
  16288. for k, v := range c.header_ {
  16289. reqHeaders[k] = v
  16290. }
  16291. reqHeaders.Set("User-Agent", c.s.userAgent())
  16292. if c.ifNoneMatch_ != "" {
  16293. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16294. }
  16295. var body io.Reader = nil
  16296. c.urlParams_.Set("alt", alt)
  16297. c.urlParams_.Set("prettyPrint", "false")
  16298. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16299. urls += "?" + c.urlParams_.Encode()
  16300. req, err := http.NewRequest("GET", urls, body)
  16301. if err != nil {
  16302. return nil, err
  16303. }
  16304. req.Header = reqHeaders
  16305. googleapi.Expand(req.URL, map[string]string{
  16306. "profileId": strconv.FormatInt(c.profileId, 10),
  16307. })
  16308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16309. }
  16310. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16311. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16312. // non-nil. Any non-2xx status code is an error. Response headers are in
  16313. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16314. // (if a response was returned at all) in
  16315. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16316. // whether the returned error was because http.StatusNotModified was
  16317. // returned.
  16318. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16319. gensupport.SetOptions(c.urlParams_, opts...)
  16320. res, err := c.doRequest("json")
  16321. if res != nil && res.StatusCode == http.StatusNotModified {
  16322. if res.Body != nil {
  16323. res.Body.Close()
  16324. }
  16325. return nil, &googleapi.Error{
  16326. Code: res.StatusCode,
  16327. Header: res.Header,
  16328. }
  16329. }
  16330. if err != nil {
  16331. return nil, err
  16332. }
  16333. defer googleapi.CloseBody(res)
  16334. if err := googleapi.CheckResponse(res); err != nil {
  16335. return nil, err
  16336. }
  16337. ret := &AdvertiserLandingPagesListResponse{
  16338. ServerResponse: googleapi.ServerResponse{
  16339. Header: res.Header,
  16340. HTTPStatusCode: res.StatusCode,
  16341. },
  16342. }
  16343. target := &ret
  16344. if err := gensupport.DecodeResponse(target, res); err != nil {
  16345. return nil, err
  16346. }
  16347. return ret, nil
  16348. // {
  16349. // "description": "Retrieves a list of landing pages.",
  16350. // "httpMethod": "GET",
  16351. // "id": "dfareporting.advertiserLandingPages.list",
  16352. // "parameterOrder": [
  16353. // "profileId"
  16354. // ],
  16355. // "parameters": {
  16356. // "advertiserIds": {
  16357. // "description": "Select only landing pages that belong to these advertisers.",
  16358. // "format": "int64",
  16359. // "location": "query",
  16360. // "repeated": true,
  16361. // "type": "string"
  16362. // },
  16363. // "archived": {
  16364. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16365. // "location": "query",
  16366. // "type": "boolean"
  16367. // },
  16368. // "ids": {
  16369. // "description": "Select only landing pages with these IDs.",
  16370. // "format": "int64",
  16371. // "location": "query",
  16372. // "repeated": true,
  16373. // "type": "string"
  16374. // },
  16375. // "maxResults": {
  16376. // "default": "1000",
  16377. // "description": "Maximum number of results to return.",
  16378. // "format": "int32",
  16379. // "location": "query",
  16380. // "maximum": "1000",
  16381. // "minimum": "0",
  16382. // "type": "integer"
  16383. // },
  16384. // "pageToken": {
  16385. // "description": "Value of the nextPageToken from the previous result page.",
  16386. // "location": "query",
  16387. // "type": "string"
  16388. // },
  16389. // "profileId": {
  16390. // "description": "User profile ID associated with this request.",
  16391. // "format": "int64",
  16392. // "location": "path",
  16393. // "required": true,
  16394. // "type": "string"
  16395. // },
  16396. // "searchString": {
  16397. // "description": "Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, \"landingpage*2017\" will return landing pages with names like \"landingpage July 2017\", \"landingpage March 2017\", or simply \"landingpage 2017\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"landingpage\" will match campaigns with name \"my landingpage\", \"landingpage 2015\", or simply \"landingpage\".",
  16398. // "location": "query",
  16399. // "type": "string"
  16400. // },
  16401. // "sortField": {
  16402. // "default": "ID",
  16403. // "description": "Field by which to sort the list.",
  16404. // "enum": [
  16405. // "ID",
  16406. // "NAME"
  16407. // ],
  16408. // "enumDescriptions": [
  16409. // "",
  16410. // ""
  16411. // ],
  16412. // "location": "query",
  16413. // "type": "string"
  16414. // },
  16415. // "sortOrder": {
  16416. // "default": "ASCENDING",
  16417. // "description": "Order of sorted results.",
  16418. // "enum": [
  16419. // "ASCENDING",
  16420. // "DESCENDING"
  16421. // ],
  16422. // "enumDescriptions": [
  16423. // "",
  16424. // ""
  16425. // ],
  16426. // "location": "query",
  16427. // "type": "string"
  16428. // },
  16429. // "subaccountId": {
  16430. // "description": "Select only landing pages that belong to this subaccount.",
  16431. // "format": "int64",
  16432. // "location": "query",
  16433. // "type": "string"
  16434. // }
  16435. // },
  16436. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16437. // "response": {
  16438. // "$ref": "AdvertiserLandingPagesListResponse"
  16439. // },
  16440. // "scopes": [
  16441. // "https://www.googleapis.com/auth/dfatrafficking"
  16442. // ]
  16443. // }
  16444. }
  16445. // Pages invokes f for each page of results.
  16446. // A non-nil error returned from f will halt the iteration.
  16447. // The provided context supersedes any context provided to the Context method.
  16448. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16449. c.ctx_ = ctx
  16450. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16451. for {
  16452. x, err := c.Do()
  16453. if err != nil {
  16454. return err
  16455. }
  16456. if err := f(x); err != nil {
  16457. return err
  16458. }
  16459. if x.NextPageToken == "" {
  16460. return nil
  16461. }
  16462. c.PageToken(x.NextPageToken)
  16463. }
  16464. }
  16465. // method id "dfareporting.advertiserLandingPages.patch":
  16466. type AdvertiserLandingPagesPatchCall struct {
  16467. s *Service
  16468. profileId int64
  16469. landingpage *LandingPage
  16470. urlParams_ gensupport.URLParams
  16471. ctx_ context.Context
  16472. header_ http.Header
  16473. }
  16474. // Patch: Updates an existing landing page. This method supports patch
  16475. // semantics.
  16476. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16477. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16478. c.profileId = profileId
  16479. c.urlParams_.Set("id", fmt.Sprint(id))
  16480. c.landingpage = landingpage
  16481. return c
  16482. }
  16483. // Fields allows partial responses to be retrieved. See
  16484. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16485. // for more information.
  16486. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16487. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16488. return c
  16489. }
  16490. // Context sets the context to be used in this call's Do method. Any
  16491. // pending HTTP request will be aborted if the provided context is
  16492. // canceled.
  16493. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16494. c.ctx_ = ctx
  16495. return c
  16496. }
  16497. // Header returns an http.Header that can be modified by the caller to
  16498. // add HTTP headers to the request.
  16499. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16500. if c.header_ == nil {
  16501. c.header_ = make(http.Header)
  16502. }
  16503. return c.header_
  16504. }
  16505. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16506. reqHeaders := make(http.Header)
  16507. for k, v := range c.header_ {
  16508. reqHeaders[k] = v
  16509. }
  16510. reqHeaders.Set("User-Agent", c.s.userAgent())
  16511. var body io.Reader = nil
  16512. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16513. if err != nil {
  16514. return nil, err
  16515. }
  16516. reqHeaders.Set("Content-Type", "application/json")
  16517. c.urlParams_.Set("alt", alt)
  16518. c.urlParams_.Set("prettyPrint", "false")
  16519. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16520. urls += "?" + c.urlParams_.Encode()
  16521. req, err := http.NewRequest("PATCH", urls, body)
  16522. if err != nil {
  16523. return nil, err
  16524. }
  16525. req.Header = reqHeaders
  16526. googleapi.Expand(req.URL, map[string]string{
  16527. "profileId": strconv.FormatInt(c.profileId, 10),
  16528. })
  16529. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16530. }
  16531. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16532. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16533. // status code is an error. Response headers are in either
  16534. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16535. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16536. // to check whether the returned error was because
  16537. // http.StatusNotModified was returned.
  16538. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16539. gensupport.SetOptions(c.urlParams_, opts...)
  16540. res, err := c.doRequest("json")
  16541. if res != nil && res.StatusCode == http.StatusNotModified {
  16542. if res.Body != nil {
  16543. res.Body.Close()
  16544. }
  16545. return nil, &googleapi.Error{
  16546. Code: res.StatusCode,
  16547. Header: res.Header,
  16548. }
  16549. }
  16550. if err != nil {
  16551. return nil, err
  16552. }
  16553. defer googleapi.CloseBody(res)
  16554. if err := googleapi.CheckResponse(res); err != nil {
  16555. return nil, err
  16556. }
  16557. ret := &LandingPage{
  16558. ServerResponse: googleapi.ServerResponse{
  16559. Header: res.Header,
  16560. HTTPStatusCode: res.StatusCode,
  16561. },
  16562. }
  16563. target := &ret
  16564. if err := gensupport.DecodeResponse(target, res); err != nil {
  16565. return nil, err
  16566. }
  16567. return ret, nil
  16568. // {
  16569. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16570. // "httpMethod": "PATCH",
  16571. // "id": "dfareporting.advertiserLandingPages.patch",
  16572. // "parameterOrder": [
  16573. // "profileId",
  16574. // "id"
  16575. // ],
  16576. // "parameters": {
  16577. // "id": {
  16578. // "description": "Landing page ID.",
  16579. // "format": "int64",
  16580. // "location": "query",
  16581. // "required": true,
  16582. // "type": "string"
  16583. // },
  16584. // "profileId": {
  16585. // "description": "User profile ID associated with this request.",
  16586. // "format": "int64",
  16587. // "location": "path",
  16588. // "required": true,
  16589. // "type": "string"
  16590. // }
  16591. // },
  16592. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16593. // "request": {
  16594. // "$ref": "LandingPage"
  16595. // },
  16596. // "response": {
  16597. // "$ref": "LandingPage"
  16598. // },
  16599. // "scopes": [
  16600. // "https://www.googleapis.com/auth/dfatrafficking"
  16601. // ]
  16602. // }
  16603. }
  16604. // method id "dfareporting.advertiserLandingPages.update":
  16605. type AdvertiserLandingPagesUpdateCall struct {
  16606. s *Service
  16607. profileId int64
  16608. landingpage *LandingPage
  16609. urlParams_ gensupport.URLParams
  16610. ctx_ context.Context
  16611. header_ http.Header
  16612. }
  16613. // Update: Updates an existing landing page.
  16614. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16615. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16616. c.profileId = profileId
  16617. c.landingpage = landingpage
  16618. return c
  16619. }
  16620. // Fields allows partial responses to be retrieved. See
  16621. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16622. // for more information.
  16623. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16624. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16625. return c
  16626. }
  16627. // Context sets the context to be used in this call's Do method. Any
  16628. // pending HTTP request will be aborted if the provided context is
  16629. // canceled.
  16630. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16631. c.ctx_ = ctx
  16632. return c
  16633. }
  16634. // Header returns an http.Header that can be modified by the caller to
  16635. // add HTTP headers to the request.
  16636. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16637. if c.header_ == nil {
  16638. c.header_ = make(http.Header)
  16639. }
  16640. return c.header_
  16641. }
  16642. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16643. reqHeaders := make(http.Header)
  16644. for k, v := range c.header_ {
  16645. reqHeaders[k] = v
  16646. }
  16647. reqHeaders.Set("User-Agent", c.s.userAgent())
  16648. var body io.Reader = nil
  16649. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16650. if err != nil {
  16651. return nil, err
  16652. }
  16653. reqHeaders.Set("Content-Type", "application/json")
  16654. c.urlParams_.Set("alt", alt)
  16655. c.urlParams_.Set("prettyPrint", "false")
  16656. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16657. urls += "?" + c.urlParams_.Encode()
  16658. req, err := http.NewRequest("PUT", urls, body)
  16659. if err != nil {
  16660. return nil, err
  16661. }
  16662. req.Header = reqHeaders
  16663. googleapi.Expand(req.URL, map[string]string{
  16664. "profileId": strconv.FormatInt(c.profileId, 10),
  16665. })
  16666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16667. }
  16668. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16669. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16670. // status code is an error. Response headers are in either
  16671. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16672. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16673. // to check whether the returned error was because
  16674. // http.StatusNotModified was returned.
  16675. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16676. gensupport.SetOptions(c.urlParams_, opts...)
  16677. res, err := c.doRequest("json")
  16678. if res != nil && res.StatusCode == http.StatusNotModified {
  16679. if res.Body != nil {
  16680. res.Body.Close()
  16681. }
  16682. return nil, &googleapi.Error{
  16683. Code: res.StatusCode,
  16684. Header: res.Header,
  16685. }
  16686. }
  16687. if err != nil {
  16688. return nil, err
  16689. }
  16690. defer googleapi.CloseBody(res)
  16691. if err := googleapi.CheckResponse(res); err != nil {
  16692. return nil, err
  16693. }
  16694. ret := &LandingPage{
  16695. ServerResponse: googleapi.ServerResponse{
  16696. Header: res.Header,
  16697. HTTPStatusCode: res.StatusCode,
  16698. },
  16699. }
  16700. target := &ret
  16701. if err := gensupport.DecodeResponse(target, res); err != nil {
  16702. return nil, err
  16703. }
  16704. return ret, nil
  16705. // {
  16706. // "description": "Updates an existing landing page.",
  16707. // "httpMethod": "PUT",
  16708. // "id": "dfareporting.advertiserLandingPages.update",
  16709. // "parameterOrder": [
  16710. // "profileId"
  16711. // ],
  16712. // "parameters": {
  16713. // "profileId": {
  16714. // "description": "User profile ID associated with this request.",
  16715. // "format": "int64",
  16716. // "location": "path",
  16717. // "required": true,
  16718. // "type": "string"
  16719. // }
  16720. // },
  16721. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16722. // "request": {
  16723. // "$ref": "LandingPage"
  16724. // },
  16725. // "response": {
  16726. // "$ref": "LandingPage"
  16727. // },
  16728. // "scopes": [
  16729. // "https://www.googleapis.com/auth/dfatrafficking"
  16730. // ]
  16731. // }
  16732. }
  16733. // method id "dfareporting.advertisers.get":
  16734. type AdvertisersGetCall struct {
  16735. s *Service
  16736. profileId int64
  16737. id int64
  16738. urlParams_ gensupport.URLParams
  16739. ifNoneMatch_ string
  16740. ctx_ context.Context
  16741. header_ http.Header
  16742. }
  16743. // Get: Gets one advertiser by ID.
  16744. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16745. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16746. c.profileId = profileId
  16747. c.id = id
  16748. return c
  16749. }
  16750. // Fields allows partial responses to be retrieved. See
  16751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16752. // for more information.
  16753. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16755. return c
  16756. }
  16757. // IfNoneMatch sets the optional parameter which makes the operation
  16758. // fail if the object's ETag matches the given value. This is useful for
  16759. // getting updates only after the object has changed since the last
  16760. // request. Use googleapi.IsNotModified to check whether the response
  16761. // error from Do is the result of In-None-Match.
  16762. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16763. c.ifNoneMatch_ = entityTag
  16764. return c
  16765. }
  16766. // Context sets the context to be used in this call's Do method. Any
  16767. // pending HTTP request will be aborted if the provided context is
  16768. // canceled.
  16769. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  16770. c.ctx_ = ctx
  16771. return c
  16772. }
  16773. // Header returns an http.Header that can be modified by the caller to
  16774. // add HTTP headers to the request.
  16775. func (c *AdvertisersGetCall) Header() http.Header {
  16776. if c.header_ == nil {
  16777. c.header_ = make(http.Header)
  16778. }
  16779. return c.header_
  16780. }
  16781. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  16782. reqHeaders := make(http.Header)
  16783. for k, v := range c.header_ {
  16784. reqHeaders[k] = v
  16785. }
  16786. reqHeaders.Set("User-Agent", c.s.userAgent())
  16787. if c.ifNoneMatch_ != "" {
  16788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16789. }
  16790. var body io.Reader = nil
  16791. c.urlParams_.Set("alt", alt)
  16792. c.urlParams_.Set("prettyPrint", "false")
  16793. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  16794. urls += "?" + c.urlParams_.Encode()
  16795. req, err := http.NewRequest("GET", urls, body)
  16796. if err != nil {
  16797. return nil, err
  16798. }
  16799. req.Header = reqHeaders
  16800. googleapi.Expand(req.URL, map[string]string{
  16801. "profileId": strconv.FormatInt(c.profileId, 10),
  16802. "id": strconv.FormatInt(c.id, 10),
  16803. })
  16804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16805. }
  16806. // Do executes the "dfareporting.advertisers.get" call.
  16807. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16808. // status code is an error. Response headers are in either
  16809. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16810. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16811. // to check whether the returned error was because
  16812. // http.StatusNotModified was returned.
  16813. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16814. gensupport.SetOptions(c.urlParams_, opts...)
  16815. res, err := c.doRequest("json")
  16816. if res != nil && res.StatusCode == http.StatusNotModified {
  16817. if res.Body != nil {
  16818. res.Body.Close()
  16819. }
  16820. return nil, &googleapi.Error{
  16821. Code: res.StatusCode,
  16822. Header: res.Header,
  16823. }
  16824. }
  16825. if err != nil {
  16826. return nil, err
  16827. }
  16828. defer googleapi.CloseBody(res)
  16829. if err := googleapi.CheckResponse(res); err != nil {
  16830. return nil, err
  16831. }
  16832. ret := &Advertiser{
  16833. ServerResponse: googleapi.ServerResponse{
  16834. Header: res.Header,
  16835. HTTPStatusCode: res.StatusCode,
  16836. },
  16837. }
  16838. target := &ret
  16839. if err := gensupport.DecodeResponse(target, res); err != nil {
  16840. return nil, err
  16841. }
  16842. return ret, nil
  16843. // {
  16844. // "description": "Gets one advertiser by ID.",
  16845. // "httpMethod": "GET",
  16846. // "id": "dfareporting.advertisers.get",
  16847. // "parameterOrder": [
  16848. // "profileId",
  16849. // "id"
  16850. // ],
  16851. // "parameters": {
  16852. // "id": {
  16853. // "description": "Advertiser ID.",
  16854. // "format": "int64",
  16855. // "location": "path",
  16856. // "required": true,
  16857. // "type": "string"
  16858. // },
  16859. // "profileId": {
  16860. // "description": "User profile ID associated with this request.",
  16861. // "format": "int64",
  16862. // "location": "path",
  16863. // "required": true,
  16864. // "type": "string"
  16865. // }
  16866. // },
  16867. // "path": "userprofiles/{profileId}/advertisers/{id}",
  16868. // "response": {
  16869. // "$ref": "Advertiser"
  16870. // },
  16871. // "scopes": [
  16872. // "https://www.googleapis.com/auth/dfatrafficking"
  16873. // ]
  16874. // }
  16875. }
  16876. // method id "dfareporting.advertisers.insert":
  16877. type AdvertisersInsertCall struct {
  16878. s *Service
  16879. profileId int64
  16880. advertiser *Advertiser
  16881. urlParams_ gensupport.URLParams
  16882. ctx_ context.Context
  16883. header_ http.Header
  16884. }
  16885. // Insert: Inserts a new advertiser.
  16886. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  16887. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16888. c.profileId = profileId
  16889. c.advertiser = advertiser
  16890. return c
  16891. }
  16892. // Fields allows partial responses to be retrieved. See
  16893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16894. // for more information.
  16895. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  16896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16897. return c
  16898. }
  16899. // Context sets the context to be used in this call's Do method. Any
  16900. // pending HTTP request will be aborted if the provided context is
  16901. // canceled.
  16902. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  16903. c.ctx_ = ctx
  16904. return c
  16905. }
  16906. // Header returns an http.Header that can be modified by the caller to
  16907. // add HTTP headers to the request.
  16908. func (c *AdvertisersInsertCall) Header() http.Header {
  16909. if c.header_ == nil {
  16910. c.header_ = make(http.Header)
  16911. }
  16912. return c.header_
  16913. }
  16914. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  16915. reqHeaders := make(http.Header)
  16916. for k, v := range c.header_ {
  16917. reqHeaders[k] = v
  16918. }
  16919. reqHeaders.Set("User-Agent", c.s.userAgent())
  16920. var body io.Reader = nil
  16921. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16922. if err != nil {
  16923. return nil, err
  16924. }
  16925. reqHeaders.Set("Content-Type", "application/json")
  16926. c.urlParams_.Set("alt", alt)
  16927. c.urlParams_.Set("prettyPrint", "false")
  16928. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16929. urls += "?" + c.urlParams_.Encode()
  16930. req, err := http.NewRequest("POST", urls, body)
  16931. if err != nil {
  16932. return nil, err
  16933. }
  16934. req.Header = reqHeaders
  16935. googleapi.Expand(req.URL, map[string]string{
  16936. "profileId": strconv.FormatInt(c.profileId, 10),
  16937. })
  16938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16939. }
  16940. // Do executes the "dfareporting.advertisers.insert" call.
  16941. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16942. // status code is an error. Response headers are in either
  16943. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16944. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16945. // to check whether the returned error was because
  16946. // http.StatusNotModified was returned.
  16947. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16948. gensupport.SetOptions(c.urlParams_, opts...)
  16949. res, err := c.doRequest("json")
  16950. if res != nil && res.StatusCode == http.StatusNotModified {
  16951. if res.Body != nil {
  16952. res.Body.Close()
  16953. }
  16954. return nil, &googleapi.Error{
  16955. Code: res.StatusCode,
  16956. Header: res.Header,
  16957. }
  16958. }
  16959. if err != nil {
  16960. return nil, err
  16961. }
  16962. defer googleapi.CloseBody(res)
  16963. if err := googleapi.CheckResponse(res); err != nil {
  16964. return nil, err
  16965. }
  16966. ret := &Advertiser{
  16967. ServerResponse: googleapi.ServerResponse{
  16968. Header: res.Header,
  16969. HTTPStatusCode: res.StatusCode,
  16970. },
  16971. }
  16972. target := &ret
  16973. if err := gensupport.DecodeResponse(target, res); err != nil {
  16974. return nil, err
  16975. }
  16976. return ret, nil
  16977. // {
  16978. // "description": "Inserts a new advertiser.",
  16979. // "httpMethod": "POST",
  16980. // "id": "dfareporting.advertisers.insert",
  16981. // "parameterOrder": [
  16982. // "profileId"
  16983. // ],
  16984. // "parameters": {
  16985. // "profileId": {
  16986. // "description": "User profile ID associated with this request.",
  16987. // "format": "int64",
  16988. // "location": "path",
  16989. // "required": true,
  16990. // "type": "string"
  16991. // }
  16992. // },
  16993. // "path": "userprofiles/{profileId}/advertisers",
  16994. // "request": {
  16995. // "$ref": "Advertiser"
  16996. // },
  16997. // "response": {
  16998. // "$ref": "Advertiser"
  16999. // },
  17000. // "scopes": [
  17001. // "https://www.googleapis.com/auth/dfatrafficking"
  17002. // ]
  17003. // }
  17004. }
  17005. // method id "dfareporting.advertisers.list":
  17006. type AdvertisersListCall struct {
  17007. s *Service
  17008. profileId int64
  17009. urlParams_ gensupport.URLParams
  17010. ifNoneMatch_ string
  17011. ctx_ context.Context
  17012. header_ http.Header
  17013. }
  17014. // List: Retrieves a list of advertisers, possibly filtered. This method
  17015. // supports paging.
  17016. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  17017. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17018. c.profileId = profileId
  17019. return c
  17020. }
  17021. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17022. // Select only advertisers with these advertiser group IDs.
  17023. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  17024. var advertiserGroupIds_ []string
  17025. for _, v := range advertiserGroupIds {
  17026. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17027. }
  17028. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17029. return c
  17030. }
  17031. // FloodlightConfigurationIds sets the optional parameter
  17032. // "floodlightConfigurationIds": Select only advertisers with these
  17033. // floodlight configuration IDs.
  17034. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  17035. var floodlightConfigurationIds_ []string
  17036. for _, v := range floodlightConfigurationIds {
  17037. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  17038. }
  17039. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  17040. return c
  17041. }
  17042. // Ids sets the optional parameter "ids": Select only advertisers with
  17043. // these IDs.
  17044. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  17045. var ids_ []string
  17046. for _, v := range ids {
  17047. ids_ = append(ids_, fmt.Sprint(v))
  17048. }
  17049. c.urlParams_.SetMulti("ids", ids_)
  17050. return c
  17051. }
  17052. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  17053. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  17054. // do not belong to any advertiser group.
  17055. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  17056. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  17057. return c
  17058. }
  17059. // MaxResults sets the optional parameter "maxResults": Maximum number
  17060. // of results to return.
  17061. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  17062. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17063. return c
  17064. }
  17065. // OnlyParent sets the optional parameter "onlyParent": Select only
  17066. // advertisers which use another advertiser's floodlight configuration.
  17067. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  17068. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  17069. return c
  17070. }
  17071. // PageToken sets the optional parameter "pageToken": Value of the
  17072. // nextPageToken from the previous result page.
  17073. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  17074. c.urlParams_.Set("pageToken", pageToken)
  17075. return c
  17076. }
  17077. // SearchString sets the optional parameter "searchString": Allows
  17078. // searching for objects by name or ID. Wildcards (*) are allowed. For
  17079. // example, "advertiser*2015" will return objects with names like
  17080. // "advertiser June 2015", "advertiser April 2015", or simply
  17081. // "advertiser 2015". Most of the searches also add wildcards implicitly
  17082. // at the start and the end of the search string. For example, a search
  17083. // string of "advertiser" will match objects with name "my advertiser",
  17084. // "advertiser 2015", or simply "advertiser".
  17085. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  17086. c.urlParams_.Set("searchString", searchString)
  17087. return c
  17088. }
  17089. // SortField sets the optional parameter "sortField": Field by which to
  17090. // sort the list.
  17091. //
  17092. // Possible values:
  17093. // "ID" (default)
  17094. // "NAME"
  17095. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  17096. c.urlParams_.Set("sortField", sortField)
  17097. return c
  17098. }
  17099. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17100. // results.
  17101. //
  17102. // Possible values:
  17103. // "ASCENDING" (default)
  17104. // "DESCENDING"
  17105. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  17106. c.urlParams_.Set("sortOrder", sortOrder)
  17107. return c
  17108. }
  17109. // Status sets the optional parameter "status": Select only advertisers
  17110. // with the specified status.
  17111. //
  17112. // Possible values:
  17113. // "APPROVED"
  17114. // "ON_HOLD"
  17115. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  17116. c.urlParams_.Set("status", status)
  17117. return c
  17118. }
  17119. // SubaccountId sets the optional parameter "subaccountId": Select only
  17120. // advertisers with these subaccount IDs.
  17121. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  17122. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17123. return c
  17124. }
  17125. // Fields allows partial responses to be retrieved. See
  17126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17127. // for more information.
  17128. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  17129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17130. return c
  17131. }
  17132. // IfNoneMatch sets the optional parameter which makes the operation
  17133. // fail if the object's ETag matches the given value. This is useful for
  17134. // getting updates only after the object has changed since the last
  17135. // request. Use googleapi.IsNotModified to check whether the response
  17136. // error from Do is the result of In-None-Match.
  17137. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17138. c.ifNoneMatch_ = entityTag
  17139. return c
  17140. }
  17141. // Context sets the context to be used in this call's Do method. Any
  17142. // pending HTTP request will be aborted if the provided context is
  17143. // canceled.
  17144. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17145. c.ctx_ = ctx
  17146. return c
  17147. }
  17148. // Header returns an http.Header that can be modified by the caller to
  17149. // add HTTP headers to the request.
  17150. func (c *AdvertisersListCall) Header() http.Header {
  17151. if c.header_ == nil {
  17152. c.header_ = make(http.Header)
  17153. }
  17154. return c.header_
  17155. }
  17156. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17157. reqHeaders := make(http.Header)
  17158. for k, v := range c.header_ {
  17159. reqHeaders[k] = v
  17160. }
  17161. reqHeaders.Set("User-Agent", c.s.userAgent())
  17162. if c.ifNoneMatch_ != "" {
  17163. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17164. }
  17165. var body io.Reader = nil
  17166. c.urlParams_.Set("alt", alt)
  17167. c.urlParams_.Set("prettyPrint", "false")
  17168. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17169. urls += "?" + c.urlParams_.Encode()
  17170. req, err := http.NewRequest("GET", urls, body)
  17171. if err != nil {
  17172. return nil, err
  17173. }
  17174. req.Header = reqHeaders
  17175. googleapi.Expand(req.URL, map[string]string{
  17176. "profileId": strconv.FormatInt(c.profileId, 10),
  17177. })
  17178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17179. }
  17180. // Do executes the "dfareporting.advertisers.list" call.
  17181. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17182. // non-2xx status code is an error. Response headers are in either
  17183. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17184. // returned at all) in error.(*googleapi.Error).Header. Use
  17185. // googleapi.IsNotModified to check whether the returned error was
  17186. // because http.StatusNotModified was returned.
  17187. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17188. gensupport.SetOptions(c.urlParams_, opts...)
  17189. res, err := c.doRequest("json")
  17190. if res != nil && res.StatusCode == http.StatusNotModified {
  17191. if res.Body != nil {
  17192. res.Body.Close()
  17193. }
  17194. return nil, &googleapi.Error{
  17195. Code: res.StatusCode,
  17196. Header: res.Header,
  17197. }
  17198. }
  17199. if err != nil {
  17200. return nil, err
  17201. }
  17202. defer googleapi.CloseBody(res)
  17203. if err := googleapi.CheckResponse(res); err != nil {
  17204. return nil, err
  17205. }
  17206. ret := &AdvertisersListResponse{
  17207. ServerResponse: googleapi.ServerResponse{
  17208. Header: res.Header,
  17209. HTTPStatusCode: res.StatusCode,
  17210. },
  17211. }
  17212. target := &ret
  17213. if err := gensupport.DecodeResponse(target, res); err != nil {
  17214. return nil, err
  17215. }
  17216. return ret, nil
  17217. // {
  17218. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17219. // "httpMethod": "GET",
  17220. // "id": "dfareporting.advertisers.list",
  17221. // "parameterOrder": [
  17222. // "profileId"
  17223. // ],
  17224. // "parameters": {
  17225. // "advertiserGroupIds": {
  17226. // "description": "Select only advertisers with these advertiser group IDs.",
  17227. // "format": "int64",
  17228. // "location": "query",
  17229. // "repeated": true,
  17230. // "type": "string"
  17231. // },
  17232. // "floodlightConfigurationIds": {
  17233. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17234. // "format": "int64",
  17235. // "location": "query",
  17236. // "repeated": true,
  17237. // "type": "string"
  17238. // },
  17239. // "ids": {
  17240. // "description": "Select only advertisers with these IDs.",
  17241. // "format": "int64",
  17242. // "location": "query",
  17243. // "repeated": true,
  17244. // "type": "string"
  17245. // },
  17246. // "includeAdvertisersWithoutGroupsOnly": {
  17247. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17248. // "location": "query",
  17249. // "type": "boolean"
  17250. // },
  17251. // "maxResults": {
  17252. // "default": "1000",
  17253. // "description": "Maximum number of results to return.",
  17254. // "format": "int32",
  17255. // "location": "query",
  17256. // "maximum": "1000",
  17257. // "minimum": "0",
  17258. // "type": "integer"
  17259. // },
  17260. // "onlyParent": {
  17261. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17262. // "location": "query",
  17263. // "type": "boolean"
  17264. // },
  17265. // "pageToken": {
  17266. // "description": "Value of the nextPageToken from the previous result page.",
  17267. // "location": "query",
  17268. // "type": "string"
  17269. // },
  17270. // "profileId": {
  17271. // "description": "User profile ID associated with this request.",
  17272. // "format": "int64",
  17273. // "location": "path",
  17274. // "required": true,
  17275. // "type": "string"
  17276. // },
  17277. // "searchString": {
  17278. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"advertiser*2015\" will return objects with names like \"advertiser June 2015\", \"advertiser April 2015\", or simply \"advertiser 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"advertiser\" will match objects with name \"my advertiser\", \"advertiser 2015\", or simply \"advertiser\".",
  17279. // "location": "query",
  17280. // "type": "string"
  17281. // },
  17282. // "sortField": {
  17283. // "default": "ID",
  17284. // "description": "Field by which to sort the list.",
  17285. // "enum": [
  17286. // "ID",
  17287. // "NAME"
  17288. // ],
  17289. // "enumDescriptions": [
  17290. // "",
  17291. // ""
  17292. // ],
  17293. // "location": "query",
  17294. // "type": "string"
  17295. // },
  17296. // "sortOrder": {
  17297. // "default": "ASCENDING",
  17298. // "description": "Order of sorted results.",
  17299. // "enum": [
  17300. // "ASCENDING",
  17301. // "DESCENDING"
  17302. // ],
  17303. // "enumDescriptions": [
  17304. // "",
  17305. // ""
  17306. // ],
  17307. // "location": "query",
  17308. // "type": "string"
  17309. // },
  17310. // "status": {
  17311. // "description": "Select only advertisers with the specified status.",
  17312. // "enum": [
  17313. // "APPROVED",
  17314. // "ON_HOLD"
  17315. // ],
  17316. // "enumDescriptions": [
  17317. // "",
  17318. // ""
  17319. // ],
  17320. // "location": "query",
  17321. // "type": "string"
  17322. // },
  17323. // "subaccountId": {
  17324. // "description": "Select only advertisers with these subaccount IDs.",
  17325. // "format": "int64",
  17326. // "location": "query",
  17327. // "type": "string"
  17328. // }
  17329. // },
  17330. // "path": "userprofiles/{profileId}/advertisers",
  17331. // "response": {
  17332. // "$ref": "AdvertisersListResponse"
  17333. // },
  17334. // "scopes": [
  17335. // "https://www.googleapis.com/auth/dfatrafficking"
  17336. // ]
  17337. // }
  17338. }
  17339. // Pages invokes f for each page of results.
  17340. // A non-nil error returned from f will halt the iteration.
  17341. // The provided context supersedes any context provided to the Context method.
  17342. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17343. c.ctx_ = ctx
  17344. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17345. for {
  17346. x, err := c.Do()
  17347. if err != nil {
  17348. return err
  17349. }
  17350. if err := f(x); err != nil {
  17351. return err
  17352. }
  17353. if x.NextPageToken == "" {
  17354. return nil
  17355. }
  17356. c.PageToken(x.NextPageToken)
  17357. }
  17358. }
  17359. // method id "dfareporting.advertisers.patch":
  17360. type AdvertisersPatchCall struct {
  17361. s *Service
  17362. profileId int64
  17363. advertiser *Advertiser
  17364. urlParams_ gensupport.URLParams
  17365. ctx_ context.Context
  17366. header_ http.Header
  17367. }
  17368. // Patch: Updates an existing advertiser. This method supports patch
  17369. // semantics.
  17370. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17371. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17372. c.profileId = profileId
  17373. c.urlParams_.Set("id", fmt.Sprint(id))
  17374. c.advertiser = advertiser
  17375. return c
  17376. }
  17377. // Fields allows partial responses to be retrieved. See
  17378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17379. // for more information.
  17380. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17382. return c
  17383. }
  17384. // Context sets the context to be used in this call's Do method. Any
  17385. // pending HTTP request will be aborted if the provided context is
  17386. // canceled.
  17387. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17388. c.ctx_ = ctx
  17389. return c
  17390. }
  17391. // Header returns an http.Header that can be modified by the caller to
  17392. // add HTTP headers to the request.
  17393. func (c *AdvertisersPatchCall) Header() http.Header {
  17394. if c.header_ == nil {
  17395. c.header_ = make(http.Header)
  17396. }
  17397. return c.header_
  17398. }
  17399. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17400. reqHeaders := make(http.Header)
  17401. for k, v := range c.header_ {
  17402. reqHeaders[k] = v
  17403. }
  17404. reqHeaders.Set("User-Agent", c.s.userAgent())
  17405. var body io.Reader = nil
  17406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17407. if err != nil {
  17408. return nil, err
  17409. }
  17410. reqHeaders.Set("Content-Type", "application/json")
  17411. c.urlParams_.Set("alt", alt)
  17412. c.urlParams_.Set("prettyPrint", "false")
  17413. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17414. urls += "?" + c.urlParams_.Encode()
  17415. req, err := http.NewRequest("PATCH", urls, body)
  17416. if err != nil {
  17417. return nil, err
  17418. }
  17419. req.Header = reqHeaders
  17420. googleapi.Expand(req.URL, map[string]string{
  17421. "profileId": strconv.FormatInt(c.profileId, 10),
  17422. })
  17423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17424. }
  17425. // Do executes the "dfareporting.advertisers.patch" call.
  17426. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17427. // status code is an error. Response headers are in either
  17428. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17429. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17430. // to check whether the returned error was because
  17431. // http.StatusNotModified was returned.
  17432. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17433. gensupport.SetOptions(c.urlParams_, opts...)
  17434. res, err := c.doRequest("json")
  17435. if res != nil && res.StatusCode == http.StatusNotModified {
  17436. if res.Body != nil {
  17437. res.Body.Close()
  17438. }
  17439. return nil, &googleapi.Error{
  17440. Code: res.StatusCode,
  17441. Header: res.Header,
  17442. }
  17443. }
  17444. if err != nil {
  17445. return nil, err
  17446. }
  17447. defer googleapi.CloseBody(res)
  17448. if err := googleapi.CheckResponse(res); err != nil {
  17449. return nil, err
  17450. }
  17451. ret := &Advertiser{
  17452. ServerResponse: googleapi.ServerResponse{
  17453. Header: res.Header,
  17454. HTTPStatusCode: res.StatusCode,
  17455. },
  17456. }
  17457. target := &ret
  17458. if err := gensupport.DecodeResponse(target, res); err != nil {
  17459. return nil, err
  17460. }
  17461. return ret, nil
  17462. // {
  17463. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17464. // "httpMethod": "PATCH",
  17465. // "id": "dfareporting.advertisers.patch",
  17466. // "parameterOrder": [
  17467. // "profileId",
  17468. // "id"
  17469. // ],
  17470. // "parameters": {
  17471. // "id": {
  17472. // "description": "Advertiser ID.",
  17473. // "format": "int64",
  17474. // "location": "query",
  17475. // "required": true,
  17476. // "type": "string"
  17477. // },
  17478. // "profileId": {
  17479. // "description": "User profile ID associated with this request.",
  17480. // "format": "int64",
  17481. // "location": "path",
  17482. // "required": true,
  17483. // "type": "string"
  17484. // }
  17485. // },
  17486. // "path": "userprofiles/{profileId}/advertisers",
  17487. // "request": {
  17488. // "$ref": "Advertiser"
  17489. // },
  17490. // "response": {
  17491. // "$ref": "Advertiser"
  17492. // },
  17493. // "scopes": [
  17494. // "https://www.googleapis.com/auth/dfatrafficking"
  17495. // ]
  17496. // }
  17497. }
  17498. // method id "dfareporting.advertisers.update":
  17499. type AdvertisersUpdateCall struct {
  17500. s *Service
  17501. profileId int64
  17502. advertiser *Advertiser
  17503. urlParams_ gensupport.URLParams
  17504. ctx_ context.Context
  17505. header_ http.Header
  17506. }
  17507. // Update: Updates an existing advertiser.
  17508. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17509. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17510. c.profileId = profileId
  17511. c.advertiser = advertiser
  17512. return c
  17513. }
  17514. // Fields allows partial responses to be retrieved. See
  17515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17516. // for more information.
  17517. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17519. return c
  17520. }
  17521. // Context sets the context to be used in this call's Do method. Any
  17522. // pending HTTP request will be aborted if the provided context is
  17523. // canceled.
  17524. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17525. c.ctx_ = ctx
  17526. return c
  17527. }
  17528. // Header returns an http.Header that can be modified by the caller to
  17529. // add HTTP headers to the request.
  17530. func (c *AdvertisersUpdateCall) Header() http.Header {
  17531. if c.header_ == nil {
  17532. c.header_ = make(http.Header)
  17533. }
  17534. return c.header_
  17535. }
  17536. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17537. reqHeaders := make(http.Header)
  17538. for k, v := range c.header_ {
  17539. reqHeaders[k] = v
  17540. }
  17541. reqHeaders.Set("User-Agent", c.s.userAgent())
  17542. var body io.Reader = nil
  17543. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17544. if err != nil {
  17545. return nil, err
  17546. }
  17547. reqHeaders.Set("Content-Type", "application/json")
  17548. c.urlParams_.Set("alt", alt)
  17549. c.urlParams_.Set("prettyPrint", "false")
  17550. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17551. urls += "?" + c.urlParams_.Encode()
  17552. req, err := http.NewRequest("PUT", urls, body)
  17553. if err != nil {
  17554. return nil, err
  17555. }
  17556. req.Header = reqHeaders
  17557. googleapi.Expand(req.URL, map[string]string{
  17558. "profileId": strconv.FormatInt(c.profileId, 10),
  17559. })
  17560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17561. }
  17562. // Do executes the "dfareporting.advertisers.update" call.
  17563. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17564. // status code is an error. Response headers are in either
  17565. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17566. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17567. // to check whether the returned error was because
  17568. // http.StatusNotModified was returned.
  17569. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17570. gensupport.SetOptions(c.urlParams_, opts...)
  17571. res, err := c.doRequest("json")
  17572. if res != nil && res.StatusCode == http.StatusNotModified {
  17573. if res.Body != nil {
  17574. res.Body.Close()
  17575. }
  17576. return nil, &googleapi.Error{
  17577. Code: res.StatusCode,
  17578. Header: res.Header,
  17579. }
  17580. }
  17581. if err != nil {
  17582. return nil, err
  17583. }
  17584. defer googleapi.CloseBody(res)
  17585. if err := googleapi.CheckResponse(res); err != nil {
  17586. return nil, err
  17587. }
  17588. ret := &Advertiser{
  17589. ServerResponse: googleapi.ServerResponse{
  17590. Header: res.Header,
  17591. HTTPStatusCode: res.StatusCode,
  17592. },
  17593. }
  17594. target := &ret
  17595. if err := gensupport.DecodeResponse(target, res); err != nil {
  17596. return nil, err
  17597. }
  17598. return ret, nil
  17599. // {
  17600. // "description": "Updates an existing advertiser.",
  17601. // "httpMethod": "PUT",
  17602. // "id": "dfareporting.advertisers.update",
  17603. // "parameterOrder": [
  17604. // "profileId"
  17605. // ],
  17606. // "parameters": {
  17607. // "profileId": {
  17608. // "description": "User profile ID associated with this request.",
  17609. // "format": "int64",
  17610. // "location": "path",
  17611. // "required": true,
  17612. // "type": "string"
  17613. // }
  17614. // },
  17615. // "path": "userprofiles/{profileId}/advertisers",
  17616. // "request": {
  17617. // "$ref": "Advertiser"
  17618. // },
  17619. // "response": {
  17620. // "$ref": "Advertiser"
  17621. // },
  17622. // "scopes": [
  17623. // "https://www.googleapis.com/auth/dfatrafficking"
  17624. // ]
  17625. // }
  17626. }
  17627. // method id "dfareporting.browsers.list":
  17628. type BrowsersListCall struct {
  17629. s *Service
  17630. profileId int64
  17631. urlParams_ gensupport.URLParams
  17632. ifNoneMatch_ string
  17633. ctx_ context.Context
  17634. header_ http.Header
  17635. }
  17636. // List: Retrieves a list of browsers.
  17637. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17638. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17639. c.profileId = profileId
  17640. return c
  17641. }
  17642. // Fields allows partial responses to be retrieved. See
  17643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17644. // for more information.
  17645. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17647. return c
  17648. }
  17649. // IfNoneMatch sets the optional parameter which makes the operation
  17650. // fail if the object's ETag matches the given value. This is useful for
  17651. // getting updates only after the object has changed since the last
  17652. // request. Use googleapi.IsNotModified to check whether the response
  17653. // error from Do is the result of In-None-Match.
  17654. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17655. c.ifNoneMatch_ = entityTag
  17656. return c
  17657. }
  17658. // Context sets the context to be used in this call's Do method. Any
  17659. // pending HTTP request will be aborted if the provided context is
  17660. // canceled.
  17661. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17662. c.ctx_ = ctx
  17663. return c
  17664. }
  17665. // Header returns an http.Header that can be modified by the caller to
  17666. // add HTTP headers to the request.
  17667. func (c *BrowsersListCall) Header() http.Header {
  17668. if c.header_ == nil {
  17669. c.header_ = make(http.Header)
  17670. }
  17671. return c.header_
  17672. }
  17673. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17674. reqHeaders := make(http.Header)
  17675. for k, v := range c.header_ {
  17676. reqHeaders[k] = v
  17677. }
  17678. reqHeaders.Set("User-Agent", c.s.userAgent())
  17679. if c.ifNoneMatch_ != "" {
  17680. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17681. }
  17682. var body io.Reader = nil
  17683. c.urlParams_.Set("alt", alt)
  17684. c.urlParams_.Set("prettyPrint", "false")
  17685. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17686. urls += "?" + c.urlParams_.Encode()
  17687. req, err := http.NewRequest("GET", urls, body)
  17688. if err != nil {
  17689. return nil, err
  17690. }
  17691. req.Header = reqHeaders
  17692. googleapi.Expand(req.URL, map[string]string{
  17693. "profileId": strconv.FormatInt(c.profileId, 10),
  17694. })
  17695. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17696. }
  17697. // Do executes the "dfareporting.browsers.list" call.
  17698. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17699. // non-2xx status code is an error. Response headers are in either
  17700. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17701. // returned at all) in error.(*googleapi.Error).Header. Use
  17702. // googleapi.IsNotModified to check whether the returned error was
  17703. // because http.StatusNotModified was returned.
  17704. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17705. gensupport.SetOptions(c.urlParams_, opts...)
  17706. res, err := c.doRequest("json")
  17707. if res != nil && res.StatusCode == http.StatusNotModified {
  17708. if res.Body != nil {
  17709. res.Body.Close()
  17710. }
  17711. return nil, &googleapi.Error{
  17712. Code: res.StatusCode,
  17713. Header: res.Header,
  17714. }
  17715. }
  17716. if err != nil {
  17717. return nil, err
  17718. }
  17719. defer googleapi.CloseBody(res)
  17720. if err := googleapi.CheckResponse(res); err != nil {
  17721. return nil, err
  17722. }
  17723. ret := &BrowsersListResponse{
  17724. ServerResponse: googleapi.ServerResponse{
  17725. Header: res.Header,
  17726. HTTPStatusCode: res.StatusCode,
  17727. },
  17728. }
  17729. target := &ret
  17730. if err := gensupport.DecodeResponse(target, res); err != nil {
  17731. return nil, err
  17732. }
  17733. return ret, nil
  17734. // {
  17735. // "description": "Retrieves a list of browsers.",
  17736. // "httpMethod": "GET",
  17737. // "id": "dfareporting.browsers.list",
  17738. // "parameterOrder": [
  17739. // "profileId"
  17740. // ],
  17741. // "parameters": {
  17742. // "profileId": {
  17743. // "description": "User profile ID associated with this request.",
  17744. // "format": "int64",
  17745. // "location": "path",
  17746. // "required": true,
  17747. // "type": "string"
  17748. // }
  17749. // },
  17750. // "path": "userprofiles/{profileId}/browsers",
  17751. // "response": {
  17752. // "$ref": "BrowsersListResponse"
  17753. // },
  17754. // "scopes": [
  17755. // "https://www.googleapis.com/auth/dfatrafficking"
  17756. // ]
  17757. // }
  17758. }
  17759. // method id "dfareporting.campaignCreativeAssociations.insert":
  17760. type CampaignCreativeAssociationsInsertCall struct {
  17761. s *Service
  17762. profileId int64
  17763. campaignId int64
  17764. campaigncreativeassociation *CampaignCreativeAssociation
  17765. urlParams_ gensupport.URLParams
  17766. ctx_ context.Context
  17767. header_ http.Header
  17768. }
  17769. // Insert: Associates a creative with the specified campaign. This
  17770. // method creates a default ad with dimensions matching the creative in
  17771. // the campaign if such a default ad does not exist already.
  17772. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  17773. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17774. c.profileId = profileId
  17775. c.campaignId = campaignId
  17776. c.campaigncreativeassociation = campaigncreativeassociation
  17777. return c
  17778. }
  17779. // Fields allows partial responses to be retrieved. See
  17780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17781. // for more information.
  17782. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  17783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17784. return c
  17785. }
  17786. // Context sets the context to be used in this call's Do method. Any
  17787. // pending HTTP request will be aborted if the provided context is
  17788. // canceled.
  17789. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  17790. c.ctx_ = ctx
  17791. return c
  17792. }
  17793. // Header returns an http.Header that can be modified by the caller to
  17794. // add HTTP headers to the request.
  17795. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  17796. if c.header_ == nil {
  17797. c.header_ = make(http.Header)
  17798. }
  17799. return c.header_
  17800. }
  17801. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  17802. reqHeaders := make(http.Header)
  17803. for k, v := range c.header_ {
  17804. reqHeaders[k] = v
  17805. }
  17806. reqHeaders.Set("User-Agent", c.s.userAgent())
  17807. var body io.Reader = nil
  17808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  17809. if err != nil {
  17810. return nil, err
  17811. }
  17812. reqHeaders.Set("Content-Type", "application/json")
  17813. c.urlParams_.Set("alt", alt)
  17814. c.urlParams_.Set("prettyPrint", "false")
  17815. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17816. urls += "?" + c.urlParams_.Encode()
  17817. req, err := http.NewRequest("POST", urls, body)
  17818. if err != nil {
  17819. return nil, err
  17820. }
  17821. req.Header = reqHeaders
  17822. googleapi.Expand(req.URL, map[string]string{
  17823. "profileId": strconv.FormatInt(c.profileId, 10),
  17824. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17825. })
  17826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17827. }
  17828. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  17829. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  17830. // Any non-2xx status code is an error. Response headers are in either
  17831. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  17832. // was returned at all) in error.(*googleapi.Error).Header. Use
  17833. // googleapi.IsNotModified to check whether the returned error was
  17834. // because http.StatusNotModified was returned.
  17835. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  17836. gensupport.SetOptions(c.urlParams_, opts...)
  17837. res, err := c.doRequest("json")
  17838. if res != nil && res.StatusCode == http.StatusNotModified {
  17839. if res.Body != nil {
  17840. res.Body.Close()
  17841. }
  17842. return nil, &googleapi.Error{
  17843. Code: res.StatusCode,
  17844. Header: res.Header,
  17845. }
  17846. }
  17847. if err != nil {
  17848. return nil, err
  17849. }
  17850. defer googleapi.CloseBody(res)
  17851. if err := googleapi.CheckResponse(res); err != nil {
  17852. return nil, err
  17853. }
  17854. ret := &CampaignCreativeAssociation{
  17855. ServerResponse: googleapi.ServerResponse{
  17856. Header: res.Header,
  17857. HTTPStatusCode: res.StatusCode,
  17858. },
  17859. }
  17860. target := &ret
  17861. if err := gensupport.DecodeResponse(target, res); err != nil {
  17862. return nil, err
  17863. }
  17864. return ret, nil
  17865. // {
  17866. // "description": "Associates a creative with the specified campaign. This method creates a default ad with dimensions matching the creative in the campaign if such a default ad does not exist already.",
  17867. // "httpMethod": "POST",
  17868. // "id": "dfareporting.campaignCreativeAssociations.insert",
  17869. // "parameterOrder": [
  17870. // "profileId",
  17871. // "campaignId"
  17872. // ],
  17873. // "parameters": {
  17874. // "campaignId": {
  17875. // "description": "Campaign ID in this association.",
  17876. // "format": "int64",
  17877. // "location": "path",
  17878. // "required": true,
  17879. // "type": "string"
  17880. // },
  17881. // "profileId": {
  17882. // "description": "User profile ID associated with this request.",
  17883. // "format": "int64",
  17884. // "location": "path",
  17885. // "required": true,
  17886. // "type": "string"
  17887. // }
  17888. // },
  17889. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  17890. // "request": {
  17891. // "$ref": "CampaignCreativeAssociation"
  17892. // },
  17893. // "response": {
  17894. // "$ref": "CampaignCreativeAssociation"
  17895. // },
  17896. // "scopes": [
  17897. // "https://www.googleapis.com/auth/dfatrafficking"
  17898. // ]
  17899. // }
  17900. }
  17901. // method id "dfareporting.campaignCreativeAssociations.list":
  17902. type CampaignCreativeAssociationsListCall struct {
  17903. s *Service
  17904. profileId int64
  17905. campaignId int64
  17906. urlParams_ gensupport.URLParams
  17907. ifNoneMatch_ string
  17908. ctx_ context.Context
  17909. header_ http.Header
  17910. }
  17911. // List: Retrieves the list of creative IDs associated with the
  17912. // specified campaign. This method supports paging.
  17913. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  17914. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17915. c.profileId = profileId
  17916. c.campaignId = campaignId
  17917. return c
  17918. }
  17919. // MaxResults sets the optional parameter "maxResults": Maximum number
  17920. // of results to return.
  17921. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  17922. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17923. return c
  17924. }
  17925. // PageToken sets the optional parameter "pageToken": Value of the
  17926. // nextPageToken from the previous result page.
  17927. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  17928. c.urlParams_.Set("pageToken", pageToken)
  17929. return c
  17930. }
  17931. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17932. // results.
  17933. //
  17934. // Possible values:
  17935. // "ASCENDING" (default)
  17936. // "DESCENDING"
  17937. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  17938. c.urlParams_.Set("sortOrder", sortOrder)
  17939. return c
  17940. }
  17941. // Fields allows partial responses to be retrieved. See
  17942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17943. // for more information.
  17944. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  17945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17946. return c
  17947. }
  17948. // IfNoneMatch sets the optional parameter which makes the operation
  17949. // fail if the object's ETag matches the given value. This is useful for
  17950. // getting updates only after the object has changed since the last
  17951. // request. Use googleapi.IsNotModified to check whether the response
  17952. // error from Do is the result of In-None-Match.
  17953. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  17954. c.ifNoneMatch_ = entityTag
  17955. return c
  17956. }
  17957. // Context sets the context to be used in this call's Do method. Any
  17958. // pending HTTP request will be aborted if the provided context is
  17959. // canceled.
  17960. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  17961. c.ctx_ = ctx
  17962. return c
  17963. }
  17964. // Header returns an http.Header that can be modified by the caller to
  17965. // add HTTP headers to the request.
  17966. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  17967. if c.header_ == nil {
  17968. c.header_ = make(http.Header)
  17969. }
  17970. return c.header_
  17971. }
  17972. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  17973. reqHeaders := make(http.Header)
  17974. for k, v := range c.header_ {
  17975. reqHeaders[k] = v
  17976. }
  17977. reqHeaders.Set("User-Agent", c.s.userAgent())
  17978. if c.ifNoneMatch_ != "" {
  17979. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17980. }
  17981. var body io.Reader = nil
  17982. c.urlParams_.Set("alt", alt)
  17983. c.urlParams_.Set("prettyPrint", "false")
  17984. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17985. urls += "?" + c.urlParams_.Encode()
  17986. req, err := http.NewRequest("GET", urls, body)
  17987. if err != nil {
  17988. return nil, err
  17989. }
  17990. req.Header = reqHeaders
  17991. googleapi.Expand(req.URL, map[string]string{
  17992. "profileId": strconv.FormatInt(c.profileId, 10),
  17993. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17994. })
  17995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17996. }
  17997. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  17998. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  17999. // will be non-nil. Any non-2xx status code is an error. Response
  18000. // headers are in either
  18001. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  18002. // (if a response was returned at all) in
  18003. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18004. // whether the returned error was because http.StatusNotModified was
  18005. // returned.
  18006. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  18007. gensupport.SetOptions(c.urlParams_, opts...)
  18008. res, err := c.doRequest("json")
  18009. if res != nil && res.StatusCode == http.StatusNotModified {
  18010. if res.Body != nil {
  18011. res.Body.Close()
  18012. }
  18013. return nil, &googleapi.Error{
  18014. Code: res.StatusCode,
  18015. Header: res.Header,
  18016. }
  18017. }
  18018. if err != nil {
  18019. return nil, err
  18020. }
  18021. defer googleapi.CloseBody(res)
  18022. if err := googleapi.CheckResponse(res); err != nil {
  18023. return nil, err
  18024. }
  18025. ret := &CampaignCreativeAssociationsListResponse{
  18026. ServerResponse: googleapi.ServerResponse{
  18027. Header: res.Header,
  18028. HTTPStatusCode: res.StatusCode,
  18029. },
  18030. }
  18031. target := &ret
  18032. if err := gensupport.DecodeResponse(target, res); err != nil {
  18033. return nil, err
  18034. }
  18035. return ret, nil
  18036. // {
  18037. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  18038. // "httpMethod": "GET",
  18039. // "id": "dfareporting.campaignCreativeAssociations.list",
  18040. // "parameterOrder": [
  18041. // "profileId",
  18042. // "campaignId"
  18043. // ],
  18044. // "parameters": {
  18045. // "campaignId": {
  18046. // "description": "Campaign ID in this association.",
  18047. // "format": "int64",
  18048. // "location": "path",
  18049. // "required": true,
  18050. // "type": "string"
  18051. // },
  18052. // "maxResults": {
  18053. // "default": "1000",
  18054. // "description": "Maximum number of results to return.",
  18055. // "format": "int32",
  18056. // "location": "query",
  18057. // "maximum": "1000",
  18058. // "minimum": "0",
  18059. // "type": "integer"
  18060. // },
  18061. // "pageToken": {
  18062. // "description": "Value of the nextPageToken from the previous result page.",
  18063. // "location": "query",
  18064. // "type": "string"
  18065. // },
  18066. // "profileId": {
  18067. // "description": "User profile ID associated with this request.",
  18068. // "format": "int64",
  18069. // "location": "path",
  18070. // "required": true,
  18071. // "type": "string"
  18072. // },
  18073. // "sortOrder": {
  18074. // "default": "ASCENDING",
  18075. // "description": "Order of sorted results.",
  18076. // "enum": [
  18077. // "ASCENDING",
  18078. // "DESCENDING"
  18079. // ],
  18080. // "enumDescriptions": [
  18081. // "",
  18082. // ""
  18083. // ],
  18084. // "location": "query",
  18085. // "type": "string"
  18086. // }
  18087. // },
  18088. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  18089. // "response": {
  18090. // "$ref": "CampaignCreativeAssociationsListResponse"
  18091. // },
  18092. // "scopes": [
  18093. // "https://www.googleapis.com/auth/dfatrafficking"
  18094. // ]
  18095. // }
  18096. }
  18097. // Pages invokes f for each page of results.
  18098. // A non-nil error returned from f will halt the iteration.
  18099. // The provided context supersedes any context provided to the Context method.
  18100. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  18101. c.ctx_ = ctx
  18102. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18103. for {
  18104. x, err := c.Do()
  18105. if err != nil {
  18106. return err
  18107. }
  18108. if err := f(x); err != nil {
  18109. return err
  18110. }
  18111. if x.NextPageToken == "" {
  18112. return nil
  18113. }
  18114. c.PageToken(x.NextPageToken)
  18115. }
  18116. }
  18117. // method id "dfareporting.campaigns.get":
  18118. type CampaignsGetCall struct {
  18119. s *Service
  18120. profileId int64
  18121. id int64
  18122. urlParams_ gensupport.URLParams
  18123. ifNoneMatch_ string
  18124. ctx_ context.Context
  18125. header_ http.Header
  18126. }
  18127. // Get: Gets one campaign by ID.
  18128. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  18129. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18130. c.profileId = profileId
  18131. c.id = id
  18132. return c
  18133. }
  18134. // Fields allows partial responses to be retrieved. See
  18135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18136. // for more information.
  18137. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  18138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18139. return c
  18140. }
  18141. // IfNoneMatch sets the optional parameter which makes the operation
  18142. // fail if the object's ETag matches the given value. This is useful for
  18143. // getting updates only after the object has changed since the last
  18144. // request. Use googleapi.IsNotModified to check whether the response
  18145. // error from Do is the result of In-None-Match.
  18146. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  18147. c.ifNoneMatch_ = entityTag
  18148. return c
  18149. }
  18150. // Context sets the context to be used in this call's Do method. Any
  18151. // pending HTTP request will be aborted if the provided context is
  18152. // canceled.
  18153. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  18154. c.ctx_ = ctx
  18155. return c
  18156. }
  18157. // Header returns an http.Header that can be modified by the caller to
  18158. // add HTTP headers to the request.
  18159. func (c *CampaignsGetCall) Header() http.Header {
  18160. if c.header_ == nil {
  18161. c.header_ = make(http.Header)
  18162. }
  18163. return c.header_
  18164. }
  18165. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18166. reqHeaders := make(http.Header)
  18167. for k, v := range c.header_ {
  18168. reqHeaders[k] = v
  18169. }
  18170. reqHeaders.Set("User-Agent", c.s.userAgent())
  18171. if c.ifNoneMatch_ != "" {
  18172. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18173. }
  18174. var body io.Reader = nil
  18175. c.urlParams_.Set("alt", alt)
  18176. c.urlParams_.Set("prettyPrint", "false")
  18177. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18178. urls += "?" + c.urlParams_.Encode()
  18179. req, err := http.NewRequest("GET", urls, body)
  18180. if err != nil {
  18181. return nil, err
  18182. }
  18183. req.Header = reqHeaders
  18184. googleapi.Expand(req.URL, map[string]string{
  18185. "profileId": strconv.FormatInt(c.profileId, 10),
  18186. "id": strconv.FormatInt(c.id, 10),
  18187. })
  18188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18189. }
  18190. // Do executes the "dfareporting.campaigns.get" call.
  18191. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18192. // code is an error. Response headers are in either
  18193. // *Campaign.ServerResponse.Header or (if a response was returned at
  18194. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18195. // to check whether the returned error was because
  18196. // http.StatusNotModified was returned.
  18197. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18198. gensupport.SetOptions(c.urlParams_, opts...)
  18199. res, err := c.doRequest("json")
  18200. if res != nil && res.StatusCode == http.StatusNotModified {
  18201. if res.Body != nil {
  18202. res.Body.Close()
  18203. }
  18204. return nil, &googleapi.Error{
  18205. Code: res.StatusCode,
  18206. Header: res.Header,
  18207. }
  18208. }
  18209. if err != nil {
  18210. return nil, err
  18211. }
  18212. defer googleapi.CloseBody(res)
  18213. if err := googleapi.CheckResponse(res); err != nil {
  18214. return nil, err
  18215. }
  18216. ret := &Campaign{
  18217. ServerResponse: googleapi.ServerResponse{
  18218. Header: res.Header,
  18219. HTTPStatusCode: res.StatusCode,
  18220. },
  18221. }
  18222. target := &ret
  18223. if err := gensupport.DecodeResponse(target, res); err != nil {
  18224. return nil, err
  18225. }
  18226. return ret, nil
  18227. // {
  18228. // "description": "Gets one campaign by ID.",
  18229. // "httpMethod": "GET",
  18230. // "id": "dfareporting.campaigns.get",
  18231. // "parameterOrder": [
  18232. // "profileId",
  18233. // "id"
  18234. // ],
  18235. // "parameters": {
  18236. // "id": {
  18237. // "description": "Campaign ID.",
  18238. // "format": "int64",
  18239. // "location": "path",
  18240. // "required": true,
  18241. // "type": "string"
  18242. // },
  18243. // "profileId": {
  18244. // "description": "User profile ID associated with this request.",
  18245. // "format": "int64",
  18246. // "location": "path",
  18247. // "required": true,
  18248. // "type": "string"
  18249. // }
  18250. // },
  18251. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18252. // "response": {
  18253. // "$ref": "Campaign"
  18254. // },
  18255. // "scopes": [
  18256. // "https://www.googleapis.com/auth/dfatrafficking"
  18257. // ]
  18258. // }
  18259. }
  18260. // method id "dfareporting.campaigns.insert":
  18261. type CampaignsInsertCall struct {
  18262. s *Service
  18263. profileId int64
  18264. campaign *Campaign
  18265. urlParams_ gensupport.URLParams
  18266. ctx_ context.Context
  18267. header_ http.Header
  18268. }
  18269. // Insert: Inserts a new campaign.
  18270. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18271. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18272. c.profileId = profileId
  18273. c.campaign = campaign
  18274. return c
  18275. }
  18276. // Fields allows partial responses to be retrieved. See
  18277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18278. // for more information.
  18279. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18281. return c
  18282. }
  18283. // Context sets the context to be used in this call's Do method. Any
  18284. // pending HTTP request will be aborted if the provided context is
  18285. // canceled.
  18286. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18287. c.ctx_ = ctx
  18288. return c
  18289. }
  18290. // Header returns an http.Header that can be modified by the caller to
  18291. // add HTTP headers to the request.
  18292. func (c *CampaignsInsertCall) Header() http.Header {
  18293. if c.header_ == nil {
  18294. c.header_ = make(http.Header)
  18295. }
  18296. return c.header_
  18297. }
  18298. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18299. reqHeaders := make(http.Header)
  18300. for k, v := range c.header_ {
  18301. reqHeaders[k] = v
  18302. }
  18303. reqHeaders.Set("User-Agent", c.s.userAgent())
  18304. var body io.Reader = nil
  18305. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18306. if err != nil {
  18307. return nil, err
  18308. }
  18309. reqHeaders.Set("Content-Type", "application/json")
  18310. c.urlParams_.Set("alt", alt)
  18311. c.urlParams_.Set("prettyPrint", "false")
  18312. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18313. urls += "?" + c.urlParams_.Encode()
  18314. req, err := http.NewRequest("POST", urls, body)
  18315. if err != nil {
  18316. return nil, err
  18317. }
  18318. req.Header = reqHeaders
  18319. googleapi.Expand(req.URL, map[string]string{
  18320. "profileId": strconv.FormatInt(c.profileId, 10),
  18321. })
  18322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18323. }
  18324. // Do executes the "dfareporting.campaigns.insert" call.
  18325. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18326. // code is an error. Response headers are in either
  18327. // *Campaign.ServerResponse.Header or (if a response was returned at
  18328. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18329. // to check whether the returned error was because
  18330. // http.StatusNotModified was returned.
  18331. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18332. gensupport.SetOptions(c.urlParams_, opts...)
  18333. res, err := c.doRequest("json")
  18334. if res != nil && res.StatusCode == http.StatusNotModified {
  18335. if res.Body != nil {
  18336. res.Body.Close()
  18337. }
  18338. return nil, &googleapi.Error{
  18339. Code: res.StatusCode,
  18340. Header: res.Header,
  18341. }
  18342. }
  18343. if err != nil {
  18344. return nil, err
  18345. }
  18346. defer googleapi.CloseBody(res)
  18347. if err := googleapi.CheckResponse(res); err != nil {
  18348. return nil, err
  18349. }
  18350. ret := &Campaign{
  18351. ServerResponse: googleapi.ServerResponse{
  18352. Header: res.Header,
  18353. HTTPStatusCode: res.StatusCode,
  18354. },
  18355. }
  18356. target := &ret
  18357. if err := gensupport.DecodeResponse(target, res); err != nil {
  18358. return nil, err
  18359. }
  18360. return ret, nil
  18361. // {
  18362. // "description": "Inserts a new campaign.",
  18363. // "httpMethod": "POST",
  18364. // "id": "dfareporting.campaigns.insert",
  18365. // "parameterOrder": [
  18366. // "profileId"
  18367. // ],
  18368. // "parameters": {
  18369. // "profileId": {
  18370. // "description": "User profile ID associated with this request.",
  18371. // "format": "int64",
  18372. // "location": "path",
  18373. // "required": true,
  18374. // "type": "string"
  18375. // }
  18376. // },
  18377. // "path": "userprofiles/{profileId}/campaigns",
  18378. // "request": {
  18379. // "$ref": "Campaign"
  18380. // },
  18381. // "response": {
  18382. // "$ref": "Campaign"
  18383. // },
  18384. // "scopes": [
  18385. // "https://www.googleapis.com/auth/dfatrafficking"
  18386. // ]
  18387. // }
  18388. }
  18389. // method id "dfareporting.campaigns.list":
  18390. type CampaignsListCall struct {
  18391. s *Service
  18392. profileId int64
  18393. urlParams_ gensupport.URLParams
  18394. ifNoneMatch_ string
  18395. ctx_ context.Context
  18396. header_ http.Header
  18397. }
  18398. // List: Retrieves a list of campaigns, possibly filtered. This method
  18399. // supports paging.
  18400. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18401. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18402. c.profileId = profileId
  18403. return c
  18404. }
  18405. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18406. // Select only campaigns whose advertisers belong to these advertiser
  18407. // groups.
  18408. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18409. var advertiserGroupIds_ []string
  18410. for _, v := range advertiserGroupIds {
  18411. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18412. }
  18413. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18414. return c
  18415. }
  18416. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18417. // only campaigns that belong to these advertisers.
  18418. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18419. var advertiserIds_ []string
  18420. for _, v := range advertiserIds {
  18421. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18422. }
  18423. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18424. return c
  18425. }
  18426. // Archived sets the optional parameter "archived": Select only archived
  18427. // campaigns. Don't set this field to select both archived and
  18428. // non-archived campaigns.
  18429. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18430. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18431. return c
  18432. }
  18433. // AtLeastOneOptimizationActivity sets the optional parameter
  18434. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18435. // least one optimization activity.
  18436. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18437. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18438. return c
  18439. }
  18440. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18441. // campaigns with these IDs.
  18442. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18443. var excludedIds_ []string
  18444. for _, v := range excludedIds {
  18445. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18446. }
  18447. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18448. return c
  18449. }
  18450. // Ids sets the optional parameter "ids": Select only campaigns with
  18451. // these IDs.
  18452. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18453. var ids_ []string
  18454. for _, v := range ids {
  18455. ids_ = append(ids_, fmt.Sprint(v))
  18456. }
  18457. c.urlParams_.SetMulti("ids", ids_)
  18458. return c
  18459. }
  18460. // MaxResults sets the optional parameter "maxResults": Maximum number
  18461. // of results to return.
  18462. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18463. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18464. return c
  18465. }
  18466. // OverriddenEventTagId sets the optional parameter
  18467. // "overriddenEventTagId": Select only campaigns that have overridden
  18468. // this event tag ID.
  18469. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18470. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18471. return c
  18472. }
  18473. // PageToken sets the optional parameter "pageToken": Value of the
  18474. // nextPageToken from the previous result page.
  18475. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18476. c.urlParams_.Set("pageToken", pageToken)
  18477. return c
  18478. }
  18479. // SearchString sets the optional parameter "searchString": Allows
  18480. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18481. // example, "campaign*2015" will return campaigns with names like
  18482. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18483. // 2015". Most of the searches also add wildcards implicitly at the
  18484. // start and the end of the search string. For example, a search string
  18485. // of "campaign" will match campaigns with name "my campaign", "campaign
  18486. // 2015", or simply "campaign".
  18487. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18488. c.urlParams_.Set("searchString", searchString)
  18489. return c
  18490. }
  18491. // SortField sets the optional parameter "sortField": Field by which to
  18492. // sort the list.
  18493. //
  18494. // Possible values:
  18495. // "ID" (default)
  18496. // "NAME"
  18497. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18498. c.urlParams_.Set("sortField", sortField)
  18499. return c
  18500. }
  18501. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18502. // results.
  18503. //
  18504. // Possible values:
  18505. // "ASCENDING" (default)
  18506. // "DESCENDING"
  18507. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18508. c.urlParams_.Set("sortOrder", sortOrder)
  18509. return c
  18510. }
  18511. // SubaccountId sets the optional parameter "subaccountId": Select only
  18512. // campaigns that belong to this subaccount.
  18513. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18514. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18515. return c
  18516. }
  18517. // Fields allows partial responses to be retrieved. See
  18518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18519. // for more information.
  18520. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18522. return c
  18523. }
  18524. // IfNoneMatch sets the optional parameter which makes the operation
  18525. // fail if the object's ETag matches the given value. This is useful for
  18526. // getting updates only after the object has changed since the last
  18527. // request. Use googleapi.IsNotModified to check whether the response
  18528. // error from Do is the result of In-None-Match.
  18529. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18530. c.ifNoneMatch_ = entityTag
  18531. return c
  18532. }
  18533. // Context sets the context to be used in this call's Do method. Any
  18534. // pending HTTP request will be aborted if the provided context is
  18535. // canceled.
  18536. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18537. c.ctx_ = ctx
  18538. return c
  18539. }
  18540. // Header returns an http.Header that can be modified by the caller to
  18541. // add HTTP headers to the request.
  18542. func (c *CampaignsListCall) Header() http.Header {
  18543. if c.header_ == nil {
  18544. c.header_ = make(http.Header)
  18545. }
  18546. return c.header_
  18547. }
  18548. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18549. reqHeaders := make(http.Header)
  18550. for k, v := range c.header_ {
  18551. reqHeaders[k] = v
  18552. }
  18553. reqHeaders.Set("User-Agent", c.s.userAgent())
  18554. if c.ifNoneMatch_ != "" {
  18555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18556. }
  18557. var body io.Reader = nil
  18558. c.urlParams_.Set("alt", alt)
  18559. c.urlParams_.Set("prettyPrint", "false")
  18560. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18561. urls += "?" + c.urlParams_.Encode()
  18562. req, err := http.NewRequest("GET", urls, body)
  18563. if err != nil {
  18564. return nil, err
  18565. }
  18566. req.Header = reqHeaders
  18567. googleapi.Expand(req.URL, map[string]string{
  18568. "profileId": strconv.FormatInt(c.profileId, 10),
  18569. })
  18570. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18571. }
  18572. // Do executes the "dfareporting.campaigns.list" call.
  18573. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18574. // non-2xx status code is an error. Response headers are in either
  18575. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18576. // returned at all) in error.(*googleapi.Error).Header. Use
  18577. // googleapi.IsNotModified to check whether the returned error was
  18578. // because http.StatusNotModified was returned.
  18579. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18580. gensupport.SetOptions(c.urlParams_, opts...)
  18581. res, err := c.doRequest("json")
  18582. if res != nil && res.StatusCode == http.StatusNotModified {
  18583. if res.Body != nil {
  18584. res.Body.Close()
  18585. }
  18586. return nil, &googleapi.Error{
  18587. Code: res.StatusCode,
  18588. Header: res.Header,
  18589. }
  18590. }
  18591. if err != nil {
  18592. return nil, err
  18593. }
  18594. defer googleapi.CloseBody(res)
  18595. if err := googleapi.CheckResponse(res); err != nil {
  18596. return nil, err
  18597. }
  18598. ret := &CampaignsListResponse{
  18599. ServerResponse: googleapi.ServerResponse{
  18600. Header: res.Header,
  18601. HTTPStatusCode: res.StatusCode,
  18602. },
  18603. }
  18604. target := &ret
  18605. if err := gensupport.DecodeResponse(target, res); err != nil {
  18606. return nil, err
  18607. }
  18608. return ret, nil
  18609. // {
  18610. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18611. // "httpMethod": "GET",
  18612. // "id": "dfareporting.campaigns.list",
  18613. // "parameterOrder": [
  18614. // "profileId"
  18615. // ],
  18616. // "parameters": {
  18617. // "advertiserGroupIds": {
  18618. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18619. // "format": "int64",
  18620. // "location": "query",
  18621. // "repeated": true,
  18622. // "type": "string"
  18623. // },
  18624. // "advertiserIds": {
  18625. // "description": "Select only campaigns that belong to these advertisers.",
  18626. // "format": "int64",
  18627. // "location": "query",
  18628. // "repeated": true,
  18629. // "type": "string"
  18630. // },
  18631. // "archived": {
  18632. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18633. // "location": "query",
  18634. // "type": "boolean"
  18635. // },
  18636. // "atLeastOneOptimizationActivity": {
  18637. // "description": "Select only campaigns that have at least one optimization activity.",
  18638. // "location": "query",
  18639. // "type": "boolean"
  18640. // },
  18641. // "excludedIds": {
  18642. // "description": "Exclude campaigns with these IDs.",
  18643. // "format": "int64",
  18644. // "location": "query",
  18645. // "repeated": true,
  18646. // "type": "string"
  18647. // },
  18648. // "ids": {
  18649. // "description": "Select only campaigns with these IDs.",
  18650. // "format": "int64",
  18651. // "location": "query",
  18652. // "repeated": true,
  18653. // "type": "string"
  18654. // },
  18655. // "maxResults": {
  18656. // "default": "1000",
  18657. // "description": "Maximum number of results to return.",
  18658. // "format": "int32",
  18659. // "location": "query",
  18660. // "maximum": "1000",
  18661. // "minimum": "0",
  18662. // "type": "integer"
  18663. // },
  18664. // "overriddenEventTagId": {
  18665. // "description": "Select only campaigns that have overridden this event tag ID.",
  18666. // "format": "int64",
  18667. // "location": "query",
  18668. // "type": "string"
  18669. // },
  18670. // "pageToken": {
  18671. // "description": "Value of the nextPageToken from the previous result page.",
  18672. // "location": "query",
  18673. // "type": "string"
  18674. // },
  18675. // "profileId": {
  18676. // "description": "User profile ID associated with this request.",
  18677. // "format": "int64",
  18678. // "location": "path",
  18679. // "required": true,
  18680. // "type": "string"
  18681. // },
  18682. // "searchString": {
  18683. // "description": "Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, \"campaign*2015\" will return campaigns with names like \"campaign June 2015\", \"campaign April 2015\", or simply \"campaign 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"campaign\" will match campaigns with name \"my campaign\", \"campaign 2015\", or simply \"campaign\".",
  18684. // "location": "query",
  18685. // "type": "string"
  18686. // },
  18687. // "sortField": {
  18688. // "default": "ID",
  18689. // "description": "Field by which to sort the list.",
  18690. // "enum": [
  18691. // "ID",
  18692. // "NAME"
  18693. // ],
  18694. // "enumDescriptions": [
  18695. // "",
  18696. // ""
  18697. // ],
  18698. // "location": "query",
  18699. // "type": "string"
  18700. // },
  18701. // "sortOrder": {
  18702. // "default": "ASCENDING",
  18703. // "description": "Order of sorted results.",
  18704. // "enum": [
  18705. // "ASCENDING",
  18706. // "DESCENDING"
  18707. // ],
  18708. // "enumDescriptions": [
  18709. // "",
  18710. // ""
  18711. // ],
  18712. // "location": "query",
  18713. // "type": "string"
  18714. // },
  18715. // "subaccountId": {
  18716. // "description": "Select only campaigns that belong to this subaccount.",
  18717. // "format": "int64",
  18718. // "location": "query",
  18719. // "type": "string"
  18720. // }
  18721. // },
  18722. // "path": "userprofiles/{profileId}/campaigns",
  18723. // "response": {
  18724. // "$ref": "CampaignsListResponse"
  18725. // },
  18726. // "scopes": [
  18727. // "https://www.googleapis.com/auth/dfatrafficking"
  18728. // ]
  18729. // }
  18730. }
  18731. // Pages invokes f for each page of results.
  18732. // A non-nil error returned from f will halt the iteration.
  18733. // The provided context supersedes any context provided to the Context method.
  18734. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18735. c.ctx_ = ctx
  18736. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18737. for {
  18738. x, err := c.Do()
  18739. if err != nil {
  18740. return err
  18741. }
  18742. if err := f(x); err != nil {
  18743. return err
  18744. }
  18745. if x.NextPageToken == "" {
  18746. return nil
  18747. }
  18748. c.PageToken(x.NextPageToken)
  18749. }
  18750. }
  18751. // method id "dfareporting.campaigns.patch":
  18752. type CampaignsPatchCall struct {
  18753. s *Service
  18754. profileId int64
  18755. campaign *Campaign
  18756. urlParams_ gensupport.URLParams
  18757. ctx_ context.Context
  18758. header_ http.Header
  18759. }
  18760. // Patch: Updates an existing campaign. This method supports patch
  18761. // semantics.
  18762. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18763. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18764. c.profileId = profileId
  18765. c.urlParams_.Set("id", fmt.Sprint(id))
  18766. c.campaign = campaign
  18767. return c
  18768. }
  18769. // Fields allows partial responses to be retrieved. See
  18770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18771. // for more information.
  18772. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  18773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18774. return c
  18775. }
  18776. // Context sets the context to be used in this call's Do method. Any
  18777. // pending HTTP request will be aborted if the provided context is
  18778. // canceled.
  18779. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  18780. c.ctx_ = ctx
  18781. return c
  18782. }
  18783. // Header returns an http.Header that can be modified by the caller to
  18784. // add HTTP headers to the request.
  18785. func (c *CampaignsPatchCall) Header() http.Header {
  18786. if c.header_ == nil {
  18787. c.header_ = make(http.Header)
  18788. }
  18789. return c.header_
  18790. }
  18791. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  18792. reqHeaders := make(http.Header)
  18793. for k, v := range c.header_ {
  18794. reqHeaders[k] = v
  18795. }
  18796. reqHeaders.Set("User-Agent", c.s.userAgent())
  18797. var body io.Reader = nil
  18798. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18799. if err != nil {
  18800. return nil, err
  18801. }
  18802. reqHeaders.Set("Content-Type", "application/json")
  18803. c.urlParams_.Set("alt", alt)
  18804. c.urlParams_.Set("prettyPrint", "false")
  18805. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18806. urls += "?" + c.urlParams_.Encode()
  18807. req, err := http.NewRequest("PATCH", urls, body)
  18808. if err != nil {
  18809. return nil, err
  18810. }
  18811. req.Header = reqHeaders
  18812. googleapi.Expand(req.URL, map[string]string{
  18813. "profileId": strconv.FormatInt(c.profileId, 10),
  18814. })
  18815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18816. }
  18817. // Do executes the "dfareporting.campaigns.patch" call.
  18818. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18819. // code is an error. Response headers are in either
  18820. // *Campaign.ServerResponse.Header or (if a response was returned at
  18821. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18822. // to check whether the returned error was because
  18823. // http.StatusNotModified was returned.
  18824. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18825. gensupport.SetOptions(c.urlParams_, opts...)
  18826. res, err := c.doRequest("json")
  18827. if res != nil && res.StatusCode == http.StatusNotModified {
  18828. if res.Body != nil {
  18829. res.Body.Close()
  18830. }
  18831. return nil, &googleapi.Error{
  18832. Code: res.StatusCode,
  18833. Header: res.Header,
  18834. }
  18835. }
  18836. if err != nil {
  18837. return nil, err
  18838. }
  18839. defer googleapi.CloseBody(res)
  18840. if err := googleapi.CheckResponse(res); err != nil {
  18841. return nil, err
  18842. }
  18843. ret := &Campaign{
  18844. ServerResponse: googleapi.ServerResponse{
  18845. Header: res.Header,
  18846. HTTPStatusCode: res.StatusCode,
  18847. },
  18848. }
  18849. target := &ret
  18850. if err := gensupport.DecodeResponse(target, res); err != nil {
  18851. return nil, err
  18852. }
  18853. return ret, nil
  18854. // {
  18855. // "description": "Updates an existing campaign. This method supports patch semantics.",
  18856. // "httpMethod": "PATCH",
  18857. // "id": "dfareporting.campaigns.patch",
  18858. // "parameterOrder": [
  18859. // "profileId",
  18860. // "id"
  18861. // ],
  18862. // "parameters": {
  18863. // "id": {
  18864. // "description": "Campaign ID.",
  18865. // "format": "int64",
  18866. // "location": "query",
  18867. // "required": true,
  18868. // "type": "string"
  18869. // },
  18870. // "profileId": {
  18871. // "description": "User profile ID associated with this request.",
  18872. // "format": "int64",
  18873. // "location": "path",
  18874. // "required": true,
  18875. // "type": "string"
  18876. // }
  18877. // },
  18878. // "path": "userprofiles/{profileId}/campaigns",
  18879. // "request": {
  18880. // "$ref": "Campaign"
  18881. // },
  18882. // "response": {
  18883. // "$ref": "Campaign"
  18884. // },
  18885. // "scopes": [
  18886. // "https://www.googleapis.com/auth/dfatrafficking"
  18887. // ]
  18888. // }
  18889. }
  18890. // method id "dfareporting.campaigns.update":
  18891. type CampaignsUpdateCall struct {
  18892. s *Service
  18893. profileId int64
  18894. campaign *Campaign
  18895. urlParams_ gensupport.URLParams
  18896. ctx_ context.Context
  18897. header_ http.Header
  18898. }
  18899. // Update: Updates an existing campaign.
  18900. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  18901. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18902. c.profileId = profileId
  18903. c.campaign = campaign
  18904. return c
  18905. }
  18906. // Fields allows partial responses to be retrieved. See
  18907. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18908. // for more information.
  18909. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  18910. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18911. return c
  18912. }
  18913. // Context sets the context to be used in this call's Do method. Any
  18914. // pending HTTP request will be aborted if the provided context is
  18915. // canceled.
  18916. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  18917. c.ctx_ = ctx
  18918. return c
  18919. }
  18920. // Header returns an http.Header that can be modified by the caller to
  18921. // add HTTP headers to the request.
  18922. func (c *CampaignsUpdateCall) Header() http.Header {
  18923. if c.header_ == nil {
  18924. c.header_ = make(http.Header)
  18925. }
  18926. return c.header_
  18927. }
  18928. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  18929. reqHeaders := make(http.Header)
  18930. for k, v := range c.header_ {
  18931. reqHeaders[k] = v
  18932. }
  18933. reqHeaders.Set("User-Agent", c.s.userAgent())
  18934. var body io.Reader = nil
  18935. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18936. if err != nil {
  18937. return nil, err
  18938. }
  18939. reqHeaders.Set("Content-Type", "application/json")
  18940. c.urlParams_.Set("alt", alt)
  18941. c.urlParams_.Set("prettyPrint", "false")
  18942. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18943. urls += "?" + c.urlParams_.Encode()
  18944. req, err := http.NewRequest("PUT", urls, body)
  18945. if err != nil {
  18946. return nil, err
  18947. }
  18948. req.Header = reqHeaders
  18949. googleapi.Expand(req.URL, map[string]string{
  18950. "profileId": strconv.FormatInt(c.profileId, 10),
  18951. })
  18952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18953. }
  18954. // Do executes the "dfareporting.campaigns.update" call.
  18955. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18956. // code is an error. Response headers are in either
  18957. // *Campaign.ServerResponse.Header or (if a response was returned at
  18958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18959. // to check whether the returned error was because
  18960. // http.StatusNotModified was returned.
  18961. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18962. gensupport.SetOptions(c.urlParams_, opts...)
  18963. res, err := c.doRequest("json")
  18964. if res != nil && res.StatusCode == http.StatusNotModified {
  18965. if res.Body != nil {
  18966. res.Body.Close()
  18967. }
  18968. return nil, &googleapi.Error{
  18969. Code: res.StatusCode,
  18970. Header: res.Header,
  18971. }
  18972. }
  18973. if err != nil {
  18974. return nil, err
  18975. }
  18976. defer googleapi.CloseBody(res)
  18977. if err := googleapi.CheckResponse(res); err != nil {
  18978. return nil, err
  18979. }
  18980. ret := &Campaign{
  18981. ServerResponse: googleapi.ServerResponse{
  18982. Header: res.Header,
  18983. HTTPStatusCode: res.StatusCode,
  18984. },
  18985. }
  18986. target := &ret
  18987. if err := gensupport.DecodeResponse(target, res); err != nil {
  18988. return nil, err
  18989. }
  18990. return ret, nil
  18991. // {
  18992. // "description": "Updates an existing campaign.",
  18993. // "httpMethod": "PUT",
  18994. // "id": "dfareporting.campaigns.update",
  18995. // "parameterOrder": [
  18996. // "profileId"
  18997. // ],
  18998. // "parameters": {
  18999. // "profileId": {
  19000. // "description": "User profile ID associated with this request.",
  19001. // "format": "int64",
  19002. // "location": "path",
  19003. // "required": true,
  19004. // "type": "string"
  19005. // }
  19006. // },
  19007. // "path": "userprofiles/{profileId}/campaigns",
  19008. // "request": {
  19009. // "$ref": "Campaign"
  19010. // },
  19011. // "response": {
  19012. // "$ref": "Campaign"
  19013. // },
  19014. // "scopes": [
  19015. // "https://www.googleapis.com/auth/dfatrafficking"
  19016. // ]
  19017. // }
  19018. }
  19019. // method id "dfareporting.changeLogs.get":
  19020. type ChangeLogsGetCall struct {
  19021. s *Service
  19022. profileId int64
  19023. id int64
  19024. urlParams_ gensupport.URLParams
  19025. ifNoneMatch_ string
  19026. ctx_ context.Context
  19027. header_ http.Header
  19028. }
  19029. // Get: Gets one change log by ID.
  19030. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  19031. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19032. c.profileId = profileId
  19033. c.id = id
  19034. return c
  19035. }
  19036. // Fields allows partial responses to be retrieved. See
  19037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19038. // for more information.
  19039. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  19040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19041. return c
  19042. }
  19043. // IfNoneMatch sets the optional parameter which makes the operation
  19044. // fail if the object's ETag matches the given value. This is useful for
  19045. // getting updates only after the object has changed since the last
  19046. // request. Use googleapi.IsNotModified to check whether the response
  19047. // error from Do is the result of In-None-Match.
  19048. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  19049. c.ifNoneMatch_ = entityTag
  19050. return c
  19051. }
  19052. // Context sets the context to be used in this call's Do method. Any
  19053. // pending HTTP request will be aborted if the provided context is
  19054. // canceled.
  19055. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  19056. c.ctx_ = ctx
  19057. return c
  19058. }
  19059. // Header returns an http.Header that can be modified by the caller to
  19060. // add HTTP headers to the request.
  19061. func (c *ChangeLogsGetCall) Header() http.Header {
  19062. if c.header_ == nil {
  19063. c.header_ = make(http.Header)
  19064. }
  19065. return c.header_
  19066. }
  19067. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  19068. reqHeaders := make(http.Header)
  19069. for k, v := range c.header_ {
  19070. reqHeaders[k] = v
  19071. }
  19072. reqHeaders.Set("User-Agent", c.s.userAgent())
  19073. if c.ifNoneMatch_ != "" {
  19074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19075. }
  19076. var body io.Reader = nil
  19077. c.urlParams_.Set("alt", alt)
  19078. c.urlParams_.Set("prettyPrint", "false")
  19079. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  19080. urls += "?" + c.urlParams_.Encode()
  19081. req, err := http.NewRequest("GET", urls, body)
  19082. if err != nil {
  19083. return nil, err
  19084. }
  19085. req.Header = reqHeaders
  19086. googleapi.Expand(req.URL, map[string]string{
  19087. "profileId": strconv.FormatInt(c.profileId, 10),
  19088. "id": strconv.FormatInt(c.id, 10),
  19089. })
  19090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19091. }
  19092. // Do executes the "dfareporting.changeLogs.get" call.
  19093. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  19094. // status code is an error. Response headers are in either
  19095. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  19096. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  19097. // to check whether the returned error was because
  19098. // http.StatusNotModified was returned.
  19099. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  19100. gensupport.SetOptions(c.urlParams_, opts...)
  19101. res, err := c.doRequest("json")
  19102. if res != nil && res.StatusCode == http.StatusNotModified {
  19103. if res.Body != nil {
  19104. res.Body.Close()
  19105. }
  19106. return nil, &googleapi.Error{
  19107. Code: res.StatusCode,
  19108. Header: res.Header,
  19109. }
  19110. }
  19111. if err != nil {
  19112. return nil, err
  19113. }
  19114. defer googleapi.CloseBody(res)
  19115. if err := googleapi.CheckResponse(res); err != nil {
  19116. return nil, err
  19117. }
  19118. ret := &ChangeLog{
  19119. ServerResponse: googleapi.ServerResponse{
  19120. Header: res.Header,
  19121. HTTPStatusCode: res.StatusCode,
  19122. },
  19123. }
  19124. target := &ret
  19125. if err := gensupport.DecodeResponse(target, res); err != nil {
  19126. return nil, err
  19127. }
  19128. return ret, nil
  19129. // {
  19130. // "description": "Gets one change log by ID.",
  19131. // "httpMethod": "GET",
  19132. // "id": "dfareporting.changeLogs.get",
  19133. // "parameterOrder": [
  19134. // "profileId",
  19135. // "id"
  19136. // ],
  19137. // "parameters": {
  19138. // "id": {
  19139. // "description": "Change log ID.",
  19140. // "format": "int64",
  19141. // "location": "path",
  19142. // "required": true,
  19143. // "type": "string"
  19144. // },
  19145. // "profileId": {
  19146. // "description": "User profile ID associated with this request.",
  19147. // "format": "int64",
  19148. // "location": "path",
  19149. // "required": true,
  19150. // "type": "string"
  19151. // }
  19152. // },
  19153. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  19154. // "response": {
  19155. // "$ref": "ChangeLog"
  19156. // },
  19157. // "scopes": [
  19158. // "https://www.googleapis.com/auth/dfatrafficking"
  19159. // ]
  19160. // }
  19161. }
  19162. // method id "dfareporting.changeLogs.list":
  19163. type ChangeLogsListCall struct {
  19164. s *Service
  19165. profileId int64
  19166. urlParams_ gensupport.URLParams
  19167. ifNoneMatch_ string
  19168. ctx_ context.Context
  19169. header_ http.Header
  19170. }
  19171. // List: Retrieves a list of change logs. This method supports paging.
  19172. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  19173. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19174. c.profileId = profileId
  19175. return c
  19176. }
  19177. // Action sets the optional parameter "action": Select only change logs
  19178. // with the specified action.
  19179. //
  19180. // Possible values:
  19181. // "ACTION_ADD"
  19182. // "ACTION_ASSIGN"
  19183. // "ACTION_ASSOCIATE"
  19184. // "ACTION_CREATE"
  19185. // "ACTION_DELETE"
  19186. // "ACTION_DISABLE"
  19187. // "ACTION_EMAIL_TAGS"
  19188. // "ACTION_ENABLE"
  19189. // "ACTION_LINK"
  19190. // "ACTION_MARK_AS_DEFAULT"
  19191. // "ACTION_PUSH"
  19192. // "ACTION_REMOVE"
  19193. // "ACTION_SEND"
  19194. // "ACTION_SHARE"
  19195. // "ACTION_UNASSIGN"
  19196. // "ACTION_UNLINK"
  19197. // "ACTION_UPDATE"
  19198. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19199. c.urlParams_.Set("action", action)
  19200. return c
  19201. }
  19202. // Ids sets the optional parameter "ids": Select only change logs with
  19203. // these IDs.
  19204. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19205. var ids_ []string
  19206. for _, v := range ids {
  19207. ids_ = append(ids_, fmt.Sprint(v))
  19208. }
  19209. c.urlParams_.SetMulti("ids", ids_)
  19210. return c
  19211. }
  19212. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19213. // only change logs whose change time is before the specified
  19214. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19215. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19216. // America/New York time zone, the format is
  19217. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19218. // the letter T, the hour (24-hour clock system), minute, second, and
  19219. // then the time zone offset.
  19220. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19221. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19222. return c
  19223. }
  19224. // MaxResults sets the optional parameter "maxResults": Maximum number
  19225. // of results to return.
  19226. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19228. return c
  19229. }
  19230. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19231. // only change logs whose change time is before the specified
  19232. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19233. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19234. // America/New York time zone, the format is
  19235. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19236. // the letter T, the hour (24-hour clock system), minute, second, and
  19237. // then the time zone offset.
  19238. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19239. c.urlParams_.Set("minChangeTime", minChangeTime)
  19240. return c
  19241. }
  19242. // ObjectIds sets the optional parameter "objectIds": Select only change
  19243. // logs with these object IDs.
  19244. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19245. var objectIds_ []string
  19246. for _, v := range objectIds {
  19247. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19248. }
  19249. c.urlParams_.SetMulti("objectIds", objectIds_)
  19250. return c
  19251. }
  19252. // ObjectType sets the optional parameter "objectType": Select only
  19253. // change logs with the specified object type.
  19254. //
  19255. // Possible values:
  19256. // "OBJECT_ACCOUNT"
  19257. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19258. // "OBJECT_AD"
  19259. // "OBJECT_ADVERTISER"
  19260. // "OBJECT_ADVERTISER_GROUP"
  19261. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19262. // "OBJECT_BILLING_FEATURE"
  19263. // "OBJECT_BILLING_MINIMUM_FEE"
  19264. // "OBJECT_BILLING_PROFILE"
  19265. // "OBJECT_CAMPAIGN"
  19266. // "OBJECT_CONTENT_CATEGORY"
  19267. // "OBJECT_CREATIVE"
  19268. // "OBJECT_CREATIVE_ASSET"
  19269. // "OBJECT_CREATIVE_BUNDLE"
  19270. // "OBJECT_CREATIVE_FIELD"
  19271. // "OBJECT_CREATIVE_GROUP"
  19272. // "OBJECT_DFA_SITE"
  19273. // "OBJECT_EVENT_TAG"
  19274. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19275. // "OBJECT_FLOODLIGHT_ACTVITY"
  19276. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19277. // "OBJECT_INSTREAM_CREATIVE"
  19278. // "OBJECT_LANDING_PAGE"
  19279. // "OBJECT_MEDIA_ORDER"
  19280. // "OBJECT_PLACEMENT"
  19281. // "OBJECT_PLACEMENT_STRATEGY"
  19282. // "OBJECT_PLAYSTORE_LINK"
  19283. // "OBJECT_PROVIDED_LIST_CLIENT"
  19284. // "OBJECT_RATE_CARD"
  19285. // "OBJECT_REMARKETING_LIST"
  19286. // "OBJECT_RICHMEDIA_CREATIVE"
  19287. // "OBJECT_SD_SITE"
  19288. // "OBJECT_SEARCH_LIFT_STUDY"
  19289. // "OBJECT_SIZE"
  19290. // "OBJECT_SUBACCOUNT"
  19291. // "OBJECT_TARGETING_TEMPLATE"
  19292. // "OBJECT_USER_PROFILE"
  19293. // "OBJECT_USER_PROFILE_FILTER"
  19294. // "OBJECT_USER_ROLE"
  19295. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19296. c.urlParams_.Set("objectType", objectType)
  19297. return c
  19298. }
  19299. // PageToken sets the optional parameter "pageToken": Value of the
  19300. // nextPageToken from the previous result page.
  19301. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19302. c.urlParams_.Set("pageToken", pageToken)
  19303. return c
  19304. }
  19305. // SearchString sets the optional parameter "searchString": Select only
  19306. // change logs whose object ID, user name, old or new values match the
  19307. // search string.
  19308. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19309. c.urlParams_.Set("searchString", searchString)
  19310. return c
  19311. }
  19312. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19313. // only change logs with these user profile IDs.
  19314. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19315. var userProfileIds_ []string
  19316. for _, v := range userProfileIds {
  19317. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19318. }
  19319. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19320. return c
  19321. }
  19322. // Fields allows partial responses to be retrieved. See
  19323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19324. // for more information.
  19325. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19327. return c
  19328. }
  19329. // IfNoneMatch sets the optional parameter which makes the operation
  19330. // fail if the object's ETag matches the given value. This is useful for
  19331. // getting updates only after the object has changed since the last
  19332. // request. Use googleapi.IsNotModified to check whether the response
  19333. // error from Do is the result of In-None-Match.
  19334. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19335. c.ifNoneMatch_ = entityTag
  19336. return c
  19337. }
  19338. // Context sets the context to be used in this call's Do method. Any
  19339. // pending HTTP request will be aborted if the provided context is
  19340. // canceled.
  19341. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19342. c.ctx_ = ctx
  19343. return c
  19344. }
  19345. // Header returns an http.Header that can be modified by the caller to
  19346. // add HTTP headers to the request.
  19347. func (c *ChangeLogsListCall) Header() http.Header {
  19348. if c.header_ == nil {
  19349. c.header_ = make(http.Header)
  19350. }
  19351. return c.header_
  19352. }
  19353. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19354. reqHeaders := make(http.Header)
  19355. for k, v := range c.header_ {
  19356. reqHeaders[k] = v
  19357. }
  19358. reqHeaders.Set("User-Agent", c.s.userAgent())
  19359. if c.ifNoneMatch_ != "" {
  19360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19361. }
  19362. var body io.Reader = nil
  19363. c.urlParams_.Set("alt", alt)
  19364. c.urlParams_.Set("prettyPrint", "false")
  19365. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19366. urls += "?" + c.urlParams_.Encode()
  19367. req, err := http.NewRequest("GET", urls, body)
  19368. if err != nil {
  19369. return nil, err
  19370. }
  19371. req.Header = reqHeaders
  19372. googleapi.Expand(req.URL, map[string]string{
  19373. "profileId": strconv.FormatInt(c.profileId, 10),
  19374. })
  19375. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19376. }
  19377. // Do executes the "dfareporting.changeLogs.list" call.
  19378. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19379. // non-2xx status code is an error. Response headers are in either
  19380. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19381. // returned at all) in error.(*googleapi.Error).Header. Use
  19382. // googleapi.IsNotModified to check whether the returned error was
  19383. // because http.StatusNotModified was returned.
  19384. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19385. gensupport.SetOptions(c.urlParams_, opts...)
  19386. res, err := c.doRequest("json")
  19387. if res != nil && res.StatusCode == http.StatusNotModified {
  19388. if res.Body != nil {
  19389. res.Body.Close()
  19390. }
  19391. return nil, &googleapi.Error{
  19392. Code: res.StatusCode,
  19393. Header: res.Header,
  19394. }
  19395. }
  19396. if err != nil {
  19397. return nil, err
  19398. }
  19399. defer googleapi.CloseBody(res)
  19400. if err := googleapi.CheckResponse(res); err != nil {
  19401. return nil, err
  19402. }
  19403. ret := &ChangeLogsListResponse{
  19404. ServerResponse: googleapi.ServerResponse{
  19405. Header: res.Header,
  19406. HTTPStatusCode: res.StatusCode,
  19407. },
  19408. }
  19409. target := &ret
  19410. if err := gensupport.DecodeResponse(target, res); err != nil {
  19411. return nil, err
  19412. }
  19413. return ret, nil
  19414. // {
  19415. // "description": "Retrieves a list of change logs. This method supports paging.",
  19416. // "httpMethod": "GET",
  19417. // "id": "dfareporting.changeLogs.list",
  19418. // "parameterOrder": [
  19419. // "profileId"
  19420. // ],
  19421. // "parameters": {
  19422. // "action": {
  19423. // "description": "Select only change logs with the specified action.",
  19424. // "enum": [
  19425. // "ACTION_ADD",
  19426. // "ACTION_ASSIGN",
  19427. // "ACTION_ASSOCIATE",
  19428. // "ACTION_CREATE",
  19429. // "ACTION_DELETE",
  19430. // "ACTION_DISABLE",
  19431. // "ACTION_EMAIL_TAGS",
  19432. // "ACTION_ENABLE",
  19433. // "ACTION_LINK",
  19434. // "ACTION_MARK_AS_DEFAULT",
  19435. // "ACTION_PUSH",
  19436. // "ACTION_REMOVE",
  19437. // "ACTION_SEND",
  19438. // "ACTION_SHARE",
  19439. // "ACTION_UNASSIGN",
  19440. // "ACTION_UNLINK",
  19441. // "ACTION_UPDATE"
  19442. // ],
  19443. // "enumDescriptions": [
  19444. // "",
  19445. // "",
  19446. // "",
  19447. // "",
  19448. // "",
  19449. // "",
  19450. // "",
  19451. // "",
  19452. // "",
  19453. // "",
  19454. // "",
  19455. // "",
  19456. // "",
  19457. // "",
  19458. // "",
  19459. // "",
  19460. // ""
  19461. // ],
  19462. // "location": "query",
  19463. // "type": "string"
  19464. // },
  19465. // "ids": {
  19466. // "description": "Select only change logs with these IDs.",
  19467. // "format": "int64",
  19468. // "location": "query",
  19469. // "repeated": true,
  19470. // "type": "string"
  19471. // },
  19472. // "maxChangeTime": {
  19473. // "description": "Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.",
  19474. // "location": "query",
  19475. // "type": "string"
  19476. // },
  19477. // "maxResults": {
  19478. // "default": "1000",
  19479. // "description": "Maximum number of results to return.",
  19480. // "format": "int32",
  19481. // "location": "query",
  19482. // "maximum": "1000",
  19483. // "minimum": "0",
  19484. // "type": "integer"
  19485. // },
  19486. // "minChangeTime": {
  19487. // "description": "Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is \"2015-07-18T22:54:00-04:00\". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset.",
  19488. // "location": "query",
  19489. // "type": "string"
  19490. // },
  19491. // "objectIds": {
  19492. // "description": "Select only change logs with these object IDs.",
  19493. // "format": "int64",
  19494. // "location": "query",
  19495. // "repeated": true,
  19496. // "type": "string"
  19497. // },
  19498. // "objectType": {
  19499. // "description": "Select only change logs with the specified object type.",
  19500. // "enum": [
  19501. // "OBJECT_ACCOUNT",
  19502. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19503. // "OBJECT_AD",
  19504. // "OBJECT_ADVERTISER",
  19505. // "OBJECT_ADVERTISER_GROUP",
  19506. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19507. // "OBJECT_BILLING_FEATURE",
  19508. // "OBJECT_BILLING_MINIMUM_FEE",
  19509. // "OBJECT_BILLING_PROFILE",
  19510. // "OBJECT_CAMPAIGN",
  19511. // "OBJECT_CONTENT_CATEGORY",
  19512. // "OBJECT_CREATIVE",
  19513. // "OBJECT_CREATIVE_ASSET",
  19514. // "OBJECT_CREATIVE_BUNDLE",
  19515. // "OBJECT_CREATIVE_FIELD",
  19516. // "OBJECT_CREATIVE_GROUP",
  19517. // "OBJECT_DFA_SITE",
  19518. // "OBJECT_EVENT_TAG",
  19519. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19520. // "OBJECT_FLOODLIGHT_ACTVITY",
  19521. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19522. // "OBJECT_INSTREAM_CREATIVE",
  19523. // "OBJECT_LANDING_PAGE",
  19524. // "OBJECT_MEDIA_ORDER",
  19525. // "OBJECT_PLACEMENT",
  19526. // "OBJECT_PLACEMENT_STRATEGY",
  19527. // "OBJECT_PLAYSTORE_LINK",
  19528. // "OBJECT_PROVIDED_LIST_CLIENT",
  19529. // "OBJECT_RATE_CARD",
  19530. // "OBJECT_REMARKETING_LIST",
  19531. // "OBJECT_RICHMEDIA_CREATIVE",
  19532. // "OBJECT_SD_SITE",
  19533. // "OBJECT_SEARCH_LIFT_STUDY",
  19534. // "OBJECT_SIZE",
  19535. // "OBJECT_SUBACCOUNT",
  19536. // "OBJECT_TARGETING_TEMPLATE",
  19537. // "OBJECT_USER_PROFILE",
  19538. // "OBJECT_USER_PROFILE_FILTER",
  19539. // "OBJECT_USER_ROLE"
  19540. // ],
  19541. // "enumDescriptions": [
  19542. // "",
  19543. // "",
  19544. // "",
  19545. // "",
  19546. // "",
  19547. // "",
  19548. // "",
  19549. // "",
  19550. // "",
  19551. // "",
  19552. // "",
  19553. // "",
  19554. // "",
  19555. // "",
  19556. // "",
  19557. // "",
  19558. // "",
  19559. // "",
  19560. // "",
  19561. // "",
  19562. // "",
  19563. // "",
  19564. // "",
  19565. // "",
  19566. // "",
  19567. // "",
  19568. // "",
  19569. // "",
  19570. // "",
  19571. // "",
  19572. // "",
  19573. // "",
  19574. // "",
  19575. // "",
  19576. // "",
  19577. // "",
  19578. // "",
  19579. // "",
  19580. // ""
  19581. // ],
  19582. // "location": "query",
  19583. // "type": "string"
  19584. // },
  19585. // "pageToken": {
  19586. // "description": "Value of the nextPageToken from the previous result page.",
  19587. // "location": "query",
  19588. // "type": "string"
  19589. // },
  19590. // "profileId": {
  19591. // "description": "User profile ID associated with this request.",
  19592. // "format": "int64",
  19593. // "location": "path",
  19594. // "required": true,
  19595. // "type": "string"
  19596. // },
  19597. // "searchString": {
  19598. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19599. // "location": "query",
  19600. // "type": "string"
  19601. // },
  19602. // "userProfileIds": {
  19603. // "description": "Select only change logs with these user profile IDs.",
  19604. // "format": "int64",
  19605. // "location": "query",
  19606. // "repeated": true,
  19607. // "type": "string"
  19608. // }
  19609. // },
  19610. // "path": "userprofiles/{profileId}/changeLogs",
  19611. // "response": {
  19612. // "$ref": "ChangeLogsListResponse"
  19613. // },
  19614. // "scopes": [
  19615. // "https://www.googleapis.com/auth/dfatrafficking"
  19616. // ]
  19617. // }
  19618. }
  19619. // Pages invokes f for each page of results.
  19620. // A non-nil error returned from f will halt the iteration.
  19621. // The provided context supersedes any context provided to the Context method.
  19622. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19623. c.ctx_ = ctx
  19624. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19625. for {
  19626. x, err := c.Do()
  19627. if err != nil {
  19628. return err
  19629. }
  19630. if err := f(x); err != nil {
  19631. return err
  19632. }
  19633. if x.NextPageToken == "" {
  19634. return nil
  19635. }
  19636. c.PageToken(x.NextPageToken)
  19637. }
  19638. }
  19639. // method id "dfareporting.cities.list":
  19640. type CitiesListCall struct {
  19641. s *Service
  19642. profileId int64
  19643. urlParams_ gensupport.URLParams
  19644. ifNoneMatch_ string
  19645. ctx_ context.Context
  19646. header_ http.Header
  19647. }
  19648. // List: Retrieves a list of cities, possibly filtered.
  19649. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19650. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19651. c.profileId = profileId
  19652. return c
  19653. }
  19654. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19655. // only cities from these countries.
  19656. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19657. var countryDartIds_ []string
  19658. for _, v := range countryDartIds {
  19659. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19660. }
  19661. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19662. return c
  19663. }
  19664. // DartIds sets the optional parameter "dartIds": Select only cities
  19665. // with these DART IDs.
  19666. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19667. var dartIds_ []string
  19668. for _, v := range dartIds {
  19669. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19670. }
  19671. c.urlParams_.SetMulti("dartIds", dartIds_)
  19672. return c
  19673. }
  19674. // NamePrefix sets the optional parameter "namePrefix": Select only
  19675. // cities with names starting with this prefix.
  19676. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19677. c.urlParams_.Set("namePrefix", namePrefix)
  19678. return c
  19679. }
  19680. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19681. // only cities from these regions.
  19682. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19683. var regionDartIds_ []string
  19684. for _, v := range regionDartIds {
  19685. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19686. }
  19687. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19688. return c
  19689. }
  19690. // Fields allows partial responses to be retrieved. See
  19691. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19692. // for more information.
  19693. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19694. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19695. return c
  19696. }
  19697. // IfNoneMatch sets the optional parameter which makes the operation
  19698. // fail if the object's ETag matches the given value. This is useful for
  19699. // getting updates only after the object has changed since the last
  19700. // request. Use googleapi.IsNotModified to check whether the response
  19701. // error from Do is the result of In-None-Match.
  19702. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19703. c.ifNoneMatch_ = entityTag
  19704. return c
  19705. }
  19706. // Context sets the context to be used in this call's Do method. Any
  19707. // pending HTTP request will be aborted if the provided context is
  19708. // canceled.
  19709. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  19710. c.ctx_ = ctx
  19711. return c
  19712. }
  19713. // Header returns an http.Header that can be modified by the caller to
  19714. // add HTTP headers to the request.
  19715. func (c *CitiesListCall) Header() http.Header {
  19716. if c.header_ == nil {
  19717. c.header_ = make(http.Header)
  19718. }
  19719. return c.header_
  19720. }
  19721. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  19722. reqHeaders := make(http.Header)
  19723. for k, v := range c.header_ {
  19724. reqHeaders[k] = v
  19725. }
  19726. reqHeaders.Set("User-Agent", c.s.userAgent())
  19727. if c.ifNoneMatch_ != "" {
  19728. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19729. }
  19730. var body io.Reader = nil
  19731. c.urlParams_.Set("alt", alt)
  19732. c.urlParams_.Set("prettyPrint", "false")
  19733. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19734. urls += "?" + c.urlParams_.Encode()
  19735. req, err := http.NewRequest("GET", urls, body)
  19736. if err != nil {
  19737. return nil, err
  19738. }
  19739. req.Header = reqHeaders
  19740. googleapi.Expand(req.URL, map[string]string{
  19741. "profileId": strconv.FormatInt(c.profileId, 10),
  19742. })
  19743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19744. }
  19745. // Do executes the "dfareporting.cities.list" call.
  19746. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19747. // non-2xx status code is an error. Response headers are in either
  19748. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19749. // returned at all) in error.(*googleapi.Error).Header. Use
  19750. // googleapi.IsNotModified to check whether the returned error was
  19751. // because http.StatusNotModified was returned.
  19752. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19753. gensupport.SetOptions(c.urlParams_, opts...)
  19754. res, err := c.doRequest("json")
  19755. if res != nil && res.StatusCode == http.StatusNotModified {
  19756. if res.Body != nil {
  19757. res.Body.Close()
  19758. }
  19759. return nil, &googleapi.Error{
  19760. Code: res.StatusCode,
  19761. Header: res.Header,
  19762. }
  19763. }
  19764. if err != nil {
  19765. return nil, err
  19766. }
  19767. defer googleapi.CloseBody(res)
  19768. if err := googleapi.CheckResponse(res); err != nil {
  19769. return nil, err
  19770. }
  19771. ret := &CitiesListResponse{
  19772. ServerResponse: googleapi.ServerResponse{
  19773. Header: res.Header,
  19774. HTTPStatusCode: res.StatusCode,
  19775. },
  19776. }
  19777. target := &ret
  19778. if err := gensupport.DecodeResponse(target, res); err != nil {
  19779. return nil, err
  19780. }
  19781. return ret, nil
  19782. // {
  19783. // "description": "Retrieves a list of cities, possibly filtered.",
  19784. // "httpMethod": "GET",
  19785. // "id": "dfareporting.cities.list",
  19786. // "parameterOrder": [
  19787. // "profileId"
  19788. // ],
  19789. // "parameters": {
  19790. // "countryDartIds": {
  19791. // "description": "Select only cities from these countries.",
  19792. // "format": "int64",
  19793. // "location": "query",
  19794. // "repeated": true,
  19795. // "type": "string"
  19796. // },
  19797. // "dartIds": {
  19798. // "description": "Select only cities with these DART IDs.",
  19799. // "format": "int64",
  19800. // "location": "query",
  19801. // "repeated": true,
  19802. // "type": "string"
  19803. // },
  19804. // "namePrefix": {
  19805. // "description": "Select only cities with names starting with this prefix.",
  19806. // "location": "query",
  19807. // "type": "string"
  19808. // },
  19809. // "profileId": {
  19810. // "description": "User profile ID associated with this request.",
  19811. // "format": "int64",
  19812. // "location": "path",
  19813. // "required": true,
  19814. // "type": "string"
  19815. // },
  19816. // "regionDartIds": {
  19817. // "description": "Select only cities from these regions.",
  19818. // "format": "int64",
  19819. // "location": "query",
  19820. // "repeated": true,
  19821. // "type": "string"
  19822. // }
  19823. // },
  19824. // "path": "userprofiles/{profileId}/cities",
  19825. // "response": {
  19826. // "$ref": "CitiesListResponse"
  19827. // },
  19828. // "scopes": [
  19829. // "https://www.googleapis.com/auth/dfatrafficking"
  19830. // ]
  19831. // }
  19832. }
  19833. // method id "dfareporting.connectionTypes.get":
  19834. type ConnectionTypesGetCall struct {
  19835. s *Service
  19836. profileId int64
  19837. id int64
  19838. urlParams_ gensupport.URLParams
  19839. ifNoneMatch_ string
  19840. ctx_ context.Context
  19841. header_ http.Header
  19842. }
  19843. // Get: Gets one connection type by ID.
  19844. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  19845. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19846. c.profileId = profileId
  19847. c.id = id
  19848. return c
  19849. }
  19850. // Fields allows partial responses to be retrieved. See
  19851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19852. // for more information.
  19853. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  19854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19855. return c
  19856. }
  19857. // IfNoneMatch sets the optional parameter which makes the operation
  19858. // fail if the object's ETag matches the given value. This is useful for
  19859. // getting updates only after the object has changed since the last
  19860. // request. Use googleapi.IsNotModified to check whether the response
  19861. // error from Do is the result of In-None-Match.
  19862. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  19863. c.ifNoneMatch_ = entityTag
  19864. return c
  19865. }
  19866. // Context sets the context to be used in this call's Do method. Any
  19867. // pending HTTP request will be aborted if the provided context is
  19868. // canceled.
  19869. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  19870. c.ctx_ = ctx
  19871. return c
  19872. }
  19873. // Header returns an http.Header that can be modified by the caller to
  19874. // add HTTP headers to the request.
  19875. func (c *ConnectionTypesGetCall) Header() http.Header {
  19876. if c.header_ == nil {
  19877. c.header_ = make(http.Header)
  19878. }
  19879. return c.header_
  19880. }
  19881. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  19882. reqHeaders := make(http.Header)
  19883. for k, v := range c.header_ {
  19884. reqHeaders[k] = v
  19885. }
  19886. reqHeaders.Set("User-Agent", c.s.userAgent())
  19887. if c.ifNoneMatch_ != "" {
  19888. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19889. }
  19890. var body io.Reader = nil
  19891. c.urlParams_.Set("alt", alt)
  19892. c.urlParams_.Set("prettyPrint", "false")
  19893. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  19894. urls += "?" + c.urlParams_.Encode()
  19895. req, err := http.NewRequest("GET", urls, body)
  19896. if err != nil {
  19897. return nil, err
  19898. }
  19899. req.Header = reqHeaders
  19900. googleapi.Expand(req.URL, map[string]string{
  19901. "profileId": strconv.FormatInt(c.profileId, 10),
  19902. "id": strconv.FormatInt(c.id, 10),
  19903. })
  19904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19905. }
  19906. // Do executes the "dfareporting.connectionTypes.get" call.
  19907. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  19908. // status code is an error. Response headers are in either
  19909. // *ConnectionType.ServerResponse.Header or (if a response was returned
  19910. // at all) in error.(*googleapi.Error).Header. Use
  19911. // googleapi.IsNotModified to check whether the returned error was
  19912. // because http.StatusNotModified was returned.
  19913. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  19914. gensupport.SetOptions(c.urlParams_, opts...)
  19915. res, err := c.doRequest("json")
  19916. if res != nil && res.StatusCode == http.StatusNotModified {
  19917. if res.Body != nil {
  19918. res.Body.Close()
  19919. }
  19920. return nil, &googleapi.Error{
  19921. Code: res.StatusCode,
  19922. Header: res.Header,
  19923. }
  19924. }
  19925. if err != nil {
  19926. return nil, err
  19927. }
  19928. defer googleapi.CloseBody(res)
  19929. if err := googleapi.CheckResponse(res); err != nil {
  19930. return nil, err
  19931. }
  19932. ret := &ConnectionType{
  19933. ServerResponse: googleapi.ServerResponse{
  19934. Header: res.Header,
  19935. HTTPStatusCode: res.StatusCode,
  19936. },
  19937. }
  19938. target := &ret
  19939. if err := gensupport.DecodeResponse(target, res); err != nil {
  19940. return nil, err
  19941. }
  19942. return ret, nil
  19943. // {
  19944. // "description": "Gets one connection type by ID.",
  19945. // "httpMethod": "GET",
  19946. // "id": "dfareporting.connectionTypes.get",
  19947. // "parameterOrder": [
  19948. // "profileId",
  19949. // "id"
  19950. // ],
  19951. // "parameters": {
  19952. // "id": {
  19953. // "description": "Connection type ID.",
  19954. // "format": "int64",
  19955. // "location": "path",
  19956. // "required": true,
  19957. // "type": "string"
  19958. // },
  19959. // "profileId": {
  19960. // "description": "User profile ID associated with this request.",
  19961. // "format": "int64",
  19962. // "location": "path",
  19963. // "required": true,
  19964. // "type": "string"
  19965. // }
  19966. // },
  19967. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  19968. // "response": {
  19969. // "$ref": "ConnectionType"
  19970. // },
  19971. // "scopes": [
  19972. // "https://www.googleapis.com/auth/dfatrafficking"
  19973. // ]
  19974. // }
  19975. }
  19976. // method id "dfareporting.connectionTypes.list":
  19977. type ConnectionTypesListCall struct {
  19978. s *Service
  19979. profileId int64
  19980. urlParams_ gensupport.URLParams
  19981. ifNoneMatch_ string
  19982. ctx_ context.Context
  19983. header_ http.Header
  19984. }
  19985. // List: Retrieves a list of connection types.
  19986. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  19987. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19988. c.profileId = profileId
  19989. return c
  19990. }
  19991. // Fields allows partial responses to be retrieved. See
  19992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19993. // for more information.
  19994. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  19995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19996. return c
  19997. }
  19998. // IfNoneMatch sets the optional parameter which makes the operation
  19999. // fail if the object's ETag matches the given value. This is useful for
  20000. // getting updates only after the object has changed since the last
  20001. // request. Use googleapi.IsNotModified to check whether the response
  20002. // error from Do is the result of In-None-Match.
  20003. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  20004. c.ifNoneMatch_ = entityTag
  20005. return c
  20006. }
  20007. // Context sets the context to be used in this call's Do method. Any
  20008. // pending HTTP request will be aborted if the provided context is
  20009. // canceled.
  20010. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  20011. c.ctx_ = ctx
  20012. return c
  20013. }
  20014. // Header returns an http.Header that can be modified by the caller to
  20015. // add HTTP headers to the request.
  20016. func (c *ConnectionTypesListCall) Header() http.Header {
  20017. if c.header_ == nil {
  20018. c.header_ = make(http.Header)
  20019. }
  20020. return c.header_
  20021. }
  20022. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  20023. reqHeaders := make(http.Header)
  20024. for k, v := range c.header_ {
  20025. reqHeaders[k] = v
  20026. }
  20027. reqHeaders.Set("User-Agent", c.s.userAgent())
  20028. if c.ifNoneMatch_ != "" {
  20029. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20030. }
  20031. var body io.Reader = nil
  20032. c.urlParams_.Set("alt", alt)
  20033. c.urlParams_.Set("prettyPrint", "false")
  20034. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  20035. urls += "?" + c.urlParams_.Encode()
  20036. req, err := http.NewRequest("GET", urls, body)
  20037. if err != nil {
  20038. return nil, err
  20039. }
  20040. req.Header = reqHeaders
  20041. googleapi.Expand(req.URL, map[string]string{
  20042. "profileId": strconv.FormatInt(c.profileId, 10),
  20043. })
  20044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20045. }
  20046. // Do executes the "dfareporting.connectionTypes.list" call.
  20047. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  20048. // Any non-2xx status code is an error. Response headers are in either
  20049. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  20050. // was returned at all) in error.(*googleapi.Error).Header. Use
  20051. // googleapi.IsNotModified to check whether the returned error was
  20052. // because http.StatusNotModified was returned.
  20053. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  20054. gensupport.SetOptions(c.urlParams_, opts...)
  20055. res, err := c.doRequest("json")
  20056. if res != nil && res.StatusCode == http.StatusNotModified {
  20057. if res.Body != nil {
  20058. res.Body.Close()
  20059. }
  20060. return nil, &googleapi.Error{
  20061. Code: res.StatusCode,
  20062. Header: res.Header,
  20063. }
  20064. }
  20065. if err != nil {
  20066. return nil, err
  20067. }
  20068. defer googleapi.CloseBody(res)
  20069. if err := googleapi.CheckResponse(res); err != nil {
  20070. return nil, err
  20071. }
  20072. ret := &ConnectionTypesListResponse{
  20073. ServerResponse: googleapi.ServerResponse{
  20074. Header: res.Header,
  20075. HTTPStatusCode: res.StatusCode,
  20076. },
  20077. }
  20078. target := &ret
  20079. if err := gensupport.DecodeResponse(target, res); err != nil {
  20080. return nil, err
  20081. }
  20082. return ret, nil
  20083. // {
  20084. // "description": "Retrieves a list of connection types.",
  20085. // "httpMethod": "GET",
  20086. // "id": "dfareporting.connectionTypes.list",
  20087. // "parameterOrder": [
  20088. // "profileId"
  20089. // ],
  20090. // "parameters": {
  20091. // "profileId": {
  20092. // "description": "User profile ID associated with this request.",
  20093. // "format": "int64",
  20094. // "location": "path",
  20095. // "required": true,
  20096. // "type": "string"
  20097. // }
  20098. // },
  20099. // "path": "userprofiles/{profileId}/connectionTypes",
  20100. // "response": {
  20101. // "$ref": "ConnectionTypesListResponse"
  20102. // },
  20103. // "scopes": [
  20104. // "https://www.googleapis.com/auth/dfatrafficking"
  20105. // ]
  20106. // }
  20107. }
  20108. // method id "dfareporting.contentCategories.delete":
  20109. type ContentCategoriesDeleteCall struct {
  20110. s *Service
  20111. profileId int64
  20112. id int64
  20113. urlParams_ gensupport.URLParams
  20114. ctx_ context.Context
  20115. header_ http.Header
  20116. }
  20117. // Delete: Deletes an existing content category.
  20118. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  20119. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20120. c.profileId = profileId
  20121. c.id = id
  20122. return c
  20123. }
  20124. // Fields allows partial responses to be retrieved. See
  20125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20126. // for more information.
  20127. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  20128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20129. return c
  20130. }
  20131. // Context sets the context to be used in this call's Do method. Any
  20132. // pending HTTP request will be aborted if the provided context is
  20133. // canceled.
  20134. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  20135. c.ctx_ = ctx
  20136. return c
  20137. }
  20138. // Header returns an http.Header that can be modified by the caller to
  20139. // add HTTP headers to the request.
  20140. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  20141. if c.header_ == nil {
  20142. c.header_ = make(http.Header)
  20143. }
  20144. return c.header_
  20145. }
  20146. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20147. reqHeaders := make(http.Header)
  20148. for k, v := range c.header_ {
  20149. reqHeaders[k] = v
  20150. }
  20151. reqHeaders.Set("User-Agent", c.s.userAgent())
  20152. var body io.Reader = nil
  20153. c.urlParams_.Set("alt", alt)
  20154. c.urlParams_.Set("prettyPrint", "false")
  20155. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20156. urls += "?" + c.urlParams_.Encode()
  20157. req, err := http.NewRequest("DELETE", urls, body)
  20158. if err != nil {
  20159. return nil, err
  20160. }
  20161. req.Header = reqHeaders
  20162. googleapi.Expand(req.URL, map[string]string{
  20163. "profileId": strconv.FormatInt(c.profileId, 10),
  20164. "id": strconv.FormatInt(c.id, 10),
  20165. })
  20166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20167. }
  20168. // Do executes the "dfareporting.contentCategories.delete" call.
  20169. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20170. gensupport.SetOptions(c.urlParams_, opts...)
  20171. res, err := c.doRequest("json")
  20172. if err != nil {
  20173. return err
  20174. }
  20175. defer googleapi.CloseBody(res)
  20176. if err := googleapi.CheckResponse(res); err != nil {
  20177. return err
  20178. }
  20179. return nil
  20180. // {
  20181. // "description": "Deletes an existing content category.",
  20182. // "httpMethod": "DELETE",
  20183. // "id": "dfareporting.contentCategories.delete",
  20184. // "parameterOrder": [
  20185. // "profileId",
  20186. // "id"
  20187. // ],
  20188. // "parameters": {
  20189. // "id": {
  20190. // "description": "Content category ID.",
  20191. // "format": "int64",
  20192. // "location": "path",
  20193. // "required": true,
  20194. // "type": "string"
  20195. // },
  20196. // "profileId": {
  20197. // "description": "User profile ID associated with this request.",
  20198. // "format": "int64",
  20199. // "location": "path",
  20200. // "required": true,
  20201. // "type": "string"
  20202. // }
  20203. // },
  20204. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20205. // "scopes": [
  20206. // "https://www.googleapis.com/auth/dfatrafficking"
  20207. // ]
  20208. // }
  20209. }
  20210. // method id "dfareporting.contentCategories.get":
  20211. type ContentCategoriesGetCall struct {
  20212. s *Service
  20213. profileId int64
  20214. id int64
  20215. urlParams_ gensupport.URLParams
  20216. ifNoneMatch_ string
  20217. ctx_ context.Context
  20218. header_ http.Header
  20219. }
  20220. // Get: Gets one content category by ID.
  20221. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20222. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20223. c.profileId = profileId
  20224. c.id = id
  20225. return c
  20226. }
  20227. // Fields allows partial responses to be retrieved. See
  20228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20229. // for more information.
  20230. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20232. return c
  20233. }
  20234. // IfNoneMatch sets the optional parameter which makes the operation
  20235. // fail if the object's ETag matches the given value. This is useful for
  20236. // getting updates only after the object has changed since the last
  20237. // request. Use googleapi.IsNotModified to check whether the response
  20238. // error from Do is the result of In-None-Match.
  20239. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20240. c.ifNoneMatch_ = entityTag
  20241. return c
  20242. }
  20243. // Context sets the context to be used in this call's Do method. Any
  20244. // pending HTTP request will be aborted if the provided context is
  20245. // canceled.
  20246. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20247. c.ctx_ = ctx
  20248. return c
  20249. }
  20250. // Header returns an http.Header that can be modified by the caller to
  20251. // add HTTP headers to the request.
  20252. func (c *ContentCategoriesGetCall) Header() http.Header {
  20253. if c.header_ == nil {
  20254. c.header_ = make(http.Header)
  20255. }
  20256. return c.header_
  20257. }
  20258. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20259. reqHeaders := make(http.Header)
  20260. for k, v := range c.header_ {
  20261. reqHeaders[k] = v
  20262. }
  20263. reqHeaders.Set("User-Agent", c.s.userAgent())
  20264. if c.ifNoneMatch_ != "" {
  20265. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20266. }
  20267. var body io.Reader = nil
  20268. c.urlParams_.Set("alt", alt)
  20269. c.urlParams_.Set("prettyPrint", "false")
  20270. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20271. urls += "?" + c.urlParams_.Encode()
  20272. req, err := http.NewRequest("GET", urls, body)
  20273. if err != nil {
  20274. return nil, err
  20275. }
  20276. req.Header = reqHeaders
  20277. googleapi.Expand(req.URL, map[string]string{
  20278. "profileId": strconv.FormatInt(c.profileId, 10),
  20279. "id": strconv.FormatInt(c.id, 10),
  20280. })
  20281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20282. }
  20283. // Do executes the "dfareporting.contentCategories.get" call.
  20284. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20285. // status code is an error. Response headers are in either
  20286. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20287. // at all) in error.(*googleapi.Error).Header. Use
  20288. // googleapi.IsNotModified to check whether the returned error was
  20289. // because http.StatusNotModified was returned.
  20290. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20291. gensupport.SetOptions(c.urlParams_, opts...)
  20292. res, err := c.doRequest("json")
  20293. if res != nil && res.StatusCode == http.StatusNotModified {
  20294. if res.Body != nil {
  20295. res.Body.Close()
  20296. }
  20297. return nil, &googleapi.Error{
  20298. Code: res.StatusCode,
  20299. Header: res.Header,
  20300. }
  20301. }
  20302. if err != nil {
  20303. return nil, err
  20304. }
  20305. defer googleapi.CloseBody(res)
  20306. if err := googleapi.CheckResponse(res); err != nil {
  20307. return nil, err
  20308. }
  20309. ret := &ContentCategory{
  20310. ServerResponse: googleapi.ServerResponse{
  20311. Header: res.Header,
  20312. HTTPStatusCode: res.StatusCode,
  20313. },
  20314. }
  20315. target := &ret
  20316. if err := gensupport.DecodeResponse(target, res); err != nil {
  20317. return nil, err
  20318. }
  20319. return ret, nil
  20320. // {
  20321. // "description": "Gets one content category by ID.",
  20322. // "httpMethod": "GET",
  20323. // "id": "dfareporting.contentCategories.get",
  20324. // "parameterOrder": [
  20325. // "profileId",
  20326. // "id"
  20327. // ],
  20328. // "parameters": {
  20329. // "id": {
  20330. // "description": "Content category ID.",
  20331. // "format": "int64",
  20332. // "location": "path",
  20333. // "required": true,
  20334. // "type": "string"
  20335. // },
  20336. // "profileId": {
  20337. // "description": "User profile ID associated with this request.",
  20338. // "format": "int64",
  20339. // "location": "path",
  20340. // "required": true,
  20341. // "type": "string"
  20342. // }
  20343. // },
  20344. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20345. // "response": {
  20346. // "$ref": "ContentCategory"
  20347. // },
  20348. // "scopes": [
  20349. // "https://www.googleapis.com/auth/dfatrafficking"
  20350. // ]
  20351. // }
  20352. }
  20353. // method id "dfareporting.contentCategories.insert":
  20354. type ContentCategoriesInsertCall struct {
  20355. s *Service
  20356. profileId int64
  20357. contentcategory *ContentCategory
  20358. urlParams_ gensupport.URLParams
  20359. ctx_ context.Context
  20360. header_ http.Header
  20361. }
  20362. // Insert: Inserts a new content category.
  20363. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20364. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20365. c.profileId = profileId
  20366. c.contentcategory = contentcategory
  20367. return c
  20368. }
  20369. // Fields allows partial responses to be retrieved. See
  20370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20371. // for more information.
  20372. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20374. return c
  20375. }
  20376. // Context sets the context to be used in this call's Do method. Any
  20377. // pending HTTP request will be aborted if the provided context is
  20378. // canceled.
  20379. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20380. c.ctx_ = ctx
  20381. return c
  20382. }
  20383. // Header returns an http.Header that can be modified by the caller to
  20384. // add HTTP headers to the request.
  20385. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20386. if c.header_ == nil {
  20387. c.header_ = make(http.Header)
  20388. }
  20389. return c.header_
  20390. }
  20391. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20392. reqHeaders := make(http.Header)
  20393. for k, v := range c.header_ {
  20394. reqHeaders[k] = v
  20395. }
  20396. reqHeaders.Set("User-Agent", c.s.userAgent())
  20397. var body io.Reader = nil
  20398. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20399. if err != nil {
  20400. return nil, err
  20401. }
  20402. reqHeaders.Set("Content-Type", "application/json")
  20403. c.urlParams_.Set("alt", alt)
  20404. c.urlParams_.Set("prettyPrint", "false")
  20405. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20406. urls += "?" + c.urlParams_.Encode()
  20407. req, err := http.NewRequest("POST", urls, body)
  20408. if err != nil {
  20409. return nil, err
  20410. }
  20411. req.Header = reqHeaders
  20412. googleapi.Expand(req.URL, map[string]string{
  20413. "profileId": strconv.FormatInt(c.profileId, 10),
  20414. })
  20415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20416. }
  20417. // Do executes the "dfareporting.contentCategories.insert" call.
  20418. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20419. // status code is an error. Response headers are in either
  20420. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20421. // at all) in error.(*googleapi.Error).Header. Use
  20422. // googleapi.IsNotModified to check whether the returned error was
  20423. // because http.StatusNotModified was returned.
  20424. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20425. gensupport.SetOptions(c.urlParams_, opts...)
  20426. res, err := c.doRequest("json")
  20427. if res != nil && res.StatusCode == http.StatusNotModified {
  20428. if res.Body != nil {
  20429. res.Body.Close()
  20430. }
  20431. return nil, &googleapi.Error{
  20432. Code: res.StatusCode,
  20433. Header: res.Header,
  20434. }
  20435. }
  20436. if err != nil {
  20437. return nil, err
  20438. }
  20439. defer googleapi.CloseBody(res)
  20440. if err := googleapi.CheckResponse(res); err != nil {
  20441. return nil, err
  20442. }
  20443. ret := &ContentCategory{
  20444. ServerResponse: googleapi.ServerResponse{
  20445. Header: res.Header,
  20446. HTTPStatusCode: res.StatusCode,
  20447. },
  20448. }
  20449. target := &ret
  20450. if err := gensupport.DecodeResponse(target, res); err != nil {
  20451. return nil, err
  20452. }
  20453. return ret, nil
  20454. // {
  20455. // "description": "Inserts a new content category.",
  20456. // "httpMethod": "POST",
  20457. // "id": "dfareporting.contentCategories.insert",
  20458. // "parameterOrder": [
  20459. // "profileId"
  20460. // ],
  20461. // "parameters": {
  20462. // "profileId": {
  20463. // "description": "User profile ID associated with this request.",
  20464. // "format": "int64",
  20465. // "location": "path",
  20466. // "required": true,
  20467. // "type": "string"
  20468. // }
  20469. // },
  20470. // "path": "userprofiles/{profileId}/contentCategories",
  20471. // "request": {
  20472. // "$ref": "ContentCategory"
  20473. // },
  20474. // "response": {
  20475. // "$ref": "ContentCategory"
  20476. // },
  20477. // "scopes": [
  20478. // "https://www.googleapis.com/auth/dfatrafficking"
  20479. // ]
  20480. // }
  20481. }
  20482. // method id "dfareporting.contentCategories.list":
  20483. type ContentCategoriesListCall struct {
  20484. s *Service
  20485. profileId int64
  20486. urlParams_ gensupport.URLParams
  20487. ifNoneMatch_ string
  20488. ctx_ context.Context
  20489. header_ http.Header
  20490. }
  20491. // List: Retrieves a list of content categories, possibly filtered. This
  20492. // method supports paging.
  20493. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20494. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20495. c.profileId = profileId
  20496. return c
  20497. }
  20498. // Ids sets the optional parameter "ids": Select only content categories
  20499. // with these IDs.
  20500. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20501. var ids_ []string
  20502. for _, v := range ids {
  20503. ids_ = append(ids_, fmt.Sprint(v))
  20504. }
  20505. c.urlParams_.SetMulti("ids", ids_)
  20506. return c
  20507. }
  20508. // MaxResults sets the optional parameter "maxResults": Maximum number
  20509. // of results to return.
  20510. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20511. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20512. return c
  20513. }
  20514. // PageToken sets the optional parameter "pageToken": Value of the
  20515. // nextPageToken from the previous result page.
  20516. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20517. c.urlParams_.Set("pageToken", pageToken)
  20518. return c
  20519. }
  20520. // SearchString sets the optional parameter "searchString": Allows
  20521. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20522. // example, "contentcategory*2015" will return objects with names like
  20523. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20524. // "contentcategory 2015". Most of the searches also add wildcards
  20525. // implicitly at the start and the end of the search string. For
  20526. // example, a search string of "contentcategory" will match objects with
  20527. // name "my contentcategory", "contentcategory 2015", or simply
  20528. // "contentcategory".
  20529. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20530. c.urlParams_.Set("searchString", searchString)
  20531. return c
  20532. }
  20533. // SortField sets the optional parameter "sortField": Field by which to
  20534. // sort the list.
  20535. //
  20536. // Possible values:
  20537. // "ID" (default)
  20538. // "NAME"
  20539. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20540. c.urlParams_.Set("sortField", sortField)
  20541. return c
  20542. }
  20543. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20544. // results.
  20545. //
  20546. // Possible values:
  20547. // "ASCENDING" (default)
  20548. // "DESCENDING"
  20549. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20550. c.urlParams_.Set("sortOrder", sortOrder)
  20551. return c
  20552. }
  20553. // Fields allows partial responses to be retrieved. See
  20554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20555. // for more information.
  20556. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20558. return c
  20559. }
  20560. // IfNoneMatch sets the optional parameter which makes the operation
  20561. // fail if the object's ETag matches the given value. This is useful for
  20562. // getting updates only after the object has changed since the last
  20563. // request. Use googleapi.IsNotModified to check whether the response
  20564. // error from Do is the result of In-None-Match.
  20565. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20566. c.ifNoneMatch_ = entityTag
  20567. return c
  20568. }
  20569. // Context sets the context to be used in this call's Do method. Any
  20570. // pending HTTP request will be aborted if the provided context is
  20571. // canceled.
  20572. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20573. c.ctx_ = ctx
  20574. return c
  20575. }
  20576. // Header returns an http.Header that can be modified by the caller to
  20577. // add HTTP headers to the request.
  20578. func (c *ContentCategoriesListCall) Header() http.Header {
  20579. if c.header_ == nil {
  20580. c.header_ = make(http.Header)
  20581. }
  20582. return c.header_
  20583. }
  20584. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20585. reqHeaders := make(http.Header)
  20586. for k, v := range c.header_ {
  20587. reqHeaders[k] = v
  20588. }
  20589. reqHeaders.Set("User-Agent", c.s.userAgent())
  20590. if c.ifNoneMatch_ != "" {
  20591. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20592. }
  20593. var body io.Reader = nil
  20594. c.urlParams_.Set("alt", alt)
  20595. c.urlParams_.Set("prettyPrint", "false")
  20596. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20597. urls += "?" + c.urlParams_.Encode()
  20598. req, err := http.NewRequest("GET", urls, body)
  20599. if err != nil {
  20600. return nil, err
  20601. }
  20602. req.Header = reqHeaders
  20603. googleapi.Expand(req.URL, map[string]string{
  20604. "profileId": strconv.FormatInt(c.profileId, 10),
  20605. })
  20606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20607. }
  20608. // Do executes the "dfareporting.contentCategories.list" call.
  20609. // Exactly one of *ContentCategoriesListResponse or error will be
  20610. // non-nil. Any non-2xx status code is an error. Response headers are in
  20611. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20612. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20613. // googleapi.IsNotModified to check whether the returned error was
  20614. // because http.StatusNotModified was returned.
  20615. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20616. gensupport.SetOptions(c.urlParams_, opts...)
  20617. res, err := c.doRequest("json")
  20618. if res != nil && res.StatusCode == http.StatusNotModified {
  20619. if res.Body != nil {
  20620. res.Body.Close()
  20621. }
  20622. return nil, &googleapi.Error{
  20623. Code: res.StatusCode,
  20624. Header: res.Header,
  20625. }
  20626. }
  20627. if err != nil {
  20628. return nil, err
  20629. }
  20630. defer googleapi.CloseBody(res)
  20631. if err := googleapi.CheckResponse(res); err != nil {
  20632. return nil, err
  20633. }
  20634. ret := &ContentCategoriesListResponse{
  20635. ServerResponse: googleapi.ServerResponse{
  20636. Header: res.Header,
  20637. HTTPStatusCode: res.StatusCode,
  20638. },
  20639. }
  20640. target := &ret
  20641. if err := gensupport.DecodeResponse(target, res); err != nil {
  20642. return nil, err
  20643. }
  20644. return ret, nil
  20645. // {
  20646. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20647. // "httpMethod": "GET",
  20648. // "id": "dfareporting.contentCategories.list",
  20649. // "parameterOrder": [
  20650. // "profileId"
  20651. // ],
  20652. // "parameters": {
  20653. // "ids": {
  20654. // "description": "Select only content categories with these IDs.",
  20655. // "format": "int64",
  20656. // "location": "query",
  20657. // "repeated": true,
  20658. // "type": "string"
  20659. // },
  20660. // "maxResults": {
  20661. // "default": "1000",
  20662. // "description": "Maximum number of results to return.",
  20663. // "format": "int32",
  20664. // "location": "query",
  20665. // "maximum": "1000",
  20666. // "minimum": "0",
  20667. // "type": "integer"
  20668. // },
  20669. // "pageToken": {
  20670. // "description": "Value of the nextPageToken from the previous result page.",
  20671. // "location": "query",
  20672. // "type": "string"
  20673. // },
  20674. // "profileId": {
  20675. // "description": "User profile ID associated with this request.",
  20676. // "format": "int64",
  20677. // "location": "path",
  20678. // "required": true,
  20679. // "type": "string"
  20680. // },
  20681. // "searchString": {
  20682. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"contentcategory*2015\" will return objects with names like \"contentcategory June 2015\", \"contentcategory April 2015\", or simply \"contentcategory 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"contentcategory\" will match objects with name \"my contentcategory\", \"contentcategory 2015\", or simply \"contentcategory\".",
  20683. // "location": "query",
  20684. // "type": "string"
  20685. // },
  20686. // "sortField": {
  20687. // "default": "ID",
  20688. // "description": "Field by which to sort the list.",
  20689. // "enum": [
  20690. // "ID",
  20691. // "NAME"
  20692. // ],
  20693. // "enumDescriptions": [
  20694. // "",
  20695. // ""
  20696. // ],
  20697. // "location": "query",
  20698. // "type": "string"
  20699. // },
  20700. // "sortOrder": {
  20701. // "default": "ASCENDING",
  20702. // "description": "Order of sorted results.",
  20703. // "enum": [
  20704. // "ASCENDING",
  20705. // "DESCENDING"
  20706. // ],
  20707. // "enumDescriptions": [
  20708. // "",
  20709. // ""
  20710. // ],
  20711. // "location": "query",
  20712. // "type": "string"
  20713. // }
  20714. // },
  20715. // "path": "userprofiles/{profileId}/contentCategories",
  20716. // "response": {
  20717. // "$ref": "ContentCategoriesListResponse"
  20718. // },
  20719. // "scopes": [
  20720. // "https://www.googleapis.com/auth/dfatrafficking"
  20721. // ]
  20722. // }
  20723. }
  20724. // Pages invokes f for each page of results.
  20725. // A non-nil error returned from f will halt the iteration.
  20726. // The provided context supersedes any context provided to the Context method.
  20727. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20728. c.ctx_ = ctx
  20729. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20730. for {
  20731. x, err := c.Do()
  20732. if err != nil {
  20733. return err
  20734. }
  20735. if err := f(x); err != nil {
  20736. return err
  20737. }
  20738. if x.NextPageToken == "" {
  20739. return nil
  20740. }
  20741. c.PageToken(x.NextPageToken)
  20742. }
  20743. }
  20744. // method id "dfareporting.contentCategories.patch":
  20745. type ContentCategoriesPatchCall struct {
  20746. s *Service
  20747. profileId int64
  20748. contentcategory *ContentCategory
  20749. urlParams_ gensupport.URLParams
  20750. ctx_ context.Context
  20751. header_ http.Header
  20752. }
  20753. // Patch: Updates an existing content category. This method supports
  20754. // patch semantics.
  20755. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20756. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20757. c.profileId = profileId
  20758. c.urlParams_.Set("id", fmt.Sprint(id))
  20759. c.contentcategory = contentcategory
  20760. return c
  20761. }
  20762. // Fields allows partial responses to be retrieved. See
  20763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20764. // for more information.
  20765. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20767. return c
  20768. }
  20769. // Context sets the context to be used in this call's Do method. Any
  20770. // pending HTTP request will be aborted if the provided context is
  20771. // canceled.
  20772. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  20773. c.ctx_ = ctx
  20774. return c
  20775. }
  20776. // Header returns an http.Header that can be modified by the caller to
  20777. // add HTTP headers to the request.
  20778. func (c *ContentCategoriesPatchCall) Header() http.Header {
  20779. if c.header_ == nil {
  20780. c.header_ = make(http.Header)
  20781. }
  20782. return c.header_
  20783. }
  20784. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  20785. reqHeaders := make(http.Header)
  20786. for k, v := range c.header_ {
  20787. reqHeaders[k] = v
  20788. }
  20789. reqHeaders.Set("User-Agent", c.s.userAgent())
  20790. var body io.Reader = nil
  20791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20792. if err != nil {
  20793. return nil, err
  20794. }
  20795. reqHeaders.Set("Content-Type", "application/json")
  20796. c.urlParams_.Set("alt", alt)
  20797. c.urlParams_.Set("prettyPrint", "false")
  20798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20799. urls += "?" + c.urlParams_.Encode()
  20800. req, err := http.NewRequest("PATCH", urls, body)
  20801. if err != nil {
  20802. return nil, err
  20803. }
  20804. req.Header = reqHeaders
  20805. googleapi.Expand(req.URL, map[string]string{
  20806. "profileId": strconv.FormatInt(c.profileId, 10),
  20807. })
  20808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20809. }
  20810. // Do executes the "dfareporting.contentCategories.patch" call.
  20811. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20812. // status code is an error. Response headers are in either
  20813. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20814. // at all) in error.(*googleapi.Error).Header. Use
  20815. // googleapi.IsNotModified to check whether the returned error was
  20816. // because http.StatusNotModified was returned.
  20817. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20818. gensupport.SetOptions(c.urlParams_, opts...)
  20819. res, err := c.doRequest("json")
  20820. if res != nil && res.StatusCode == http.StatusNotModified {
  20821. if res.Body != nil {
  20822. res.Body.Close()
  20823. }
  20824. return nil, &googleapi.Error{
  20825. Code: res.StatusCode,
  20826. Header: res.Header,
  20827. }
  20828. }
  20829. if err != nil {
  20830. return nil, err
  20831. }
  20832. defer googleapi.CloseBody(res)
  20833. if err := googleapi.CheckResponse(res); err != nil {
  20834. return nil, err
  20835. }
  20836. ret := &ContentCategory{
  20837. ServerResponse: googleapi.ServerResponse{
  20838. Header: res.Header,
  20839. HTTPStatusCode: res.StatusCode,
  20840. },
  20841. }
  20842. target := &ret
  20843. if err := gensupport.DecodeResponse(target, res); err != nil {
  20844. return nil, err
  20845. }
  20846. return ret, nil
  20847. // {
  20848. // "description": "Updates an existing content category. This method supports patch semantics.",
  20849. // "httpMethod": "PATCH",
  20850. // "id": "dfareporting.contentCategories.patch",
  20851. // "parameterOrder": [
  20852. // "profileId",
  20853. // "id"
  20854. // ],
  20855. // "parameters": {
  20856. // "id": {
  20857. // "description": "Content category ID.",
  20858. // "format": "int64",
  20859. // "location": "query",
  20860. // "required": true,
  20861. // "type": "string"
  20862. // },
  20863. // "profileId": {
  20864. // "description": "User profile ID associated with this request.",
  20865. // "format": "int64",
  20866. // "location": "path",
  20867. // "required": true,
  20868. // "type": "string"
  20869. // }
  20870. // },
  20871. // "path": "userprofiles/{profileId}/contentCategories",
  20872. // "request": {
  20873. // "$ref": "ContentCategory"
  20874. // },
  20875. // "response": {
  20876. // "$ref": "ContentCategory"
  20877. // },
  20878. // "scopes": [
  20879. // "https://www.googleapis.com/auth/dfatrafficking"
  20880. // ]
  20881. // }
  20882. }
  20883. // method id "dfareporting.contentCategories.update":
  20884. type ContentCategoriesUpdateCall struct {
  20885. s *Service
  20886. profileId int64
  20887. contentcategory *ContentCategory
  20888. urlParams_ gensupport.URLParams
  20889. ctx_ context.Context
  20890. header_ http.Header
  20891. }
  20892. // Update: Updates an existing content category.
  20893. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  20894. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20895. c.profileId = profileId
  20896. c.contentcategory = contentcategory
  20897. return c
  20898. }
  20899. // Fields allows partial responses to be retrieved. See
  20900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20901. // for more information.
  20902. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  20903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20904. return c
  20905. }
  20906. // Context sets the context to be used in this call's Do method. Any
  20907. // pending HTTP request will be aborted if the provided context is
  20908. // canceled.
  20909. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  20910. c.ctx_ = ctx
  20911. return c
  20912. }
  20913. // Header returns an http.Header that can be modified by the caller to
  20914. // add HTTP headers to the request.
  20915. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  20916. if c.header_ == nil {
  20917. c.header_ = make(http.Header)
  20918. }
  20919. return c.header_
  20920. }
  20921. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  20922. reqHeaders := make(http.Header)
  20923. for k, v := range c.header_ {
  20924. reqHeaders[k] = v
  20925. }
  20926. reqHeaders.Set("User-Agent", c.s.userAgent())
  20927. var body io.Reader = nil
  20928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20929. if err != nil {
  20930. return nil, err
  20931. }
  20932. reqHeaders.Set("Content-Type", "application/json")
  20933. c.urlParams_.Set("alt", alt)
  20934. c.urlParams_.Set("prettyPrint", "false")
  20935. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20936. urls += "?" + c.urlParams_.Encode()
  20937. req, err := http.NewRequest("PUT", urls, body)
  20938. if err != nil {
  20939. return nil, err
  20940. }
  20941. req.Header = reqHeaders
  20942. googleapi.Expand(req.URL, map[string]string{
  20943. "profileId": strconv.FormatInt(c.profileId, 10),
  20944. })
  20945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20946. }
  20947. // Do executes the "dfareporting.contentCategories.update" call.
  20948. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20949. // status code is an error. Response headers are in either
  20950. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20951. // at all) in error.(*googleapi.Error).Header. Use
  20952. // googleapi.IsNotModified to check whether the returned error was
  20953. // because http.StatusNotModified was returned.
  20954. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20955. gensupport.SetOptions(c.urlParams_, opts...)
  20956. res, err := c.doRequest("json")
  20957. if res != nil && res.StatusCode == http.StatusNotModified {
  20958. if res.Body != nil {
  20959. res.Body.Close()
  20960. }
  20961. return nil, &googleapi.Error{
  20962. Code: res.StatusCode,
  20963. Header: res.Header,
  20964. }
  20965. }
  20966. if err != nil {
  20967. return nil, err
  20968. }
  20969. defer googleapi.CloseBody(res)
  20970. if err := googleapi.CheckResponse(res); err != nil {
  20971. return nil, err
  20972. }
  20973. ret := &ContentCategory{
  20974. ServerResponse: googleapi.ServerResponse{
  20975. Header: res.Header,
  20976. HTTPStatusCode: res.StatusCode,
  20977. },
  20978. }
  20979. target := &ret
  20980. if err := gensupport.DecodeResponse(target, res); err != nil {
  20981. return nil, err
  20982. }
  20983. return ret, nil
  20984. // {
  20985. // "description": "Updates an existing content category.",
  20986. // "httpMethod": "PUT",
  20987. // "id": "dfareporting.contentCategories.update",
  20988. // "parameterOrder": [
  20989. // "profileId"
  20990. // ],
  20991. // "parameters": {
  20992. // "profileId": {
  20993. // "description": "User profile ID associated with this request.",
  20994. // "format": "int64",
  20995. // "location": "path",
  20996. // "required": true,
  20997. // "type": "string"
  20998. // }
  20999. // },
  21000. // "path": "userprofiles/{profileId}/contentCategories",
  21001. // "request": {
  21002. // "$ref": "ContentCategory"
  21003. // },
  21004. // "response": {
  21005. // "$ref": "ContentCategory"
  21006. // },
  21007. // "scopes": [
  21008. // "https://www.googleapis.com/auth/dfatrafficking"
  21009. // ]
  21010. // }
  21011. }
  21012. // method id "dfareporting.conversions.batchinsert":
  21013. type ConversionsBatchinsertCall struct {
  21014. s *Service
  21015. profileId int64
  21016. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  21017. urlParams_ gensupport.URLParams
  21018. ctx_ context.Context
  21019. header_ http.Header
  21020. }
  21021. // Batchinsert: Inserts conversions.
  21022. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  21023. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21024. c.profileId = profileId
  21025. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  21026. return c
  21027. }
  21028. // Fields allows partial responses to be retrieved. See
  21029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21030. // for more information.
  21031. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  21032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21033. return c
  21034. }
  21035. // Context sets the context to be used in this call's Do method. Any
  21036. // pending HTTP request will be aborted if the provided context is
  21037. // canceled.
  21038. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  21039. c.ctx_ = ctx
  21040. return c
  21041. }
  21042. // Header returns an http.Header that can be modified by the caller to
  21043. // add HTTP headers to the request.
  21044. func (c *ConversionsBatchinsertCall) Header() http.Header {
  21045. if c.header_ == nil {
  21046. c.header_ = make(http.Header)
  21047. }
  21048. return c.header_
  21049. }
  21050. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  21051. reqHeaders := make(http.Header)
  21052. for k, v := range c.header_ {
  21053. reqHeaders[k] = v
  21054. }
  21055. reqHeaders.Set("User-Agent", c.s.userAgent())
  21056. var body io.Reader = nil
  21057. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  21058. if err != nil {
  21059. return nil, err
  21060. }
  21061. reqHeaders.Set("Content-Type", "application/json")
  21062. c.urlParams_.Set("alt", alt)
  21063. c.urlParams_.Set("prettyPrint", "false")
  21064. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  21065. urls += "?" + c.urlParams_.Encode()
  21066. req, err := http.NewRequest("POST", urls, body)
  21067. if err != nil {
  21068. return nil, err
  21069. }
  21070. req.Header = reqHeaders
  21071. googleapi.Expand(req.URL, map[string]string{
  21072. "profileId": strconv.FormatInt(c.profileId, 10),
  21073. })
  21074. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21075. }
  21076. // Do executes the "dfareporting.conversions.batchinsert" call.
  21077. // Exactly one of *ConversionsBatchInsertResponse or error will be
  21078. // non-nil. Any non-2xx status code is an error. Response headers are in
  21079. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  21080. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21081. // googleapi.IsNotModified to check whether the returned error was
  21082. // because http.StatusNotModified was returned.
  21083. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  21084. gensupport.SetOptions(c.urlParams_, opts...)
  21085. res, err := c.doRequest("json")
  21086. if res != nil && res.StatusCode == http.StatusNotModified {
  21087. if res.Body != nil {
  21088. res.Body.Close()
  21089. }
  21090. return nil, &googleapi.Error{
  21091. Code: res.StatusCode,
  21092. Header: res.Header,
  21093. }
  21094. }
  21095. if err != nil {
  21096. return nil, err
  21097. }
  21098. defer googleapi.CloseBody(res)
  21099. if err := googleapi.CheckResponse(res); err != nil {
  21100. return nil, err
  21101. }
  21102. ret := &ConversionsBatchInsertResponse{
  21103. ServerResponse: googleapi.ServerResponse{
  21104. Header: res.Header,
  21105. HTTPStatusCode: res.StatusCode,
  21106. },
  21107. }
  21108. target := &ret
  21109. if err := gensupport.DecodeResponse(target, res); err != nil {
  21110. return nil, err
  21111. }
  21112. return ret, nil
  21113. // {
  21114. // "description": "Inserts conversions.",
  21115. // "httpMethod": "POST",
  21116. // "id": "dfareporting.conversions.batchinsert",
  21117. // "parameterOrder": [
  21118. // "profileId"
  21119. // ],
  21120. // "parameters": {
  21121. // "profileId": {
  21122. // "description": "User profile ID associated with this request.",
  21123. // "format": "int64",
  21124. // "location": "path",
  21125. // "required": true,
  21126. // "type": "string"
  21127. // }
  21128. // },
  21129. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  21130. // "request": {
  21131. // "$ref": "ConversionsBatchInsertRequest"
  21132. // },
  21133. // "response": {
  21134. // "$ref": "ConversionsBatchInsertResponse"
  21135. // },
  21136. // "scopes": [
  21137. // "https://www.googleapis.com/auth/ddmconversions"
  21138. // ]
  21139. // }
  21140. }
  21141. // method id "dfareporting.conversions.batchupdate":
  21142. type ConversionsBatchupdateCall struct {
  21143. s *Service
  21144. profileId int64
  21145. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  21146. urlParams_ gensupport.URLParams
  21147. ctx_ context.Context
  21148. header_ http.Header
  21149. }
  21150. // Batchupdate: Updates existing conversions.
  21151. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  21152. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21153. c.profileId = profileId
  21154. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  21155. return c
  21156. }
  21157. // Fields allows partial responses to be retrieved. See
  21158. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21159. // for more information.
  21160. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  21161. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21162. return c
  21163. }
  21164. // Context sets the context to be used in this call's Do method. Any
  21165. // pending HTTP request will be aborted if the provided context is
  21166. // canceled.
  21167. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  21168. c.ctx_ = ctx
  21169. return c
  21170. }
  21171. // Header returns an http.Header that can be modified by the caller to
  21172. // add HTTP headers to the request.
  21173. func (c *ConversionsBatchupdateCall) Header() http.Header {
  21174. if c.header_ == nil {
  21175. c.header_ = make(http.Header)
  21176. }
  21177. return c.header_
  21178. }
  21179. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  21180. reqHeaders := make(http.Header)
  21181. for k, v := range c.header_ {
  21182. reqHeaders[k] = v
  21183. }
  21184. reqHeaders.Set("User-Agent", c.s.userAgent())
  21185. var body io.Reader = nil
  21186. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  21187. if err != nil {
  21188. return nil, err
  21189. }
  21190. reqHeaders.Set("Content-Type", "application/json")
  21191. c.urlParams_.Set("alt", alt)
  21192. c.urlParams_.Set("prettyPrint", "false")
  21193. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  21194. urls += "?" + c.urlParams_.Encode()
  21195. req, err := http.NewRequest("POST", urls, body)
  21196. if err != nil {
  21197. return nil, err
  21198. }
  21199. req.Header = reqHeaders
  21200. googleapi.Expand(req.URL, map[string]string{
  21201. "profileId": strconv.FormatInt(c.profileId, 10),
  21202. })
  21203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21204. }
  21205. // Do executes the "dfareporting.conversions.batchupdate" call.
  21206. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  21207. // non-nil. Any non-2xx status code is an error. Response headers are in
  21208. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  21209. // response was returned at all) in error.(*googleapi.Error).Header. Use
  21210. // googleapi.IsNotModified to check whether the returned error was
  21211. // because http.StatusNotModified was returned.
  21212. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  21213. gensupport.SetOptions(c.urlParams_, opts...)
  21214. res, err := c.doRequest("json")
  21215. if res != nil && res.StatusCode == http.StatusNotModified {
  21216. if res.Body != nil {
  21217. res.Body.Close()
  21218. }
  21219. return nil, &googleapi.Error{
  21220. Code: res.StatusCode,
  21221. Header: res.Header,
  21222. }
  21223. }
  21224. if err != nil {
  21225. return nil, err
  21226. }
  21227. defer googleapi.CloseBody(res)
  21228. if err := googleapi.CheckResponse(res); err != nil {
  21229. return nil, err
  21230. }
  21231. ret := &ConversionsBatchUpdateResponse{
  21232. ServerResponse: googleapi.ServerResponse{
  21233. Header: res.Header,
  21234. HTTPStatusCode: res.StatusCode,
  21235. },
  21236. }
  21237. target := &ret
  21238. if err := gensupport.DecodeResponse(target, res); err != nil {
  21239. return nil, err
  21240. }
  21241. return ret, nil
  21242. // {
  21243. // "description": "Updates existing conversions.",
  21244. // "httpMethod": "POST",
  21245. // "id": "dfareporting.conversions.batchupdate",
  21246. // "parameterOrder": [
  21247. // "profileId"
  21248. // ],
  21249. // "parameters": {
  21250. // "profileId": {
  21251. // "description": "User profile ID associated with this request.",
  21252. // "format": "int64",
  21253. // "location": "path",
  21254. // "required": true,
  21255. // "type": "string"
  21256. // }
  21257. // },
  21258. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21259. // "request": {
  21260. // "$ref": "ConversionsBatchUpdateRequest"
  21261. // },
  21262. // "response": {
  21263. // "$ref": "ConversionsBatchUpdateResponse"
  21264. // },
  21265. // "scopes": [
  21266. // "https://www.googleapis.com/auth/ddmconversions"
  21267. // ]
  21268. // }
  21269. }
  21270. // method id "dfareporting.countries.get":
  21271. type CountriesGetCall struct {
  21272. s *Service
  21273. profileId int64
  21274. dartId int64
  21275. urlParams_ gensupport.URLParams
  21276. ifNoneMatch_ string
  21277. ctx_ context.Context
  21278. header_ http.Header
  21279. }
  21280. // Get: Gets one country by ID.
  21281. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21282. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21283. c.profileId = profileId
  21284. c.dartId = dartId
  21285. return c
  21286. }
  21287. // Fields allows partial responses to be retrieved. See
  21288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21289. // for more information.
  21290. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21292. return c
  21293. }
  21294. // IfNoneMatch sets the optional parameter which makes the operation
  21295. // fail if the object's ETag matches the given value. This is useful for
  21296. // getting updates only after the object has changed since the last
  21297. // request. Use googleapi.IsNotModified to check whether the response
  21298. // error from Do is the result of In-None-Match.
  21299. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21300. c.ifNoneMatch_ = entityTag
  21301. return c
  21302. }
  21303. // Context sets the context to be used in this call's Do method. Any
  21304. // pending HTTP request will be aborted if the provided context is
  21305. // canceled.
  21306. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21307. c.ctx_ = ctx
  21308. return c
  21309. }
  21310. // Header returns an http.Header that can be modified by the caller to
  21311. // add HTTP headers to the request.
  21312. func (c *CountriesGetCall) Header() http.Header {
  21313. if c.header_ == nil {
  21314. c.header_ = make(http.Header)
  21315. }
  21316. return c.header_
  21317. }
  21318. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21319. reqHeaders := make(http.Header)
  21320. for k, v := range c.header_ {
  21321. reqHeaders[k] = v
  21322. }
  21323. reqHeaders.Set("User-Agent", c.s.userAgent())
  21324. if c.ifNoneMatch_ != "" {
  21325. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21326. }
  21327. var body io.Reader = nil
  21328. c.urlParams_.Set("alt", alt)
  21329. c.urlParams_.Set("prettyPrint", "false")
  21330. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21331. urls += "?" + c.urlParams_.Encode()
  21332. req, err := http.NewRequest("GET", urls, body)
  21333. if err != nil {
  21334. return nil, err
  21335. }
  21336. req.Header = reqHeaders
  21337. googleapi.Expand(req.URL, map[string]string{
  21338. "profileId": strconv.FormatInt(c.profileId, 10),
  21339. "dartId": strconv.FormatInt(c.dartId, 10),
  21340. })
  21341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21342. }
  21343. // Do executes the "dfareporting.countries.get" call.
  21344. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21345. // code is an error. Response headers are in either
  21346. // *Country.ServerResponse.Header or (if a response was returned at all)
  21347. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21348. // check whether the returned error was because http.StatusNotModified
  21349. // was returned.
  21350. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21351. gensupport.SetOptions(c.urlParams_, opts...)
  21352. res, err := c.doRequest("json")
  21353. if res != nil && res.StatusCode == http.StatusNotModified {
  21354. if res.Body != nil {
  21355. res.Body.Close()
  21356. }
  21357. return nil, &googleapi.Error{
  21358. Code: res.StatusCode,
  21359. Header: res.Header,
  21360. }
  21361. }
  21362. if err != nil {
  21363. return nil, err
  21364. }
  21365. defer googleapi.CloseBody(res)
  21366. if err := googleapi.CheckResponse(res); err != nil {
  21367. return nil, err
  21368. }
  21369. ret := &Country{
  21370. ServerResponse: googleapi.ServerResponse{
  21371. Header: res.Header,
  21372. HTTPStatusCode: res.StatusCode,
  21373. },
  21374. }
  21375. target := &ret
  21376. if err := gensupport.DecodeResponse(target, res); err != nil {
  21377. return nil, err
  21378. }
  21379. return ret, nil
  21380. // {
  21381. // "description": "Gets one country by ID.",
  21382. // "httpMethod": "GET",
  21383. // "id": "dfareporting.countries.get",
  21384. // "parameterOrder": [
  21385. // "profileId",
  21386. // "dartId"
  21387. // ],
  21388. // "parameters": {
  21389. // "dartId": {
  21390. // "description": "Country DART ID.",
  21391. // "format": "int64",
  21392. // "location": "path",
  21393. // "required": true,
  21394. // "type": "string"
  21395. // },
  21396. // "profileId": {
  21397. // "description": "User profile ID associated with this request.",
  21398. // "format": "int64",
  21399. // "location": "path",
  21400. // "required": true,
  21401. // "type": "string"
  21402. // }
  21403. // },
  21404. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21405. // "response": {
  21406. // "$ref": "Country"
  21407. // },
  21408. // "scopes": [
  21409. // "https://www.googleapis.com/auth/dfatrafficking"
  21410. // ]
  21411. // }
  21412. }
  21413. // method id "dfareporting.countries.list":
  21414. type CountriesListCall struct {
  21415. s *Service
  21416. profileId int64
  21417. urlParams_ gensupport.URLParams
  21418. ifNoneMatch_ string
  21419. ctx_ context.Context
  21420. header_ http.Header
  21421. }
  21422. // List: Retrieves a list of countries.
  21423. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21424. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21425. c.profileId = profileId
  21426. return c
  21427. }
  21428. // Fields allows partial responses to be retrieved. See
  21429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21430. // for more information.
  21431. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21433. return c
  21434. }
  21435. // IfNoneMatch sets the optional parameter which makes the operation
  21436. // fail if the object's ETag matches the given value. This is useful for
  21437. // getting updates only after the object has changed since the last
  21438. // request. Use googleapi.IsNotModified to check whether the response
  21439. // error from Do is the result of In-None-Match.
  21440. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21441. c.ifNoneMatch_ = entityTag
  21442. return c
  21443. }
  21444. // Context sets the context to be used in this call's Do method. Any
  21445. // pending HTTP request will be aborted if the provided context is
  21446. // canceled.
  21447. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21448. c.ctx_ = ctx
  21449. return c
  21450. }
  21451. // Header returns an http.Header that can be modified by the caller to
  21452. // add HTTP headers to the request.
  21453. func (c *CountriesListCall) Header() http.Header {
  21454. if c.header_ == nil {
  21455. c.header_ = make(http.Header)
  21456. }
  21457. return c.header_
  21458. }
  21459. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21460. reqHeaders := make(http.Header)
  21461. for k, v := range c.header_ {
  21462. reqHeaders[k] = v
  21463. }
  21464. reqHeaders.Set("User-Agent", c.s.userAgent())
  21465. if c.ifNoneMatch_ != "" {
  21466. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21467. }
  21468. var body io.Reader = nil
  21469. c.urlParams_.Set("alt", alt)
  21470. c.urlParams_.Set("prettyPrint", "false")
  21471. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21472. urls += "?" + c.urlParams_.Encode()
  21473. req, err := http.NewRequest("GET", urls, body)
  21474. if err != nil {
  21475. return nil, err
  21476. }
  21477. req.Header = reqHeaders
  21478. googleapi.Expand(req.URL, map[string]string{
  21479. "profileId": strconv.FormatInt(c.profileId, 10),
  21480. })
  21481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21482. }
  21483. // Do executes the "dfareporting.countries.list" call.
  21484. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21485. // non-2xx status code is an error. Response headers are in either
  21486. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21487. // returned at all) in error.(*googleapi.Error).Header. Use
  21488. // googleapi.IsNotModified to check whether the returned error was
  21489. // because http.StatusNotModified was returned.
  21490. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21491. gensupport.SetOptions(c.urlParams_, opts...)
  21492. res, err := c.doRequest("json")
  21493. if res != nil && res.StatusCode == http.StatusNotModified {
  21494. if res.Body != nil {
  21495. res.Body.Close()
  21496. }
  21497. return nil, &googleapi.Error{
  21498. Code: res.StatusCode,
  21499. Header: res.Header,
  21500. }
  21501. }
  21502. if err != nil {
  21503. return nil, err
  21504. }
  21505. defer googleapi.CloseBody(res)
  21506. if err := googleapi.CheckResponse(res); err != nil {
  21507. return nil, err
  21508. }
  21509. ret := &CountriesListResponse{
  21510. ServerResponse: googleapi.ServerResponse{
  21511. Header: res.Header,
  21512. HTTPStatusCode: res.StatusCode,
  21513. },
  21514. }
  21515. target := &ret
  21516. if err := gensupport.DecodeResponse(target, res); err != nil {
  21517. return nil, err
  21518. }
  21519. return ret, nil
  21520. // {
  21521. // "description": "Retrieves a list of countries.",
  21522. // "httpMethod": "GET",
  21523. // "id": "dfareporting.countries.list",
  21524. // "parameterOrder": [
  21525. // "profileId"
  21526. // ],
  21527. // "parameters": {
  21528. // "profileId": {
  21529. // "description": "User profile ID associated with this request.",
  21530. // "format": "int64",
  21531. // "location": "path",
  21532. // "required": true,
  21533. // "type": "string"
  21534. // }
  21535. // },
  21536. // "path": "userprofiles/{profileId}/countries",
  21537. // "response": {
  21538. // "$ref": "CountriesListResponse"
  21539. // },
  21540. // "scopes": [
  21541. // "https://www.googleapis.com/auth/dfatrafficking"
  21542. // ]
  21543. // }
  21544. }
  21545. // method id "dfareporting.creativeAssets.insert":
  21546. type CreativeAssetsInsertCall struct {
  21547. s *Service
  21548. profileId int64
  21549. advertiserId int64
  21550. creativeassetmetadata *CreativeAssetMetadata
  21551. urlParams_ gensupport.URLParams
  21552. mediaInfo_ *gensupport.MediaInfo
  21553. ctx_ context.Context
  21554. header_ http.Header
  21555. }
  21556. // Insert: Inserts a new creative asset.
  21557. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21558. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21559. c.profileId = profileId
  21560. c.advertiserId = advertiserId
  21561. c.creativeassetmetadata = creativeassetmetadata
  21562. return c
  21563. }
  21564. // Media specifies the media to upload in one or more chunks. The chunk
  21565. // size may be controlled by supplying a MediaOption generated by
  21566. // googleapi.ChunkSize. The chunk size defaults to
  21567. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21568. // upload request will be determined by sniffing the contents of r,
  21569. // unless a MediaOption generated by googleapi.ContentType is
  21570. // supplied.
  21571. // At most one of Media and ResumableMedia may be set.
  21572. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21573. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21574. return c
  21575. }
  21576. // ResumableMedia specifies the media to upload in chunks and can be
  21577. // canceled with ctx.
  21578. //
  21579. // Deprecated: use Media instead.
  21580. //
  21581. // At most one of Media and ResumableMedia may be set. mediaType
  21582. // identifies the MIME media type of the upload, such as "image/png". If
  21583. // mediaType is "", it will be auto-detected. The provided ctx will
  21584. // supersede any context previously provided to the Context method.
  21585. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21586. c.ctx_ = ctx
  21587. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21588. return c
  21589. }
  21590. // ProgressUpdater provides a callback function that will be called
  21591. // after every chunk. It should be a low-latency function in order to
  21592. // not slow down the upload operation. This should only be called when
  21593. // using ResumableMedia (as opposed to Media).
  21594. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21595. c.mediaInfo_.SetProgressUpdater(pu)
  21596. return c
  21597. }
  21598. // Fields allows partial responses to be retrieved. See
  21599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21600. // for more information.
  21601. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21603. return c
  21604. }
  21605. // Context sets the context to be used in this call's Do method. Any
  21606. // pending HTTP request will be aborted if the provided context is
  21607. // canceled.
  21608. // This context will supersede any context previously provided to the
  21609. // ResumableMedia method.
  21610. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21611. c.ctx_ = ctx
  21612. return c
  21613. }
  21614. // Header returns an http.Header that can be modified by the caller to
  21615. // add HTTP headers to the request.
  21616. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21617. if c.header_ == nil {
  21618. c.header_ = make(http.Header)
  21619. }
  21620. return c.header_
  21621. }
  21622. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21623. reqHeaders := make(http.Header)
  21624. for k, v := range c.header_ {
  21625. reqHeaders[k] = v
  21626. }
  21627. reqHeaders.Set("User-Agent", c.s.userAgent())
  21628. var body io.Reader = nil
  21629. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21630. if err != nil {
  21631. return nil, err
  21632. }
  21633. reqHeaders.Set("Content-Type", "application/json")
  21634. c.urlParams_.Set("alt", alt)
  21635. c.urlParams_.Set("prettyPrint", "false")
  21636. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21637. if c.mediaInfo_ != nil {
  21638. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21639. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21640. }
  21641. if body == nil {
  21642. body = new(bytes.Buffer)
  21643. reqHeaders.Set("Content-Type", "application/json")
  21644. }
  21645. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21646. defer cleanup()
  21647. urls += "?" + c.urlParams_.Encode()
  21648. req, err := http.NewRequest("POST", urls, body)
  21649. if err != nil {
  21650. return nil, err
  21651. }
  21652. req.Header = reqHeaders
  21653. gensupport.SetGetBody(req, getBody)
  21654. googleapi.Expand(req.URL, map[string]string{
  21655. "profileId": strconv.FormatInt(c.profileId, 10),
  21656. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21657. })
  21658. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21659. }
  21660. // Do executes the "dfareporting.creativeAssets.insert" call.
  21661. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21662. // non-2xx status code is an error. Response headers are in either
  21663. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21664. // returned at all) in error.(*googleapi.Error).Header. Use
  21665. // googleapi.IsNotModified to check whether the returned error was
  21666. // because http.StatusNotModified was returned.
  21667. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21668. gensupport.SetOptions(c.urlParams_, opts...)
  21669. res, err := c.doRequest("json")
  21670. if res != nil && res.StatusCode == http.StatusNotModified {
  21671. if res.Body != nil {
  21672. res.Body.Close()
  21673. }
  21674. return nil, &googleapi.Error{
  21675. Code: res.StatusCode,
  21676. Header: res.Header,
  21677. }
  21678. }
  21679. if err != nil {
  21680. return nil, err
  21681. }
  21682. defer googleapi.CloseBody(res)
  21683. if err := googleapi.CheckResponse(res); err != nil {
  21684. return nil, err
  21685. }
  21686. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21687. if rx != nil {
  21688. rx.Client = c.s.client
  21689. rx.UserAgent = c.s.userAgent()
  21690. ctx := c.ctx_
  21691. if ctx == nil {
  21692. ctx = context.TODO()
  21693. }
  21694. res, err = rx.Upload(ctx)
  21695. if err != nil {
  21696. return nil, err
  21697. }
  21698. defer res.Body.Close()
  21699. if err := googleapi.CheckResponse(res); err != nil {
  21700. return nil, err
  21701. }
  21702. }
  21703. ret := &CreativeAssetMetadata{
  21704. ServerResponse: googleapi.ServerResponse{
  21705. Header: res.Header,
  21706. HTTPStatusCode: res.StatusCode,
  21707. },
  21708. }
  21709. target := &ret
  21710. if err := gensupport.DecodeResponse(target, res); err != nil {
  21711. return nil, err
  21712. }
  21713. return ret, nil
  21714. // {
  21715. // "description": "Inserts a new creative asset.",
  21716. // "httpMethod": "POST",
  21717. // "id": "dfareporting.creativeAssets.insert",
  21718. // "mediaUpload": {
  21719. // "accept": [
  21720. // "*/*"
  21721. // ],
  21722. // "maxSize": "1024MB",
  21723. // "protocols": {
  21724. // "resumable": {
  21725. // "multipart": true,
  21726. // "path": "/resumable/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21727. // },
  21728. // "simple": {
  21729. // "multipart": true,
  21730. // "path": "/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21731. // }
  21732. // }
  21733. // },
  21734. // "parameterOrder": [
  21735. // "profileId",
  21736. // "advertiserId"
  21737. // ],
  21738. // "parameters": {
  21739. // "advertiserId": {
  21740. // "description": "Advertiser ID of this creative. This is a required field.",
  21741. // "format": "int64",
  21742. // "location": "path",
  21743. // "required": true,
  21744. // "type": "string"
  21745. // },
  21746. // "profileId": {
  21747. // "description": "User profile ID associated with this request.",
  21748. // "format": "int64",
  21749. // "location": "path",
  21750. // "required": true,
  21751. // "type": "string"
  21752. // }
  21753. // },
  21754. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21755. // "request": {
  21756. // "$ref": "CreativeAssetMetadata"
  21757. // },
  21758. // "response": {
  21759. // "$ref": "CreativeAssetMetadata"
  21760. // },
  21761. // "scopes": [
  21762. // "https://www.googleapis.com/auth/dfatrafficking"
  21763. // ],
  21764. // "supportsMediaUpload": true
  21765. // }
  21766. }
  21767. // method id "dfareporting.creativeFieldValues.delete":
  21768. type CreativeFieldValuesDeleteCall struct {
  21769. s *Service
  21770. profileId int64
  21771. creativeFieldId int64
  21772. id int64
  21773. urlParams_ gensupport.URLParams
  21774. ctx_ context.Context
  21775. header_ http.Header
  21776. }
  21777. // Delete: Deletes an existing creative field value.
  21778. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  21779. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21780. c.profileId = profileId
  21781. c.creativeFieldId = creativeFieldId
  21782. c.id = id
  21783. return c
  21784. }
  21785. // Fields allows partial responses to be retrieved. See
  21786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21787. // for more information.
  21788. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  21789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21790. return c
  21791. }
  21792. // Context sets the context to be used in this call's Do method. Any
  21793. // pending HTTP request will be aborted if the provided context is
  21794. // canceled.
  21795. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  21796. c.ctx_ = ctx
  21797. return c
  21798. }
  21799. // Header returns an http.Header that can be modified by the caller to
  21800. // add HTTP headers to the request.
  21801. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  21802. if c.header_ == nil {
  21803. c.header_ = make(http.Header)
  21804. }
  21805. return c.header_
  21806. }
  21807. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  21808. reqHeaders := make(http.Header)
  21809. for k, v := range c.header_ {
  21810. reqHeaders[k] = v
  21811. }
  21812. reqHeaders.Set("User-Agent", c.s.userAgent())
  21813. var body io.Reader = nil
  21814. c.urlParams_.Set("alt", alt)
  21815. c.urlParams_.Set("prettyPrint", "false")
  21816. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21817. urls += "?" + c.urlParams_.Encode()
  21818. req, err := http.NewRequest("DELETE", urls, body)
  21819. if err != nil {
  21820. return nil, err
  21821. }
  21822. req.Header = reqHeaders
  21823. googleapi.Expand(req.URL, map[string]string{
  21824. "profileId": strconv.FormatInt(c.profileId, 10),
  21825. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21826. "id": strconv.FormatInt(c.id, 10),
  21827. })
  21828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21829. }
  21830. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  21831. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  21832. gensupport.SetOptions(c.urlParams_, opts...)
  21833. res, err := c.doRequest("json")
  21834. if err != nil {
  21835. return err
  21836. }
  21837. defer googleapi.CloseBody(res)
  21838. if err := googleapi.CheckResponse(res); err != nil {
  21839. return err
  21840. }
  21841. return nil
  21842. // {
  21843. // "description": "Deletes an existing creative field value.",
  21844. // "httpMethod": "DELETE",
  21845. // "id": "dfareporting.creativeFieldValues.delete",
  21846. // "parameterOrder": [
  21847. // "profileId",
  21848. // "creativeFieldId",
  21849. // "id"
  21850. // ],
  21851. // "parameters": {
  21852. // "creativeFieldId": {
  21853. // "description": "Creative field ID for this creative field value.",
  21854. // "format": "int64",
  21855. // "location": "path",
  21856. // "required": true,
  21857. // "type": "string"
  21858. // },
  21859. // "id": {
  21860. // "description": "Creative Field Value ID",
  21861. // "format": "int64",
  21862. // "location": "path",
  21863. // "required": true,
  21864. // "type": "string"
  21865. // },
  21866. // "profileId": {
  21867. // "description": "User profile ID associated with this request.",
  21868. // "format": "int64",
  21869. // "location": "path",
  21870. // "required": true,
  21871. // "type": "string"
  21872. // }
  21873. // },
  21874. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  21875. // "scopes": [
  21876. // "https://www.googleapis.com/auth/dfatrafficking"
  21877. // ]
  21878. // }
  21879. }
  21880. // method id "dfareporting.creativeFieldValues.get":
  21881. type CreativeFieldValuesGetCall struct {
  21882. s *Service
  21883. profileId int64
  21884. creativeFieldId int64
  21885. id int64
  21886. urlParams_ gensupport.URLParams
  21887. ifNoneMatch_ string
  21888. ctx_ context.Context
  21889. header_ http.Header
  21890. }
  21891. // Get: Gets one creative field value by ID.
  21892. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  21893. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21894. c.profileId = profileId
  21895. c.creativeFieldId = creativeFieldId
  21896. c.id = id
  21897. return c
  21898. }
  21899. // Fields allows partial responses to be retrieved. See
  21900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21901. // for more information.
  21902. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  21903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21904. return c
  21905. }
  21906. // IfNoneMatch sets the optional parameter which makes the operation
  21907. // fail if the object's ETag matches the given value. This is useful for
  21908. // getting updates only after the object has changed since the last
  21909. // request. Use googleapi.IsNotModified to check whether the response
  21910. // error from Do is the result of In-None-Match.
  21911. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  21912. c.ifNoneMatch_ = entityTag
  21913. return c
  21914. }
  21915. // Context sets the context to be used in this call's Do method. Any
  21916. // pending HTTP request will be aborted if the provided context is
  21917. // canceled.
  21918. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  21919. c.ctx_ = ctx
  21920. return c
  21921. }
  21922. // Header returns an http.Header that can be modified by the caller to
  21923. // add HTTP headers to the request.
  21924. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  21925. if c.header_ == nil {
  21926. c.header_ = make(http.Header)
  21927. }
  21928. return c.header_
  21929. }
  21930. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  21931. reqHeaders := make(http.Header)
  21932. for k, v := range c.header_ {
  21933. reqHeaders[k] = v
  21934. }
  21935. reqHeaders.Set("User-Agent", c.s.userAgent())
  21936. if c.ifNoneMatch_ != "" {
  21937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21938. }
  21939. var body io.Reader = nil
  21940. c.urlParams_.Set("alt", alt)
  21941. c.urlParams_.Set("prettyPrint", "false")
  21942. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21943. urls += "?" + c.urlParams_.Encode()
  21944. req, err := http.NewRequest("GET", urls, body)
  21945. if err != nil {
  21946. return nil, err
  21947. }
  21948. req.Header = reqHeaders
  21949. googleapi.Expand(req.URL, map[string]string{
  21950. "profileId": strconv.FormatInt(c.profileId, 10),
  21951. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21952. "id": strconv.FormatInt(c.id, 10),
  21953. })
  21954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21955. }
  21956. // Do executes the "dfareporting.creativeFieldValues.get" call.
  21957. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21958. // non-2xx status code is an error. Response headers are in either
  21959. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21960. // returned at all) in error.(*googleapi.Error).Header. Use
  21961. // googleapi.IsNotModified to check whether the returned error was
  21962. // because http.StatusNotModified was returned.
  21963. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21964. gensupport.SetOptions(c.urlParams_, opts...)
  21965. res, err := c.doRequest("json")
  21966. if res != nil && res.StatusCode == http.StatusNotModified {
  21967. if res.Body != nil {
  21968. res.Body.Close()
  21969. }
  21970. return nil, &googleapi.Error{
  21971. Code: res.StatusCode,
  21972. Header: res.Header,
  21973. }
  21974. }
  21975. if err != nil {
  21976. return nil, err
  21977. }
  21978. defer googleapi.CloseBody(res)
  21979. if err := googleapi.CheckResponse(res); err != nil {
  21980. return nil, err
  21981. }
  21982. ret := &CreativeFieldValue{
  21983. ServerResponse: googleapi.ServerResponse{
  21984. Header: res.Header,
  21985. HTTPStatusCode: res.StatusCode,
  21986. },
  21987. }
  21988. target := &ret
  21989. if err := gensupport.DecodeResponse(target, res); err != nil {
  21990. return nil, err
  21991. }
  21992. return ret, nil
  21993. // {
  21994. // "description": "Gets one creative field value by ID.",
  21995. // "httpMethod": "GET",
  21996. // "id": "dfareporting.creativeFieldValues.get",
  21997. // "parameterOrder": [
  21998. // "profileId",
  21999. // "creativeFieldId",
  22000. // "id"
  22001. // ],
  22002. // "parameters": {
  22003. // "creativeFieldId": {
  22004. // "description": "Creative field ID for this creative field value.",
  22005. // "format": "int64",
  22006. // "location": "path",
  22007. // "required": true,
  22008. // "type": "string"
  22009. // },
  22010. // "id": {
  22011. // "description": "Creative Field Value ID",
  22012. // "format": "int64",
  22013. // "location": "path",
  22014. // "required": true,
  22015. // "type": "string"
  22016. // },
  22017. // "profileId": {
  22018. // "description": "User profile ID associated with this request.",
  22019. // "format": "int64",
  22020. // "location": "path",
  22021. // "required": true,
  22022. // "type": "string"
  22023. // }
  22024. // },
  22025. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  22026. // "response": {
  22027. // "$ref": "CreativeFieldValue"
  22028. // },
  22029. // "scopes": [
  22030. // "https://www.googleapis.com/auth/dfatrafficking"
  22031. // ]
  22032. // }
  22033. }
  22034. // method id "dfareporting.creativeFieldValues.insert":
  22035. type CreativeFieldValuesInsertCall struct {
  22036. s *Service
  22037. profileId int64
  22038. creativeFieldId int64
  22039. creativefieldvalue *CreativeFieldValue
  22040. urlParams_ gensupport.URLParams
  22041. ctx_ context.Context
  22042. header_ http.Header
  22043. }
  22044. // Insert: Inserts a new creative field value.
  22045. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  22046. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22047. c.profileId = profileId
  22048. c.creativeFieldId = creativeFieldId
  22049. c.creativefieldvalue = creativefieldvalue
  22050. return c
  22051. }
  22052. // Fields allows partial responses to be retrieved. See
  22053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22054. // for more information.
  22055. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  22056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22057. return c
  22058. }
  22059. // Context sets the context to be used in this call's Do method. Any
  22060. // pending HTTP request will be aborted if the provided context is
  22061. // canceled.
  22062. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  22063. c.ctx_ = ctx
  22064. return c
  22065. }
  22066. // Header returns an http.Header that can be modified by the caller to
  22067. // add HTTP headers to the request.
  22068. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  22069. if c.header_ == nil {
  22070. c.header_ = make(http.Header)
  22071. }
  22072. return c.header_
  22073. }
  22074. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  22075. reqHeaders := make(http.Header)
  22076. for k, v := range c.header_ {
  22077. reqHeaders[k] = v
  22078. }
  22079. reqHeaders.Set("User-Agent", c.s.userAgent())
  22080. var body io.Reader = nil
  22081. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22082. if err != nil {
  22083. return nil, err
  22084. }
  22085. reqHeaders.Set("Content-Type", "application/json")
  22086. c.urlParams_.Set("alt", alt)
  22087. c.urlParams_.Set("prettyPrint", "false")
  22088. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22089. urls += "?" + c.urlParams_.Encode()
  22090. req, err := http.NewRequest("POST", urls, body)
  22091. if err != nil {
  22092. return nil, err
  22093. }
  22094. req.Header = reqHeaders
  22095. googleapi.Expand(req.URL, map[string]string{
  22096. "profileId": strconv.FormatInt(c.profileId, 10),
  22097. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22098. })
  22099. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22100. }
  22101. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  22102. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22103. // non-2xx status code is an error. Response headers are in either
  22104. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22105. // returned at all) in error.(*googleapi.Error).Header. Use
  22106. // googleapi.IsNotModified to check whether the returned error was
  22107. // because http.StatusNotModified was returned.
  22108. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22109. gensupport.SetOptions(c.urlParams_, opts...)
  22110. res, err := c.doRequest("json")
  22111. if res != nil && res.StatusCode == http.StatusNotModified {
  22112. if res.Body != nil {
  22113. res.Body.Close()
  22114. }
  22115. return nil, &googleapi.Error{
  22116. Code: res.StatusCode,
  22117. Header: res.Header,
  22118. }
  22119. }
  22120. if err != nil {
  22121. return nil, err
  22122. }
  22123. defer googleapi.CloseBody(res)
  22124. if err := googleapi.CheckResponse(res); err != nil {
  22125. return nil, err
  22126. }
  22127. ret := &CreativeFieldValue{
  22128. ServerResponse: googleapi.ServerResponse{
  22129. Header: res.Header,
  22130. HTTPStatusCode: res.StatusCode,
  22131. },
  22132. }
  22133. target := &ret
  22134. if err := gensupport.DecodeResponse(target, res); err != nil {
  22135. return nil, err
  22136. }
  22137. return ret, nil
  22138. // {
  22139. // "description": "Inserts a new creative field value.",
  22140. // "httpMethod": "POST",
  22141. // "id": "dfareporting.creativeFieldValues.insert",
  22142. // "parameterOrder": [
  22143. // "profileId",
  22144. // "creativeFieldId"
  22145. // ],
  22146. // "parameters": {
  22147. // "creativeFieldId": {
  22148. // "description": "Creative field ID for this creative field value.",
  22149. // "format": "int64",
  22150. // "location": "path",
  22151. // "required": true,
  22152. // "type": "string"
  22153. // },
  22154. // "profileId": {
  22155. // "description": "User profile ID associated with this request.",
  22156. // "format": "int64",
  22157. // "location": "path",
  22158. // "required": true,
  22159. // "type": "string"
  22160. // }
  22161. // },
  22162. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22163. // "request": {
  22164. // "$ref": "CreativeFieldValue"
  22165. // },
  22166. // "response": {
  22167. // "$ref": "CreativeFieldValue"
  22168. // },
  22169. // "scopes": [
  22170. // "https://www.googleapis.com/auth/dfatrafficking"
  22171. // ]
  22172. // }
  22173. }
  22174. // method id "dfareporting.creativeFieldValues.list":
  22175. type CreativeFieldValuesListCall struct {
  22176. s *Service
  22177. profileId int64
  22178. creativeFieldId int64
  22179. urlParams_ gensupport.URLParams
  22180. ifNoneMatch_ string
  22181. ctx_ context.Context
  22182. header_ http.Header
  22183. }
  22184. // List: Retrieves a list of creative field values, possibly filtered.
  22185. // This method supports paging.
  22186. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  22187. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22188. c.profileId = profileId
  22189. c.creativeFieldId = creativeFieldId
  22190. return c
  22191. }
  22192. // Ids sets the optional parameter "ids": Select only creative field
  22193. // values with these IDs.
  22194. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  22195. var ids_ []string
  22196. for _, v := range ids {
  22197. ids_ = append(ids_, fmt.Sprint(v))
  22198. }
  22199. c.urlParams_.SetMulti("ids", ids_)
  22200. return c
  22201. }
  22202. // MaxResults sets the optional parameter "maxResults": Maximum number
  22203. // of results to return.
  22204. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  22205. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22206. return c
  22207. }
  22208. // PageToken sets the optional parameter "pageToken": Value of the
  22209. // nextPageToken from the previous result page.
  22210. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  22211. c.urlParams_.Set("pageToken", pageToken)
  22212. return c
  22213. }
  22214. // SearchString sets the optional parameter "searchString": Allows
  22215. // searching for creative field values by their values. Wildcards (e.g.
  22216. // *) are not allowed.
  22217. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  22218. c.urlParams_.Set("searchString", searchString)
  22219. return c
  22220. }
  22221. // SortField sets the optional parameter "sortField": Field by which to
  22222. // sort the list.
  22223. //
  22224. // Possible values:
  22225. // "ID" (default)
  22226. // "VALUE"
  22227. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  22228. c.urlParams_.Set("sortField", sortField)
  22229. return c
  22230. }
  22231. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22232. // results.
  22233. //
  22234. // Possible values:
  22235. // "ASCENDING" (default)
  22236. // "DESCENDING"
  22237. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  22238. c.urlParams_.Set("sortOrder", sortOrder)
  22239. return c
  22240. }
  22241. // Fields allows partial responses to be retrieved. See
  22242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22243. // for more information.
  22244. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  22245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22246. return c
  22247. }
  22248. // IfNoneMatch sets the optional parameter which makes the operation
  22249. // fail if the object's ETag matches the given value. This is useful for
  22250. // getting updates only after the object has changed since the last
  22251. // request. Use googleapi.IsNotModified to check whether the response
  22252. // error from Do is the result of In-None-Match.
  22253. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22254. c.ifNoneMatch_ = entityTag
  22255. return c
  22256. }
  22257. // Context sets the context to be used in this call's Do method. Any
  22258. // pending HTTP request will be aborted if the provided context is
  22259. // canceled.
  22260. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22261. c.ctx_ = ctx
  22262. return c
  22263. }
  22264. // Header returns an http.Header that can be modified by the caller to
  22265. // add HTTP headers to the request.
  22266. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22267. if c.header_ == nil {
  22268. c.header_ = make(http.Header)
  22269. }
  22270. return c.header_
  22271. }
  22272. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22273. reqHeaders := make(http.Header)
  22274. for k, v := range c.header_ {
  22275. reqHeaders[k] = v
  22276. }
  22277. reqHeaders.Set("User-Agent", c.s.userAgent())
  22278. if c.ifNoneMatch_ != "" {
  22279. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22280. }
  22281. var body io.Reader = nil
  22282. c.urlParams_.Set("alt", alt)
  22283. c.urlParams_.Set("prettyPrint", "false")
  22284. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22285. urls += "?" + c.urlParams_.Encode()
  22286. req, err := http.NewRequest("GET", urls, body)
  22287. if err != nil {
  22288. return nil, err
  22289. }
  22290. req.Header = reqHeaders
  22291. googleapi.Expand(req.URL, map[string]string{
  22292. "profileId": strconv.FormatInt(c.profileId, 10),
  22293. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22294. })
  22295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22296. }
  22297. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22298. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22299. // non-nil. Any non-2xx status code is an error. Response headers are in
  22300. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22301. // a response was returned at all) in error.(*googleapi.Error).Header.
  22302. // Use googleapi.IsNotModified to check whether the returned error was
  22303. // because http.StatusNotModified was returned.
  22304. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22305. gensupport.SetOptions(c.urlParams_, opts...)
  22306. res, err := c.doRequest("json")
  22307. if res != nil && res.StatusCode == http.StatusNotModified {
  22308. if res.Body != nil {
  22309. res.Body.Close()
  22310. }
  22311. return nil, &googleapi.Error{
  22312. Code: res.StatusCode,
  22313. Header: res.Header,
  22314. }
  22315. }
  22316. if err != nil {
  22317. return nil, err
  22318. }
  22319. defer googleapi.CloseBody(res)
  22320. if err := googleapi.CheckResponse(res); err != nil {
  22321. return nil, err
  22322. }
  22323. ret := &CreativeFieldValuesListResponse{
  22324. ServerResponse: googleapi.ServerResponse{
  22325. Header: res.Header,
  22326. HTTPStatusCode: res.StatusCode,
  22327. },
  22328. }
  22329. target := &ret
  22330. if err := gensupport.DecodeResponse(target, res); err != nil {
  22331. return nil, err
  22332. }
  22333. return ret, nil
  22334. // {
  22335. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22336. // "httpMethod": "GET",
  22337. // "id": "dfareporting.creativeFieldValues.list",
  22338. // "parameterOrder": [
  22339. // "profileId",
  22340. // "creativeFieldId"
  22341. // ],
  22342. // "parameters": {
  22343. // "creativeFieldId": {
  22344. // "description": "Creative field ID for this creative field value.",
  22345. // "format": "int64",
  22346. // "location": "path",
  22347. // "required": true,
  22348. // "type": "string"
  22349. // },
  22350. // "ids": {
  22351. // "description": "Select only creative field values with these IDs.",
  22352. // "format": "int64",
  22353. // "location": "query",
  22354. // "repeated": true,
  22355. // "type": "string"
  22356. // },
  22357. // "maxResults": {
  22358. // "default": "1000",
  22359. // "description": "Maximum number of results to return.",
  22360. // "format": "int32",
  22361. // "location": "query",
  22362. // "maximum": "1000",
  22363. // "minimum": "0",
  22364. // "type": "integer"
  22365. // },
  22366. // "pageToken": {
  22367. // "description": "Value of the nextPageToken from the previous result page.",
  22368. // "location": "query",
  22369. // "type": "string"
  22370. // },
  22371. // "profileId": {
  22372. // "description": "User profile ID associated with this request.",
  22373. // "format": "int64",
  22374. // "location": "path",
  22375. // "required": true,
  22376. // "type": "string"
  22377. // },
  22378. // "searchString": {
  22379. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22380. // "location": "query",
  22381. // "type": "string"
  22382. // },
  22383. // "sortField": {
  22384. // "default": "ID",
  22385. // "description": "Field by which to sort the list.",
  22386. // "enum": [
  22387. // "ID",
  22388. // "VALUE"
  22389. // ],
  22390. // "enumDescriptions": [
  22391. // "",
  22392. // ""
  22393. // ],
  22394. // "location": "query",
  22395. // "type": "string"
  22396. // },
  22397. // "sortOrder": {
  22398. // "default": "ASCENDING",
  22399. // "description": "Order of sorted results.",
  22400. // "enum": [
  22401. // "ASCENDING",
  22402. // "DESCENDING"
  22403. // ],
  22404. // "enumDescriptions": [
  22405. // "",
  22406. // ""
  22407. // ],
  22408. // "location": "query",
  22409. // "type": "string"
  22410. // }
  22411. // },
  22412. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22413. // "response": {
  22414. // "$ref": "CreativeFieldValuesListResponse"
  22415. // },
  22416. // "scopes": [
  22417. // "https://www.googleapis.com/auth/dfatrafficking"
  22418. // ]
  22419. // }
  22420. }
  22421. // Pages invokes f for each page of results.
  22422. // A non-nil error returned from f will halt the iteration.
  22423. // The provided context supersedes any context provided to the Context method.
  22424. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22425. c.ctx_ = ctx
  22426. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22427. for {
  22428. x, err := c.Do()
  22429. if err != nil {
  22430. return err
  22431. }
  22432. if err := f(x); err != nil {
  22433. return err
  22434. }
  22435. if x.NextPageToken == "" {
  22436. return nil
  22437. }
  22438. c.PageToken(x.NextPageToken)
  22439. }
  22440. }
  22441. // method id "dfareporting.creativeFieldValues.patch":
  22442. type CreativeFieldValuesPatchCall struct {
  22443. s *Service
  22444. profileId int64
  22445. creativeFieldId int64
  22446. creativefieldvalue *CreativeFieldValue
  22447. urlParams_ gensupport.URLParams
  22448. ctx_ context.Context
  22449. header_ http.Header
  22450. }
  22451. // Patch: Updates an existing creative field value. This method supports
  22452. // patch semantics.
  22453. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22454. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22455. c.profileId = profileId
  22456. c.creativeFieldId = creativeFieldId
  22457. c.urlParams_.Set("id", fmt.Sprint(id))
  22458. c.creativefieldvalue = creativefieldvalue
  22459. return c
  22460. }
  22461. // Fields allows partial responses to be retrieved. See
  22462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22463. // for more information.
  22464. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22466. return c
  22467. }
  22468. // Context sets the context to be used in this call's Do method. Any
  22469. // pending HTTP request will be aborted if the provided context is
  22470. // canceled.
  22471. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22472. c.ctx_ = ctx
  22473. return c
  22474. }
  22475. // Header returns an http.Header that can be modified by the caller to
  22476. // add HTTP headers to the request.
  22477. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22478. if c.header_ == nil {
  22479. c.header_ = make(http.Header)
  22480. }
  22481. return c.header_
  22482. }
  22483. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22484. reqHeaders := make(http.Header)
  22485. for k, v := range c.header_ {
  22486. reqHeaders[k] = v
  22487. }
  22488. reqHeaders.Set("User-Agent", c.s.userAgent())
  22489. var body io.Reader = nil
  22490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22491. if err != nil {
  22492. return nil, err
  22493. }
  22494. reqHeaders.Set("Content-Type", "application/json")
  22495. c.urlParams_.Set("alt", alt)
  22496. c.urlParams_.Set("prettyPrint", "false")
  22497. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22498. urls += "?" + c.urlParams_.Encode()
  22499. req, err := http.NewRequest("PATCH", urls, body)
  22500. if err != nil {
  22501. return nil, err
  22502. }
  22503. req.Header = reqHeaders
  22504. googleapi.Expand(req.URL, map[string]string{
  22505. "profileId": strconv.FormatInt(c.profileId, 10),
  22506. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22507. })
  22508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22509. }
  22510. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22511. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22512. // non-2xx status code is an error. Response headers are in either
  22513. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22514. // returned at all) in error.(*googleapi.Error).Header. Use
  22515. // googleapi.IsNotModified to check whether the returned error was
  22516. // because http.StatusNotModified was returned.
  22517. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22518. gensupport.SetOptions(c.urlParams_, opts...)
  22519. res, err := c.doRequest("json")
  22520. if res != nil && res.StatusCode == http.StatusNotModified {
  22521. if res.Body != nil {
  22522. res.Body.Close()
  22523. }
  22524. return nil, &googleapi.Error{
  22525. Code: res.StatusCode,
  22526. Header: res.Header,
  22527. }
  22528. }
  22529. if err != nil {
  22530. return nil, err
  22531. }
  22532. defer googleapi.CloseBody(res)
  22533. if err := googleapi.CheckResponse(res); err != nil {
  22534. return nil, err
  22535. }
  22536. ret := &CreativeFieldValue{
  22537. ServerResponse: googleapi.ServerResponse{
  22538. Header: res.Header,
  22539. HTTPStatusCode: res.StatusCode,
  22540. },
  22541. }
  22542. target := &ret
  22543. if err := gensupport.DecodeResponse(target, res); err != nil {
  22544. return nil, err
  22545. }
  22546. return ret, nil
  22547. // {
  22548. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22549. // "httpMethod": "PATCH",
  22550. // "id": "dfareporting.creativeFieldValues.patch",
  22551. // "parameterOrder": [
  22552. // "profileId",
  22553. // "creativeFieldId",
  22554. // "id"
  22555. // ],
  22556. // "parameters": {
  22557. // "creativeFieldId": {
  22558. // "description": "Creative field ID for this creative field value.",
  22559. // "format": "int64",
  22560. // "location": "path",
  22561. // "required": true,
  22562. // "type": "string"
  22563. // },
  22564. // "id": {
  22565. // "description": "Creative Field Value ID",
  22566. // "format": "int64",
  22567. // "location": "query",
  22568. // "required": true,
  22569. // "type": "string"
  22570. // },
  22571. // "profileId": {
  22572. // "description": "User profile ID associated with this request.",
  22573. // "format": "int64",
  22574. // "location": "path",
  22575. // "required": true,
  22576. // "type": "string"
  22577. // }
  22578. // },
  22579. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22580. // "request": {
  22581. // "$ref": "CreativeFieldValue"
  22582. // },
  22583. // "response": {
  22584. // "$ref": "CreativeFieldValue"
  22585. // },
  22586. // "scopes": [
  22587. // "https://www.googleapis.com/auth/dfatrafficking"
  22588. // ]
  22589. // }
  22590. }
  22591. // method id "dfareporting.creativeFieldValues.update":
  22592. type CreativeFieldValuesUpdateCall struct {
  22593. s *Service
  22594. profileId int64
  22595. creativeFieldId int64
  22596. creativefieldvalue *CreativeFieldValue
  22597. urlParams_ gensupport.URLParams
  22598. ctx_ context.Context
  22599. header_ http.Header
  22600. }
  22601. // Update: Updates an existing creative field value.
  22602. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22603. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22604. c.profileId = profileId
  22605. c.creativeFieldId = creativeFieldId
  22606. c.creativefieldvalue = creativefieldvalue
  22607. return c
  22608. }
  22609. // Fields allows partial responses to be retrieved. See
  22610. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22611. // for more information.
  22612. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22613. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22614. return c
  22615. }
  22616. // Context sets the context to be used in this call's Do method. Any
  22617. // pending HTTP request will be aborted if the provided context is
  22618. // canceled.
  22619. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22620. c.ctx_ = ctx
  22621. return c
  22622. }
  22623. // Header returns an http.Header that can be modified by the caller to
  22624. // add HTTP headers to the request.
  22625. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22626. if c.header_ == nil {
  22627. c.header_ = make(http.Header)
  22628. }
  22629. return c.header_
  22630. }
  22631. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22632. reqHeaders := make(http.Header)
  22633. for k, v := range c.header_ {
  22634. reqHeaders[k] = v
  22635. }
  22636. reqHeaders.Set("User-Agent", c.s.userAgent())
  22637. var body io.Reader = nil
  22638. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22639. if err != nil {
  22640. return nil, err
  22641. }
  22642. reqHeaders.Set("Content-Type", "application/json")
  22643. c.urlParams_.Set("alt", alt)
  22644. c.urlParams_.Set("prettyPrint", "false")
  22645. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22646. urls += "?" + c.urlParams_.Encode()
  22647. req, err := http.NewRequest("PUT", urls, body)
  22648. if err != nil {
  22649. return nil, err
  22650. }
  22651. req.Header = reqHeaders
  22652. googleapi.Expand(req.URL, map[string]string{
  22653. "profileId": strconv.FormatInt(c.profileId, 10),
  22654. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22655. })
  22656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22657. }
  22658. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22659. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22660. // non-2xx status code is an error. Response headers are in either
  22661. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22662. // returned at all) in error.(*googleapi.Error).Header. Use
  22663. // googleapi.IsNotModified to check whether the returned error was
  22664. // because http.StatusNotModified was returned.
  22665. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22666. gensupport.SetOptions(c.urlParams_, opts...)
  22667. res, err := c.doRequest("json")
  22668. if res != nil && res.StatusCode == http.StatusNotModified {
  22669. if res.Body != nil {
  22670. res.Body.Close()
  22671. }
  22672. return nil, &googleapi.Error{
  22673. Code: res.StatusCode,
  22674. Header: res.Header,
  22675. }
  22676. }
  22677. if err != nil {
  22678. return nil, err
  22679. }
  22680. defer googleapi.CloseBody(res)
  22681. if err := googleapi.CheckResponse(res); err != nil {
  22682. return nil, err
  22683. }
  22684. ret := &CreativeFieldValue{
  22685. ServerResponse: googleapi.ServerResponse{
  22686. Header: res.Header,
  22687. HTTPStatusCode: res.StatusCode,
  22688. },
  22689. }
  22690. target := &ret
  22691. if err := gensupport.DecodeResponse(target, res); err != nil {
  22692. return nil, err
  22693. }
  22694. return ret, nil
  22695. // {
  22696. // "description": "Updates an existing creative field value.",
  22697. // "httpMethod": "PUT",
  22698. // "id": "dfareporting.creativeFieldValues.update",
  22699. // "parameterOrder": [
  22700. // "profileId",
  22701. // "creativeFieldId"
  22702. // ],
  22703. // "parameters": {
  22704. // "creativeFieldId": {
  22705. // "description": "Creative field ID for this creative field value.",
  22706. // "format": "int64",
  22707. // "location": "path",
  22708. // "required": true,
  22709. // "type": "string"
  22710. // },
  22711. // "profileId": {
  22712. // "description": "User profile ID associated with this request.",
  22713. // "format": "int64",
  22714. // "location": "path",
  22715. // "required": true,
  22716. // "type": "string"
  22717. // }
  22718. // },
  22719. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22720. // "request": {
  22721. // "$ref": "CreativeFieldValue"
  22722. // },
  22723. // "response": {
  22724. // "$ref": "CreativeFieldValue"
  22725. // },
  22726. // "scopes": [
  22727. // "https://www.googleapis.com/auth/dfatrafficking"
  22728. // ]
  22729. // }
  22730. }
  22731. // method id "dfareporting.creativeFields.delete":
  22732. type CreativeFieldsDeleteCall struct {
  22733. s *Service
  22734. profileId int64
  22735. id int64
  22736. urlParams_ gensupport.URLParams
  22737. ctx_ context.Context
  22738. header_ http.Header
  22739. }
  22740. // Delete: Deletes an existing creative field.
  22741. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22742. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22743. c.profileId = profileId
  22744. c.id = id
  22745. return c
  22746. }
  22747. // Fields allows partial responses to be retrieved. See
  22748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22749. // for more information.
  22750. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22752. return c
  22753. }
  22754. // Context sets the context to be used in this call's Do method. Any
  22755. // pending HTTP request will be aborted if the provided context is
  22756. // canceled.
  22757. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22758. c.ctx_ = ctx
  22759. return c
  22760. }
  22761. // Header returns an http.Header that can be modified by the caller to
  22762. // add HTTP headers to the request.
  22763. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22764. if c.header_ == nil {
  22765. c.header_ = make(http.Header)
  22766. }
  22767. return c.header_
  22768. }
  22769. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  22770. reqHeaders := make(http.Header)
  22771. for k, v := range c.header_ {
  22772. reqHeaders[k] = v
  22773. }
  22774. reqHeaders.Set("User-Agent", c.s.userAgent())
  22775. var body io.Reader = nil
  22776. c.urlParams_.Set("alt", alt)
  22777. c.urlParams_.Set("prettyPrint", "false")
  22778. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22779. urls += "?" + c.urlParams_.Encode()
  22780. req, err := http.NewRequest("DELETE", urls, body)
  22781. if err != nil {
  22782. return nil, err
  22783. }
  22784. req.Header = reqHeaders
  22785. googleapi.Expand(req.URL, map[string]string{
  22786. "profileId": strconv.FormatInt(c.profileId, 10),
  22787. "id": strconv.FormatInt(c.id, 10),
  22788. })
  22789. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22790. }
  22791. // Do executes the "dfareporting.creativeFields.delete" call.
  22792. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  22793. gensupport.SetOptions(c.urlParams_, opts...)
  22794. res, err := c.doRequest("json")
  22795. if err != nil {
  22796. return err
  22797. }
  22798. defer googleapi.CloseBody(res)
  22799. if err := googleapi.CheckResponse(res); err != nil {
  22800. return err
  22801. }
  22802. return nil
  22803. // {
  22804. // "description": "Deletes an existing creative field.",
  22805. // "httpMethod": "DELETE",
  22806. // "id": "dfareporting.creativeFields.delete",
  22807. // "parameterOrder": [
  22808. // "profileId",
  22809. // "id"
  22810. // ],
  22811. // "parameters": {
  22812. // "id": {
  22813. // "description": "Creative Field ID",
  22814. // "format": "int64",
  22815. // "location": "path",
  22816. // "required": true,
  22817. // "type": "string"
  22818. // },
  22819. // "profileId": {
  22820. // "description": "User profile ID associated with this request.",
  22821. // "format": "int64",
  22822. // "location": "path",
  22823. // "required": true,
  22824. // "type": "string"
  22825. // }
  22826. // },
  22827. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22828. // "scopes": [
  22829. // "https://www.googleapis.com/auth/dfatrafficking"
  22830. // ]
  22831. // }
  22832. }
  22833. // method id "dfareporting.creativeFields.get":
  22834. type CreativeFieldsGetCall struct {
  22835. s *Service
  22836. profileId int64
  22837. id int64
  22838. urlParams_ gensupport.URLParams
  22839. ifNoneMatch_ string
  22840. ctx_ context.Context
  22841. header_ http.Header
  22842. }
  22843. // Get: Gets one creative field by ID.
  22844. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  22845. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22846. c.profileId = profileId
  22847. c.id = id
  22848. return c
  22849. }
  22850. // Fields allows partial responses to be retrieved. See
  22851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22852. // for more information.
  22853. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  22854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22855. return c
  22856. }
  22857. // IfNoneMatch sets the optional parameter which makes the operation
  22858. // fail if the object's ETag matches the given value. This is useful for
  22859. // getting updates only after the object has changed since the last
  22860. // request. Use googleapi.IsNotModified to check whether the response
  22861. // error from Do is the result of In-None-Match.
  22862. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  22863. c.ifNoneMatch_ = entityTag
  22864. return c
  22865. }
  22866. // Context sets the context to be used in this call's Do method. Any
  22867. // pending HTTP request will be aborted if the provided context is
  22868. // canceled.
  22869. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  22870. c.ctx_ = ctx
  22871. return c
  22872. }
  22873. // Header returns an http.Header that can be modified by the caller to
  22874. // add HTTP headers to the request.
  22875. func (c *CreativeFieldsGetCall) Header() http.Header {
  22876. if c.header_ == nil {
  22877. c.header_ = make(http.Header)
  22878. }
  22879. return c.header_
  22880. }
  22881. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  22882. reqHeaders := make(http.Header)
  22883. for k, v := range c.header_ {
  22884. reqHeaders[k] = v
  22885. }
  22886. reqHeaders.Set("User-Agent", c.s.userAgent())
  22887. if c.ifNoneMatch_ != "" {
  22888. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22889. }
  22890. var body io.Reader = nil
  22891. c.urlParams_.Set("alt", alt)
  22892. c.urlParams_.Set("prettyPrint", "false")
  22893. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22894. urls += "?" + c.urlParams_.Encode()
  22895. req, err := http.NewRequest("GET", urls, body)
  22896. if err != nil {
  22897. return nil, err
  22898. }
  22899. req.Header = reqHeaders
  22900. googleapi.Expand(req.URL, map[string]string{
  22901. "profileId": strconv.FormatInt(c.profileId, 10),
  22902. "id": strconv.FormatInt(c.id, 10),
  22903. })
  22904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22905. }
  22906. // Do executes the "dfareporting.creativeFields.get" call.
  22907. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22908. // status code is an error. Response headers are in either
  22909. // *CreativeField.ServerResponse.Header or (if a response was returned
  22910. // at all) in error.(*googleapi.Error).Header. Use
  22911. // googleapi.IsNotModified to check whether the returned error was
  22912. // because http.StatusNotModified was returned.
  22913. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22914. gensupport.SetOptions(c.urlParams_, opts...)
  22915. res, err := c.doRequest("json")
  22916. if res != nil && res.StatusCode == http.StatusNotModified {
  22917. if res.Body != nil {
  22918. res.Body.Close()
  22919. }
  22920. return nil, &googleapi.Error{
  22921. Code: res.StatusCode,
  22922. Header: res.Header,
  22923. }
  22924. }
  22925. if err != nil {
  22926. return nil, err
  22927. }
  22928. defer googleapi.CloseBody(res)
  22929. if err := googleapi.CheckResponse(res); err != nil {
  22930. return nil, err
  22931. }
  22932. ret := &CreativeField{
  22933. ServerResponse: googleapi.ServerResponse{
  22934. Header: res.Header,
  22935. HTTPStatusCode: res.StatusCode,
  22936. },
  22937. }
  22938. target := &ret
  22939. if err := gensupport.DecodeResponse(target, res); err != nil {
  22940. return nil, err
  22941. }
  22942. return ret, nil
  22943. // {
  22944. // "description": "Gets one creative field by ID.",
  22945. // "httpMethod": "GET",
  22946. // "id": "dfareporting.creativeFields.get",
  22947. // "parameterOrder": [
  22948. // "profileId",
  22949. // "id"
  22950. // ],
  22951. // "parameters": {
  22952. // "id": {
  22953. // "description": "Creative Field ID",
  22954. // "format": "int64",
  22955. // "location": "path",
  22956. // "required": true,
  22957. // "type": "string"
  22958. // },
  22959. // "profileId": {
  22960. // "description": "User profile ID associated with this request.",
  22961. // "format": "int64",
  22962. // "location": "path",
  22963. // "required": true,
  22964. // "type": "string"
  22965. // }
  22966. // },
  22967. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22968. // "response": {
  22969. // "$ref": "CreativeField"
  22970. // },
  22971. // "scopes": [
  22972. // "https://www.googleapis.com/auth/dfatrafficking"
  22973. // ]
  22974. // }
  22975. }
  22976. // method id "dfareporting.creativeFields.insert":
  22977. type CreativeFieldsInsertCall struct {
  22978. s *Service
  22979. profileId int64
  22980. creativefield *CreativeField
  22981. urlParams_ gensupport.URLParams
  22982. ctx_ context.Context
  22983. header_ http.Header
  22984. }
  22985. // Insert: Inserts a new creative field.
  22986. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  22987. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22988. c.profileId = profileId
  22989. c.creativefield = creativefield
  22990. return c
  22991. }
  22992. // Fields allows partial responses to be retrieved. See
  22993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22994. // for more information.
  22995. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  22996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22997. return c
  22998. }
  22999. // Context sets the context to be used in this call's Do method. Any
  23000. // pending HTTP request will be aborted if the provided context is
  23001. // canceled.
  23002. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  23003. c.ctx_ = ctx
  23004. return c
  23005. }
  23006. // Header returns an http.Header that can be modified by the caller to
  23007. // add HTTP headers to the request.
  23008. func (c *CreativeFieldsInsertCall) Header() http.Header {
  23009. if c.header_ == nil {
  23010. c.header_ = make(http.Header)
  23011. }
  23012. return c.header_
  23013. }
  23014. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  23015. reqHeaders := make(http.Header)
  23016. for k, v := range c.header_ {
  23017. reqHeaders[k] = v
  23018. }
  23019. reqHeaders.Set("User-Agent", c.s.userAgent())
  23020. var body io.Reader = nil
  23021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23022. if err != nil {
  23023. return nil, err
  23024. }
  23025. reqHeaders.Set("Content-Type", "application/json")
  23026. c.urlParams_.Set("alt", alt)
  23027. c.urlParams_.Set("prettyPrint", "false")
  23028. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23029. urls += "?" + c.urlParams_.Encode()
  23030. req, err := http.NewRequest("POST", urls, body)
  23031. if err != nil {
  23032. return nil, err
  23033. }
  23034. req.Header = reqHeaders
  23035. googleapi.Expand(req.URL, map[string]string{
  23036. "profileId": strconv.FormatInt(c.profileId, 10),
  23037. })
  23038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23039. }
  23040. // Do executes the "dfareporting.creativeFields.insert" call.
  23041. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23042. // status code is an error. Response headers are in either
  23043. // *CreativeField.ServerResponse.Header or (if a response was returned
  23044. // at all) in error.(*googleapi.Error).Header. Use
  23045. // googleapi.IsNotModified to check whether the returned error was
  23046. // because http.StatusNotModified was returned.
  23047. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23048. gensupport.SetOptions(c.urlParams_, opts...)
  23049. res, err := c.doRequest("json")
  23050. if res != nil && res.StatusCode == http.StatusNotModified {
  23051. if res.Body != nil {
  23052. res.Body.Close()
  23053. }
  23054. return nil, &googleapi.Error{
  23055. Code: res.StatusCode,
  23056. Header: res.Header,
  23057. }
  23058. }
  23059. if err != nil {
  23060. return nil, err
  23061. }
  23062. defer googleapi.CloseBody(res)
  23063. if err := googleapi.CheckResponse(res); err != nil {
  23064. return nil, err
  23065. }
  23066. ret := &CreativeField{
  23067. ServerResponse: googleapi.ServerResponse{
  23068. Header: res.Header,
  23069. HTTPStatusCode: res.StatusCode,
  23070. },
  23071. }
  23072. target := &ret
  23073. if err := gensupport.DecodeResponse(target, res); err != nil {
  23074. return nil, err
  23075. }
  23076. return ret, nil
  23077. // {
  23078. // "description": "Inserts a new creative field.",
  23079. // "httpMethod": "POST",
  23080. // "id": "dfareporting.creativeFields.insert",
  23081. // "parameterOrder": [
  23082. // "profileId"
  23083. // ],
  23084. // "parameters": {
  23085. // "profileId": {
  23086. // "description": "User profile ID associated with this request.",
  23087. // "format": "int64",
  23088. // "location": "path",
  23089. // "required": true,
  23090. // "type": "string"
  23091. // }
  23092. // },
  23093. // "path": "userprofiles/{profileId}/creativeFields",
  23094. // "request": {
  23095. // "$ref": "CreativeField"
  23096. // },
  23097. // "response": {
  23098. // "$ref": "CreativeField"
  23099. // },
  23100. // "scopes": [
  23101. // "https://www.googleapis.com/auth/dfatrafficking"
  23102. // ]
  23103. // }
  23104. }
  23105. // method id "dfareporting.creativeFields.list":
  23106. type CreativeFieldsListCall struct {
  23107. s *Service
  23108. profileId int64
  23109. urlParams_ gensupport.URLParams
  23110. ifNoneMatch_ string
  23111. ctx_ context.Context
  23112. header_ http.Header
  23113. }
  23114. // List: Retrieves a list of creative fields, possibly filtered. This
  23115. // method supports paging.
  23116. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  23117. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23118. c.profileId = profileId
  23119. return c
  23120. }
  23121. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23122. // only creative fields that belong to these advertisers.
  23123. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  23124. var advertiserIds_ []string
  23125. for _, v := range advertiserIds {
  23126. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23127. }
  23128. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23129. return c
  23130. }
  23131. // Ids sets the optional parameter "ids": Select only creative fields
  23132. // with these IDs.
  23133. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  23134. var ids_ []string
  23135. for _, v := range ids {
  23136. ids_ = append(ids_, fmt.Sprint(v))
  23137. }
  23138. c.urlParams_.SetMulti("ids", ids_)
  23139. return c
  23140. }
  23141. // MaxResults sets the optional parameter "maxResults": Maximum number
  23142. // of results to return.
  23143. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  23144. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23145. return c
  23146. }
  23147. // PageToken sets the optional parameter "pageToken": Value of the
  23148. // nextPageToken from the previous result page.
  23149. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  23150. c.urlParams_.Set("pageToken", pageToken)
  23151. return c
  23152. }
  23153. // SearchString sets the optional parameter "searchString": Allows
  23154. // searching for creative fields by name or ID. Wildcards (*) are
  23155. // allowed. For example, "creativefield*2015" will return creative
  23156. // fields with names like "creativefield June 2015", "creativefield
  23157. // April 2015", or simply "creativefield 2015". Most of the searches
  23158. // also add wild-cards implicitly at the start and the end of the search
  23159. // string. For example, a search string of "creativefield" will match
  23160. // creative fields with the name "my creativefield", "creativefield
  23161. // 2015", or simply "creativefield".
  23162. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  23163. c.urlParams_.Set("searchString", searchString)
  23164. return c
  23165. }
  23166. // SortField sets the optional parameter "sortField": Field by which to
  23167. // sort the list.
  23168. //
  23169. // Possible values:
  23170. // "ID" (default)
  23171. // "NAME"
  23172. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  23173. c.urlParams_.Set("sortField", sortField)
  23174. return c
  23175. }
  23176. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23177. // results.
  23178. //
  23179. // Possible values:
  23180. // "ASCENDING" (default)
  23181. // "DESCENDING"
  23182. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  23183. c.urlParams_.Set("sortOrder", sortOrder)
  23184. return c
  23185. }
  23186. // Fields allows partial responses to be retrieved. See
  23187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23188. // for more information.
  23189. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  23190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23191. return c
  23192. }
  23193. // IfNoneMatch sets the optional parameter which makes the operation
  23194. // fail if the object's ETag matches the given value. This is useful for
  23195. // getting updates only after the object has changed since the last
  23196. // request. Use googleapi.IsNotModified to check whether the response
  23197. // error from Do is the result of In-None-Match.
  23198. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  23199. c.ifNoneMatch_ = entityTag
  23200. return c
  23201. }
  23202. // Context sets the context to be used in this call's Do method. Any
  23203. // pending HTTP request will be aborted if the provided context is
  23204. // canceled.
  23205. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  23206. c.ctx_ = ctx
  23207. return c
  23208. }
  23209. // Header returns an http.Header that can be modified by the caller to
  23210. // add HTTP headers to the request.
  23211. func (c *CreativeFieldsListCall) Header() http.Header {
  23212. if c.header_ == nil {
  23213. c.header_ = make(http.Header)
  23214. }
  23215. return c.header_
  23216. }
  23217. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  23218. reqHeaders := make(http.Header)
  23219. for k, v := range c.header_ {
  23220. reqHeaders[k] = v
  23221. }
  23222. reqHeaders.Set("User-Agent", c.s.userAgent())
  23223. if c.ifNoneMatch_ != "" {
  23224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23225. }
  23226. var body io.Reader = nil
  23227. c.urlParams_.Set("alt", alt)
  23228. c.urlParams_.Set("prettyPrint", "false")
  23229. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23230. urls += "?" + c.urlParams_.Encode()
  23231. req, err := http.NewRequest("GET", urls, body)
  23232. if err != nil {
  23233. return nil, err
  23234. }
  23235. req.Header = reqHeaders
  23236. googleapi.Expand(req.URL, map[string]string{
  23237. "profileId": strconv.FormatInt(c.profileId, 10),
  23238. })
  23239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23240. }
  23241. // Do executes the "dfareporting.creativeFields.list" call.
  23242. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  23243. // Any non-2xx status code is an error. Response headers are in either
  23244. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  23245. // was returned at all) in error.(*googleapi.Error).Header. Use
  23246. // googleapi.IsNotModified to check whether the returned error was
  23247. // because http.StatusNotModified was returned.
  23248. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  23249. gensupport.SetOptions(c.urlParams_, opts...)
  23250. res, err := c.doRequest("json")
  23251. if res != nil && res.StatusCode == http.StatusNotModified {
  23252. if res.Body != nil {
  23253. res.Body.Close()
  23254. }
  23255. return nil, &googleapi.Error{
  23256. Code: res.StatusCode,
  23257. Header: res.Header,
  23258. }
  23259. }
  23260. if err != nil {
  23261. return nil, err
  23262. }
  23263. defer googleapi.CloseBody(res)
  23264. if err := googleapi.CheckResponse(res); err != nil {
  23265. return nil, err
  23266. }
  23267. ret := &CreativeFieldsListResponse{
  23268. ServerResponse: googleapi.ServerResponse{
  23269. Header: res.Header,
  23270. HTTPStatusCode: res.StatusCode,
  23271. },
  23272. }
  23273. target := &ret
  23274. if err := gensupport.DecodeResponse(target, res); err != nil {
  23275. return nil, err
  23276. }
  23277. return ret, nil
  23278. // {
  23279. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  23280. // "httpMethod": "GET",
  23281. // "id": "dfareporting.creativeFields.list",
  23282. // "parameterOrder": [
  23283. // "profileId"
  23284. // ],
  23285. // "parameters": {
  23286. // "advertiserIds": {
  23287. // "description": "Select only creative fields that belong to these advertisers.",
  23288. // "format": "int64",
  23289. // "location": "query",
  23290. // "repeated": true,
  23291. // "type": "string"
  23292. // },
  23293. // "ids": {
  23294. // "description": "Select only creative fields with these IDs.",
  23295. // "format": "int64",
  23296. // "location": "query",
  23297. // "repeated": true,
  23298. // "type": "string"
  23299. // },
  23300. // "maxResults": {
  23301. // "default": "1000",
  23302. // "description": "Maximum number of results to return.",
  23303. // "format": "int32",
  23304. // "location": "query",
  23305. // "maximum": "1000",
  23306. // "minimum": "0",
  23307. // "type": "integer"
  23308. // },
  23309. // "pageToken": {
  23310. // "description": "Value of the nextPageToken from the previous result page.",
  23311. // "location": "query",
  23312. // "type": "string"
  23313. // },
  23314. // "profileId": {
  23315. // "description": "User profile ID associated with this request.",
  23316. // "format": "int64",
  23317. // "location": "path",
  23318. // "required": true,
  23319. // "type": "string"
  23320. // },
  23321. // "searchString": {
  23322. // "description": "Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, \"creativefield*2015\" will return creative fields with names like \"creativefield June 2015\", \"creativefield April 2015\", or simply \"creativefield 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativefield\" will match creative fields with the name \"my creativefield\", \"creativefield 2015\", or simply \"creativefield\".",
  23323. // "location": "query",
  23324. // "type": "string"
  23325. // },
  23326. // "sortField": {
  23327. // "default": "ID",
  23328. // "description": "Field by which to sort the list.",
  23329. // "enum": [
  23330. // "ID",
  23331. // "NAME"
  23332. // ],
  23333. // "enumDescriptions": [
  23334. // "",
  23335. // ""
  23336. // ],
  23337. // "location": "query",
  23338. // "type": "string"
  23339. // },
  23340. // "sortOrder": {
  23341. // "default": "ASCENDING",
  23342. // "description": "Order of sorted results.",
  23343. // "enum": [
  23344. // "ASCENDING",
  23345. // "DESCENDING"
  23346. // ],
  23347. // "enumDescriptions": [
  23348. // "",
  23349. // ""
  23350. // ],
  23351. // "location": "query",
  23352. // "type": "string"
  23353. // }
  23354. // },
  23355. // "path": "userprofiles/{profileId}/creativeFields",
  23356. // "response": {
  23357. // "$ref": "CreativeFieldsListResponse"
  23358. // },
  23359. // "scopes": [
  23360. // "https://www.googleapis.com/auth/dfatrafficking"
  23361. // ]
  23362. // }
  23363. }
  23364. // Pages invokes f for each page of results.
  23365. // A non-nil error returned from f will halt the iteration.
  23366. // The provided context supersedes any context provided to the Context method.
  23367. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23368. c.ctx_ = ctx
  23369. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23370. for {
  23371. x, err := c.Do()
  23372. if err != nil {
  23373. return err
  23374. }
  23375. if err := f(x); err != nil {
  23376. return err
  23377. }
  23378. if x.NextPageToken == "" {
  23379. return nil
  23380. }
  23381. c.PageToken(x.NextPageToken)
  23382. }
  23383. }
  23384. // method id "dfareporting.creativeFields.patch":
  23385. type CreativeFieldsPatchCall struct {
  23386. s *Service
  23387. profileId int64
  23388. creativefield *CreativeField
  23389. urlParams_ gensupport.URLParams
  23390. ctx_ context.Context
  23391. header_ http.Header
  23392. }
  23393. // Patch: Updates an existing creative field. This method supports patch
  23394. // semantics.
  23395. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23396. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23397. c.profileId = profileId
  23398. c.urlParams_.Set("id", fmt.Sprint(id))
  23399. c.creativefield = creativefield
  23400. return c
  23401. }
  23402. // Fields allows partial responses to be retrieved. See
  23403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23404. // for more information.
  23405. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23407. return c
  23408. }
  23409. // Context sets the context to be used in this call's Do method. Any
  23410. // pending HTTP request will be aborted if the provided context is
  23411. // canceled.
  23412. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23413. c.ctx_ = ctx
  23414. return c
  23415. }
  23416. // Header returns an http.Header that can be modified by the caller to
  23417. // add HTTP headers to the request.
  23418. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23419. if c.header_ == nil {
  23420. c.header_ = make(http.Header)
  23421. }
  23422. return c.header_
  23423. }
  23424. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23425. reqHeaders := make(http.Header)
  23426. for k, v := range c.header_ {
  23427. reqHeaders[k] = v
  23428. }
  23429. reqHeaders.Set("User-Agent", c.s.userAgent())
  23430. var body io.Reader = nil
  23431. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23432. if err != nil {
  23433. return nil, err
  23434. }
  23435. reqHeaders.Set("Content-Type", "application/json")
  23436. c.urlParams_.Set("alt", alt)
  23437. c.urlParams_.Set("prettyPrint", "false")
  23438. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23439. urls += "?" + c.urlParams_.Encode()
  23440. req, err := http.NewRequest("PATCH", urls, body)
  23441. if err != nil {
  23442. return nil, err
  23443. }
  23444. req.Header = reqHeaders
  23445. googleapi.Expand(req.URL, map[string]string{
  23446. "profileId": strconv.FormatInt(c.profileId, 10),
  23447. })
  23448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23449. }
  23450. // Do executes the "dfareporting.creativeFields.patch" call.
  23451. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23452. // status code is an error. Response headers are in either
  23453. // *CreativeField.ServerResponse.Header or (if a response was returned
  23454. // at all) in error.(*googleapi.Error).Header. Use
  23455. // googleapi.IsNotModified to check whether the returned error was
  23456. // because http.StatusNotModified was returned.
  23457. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23458. gensupport.SetOptions(c.urlParams_, opts...)
  23459. res, err := c.doRequest("json")
  23460. if res != nil && res.StatusCode == http.StatusNotModified {
  23461. if res.Body != nil {
  23462. res.Body.Close()
  23463. }
  23464. return nil, &googleapi.Error{
  23465. Code: res.StatusCode,
  23466. Header: res.Header,
  23467. }
  23468. }
  23469. if err != nil {
  23470. return nil, err
  23471. }
  23472. defer googleapi.CloseBody(res)
  23473. if err := googleapi.CheckResponse(res); err != nil {
  23474. return nil, err
  23475. }
  23476. ret := &CreativeField{
  23477. ServerResponse: googleapi.ServerResponse{
  23478. Header: res.Header,
  23479. HTTPStatusCode: res.StatusCode,
  23480. },
  23481. }
  23482. target := &ret
  23483. if err := gensupport.DecodeResponse(target, res); err != nil {
  23484. return nil, err
  23485. }
  23486. return ret, nil
  23487. // {
  23488. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23489. // "httpMethod": "PATCH",
  23490. // "id": "dfareporting.creativeFields.patch",
  23491. // "parameterOrder": [
  23492. // "profileId",
  23493. // "id"
  23494. // ],
  23495. // "parameters": {
  23496. // "id": {
  23497. // "description": "Creative Field ID",
  23498. // "format": "int64",
  23499. // "location": "query",
  23500. // "required": true,
  23501. // "type": "string"
  23502. // },
  23503. // "profileId": {
  23504. // "description": "User profile ID associated with this request.",
  23505. // "format": "int64",
  23506. // "location": "path",
  23507. // "required": true,
  23508. // "type": "string"
  23509. // }
  23510. // },
  23511. // "path": "userprofiles/{profileId}/creativeFields",
  23512. // "request": {
  23513. // "$ref": "CreativeField"
  23514. // },
  23515. // "response": {
  23516. // "$ref": "CreativeField"
  23517. // },
  23518. // "scopes": [
  23519. // "https://www.googleapis.com/auth/dfatrafficking"
  23520. // ]
  23521. // }
  23522. }
  23523. // method id "dfareporting.creativeFields.update":
  23524. type CreativeFieldsUpdateCall struct {
  23525. s *Service
  23526. profileId int64
  23527. creativefield *CreativeField
  23528. urlParams_ gensupport.URLParams
  23529. ctx_ context.Context
  23530. header_ http.Header
  23531. }
  23532. // Update: Updates an existing creative field.
  23533. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23534. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23535. c.profileId = profileId
  23536. c.creativefield = creativefield
  23537. return c
  23538. }
  23539. // Fields allows partial responses to be retrieved. See
  23540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23541. // for more information.
  23542. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23544. return c
  23545. }
  23546. // Context sets the context to be used in this call's Do method. Any
  23547. // pending HTTP request will be aborted if the provided context is
  23548. // canceled.
  23549. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23550. c.ctx_ = ctx
  23551. return c
  23552. }
  23553. // Header returns an http.Header that can be modified by the caller to
  23554. // add HTTP headers to the request.
  23555. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23556. if c.header_ == nil {
  23557. c.header_ = make(http.Header)
  23558. }
  23559. return c.header_
  23560. }
  23561. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23562. reqHeaders := make(http.Header)
  23563. for k, v := range c.header_ {
  23564. reqHeaders[k] = v
  23565. }
  23566. reqHeaders.Set("User-Agent", c.s.userAgent())
  23567. var body io.Reader = nil
  23568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23569. if err != nil {
  23570. return nil, err
  23571. }
  23572. reqHeaders.Set("Content-Type", "application/json")
  23573. c.urlParams_.Set("alt", alt)
  23574. c.urlParams_.Set("prettyPrint", "false")
  23575. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23576. urls += "?" + c.urlParams_.Encode()
  23577. req, err := http.NewRequest("PUT", urls, body)
  23578. if err != nil {
  23579. return nil, err
  23580. }
  23581. req.Header = reqHeaders
  23582. googleapi.Expand(req.URL, map[string]string{
  23583. "profileId": strconv.FormatInt(c.profileId, 10),
  23584. })
  23585. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23586. }
  23587. // Do executes the "dfareporting.creativeFields.update" call.
  23588. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23589. // status code is an error. Response headers are in either
  23590. // *CreativeField.ServerResponse.Header or (if a response was returned
  23591. // at all) in error.(*googleapi.Error).Header. Use
  23592. // googleapi.IsNotModified to check whether the returned error was
  23593. // because http.StatusNotModified was returned.
  23594. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23595. gensupport.SetOptions(c.urlParams_, opts...)
  23596. res, err := c.doRequest("json")
  23597. if res != nil && res.StatusCode == http.StatusNotModified {
  23598. if res.Body != nil {
  23599. res.Body.Close()
  23600. }
  23601. return nil, &googleapi.Error{
  23602. Code: res.StatusCode,
  23603. Header: res.Header,
  23604. }
  23605. }
  23606. if err != nil {
  23607. return nil, err
  23608. }
  23609. defer googleapi.CloseBody(res)
  23610. if err := googleapi.CheckResponse(res); err != nil {
  23611. return nil, err
  23612. }
  23613. ret := &CreativeField{
  23614. ServerResponse: googleapi.ServerResponse{
  23615. Header: res.Header,
  23616. HTTPStatusCode: res.StatusCode,
  23617. },
  23618. }
  23619. target := &ret
  23620. if err := gensupport.DecodeResponse(target, res); err != nil {
  23621. return nil, err
  23622. }
  23623. return ret, nil
  23624. // {
  23625. // "description": "Updates an existing creative field.",
  23626. // "httpMethod": "PUT",
  23627. // "id": "dfareporting.creativeFields.update",
  23628. // "parameterOrder": [
  23629. // "profileId"
  23630. // ],
  23631. // "parameters": {
  23632. // "profileId": {
  23633. // "description": "User profile ID associated with this request.",
  23634. // "format": "int64",
  23635. // "location": "path",
  23636. // "required": true,
  23637. // "type": "string"
  23638. // }
  23639. // },
  23640. // "path": "userprofiles/{profileId}/creativeFields",
  23641. // "request": {
  23642. // "$ref": "CreativeField"
  23643. // },
  23644. // "response": {
  23645. // "$ref": "CreativeField"
  23646. // },
  23647. // "scopes": [
  23648. // "https://www.googleapis.com/auth/dfatrafficking"
  23649. // ]
  23650. // }
  23651. }
  23652. // method id "dfareporting.creativeGroups.get":
  23653. type CreativeGroupsGetCall struct {
  23654. s *Service
  23655. profileId int64
  23656. id int64
  23657. urlParams_ gensupport.URLParams
  23658. ifNoneMatch_ string
  23659. ctx_ context.Context
  23660. header_ http.Header
  23661. }
  23662. // Get: Gets one creative group by ID.
  23663. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23664. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23665. c.profileId = profileId
  23666. c.id = id
  23667. return c
  23668. }
  23669. // Fields allows partial responses to be retrieved. See
  23670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23671. // for more information.
  23672. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  23673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23674. return c
  23675. }
  23676. // IfNoneMatch sets the optional parameter which makes the operation
  23677. // fail if the object's ETag matches the given value. This is useful for
  23678. // getting updates only after the object has changed since the last
  23679. // request. Use googleapi.IsNotModified to check whether the response
  23680. // error from Do is the result of In-None-Match.
  23681. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  23682. c.ifNoneMatch_ = entityTag
  23683. return c
  23684. }
  23685. // Context sets the context to be used in this call's Do method. Any
  23686. // pending HTTP request will be aborted if the provided context is
  23687. // canceled.
  23688. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  23689. c.ctx_ = ctx
  23690. return c
  23691. }
  23692. // Header returns an http.Header that can be modified by the caller to
  23693. // add HTTP headers to the request.
  23694. func (c *CreativeGroupsGetCall) Header() http.Header {
  23695. if c.header_ == nil {
  23696. c.header_ = make(http.Header)
  23697. }
  23698. return c.header_
  23699. }
  23700. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  23701. reqHeaders := make(http.Header)
  23702. for k, v := range c.header_ {
  23703. reqHeaders[k] = v
  23704. }
  23705. reqHeaders.Set("User-Agent", c.s.userAgent())
  23706. if c.ifNoneMatch_ != "" {
  23707. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23708. }
  23709. var body io.Reader = nil
  23710. c.urlParams_.Set("alt", alt)
  23711. c.urlParams_.Set("prettyPrint", "false")
  23712. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23713. urls += "?" + c.urlParams_.Encode()
  23714. req, err := http.NewRequest("GET", urls, body)
  23715. if err != nil {
  23716. return nil, err
  23717. }
  23718. req.Header = reqHeaders
  23719. googleapi.Expand(req.URL, map[string]string{
  23720. "profileId": strconv.FormatInt(c.profileId, 10),
  23721. "id": strconv.FormatInt(c.id, 10),
  23722. })
  23723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23724. }
  23725. // Do executes the "dfareporting.creativeGroups.get" call.
  23726. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23727. // status code is an error. Response headers are in either
  23728. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23729. // at all) in error.(*googleapi.Error).Header. Use
  23730. // googleapi.IsNotModified to check whether the returned error was
  23731. // because http.StatusNotModified was returned.
  23732. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23733. gensupport.SetOptions(c.urlParams_, opts...)
  23734. res, err := c.doRequest("json")
  23735. if res != nil && res.StatusCode == http.StatusNotModified {
  23736. if res.Body != nil {
  23737. res.Body.Close()
  23738. }
  23739. return nil, &googleapi.Error{
  23740. Code: res.StatusCode,
  23741. Header: res.Header,
  23742. }
  23743. }
  23744. if err != nil {
  23745. return nil, err
  23746. }
  23747. defer googleapi.CloseBody(res)
  23748. if err := googleapi.CheckResponse(res); err != nil {
  23749. return nil, err
  23750. }
  23751. ret := &CreativeGroup{
  23752. ServerResponse: googleapi.ServerResponse{
  23753. Header: res.Header,
  23754. HTTPStatusCode: res.StatusCode,
  23755. },
  23756. }
  23757. target := &ret
  23758. if err := gensupport.DecodeResponse(target, res); err != nil {
  23759. return nil, err
  23760. }
  23761. return ret, nil
  23762. // {
  23763. // "description": "Gets one creative group by ID.",
  23764. // "httpMethod": "GET",
  23765. // "id": "dfareporting.creativeGroups.get",
  23766. // "parameterOrder": [
  23767. // "profileId",
  23768. // "id"
  23769. // ],
  23770. // "parameters": {
  23771. // "id": {
  23772. // "description": "Creative group ID.",
  23773. // "format": "int64",
  23774. // "location": "path",
  23775. // "required": true,
  23776. // "type": "string"
  23777. // },
  23778. // "profileId": {
  23779. // "description": "User profile ID associated with this request.",
  23780. // "format": "int64",
  23781. // "location": "path",
  23782. // "required": true,
  23783. // "type": "string"
  23784. // }
  23785. // },
  23786. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  23787. // "response": {
  23788. // "$ref": "CreativeGroup"
  23789. // },
  23790. // "scopes": [
  23791. // "https://www.googleapis.com/auth/dfatrafficking"
  23792. // ]
  23793. // }
  23794. }
  23795. // method id "dfareporting.creativeGroups.insert":
  23796. type CreativeGroupsInsertCall struct {
  23797. s *Service
  23798. profileId int64
  23799. creativegroup *CreativeGroup
  23800. urlParams_ gensupport.URLParams
  23801. ctx_ context.Context
  23802. header_ http.Header
  23803. }
  23804. // Insert: Inserts a new creative group.
  23805. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  23806. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23807. c.profileId = profileId
  23808. c.creativegroup = creativegroup
  23809. return c
  23810. }
  23811. // Fields allows partial responses to be retrieved. See
  23812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23813. // for more information.
  23814. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  23815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23816. return c
  23817. }
  23818. // Context sets the context to be used in this call's Do method. Any
  23819. // pending HTTP request will be aborted if the provided context is
  23820. // canceled.
  23821. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  23822. c.ctx_ = ctx
  23823. return c
  23824. }
  23825. // Header returns an http.Header that can be modified by the caller to
  23826. // add HTTP headers to the request.
  23827. func (c *CreativeGroupsInsertCall) Header() http.Header {
  23828. if c.header_ == nil {
  23829. c.header_ = make(http.Header)
  23830. }
  23831. return c.header_
  23832. }
  23833. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  23834. reqHeaders := make(http.Header)
  23835. for k, v := range c.header_ {
  23836. reqHeaders[k] = v
  23837. }
  23838. reqHeaders.Set("User-Agent", c.s.userAgent())
  23839. var body io.Reader = nil
  23840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  23841. if err != nil {
  23842. return nil, err
  23843. }
  23844. reqHeaders.Set("Content-Type", "application/json")
  23845. c.urlParams_.Set("alt", alt)
  23846. c.urlParams_.Set("prettyPrint", "false")
  23847. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23848. urls += "?" + c.urlParams_.Encode()
  23849. req, err := http.NewRequest("POST", urls, body)
  23850. if err != nil {
  23851. return nil, err
  23852. }
  23853. req.Header = reqHeaders
  23854. googleapi.Expand(req.URL, map[string]string{
  23855. "profileId": strconv.FormatInt(c.profileId, 10),
  23856. })
  23857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23858. }
  23859. // Do executes the "dfareporting.creativeGroups.insert" call.
  23860. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23861. // status code is an error. Response headers are in either
  23862. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23863. // at all) in error.(*googleapi.Error).Header. Use
  23864. // googleapi.IsNotModified to check whether the returned error was
  23865. // because http.StatusNotModified was returned.
  23866. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23867. gensupport.SetOptions(c.urlParams_, opts...)
  23868. res, err := c.doRequest("json")
  23869. if res != nil && res.StatusCode == http.StatusNotModified {
  23870. if res.Body != nil {
  23871. res.Body.Close()
  23872. }
  23873. return nil, &googleapi.Error{
  23874. Code: res.StatusCode,
  23875. Header: res.Header,
  23876. }
  23877. }
  23878. if err != nil {
  23879. return nil, err
  23880. }
  23881. defer googleapi.CloseBody(res)
  23882. if err := googleapi.CheckResponse(res); err != nil {
  23883. return nil, err
  23884. }
  23885. ret := &CreativeGroup{
  23886. ServerResponse: googleapi.ServerResponse{
  23887. Header: res.Header,
  23888. HTTPStatusCode: res.StatusCode,
  23889. },
  23890. }
  23891. target := &ret
  23892. if err := gensupport.DecodeResponse(target, res); err != nil {
  23893. return nil, err
  23894. }
  23895. return ret, nil
  23896. // {
  23897. // "description": "Inserts a new creative group.",
  23898. // "httpMethod": "POST",
  23899. // "id": "dfareporting.creativeGroups.insert",
  23900. // "parameterOrder": [
  23901. // "profileId"
  23902. // ],
  23903. // "parameters": {
  23904. // "profileId": {
  23905. // "description": "User profile ID associated with this request.",
  23906. // "format": "int64",
  23907. // "location": "path",
  23908. // "required": true,
  23909. // "type": "string"
  23910. // }
  23911. // },
  23912. // "path": "userprofiles/{profileId}/creativeGroups",
  23913. // "request": {
  23914. // "$ref": "CreativeGroup"
  23915. // },
  23916. // "response": {
  23917. // "$ref": "CreativeGroup"
  23918. // },
  23919. // "scopes": [
  23920. // "https://www.googleapis.com/auth/dfatrafficking"
  23921. // ]
  23922. // }
  23923. }
  23924. // method id "dfareporting.creativeGroups.list":
  23925. type CreativeGroupsListCall struct {
  23926. s *Service
  23927. profileId int64
  23928. urlParams_ gensupport.URLParams
  23929. ifNoneMatch_ string
  23930. ctx_ context.Context
  23931. header_ http.Header
  23932. }
  23933. // List: Retrieves a list of creative groups, possibly filtered. This
  23934. // method supports paging.
  23935. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  23936. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23937. c.profileId = profileId
  23938. return c
  23939. }
  23940. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23941. // only creative groups that belong to these advertisers.
  23942. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  23943. var advertiserIds_ []string
  23944. for _, v := range advertiserIds {
  23945. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23946. }
  23947. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23948. return c
  23949. }
  23950. // GroupNumber sets the optional parameter "groupNumber": Select only
  23951. // creative groups that belong to this subgroup.
  23952. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  23953. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  23954. return c
  23955. }
  23956. // Ids sets the optional parameter "ids": Select only creative groups
  23957. // with these IDs.
  23958. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  23959. var ids_ []string
  23960. for _, v := range ids {
  23961. ids_ = append(ids_, fmt.Sprint(v))
  23962. }
  23963. c.urlParams_.SetMulti("ids", ids_)
  23964. return c
  23965. }
  23966. // MaxResults sets the optional parameter "maxResults": Maximum number
  23967. // of results to return.
  23968. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  23969. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23970. return c
  23971. }
  23972. // PageToken sets the optional parameter "pageToken": Value of the
  23973. // nextPageToken from the previous result page.
  23974. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  23975. c.urlParams_.Set("pageToken", pageToken)
  23976. return c
  23977. }
  23978. // SearchString sets the optional parameter "searchString": Allows
  23979. // searching for creative groups by name or ID. Wildcards (*) are
  23980. // allowed. For example, "creativegroup*2015" will return creative
  23981. // groups with names like "creativegroup June 2015", "creativegroup
  23982. // April 2015", or simply "creativegroup 2015". Most of the searches
  23983. // also add wild-cards implicitly at the start and the end of the search
  23984. // string. For example, a search string of "creativegroup" will match
  23985. // creative groups with the name "my creativegroup", "creativegroup
  23986. // 2015", or simply "creativegroup".
  23987. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  23988. c.urlParams_.Set("searchString", searchString)
  23989. return c
  23990. }
  23991. // SortField sets the optional parameter "sortField": Field by which to
  23992. // sort the list.
  23993. //
  23994. // Possible values:
  23995. // "ID" (default)
  23996. // "NAME"
  23997. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  23998. c.urlParams_.Set("sortField", sortField)
  23999. return c
  24000. }
  24001. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24002. // results.
  24003. //
  24004. // Possible values:
  24005. // "ASCENDING" (default)
  24006. // "DESCENDING"
  24007. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  24008. c.urlParams_.Set("sortOrder", sortOrder)
  24009. return c
  24010. }
  24011. // Fields allows partial responses to be retrieved. See
  24012. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24013. // for more information.
  24014. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  24015. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24016. return c
  24017. }
  24018. // IfNoneMatch sets the optional parameter which makes the operation
  24019. // fail if the object's ETag matches the given value. This is useful for
  24020. // getting updates only after the object has changed since the last
  24021. // request. Use googleapi.IsNotModified to check whether the response
  24022. // error from Do is the result of In-None-Match.
  24023. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  24024. c.ifNoneMatch_ = entityTag
  24025. return c
  24026. }
  24027. // Context sets the context to be used in this call's Do method. Any
  24028. // pending HTTP request will be aborted if the provided context is
  24029. // canceled.
  24030. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  24031. c.ctx_ = ctx
  24032. return c
  24033. }
  24034. // Header returns an http.Header that can be modified by the caller to
  24035. // add HTTP headers to the request.
  24036. func (c *CreativeGroupsListCall) Header() http.Header {
  24037. if c.header_ == nil {
  24038. c.header_ = make(http.Header)
  24039. }
  24040. return c.header_
  24041. }
  24042. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  24043. reqHeaders := make(http.Header)
  24044. for k, v := range c.header_ {
  24045. reqHeaders[k] = v
  24046. }
  24047. reqHeaders.Set("User-Agent", c.s.userAgent())
  24048. if c.ifNoneMatch_ != "" {
  24049. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24050. }
  24051. var body io.Reader = nil
  24052. c.urlParams_.Set("alt", alt)
  24053. c.urlParams_.Set("prettyPrint", "false")
  24054. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24055. urls += "?" + c.urlParams_.Encode()
  24056. req, err := http.NewRequest("GET", urls, body)
  24057. if err != nil {
  24058. return nil, err
  24059. }
  24060. req.Header = reqHeaders
  24061. googleapi.Expand(req.URL, map[string]string{
  24062. "profileId": strconv.FormatInt(c.profileId, 10),
  24063. })
  24064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24065. }
  24066. // Do executes the "dfareporting.creativeGroups.list" call.
  24067. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  24068. // Any non-2xx status code is an error. Response headers are in either
  24069. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  24070. // was returned at all) in error.(*googleapi.Error).Header. Use
  24071. // googleapi.IsNotModified to check whether the returned error was
  24072. // because http.StatusNotModified was returned.
  24073. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  24074. gensupport.SetOptions(c.urlParams_, opts...)
  24075. res, err := c.doRequest("json")
  24076. if res != nil && res.StatusCode == http.StatusNotModified {
  24077. if res.Body != nil {
  24078. res.Body.Close()
  24079. }
  24080. return nil, &googleapi.Error{
  24081. Code: res.StatusCode,
  24082. Header: res.Header,
  24083. }
  24084. }
  24085. if err != nil {
  24086. return nil, err
  24087. }
  24088. defer googleapi.CloseBody(res)
  24089. if err := googleapi.CheckResponse(res); err != nil {
  24090. return nil, err
  24091. }
  24092. ret := &CreativeGroupsListResponse{
  24093. ServerResponse: googleapi.ServerResponse{
  24094. Header: res.Header,
  24095. HTTPStatusCode: res.StatusCode,
  24096. },
  24097. }
  24098. target := &ret
  24099. if err := gensupport.DecodeResponse(target, res); err != nil {
  24100. return nil, err
  24101. }
  24102. return ret, nil
  24103. // {
  24104. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  24105. // "httpMethod": "GET",
  24106. // "id": "dfareporting.creativeGroups.list",
  24107. // "parameterOrder": [
  24108. // "profileId"
  24109. // ],
  24110. // "parameters": {
  24111. // "advertiserIds": {
  24112. // "description": "Select only creative groups that belong to these advertisers.",
  24113. // "format": "int64",
  24114. // "location": "query",
  24115. // "repeated": true,
  24116. // "type": "string"
  24117. // },
  24118. // "groupNumber": {
  24119. // "description": "Select only creative groups that belong to this subgroup.",
  24120. // "format": "int32",
  24121. // "location": "query",
  24122. // "maximum": "2",
  24123. // "minimum": "1",
  24124. // "type": "integer"
  24125. // },
  24126. // "ids": {
  24127. // "description": "Select only creative groups with these IDs.",
  24128. // "format": "int64",
  24129. // "location": "query",
  24130. // "repeated": true,
  24131. // "type": "string"
  24132. // },
  24133. // "maxResults": {
  24134. // "default": "1000",
  24135. // "description": "Maximum number of results to return.",
  24136. // "format": "int32",
  24137. // "location": "query",
  24138. // "maximum": "1000",
  24139. // "minimum": "0",
  24140. // "type": "integer"
  24141. // },
  24142. // "pageToken": {
  24143. // "description": "Value of the nextPageToken from the previous result page.",
  24144. // "location": "query",
  24145. // "type": "string"
  24146. // },
  24147. // "profileId": {
  24148. // "description": "User profile ID associated with this request.",
  24149. // "format": "int64",
  24150. // "location": "path",
  24151. // "required": true,
  24152. // "type": "string"
  24153. // },
  24154. // "searchString": {
  24155. // "description": "Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, \"creativegroup*2015\" will return creative groups with names like \"creativegroup June 2015\", \"creativegroup April 2015\", or simply \"creativegroup 2015\". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of \"creativegroup\" will match creative groups with the name \"my creativegroup\", \"creativegroup 2015\", or simply \"creativegroup\".",
  24156. // "location": "query",
  24157. // "type": "string"
  24158. // },
  24159. // "sortField": {
  24160. // "default": "ID",
  24161. // "description": "Field by which to sort the list.",
  24162. // "enum": [
  24163. // "ID",
  24164. // "NAME"
  24165. // ],
  24166. // "enumDescriptions": [
  24167. // "",
  24168. // ""
  24169. // ],
  24170. // "location": "query",
  24171. // "type": "string"
  24172. // },
  24173. // "sortOrder": {
  24174. // "default": "ASCENDING",
  24175. // "description": "Order of sorted results.",
  24176. // "enum": [
  24177. // "ASCENDING",
  24178. // "DESCENDING"
  24179. // ],
  24180. // "enumDescriptions": [
  24181. // "",
  24182. // ""
  24183. // ],
  24184. // "location": "query",
  24185. // "type": "string"
  24186. // }
  24187. // },
  24188. // "path": "userprofiles/{profileId}/creativeGroups",
  24189. // "response": {
  24190. // "$ref": "CreativeGroupsListResponse"
  24191. // },
  24192. // "scopes": [
  24193. // "https://www.googleapis.com/auth/dfatrafficking"
  24194. // ]
  24195. // }
  24196. }
  24197. // Pages invokes f for each page of results.
  24198. // A non-nil error returned from f will halt the iteration.
  24199. // The provided context supersedes any context provided to the Context method.
  24200. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  24201. c.ctx_ = ctx
  24202. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24203. for {
  24204. x, err := c.Do()
  24205. if err != nil {
  24206. return err
  24207. }
  24208. if err := f(x); err != nil {
  24209. return err
  24210. }
  24211. if x.NextPageToken == "" {
  24212. return nil
  24213. }
  24214. c.PageToken(x.NextPageToken)
  24215. }
  24216. }
  24217. // method id "dfareporting.creativeGroups.patch":
  24218. type CreativeGroupsPatchCall struct {
  24219. s *Service
  24220. profileId int64
  24221. creativegroup *CreativeGroup
  24222. urlParams_ gensupport.URLParams
  24223. ctx_ context.Context
  24224. header_ http.Header
  24225. }
  24226. // Patch: Updates an existing creative group. This method supports patch
  24227. // semantics.
  24228. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  24229. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24230. c.profileId = profileId
  24231. c.urlParams_.Set("id", fmt.Sprint(id))
  24232. c.creativegroup = creativegroup
  24233. return c
  24234. }
  24235. // Fields allows partial responses to be retrieved. See
  24236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24237. // for more information.
  24238. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  24239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24240. return c
  24241. }
  24242. // Context sets the context to be used in this call's Do method. Any
  24243. // pending HTTP request will be aborted if the provided context is
  24244. // canceled.
  24245. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  24246. c.ctx_ = ctx
  24247. return c
  24248. }
  24249. // Header returns an http.Header that can be modified by the caller to
  24250. // add HTTP headers to the request.
  24251. func (c *CreativeGroupsPatchCall) Header() http.Header {
  24252. if c.header_ == nil {
  24253. c.header_ = make(http.Header)
  24254. }
  24255. return c.header_
  24256. }
  24257. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  24258. reqHeaders := make(http.Header)
  24259. for k, v := range c.header_ {
  24260. reqHeaders[k] = v
  24261. }
  24262. reqHeaders.Set("User-Agent", c.s.userAgent())
  24263. var body io.Reader = nil
  24264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24265. if err != nil {
  24266. return nil, err
  24267. }
  24268. reqHeaders.Set("Content-Type", "application/json")
  24269. c.urlParams_.Set("alt", alt)
  24270. c.urlParams_.Set("prettyPrint", "false")
  24271. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24272. urls += "?" + c.urlParams_.Encode()
  24273. req, err := http.NewRequest("PATCH", urls, body)
  24274. if err != nil {
  24275. return nil, err
  24276. }
  24277. req.Header = reqHeaders
  24278. googleapi.Expand(req.URL, map[string]string{
  24279. "profileId": strconv.FormatInt(c.profileId, 10),
  24280. })
  24281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24282. }
  24283. // Do executes the "dfareporting.creativeGroups.patch" call.
  24284. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24285. // status code is an error. Response headers are in either
  24286. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24287. // at all) in error.(*googleapi.Error).Header. Use
  24288. // googleapi.IsNotModified to check whether the returned error was
  24289. // because http.StatusNotModified was returned.
  24290. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24291. gensupport.SetOptions(c.urlParams_, opts...)
  24292. res, err := c.doRequest("json")
  24293. if res != nil && res.StatusCode == http.StatusNotModified {
  24294. if res.Body != nil {
  24295. res.Body.Close()
  24296. }
  24297. return nil, &googleapi.Error{
  24298. Code: res.StatusCode,
  24299. Header: res.Header,
  24300. }
  24301. }
  24302. if err != nil {
  24303. return nil, err
  24304. }
  24305. defer googleapi.CloseBody(res)
  24306. if err := googleapi.CheckResponse(res); err != nil {
  24307. return nil, err
  24308. }
  24309. ret := &CreativeGroup{
  24310. ServerResponse: googleapi.ServerResponse{
  24311. Header: res.Header,
  24312. HTTPStatusCode: res.StatusCode,
  24313. },
  24314. }
  24315. target := &ret
  24316. if err := gensupport.DecodeResponse(target, res); err != nil {
  24317. return nil, err
  24318. }
  24319. return ret, nil
  24320. // {
  24321. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24322. // "httpMethod": "PATCH",
  24323. // "id": "dfareporting.creativeGroups.patch",
  24324. // "parameterOrder": [
  24325. // "profileId",
  24326. // "id"
  24327. // ],
  24328. // "parameters": {
  24329. // "id": {
  24330. // "description": "Creative group ID.",
  24331. // "format": "int64",
  24332. // "location": "query",
  24333. // "required": true,
  24334. // "type": "string"
  24335. // },
  24336. // "profileId": {
  24337. // "description": "User profile ID associated with this request.",
  24338. // "format": "int64",
  24339. // "location": "path",
  24340. // "required": true,
  24341. // "type": "string"
  24342. // }
  24343. // },
  24344. // "path": "userprofiles/{profileId}/creativeGroups",
  24345. // "request": {
  24346. // "$ref": "CreativeGroup"
  24347. // },
  24348. // "response": {
  24349. // "$ref": "CreativeGroup"
  24350. // },
  24351. // "scopes": [
  24352. // "https://www.googleapis.com/auth/dfatrafficking"
  24353. // ]
  24354. // }
  24355. }
  24356. // method id "dfareporting.creativeGroups.update":
  24357. type CreativeGroupsUpdateCall struct {
  24358. s *Service
  24359. profileId int64
  24360. creativegroup *CreativeGroup
  24361. urlParams_ gensupport.URLParams
  24362. ctx_ context.Context
  24363. header_ http.Header
  24364. }
  24365. // Update: Updates an existing creative group.
  24366. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24367. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24368. c.profileId = profileId
  24369. c.creativegroup = creativegroup
  24370. return c
  24371. }
  24372. // Fields allows partial responses to be retrieved. See
  24373. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24374. // for more information.
  24375. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24376. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24377. return c
  24378. }
  24379. // Context sets the context to be used in this call's Do method. Any
  24380. // pending HTTP request will be aborted if the provided context is
  24381. // canceled.
  24382. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24383. c.ctx_ = ctx
  24384. return c
  24385. }
  24386. // Header returns an http.Header that can be modified by the caller to
  24387. // add HTTP headers to the request.
  24388. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24389. if c.header_ == nil {
  24390. c.header_ = make(http.Header)
  24391. }
  24392. return c.header_
  24393. }
  24394. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24395. reqHeaders := make(http.Header)
  24396. for k, v := range c.header_ {
  24397. reqHeaders[k] = v
  24398. }
  24399. reqHeaders.Set("User-Agent", c.s.userAgent())
  24400. var body io.Reader = nil
  24401. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24402. if err != nil {
  24403. return nil, err
  24404. }
  24405. reqHeaders.Set("Content-Type", "application/json")
  24406. c.urlParams_.Set("alt", alt)
  24407. c.urlParams_.Set("prettyPrint", "false")
  24408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24409. urls += "?" + c.urlParams_.Encode()
  24410. req, err := http.NewRequest("PUT", urls, body)
  24411. if err != nil {
  24412. return nil, err
  24413. }
  24414. req.Header = reqHeaders
  24415. googleapi.Expand(req.URL, map[string]string{
  24416. "profileId": strconv.FormatInt(c.profileId, 10),
  24417. })
  24418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24419. }
  24420. // Do executes the "dfareporting.creativeGroups.update" call.
  24421. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24422. // status code is an error. Response headers are in either
  24423. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24424. // at all) in error.(*googleapi.Error).Header. Use
  24425. // googleapi.IsNotModified to check whether the returned error was
  24426. // because http.StatusNotModified was returned.
  24427. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24428. gensupport.SetOptions(c.urlParams_, opts...)
  24429. res, err := c.doRequest("json")
  24430. if res != nil && res.StatusCode == http.StatusNotModified {
  24431. if res.Body != nil {
  24432. res.Body.Close()
  24433. }
  24434. return nil, &googleapi.Error{
  24435. Code: res.StatusCode,
  24436. Header: res.Header,
  24437. }
  24438. }
  24439. if err != nil {
  24440. return nil, err
  24441. }
  24442. defer googleapi.CloseBody(res)
  24443. if err := googleapi.CheckResponse(res); err != nil {
  24444. return nil, err
  24445. }
  24446. ret := &CreativeGroup{
  24447. ServerResponse: googleapi.ServerResponse{
  24448. Header: res.Header,
  24449. HTTPStatusCode: res.StatusCode,
  24450. },
  24451. }
  24452. target := &ret
  24453. if err := gensupport.DecodeResponse(target, res); err != nil {
  24454. return nil, err
  24455. }
  24456. return ret, nil
  24457. // {
  24458. // "description": "Updates an existing creative group.",
  24459. // "httpMethod": "PUT",
  24460. // "id": "dfareporting.creativeGroups.update",
  24461. // "parameterOrder": [
  24462. // "profileId"
  24463. // ],
  24464. // "parameters": {
  24465. // "profileId": {
  24466. // "description": "User profile ID associated with this request.",
  24467. // "format": "int64",
  24468. // "location": "path",
  24469. // "required": true,
  24470. // "type": "string"
  24471. // }
  24472. // },
  24473. // "path": "userprofiles/{profileId}/creativeGroups",
  24474. // "request": {
  24475. // "$ref": "CreativeGroup"
  24476. // },
  24477. // "response": {
  24478. // "$ref": "CreativeGroup"
  24479. // },
  24480. // "scopes": [
  24481. // "https://www.googleapis.com/auth/dfatrafficking"
  24482. // ]
  24483. // }
  24484. }
  24485. // method id "dfareporting.creatives.get":
  24486. type CreativesGetCall struct {
  24487. s *Service
  24488. profileId int64
  24489. id int64
  24490. urlParams_ gensupport.URLParams
  24491. ifNoneMatch_ string
  24492. ctx_ context.Context
  24493. header_ http.Header
  24494. }
  24495. // Get: Gets one creative by ID.
  24496. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24497. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24498. c.profileId = profileId
  24499. c.id = id
  24500. return c
  24501. }
  24502. // Fields allows partial responses to be retrieved. See
  24503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24504. // for more information.
  24505. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24507. return c
  24508. }
  24509. // IfNoneMatch sets the optional parameter which makes the operation
  24510. // fail if the object's ETag matches the given value. This is useful for
  24511. // getting updates only after the object has changed since the last
  24512. // request. Use googleapi.IsNotModified to check whether the response
  24513. // error from Do is the result of In-None-Match.
  24514. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24515. c.ifNoneMatch_ = entityTag
  24516. return c
  24517. }
  24518. // Context sets the context to be used in this call's Do method. Any
  24519. // pending HTTP request will be aborted if the provided context is
  24520. // canceled.
  24521. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24522. c.ctx_ = ctx
  24523. return c
  24524. }
  24525. // Header returns an http.Header that can be modified by the caller to
  24526. // add HTTP headers to the request.
  24527. func (c *CreativesGetCall) Header() http.Header {
  24528. if c.header_ == nil {
  24529. c.header_ = make(http.Header)
  24530. }
  24531. return c.header_
  24532. }
  24533. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24534. reqHeaders := make(http.Header)
  24535. for k, v := range c.header_ {
  24536. reqHeaders[k] = v
  24537. }
  24538. reqHeaders.Set("User-Agent", c.s.userAgent())
  24539. if c.ifNoneMatch_ != "" {
  24540. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24541. }
  24542. var body io.Reader = nil
  24543. c.urlParams_.Set("alt", alt)
  24544. c.urlParams_.Set("prettyPrint", "false")
  24545. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24546. urls += "?" + c.urlParams_.Encode()
  24547. req, err := http.NewRequest("GET", urls, body)
  24548. if err != nil {
  24549. return nil, err
  24550. }
  24551. req.Header = reqHeaders
  24552. googleapi.Expand(req.URL, map[string]string{
  24553. "profileId": strconv.FormatInt(c.profileId, 10),
  24554. "id": strconv.FormatInt(c.id, 10),
  24555. })
  24556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24557. }
  24558. // Do executes the "dfareporting.creatives.get" call.
  24559. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24560. // code is an error. Response headers are in either
  24561. // *Creative.ServerResponse.Header or (if a response was returned at
  24562. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24563. // to check whether the returned error was because
  24564. // http.StatusNotModified was returned.
  24565. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24566. gensupport.SetOptions(c.urlParams_, opts...)
  24567. res, err := c.doRequest("json")
  24568. if res != nil && res.StatusCode == http.StatusNotModified {
  24569. if res.Body != nil {
  24570. res.Body.Close()
  24571. }
  24572. return nil, &googleapi.Error{
  24573. Code: res.StatusCode,
  24574. Header: res.Header,
  24575. }
  24576. }
  24577. if err != nil {
  24578. return nil, err
  24579. }
  24580. defer googleapi.CloseBody(res)
  24581. if err := googleapi.CheckResponse(res); err != nil {
  24582. return nil, err
  24583. }
  24584. ret := &Creative{
  24585. ServerResponse: googleapi.ServerResponse{
  24586. Header: res.Header,
  24587. HTTPStatusCode: res.StatusCode,
  24588. },
  24589. }
  24590. target := &ret
  24591. if err := gensupport.DecodeResponse(target, res); err != nil {
  24592. return nil, err
  24593. }
  24594. return ret, nil
  24595. // {
  24596. // "description": "Gets one creative by ID.",
  24597. // "httpMethod": "GET",
  24598. // "id": "dfareporting.creatives.get",
  24599. // "parameterOrder": [
  24600. // "profileId",
  24601. // "id"
  24602. // ],
  24603. // "parameters": {
  24604. // "id": {
  24605. // "description": "Creative ID.",
  24606. // "format": "int64",
  24607. // "location": "path",
  24608. // "required": true,
  24609. // "type": "string"
  24610. // },
  24611. // "profileId": {
  24612. // "description": "User profile ID associated with this request.",
  24613. // "format": "int64",
  24614. // "location": "path",
  24615. // "required": true,
  24616. // "type": "string"
  24617. // }
  24618. // },
  24619. // "path": "userprofiles/{profileId}/creatives/{id}",
  24620. // "response": {
  24621. // "$ref": "Creative"
  24622. // },
  24623. // "scopes": [
  24624. // "https://www.googleapis.com/auth/dfatrafficking"
  24625. // ]
  24626. // }
  24627. }
  24628. // method id "dfareporting.creatives.insert":
  24629. type CreativesInsertCall struct {
  24630. s *Service
  24631. profileId int64
  24632. creative *Creative
  24633. urlParams_ gensupport.URLParams
  24634. ctx_ context.Context
  24635. header_ http.Header
  24636. }
  24637. // Insert: Inserts a new creative.
  24638. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24639. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24640. c.profileId = profileId
  24641. c.creative = creative
  24642. return c
  24643. }
  24644. // Fields allows partial responses to be retrieved. See
  24645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24646. // for more information.
  24647. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24649. return c
  24650. }
  24651. // Context sets the context to be used in this call's Do method. Any
  24652. // pending HTTP request will be aborted if the provided context is
  24653. // canceled.
  24654. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24655. c.ctx_ = ctx
  24656. return c
  24657. }
  24658. // Header returns an http.Header that can be modified by the caller to
  24659. // add HTTP headers to the request.
  24660. func (c *CreativesInsertCall) Header() http.Header {
  24661. if c.header_ == nil {
  24662. c.header_ = make(http.Header)
  24663. }
  24664. return c.header_
  24665. }
  24666. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24667. reqHeaders := make(http.Header)
  24668. for k, v := range c.header_ {
  24669. reqHeaders[k] = v
  24670. }
  24671. reqHeaders.Set("User-Agent", c.s.userAgent())
  24672. var body io.Reader = nil
  24673. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24674. if err != nil {
  24675. return nil, err
  24676. }
  24677. reqHeaders.Set("Content-Type", "application/json")
  24678. c.urlParams_.Set("alt", alt)
  24679. c.urlParams_.Set("prettyPrint", "false")
  24680. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24681. urls += "?" + c.urlParams_.Encode()
  24682. req, err := http.NewRequest("POST", urls, body)
  24683. if err != nil {
  24684. return nil, err
  24685. }
  24686. req.Header = reqHeaders
  24687. googleapi.Expand(req.URL, map[string]string{
  24688. "profileId": strconv.FormatInt(c.profileId, 10),
  24689. })
  24690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24691. }
  24692. // Do executes the "dfareporting.creatives.insert" call.
  24693. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24694. // code is an error. Response headers are in either
  24695. // *Creative.ServerResponse.Header or (if a response was returned at
  24696. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24697. // to check whether the returned error was because
  24698. // http.StatusNotModified was returned.
  24699. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24700. gensupport.SetOptions(c.urlParams_, opts...)
  24701. res, err := c.doRequest("json")
  24702. if res != nil && res.StatusCode == http.StatusNotModified {
  24703. if res.Body != nil {
  24704. res.Body.Close()
  24705. }
  24706. return nil, &googleapi.Error{
  24707. Code: res.StatusCode,
  24708. Header: res.Header,
  24709. }
  24710. }
  24711. if err != nil {
  24712. return nil, err
  24713. }
  24714. defer googleapi.CloseBody(res)
  24715. if err := googleapi.CheckResponse(res); err != nil {
  24716. return nil, err
  24717. }
  24718. ret := &Creative{
  24719. ServerResponse: googleapi.ServerResponse{
  24720. Header: res.Header,
  24721. HTTPStatusCode: res.StatusCode,
  24722. },
  24723. }
  24724. target := &ret
  24725. if err := gensupport.DecodeResponse(target, res); err != nil {
  24726. return nil, err
  24727. }
  24728. return ret, nil
  24729. // {
  24730. // "description": "Inserts a new creative.",
  24731. // "httpMethod": "POST",
  24732. // "id": "dfareporting.creatives.insert",
  24733. // "parameterOrder": [
  24734. // "profileId"
  24735. // ],
  24736. // "parameters": {
  24737. // "profileId": {
  24738. // "description": "User profile ID associated with this request.",
  24739. // "format": "int64",
  24740. // "location": "path",
  24741. // "required": true,
  24742. // "type": "string"
  24743. // }
  24744. // },
  24745. // "path": "userprofiles/{profileId}/creatives",
  24746. // "request": {
  24747. // "$ref": "Creative"
  24748. // },
  24749. // "response": {
  24750. // "$ref": "Creative"
  24751. // },
  24752. // "scopes": [
  24753. // "https://www.googleapis.com/auth/dfatrafficking"
  24754. // ]
  24755. // }
  24756. }
  24757. // method id "dfareporting.creatives.list":
  24758. type CreativesListCall struct {
  24759. s *Service
  24760. profileId int64
  24761. urlParams_ gensupport.URLParams
  24762. ifNoneMatch_ string
  24763. ctx_ context.Context
  24764. header_ http.Header
  24765. }
  24766. // List: Retrieves a list of creatives, possibly filtered. This method
  24767. // supports paging.
  24768. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  24769. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24770. c.profileId = profileId
  24771. return c
  24772. }
  24773. // Active sets the optional parameter "active": Select only active
  24774. // creatives. Leave blank to select active and inactive creatives.
  24775. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  24776. c.urlParams_.Set("active", fmt.Sprint(active))
  24777. return c
  24778. }
  24779. // AdvertiserId sets the optional parameter "advertiserId": Select only
  24780. // creatives with this advertiser ID.
  24781. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  24782. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  24783. return c
  24784. }
  24785. // Archived sets the optional parameter "archived": Select only archived
  24786. // creatives. Leave blank to select archived and unarchived creatives.
  24787. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  24788. c.urlParams_.Set("archived", fmt.Sprint(archived))
  24789. return c
  24790. }
  24791. // CampaignId sets the optional parameter "campaignId": Select only
  24792. // creatives with this campaign ID.
  24793. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  24794. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  24795. return c
  24796. }
  24797. // CompanionCreativeIds sets the optional parameter
  24798. // "companionCreativeIds": Select only in-stream video creatives with
  24799. // these companion IDs.
  24800. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  24801. var companionCreativeIds_ []string
  24802. for _, v := range companionCreativeIds {
  24803. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  24804. }
  24805. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  24806. return c
  24807. }
  24808. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  24809. // Select only creatives with these creative field IDs.
  24810. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  24811. var creativeFieldIds_ []string
  24812. for _, v := range creativeFieldIds {
  24813. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  24814. }
  24815. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  24816. return c
  24817. }
  24818. // Ids sets the optional parameter "ids": Select only creatives with
  24819. // these IDs.
  24820. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  24821. var ids_ []string
  24822. for _, v := range ids {
  24823. ids_ = append(ids_, fmt.Sprint(v))
  24824. }
  24825. c.urlParams_.SetMulti("ids", ids_)
  24826. return c
  24827. }
  24828. // MaxResults sets the optional parameter "maxResults": Maximum number
  24829. // of results to return.
  24830. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  24831. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24832. return c
  24833. }
  24834. // PageToken sets the optional parameter "pageToken": Value of the
  24835. // nextPageToken from the previous result page.
  24836. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  24837. c.urlParams_.Set("pageToken", pageToken)
  24838. return c
  24839. }
  24840. // RenderingIds sets the optional parameter "renderingIds": Select only
  24841. // creatives with these rendering IDs.
  24842. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  24843. var renderingIds_ []string
  24844. for _, v := range renderingIds {
  24845. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  24846. }
  24847. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  24848. return c
  24849. }
  24850. // SearchString sets the optional parameter "searchString": Allows
  24851. // searching for objects by name or ID. Wildcards (*) are allowed. For
  24852. // example, "creative*2015" will return objects with names like
  24853. // "creative June 2015", "creative April 2015", or simply "creative
  24854. // 2015". Most of the searches also add wildcards implicitly at the
  24855. // start and the end of the search string. For example, a search string
  24856. // of "creative" will match objects with name "my creative", "creative
  24857. // 2015", or simply "creative".
  24858. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  24859. c.urlParams_.Set("searchString", searchString)
  24860. return c
  24861. }
  24862. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  24863. // with these size IDs.
  24864. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  24865. var sizeIds_ []string
  24866. for _, v := range sizeIds {
  24867. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  24868. }
  24869. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  24870. return c
  24871. }
  24872. // SortField sets the optional parameter "sortField": Field by which to
  24873. // sort the list.
  24874. //
  24875. // Possible values:
  24876. // "ID" (default)
  24877. // "NAME"
  24878. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  24879. c.urlParams_.Set("sortField", sortField)
  24880. return c
  24881. }
  24882. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24883. // results.
  24884. //
  24885. // Possible values:
  24886. // "ASCENDING" (default)
  24887. // "DESCENDING"
  24888. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  24889. c.urlParams_.Set("sortOrder", sortOrder)
  24890. return c
  24891. }
  24892. // StudioCreativeId sets the optional parameter "studioCreativeId":
  24893. // Select only creatives corresponding to this Studio creative ID.
  24894. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  24895. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  24896. return c
  24897. }
  24898. // Types sets the optional parameter "types": Select only creatives with
  24899. // these creative types.
  24900. //
  24901. // Possible values:
  24902. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  24903. // "CUSTOM_DISPLAY"
  24904. // "CUSTOM_DISPLAY_INTERSTITIAL"
  24905. // "DISPLAY"
  24906. // "DISPLAY_IMAGE_GALLERY"
  24907. // "DISPLAY_REDIRECT"
  24908. // "FLASH_INPAGE"
  24909. // "HTML5_BANNER"
  24910. // "IMAGE"
  24911. // "INSTREAM_AUDIO"
  24912. // "INSTREAM_VIDEO"
  24913. // "INSTREAM_VIDEO_REDIRECT"
  24914. // "INTERNAL_REDIRECT"
  24915. // "INTERSTITIAL_INTERNAL_REDIRECT"
  24916. // "RICH_MEDIA_DISPLAY_BANNER"
  24917. // "RICH_MEDIA_DISPLAY_EXPANDING"
  24918. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  24919. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  24920. // "RICH_MEDIA_IM_EXPAND"
  24921. // "RICH_MEDIA_INPAGE_FLOATING"
  24922. // "RICH_MEDIA_MOBILE_IN_APP"
  24923. // "RICH_MEDIA_PEEL_DOWN"
  24924. // "TRACKING_TEXT"
  24925. // "VPAID_LINEAR_VIDEO"
  24926. // "VPAID_NON_LINEAR_VIDEO"
  24927. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  24928. c.urlParams_.SetMulti("types", append([]string{}, types...))
  24929. return c
  24930. }
  24931. // Fields allows partial responses to be retrieved. See
  24932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24933. // for more information.
  24934. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  24935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24936. return c
  24937. }
  24938. // IfNoneMatch sets the optional parameter which makes the operation
  24939. // fail if the object's ETag matches the given value. This is useful for
  24940. // getting updates only after the object has changed since the last
  24941. // request. Use googleapi.IsNotModified to check whether the response
  24942. // error from Do is the result of In-None-Match.
  24943. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  24944. c.ifNoneMatch_ = entityTag
  24945. return c
  24946. }
  24947. // Context sets the context to be used in this call's Do method. Any
  24948. // pending HTTP request will be aborted if the provided context is
  24949. // canceled.
  24950. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  24951. c.ctx_ = ctx
  24952. return c
  24953. }
  24954. // Header returns an http.Header that can be modified by the caller to
  24955. // add HTTP headers to the request.
  24956. func (c *CreativesListCall) Header() http.Header {
  24957. if c.header_ == nil {
  24958. c.header_ = make(http.Header)
  24959. }
  24960. return c.header_
  24961. }
  24962. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  24963. reqHeaders := make(http.Header)
  24964. for k, v := range c.header_ {
  24965. reqHeaders[k] = v
  24966. }
  24967. reqHeaders.Set("User-Agent", c.s.userAgent())
  24968. if c.ifNoneMatch_ != "" {
  24969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24970. }
  24971. var body io.Reader = nil
  24972. c.urlParams_.Set("alt", alt)
  24973. c.urlParams_.Set("prettyPrint", "false")
  24974. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24975. urls += "?" + c.urlParams_.Encode()
  24976. req, err := http.NewRequest("GET", urls, body)
  24977. if err != nil {
  24978. return nil, err
  24979. }
  24980. req.Header = reqHeaders
  24981. googleapi.Expand(req.URL, map[string]string{
  24982. "profileId": strconv.FormatInt(c.profileId, 10),
  24983. })
  24984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24985. }
  24986. // Do executes the "dfareporting.creatives.list" call.
  24987. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  24988. // non-2xx status code is an error. Response headers are in either
  24989. // *CreativesListResponse.ServerResponse.Header or (if a response was
  24990. // returned at all) in error.(*googleapi.Error).Header. Use
  24991. // googleapi.IsNotModified to check whether the returned error was
  24992. // because http.StatusNotModified was returned.
  24993. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  24994. gensupport.SetOptions(c.urlParams_, opts...)
  24995. res, err := c.doRequest("json")
  24996. if res != nil && res.StatusCode == http.StatusNotModified {
  24997. if res.Body != nil {
  24998. res.Body.Close()
  24999. }
  25000. return nil, &googleapi.Error{
  25001. Code: res.StatusCode,
  25002. Header: res.Header,
  25003. }
  25004. }
  25005. if err != nil {
  25006. return nil, err
  25007. }
  25008. defer googleapi.CloseBody(res)
  25009. if err := googleapi.CheckResponse(res); err != nil {
  25010. return nil, err
  25011. }
  25012. ret := &CreativesListResponse{
  25013. ServerResponse: googleapi.ServerResponse{
  25014. Header: res.Header,
  25015. HTTPStatusCode: res.StatusCode,
  25016. },
  25017. }
  25018. target := &ret
  25019. if err := gensupport.DecodeResponse(target, res); err != nil {
  25020. return nil, err
  25021. }
  25022. return ret, nil
  25023. // {
  25024. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  25025. // "httpMethod": "GET",
  25026. // "id": "dfareporting.creatives.list",
  25027. // "parameterOrder": [
  25028. // "profileId"
  25029. // ],
  25030. // "parameters": {
  25031. // "active": {
  25032. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  25033. // "location": "query",
  25034. // "type": "boolean"
  25035. // },
  25036. // "advertiserId": {
  25037. // "description": "Select only creatives with this advertiser ID.",
  25038. // "format": "int64",
  25039. // "location": "query",
  25040. // "type": "string"
  25041. // },
  25042. // "archived": {
  25043. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  25044. // "location": "query",
  25045. // "type": "boolean"
  25046. // },
  25047. // "campaignId": {
  25048. // "description": "Select only creatives with this campaign ID.",
  25049. // "format": "int64",
  25050. // "location": "query",
  25051. // "type": "string"
  25052. // },
  25053. // "companionCreativeIds": {
  25054. // "description": "Select only in-stream video creatives with these companion IDs.",
  25055. // "format": "int64",
  25056. // "location": "query",
  25057. // "repeated": true,
  25058. // "type": "string"
  25059. // },
  25060. // "creativeFieldIds": {
  25061. // "description": "Select only creatives with these creative field IDs.",
  25062. // "format": "int64",
  25063. // "location": "query",
  25064. // "repeated": true,
  25065. // "type": "string"
  25066. // },
  25067. // "ids": {
  25068. // "description": "Select only creatives with these IDs.",
  25069. // "format": "int64",
  25070. // "location": "query",
  25071. // "repeated": true,
  25072. // "type": "string"
  25073. // },
  25074. // "maxResults": {
  25075. // "default": "1000",
  25076. // "description": "Maximum number of results to return.",
  25077. // "format": "int32",
  25078. // "location": "query",
  25079. // "maximum": "1000",
  25080. // "minimum": "0",
  25081. // "type": "integer"
  25082. // },
  25083. // "pageToken": {
  25084. // "description": "Value of the nextPageToken from the previous result page.",
  25085. // "location": "query",
  25086. // "type": "string"
  25087. // },
  25088. // "profileId": {
  25089. // "description": "User profile ID associated with this request.",
  25090. // "format": "int64",
  25091. // "location": "path",
  25092. // "required": true,
  25093. // "type": "string"
  25094. // },
  25095. // "renderingIds": {
  25096. // "description": "Select only creatives with these rendering IDs.",
  25097. // "format": "int64",
  25098. // "location": "query",
  25099. // "repeated": true,
  25100. // "type": "string"
  25101. // },
  25102. // "searchString": {
  25103. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"creative*2015\" will return objects with names like \"creative June 2015\", \"creative April 2015\", or simply \"creative 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"creative\" will match objects with name \"my creative\", \"creative 2015\", or simply \"creative\".",
  25104. // "location": "query",
  25105. // "type": "string"
  25106. // },
  25107. // "sizeIds": {
  25108. // "description": "Select only creatives with these size IDs.",
  25109. // "format": "int64",
  25110. // "location": "query",
  25111. // "repeated": true,
  25112. // "type": "string"
  25113. // },
  25114. // "sortField": {
  25115. // "default": "ID",
  25116. // "description": "Field by which to sort the list.",
  25117. // "enum": [
  25118. // "ID",
  25119. // "NAME"
  25120. // ],
  25121. // "enumDescriptions": [
  25122. // "",
  25123. // ""
  25124. // ],
  25125. // "location": "query",
  25126. // "type": "string"
  25127. // },
  25128. // "sortOrder": {
  25129. // "default": "ASCENDING",
  25130. // "description": "Order of sorted results.",
  25131. // "enum": [
  25132. // "ASCENDING",
  25133. // "DESCENDING"
  25134. // ],
  25135. // "enumDescriptions": [
  25136. // "",
  25137. // ""
  25138. // ],
  25139. // "location": "query",
  25140. // "type": "string"
  25141. // },
  25142. // "studioCreativeId": {
  25143. // "description": "Select only creatives corresponding to this Studio creative ID.",
  25144. // "format": "int64",
  25145. // "location": "query",
  25146. // "type": "string"
  25147. // },
  25148. // "types": {
  25149. // "description": "Select only creatives with these creative types.",
  25150. // "enum": [
  25151. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  25152. // "CUSTOM_DISPLAY",
  25153. // "CUSTOM_DISPLAY_INTERSTITIAL",
  25154. // "DISPLAY",
  25155. // "DISPLAY_IMAGE_GALLERY",
  25156. // "DISPLAY_REDIRECT",
  25157. // "FLASH_INPAGE",
  25158. // "HTML5_BANNER",
  25159. // "IMAGE",
  25160. // "INSTREAM_AUDIO",
  25161. // "INSTREAM_VIDEO",
  25162. // "INSTREAM_VIDEO_REDIRECT",
  25163. // "INTERNAL_REDIRECT",
  25164. // "INTERSTITIAL_INTERNAL_REDIRECT",
  25165. // "RICH_MEDIA_DISPLAY_BANNER",
  25166. // "RICH_MEDIA_DISPLAY_EXPANDING",
  25167. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  25168. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  25169. // "RICH_MEDIA_IM_EXPAND",
  25170. // "RICH_MEDIA_INPAGE_FLOATING",
  25171. // "RICH_MEDIA_MOBILE_IN_APP",
  25172. // "RICH_MEDIA_PEEL_DOWN",
  25173. // "TRACKING_TEXT",
  25174. // "VPAID_LINEAR_VIDEO",
  25175. // "VPAID_NON_LINEAR_VIDEO"
  25176. // ],
  25177. // "enumDescriptions": [
  25178. // "",
  25179. // "",
  25180. // "",
  25181. // "",
  25182. // "",
  25183. // "",
  25184. // "",
  25185. // "",
  25186. // "",
  25187. // "",
  25188. // "",
  25189. // "",
  25190. // "",
  25191. // "",
  25192. // "",
  25193. // "",
  25194. // "",
  25195. // "",
  25196. // "",
  25197. // "",
  25198. // "",
  25199. // "",
  25200. // "",
  25201. // "",
  25202. // ""
  25203. // ],
  25204. // "location": "query",
  25205. // "repeated": true,
  25206. // "type": "string"
  25207. // }
  25208. // },
  25209. // "path": "userprofiles/{profileId}/creatives",
  25210. // "response": {
  25211. // "$ref": "CreativesListResponse"
  25212. // },
  25213. // "scopes": [
  25214. // "https://www.googleapis.com/auth/dfatrafficking"
  25215. // ]
  25216. // }
  25217. }
  25218. // Pages invokes f for each page of results.
  25219. // A non-nil error returned from f will halt the iteration.
  25220. // The provided context supersedes any context provided to the Context method.
  25221. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  25222. c.ctx_ = ctx
  25223. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25224. for {
  25225. x, err := c.Do()
  25226. if err != nil {
  25227. return err
  25228. }
  25229. if err := f(x); err != nil {
  25230. return err
  25231. }
  25232. if x.NextPageToken == "" {
  25233. return nil
  25234. }
  25235. c.PageToken(x.NextPageToken)
  25236. }
  25237. }
  25238. // method id "dfareporting.creatives.patch":
  25239. type CreativesPatchCall struct {
  25240. s *Service
  25241. profileId int64
  25242. creative *Creative
  25243. urlParams_ gensupport.URLParams
  25244. ctx_ context.Context
  25245. header_ http.Header
  25246. }
  25247. // Patch: Updates an existing creative. This method supports patch
  25248. // semantics.
  25249. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  25250. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25251. c.profileId = profileId
  25252. c.urlParams_.Set("id", fmt.Sprint(id))
  25253. c.creative = creative
  25254. return c
  25255. }
  25256. // Fields allows partial responses to be retrieved. See
  25257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25258. // for more information.
  25259. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  25260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25261. return c
  25262. }
  25263. // Context sets the context to be used in this call's Do method. Any
  25264. // pending HTTP request will be aborted if the provided context is
  25265. // canceled.
  25266. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  25267. c.ctx_ = ctx
  25268. return c
  25269. }
  25270. // Header returns an http.Header that can be modified by the caller to
  25271. // add HTTP headers to the request.
  25272. func (c *CreativesPatchCall) Header() http.Header {
  25273. if c.header_ == nil {
  25274. c.header_ = make(http.Header)
  25275. }
  25276. return c.header_
  25277. }
  25278. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  25279. reqHeaders := make(http.Header)
  25280. for k, v := range c.header_ {
  25281. reqHeaders[k] = v
  25282. }
  25283. reqHeaders.Set("User-Agent", c.s.userAgent())
  25284. var body io.Reader = nil
  25285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25286. if err != nil {
  25287. return nil, err
  25288. }
  25289. reqHeaders.Set("Content-Type", "application/json")
  25290. c.urlParams_.Set("alt", alt)
  25291. c.urlParams_.Set("prettyPrint", "false")
  25292. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25293. urls += "?" + c.urlParams_.Encode()
  25294. req, err := http.NewRequest("PATCH", urls, body)
  25295. if err != nil {
  25296. return nil, err
  25297. }
  25298. req.Header = reqHeaders
  25299. googleapi.Expand(req.URL, map[string]string{
  25300. "profileId": strconv.FormatInt(c.profileId, 10),
  25301. })
  25302. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25303. }
  25304. // Do executes the "dfareporting.creatives.patch" call.
  25305. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25306. // code is an error. Response headers are in either
  25307. // *Creative.ServerResponse.Header or (if a response was returned at
  25308. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25309. // to check whether the returned error was because
  25310. // http.StatusNotModified was returned.
  25311. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25312. gensupport.SetOptions(c.urlParams_, opts...)
  25313. res, err := c.doRequest("json")
  25314. if res != nil && res.StatusCode == http.StatusNotModified {
  25315. if res.Body != nil {
  25316. res.Body.Close()
  25317. }
  25318. return nil, &googleapi.Error{
  25319. Code: res.StatusCode,
  25320. Header: res.Header,
  25321. }
  25322. }
  25323. if err != nil {
  25324. return nil, err
  25325. }
  25326. defer googleapi.CloseBody(res)
  25327. if err := googleapi.CheckResponse(res); err != nil {
  25328. return nil, err
  25329. }
  25330. ret := &Creative{
  25331. ServerResponse: googleapi.ServerResponse{
  25332. Header: res.Header,
  25333. HTTPStatusCode: res.StatusCode,
  25334. },
  25335. }
  25336. target := &ret
  25337. if err := gensupport.DecodeResponse(target, res); err != nil {
  25338. return nil, err
  25339. }
  25340. return ret, nil
  25341. // {
  25342. // "description": "Updates an existing creative. This method supports patch semantics.",
  25343. // "httpMethod": "PATCH",
  25344. // "id": "dfareporting.creatives.patch",
  25345. // "parameterOrder": [
  25346. // "profileId",
  25347. // "id"
  25348. // ],
  25349. // "parameters": {
  25350. // "id": {
  25351. // "description": "Creative ID.",
  25352. // "format": "int64",
  25353. // "location": "query",
  25354. // "required": true,
  25355. // "type": "string"
  25356. // },
  25357. // "profileId": {
  25358. // "description": "User profile ID associated with this request.",
  25359. // "format": "int64",
  25360. // "location": "path",
  25361. // "required": true,
  25362. // "type": "string"
  25363. // }
  25364. // },
  25365. // "path": "userprofiles/{profileId}/creatives",
  25366. // "request": {
  25367. // "$ref": "Creative"
  25368. // },
  25369. // "response": {
  25370. // "$ref": "Creative"
  25371. // },
  25372. // "scopes": [
  25373. // "https://www.googleapis.com/auth/dfatrafficking"
  25374. // ]
  25375. // }
  25376. }
  25377. // method id "dfareporting.creatives.update":
  25378. type CreativesUpdateCall struct {
  25379. s *Service
  25380. profileId int64
  25381. creative *Creative
  25382. urlParams_ gensupport.URLParams
  25383. ctx_ context.Context
  25384. header_ http.Header
  25385. }
  25386. // Update: Updates an existing creative.
  25387. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25388. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25389. c.profileId = profileId
  25390. c.creative = creative
  25391. return c
  25392. }
  25393. // Fields allows partial responses to be retrieved. See
  25394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25395. // for more information.
  25396. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25398. return c
  25399. }
  25400. // Context sets the context to be used in this call's Do method. Any
  25401. // pending HTTP request will be aborted if the provided context is
  25402. // canceled.
  25403. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25404. c.ctx_ = ctx
  25405. return c
  25406. }
  25407. // Header returns an http.Header that can be modified by the caller to
  25408. // add HTTP headers to the request.
  25409. func (c *CreativesUpdateCall) Header() http.Header {
  25410. if c.header_ == nil {
  25411. c.header_ = make(http.Header)
  25412. }
  25413. return c.header_
  25414. }
  25415. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25416. reqHeaders := make(http.Header)
  25417. for k, v := range c.header_ {
  25418. reqHeaders[k] = v
  25419. }
  25420. reqHeaders.Set("User-Agent", c.s.userAgent())
  25421. var body io.Reader = nil
  25422. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25423. if err != nil {
  25424. return nil, err
  25425. }
  25426. reqHeaders.Set("Content-Type", "application/json")
  25427. c.urlParams_.Set("alt", alt)
  25428. c.urlParams_.Set("prettyPrint", "false")
  25429. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25430. urls += "?" + c.urlParams_.Encode()
  25431. req, err := http.NewRequest("PUT", urls, body)
  25432. if err != nil {
  25433. return nil, err
  25434. }
  25435. req.Header = reqHeaders
  25436. googleapi.Expand(req.URL, map[string]string{
  25437. "profileId": strconv.FormatInt(c.profileId, 10),
  25438. })
  25439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25440. }
  25441. // Do executes the "dfareporting.creatives.update" call.
  25442. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25443. // code is an error. Response headers are in either
  25444. // *Creative.ServerResponse.Header or (if a response was returned at
  25445. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25446. // to check whether the returned error was because
  25447. // http.StatusNotModified was returned.
  25448. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25449. gensupport.SetOptions(c.urlParams_, opts...)
  25450. res, err := c.doRequest("json")
  25451. if res != nil && res.StatusCode == http.StatusNotModified {
  25452. if res.Body != nil {
  25453. res.Body.Close()
  25454. }
  25455. return nil, &googleapi.Error{
  25456. Code: res.StatusCode,
  25457. Header: res.Header,
  25458. }
  25459. }
  25460. if err != nil {
  25461. return nil, err
  25462. }
  25463. defer googleapi.CloseBody(res)
  25464. if err := googleapi.CheckResponse(res); err != nil {
  25465. return nil, err
  25466. }
  25467. ret := &Creative{
  25468. ServerResponse: googleapi.ServerResponse{
  25469. Header: res.Header,
  25470. HTTPStatusCode: res.StatusCode,
  25471. },
  25472. }
  25473. target := &ret
  25474. if err := gensupport.DecodeResponse(target, res); err != nil {
  25475. return nil, err
  25476. }
  25477. return ret, nil
  25478. // {
  25479. // "description": "Updates an existing creative.",
  25480. // "httpMethod": "PUT",
  25481. // "id": "dfareporting.creatives.update",
  25482. // "parameterOrder": [
  25483. // "profileId"
  25484. // ],
  25485. // "parameters": {
  25486. // "profileId": {
  25487. // "description": "User profile ID associated with this request.",
  25488. // "format": "int64",
  25489. // "location": "path",
  25490. // "required": true,
  25491. // "type": "string"
  25492. // }
  25493. // },
  25494. // "path": "userprofiles/{profileId}/creatives",
  25495. // "request": {
  25496. // "$ref": "Creative"
  25497. // },
  25498. // "response": {
  25499. // "$ref": "Creative"
  25500. // },
  25501. // "scopes": [
  25502. // "https://www.googleapis.com/auth/dfatrafficking"
  25503. // ]
  25504. // }
  25505. }
  25506. // method id "dfareporting.dimensionValues.query":
  25507. type DimensionValuesQueryCall struct {
  25508. s *Service
  25509. profileId int64
  25510. dimensionvaluerequest *DimensionValueRequest
  25511. urlParams_ gensupport.URLParams
  25512. ctx_ context.Context
  25513. header_ http.Header
  25514. }
  25515. // Query: Retrieves list of report dimension values for a list of
  25516. // filters.
  25517. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25518. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25519. c.profileId = profileId
  25520. c.dimensionvaluerequest = dimensionvaluerequest
  25521. return c
  25522. }
  25523. // MaxResults sets the optional parameter "maxResults": Maximum number
  25524. // of results to return.
  25525. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25526. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25527. return c
  25528. }
  25529. // PageToken sets the optional parameter "pageToken": The value of the
  25530. // nextToken from the previous result page.
  25531. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25532. c.urlParams_.Set("pageToken", pageToken)
  25533. return c
  25534. }
  25535. // Fields allows partial responses to be retrieved. See
  25536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25537. // for more information.
  25538. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25540. return c
  25541. }
  25542. // Context sets the context to be used in this call's Do method. Any
  25543. // pending HTTP request will be aborted if the provided context is
  25544. // canceled.
  25545. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25546. c.ctx_ = ctx
  25547. return c
  25548. }
  25549. // Header returns an http.Header that can be modified by the caller to
  25550. // add HTTP headers to the request.
  25551. func (c *DimensionValuesQueryCall) Header() http.Header {
  25552. if c.header_ == nil {
  25553. c.header_ = make(http.Header)
  25554. }
  25555. return c.header_
  25556. }
  25557. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25558. reqHeaders := make(http.Header)
  25559. for k, v := range c.header_ {
  25560. reqHeaders[k] = v
  25561. }
  25562. reqHeaders.Set("User-Agent", c.s.userAgent())
  25563. var body io.Reader = nil
  25564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25565. if err != nil {
  25566. return nil, err
  25567. }
  25568. reqHeaders.Set("Content-Type", "application/json")
  25569. c.urlParams_.Set("alt", alt)
  25570. c.urlParams_.Set("prettyPrint", "false")
  25571. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25572. urls += "?" + c.urlParams_.Encode()
  25573. req, err := http.NewRequest("POST", urls, body)
  25574. if err != nil {
  25575. return nil, err
  25576. }
  25577. req.Header = reqHeaders
  25578. googleapi.Expand(req.URL, map[string]string{
  25579. "profileId": strconv.FormatInt(c.profileId, 10),
  25580. })
  25581. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25582. }
  25583. // Do executes the "dfareporting.dimensionValues.query" call.
  25584. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25585. // non-2xx status code is an error. Response headers are in either
  25586. // *DimensionValueList.ServerResponse.Header or (if a response was
  25587. // returned at all) in error.(*googleapi.Error).Header. Use
  25588. // googleapi.IsNotModified to check whether the returned error was
  25589. // because http.StatusNotModified was returned.
  25590. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25591. gensupport.SetOptions(c.urlParams_, opts...)
  25592. res, err := c.doRequest("json")
  25593. if res != nil && res.StatusCode == http.StatusNotModified {
  25594. if res.Body != nil {
  25595. res.Body.Close()
  25596. }
  25597. return nil, &googleapi.Error{
  25598. Code: res.StatusCode,
  25599. Header: res.Header,
  25600. }
  25601. }
  25602. if err != nil {
  25603. return nil, err
  25604. }
  25605. defer googleapi.CloseBody(res)
  25606. if err := googleapi.CheckResponse(res); err != nil {
  25607. return nil, err
  25608. }
  25609. ret := &DimensionValueList{
  25610. ServerResponse: googleapi.ServerResponse{
  25611. Header: res.Header,
  25612. HTTPStatusCode: res.StatusCode,
  25613. },
  25614. }
  25615. target := &ret
  25616. if err := gensupport.DecodeResponse(target, res); err != nil {
  25617. return nil, err
  25618. }
  25619. return ret, nil
  25620. // {
  25621. // "description": "Retrieves list of report dimension values for a list of filters.",
  25622. // "httpMethod": "POST",
  25623. // "id": "dfareporting.dimensionValues.query",
  25624. // "parameterOrder": [
  25625. // "profileId"
  25626. // ],
  25627. // "parameters": {
  25628. // "maxResults": {
  25629. // "default": "100",
  25630. // "description": "Maximum number of results to return.",
  25631. // "format": "int32",
  25632. // "location": "query",
  25633. // "maximum": "100",
  25634. // "minimum": "0",
  25635. // "type": "integer"
  25636. // },
  25637. // "pageToken": {
  25638. // "description": "The value of the nextToken from the previous result page.",
  25639. // "location": "query",
  25640. // "type": "string"
  25641. // },
  25642. // "profileId": {
  25643. // "description": "The DFA user profile ID.",
  25644. // "format": "int64",
  25645. // "location": "path",
  25646. // "required": true,
  25647. // "type": "string"
  25648. // }
  25649. // },
  25650. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25651. // "request": {
  25652. // "$ref": "DimensionValueRequest"
  25653. // },
  25654. // "response": {
  25655. // "$ref": "DimensionValueList"
  25656. // },
  25657. // "scopes": [
  25658. // "https://www.googleapis.com/auth/dfareporting"
  25659. // ]
  25660. // }
  25661. }
  25662. // Pages invokes f for each page of results.
  25663. // A non-nil error returned from f will halt the iteration.
  25664. // The provided context supersedes any context provided to the Context method.
  25665. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25666. c.ctx_ = ctx
  25667. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25668. for {
  25669. x, err := c.Do()
  25670. if err != nil {
  25671. return err
  25672. }
  25673. if err := f(x); err != nil {
  25674. return err
  25675. }
  25676. if x.NextPageToken == "" {
  25677. return nil
  25678. }
  25679. c.PageToken(x.NextPageToken)
  25680. }
  25681. }
  25682. // method id "dfareporting.directorySiteContacts.get":
  25683. type DirectorySiteContactsGetCall struct {
  25684. s *Service
  25685. profileId int64
  25686. id int64
  25687. urlParams_ gensupport.URLParams
  25688. ifNoneMatch_ string
  25689. ctx_ context.Context
  25690. header_ http.Header
  25691. }
  25692. // Get: Gets one directory site contact by ID.
  25693. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  25694. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25695. c.profileId = profileId
  25696. c.id = id
  25697. return c
  25698. }
  25699. // Fields allows partial responses to be retrieved. See
  25700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25701. // for more information.
  25702. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  25703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25704. return c
  25705. }
  25706. // IfNoneMatch sets the optional parameter which makes the operation
  25707. // fail if the object's ETag matches the given value. This is useful for
  25708. // getting updates only after the object has changed since the last
  25709. // request. Use googleapi.IsNotModified to check whether the response
  25710. // error from Do is the result of In-None-Match.
  25711. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  25712. c.ifNoneMatch_ = entityTag
  25713. return c
  25714. }
  25715. // Context sets the context to be used in this call's Do method. Any
  25716. // pending HTTP request will be aborted if the provided context is
  25717. // canceled.
  25718. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  25719. c.ctx_ = ctx
  25720. return c
  25721. }
  25722. // Header returns an http.Header that can be modified by the caller to
  25723. // add HTTP headers to the request.
  25724. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  25725. if c.header_ == nil {
  25726. c.header_ = make(http.Header)
  25727. }
  25728. return c.header_
  25729. }
  25730. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  25731. reqHeaders := make(http.Header)
  25732. for k, v := range c.header_ {
  25733. reqHeaders[k] = v
  25734. }
  25735. reqHeaders.Set("User-Agent", c.s.userAgent())
  25736. if c.ifNoneMatch_ != "" {
  25737. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25738. }
  25739. var body io.Reader = nil
  25740. c.urlParams_.Set("alt", alt)
  25741. c.urlParams_.Set("prettyPrint", "false")
  25742. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  25743. urls += "?" + c.urlParams_.Encode()
  25744. req, err := http.NewRequest("GET", urls, body)
  25745. if err != nil {
  25746. return nil, err
  25747. }
  25748. req.Header = reqHeaders
  25749. googleapi.Expand(req.URL, map[string]string{
  25750. "profileId": strconv.FormatInt(c.profileId, 10),
  25751. "id": strconv.FormatInt(c.id, 10),
  25752. })
  25753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25754. }
  25755. // Do executes the "dfareporting.directorySiteContacts.get" call.
  25756. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  25757. // non-2xx status code is an error. Response headers are in either
  25758. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  25759. // returned at all) in error.(*googleapi.Error).Header. Use
  25760. // googleapi.IsNotModified to check whether the returned error was
  25761. // because http.StatusNotModified was returned.
  25762. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  25763. gensupport.SetOptions(c.urlParams_, opts...)
  25764. res, err := c.doRequest("json")
  25765. if res != nil && res.StatusCode == http.StatusNotModified {
  25766. if res.Body != nil {
  25767. res.Body.Close()
  25768. }
  25769. return nil, &googleapi.Error{
  25770. Code: res.StatusCode,
  25771. Header: res.Header,
  25772. }
  25773. }
  25774. if err != nil {
  25775. return nil, err
  25776. }
  25777. defer googleapi.CloseBody(res)
  25778. if err := googleapi.CheckResponse(res); err != nil {
  25779. return nil, err
  25780. }
  25781. ret := &DirectorySiteContact{
  25782. ServerResponse: googleapi.ServerResponse{
  25783. Header: res.Header,
  25784. HTTPStatusCode: res.StatusCode,
  25785. },
  25786. }
  25787. target := &ret
  25788. if err := gensupport.DecodeResponse(target, res); err != nil {
  25789. return nil, err
  25790. }
  25791. return ret, nil
  25792. // {
  25793. // "description": "Gets one directory site contact by ID.",
  25794. // "httpMethod": "GET",
  25795. // "id": "dfareporting.directorySiteContacts.get",
  25796. // "parameterOrder": [
  25797. // "profileId",
  25798. // "id"
  25799. // ],
  25800. // "parameters": {
  25801. // "id": {
  25802. // "description": "Directory site contact ID.",
  25803. // "format": "int64",
  25804. // "location": "path",
  25805. // "required": true,
  25806. // "type": "string"
  25807. // },
  25808. // "profileId": {
  25809. // "description": "User profile ID associated with this request.",
  25810. // "format": "int64",
  25811. // "location": "path",
  25812. // "required": true,
  25813. // "type": "string"
  25814. // }
  25815. // },
  25816. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  25817. // "response": {
  25818. // "$ref": "DirectorySiteContact"
  25819. // },
  25820. // "scopes": [
  25821. // "https://www.googleapis.com/auth/dfatrafficking"
  25822. // ]
  25823. // }
  25824. }
  25825. // method id "dfareporting.directorySiteContacts.list":
  25826. type DirectorySiteContactsListCall struct {
  25827. s *Service
  25828. profileId int64
  25829. urlParams_ gensupport.URLParams
  25830. ifNoneMatch_ string
  25831. ctx_ context.Context
  25832. header_ http.Header
  25833. }
  25834. // List: Retrieves a list of directory site contacts, possibly filtered.
  25835. // This method supports paging.
  25836. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  25837. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25838. c.profileId = profileId
  25839. return c
  25840. }
  25841. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  25842. // Select only directory site contacts with these directory site IDs.
  25843. // This is a required field.
  25844. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  25845. var directorySiteIds_ []string
  25846. for _, v := range directorySiteIds {
  25847. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  25848. }
  25849. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  25850. return c
  25851. }
  25852. // Ids sets the optional parameter "ids": Select only directory site
  25853. // contacts with these IDs.
  25854. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  25855. var ids_ []string
  25856. for _, v := range ids {
  25857. ids_ = append(ids_, fmt.Sprint(v))
  25858. }
  25859. c.urlParams_.SetMulti("ids", ids_)
  25860. return c
  25861. }
  25862. // MaxResults sets the optional parameter "maxResults": Maximum number
  25863. // of results to return.
  25864. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  25865. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25866. return c
  25867. }
  25868. // PageToken sets the optional parameter "pageToken": Value of the
  25869. // nextPageToken from the previous result page.
  25870. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  25871. c.urlParams_.Set("pageToken", pageToken)
  25872. return c
  25873. }
  25874. // SearchString sets the optional parameter "searchString": Allows
  25875. // searching for objects by name, ID or email. Wildcards (*) are
  25876. // allowed. For example, "directory site contact*2015" will return
  25877. // objects with names like "directory site contact June 2015",
  25878. // "directory site contact April 2015", or simply "directory site
  25879. // contact 2015". Most of the searches also add wildcards implicitly at
  25880. // the start and the end of the search string. For example, a search
  25881. // string of "directory site contact" will match objects with name "my
  25882. // directory site contact", "directory site contact 2015", or simply
  25883. // "directory site contact".
  25884. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  25885. c.urlParams_.Set("searchString", searchString)
  25886. return c
  25887. }
  25888. // SortField sets the optional parameter "sortField": Field by which to
  25889. // sort the list.
  25890. //
  25891. // Possible values:
  25892. // "ID" (default)
  25893. // "NAME"
  25894. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  25895. c.urlParams_.Set("sortField", sortField)
  25896. return c
  25897. }
  25898. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25899. // results.
  25900. //
  25901. // Possible values:
  25902. // "ASCENDING" (default)
  25903. // "DESCENDING"
  25904. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  25905. c.urlParams_.Set("sortOrder", sortOrder)
  25906. return c
  25907. }
  25908. // Fields allows partial responses to be retrieved. See
  25909. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25910. // for more information.
  25911. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  25912. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25913. return c
  25914. }
  25915. // IfNoneMatch sets the optional parameter which makes the operation
  25916. // fail if the object's ETag matches the given value. This is useful for
  25917. // getting updates only after the object has changed since the last
  25918. // request. Use googleapi.IsNotModified to check whether the response
  25919. // error from Do is the result of In-None-Match.
  25920. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  25921. c.ifNoneMatch_ = entityTag
  25922. return c
  25923. }
  25924. // Context sets the context to be used in this call's Do method. Any
  25925. // pending HTTP request will be aborted if the provided context is
  25926. // canceled.
  25927. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  25928. c.ctx_ = ctx
  25929. return c
  25930. }
  25931. // Header returns an http.Header that can be modified by the caller to
  25932. // add HTTP headers to the request.
  25933. func (c *DirectorySiteContactsListCall) Header() http.Header {
  25934. if c.header_ == nil {
  25935. c.header_ = make(http.Header)
  25936. }
  25937. return c.header_
  25938. }
  25939. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  25940. reqHeaders := make(http.Header)
  25941. for k, v := range c.header_ {
  25942. reqHeaders[k] = v
  25943. }
  25944. reqHeaders.Set("User-Agent", c.s.userAgent())
  25945. if c.ifNoneMatch_ != "" {
  25946. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25947. }
  25948. var body io.Reader = nil
  25949. c.urlParams_.Set("alt", alt)
  25950. c.urlParams_.Set("prettyPrint", "false")
  25951. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  25952. urls += "?" + c.urlParams_.Encode()
  25953. req, err := http.NewRequest("GET", urls, body)
  25954. if err != nil {
  25955. return nil, err
  25956. }
  25957. req.Header = reqHeaders
  25958. googleapi.Expand(req.URL, map[string]string{
  25959. "profileId": strconv.FormatInt(c.profileId, 10),
  25960. })
  25961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25962. }
  25963. // Do executes the "dfareporting.directorySiteContacts.list" call.
  25964. // Exactly one of *DirectorySiteContactsListResponse or error will be
  25965. // non-nil. Any non-2xx status code is an error. Response headers are in
  25966. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  25967. // (if a response was returned at all) in
  25968. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  25969. // whether the returned error was because http.StatusNotModified was
  25970. // returned.
  25971. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  25972. gensupport.SetOptions(c.urlParams_, opts...)
  25973. res, err := c.doRequest("json")
  25974. if res != nil && res.StatusCode == http.StatusNotModified {
  25975. if res.Body != nil {
  25976. res.Body.Close()
  25977. }
  25978. return nil, &googleapi.Error{
  25979. Code: res.StatusCode,
  25980. Header: res.Header,
  25981. }
  25982. }
  25983. if err != nil {
  25984. return nil, err
  25985. }
  25986. defer googleapi.CloseBody(res)
  25987. if err := googleapi.CheckResponse(res); err != nil {
  25988. return nil, err
  25989. }
  25990. ret := &DirectorySiteContactsListResponse{
  25991. ServerResponse: googleapi.ServerResponse{
  25992. Header: res.Header,
  25993. HTTPStatusCode: res.StatusCode,
  25994. },
  25995. }
  25996. target := &ret
  25997. if err := gensupport.DecodeResponse(target, res); err != nil {
  25998. return nil, err
  25999. }
  26000. return ret, nil
  26001. // {
  26002. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  26003. // "httpMethod": "GET",
  26004. // "id": "dfareporting.directorySiteContacts.list",
  26005. // "parameterOrder": [
  26006. // "profileId"
  26007. // ],
  26008. // "parameters": {
  26009. // "directorySiteIds": {
  26010. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  26011. // "format": "int64",
  26012. // "location": "query",
  26013. // "repeated": true,
  26014. // "type": "string"
  26015. // },
  26016. // "ids": {
  26017. // "description": "Select only directory site contacts with these IDs.",
  26018. // "format": "int64",
  26019. // "location": "query",
  26020. // "repeated": true,
  26021. // "type": "string"
  26022. // },
  26023. // "maxResults": {
  26024. // "default": "1000",
  26025. // "description": "Maximum number of results to return.",
  26026. // "format": "int32",
  26027. // "location": "query",
  26028. // "maximum": "1000",
  26029. // "minimum": "0",
  26030. // "type": "integer"
  26031. // },
  26032. // "pageToken": {
  26033. // "description": "Value of the nextPageToken from the previous result page.",
  26034. // "location": "query",
  26035. // "type": "string"
  26036. // },
  26037. // "profileId": {
  26038. // "description": "User profile ID associated with this request.",
  26039. // "format": "int64",
  26040. // "location": "path",
  26041. // "required": true,
  26042. // "type": "string"
  26043. // },
  26044. // "searchString": {
  26045. // "description": "Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, \"directory site contact*2015\" will return objects with names like \"directory site contact June 2015\", \"directory site contact April 2015\", or simply \"directory site contact 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site contact\" will match objects with name \"my directory site contact\", \"directory site contact 2015\", or simply \"directory site contact\".",
  26046. // "location": "query",
  26047. // "type": "string"
  26048. // },
  26049. // "sortField": {
  26050. // "default": "ID",
  26051. // "description": "Field by which to sort the list.",
  26052. // "enum": [
  26053. // "ID",
  26054. // "NAME"
  26055. // ],
  26056. // "enumDescriptions": [
  26057. // "",
  26058. // ""
  26059. // ],
  26060. // "location": "query",
  26061. // "type": "string"
  26062. // },
  26063. // "sortOrder": {
  26064. // "default": "ASCENDING",
  26065. // "description": "Order of sorted results.",
  26066. // "enum": [
  26067. // "ASCENDING",
  26068. // "DESCENDING"
  26069. // ],
  26070. // "enumDescriptions": [
  26071. // "",
  26072. // ""
  26073. // ],
  26074. // "location": "query",
  26075. // "type": "string"
  26076. // }
  26077. // },
  26078. // "path": "userprofiles/{profileId}/directorySiteContacts",
  26079. // "response": {
  26080. // "$ref": "DirectorySiteContactsListResponse"
  26081. // },
  26082. // "scopes": [
  26083. // "https://www.googleapis.com/auth/dfatrafficking"
  26084. // ]
  26085. // }
  26086. }
  26087. // Pages invokes f for each page of results.
  26088. // A non-nil error returned from f will halt the iteration.
  26089. // The provided context supersedes any context provided to the Context method.
  26090. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  26091. c.ctx_ = ctx
  26092. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26093. for {
  26094. x, err := c.Do()
  26095. if err != nil {
  26096. return err
  26097. }
  26098. if err := f(x); err != nil {
  26099. return err
  26100. }
  26101. if x.NextPageToken == "" {
  26102. return nil
  26103. }
  26104. c.PageToken(x.NextPageToken)
  26105. }
  26106. }
  26107. // method id "dfareporting.directorySites.get":
  26108. type DirectorySitesGetCall struct {
  26109. s *Service
  26110. profileId int64
  26111. id int64
  26112. urlParams_ gensupport.URLParams
  26113. ifNoneMatch_ string
  26114. ctx_ context.Context
  26115. header_ http.Header
  26116. }
  26117. // Get: Gets one directory site by ID.
  26118. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  26119. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26120. c.profileId = profileId
  26121. c.id = id
  26122. return c
  26123. }
  26124. // Fields allows partial responses to be retrieved. See
  26125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26126. // for more information.
  26127. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  26128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26129. return c
  26130. }
  26131. // IfNoneMatch sets the optional parameter which makes the operation
  26132. // fail if the object's ETag matches the given value. This is useful for
  26133. // getting updates only after the object has changed since the last
  26134. // request. Use googleapi.IsNotModified to check whether the response
  26135. // error from Do is the result of In-None-Match.
  26136. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  26137. c.ifNoneMatch_ = entityTag
  26138. return c
  26139. }
  26140. // Context sets the context to be used in this call's Do method. Any
  26141. // pending HTTP request will be aborted if the provided context is
  26142. // canceled.
  26143. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  26144. c.ctx_ = ctx
  26145. return c
  26146. }
  26147. // Header returns an http.Header that can be modified by the caller to
  26148. // add HTTP headers to the request.
  26149. func (c *DirectorySitesGetCall) Header() http.Header {
  26150. if c.header_ == nil {
  26151. c.header_ = make(http.Header)
  26152. }
  26153. return c.header_
  26154. }
  26155. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  26156. reqHeaders := make(http.Header)
  26157. for k, v := range c.header_ {
  26158. reqHeaders[k] = v
  26159. }
  26160. reqHeaders.Set("User-Agent", c.s.userAgent())
  26161. if c.ifNoneMatch_ != "" {
  26162. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26163. }
  26164. var body io.Reader = nil
  26165. c.urlParams_.Set("alt", alt)
  26166. c.urlParams_.Set("prettyPrint", "false")
  26167. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  26168. urls += "?" + c.urlParams_.Encode()
  26169. req, err := http.NewRequest("GET", urls, body)
  26170. if err != nil {
  26171. return nil, err
  26172. }
  26173. req.Header = reqHeaders
  26174. googleapi.Expand(req.URL, map[string]string{
  26175. "profileId": strconv.FormatInt(c.profileId, 10),
  26176. "id": strconv.FormatInt(c.id, 10),
  26177. })
  26178. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26179. }
  26180. // Do executes the "dfareporting.directorySites.get" call.
  26181. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26182. // status code is an error. Response headers are in either
  26183. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26184. // at all) in error.(*googleapi.Error).Header. Use
  26185. // googleapi.IsNotModified to check whether the returned error was
  26186. // because http.StatusNotModified was returned.
  26187. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26188. gensupport.SetOptions(c.urlParams_, opts...)
  26189. res, err := c.doRequest("json")
  26190. if res != nil && res.StatusCode == http.StatusNotModified {
  26191. if res.Body != nil {
  26192. res.Body.Close()
  26193. }
  26194. return nil, &googleapi.Error{
  26195. Code: res.StatusCode,
  26196. Header: res.Header,
  26197. }
  26198. }
  26199. if err != nil {
  26200. return nil, err
  26201. }
  26202. defer googleapi.CloseBody(res)
  26203. if err := googleapi.CheckResponse(res); err != nil {
  26204. return nil, err
  26205. }
  26206. ret := &DirectorySite{
  26207. ServerResponse: googleapi.ServerResponse{
  26208. Header: res.Header,
  26209. HTTPStatusCode: res.StatusCode,
  26210. },
  26211. }
  26212. target := &ret
  26213. if err := gensupport.DecodeResponse(target, res); err != nil {
  26214. return nil, err
  26215. }
  26216. return ret, nil
  26217. // {
  26218. // "description": "Gets one directory site by ID.",
  26219. // "httpMethod": "GET",
  26220. // "id": "dfareporting.directorySites.get",
  26221. // "parameterOrder": [
  26222. // "profileId",
  26223. // "id"
  26224. // ],
  26225. // "parameters": {
  26226. // "id": {
  26227. // "description": "Directory site ID.",
  26228. // "format": "int64",
  26229. // "location": "path",
  26230. // "required": true,
  26231. // "type": "string"
  26232. // },
  26233. // "profileId": {
  26234. // "description": "User profile ID associated with this request.",
  26235. // "format": "int64",
  26236. // "location": "path",
  26237. // "required": true,
  26238. // "type": "string"
  26239. // }
  26240. // },
  26241. // "path": "userprofiles/{profileId}/directorySites/{id}",
  26242. // "response": {
  26243. // "$ref": "DirectorySite"
  26244. // },
  26245. // "scopes": [
  26246. // "https://www.googleapis.com/auth/dfatrafficking"
  26247. // ]
  26248. // }
  26249. }
  26250. // method id "dfareporting.directorySites.insert":
  26251. type DirectorySitesInsertCall struct {
  26252. s *Service
  26253. profileId int64
  26254. directorysite *DirectorySite
  26255. urlParams_ gensupport.URLParams
  26256. ctx_ context.Context
  26257. header_ http.Header
  26258. }
  26259. // Insert: Inserts a new directory site.
  26260. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  26261. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26262. c.profileId = profileId
  26263. c.directorysite = directorysite
  26264. return c
  26265. }
  26266. // Fields allows partial responses to be retrieved. See
  26267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26268. // for more information.
  26269. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  26270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26271. return c
  26272. }
  26273. // Context sets the context to be used in this call's Do method. Any
  26274. // pending HTTP request will be aborted if the provided context is
  26275. // canceled.
  26276. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  26277. c.ctx_ = ctx
  26278. return c
  26279. }
  26280. // Header returns an http.Header that can be modified by the caller to
  26281. // add HTTP headers to the request.
  26282. func (c *DirectorySitesInsertCall) Header() http.Header {
  26283. if c.header_ == nil {
  26284. c.header_ = make(http.Header)
  26285. }
  26286. return c.header_
  26287. }
  26288. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  26289. reqHeaders := make(http.Header)
  26290. for k, v := range c.header_ {
  26291. reqHeaders[k] = v
  26292. }
  26293. reqHeaders.Set("User-Agent", c.s.userAgent())
  26294. var body io.Reader = nil
  26295. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  26296. if err != nil {
  26297. return nil, err
  26298. }
  26299. reqHeaders.Set("Content-Type", "application/json")
  26300. c.urlParams_.Set("alt", alt)
  26301. c.urlParams_.Set("prettyPrint", "false")
  26302. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26303. urls += "?" + c.urlParams_.Encode()
  26304. req, err := http.NewRequest("POST", urls, body)
  26305. if err != nil {
  26306. return nil, err
  26307. }
  26308. req.Header = reqHeaders
  26309. googleapi.Expand(req.URL, map[string]string{
  26310. "profileId": strconv.FormatInt(c.profileId, 10),
  26311. })
  26312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26313. }
  26314. // Do executes the "dfareporting.directorySites.insert" call.
  26315. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  26316. // status code is an error. Response headers are in either
  26317. // *DirectorySite.ServerResponse.Header or (if a response was returned
  26318. // at all) in error.(*googleapi.Error).Header. Use
  26319. // googleapi.IsNotModified to check whether the returned error was
  26320. // because http.StatusNotModified was returned.
  26321. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  26322. gensupport.SetOptions(c.urlParams_, opts...)
  26323. res, err := c.doRequest("json")
  26324. if res != nil && res.StatusCode == http.StatusNotModified {
  26325. if res.Body != nil {
  26326. res.Body.Close()
  26327. }
  26328. return nil, &googleapi.Error{
  26329. Code: res.StatusCode,
  26330. Header: res.Header,
  26331. }
  26332. }
  26333. if err != nil {
  26334. return nil, err
  26335. }
  26336. defer googleapi.CloseBody(res)
  26337. if err := googleapi.CheckResponse(res); err != nil {
  26338. return nil, err
  26339. }
  26340. ret := &DirectorySite{
  26341. ServerResponse: googleapi.ServerResponse{
  26342. Header: res.Header,
  26343. HTTPStatusCode: res.StatusCode,
  26344. },
  26345. }
  26346. target := &ret
  26347. if err := gensupport.DecodeResponse(target, res); err != nil {
  26348. return nil, err
  26349. }
  26350. return ret, nil
  26351. // {
  26352. // "description": "Inserts a new directory site.",
  26353. // "httpMethod": "POST",
  26354. // "id": "dfareporting.directorySites.insert",
  26355. // "parameterOrder": [
  26356. // "profileId"
  26357. // ],
  26358. // "parameters": {
  26359. // "profileId": {
  26360. // "description": "User profile ID associated with this request.",
  26361. // "format": "int64",
  26362. // "location": "path",
  26363. // "required": true,
  26364. // "type": "string"
  26365. // }
  26366. // },
  26367. // "path": "userprofiles/{profileId}/directorySites",
  26368. // "request": {
  26369. // "$ref": "DirectorySite"
  26370. // },
  26371. // "response": {
  26372. // "$ref": "DirectorySite"
  26373. // },
  26374. // "scopes": [
  26375. // "https://www.googleapis.com/auth/dfatrafficking"
  26376. // ]
  26377. // }
  26378. }
  26379. // method id "dfareporting.directorySites.list":
  26380. type DirectorySitesListCall struct {
  26381. s *Service
  26382. profileId int64
  26383. urlParams_ gensupport.URLParams
  26384. ifNoneMatch_ string
  26385. ctx_ context.Context
  26386. header_ http.Header
  26387. }
  26388. // List: Retrieves a list of directory sites, possibly filtered. This
  26389. // method supports paging.
  26390. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26391. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26392. c.profileId = profileId
  26393. return c
  26394. }
  26395. // AcceptsInStreamVideoPlacements sets the optional parameter
  26396. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26397. // supported and will have no effect on the results returned.
  26398. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26399. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26400. return c
  26401. }
  26402. // AcceptsInterstitialPlacements sets the optional parameter
  26403. // "acceptsInterstitialPlacements": This search filter is no longer
  26404. // supported and will have no effect on the results returned.
  26405. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26406. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26407. return c
  26408. }
  26409. // AcceptsPublisherPaidPlacements sets the optional parameter
  26410. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26411. // accept publisher paid placements. This field can be left blank.
  26412. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26413. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26414. return c
  26415. }
  26416. // Active sets the optional parameter "active": Select only active
  26417. // directory sites. Leave blank to retrieve both active and inactive
  26418. // directory sites.
  26419. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26420. c.urlParams_.Set("active", fmt.Sprint(active))
  26421. return c
  26422. }
  26423. // CountryId sets the optional parameter "countryId": Select only
  26424. // directory sites with this country ID.
  26425. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  26426. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  26427. return c
  26428. }
  26429. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26430. // only directory sites with this Ad Manager network code.
  26431. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26432. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26433. return c
  26434. }
  26435. // Ids sets the optional parameter "ids": Select only directory sites
  26436. // with these IDs.
  26437. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26438. var ids_ []string
  26439. for _, v := range ids {
  26440. ids_ = append(ids_, fmt.Sprint(v))
  26441. }
  26442. c.urlParams_.SetMulti("ids", ids_)
  26443. return c
  26444. }
  26445. // MaxResults sets the optional parameter "maxResults": Maximum number
  26446. // of results to return.
  26447. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26448. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26449. return c
  26450. }
  26451. // PageToken sets the optional parameter "pageToken": Value of the
  26452. // nextPageToken from the previous result page.
  26453. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26454. c.urlParams_.Set("pageToken", pageToken)
  26455. return c
  26456. }
  26457. // ParentId sets the optional parameter "parentId": Select only
  26458. // directory sites with this parent ID.
  26459. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  26460. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  26461. return c
  26462. }
  26463. // SearchString sets the optional parameter "searchString": Allows
  26464. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26465. // For example, "directory site*2015" will return objects with names
  26466. // like "directory site June 2015", "directory site April 2015", or
  26467. // simply "directory site 2015". Most of the searches also add wildcards
  26468. // implicitly at the start and the end of the search string. For
  26469. // example, a search string of "directory site" will match objects with
  26470. // name "my directory site", "directory site 2015" or simply, "directory
  26471. // site".
  26472. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26473. c.urlParams_.Set("searchString", searchString)
  26474. return c
  26475. }
  26476. // SortField sets the optional parameter "sortField": Field by which to
  26477. // sort the list.
  26478. //
  26479. // Possible values:
  26480. // "ID" (default)
  26481. // "NAME"
  26482. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26483. c.urlParams_.Set("sortField", sortField)
  26484. return c
  26485. }
  26486. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26487. // results.
  26488. //
  26489. // Possible values:
  26490. // "ASCENDING" (default)
  26491. // "DESCENDING"
  26492. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26493. c.urlParams_.Set("sortOrder", sortOrder)
  26494. return c
  26495. }
  26496. // Fields allows partial responses to be retrieved. See
  26497. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26498. // for more information.
  26499. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26500. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26501. return c
  26502. }
  26503. // IfNoneMatch sets the optional parameter which makes the operation
  26504. // fail if the object's ETag matches the given value. This is useful for
  26505. // getting updates only after the object has changed since the last
  26506. // request. Use googleapi.IsNotModified to check whether the response
  26507. // error from Do is the result of In-None-Match.
  26508. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26509. c.ifNoneMatch_ = entityTag
  26510. return c
  26511. }
  26512. // Context sets the context to be used in this call's Do method. Any
  26513. // pending HTTP request will be aborted if the provided context is
  26514. // canceled.
  26515. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26516. c.ctx_ = ctx
  26517. return c
  26518. }
  26519. // Header returns an http.Header that can be modified by the caller to
  26520. // add HTTP headers to the request.
  26521. func (c *DirectorySitesListCall) Header() http.Header {
  26522. if c.header_ == nil {
  26523. c.header_ = make(http.Header)
  26524. }
  26525. return c.header_
  26526. }
  26527. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26528. reqHeaders := make(http.Header)
  26529. for k, v := range c.header_ {
  26530. reqHeaders[k] = v
  26531. }
  26532. reqHeaders.Set("User-Agent", c.s.userAgent())
  26533. if c.ifNoneMatch_ != "" {
  26534. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26535. }
  26536. var body io.Reader = nil
  26537. c.urlParams_.Set("alt", alt)
  26538. c.urlParams_.Set("prettyPrint", "false")
  26539. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26540. urls += "?" + c.urlParams_.Encode()
  26541. req, err := http.NewRequest("GET", urls, body)
  26542. if err != nil {
  26543. return nil, err
  26544. }
  26545. req.Header = reqHeaders
  26546. googleapi.Expand(req.URL, map[string]string{
  26547. "profileId": strconv.FormatInt(c.profileId, 10),
  26548. })
  26549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26550. }
  26551. // Do executes the "dfareporting.directorySites.list" call.
  26552. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26553. // Any non-2xx status code is an error. Response headers are in either
  26554. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26555. // was returned at all) in error.(*googleapi.Error).Header. Use
  26556. // googleapi.IsNotModified to check whether the returned error was
  26557. // because http.StatusNotModified was returned.
  26558. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26559. gensupport.SetOptions(c.urlParams_, opts...)
  26560. res, err := c.doRequest("json")
  26561. if res != nil && res.StatusCode == http.StatusNotModified {
  26562. if res.Body != nil {
  26563. res.Body.Close()
  26564. }
  26565. return nil, &googleapi.Error{
  26566. Code: res.StatusCode,
  26567. Header: res.Header,
  26568. }
  26569. }
  26570. if err != nil {
  26571. return nil, err
  26572. }
  26573. defer googleapi.CloseBody(res)
  26574. if err := googleapi.CheckResponse(res); err != nil {
  26575. return nil, err
  26576. }
  26577. ret := &DirectorySitesListResponse{
  26578. ServerResponse: googleapi.ServerResponse{
  26579. Header: res.Header,
  26580. HTTPStatusCode: res.StatusCode,
  26581. },
  26582. }
  26583. target := &ret
  26584. if err := gensupport.DecodeResponse(target, res); err != nil {
  26585. return nil, err
  26586. }
  26587. return ret, nil
  26588. // {
  26589. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26590. // "httpMethod": "GET",
  26591. // "id": "dfareporting.directorySites.list",
  26592. // "parameterOrder": [
  26593. // "profileId"
  26594. // ],
  26595. // "parameters": {
  26596. // "acceptsInStreamVideoPlacements": {
  26597. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26598. // "location": "query",
  26599. // "type": "boolean"
  26600. // },
  26601. // "acceptsInterstitialPlacements": {
  26602. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26603. // "location": "query",
  26604. // "type": "boolean"
  26605. // },
  26606. // "acceptsPublisherPaidPlacements": {
  26607. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26608. // "location": "query",
  26609. // "type": "boolean"
  26610. // },
  26611. // "active": {
  26612. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26613. // "location": "query",
  26614. // "type": "boolean"
  26615. // },
  26616. // "countryId": {
  26617. // "description": "Select only directory sites with this country ID.",
  26618. // "format": "int64",
  26619. // "location": "query",
  26620. // "type": "string"
  26621. // },
  26622. // "dfpNetworkCode": {
  26623. // "description": "Select only directory sites with this Ad Manager network code.",
  26624. // "location": "query",
  26625. // "type": "string"
  26626. // },
  26627. // "ids": {
  26628. // "description": "Select only directory sites with these IDs.",
  26629. // "format": "int64",
  26630. // "location": "query",
  26631. // "repeated": true,
  26632. // "type": "string"
  26633. // },
  26634. // "maxResults": {
  26635. // "default": "1000",
  26636. // "description": "Maximum number of results to return.",
  26637. // "format": "int32",
  26638. // "location": "query",
  26639. // "maximum": "1000",
  26640. // "minimum": "0",
  26641. // "type": "integer"
  26642. // },
  26643. // "pageToken": {
  26644. // "description": "Value of the nextPageToken from the previous result page.",
  26645. // "location": "query",
  26646. // "type": "string"
  26647. // },
  26648. // "parentId": {
  26649. // "description": "Select only directory sites with this parent ID.",
  26650. // "format": "int64",
  26651. // "location": "query",
  26652. // "type": "string"
  26653. // },
  26654. // "profileId": {
  26655. // "description": "User profile ID associated with this request.",
  26656. // "format": "int64",
  26657. // "location": "path",
  26658. // "required": true,
  26659. // "type": "string"
  26660. // },
  26661. // "searchString": {
  26662. // "description": "Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, \"directory site*2015\" will return objects with names like \"directory site June 2015\", \"directory site April 2015\", or simply \"directory site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"directory site\" will match objects with name \"my directory site\", \"directory site 2015\" or simply, \"directory site\".",
  26663. // "location": "query",
  26664. // "type": "string"
  26665. // },
  26666. // "sortField": {
  26667. // "default": "ID",
  26668. // "description": "Field by which to sort the list.",
  26669. // "enum": [
  26670. // "ID",
  26671. // "NAME"
  26672. // ],
  26673. // "enumDescriptions": [
  26674. // "",
  26675. // ""
  26676. // ],
  26677. // "location": "query",
  26678. // "type": "string"
  26679. // },
  26680. // "sortOrder": {
  26681. // "default": "ASCENDING",
  26682. // "description": "Order of sorted results.",
  26683. // "enum": [
  26684. // "ASCENDING",
  26685. // "DESCENDING"
  26686. // ],
  26687. // "enumDescriptions": [
  26688. // "",
  26689. // ""
  26690. // ],
  26691. // "location": "query",
  26692. // "type": "string"
  26693. // }
  26694. // },
  26695. // "path": "userprofiles/{profileId}/directorySites",
  26696. // "response": {
  26697. // "$ref": "DirectorySitesListResponse"
  26698. // },
  26699. // "scopes": [
  26700. // "https://www.googleapis.com/auth/dfatrafficking"
  26701. // ]
  26702. // }
  26703. }
  26704. // Pages invokes f for each page of results.
  26705. // A non-nil error returned from f will halt the iteration.
  26706. // The provided context supersedes any context provided to the Context method.
  26707. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26708. c.ctx_ = ctx
  26709. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26710. for {
  26711. x, err := c.Do()
  26712. if err != nil {
  26713. return err
  26714. }
  26715. if err := f(x); err != nil {
  26716. return err
  26717. }
  26718. if x.NextPageToken == "" {
  26719. return nil
  26720. }
  26721. c.PageToken(x.NextPageToken)
  26722. }
  26723. }
  26724. // method id "dfareporting.dynamicTargetingKeys.delete":
  26725. type DynamicTargetingKeysDeleteCall struct {
  26726. s *Service
  26727. profileId int64
  26728. objectId int64
  26729. urlParams_ gensupport.URLParams
  26730. ctx_ context.Context
  26731. header_ http.Header
  26732. }
  26733. // Delete: Deletes an existing dynamic targeting key.
  26734. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26735. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26736. c.profileId = profileId
  26737. c.objectId = objectId
  26738. c.urlParams_.Set("name", name)
  26739. c.urlParams_.Set("objectType", objectType)
  26740. return c
  26741. }
  26742. // Fields allows partial responses to be retrieved. See
  26743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26744. // for more information.
  26745. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26747. return c
  26748. }
  26749. // Context sets the context to be used in this call's Do method. Any
  26750. // pending HTTP request will be aborted if the provided context is
  26751. // canceled.
  26752. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26753. c.ctx_ = ctx
  26754. return c
  26755. }
  26756. // Header returns an http.Header that can be modified by the caller to
  26757. // add HTTP headers to the request.
  26758. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26759. if c.header_ == nil {
  26760. c.header_ = make(http.Header)
  26761. }
  26762. return c.header_
  26763. }
  26764. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26765. reqHeaders := make(http.Header)
  26766. for k, v := range c.header_ {
  26767. reqHeaders[k] = v
  26768. }
  26769. reqHeaders.Set("User-Agent", c.s.userAgent())
  26770. var body io.Reader = nil
  26771. c.urlParams_.Set("alt", alt)
  26772. c.urlParams_.Set("prettyPrint", "false")
  26773. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  26774. urls += "?" + c.urlParams_.Encode()
  26775. req, err := http.NewRequest("DELETE", urls, body)
  26776. if err != nil {
  26777. return nil, err
  26778. }
  26779. req.Header = reqHeaders
  26780. googleapi.Expand(req.URL, map[string]string{
  26781. "profileId": strconv.FormatInt(c.profileId, 10),
  26782. "objectId": strconv.FormatInt(c.objectId, 10),
  26783. })
  26784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26785. }
  26786. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  26787. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  26788. gensupport.SetOptions(c.urlParams_, opts...)
  26789. res, err := c.doRequest("json")
  26790. if err != nil {
  26791. return err
  26792. }
  26793. defer googleapi.CloseBody(res)
  26794. if err := googleapi.CheckResponse(res); err != nil {
  26795. return err
  26796. }
  26797. return nil
  26798. // {
  26799. // "description": "Deletes an existing dynamic targeting key.",
  26800. // "httpMethod": "DELETE",
  26801. // "id": "dfareporting.dynamicTargetingKeys.delete",
  26802. // "parameterOrder": [
  26803. // "profileId",
  26804. // "objectId",
  26805. // "name",
  26806. // "objectType"
  26807. // ],
  26808. // "parameters": {
  26809. // "name": {
  26810. // "description": "Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase.",
  26811. // "location": "query",
  26812. // "required": true,
  26813. // "type": "string"
  26814. // },
  26815. // "objectId": {
  26816. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  26817. // "format": "int64",
  26818. // "location": "path",
  26819. // "required": true,
  26820. // "type": "string"
  26821. // },
  26822. // "objectType": {
  26823. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  26824. // "enum": [
  26825. // "OBJECT_AD",
  26826. // "OBJECT_ADVERTISER",
  26827. // "OBJECT_CREATIVE",
  26828. // "OBJECT_PLACEMENT"
  26829. // ],
  26830. // "enumDescriptions": [
  26831. // "",
  26832. // "",
  26833. // "",
  26834. // ""
  26835. // ],
  26836. // "location": "query",
  26837. // "required": true,
  26838. // "type": "string"
  26839. // },
  26840. // "profileId": {
  26841. // "description": "User profile ID associated with this request.",
  26842. // "format": "int64",
  26843. // "location": "path",
  26844. // "required": true,
  26845. // "type": "string"
  26846. // }
  26847. // },
  26848. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  26849. // "scopes": [
  26850. // "https://www.googleapis.com/auth/dfatrafficking"
  26851. // ]
  26852. // }
  26853. }
  26854. // method id "dfareporting.dynamicTargetingKeys.insert":
  26855. type DynamicTargetingKeysInsertCall struct {
  26856. s *Service
  26857. profileId int64
  26858. dynamictargetingkey *DynamicTargetingKey
  26859. urlParams_ gensupport.URLParams
  26860. ctx_ context.Context
  26861. header_ http.Header
  26862. }
  26863. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  26864. // the advertiser level before being assigned to the advertiser's ads,
  26865. // creatives, or placements. There is a maximum of 1000 keys per
  26866. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  26867. // creative, or placement.
  26868. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  26869. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26870. c.profileId = profileId
  26871. c.dynamictargetingkey = dynamictargetingkey
  26872. return c
  26873. }
  26874. // Fields allows partial responses to be retrieved. See
  26875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26876. // for more information.
  26877. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  26878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26879. return c
  26880. }
  26881. // Context sets the context to be used in this call's Do method. Any
  26882. // pending HTTP request will be aborted if the provided context is
  26883. // canceled.
  26884. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  26885. c.ctx_ = ctx
  26886. return c
  26887. }
  26888. // Header returns an http.Header that can be modified by the caller to
  26889. // add HTTP headers to the request.
  26890. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  26891. if c.header_ == nil {
  26892. c.header_ = make(http.Header)
  26893. }
  26894. return c.header_
  26895. }
  26896. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  26897. reqHeaders := make(http.Header)
  26898. for k, v := range c.header_ {
  26899. reqHeaders[k] = v
  26900. }
  26901. reqHeaders.Set("User-Agent", c.s.userAgent())
  26902. var body io.Reader = nil
  26903. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  26904. if err != nil {
  26905. return nil, err
  26906. }
  26907. reqHeaders.Set("Content-Type", "application/json")
  26908. c.urlParams_.Set("alt", alt)
  26909. c.urlParams_.Set("prettyPrint", "false")
  26910. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26911. urls += "?" + c.urlParams_.Encode()
  26912. req, err := http.NewRequest("POST", urls, body)
  26913. if err != nil {
  26914. return nil, err
  26915. }
  26916. req.Header = reqHeaders
  26917. googleapi.Expand(req.URL, map[string]string{
  26918. "profileId": strconv.FormatInt(c.profileId, 10),
  26919. })
  26920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26921. }
  26922. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  26923. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  26924. // non-2xx status code is an error. Response headers are in either
  26925. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  26926. // returned at all) in error.(*googleapi.Error).Header. Use
  26927. // googleapi.IsNotModified to check whether the returned error was
  26928. // because http.StatusNotModified was returned.
  26929. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  26930. gensupport.SetOptions(c.urlParams_, opts...)
  26931. res, err := c.doRequest("json")
  26932. if res != nil && res.StatusCode == http.StatusNotModified {
  26933. if res.Body != nil {
  26934. res.Body.Close()
  26935. }
  26936. return nil, &googleapi.Error{
  26937. Code: res.StatusCode,
  26938. Header: res.Header,
  26939. }
  26940. }
  26941. if err != nil {
  26942. return nil, err
  26943. }
  26944. defer googleapi.CloseBody(res)
  26945. if err := googleapi.CheckResponse(res); err != nil {
  26946. return nil, err
  26947. }
  26948. ret := &DynamicTargetingKey{
  26949. ServerResponse: googleapi.ServerResponse{
  26950. Header: res.Header,
  26951. HTTPStatusCode: res.StatusCode,
  26952. },
  26953. }
  26954. target := &ret
  26955. if err := gensupport.DecodeResponse(target, res); err != nil {
  26956. return nil, err
  26957. }
  26958. return ret, nil
  26959. // {
  26960. // "description": "Inserts a new dynamic targeting key. Keys must be created at the advertiser level before being assigned to the advertiser's ads, creatives, or placements. There is a maximum of 1000 keys per advertiser, out of which a maximum of 20 keys can be assigned per ad, creative, or placement.",
  26961. // "httpMethod": "POST",
  26962. // "id": "dfareporting.dynamicTargetingKeys.insert",
  26963. // "parameterOrder": [
  26964. // "profileId"
  26965. // ],
  26966. // "parameters": {
  26967. // "profileId": {
  26968. // "description": "User profile ID associated with this request.",
  26969. // "format": "int64",
  26970. // "location": "path",
  26971. // "required": true,
  26972. // "type": "string"
  26973. // }
  26974. // },
  26975. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26976. // "request": {
  26977. // "$ref": "DynamicTargetingKey"
  26978. // },
  26979. // "response": {
  26980. // "$ref": "DynamicTargetingKey"
  26981. // },
  26982. // "scopes": [
  26983. // "https://www.googleapis.com/auth/dfatrafficking"
  26984. // ]
  26985. // }
  26986. }
  26987. // method id "dfareporting.dynamicTargetingKeys.list":
  26988. type DynamicTargetingKeysListCall struct {
  26989. s *Service
  26990. profileId int64
  26991. urlParams_ gensupport.URLParams
  26992. ifNoneMatch_ string
  26993. ctx_ context.Context
  26994. header_ http.Header
  26995. }
  26996. // List: Retrieves a list of dynamic targeting keys.
  26997. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  26998. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26999. c.profileId = profileId
  27000. return c
  27001. }
  27002. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27003. // dynamic targeting keys whose object has this advertiser ID.
  27004. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  27005. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27006. return c
  27007. }
  27008. // Names sets the optional parameter "names": Select only dynamic
  27009. // targeting keys exactly matching these names.
  27010. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  27011. c.urlParams_.SetMulti("names", append([]string{}, names...))
  27012. return c
  27013. }
  27014. // ObjectId sets the optional parameter "objectId": Select only dynamic
  27015. // targeting keys with this object ID.
  27016. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  27017. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  27018. return c
  27019. }
  27020. // ObjectType sets the optional parameter "objectType": Select only
  27021. // dynamic targeting keys with this object type.
  27022. //
  27023. // Possible values:
  27024. // "OBJECT_AD"
  27025. // "OBJECT_ADVERTISER"
  27026. // "OBJECT_CREATIVE"
  27027. // "OBJECT_PLACEMENT"
  27028. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  27029. c.urlParams_.Set("objectType", objectType)
  27030. return c
  27031. }
  27032. // Fields allows partial responses to be retrieved. See
  27033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27034. // for more information.
  27035. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  27036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27037. return c
  27038. }
  27039. // IfNoneMatch sets the optional parameter which makes the operation
  27040. // fail if the object's ETag matches the given value. This is useful for
  27041. // getting updates only after the object has changed since the last
  27042. // request. Use googleapi.IsNotModified to check whether the response
  27043. // error from Do is the result of In-None-Match.
  27044. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  27045. c.ifNoneMatch_ = entityTag
  27046. return c
  27047. }
  27048. // Context sets the context to be used in this call's Do method. Any
  27049. // pending HTTP request will be aborted if the provided context is
  27050. // canceled.
  27051. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  27052. c.ctx_ = ctx
  27053. return c
  27054. }
  27055. // Header returns an http.Header that can be modified by the caller to
  27056. // add HTTP headers to the request.
  27057. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  27058. if c.header_ == nil {
  27059. c.header_ = make(http.Header)
  27060. }
  27061. return c.header_
  27062. }
  27063. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  27064. reqHeaders := make(http.Header)
  27065. for k, v := range c.header_ {
  27066. reqHeaders[k] = v
  27067. }
  27068. reqHeaders.Set("User-Agent", c.s.userAgent())
  27069. if c.ifNoneMatch_ != "" {
  27070. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27071. }
  27072. var body io.Reader = nil
  27073. c.urlParams_.Set("alt", alt)
  27074. c.urlParams_.Set("prettyPrint", "false")
  27075. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  27076. urls += "?" + c.urlParams_.Encode()
  27077. req, err := http.NewRequest("GET", urls, body)
  27078. if err != nil {
  27079. return nil, err
  27080. }
  27081. req.Header = reqHeaders
  27082. googleapi.Expand(req.URL, map[string]string{
  27083. "profileId": strconv.FormatInt(c.profileId, 10),
  27084. })
  27085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27086. }
  27087. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  27088. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  27089. // non-nil. Any non-2xx status code is an error. Response headers are in
  27090. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  27091. // a response was returned at all) in error.(*googleapi.Error).Header.
  27092. // Use googleapi.IsNotModified to check whether the returned error was
  27093. // because http.StatusNotModified was returned.
  27094. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  27095. gensupport.SetOptions(c.urlParams_, opts...)
  27096. res, err := c.doRequest("json")
  27097. if res != nil && res.StatusCode == http.StatusNotModified {
  27098. if res.Body != nil {
  27099. res.Body.Close()
  27100. }
  27101. return nil, &googleapi.Error{
  27102. Code: res.StatusCode,
  27103. Header: res.Header,
  27104. }
  27105. }
  27106. if err != nil {
  27107. return nil, err
  27108. }
  27109. defer googleapi.CloseBody(res)
  27110. if err := googleapi.CheckResponse(res); err != nil {
  27111. return nil, err
  27112. }
  27113. ret := &DynamicTargetingKeysListResponse{
  27114. ServerResponse: googleapi.ServerResponse{
  27115. Header: res.Header,
  27116. HTTPStatusCode: res.StatusCode,
  27117. },
  27118. }
  27119. target := &ret
  27120. if err := gensupport.DecodeResponse(target, res); err != nil {
  27121. return nil, err
  27122. }
  27123. return ret, nil
  27124. // {
  27125. // "description": "Retrieves a list of dynamic targeting keys.",
  27126. // "httpMethod": "GET",
  27127. // "id": "dfareporting.dynamicTargetingKeys.list",
  27128. // "parameterOrder": [
  27129. // "profileId"
  27130. // ],
  27131. // "parameters": {
  27132. // "advertiserId": {
  27133. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  27134. // "format": "int64",
  27135. // "location": "query",
  27136. // "type": "string"
  27137. // },
  27138. // "names": {
  27139. // "description": "Select only dynamic targeting keys exactly matching these names.",
  27140. // "location": "query",
  27141. // "repeated": true,
  27142. // "type": "string"
  27143. // },
  27144. // "objectId": {
  27145. // "description": "Select only dynamic targeting keys with this object ID.",
  27146. // "format": "int64",
  27147. // "location": "query",
  27148. // "type": "string"
  27149. // },
  27150. // "objectType": {
  27151. // "description": "Select only dynamic targeting keys with this object type.",
  27152. // "enum": [
  27153. // "OBJECT_AD",
  27154. // "OBJECT_ADVERTISER",
  27155. // "OBJECT_CREATIVE",
  27156. // "OBJECT_PLACEMENT"
  27157. // ],
  27158. // "enumDescriptions": [
  27159. // "",
  27160. // "",
  27161. // "",
  27162. // ""
  27163. // ],
  27164. // "location": "query",
  27165. // "type": "string"
  27166. // },
  27167. // "profileId": {
  27168. // "description": "User profile ID associated with this request.",
  27169. // "format": "int64",
  27170. // "location": "path",
  27171. // "required": true,
  27172. // "type": "string"
  27173. // }
  27174. // },
  27175. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  27176. // "response": {
  27177. // "$ref": "DynamicTargetingKeysListResponse"
  27178. // },
  27179. // "scopes": [
  27180. // "https://www.googleapis.com/auth/dfatrafficking"
  27181. // ]
  27182. // }
  27183. }
  27184. // method id "dfareporting.eventTags.delete":
  27185. type EventTagsDeleteCall struct {
  27186. s *Service
  27187. profileId int64
  27188. id int64
  27189. urlParams_ gensupport.URLParams
  27190. ctx_ context.Context
  27191. header_ http.Header
  27192. }
  27193. // Delete: Deletes an existing event tag.
  27194. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  27195. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27196. c.profileId = profileId
  27197. c.id = id
  27198. return c
  27199. }
  27200. // Fields allows partial responses to be retrieved. See
  27201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27202. // for more information.
  27203. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  27204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27205. return c
  27206. }
  27207. // Context sets the context to be used in this call's Do method. Any
  27208. // pending HTTP request will be aborted if the provided context is
  27209. // canceled.
  27210. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  27211. c.ctx_ = ctx
  27212. return c
  27213. }
  27214. // Header returns an http.Header that can be modified by the caller to
  27215. // add HTTP headers to the request.
  27216. func (c *EventTagsDeleteCall) Header() http.Header {
  27217. if c.header_ == nil {
  27218. c.header_ = make(http.Header)
  27219. }
  27220. return c.header_
  27221. }
  27222. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  27223. reqHeaders := make(http.Header)
  27224. for k, v := range c.header_ {
  27225. reqHeaders[k] = v
  27226. }
  27227. reqHeaders.Set("User-Agent", c.s.userAgent())
  27228. var body io.Reader = nil
  27229. c.urlParams_.Set("alt", alt)
  27230. c.urlParams_.Set("prettyPrint", "false")
  27231. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27232. urls += "?" + c.urlParams_.Encode()
  27233. req, err := http.NewRequest("DELETE", urls, body)
  27234. if err != nil {
  27235. return nil, err
  27236. }
  27237. req.Header = reqHeaders
  27238. googleapi.Expand(req.URL, map[string]string{
  27239. "profileId": strconv.FormatInt(c.profileId, 10),
  27240. "id": strconv.FormatInt(c.id, 10),
  27241. })
  27242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27243. }
  27244. // Do executes the "dfareporting.eventTags.delete" call.
  27245. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  27246. gensupport.SetOptions(c.urlParams_, opts...)
  27247. res, err := c.doRequest("json")
  27248. if err != nil {
  27249. return err
  27250. }
  27251. defer googleapi.CloseBody(res)
  27252. if err := googleapi.CheckResponse(res); err != nil {
  27253. return err
  27254. }
  27255. return nil
  27256. // {
  27257. // "description": "Deletes an existing event tag.",
  27258. // "httpMethod": "DELETE",
  27259. // "id": "dfareporting.eventTags.delete",
  27260. // "parameterOrder": [
  27261. // "profileId",
  27262. // "id"
  27263. // ],
  27264. // "parameters": {
  27265. // "id": {
  27266. // "description": "Event tag ID.",
  27267. // "format": "int64",
  27268. // "location": "path",
  27269. // "required": true,
  27270. // "type": "string"
  27271. // },
  27272. // "profileId": {
  27273. // "description": "User profile ID associated with this request.",
  27274. // "format": "int64",
  27275. // "location": "path",
  27276. // "required": true,
  27277. // "type": "string"
  27278. // }
  27279. // },
  27280. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27281. // "scopes": [
  27282. // "https://www.googleapis.com/auth/dfatrafficking"
  27283. // ]
  27284. // }
  27285. }
  27286. // method id "dfareporting.eventTags.get":
  27287. type EventTagsGetCall struct {
  27288. s *Service
  27289. profileId int64
  27290. id int64
  27291. urlParams_ gensupport.URLParams
  27292. ifNoneMatch_ string
  27293. ctx_ context.Context
  27294. header_ http.Header
  27295. }
  27296. // Get: Gets one event tag by ID.
  27297. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  27298. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27299. c.profileId = profileId
  27300. c.id = id
  27301. return c
  27302. }
  27303. // Fields allows partial responses to be retrieved. See
  27304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27305. // for more information.
  27306. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  27307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27308. return c
  27309. }
  27310. // IfNoneMatch sets the optional parameter which makes the operation
  27311. // fail if the object's ETag matches the given value. This is useful for
  27312. // getting updates only after the object has changed since the last
  27313. // request. Use googleapi.IsNotModified to check whether the response
  27314. // error from Do is the result of In-None-Match.
  27315. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  27316. c.ifNoneMatch_ = entityTag
  27317. return c
  27318. }
  27319. // Context sets the context to be used in this call's Do method. Any
  27320. // pending HTTP request will be aborted if the provided context is
  27321. // canceled.
  27322. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  27323. c.ctx_ = ctx
  27324. return c
  27325. }
  27326. // Header returns an http.Header that can be modified by the caller to
  27327. // add HTTP headers to the request.
  27328. func (c *EventTagsGetCall) Header() http.Header {
  27329. if c.header_ == nil {
  27330. c.header_ = make(http.Header)
  27331. }
  27332. return c.header_
  27333. }
  27334. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  27335. reqHeaders := make(http.Header)
  27336. for k, v := range c.header_ {
  27337. reqHeaders[k] = v
  27338. }
  27339. reqHeaders.Set("User-Agent", c.s.userAgent())
  27340. if c.ifNoneMatch_ != "" {
  27341. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27342. }
  27343. var body io.Reader = nil
  27344. c.urlParams_.Set("alt", alt)
  27345. c.urlParams_.Set("prettyPrint", "false")
  27346. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  27347. urls += "?" + c.urlParams_.Encode()
  27348. req, err := http.NewRequest("GET", urls, body)
  27349. if err != nil {
  27350. return nil, err
  27351. }
  27352. req.Header = reqHeaders
  27353. googleapi.Expand(req.URL, map[string]string{
  27354. "profileId": strconv.FormatInt(c.profileId, 10),
  27355. "id": strconv.FormatInt(c.id, 10),
  27356. })
  27357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27358. }
  27359. // Do executes the "dfareporting.eventTags.get" call.
  27360. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27361. // code is an error. Response headers are in either
  27362. // *EventTag.ServerResponse.Header or (if a response was returned at
  27363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27364. // to check whether the returned error was because
  27365. // http.StatusNotModified was returned.
  27366. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27367. gensupport.SetOptions(c.urlParams_, opts...)
  27368. res, err := c.doRequest("json")
  27369. if res != nil && res.StatusCode == http.StatusNotModified {
  27370. if res.Body != nil {
  27371. res.Body.Close()
  27372. }
  27373. return nil, &googleapi.Error{
  27374. Code: res.StatusCode,
  27375. Header: res.Header,
  27376. }
  27377. }
  27378. if err != nil {
  27379. return nil, err
  27380. }
  27381. defer googleapi.CloseBody(res)
  27382. if err := googleapi.CheckResponse(res); err != nil {
  27383. return nil, err
  27384. }
  27385. ret := &EventTag{
  27386. ServerResponse: googleapi.ServerResponse{
  27387. Header: res.Header,
  27388. HTTPStatusCode: res.StatusCode,
  27389. },
  27390. }
  27391. target := &ret
  27392. if err := gensupport.DecodeResponse(target, res); err != nil {
  27393. return nil, err
  27394. }
  27395. return ret, nil
  27396. // {
  27397. // "description": "Gets one event tag by ID.",
  27398. // "httpMethod": "GET",
  27399. // "id": "dfareporting.eventTags.get",
  27400. // "parameterOrder": [
  27401. // "profileId",
  27402. // "id"
  27403. // ],
  27404. // "parameters": {
  27405. // "id": {
  27406. // "description": "Event tag ID.",
  27407. // "format": "int64",
  27408. // "location": "path",
  27409. // "required": true,
  27410. // "type": "string"
  27411. // },
  27412. // "profileId": {
  27413. // "description": "User profile ID associated with this request.",
  27414. // "format": "int64",
  27415. // "location": "path",
  27416. // "required": true,
  27417. // "type": "string"
  27418. // }
  27419. // },
  27420. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27421. // "response": {
  27422. // "$ref": "EventTag"
  27423. // },
  27424. // "scopes": [
  27425. // "https://www.googleapis.com/auth/dfatrafficking"
  27426. // ]
  27427. // }
  27428. }
  27429. // method id "dfareporting.eventTags.insert":
  27430. type EventTagsInsertCall struct {
  27431. s *Service
  27432. profileId int64
  27433. eventtag *EventTag
  27434. urlParams_ gensupport.URLParams
  27435. ctx_ context.Context
  27436. header_ http.Header
  27437. }
  27438. // Insert: Inserts a new event tag.
  27439. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27440. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27441. c.profileId = profileId
  27442. c.eventtag = eventtag
  27443. return c
  27444. }
  27445. // Fields allows partial responses to be retrieved. See
  27446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27447. // for more information.
  27448. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27450. return c
  27451. }
  27452. // Context sets the context to be used in this call's Do method. Any
  27453. // pending HTTP request will be aborted if the provided context is
  27454. // canceled.
  27455. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27456. c.ctx_ = ctx
  27457. return c
  27458. }
  27459. // Header returns an http.Header that can be modified by the caller to
  27460. // add HTTP headers to the request.
  27461. func (c *EventTagsInsertCall) Header() http.Header {
  27462. if c.header_ == nil {
  27463. c.header_ = make(http.Header)
  27464. }
  27465. return c.header_
  27466. }
  27467. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27468. reqHeaders := make(http.Header)
  27469. for k, v := range c.header_ {
  27470. reqHeaders[k] = v
  27471. }
  27472. reqHeaders.Set("User-Agent", c.s.userAgent())
  27473. var body io.Reader = nil
  27474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27475. if err != nil {
  27476. return nil, err
  27477. }
  27478. reqHeaders.Set("Content-Type", "application/json")
  27479. c.urlParams_.Set("alt", alt)
  27480. c.urlParams_.Set("prettyPrint", "false")
  27481. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27482. urls += "?" + c.urlParams_.Encode()
  27483. req, err := http.NewRequest("POST", urls, body)
  27484. if err != nil {
  27485. return nil, err
  27486. }
  27487. req.Header = reqHeaders
  27488. googleapi.Expand(req.URL, map[string]string{
  27489. "profileId": strconv.FormatInt(c.profileId, 10),
  27490. })
  27491. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27492. }
  27493. // Do executes the "dfareporting.eventTags.insert" call.
  27494. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27495. // code is an error. Response headers are in either
  27496. // *EventTag.ServerResponse.Header or (if a response was returned at
  27497. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27498. // to check whether the returned error was because
  27499. // http.StatusNotModified was returned.
  27500. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27501. gensupport.SetOptions(c.urlParams_, opts...)
  27502. res, err := c.doRequest("json")
  27503. if res != nil && res.StatusCode == http.StatusNotModified {
  27504. if res.Body != nil {
  27505. res.Body.Close()
  27506. }
  27507. return nil, &googleapi.Error{
  27508. Code: res.StatusCode,
  27509. Header: res.Header,
  27510. }
  27511. }
  27512. if err != nil {
  27513. return nil, err
  27514. }
  27515. defer googleapi.CloseBody(res)
  27516. if err := googleapi.CheckResponse(res); err != nil {
  27517. return nil, err
  27518. }
  27519. ret := &EventTag{
  27520. ServerResponse: googleapi.ServerResponse{
  27521. Header: res.Header,
  27522. HTTPStatusCode: res.StatusCode,
  27523. },
  27524. }
  27525. target := &ret
  27526. if err := gensupport.DecodeResponse(target, res); err != nil {
  27527. return nil, err
  27528. }
  27529. return ret, nil
  27530. // {
  27531. // "description": "Inserts a new event tag.",
  27532. // "httpMethod": "POST",
  27533. // "id": "dfareporting.eventTags.insert",
  27534. // "parameterOrder": [
  27535. // "profileId"
  27536. // ],
  27537. // "parameters": {
  27538. // "profileId": {
  27539. // "description": "User profile ID associated with this request.",
  27540. // "format": "int64",
  27541. // "location": "path",
  27542. // "required": true,
  27543. // "type": "string"
  27544. // }
  27545. // },
  27546. // "path": "userprofiles/{profileId}/eventTags",
  27547. // "request": {
  27548. // "$ref": "EventTag"
  27549. // },
  27550. // "response": {
  27551. // "$ref": "EventTag"
  27552. // },
  27553. // "scopes": [
  27554. // "https://www.googleapis.com/auth/dfatrafficking"
  27555. // ]
  27556. // }
  27557. }
  27558. // method id "dfareporting.eventTags.list":
  27559. type EventTagsListCall struct {
  27560. s *Service
  27561. profileId int64
  27562. urlParams_ gensupport.URLParams
  27563. ifNoneMatch_ string
  27564. ctx_ context.Context
  27565. header_ http.Header
  27566. }
  27567. // List: Retrieves a list of event tags, possibly filtered.
  27568. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27569. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27570. c.profileId = profileId
  27571. return c
  27572. }
  27573. // AdId sets the optional parameter "adId": Select only event tags that
  27574. // belong to this ad.
  27575. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27576. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27577. return c
  27578. }
  27579. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27580. // event tags that belong to this advertiser.
  27581. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27582. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27583. return c
  27584. }
  27585. // CampaignId sets the optional parameter "campaignId": Select only
  27586. // event tags that belong to this campaign.
  27587. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27588. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27589. return c
  27590. }
  27591. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27592. // Examine only the specified campaign or advertiser's event tags for
  27593. // matching selector criteria. When set to false, the parent advertiser
  27594. // and parent campaign of the specified ad or campaign is examined as
  27595. // well. In addition, when set to false, the status field is examined as
  27596. // well, along with the enabledByDefault field. This parameter can not
  27597. // be set to true when adId is specified as ads do not define their own
  27598. // even tags.
  27599. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27600. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27601. return c
  27602. }
  27603. // Enabled sets the optional parameter "enabled": Select only enabled
  27604. // event tags. What is considered enabled or disabled depends on the
  27605. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27606. // the specified advertiser or campaign's event tags' enabledByDefault
  27607. // field is examined. When definitionsOnly is set to false, the
  27608. // specified ad or specified campaign's parent advertiser's or parent
  27609. // campaign's event tags' enabledByDefault and status fields are
  27610. // examined as well.
  27611. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27612. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27613. return c
  27614. }
  27615. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27616. // only event tags with the specified event tag types. Event tag types
  27617. // can be used to specify whether to use a third-party pixel, a
  27618. // third-party JavaScript URL, or a third-party click-through URL for
  27619. // either impression or click tracking.
  27620. //
  27621. // Possible values:
  27622. // "CLICK_THROUGH_EVENT_TAG"
  27623. // "IMPRESSION_IMAGE_EVENT_TAG"
  27624. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27625. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27626. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27627. return c
  27628. }
  27629. // Ids sets the optional parameter "ids": Select only event tags with
  27630. // these IDs.
  27631. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27632. var ids_ []string
  27633. for _, v := range ids {
  27634. ids_ = append(ids_, fmt.Sprint(v))
  27635. }
  27636. c.urlParams_.SetMulti("ids", ids_)
  27637. return c
  27638. }
  27639. // SearchString sets the optional parameter "searchString": Allows
  27640. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27641. // example, "eventtag*2015" will return objects with names like
  27642. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27643. // 2015". Most of the searches also add wildcards implicitly at the
  27644. // start and the end of the search string. For example, a search string
  27645. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27646. // 2015", or simply "eventtag".
  27647. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27648. c.urlParams_.Set("searchString", searchString)
  27649. return c
  27650. }
  27651. // SortField sets the optional parameter "sortField": Field by which to
  27652. // sort the list.
  27653. //
  27654. // Possible values:
  27655. // "ID" (default)
  27656. // "NAME"
  27657. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27658. c.urlParams_.Set("sortField", sortField)
  27659. return c
  27660. }
  27661. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27662. // results.
  27663. //
  27664. // Possible values:
  27665. // "ASCENDING" (default)
  27666. // "DESCENDING"
  27667. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27668. c.urlParams_.Set("sortOrder", sortOrder)
  27669. return c
  27670. }
  27671. // Fields allows partial responses to be retrieved. See
  27672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27673. // for more information.
  27674. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27676. return c
  27677. }
  27678. // IfNoneMatch sets the optional parameter which makes the operation
  27679. // fail if the object's ETag matches the given value. This is useful for
  27680. // getting updates only after the object has changed since the last
  27681. // request. Use googleapi.IsNotModified to check whether the response
  27682. // error from Do is the result of In-None-Match.
  27683. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27684. c.ifNoneMatch_ = entityTag
  27685. return c
  27686. }
  27687. // Context sets the context to be used in this call's Do method. Any
  27688. // pending HTTP request will be aborted if the provided context is
  27689. // canceled.
  27690. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27691. c.ctx_ = ctx
  27692. return c
  27693. }
  27694. // Header returns an http.Header that can be modified by the caller to
  27695. // add HTTP headers to the request.
  27696. func (c *EventTagsListCall) Header() http.Header {
  27697. if c.header_ == nil {
  27698. c.header_ = make(http.Header)
  27699. }
  27700. return c.header_
  27701. }
  27702. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27703. reqHeaders := make(http.Header)
  27704. for k, v := range c.header_ {
  27705. reqHeaders[k] = v
  27706. }
  27707. reqHeaders.Set("User-Agent", c.s.userAgent())
  27708. if c.ifNoneMatch_ != "" {
  27709. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27710. }
  27711. var body io.Reader = nil
  27712. c.urlParams_.Set("alt", alt)
  27713. c.urlParams_.Set("prettyPrint", "false")
  27714. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27715. urls += "?" + c.urlParams_.Encode()
  27716. req, err := http.NewRequest("GET", urls, body)
  27717. if err != nil {
  27718. return nil, err
  27719. }
  27720. req.Header = reqHeaders
  27721. googleapi.Expand(req.URL, map[string]string{
  27722. "profileId": strconv.FormatInt(c.profileId, 10),
  27723. })
  27724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27725. }
  27726. // Do executes the "dfareporting.eventTags.list" call.
  27727. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27728. // non-2xx status code is an error. Response headers are in either
  27729. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27730. // returned at all) in error.(*googleapi.Error).Header. Use
  27731. // googleapi.IsNotModified to check whether the returned error was
  27732. // because http.StatusNotModified was returned.
  27733. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27734. gensupport.SetOptions(c.urlParams_, opts...)
  27735. res, err := c.doRequest("json")
  27736. if res != nil && res.StatusCode == http.StatusNotModified {
  27737. if res.Body != nil {
  27738. res.Body.Close()
  27739. }
  27740. return nil, &googleapi.Error{
  27741. Code: res.StatusCode,
  27742. Header: res.Header,
  27743. }
  27744. }
  27745. if err != nil {
  27746. return nil, err
  27747. }
  27748. defer googleapi.CloseBody(res)
  27749. if err := googleapi.CheckResponse(res); err != nil {
  27750. return nil, err
  27751. }
  27752. ret := &EventTagsListResponse{
  27753. ServerResponse: googleapi.ServerResponse{
  27754. Header: res.Header,
  27755. HTTPStatusCode: res.StatusCode,
  27756. },
  27757. }
  27758. target := &ret
  27759. if err := gensupport.DecodeResponse(target, res); err != nil {
  27760. return nil, err
  27761. }
  27762. return ret, nil
  27763. // {
  27764. // "description": "Retrieves a list of event tags, possibly filtered.",
  27765. // "httpMethod": "GET",
  27766. // "id": "dfareporting.eventTags.list",
  27767. // "parameterOrder": [
  27768. // "profileId"
  27769. // ],
  27770. // "parameters": {
  27771. // "adId": {
  27772. // "description": "Select only event tags that belong to this ad.",
  27773. // "format": "int64",
  27774. // "location": "query",
  27775. // "type": "string"
  27776. // },
  27777. // "advertiserId": {
  27778. // "description": "Select only event tags that belong to this advertiser.",
  27779. // "format": "int64",
  27780. // "location": "query",
  27781. // "type": "string"
  27782. // },
  27783. // "campaignId": {
  27784. // "description": "Select only event tags that belong to this campaign.",
  27785. // "format": "int64",
  27786. // "location": "query",
  27787. // "type": "string"
  27788. // },
  27789. // "definitionsOnly": {
  27790. // "description": "Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags.",
  27791. // "location": "query",
  27792. // "type": "boolean"
  27793. // },
  27794. // "enabled": {
  27795. // "description": "Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well.",
  27796. // "location": "query",
  27797. // "type": "boolean"
  27798. // },
  27799. // "eventTagTypes": {
  27800. // "description": "Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking.",
  27801. // "enum": [
  27802. // "CLICK_THROUGH_EVENT_TAG",
  27803. // "IMPRESSION_IMAGE_EVENT_TAG",
  27804. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27805. // ],
  27806. // "enumDescriptions": [
  27807. // "",
  27808. // "",
  27809. // ""
  27810. // ],
  27811. // "location": "query",
  27812. // "repeated": true,
  27813. // "type": "string"
  27814. // },
  27815. // "ids": {
  27816. // "description": "Select only event tags with these IDs.",
  27817. // "format": "int64",
  27818. // "location": "query",
  27819. // "repeated": true,
  27820. // "type": "string"
  27821. // },
  27822. // "profileId": {
  27823. // "description": "User profile ID associated with this request.",
  27824. // "format": "int64",
  27825. // "location": "path",
  27826. // "required": true,
  27827. // "type": "string"
  27828. // },
  27829. // "searchString": {
  27830. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"eventtag*2015\" will return objects with names like \"eventtag June 2015\", \"eventtag April 2015\", or simply \"eventtag 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"eventtag\" will match objects with name \"my eventtag\", \"eventtag 2015\", or simply \"eventtag\".",
  27831. // "location": "query",
  27832. // "type": "string"
  27833. // },
  27834. // "sortField": {
  27835. // "default": "ID",
  27836. // "description": "Field by which to sort the list.",
  27837. // "enum": [
  27838. // "ID",
  27839. // "NAME"
  27840. // ],
  27841. // "enumDescriptions": [
  27842. // "",
  27843. // ""
  27844. // ],
  27845. // "location": "query",
  27846. // "type": "string"
  27847. // },
  27848. // "sortOrder": {
  27849. // "default": "ASCENDING",
  27850. // "description": "Order of sorted results.",
  27851. // "enum": [
  27852. // "ASCENDING",
  27853. // "DESCENDING"
  27854. // ],
  27855. // "enumDescriptions": [
  27856. // "",
  27857. // ""
  27858. // ],
  27859. // "location": "query",
  27860. // "type": "string"
  27861. // }
  27862. // },
  27863. // "path": "userprofiles/{profileId}/eventTags",
  27864. // "response": {
  27865. // "$ref": "EventTagsListResponse"
  27866. // },
  27867. // "scopes": [
  27868. // "https://www.googleapis.com/auth/dfatrafficking"
  27869. // ]
  27870. // }
  27871. }
  27872. // method id "dfareporting.eventTags.patch":
  27873. type EventTagsPatchCall struct {
  27874. s *Service
  27875. profileId int64
  27876. eventtag *EventTag
  27877. urlParams_ gensupport.URLParams
  27878. ctx_ context.Context
  27879. header_ http.Header
  27880. }
  27881. // Patch: Updates an existing event tag. This method supports patch
  27882. // semantics.
  27883. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  27884. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27885. c.profileId = profileId
  27886. c.urlParams_.Set("id", fmt.Sprint(id))
  27887. c.eventtag = eventtag
  27888. return c
  27889. }
  27890. // Fields allows partial responses to be retrieved. See
  27891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27892. // for more information.
  27893. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  27894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27895. return c
  27896. }
  27897. // Context sets the context to be used in this call's Do method. Any
  27898. // pending HTTP request will be aborted if the provided context is
  27899. // canceled.
  27900. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  27901. c.ctx_ = ctx
  27902. return c
  27903. }
  27904. // Header returns an http.Header that can be modified by the caller to
  27905. // add HTTP headers to the request.
  27906. func (c *EventTagsPatchCall) Header() http.Header {
  27907. if c.header_ == nil {
  27908. c.header_ = make(http.Header)
  27909. }
  27910. return c.header_
  27911. }
  27912. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  27913. reqHeaders := make(http.Header)
  27914. for k, v := range c.header_ {
  27915. reqHeaders[k] = v
  27916. }
  27917. reqHeaders.Set("User-Agent", c.s.userAgent())
  27918. var body io.Reader = nil
  27919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27920. if err != nil {
  27921. return nil, err
  27922. }
  27923. reqHeaders.Set("Content-Type", "application/json")
  27924. c.urlParams_.Set("alt", alt)
  27925. c.urlParams_.Set("prettyPrint", "false")
  27926. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27927. urls += "?" + c.urlParams_.Encode()
  27928. req, err := http.NewRequest("PATCH", urls, body)
  27929. if err != nil {
  27930. return nil, err
  27931. }
  27932. req.Header = reqHeaders
  27933. googleapi.Expand(req.URL, map[string]string{
  27934. "profileId": strconv.FormatInt(c.profileId, 10),
  27935. })
  27936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27937. }
  27938. // Do executes the "dfareporting.eventTags.patch" call.
  27939. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27940. // code is an error. Response headers are in either
  27941. // *EventTag.ServerResponse.Header or (if a response was returned at
  27942. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27943. // to check whether the returned error was because
  27944. // http.StatusNotModified was returned.
  27945. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27946. gensupport.SetOptions(c.urlParams_, opts...)
  27947. res, err := c.doRequest("json")
  27948. if res != nil && res.StatusCode == http.StatusNotModified {
  27949. if res.Body != nil {
  27950. res.Body.Close()
  27951. }
  27952. return nil, &googleapi.Error{
  27953. Code: res.StatusCode,
  27954. Header: res.Header,
  27955. }
  27956. }
  27957. if err != nil {
  27958. return nil, err
  27959. }
  27960. defer googleapi.CloseBody(res)
  27961. if err := googleapi.CheckResponse(res); err != nil {
  27962. return nil, err
  27963. }
  27964. ret := &EventTag{
  27965. ServerResponse: googleapi.ServerResponse{
  27966. Header: res.Header,
  27967. HTTPStatusCode: res.StatusCode,
  27968. },
  27969. }
  27970. target := &ret
  27971. if err := gensupport.DecodeResponse(target, res); err != nil {
  27972. return nil, err
  27973. }
  27974. return ret, nil
  27975. // {
  27976. // "description": "Updates an existing event tag. This method supports patch semantics.",
  27977. // "httpMethod": "PATCH",
  27978. // "id": "dfareporting.eventTags.patch",
  27979. // "parameterOrder": [
  27980. // "profileId",
  27981. // "id"
  27982. // ],
  27983. // "parameters": {
  27984. // "id": {
  27985. // "description": "Event tag ID.",
  27986. // "format": "int64",
  27987. // "location": "query",
  27988. // "required": true,
  27989. // "type": "string"
  27990. // },
  27991. // "profileId": {
  27992. // "description": "User profile ID associated with this request.",
  27993. // "format": "int64",
  27994. // "location": "path",
  27995. // "required": true,
  27996. // "type": "string"
  27997. // }
  27998. // },
  27999. // "path": "userprofiles/{profileId}/eventTags",
  28000. // "request": {
  28001. // "$ref": "EventTag"
  28002. // },
  28003. // "response": {
  28004. // "$ref": "EventTag"
  28005. // },
  28006. // "scopes": [
  28007. // "https://www.googleapis.com/auth/dfatrafficking"
  28008. // ]
  28009. // }
  28010. }
  28011. // method id "dfareporting.eventTags.update":
  28012. type EventTagsUpdateCall struct {
  28013. s *Service
  28014. profileId int64
  28015. eventtag *EventTag
  28016. urlParams_ gensupport.URLParams
  28017. ctx_ context.Context
  28018. header_ http.Header
  28019. }
  28020. // Update: Updates an existing event tag.
  28021. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  28022. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28023. c.profileId = profileId
  28024. c.eventtag = eventtag
  28025. return c
  28026. }
  28027. // Fields allows partial responses to be retrieved. See
  28028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28029. // for more information.
  28030. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  28031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28032. return c
  28033. }
  28034. // Context sets the context to be used in this call's Do method. Any
  28035. // pending HTTP request will be aborted if the provided context is
  28036. // canceled.
  28037. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  28038. c.ctx_ = ctx
  28039. return c
  28040. }
  28041. // Header returns an http.Header that can be modified by the caller to
  28042. // add HTTP headers to the request.
  28043. func (c *EventTagsUpdateCall) Header() http.Header {
  28044. if c.header_ == nil {
  28045. c.header_ = make(http.Header)
  28046. }
  28047. return c.header_
  28048. }
  28049. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  28050. reqHeaders := make(http.Header)
  28051. for k, v := range c.header_ {
  28052. reqHeaders[k] = v
  28053. }
  28054. reqHeaders.Set("User-Agent", c.s.userAgent())
  28055. var body io.Reader = nil
  28056. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  28057. if err != nil {
  28058. return nil, err
  28059. }
  28060. reqHeaders.Set("Content-Type", "application/json")
  28061. c.urlParams_.Set("alt", alt)
  28062. c.urlParams_.Set("prettyPrint", "false")
  28063. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  28064. urls += "?" + c.urlParams_.Encode()
  28065. req, err := http.NewRequest("PUT", urls, body)
  28066. if err != nil {
  28067. return nil, err
  28068. }
  28069. req.Header = reqHeaders
  28070. googleapi.Expand(req.URL, map[string]string{
  28071. "profileId": strconv.FormatInt(c.profileId, 10),
  28072. })
  28073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28074. }
  28075. // Do executes the "dfareporting.eventTags.update" call.
  28076. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  28077. // code is an error. Response headers are in either
  28078. // *EventTag.ServerResponse.Header or (if a response was returned at
  28079. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28080. // to check whether the returned error was because
  28081. // http.StatusNotModified was returned.
  28082. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  28083. gensupport.SetOptions(c.urlParams_, opts...)
  28084. res, err := c.doRequest("json")
  28085. if res != nil && res.StatusCode == http.StatusNotModified {
  28086. if res.Body != nil {
  28087. res.Body.Close()
  28088. }
  28089. return nil, &googleapi.Error{
  28090. Code: res.StatusCode,
  28091. Header: res.Header,
  28092. }
  28093. }
  28094. if err != nil {
  28095. return nil, err
  28096. }
  28097. defer googleapi.CloseBody(res)
  28098. if err := googleapi.CheckResponse(res); err != nil {
  28099. return nil, err
  28100. }
  28101. ret := &EventTag{
  28102. ServerResponse: googleapi.ServerResponse{
  28103. Header: res.Header,
  28104. HTTPStatusCode: res.StatusCode,
  28105. },
  28106. }
  28107. target := &ret
  28108. if err := gensupport.DecodeResponse(target, res); err != nil {
  28109. return nil, err
  28110. }
  28111. return ret, nil
  28112. // {
  28113. // "description": "Updates an existing event tag.",
  28114. // "httpMethod": "PUT",
  28115. // "id": "dfareporting.eventTags.update",
  28116. // "parameterOrder": [
  28117. // "profileId"
  28118. // ],
  28119. // "parameters": {
  28120. // "profileId": {
  28121. // "description": "User profile ID associated with this request.",
  28122. // "format": "int64",
  28123. // "location": "path",
  28124. // "required": true,
  28125. // "type": "string"
  28126. // }
  28127. // },
  28128. // "path": "userprofiles/{profileId}/eventTags",
  28129. // "request": {
  28130. // "$ref": "EventTag"
  28131. // },
  28132. // "response": {
  28133. // "$ref": "EventTag"
  28134. // },
  28135. // "scopes": [
  28136. // "https://www.googleapis.com/auth/dfatrafficking"
  28137. // ]
  28138. // }
  28139. }
  28140. // method id "dfareporting.files.get":
  28141. type FilesGetCall struct {
  28142. s *Service
  28143. reportId int64
  28144. fileId int64
  28145. urlParams_ gensupport.URLParams
  28146. ifNoneMatch_ string
  28147. ctx_ context.Context
  28148. header_ http.Header
  28149. }
  28150. // Get: Retrieves a report file by its report ID and file ID. This
  28151. // method supports media download.
  28152. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  28153. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28154. c.reportId = reportId
  28155. c.fileId = fileId
  28156. return c
  28157. }
  28158. // Fields allows partial responses to be retrieved. See
  28159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28160. // for more information.
  28161. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  28162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28163. return c
  28164. }
  28165. // IfNoneMatch sets the optional parameter which makes the operation
  28166. // fail if the object's ETag matches the given value. This is useful for
  28167. // getting updates only after the object has changed since the last
  28168. // request. Use googleapi.IsNotModified to check whether the response
  28169. // error from Do is the result of In-None-Match.
  28170. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  28171. c.ifNoneMatch_ = entityTag
  28172. return c
  28173. }
  28174. // Context sets the context to be used in this call's Do and Download
  28175. // methods. Any pending HTTP request will be aborted if the provided
  28176. // context is canceled.
  28177. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  28178. c.ctx_ = ctx
  28179. return c
  28180. }
  28181. // Header returns an http.Header that can be modified by the caller to
  28182. // add HTTP headers to the request.
  28183. func (c *FilesGetCall) Header() http.Header {
  28184. if c.header_ == nil {
  28185. c.header_ = make(http.Header)
  28186. }
  28187. return c.header_
  28188. }
  28189. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  28190. reqHeaders := make(http.Header)
  28191. for k, v := range c.header_ {
  28192. reqHeaders[k] = v
  28193. }
  28194. reqHeaders.Set("User-Agent", c.s.userAgent())
  28195. if c.ifNoneMatch_ != "" {
  28196. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28197. }
  28198. var body io.Reader = nil
  28199. c.urlParams_.Set("alt", alt)
  28200. c.urlParams_.Set("prettyPrint", "false")
  28201. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  28202. urls += "?" + c.urlParams_.Encode()
  28203. req, err := http.NewRequest("GET", urls, body)
  28204. if err != nil {
  28205. return nil, err
  28206. }
  28207. req.Header = reqHeaders
  28208. googleapi.Expand(req.URL, map[string]string{
  28209. "reportId": strconv.FormatInt(c.reportId, 10),
  28210. "fileId": strconv.FormatInt(c.fileId, 10),
  28211. })
  28212. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28213. }
  28214. // Download fetches the API endpoint's "media" value, instead of the normal
  28215. // API response value. If the returned error is nil, the Response is guaranteed to
  28216. // have a 2xx status code. Callers must close the Response.Body as usual.
  28217. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  28218. gensupport.SetOptions(c.urlParams_, opts...)
  28219. res, err := c.doRequest("media")
  28220. if err != nil {
  28221. return nil, err
  28222. }
  28223. if err := googleapi.CheckMediaResponse(res); err != nil {
  28224. res.Body.Close()
  28225. return nil, err
  28226. }
  28227. return res, nil
  28228. }
  28229. // Do executes the "dfareporting.files.get" call.
  28230. // Exactly one of *File or error will be non-nil. Any non-2xx status
  28231. // code is an error. Response headers are in either
  28232. // *File.ServerResponse.Header or (if a response was returned at all) in
  28233. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28234. // whether the returned error was because http.StatusNotModified was
  28235. // returned.
  28236. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  28237. gensupport.SetOptions(c.urlParams_, opts...)
  28238. res, err := c.doRequest("json")
  28239. if res != nil && res.StatusCode == http.StatusNotModified {
  28240. if res.Body != nil {
  28241. res.Body.Close()
  28242. }
  28243. return nil, &googleapi.Error{
  28244. Code: res.StatusCode,
  28245. Header: res.Header,
  28246. }
  28247. }
  28248. if err != nil {
  28249. return nil, err
  28250. }
  28251. defer googleapi.CloseBody(res)
  28252. if err := googleapi.CheckResponse(res); err != nil {
  28253. return nil, err
  28254. }
  28255. ret := &File{
  28256. ServerResponse: googleapi.ServerResponse{
  28257. Header: res.Header,
  28258. HTTPStatusCode: res.StatusCode,
  28259. },
  28260. }
  28261. target := &ret
  28262. if err := gensupport.DecodeResponse(target, res); err != nil {
  28263. return nil, err
  28264. }
  28265. return ret, nil
  28266. // {
  28267. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  28268. // "httpMethod": "GET",
  28269. // "id": "dfareporting.files.get",
  28270. // "parameterOrder": [
  28271. // "reportId",
  28272. // "fileId"
  28273. // ],
  28274. // "parameters": {
  28275. // "fileId": {
  28276. // "description": "The ID of the report file.",
  28277. // "format": "int64",
  28278. // "location": "path",
  28279. // "required": true,
  28280. // "type": "string"
  28281. // },
  28282. // "reportId": {
  28283. // "description": "The ID of the report.",
  28284. // "format": "int64",
  28285. // "location": "path",
  28286. // "required": true,
  28287. // "type": "string"
  28288. // }
  28289. // },
  28290. // "path": "reports/{reportId}/files/{fileId}",
  28291. // "response": {
  28292. // "$ref": "File"
  28293. // },
  28294. // "scopes": [
  28295. // "https://www.googleapis.com/auth/dfareporting"
  28296. // ],
  28297. // "supportsMediaDownload": true
  28298. // }
  28299. }
  28300. // method id "dfareporting.files.list":
  28301. type FilesListCall struct {
  28302. s *Service
  28303. profileId int64
  28304. urlParams_ gensupport.URLParams
  28305. ifNoneMatch_ string
  28306. ctx_ context.Context
  28307. header_ http.Header
  28308. }
  28309. // List: Lists files for a user profile.
  28310. func (r *FilesService) List(profileId int64) *FilesListCall {
  28311. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28312. c.profileId = profileId
  28313. return c
  28314. }
  28315. // MaxResults sets the optional parameter "maxResults": Maximum number
  28316. // of results to return.
  28317. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  28318. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28319. return c
  28320. }
  28321. // PageToken sets the optional parameter "pageToken": The value of the
  28322. // nextToken from the previous result page.
  28323. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  28324. c.urlParams_.Set("pageToken", pageToken)
  28325. return c
  28326. }
  28327. // Scope sets the optional parameter "scope": The scope that defines
  28328. // which results are returned.
  28329. //
  28330. // Possible values:
  28331. // "ALL" - All files in account.
  28332. // "MINE" (default) - My files.
  28333. // "SHARED_WITH_ME" - Files shared with me.
  28334. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  28335. c.urlParams_.Set("scope", scope)
  28336. return c
  28337. }
  28338. // SortField sets the optional parameter "sortField": The field by which
  28339. // to sort the list.
  28340. //
  28341. // Possible values:
  28342. // "ID" - Sort by file ID.
  28343. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  28344. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  28345. c.urlParams_.Set("sortField", sortField)
  28346. return c
  28347. }
  28348. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28349. // results.
  28350. //
  28351. // Possible values:
  28352. // "ASCENDING" - Ascending order.
  28353. // "DESCENDING" (default) - Descending order.
  28354. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  28355. c.urlParams_.Set("sortOrder", sortOrder)
  28356. return c
  28357. }
  28358. // Fields allows partial responses to be retrieved. See
  28359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28360. // for more information.
  28361. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  28362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28363. return c
  28364. }
  28365. // IfNoneMatch sets the optional parameter which makes the operation
  28366. // fail if the object's ETag matches the given value. This is useful for
  28367. // getting updates only after the object has changed since the last
  28368. // request. Use googleapi.IsNotModified to check whether the response
  28369. // error from Do is the result of In-None-Match.
  28370. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  28371. c.ifNoneMatch_ = entityTag
  28372. return c
  28373. }
  28374. // Context sets the context to be used in this call's Do method. Any
  28375. // pending HTTP request will be aborted if the provided context is
  28376. // canceled.
  28377. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  28378. c.ctx_ = ctx
  28379. return c
  28380. }
  28381. // Header returns an http.Header that can be modified by the caller to
  28382. // add HTTP headers to the request.
  28383. func (c *FilesListCall) Header() http.Header {
  28384. if c.header_ == nil {
  28385. c.header_ = make(http.Header)
  28386. }
  28387. return c.header_
  28388. }
  28389. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  28390. reqHeaders := make(http.Header)
  28391. for k, v := range c.header_ {
  28392. reqHeaders[k] = v
  28393. }
  28394. reqHeaders.Set("User-Agent", c.s.userAgent())
  28395. if c.ifNoneMatch_ != "" {
  28396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28397. }
  28398. var body io.Reader = nil
  28399. c.urlParams_.Set("alt", alt)
  28400. c.urlParams_.Set("prettyPrint", "false")
  28401. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28402. urls += "?" + c.urlParams_.Encode()
  28403. req, err := http.NewRequest("GET", urls, body)
  28404. if err != nil {
  28405. return nil, err
  28406. }
  28407. req.Header = reqHeaders
  28408. googleapi.Expand(req.URL, map[string]string{
  28409. "profileId": strconv.FormatInt(c.profileId, 10),
  28410. })
  28411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28412. }
  28413. // Do executes the "dfareporting.files.list" call.
  28414. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28415. // code is an error. Response headers are in either
  28416. // *FileList.ServerResponse.Header or (if a response was returned at
  28417. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28418. // to check whether the returned error was because
  28419. // http.StatusNotModified was returned.
  28420. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28421. gensupport.SetOptions(c.urlParams_, opts...)
  28422. res, err := c.doRequest("json")
  28423. if res != nil && res.StatusCode == http.StatusNotModified {
  28424. if res.Body != nil {
  28425. res.Body.Close()
  28426. }
  28427. return nil, &googleapi.Error{
  28428. Code: res.StatusCode,
  28429. Header: res.Header,
  28430. }
  28431. }
  28432. if err != nil {
  28433. return nil, err
  28434. }
  28435. defer googleapi.CloseBody(res)
  28436. if err := googleapi.CheckResponse(res); err != nil {
  28437. return nil, err
  28438. }
  28439. ret := &FileList{
  28440. ServerResponse: googleapi.ServerResponse{
  28441. Header: res.Header,
  28442. HTTPStatusCode: res.StatusCode,
  28443. },
  28444. }
  28445. target := &ret
  28446. if err := gensupport.DecodeResponse(target, res); err != nil {
  28447. return nil, err
  28448. }
  28449. return ret, nil
  28450. // {
  28451. // "description": "Lists files for a user profile.",
  28452. // "httpMethod": "GET",
  28453. // "id": "dfareporting.files.list",
  28454. // "parameterOrder": [
  28455. // "profileId"
  28456. // ],
  28457. // "parameters": {
  28458. // "maxResults": {
  28459. // "default": "10",
  28460. // "description": "Maximum number of results to return.",
  28461. // "format": "int32",
  28462. // "location": "query",
  28463. // "maximum": "10",
  28464. // "minimum": "0",
  28465. // "type": "integer"
  28466. // },
  28467. // "pageToken": {
  28468. // "description": "The value of the nextToken from the previous result page.",
  28469. // "location": "query",
  28470. // "type": "string"
  28471. // },
  28472. // "profileId": {
  28473. // "description": "The DFA profile ID.",
  28474. // "format": "int64",
  28475. // "location": "path",
  28476. // "required": true,
  28477. // "type": "string"
  28478. // },
  28479. // "scope": {
  28480. // "default": "MINE",
  28481. // "description": "The scope that defines which results are returned.",
  28482. // "enum": [
  28483. // "ALL",
  28484. // "MINE",
  28485. // "SHARED_WITH_ME"
  28486. // ],
  28487. // "enumDescriptions": [
  28488. // "All files in account.",
  28489. // "My files.",
  28490. // "Files shared with me."
  28491. // ],
  28492. // "location": "query",
  28493. // "type": "string"
  28494. // },
  28495. // "sortField": {
  28496. // "default": "LAST_MODIFIED_TIME",
  28497. // "description": "The field by which to sort the list.",
  28498. // "enum": [
  28499. // "ID",
  28500. // "LAST_MODIFIED_TIME"
  28501. // ],
  28502. // "enumDescriptions": [
  28503. // "Sort by file ID.",
  28504. // "Sort by 'lastmodifiedAt' field."
  28505. // ],
  28506. // "location": "query",
  28507. // "type": "string"
  28508. // },
  28509. // "sortOrder": {
  28510. // "default": "DESCENDING",
  28511. // "description": "Order of sorted results.",
  28512. // "enum": [
  28513. // "ASCENDING",
  28514. // "DESCENDING"
  28515. // ],
  28516. // "enumDescriptions": [
  28517. // "Ascending order.",
  28518. // "Descending order."
  28519. // ],
  28520. // "location": "query",
  28521. // "type": "string"
  28522. // }
  28523. // },
  28524. // "path": "userprofiles/{profileId}/files",
  28525. // "response": {
  28526. // "$ref": "FileList"
  28527. // },
  28528. // "scopes": [
  28529. // "https://www.googleapis.com/auth/dfareporting"
  28530. // ]
  28531. // }
  28532. }
  28533. // Pages invokes f for each page of results.
  28534. // A non-nil error returned from f will halt the iteration.
  28535. // The provided context supersedes any context provided to the Context method.
  28536. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28537. c.ctx_ = ctx
  28538. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28539. for {
  28540. x, err := c.Do()
  28541. if err != nil {
  28542. return err
  28543. }
  28544. if err := f(x); err != nil {
  28545. return err
  28546. }
  28547. if x.NextPageToken == "" {
  28548. return nil
  28549. }
  28550. c.PageToken(x.NextPageToken)
  28551. }
  28552. }
  28553. // method id "dfareporting.floodlightActivities.delete":
  28554. type FloodlightActivitiesDeleteCall struct {
  28555. s *Service
  28556. profileId int64
  28557. id int64
  28558. urlParams_ gensupport.URLParams
  28559. ctx_ context.Context
  28560. header_ http.Header
  28561. }
  28562. // Delete: Deletes an existing floodlight activity.
  28563. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28564. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28565. c.profileId = profileId
  28566. c.id = id
  28567. return c
  28568. }
  28569. // Fields allows partial responses to be retrieved. See
  28570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28571. // for more information.
  28572. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28574. return c
  28575. }
  28576. // Context sets the context to be used in this call's Do method. Any
  28577. // pending HTTP request will be aborted if the provided context is
  28578. // canceled.
  28579. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28580. c.ctx_ = ctx
  28581. return c
  28582. }
  28583. // Header returns an http.Header that can be modified by the caller to
  28584. // add HTTP headers to the request.
  28585. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28586. if c.header_ == nil {
  28587. c.header_ = make(http.Header)
  28588. }
  28589. return c.header_
  28590. }
  28591. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28592. reqHeaders := make(http.Header)
  28593. for k, v := range c.header_ {
  28594. reqHeaders[k] = v
  28595. }
  28596. reqHeaders.Set("User-Agent", c.s.userAgent())
  28597. var body io.Reader = nil
  28598. c.urlParams_.Set("alt", alt)
  28599. c.urlParams_.Set("prettyPrint", "false")
  28600. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28601. urls += "?" + c.urlParams_.Encode()
  28602. req, err := http.NewRequest("DELETE", urls, body)
  28603. if err != nil {
  28604. return nil, err
  28605. }
  28606. req.Header = reqHeaders
  28607. googleapi.Expand(req.URL, map[string]string{
  28608. "profileId": strconv.FormatInt(c.profileId, 10),
  28609. "id": strconv.FormatInt(c.id, 10),
  28610. })
  28611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28612. }
  28613. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28614. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28615. gensupport.SetOptions(c.urlParams_, opts...)
  28616. res, err := c.doRequest("json")
  28617. if err != nil {
  28618. return err
  28619. }
  28620. defer googleapi.CloseBody(res)
  28621. if err := googleapi.CheckResponse(res); err != nil {
  28622. return err
  28623. }
  28624. return nil
  28625. // {
  28626. // "description": "Deletes an existing floodlight activity.",
  28627. // "httpMethod": "DELETE",
  28628. // "id": "dfareporting.floodlightActivities.delete",
  28629. // "parameterOrder": [
  28630. // "profileId",
  28631. // "id"
  28632. // ],
  28633. // "parameters": {
  28634. // "id": {
  28635. // "description": "Floodlight activity ID.",
  28636. // "format": "int64",
  28637. // "location": "path",
  28638. // "required": true,
  28639. // "type": "string"
  28640. // },
  28641. // "profileId": {
  28642. // "description": "User profile ID associated with this request.",
  28643. // "format": "int64",
  28644. // "location": "path",
  28645. // "required": true,
  28646. // "type": "string"
  28647. // }
  28648. // },
  28649. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28650. // "scopes": [
  28651. // "https://www.googleapis.com/auth/dfatrafficking"
  28652. // ]
  28653. // }
  28654. }
  28655. // method id "dfareporting.floodlightActivities.generatetag":
  28656. type FloodlightActivitiesGeneratetagCall struct {
  28657. s *Service
  28658. profileId int64
  28659. urlParams_ gensupport.URLParams
  28660. ctx_ context.Context
  28661. header_ http.Header
  28662. }
  28663. // Generatetag: Generates a tag for a floodlight activity.
  28664. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28665. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28666. c.profileId = profileId
  28667. return c
  28668. }
  28669. // FloodlightActivityId sets the optional parameter
  28670. // "floodlightActivityId": Floodlight activity ID for which we want to
  28671. // generate a tag.
  28672. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28673. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28674. return c
  28675. }
  28676. // Fields allows partial responses to be retrieved. See
  28677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28678. // for more information.
  28679. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28681. return c
  28682. }
  28683. // Context sets the context to be used in this call's Do method. Any
  28684. // pending HTTP request will be aborted if the provided context is
  28685. // canceled.
  28686. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28687. c.ctx_ = ctx
  28688. return c
  28689. }
  28690. // Header returns an http.Header that can be modified by the caller to
  28691. // add HTTP headers to the request.
  28692. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28693. if c.header_ == nil {
  28694. c.header_ = make(http.Header)
  28695. }
  28696. return c.header_
  28697. }
  28698. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28699. reqHeaders := make(http.Header)
  28700. for k, v := range c.header_ {
  28701. reqHeaders[k] = v
  28702. }
  28703. reqHeaders.Set("User-Agent", c.s.userAgent())
  28704. var body io.Reader = nil
  28705. c.urlParams_.Set("alt", alt)
  28706. c.urlParams_.Set("prettyPrint", "false")
  28707. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28708. urls += "?" + c.urlParams_.Encode()
  28709. req, err := http.NewRequest("POST", urls, body)
  28710. if err != nil {
  28711. return nil, err
  28712. }
  28713. req.Header = reqHeaders
  28714. googleapi.Expand(req.URL, map[string]string{
  28715. "profileId": strconv.FormatInt(c.profileId, 10),
  28716. })
  28717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28718. }
  28719. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28720. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28721. // be non-nil. Any non-2xx status code is an error. Response headers are
  28722. // in either
  28723. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28724. // a response was returned at all) in error.(*googleapi.Error).Header.
  28725. // Use googleapi.IsNotModified to check whether the returned error was
  28726. // because http.StatusNotModified was returned.
  28727. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28728. gensupport.SetOptions(c.urlParams_, opts...)
  28729. res, err := c.doRequest("json")
  28730. if res != nil && res.StatusCode == http.StatusNotModified {
  28731. if res.Body != nil {
  28732. res.Body.Close()
  28733. }
  28734. return nil, &googleapi.Error{
  28735. Code: res.StatusCode,
  28736. Header: res.Header,
  28737. }
  28738. }
  28739. if err != nil {
  28740. return nil, err
  28741. }
  28742. defer googleapi.CloseBody(res)
  28743. if err := googleapi.CheckResponse(res); err != nil {
  28744. return nil, err
  28745. }
  28746. ret := &FloodlightActivitiesGenerateTagResponse{
  28747. ServerResponse: googleapi.ServerResponse{
  28748. Header: res.Header,
  28749. HTTPStatusCode: res.StatusCode,
  28750. },
  28751. }
  28752. target := &ret
  28753. if err := gensupport.DecodeResponse(target, res); err != nil {
  28754. return nil, err
  28755. }
  28756. return ret, nil
  28757. // {
  28758. // "description": "Generates a tag for a floodlight activity.",
  28759. // "httpMethod": "POST",
  28760. // "id": "dfareporting.floodlightActivities.generatetag",
  28761. // "parameterOrder": [
  28762. // "profileId"
  28763. // ],
  28764. // "parameters": {
  28765. // "floodlightActivityId": {
  28766. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28767. // "format": "int64",
  28768. // "location": "query",
  28769. // "type": "string"
  28770. // },
  28771. // "profileId": {
  28772. // "description": "User profile ID associated with this request.",
  28773. // "format": "int64",
  28774. // "location": "path",
  28775. // "required": true,
  28776. // "type": "string"
  28777. // }
  28778. // },
  28779. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  28780. // "response": {
  28781. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  28782. // },
  28783. // "scopes": [
  28784. // "https://www.googleapis.com/auth/dfatrafficking"
  28785. // ]
  28786. // }
  28787. }
  28788. // method id "dfareporting.floodlightActivities.get":
  28789. type FloodlightActivitiesGetCall struct {
  28790. s *Service
  28791. profileId int64
  28792. id int64
  28793. urlParams_ gensupport.URLParams
  28794. ifNoneMatch_ string
  28795. ctx_ context.Context
  28796. header_ http.Header
  28797. }
  28798. // Get: Gets one floodlight activity by ID.
  28799. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  28800. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28801. c.profileId = profileId
  28802. c.id = id
  28803. return c
  28804. }
  28805. // Fields allows partial responses to be retrieved. See
  28806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28807. // for more information.
  28808. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  28809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28810. return c
  28811. }
  28812. // IfNoneMatch sets the optional parameter which makes the operation
  28813. // fail if the object's ETag matches the given value. This is useful for
  28814. // getting updates only after the object has changed since the last
  28815. // request. Use googleapi.IsNotModified to check whether the response
  28816. // error from Do is the result of In-None-Match.
  28817. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  28818. c.ifNoneMatch_ = entityTag
  28819. return c
  28820. }
  28821. // Context sets the context to be used in this call's Do method. Any
  28822. // pending HTTP request will be aborted if the provided context is
  28823. // canceled.
  28824. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  28825. c.ctx_ = ctx
  28826. return c
  28827. }
  28828. // Header returns an http.Header that can be modified by the caller to
  28829. // add HTTP headers to the request.
  28830. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  28831. if c.header_ == nil {
  28832. c.header_ = make(http.Header)
  28833. }
  28834. return c.header_
  28835. }
  28836. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  28837. reqHeaders := make(http.Header)
  28838. for k, v := range c.header_ {
  28839. reqHeaders[k] = v
  28840. }
  28841. reqHeaders.Set("User-Agent", c.s.userAgent())
  28842. if c.ifNoneMatch_ != "" {
  28843. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28844. }
  28845. var body io.Reader = nil
  28846. c.urlParams_.Set("alt", alt)
  28847. c.urlParams_.Set("prettyPrint", "false")
  28848. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28849. urls += "?" + c.urlParams_.Encode()
  28850. req, err := http.NewRequest("GET", urls, body)
  28851. if err != nil {
  28852. return nil, err
  28853. }
  28854. req.Header = reqHeaders
  28855. googleapi.Expand(req.URL, map[string]string{
  28856. "profileId": strconv.FormatInt(c.profileId, 10),
  28857. "id": strconv.FormatInt(c.id, 10),
  28858. })
  28859. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28860. }
  28861. // Do executes the "dfareporting.floodlightActivities.get" call.
  28862. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28863. // non-2xx status code is an error. Response headers are in either
  28864. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28865. // returned at all) in error.(*googleapi.Error).Header. Use
  28866. // googleapi.IsNotModified to check whether the returned error was
  28867. // because http.StatusNotModified was returned.
  28868. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28869. gensupport.SetOptions(c.urlParams_, opts...)
  28870. res, err := c.doRequest("json")
  28871. if res != nil && res.StatusCode == http.StatusNotModified {
  28872. if res.Body != nil {
  28873. res.Body.Close()
  28874. }
  28875. return nil, &googleapi.Error{
  28876. Code: res.StatusCode,
  28877. Header: res.Header,
  28878. }
  28879. }
  28880. if err != nil {
  28881. return nil, err
  28882. }
  28883. defer googleapi.CloseBody(res)
  28884. if err := googleapi.CheckResponse(res); err != nil {
  28885. return nil, err
  28886. }
  28887. ret := &FloodlightActivity{
  28888. ServerResponse: googleapi.ServerResponse{
  28889. Header: res.Header,
  28890. HTTPStatusCode: res.StatusCode,
  28891. },
  28892. }
  28893. target := &ret
  28894. if err := gensupport.DecodeResponse(target, res); err != nil {
  28895. return nil, err
  28896. }
  28897. return ret, nil
  28898. // {
  28899. // "description": "Gets one floodlight activity by ID.",
  28900. // "httpMethod": "GET",
  28901. // "id": "dfareporting.floodlightActivities.get",
  28902. // "parameterOrder": [
  28903. // "profileId",
  28904. // "id"
  28905. // ],
  28906. // "parameters": {
  28907. // "id": {
  28908. // "description": "Floodlight activity ID.",
  28909. // "format": "int64",
  28910. // "location": "path",
  28911. // "required": true,
  28912. // "type": "string"
  28913. // },
  28914. // "profileId": {
  28915. // "description": "User profile ID associated with this request.",
  28916. // "format": "int64",
  28917. // "location": "path",
  28918. // "required": true,
  28919. // "type": "string"
  28920. // }
  28921. // },
  28922. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28923. // "response": {
  28924. // "$ref": "FloodlightActivity"
  28925. // },
  28926. // "scopes": [
  28927. // "https://www.googleapis.com/auth/dfatrafficking"
  28928. // ]
  28929. // }
  28930. }
  28931. // method id "dfareporting.floodlightActivities.insert":
  28932. type FloodlightActivitiesInsertCall struct {
  28933. s *Service
  28934. profileId int64
  28935. floodlightactivity *FloodlightActivity
  28936. urlParams_ gensupport.URLParams
  28937. ctx_ context.Context
  28938. header_ http.Header
  28939. }
  28940. // Insert: Inserts a new floodlight activity.
  28941. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  28942. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28943. c.profileId = profileId
  28944. c.floodlightactivity = floodlightactivity
  28945. return c
  28946. }
  28947. // Fields allows partial responses to be retrieved. See
  28948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28949. // for more information.
  28950. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  28951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28952. return c
  28953. }
  28954. // Context sets the context to be used in this call's Do method. Any
  28955. // pending HTTP request will be aborted if the provided context is
  28956. // canceled.
  28957. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  28958. c.ctx_ = ctx
  28959. return c
  28960. }
  28961. // Header returns an http.Header that can be modified by the caller to
  28962. // add HTTP headers to the request.
  28963. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  28964. if c.header_ == nil {
  28965. c.header_ = make(http.Header)
  28966. }
  28967. return c.header_
  28968. }
  28969. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  28970. reqHeaders := make(http.Header)
  28971. for k, v := range c.header_ {
  28972. reqHeaders[k] = v
  28973. }
  28974. reqHeaders.Set("User-Agent", c.s.userAgent())
  28975. var body io.Reader = nil
  28976. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28977. if err != nil {
  28978. return nil, err
  28979. }
  28980. reqHeaders.Set("Content-Type", "application/json")
  28981. c.urlParams_.Set("alt", alt)
  28982. c.urlParams_.Set("prettyPrint", "false")
  28983. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28984. urls += "?" + c.urlParams_.Encode()
  28985. req, err := http.NewRequest("POST", urls, body)
  28986. if err != nil {
  28987. return nil, err
  28988. }
  28989. req.Header = reqHeaders
  28990. googleapi.Expand(req.URL, map[string]string{
  28991. "profileId": strconv.FormatInt(c.profileId, 10),
  28992. })
  28993. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28994. }
  28995. // Do executes the "dfareporting.floodlightActivities.insert" call.
  28996. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28997. // non-2xx status code is an error. Response headers are in either
  28998. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28999. // returned at all) in error.(*googleapi.Error).Header. Use
  29000. // googleapi.IsNotModified to check whether the returned error was
  29001. // because http.StatusNotModified was returned.
  29002. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29003. gensupport.SetOptions(c.urlParams_, opts...)
  29004. res, err := c.doRequest("json")
  29005. if res != nil && res.StatusCode == http.StatusNotModified {
  29006. if res.Body != nil {
  29007. res.Body.Close()
  29008. }
  29009. return nil, &googleapi.Error{
  29010. Code: res.StatusCode,
  29011. Header: res.Header,
  29012. }
  29013. }
  29014. if err != nil {
  29015. return nil, err
  29016. }
  29017. defer googleapi.CloseBody(res)
  29018. if err := googleapi.CheckResponse(res); err != nil {
  29019. return nil, err
  29020. }
  29021. ret := &FloodlightActivity{
  29022. ServerResponse: googleapi.ServerResponse{
  29023. Header: res.Header,
  29024. HTTPStatusCode: res.StatusCode,
  29025. },
  29026. }
  29027. target := &ret
  29028. if err := gensupport.DecodeResponse(target, res); err != nil {
  29029. return nil, err
  29030. }
  29031. return ret, nil
  29032. // {
  29033. // "description": "Inserts a new floodlight activity.",
  29034. // "httpMethod": "POST",
  29035. // "id": "dfareporting.floodlightActivities.insert",
  29036. // "parameterOrder": [
  29037. // "profileId"
  29038. // ],
  29039. // "parameters": {
  29040. // "profileId": {
  29041. // "description": "User profile ID associated with this request.",
  29042. // "format": "int64",
  29043. // "location": "path",
  29044. // "required": true,
  29045. // "type": "string"
  29046. // }
  29047. // },
  29048. // "path": "userprofiles/{profileId}/floodlightActivities",
  29049. // "request": {
  29050. // "$ref": "FloodlightActivity"
  29051. // },
  29052. // "response": {
  29053. // "$ref": "FloodlightActivity"
  29054. // },
  29055. // "scopes": [
  29056. // "https://www.googleapis.com/auth/dfatrafficking"
  29057. // ]
  29058. // }
  29059. }
  29060. // method id "dfareporting.floodlightActivities.list":
  29061. type FloodlightActivitiesListCall struct {
  29062. s *Service
  29063. profileId int64
  29064. urlParams_ gensupport.URLParams
  29065. ifNoneMatch_ string
  29066. ctx_ context.Context
  29067. header_ http.Header
  29068. }
  29069. // List: Retrieves a list of floodlight activities, possibly filtered.
  29070. // This method supports paging.
  29071. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  29072. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29073. c.profileId = profileId
  29074. return c
  29075. }
  29076. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29077. // floodlight activities for the specified advertiser ID. Must specify
  29078. // either ids, advertiserId, or floodlightConfigurationId for a
  29079. // non-empty result.
  29080. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  29081. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29082. return c
  29083. }
  29084. // FloodlightActivityGroupIds sets the optional parameter
  29085. // "floodlightActivityGroupIds": Select only floodlight activities with
  29086. // the specified floodlight activity group IDs.
  29087. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  29088. var floodlightActivityGroupIds_ []string
  29089. for _, v := range floodlightActivityGroupIds {
  29090. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  29091. }
  29092. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  29093. return c
  29094. }
  29095. // FloodlightActivityGroupName sets the optional parameter
  29096. // "floodlightActivityGroupName": Select only floodlight activities with
  29097. // the specified floodlight activity group name.
  29098. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  29099. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  29100. return c
  29101. }
  29102. // FloodlightActivityGroupTagString sets the optional parameter
  29103. // "floodlightActivityGroupTagString": Select only floodlight activities
  29104. // with the specified floodlight activity group tag string.
  29105. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  29106. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  29107. return c
  29108. }
  29109. // FloodlightActivityGroupType sets the optional parameter
  29110. // "floodlightActivityGroupType": Select only floodlight activities with
  29111. // the specified floodlight activity group type.
  29112. //
  29113. // Possible values:
  29114. // "COUNTER"
  29115. // "SALE"
  29116. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  29117. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  29118. return c
  29119. }
  29120. // FloodlightConfigurationId sets the optional parameter
  29121. // "floodlightConfigurationId": Select only floodlight activities for
  29122. // the specified floodlight configuration ID. Must specify either ids,
  29123. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29124. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  29125. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29126. return c
  29127. }
  29128. // Ids sets the optional parameter "ids": Select only floodlight
  29129. // activities with the specified IDs. Must specify either ids,
  29130. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29131. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  29132. var ids_ []string
  29133. for _, v := range ids {
  29134. ids_ = append(ids_, fmt.Sprint(v))
  29135. }
  29136. c.urlParams_.SetMulti("ids", ids_)
  29137. return c
  29138. }
  29139. // MaxResults sets the optional parameter "maxResults": Maximum number
  29140. // of results to return.
  29141. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  29142. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29143. return c
  29144. }
  29145. // PageToken sets the optional parameter "pageToken": Value of the
  29146. // nextPageToken from the previous result page.
  29147. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  29148. c.urlParams_.Set("pageToken", pageToken)
  29149. return c
  29150. }
  29151. // SearchString sets the optional parameter "searchString": Allows
  29152. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29153. // example, "floodlightactivity*2015" will return objects with names
  29154. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  29155. // or simply "floodlightactivity 2015". Most of the searches also add
  29156. // wildcards implicitly at the start and the end of the search string.
  29157. // For example, a search string of "floodlightactivity" will match
  29158. // objects with name "my floodlightactivity activity",
  29159. // "floodlightactivity 2015", or simply "floodlightactivity".
  29160. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  29161. c.urlParams_.Set("searchString", searchString)
  29162. return c
  29163. }
  29164. // SortField sets the optional parameter "sortField": Field by which to
  29165. // sort the list.
  29166. //
  29167. // Possible values:
  29168. // "ID" (default)
  29169. // "NAME"
  29170. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  29171. c.urlParams_.Set("sortField", sortField)
  29172. return c
  29173. }
  29174. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29175. // results.
  29176. //
  29177. // Possible values:
  29178. // "ASCENDING" (default)
  29179. // "DESCENDING"
  29180. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  29181. c.urlParams_.Set("sortOrder", sortOrder)
  29182. return c
  29183. }
  29184. // TagString sets the optional parameter "tagString": Select only
  29185. // floodlight activities with the specified tag string.
  29186. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  29187. c.urlParams_.Set("tagString", tagString)
  29188. return c
  29189. }
  29190. // Fields allows partial responses to be retrieved. See
  29191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29192. // for more information.
  29193. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  29194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29195. return c
  29196. }
  29197. // IfNoneMatch sets the optional parameter which makes the operation
  29198. // fail if the object's ETag matches the given value. This is useful for
  29199. // getting updates only after the object has changed since the last
  29200. // request. Use googleapi.IsNotModified to check whether the response
  29201. // error from Do is the result of In-None-Match.
  29202. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  29203. c.ifNoneMatch_ = entityTag
  29204. return c
  29205. }
  29206. // Context sets the context to be used in this call's Do method. Any
  29207. // pending HTTP request will be aborted if the provided context is
  29208. // canceled.
  29209. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  29210. c.ctx_ = ctx
  29211. return c
  29212. }
  29213. // Header returns an http.Header that can be modified by the caller to
  29214. // add HTTP headers to the request.
  29215. func (c *FloodlightActivitiesListCall) Header() http.Header {
  29216. if c.header_ == nil {
  29217. c.header_ = make(http.Header)
  29218. }
  29219. return c.header_
  29220. }
  29221. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  29222. reqHeaders := make(http.Header)
  29223. for k, v := range c.header_ {
  29224. reqHeaders[k] = v
  29225. }
  29226. reqHeaders.Set("User-Agent", c.s.userAgent())
  29227. if c.ifNoneMatch_ != "" {
  29228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29229. }
  29230. var body io.Reader = nil
  29231. c.urlParams_.Set("alt", alt)
  29232. c.urlParams_.Set("prettyPrint", "false")
  29233. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29234. urls += "?" + c.urlParams_.Encode()
  29235. req, err := http.NewRequest("GET", urls, body)
  29236. if err != nil {
  29237. return nil, err
  29238. }
  29239. req.Header = reqHeaders
  29240. googleapi.Expand(req.URL, map[string]string{
  29241. "profileId": strconv.FormatInt(c.profileId, 10),
  29242. })
  29243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29244. }
  29245. // Do executes the "dfareporting.floodlightActivities.list" call.
  29246. // Exactly one of *FloodlightActivitiesListResponse or error will be
  29247. // non-nil. Any non-2xx status code is an error. Response headers are in
  29248. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  29249. // a response was returned at all) in error.(*googleapi.Error).Header.
  29250. // Use googleapi.IsNotModified to check whether the returned error was
  29251. // because http.StatusNotModified was returned.
  29252. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  29253. gensupport.SetOptions(c.urlParams_, opts...)
  29254. res, err := c.doRequest("json")
  29255. if res != nil && res.StatusCode == http.StatusNotModified {
  29256. if res.Body != nil {
  29257. res.Body.Close()
  29258. }
  29259. return nil, &googleapi.Error{
  29260. Code: res.StatusCode,
  29261. Header: res.Header,
  29262. }
  29263. }
  29264. if err != nil {
  29265. return nil, err
  29266. }
  29267. defer googleapi.CloseBody(res)
  29268. if err := googleapi.CheckResponse(res); err != nil {
  29269. return nil, err
  29270. }
  29271. ret := &FloodlightActivitiesListResponse{
  29272. ServerResponse: googleapi.ServerResponse{
  29273. Header: res.Header,
  29274. HTTPStatusCode: res.StatusCode,
  29275. },
  29276. }
  29277. target := &ret
  29278. if err := gensupport.DecodeResponse(target, res); err != nil {
  29279. return nil, err
  29280. }
  29281. return ret, nil
  29282. // {
  29283. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  29284. // "httpMethod": "GET",
  29285. // "id": "dfareporting.floodlightActivities.list",
  29286. // "parameterOrder": [
  29287. // "profileId"
  29288. // ],
  29289. // "parameters": {
  29290. // "advertiserId": {
  29291. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29292. // "format": "int64",
  29293. // "location": "query",
  29294. // "type": "string"
  29295. // },
  29296. // "floodlightActivityGroupIds": {
  29297. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  29298. // "format": "int64",
  29299. // "location": "query",
  29300. // "repeated": true,
  29301. // "type": "string"
  29302. // },
  29303. // "floodlightActivityGroupName": {
  29304. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  29305. // "location": "query",
  29306. // "type": "string"
  29307. // },
  29308. // "floodlightActivityGroupTagString": {
  29309. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  29310. // "location": "query",
  29311. // "type": "string"
  29312. // },
  29313. // "floodlightActivityGroupType": {
  29314. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  29315. // "enum": [
  29316. // "COUNTER",
  29317. // "SALE"
  29318. // ],
  29319. // "enumDescriptions": [
  29320. // "",
  29321. // ""
  29322. // ],
  29323. // "location": "query",
  29324. // "type": "string"
  29325. // },
  29326. // "floodlightConfigurationId": {
  29327. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29328. // "format": "int64",
  29329. // "location": "query",
  29330. // "type": "string"
  29331. // },
  29332. // "ids": {
  29333. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  29334. // "format": "int64",
  29335. // "location": "query",
  29336. // "repeated": true,
  29337. // "type": "string"
  29338. // },
  29339. // "maxResults": {
  29340. // "default": "1000",
  29341. // "description": "Maximum number of results to return.",
  29342. // "format": "int32",
  29343. // "location": "query",
  29344. // "maximum": "1000",
  29345. // "minimum": "0",
  29346. // "type": "integer"
  29347. // },
  29348. // "pageToken": {
  29349. // "description": "Value of the nextPageToken from the previous result page.",
  29350. // "location": "query",
  29351. // "type": "string"
  29352. // },
  29353. // "profileId": {
  29354. // "description": "User profile ID associated with this request.",
  29355. // "format": "int64",
  29356. // "location": "path",
  29357. // "required": true,
  29358. // "type": "string"
  29359. // },
  29360. // "searchString": {
  29361. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivity*2015\" will return objects with names like \"floodlightactivity June 2015\", \"floodlightactivity April 2015\", or simply \"floodlightactivity 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivity\" will match objects with name \"my floodlightactivity activity\", \"floodlightactivity 2015\", or simply \"floodlightactivity\".",
  29362. // "location": "query",
  29363. // "type": "string"
  29364. // },
  29365. // "sortField": {
  29366. // "default": "ID",
  29367. // "description": "Field by which to sort the list.",
  29368. // "enum": [
  29369. // "ID",
  29370. // "NAME"
  29371. // ],
  29372. // "enumDescriptions": [
  29373. // "",
  29374. // ""
  29375. // ],
  29376. // "location": "query",
  29377. // "type": "string"
  29378. // },
  29379. // "sortOrder": {
  29380. // "default": "ASCENDING",
  29381. // "description": "Order of sorted results.",
  29382. // "enum": [
  29383. // "ASCENDING",
  29384. // "DESCENDING"
  29385. // ],
  29386. // "enumDescriptions": [
  29387. // "",
  29388. // ""
  29389. // ],
  29390. // "location": "query",
  29391. // "type": "string"
  29392. // },
  29393. // "tagString": {
  29394. // "description": "Select only floodlight activities with the specified tag string.",
  29395. // "location": "query",
  29396. // "type": "string"
  29397. // }
  29398. // },
  29399. // "path": "userprofiles/{profileId}/floodlightActivities",
  29400. // "response": {
  29401. // "$ref": "FloodlightActivitiesListResponse"
  29402. // },
  29403. // "scopes": [
  29404. // "https://www.googleapis.com/auth/dfatrafficking"
  29405. // ]
  29406. // }
  29407. }
  29408. // Pages invokes f for each page of results.
  29409. // A non-nil error returned from f will halt the iteration.
  29410. // The provided context supersedes any context provided to the Context method.
  29411. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  29412. c.ctx_ = ctx
  29413. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29414. for {
  29415. x, err := c.Do()
  29416. if err != nil {
  29417. return err
  29418. }
  29419. if err := f(x); err != nil {
  29420. return err
  29421. }
  29422. if x.NextPageToken == "" {
  29423. return nil
  29424. }
  29425. c.PageToken(x.NextPageToken)
  29426. }
  29427. }
  29428. // method id "dfareporting.floodlightActivities.patch":
  29429. type FloodlightActivitiesPatchCall struct {
  29430. s *Service
  29431. profileId int64
  29432. floodlightactivity *FloodlightActivity
  29433. urlParams_ gensupport.URLParams
  29434. ctx_ context.Context
  29435. header_ http.Header
  29436. }
  29437. // Patch: Updates an existing floodlight activity. This method supports
  29438. // patch semantics.
  29439. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29440. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29441. c.profileId = profileId
  29442. c.urlParams_.Set("id", fmt.Sprint(id))
  29443. c.floodlightactivity = floodlightactivity
  29444. return c
  29445. }
  29446. // Fields allows partial responses to be retrieved. See
  29447. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29448. // for more information.
  29449. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29450. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29451. return c
  29452. }
  29453. // Context sets the context to be used in this call's Do method. Any
  29454. // pending HTTP request will be aborted if the provided context is
  29455. // canceled.
  29456. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29457. c.ctx_ = ctx
  29458. return c
  29459. }
  29460. // Header returns an http.Header that can be modified by the caller to
  29461. // add HTTP headers to the request.
  29462. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29463. if c.header_ == nil {
  29464. c.header_ = make(http.Header)
  29465. }
  29466. return c.header_
  29467. }
  29468. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29469. reqHeaders := make(http.Header)
  29470. for k, v := range c.header_ {
  29471. reqHeaders[k] = v
  29472. }
  29473. reqHeaders.Set("User-Agent", c.s.userAgent())
  29474. var body io.Reader = nil
  29475. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29476. if err != nil {
  29477. return nil, err
  29478. }
  29479. reqHeaders.Set("Content-Type", "application/json")
  29480. c.urlParams_.Set("alt", alt)
  29481. c.urlParams_.Set("prettyPrint", "false")
  29482. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29483. urls += "?" + c.urlParams_.Encode()
  29484. req, err := http.NewRequest("PATCH", urls, body)
  29485. if err != nil {
  29486. return nil, err
  29487. }
  29488. req.Header = reqHeaders
  29489. googleapi.Expand(req.URL, map[string]string{
  29490. "profileId": strconv.FormatInt(c.profileId, 10),
  29491. })
  29492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29493. }
  29494. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29495. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29496. // non-2xx status code is an error. Response headers are in either
  29497. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29498. // returned at all) in error.(*googleapi.Error).Header. Use
  29499. // googleapi.IsNotModified to check whether the returned error was
  29500. // because http.StatusNotModified was returned.
  29501. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29502. gensupport.SetOptions(c.urlParams_, opts...)
  29503. res, err := c.doRequest("json")
  29504. if res != nil && res.StatusCode == http.StatusNotModified {
  29505. if res.Body != nil {
  29506. res.Body.Close()
  29507. }
  29508. return nil, &googleapi.Error{
  29509. Code: res.StatusCode,
  29510. Header: res.Header,
  29511. }
  29512. }
  29513. if err != nil {
  29514. return nil, err
  29515. }
  29516. defer googleapi.CloseBody(res)
  29517. if err := googleapi.CheckResponse(res); err != nil {
  29518. return nil, err
  29519. }
  29520. ret := &FloodlightActivity{
  29521. ServerResponse: googleapi.ServerResponse{
  29522. Header: res.Header,
  29523. HTTPStatusCode: res.StatusCode,
  29524. },
  29525. }
  29526. target := &ret
  29527. if err := gensupport.DecodeResponse(target, res); err != nil {
  29528. return nil, err
  29529. }
  29530. return ret, nil
  29531. // {
  29532. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29533. // "httpMethod": "PATCH",
  29534. // "id": "dfareporting.floodlightActivities.patch",
  29535. // "parameterOrder": [
  29536. // "profileId",
  29537. // "id"
  29538. // ],
  29539. // "parameters": {
  29540. // "id": {
  29541. // "description": "Floodlight activity ID.",
  29542. // "format": "int64",
  29543. // "location": "query",
  29544. // "required": true,
  29545. // "type": "string"
  29546. // },
  29547. // "profileId": {
  29548. // "description": "User profile ID associated with this request.",
  29549. // "format": "int64",
  29550. // "location": "path",
  29551. // "required": true,
  29552. // "type": "string"
  29553. // }
  29554. // },
  29555. // "path": "userprofiles/{profileId}/floodlightActivities",
  29556. // "request": {
  29557. // "$ref": "FloodlightActivity"
  29558. // },
  29559. // "response": {
  29560. // "$ref": "FloodlightActivity"
  29561. // },
  29562. // "scopes": [
  29563. // "https://www.googleapis.com/auth/dfatrafficking"
  29564. // ]
  29565. // }
  29566. }
  29567. // method id "dfareporting.floodlightActivities.update":
  29568. type FloodlightActivitiesUpdateCall struct {
  29569. s *Service
  29570. profileId int64
  29571. floodlightactivity *FloodlightActivity
  29572. urlParams_ gensupport.URLParams
  29573. ctx_ context.Context
  29574. header_ http.Header
  29575. }
  29576. // Update: Updates an existing floodlight activity.
  29577. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29578. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29579. c.profileId = profileId
  29580. c.floodlightactivity = floodlightactivity
  29581. return c
  29582. }
  29583. // Fields allows partial responses to be retrieved. See
  29584. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29585. // for more information.
  29586. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29587. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29588. return c
  29589. }
  29590. // Context sets the context to be used in this call's Do method. Any
  29591. // pending HTTP request will be aborted if the provided context is
  29592. // canceled.
  29593. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29594. c.ctx_ = ctx
  29595. return c
  29596. }
  29597. // Header returns an http.Header that can be modified by the caller to
  29598. // add HTTP headers to the request.
  29599. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29600. if c.header_ == nil {
  29601. c.header_ = make(http.Header)
  29602. }
  29603. return c.header_
  29604. }
  29605. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29606. reqHeaders := make(http.Header)
  29607. for k, v := range c.header_ {
  29608. reqHeaders[k] = v
  29609. }
  29610. reqHeaders.Set("User-Agent", c.s.userAgent())
  29611. var body io.Reader = nil
  29612. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29613. if err != nil {
  29614. return nil, err
  29615. }
  29616. reqHeaders.Set("Content-Type", "application/json")
  29617. c.urlParams_.Set("alt", alt)
  29618. c.urlParams_.Set("prettyPrint", "false")
  29619. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29620. urls += "?" + c.urlParams_.Encode()
  29621. req, err := http.NewRequest("PUT", urls, body)
  29622. if err != nil {
  29623. return nil, err
  29624. }
  29625. req.Header = reqHeaders
  29626. googleapi.Expand(req.URL, map[string]string{
  29627. "profileId": strconv.FormatInt(c.profileId, 10),
  29628. })
  29629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29630. }
  29631. // Do executes the "dfareporting.floodlightActivities.update" call.
  29632. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29633. // non-2xx status code is an error. Response headers are in either
  29634. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29635. // returned at all) in error.(*googleapi.Error).Header. Use
  29636. // googleapi.IsNotModified to check whether the returned error was
  29637. // because http.StatusNotModified was returned.
  29638. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29639. gensupport.SetOptions(c.urlParams_, opts...)
  29640. res, err := c.doRequest("json")
  29641. if res != nil && res.StatusCode == http.StatusNotModified {
  29642. if res.Body != nil {
  29643. res.Body.Close()
  29644. }
  29645. return nil, &googleapi.Error{
  29646. Code: res.StatusCode,
  29647. Header: res.Header,
  29648. }
  29649. }
  29650. if err != nil {
  29651. return nil, err
  29652. }
  29653. defer googleapi.CloseBody(res)
  29654. if err := googleapi.CheckResponse(res); err != nil {
  29655. return nil, err
  29656. }
  29657. ret := &FloodlightActivity{
  29658. ServerResponse: googleapi.ServerResponse{
  29659. Header: res.Header,
  29660. HTTPStatusCode: res.StatusCode,
  29661. },
  29662. }
  29663. target := &ret
  29664. if err := gensupport.DecodeResponse(target, res); err != nil {
  29665. return nil, err
  29666. }
  29667. return ret, nil
  29668. // {
  29669. // "description": "Updates an existing floodlight activity.",
  29670. // "httpMethod": "PUT",
  29671. // "id": "dfareporting.floodlightActivities.update",
  29672. // "parameterOrder": [
  29673. // "profileId"
  29674. // ],
  29675. // "parameters": {
  29676. // "profileId": {
  29677. // "description": "User profile ID associated with this request.",
  29678. // "format": "int64",
  29679. // "location": "path",
  29680. // "required": true,
  29681. // "type": "string"
  29682. // }
  29683. // },
  29684. // "path": "userprofiles/{profileId}/floodlightActivities",
  29685. // "request": {
  29686. // "$ref": "FloodlightActivity"
  29687. // },
  29688. // "response": {
  29689. // "$ref": "FloodlightActivity"
  29690. // },
  29691. // "scopes": [
  29692. // "https://www.googleapis.com/auth/dfatrafficking"
  29693. // ]
  29694. // }
  29695. }
  29696. // method id "dfareporting.floodlightActivityGroups.get":
  29697. type FloodlightActivityGroupsGetCall struct {
  29698. s *Service
  29699. profileId int64
  29700. id int64
  29701. urlParams_ gensupport.URLParams
  29702. ifNoneMatch_ string
  29703. ctx_ context.Context
  29704. header_ http.Header
  29705. }
  29706. // Get: Gets one floodlight activity group by ID.
  29707. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29708. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29709. c.profileId = profileId
  29710. c.id = id
  29711. return c
  29712. }
  29713. // Fields allows partial responses to be retrieved. See
  29714. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29715. // for more information.
  29716. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29717. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29718. return c
  29719. }
  29720. // IfNoneMatch sets the optional parameter which makes the operation
  29721. // fail if the object's ETag matches the given value. This is useful for
  29722. // getting updates only after the object has changed since the last
  29723. // request. Use googleapi.IsNotModified to check whether the response
  29724. // error from Do is the result of In-None-Match.
  29725. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29726. c.ifNoneMatch_ = entityTag
  29727. return c
  29728. }
  29729. // Context sets the context to be used in this call's Do method. Any
  29730. // pending HTTP request will be aborted if the provided context is
  29731. // canceled.
  29732. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29733. c.ctx_ = ctx
  29734. return c
  29735. }
  29736. // Header returns an http.Header that can be modified by the caller to
  29737. // add HTTP headers to the request.
  29738. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29739. if c.header_ == nil {
  29740. c.header_ = make(http.Header)
  29741. }
  29742. return c.header_
  29743. }
  29744. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29745. reqHeaders := make(http.Header)
  29746. for k, v := range c.header_ {
  29747. reqHeaders[k] = v
  29748. }
  29749. reqHeaders.Set("User-Agent", c.s.userAgent())
  29750. if c.ifNoneMatch_ != "" {
  29751. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29752. }
  29753. var body io.Reader = nil
  29754. c.urlParams_.Set("alt", alt)
  29755. c.urlParams_.Set("prettyPrint", "false")
  29756. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29757. urls += "?" + c.urlParams_.Encode()
  29758. req, err := http.NewRequest("GET", urls, body)
  29759. if err != nil {
  29760. return nil, err
  29761. }
  29762. req.Header = reqHeaders
  29763. googleapi.Expand(req.URL, map[string]string{
  29764. "profileId": strconv.FormatInt(c.profileId, 10),
  29765. "id": strconv.FormatInt(c.id, 10),
  29766. })
  29767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29768. }
  29769. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  29770. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29771. // non-2xx status code is an error. Response headers are in either
  29772. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29773. // returned at all) in error.(*googleapi.Error).Header. Use
  29774. // googleapi.IsNotModified to check whether the returned error was
  29775. // because http.StatusNotModified was returned.
  29776. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29777. gensupport.SetOptions(c.urlParams_, opts...)
  29778. res, err := c.doRequest("json")
  29779. if res != nil && res.StatusCode == http.StatusNotModified {
  29780. if res.Body != nil {
  29781. res.Body.Close()
  29782. }
  29783. return nil, &googleapi.Error{
  29784. Code: res.StatusCode,
  29785. Header: res.Header,
  29786. }
  29787. }
  29788. if err != nil {
  29789. return nil, err
  29790. }
  29791. defer googleapi.CloseBody(res)
  29792. if err := googleapi.CheckResponse(res); err != nil {
  29793. return nil, err
  29794. }
  29795. ret := &FloodlightActivityGroup{
  29796. ServerResponse: googleapi.ServerResponse{
  29797. Header: res.Header,
  29798. HTTPStatusCode: res.StatusCode,
  29799. },
  29800. }
  29801. target := &ret
  29802. if err := gensupport.DecodeResponse(target, res); err != nil {
  29803. return nil, err
  29804. }
  29805. return ret, nil
  29806. // {
  29807. // "description": "Gets one floodlight activity group by ID.",
  29808. // "httpMethod": "GET",
  29809. // "id": "dfareporting.floodlightActivityGroups.get",
  29810. // "parameterOrder": [
  29811. // "profileId",
  29812. // "id"
  29813. // ],
  29814. // "parameters": {
  29815. // "id": {
  29816. // "description": "Floodlight activity Group ID.",
  29817. // "format": "int64",
  29818. // "location": "path",
  29819. // "required": true,
  29820. // "type": "string"
  29821. // },
  29822. // "profileId": {
  29823. // "description": "User profile ID associated with this request.",
  29824. // "format": "int64",
  29825. // "location": "path",
  29826. // "required": true,
  29827. // "type": "string"
  29828. // }
  29829. // },
  29830. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  29831. // "response": {
  29832. // "$ref": "FloodlightActivityGroup"
  29833. // },
  29834. // "scopes": [
  29835. // "https://www.googleapis.com/auth/dfatrafficking"
  29836. // ]
  29837. // }
  29838. }
  29839. // method id "dfareporting.floodlightActivityGroups.insert":
  29840. type FloodlightActivityGroupsInsertCall struct {
  29841. s *Service
  29842. profileId int64
  29843. floodlightactivitygroup *FloodlightActivityGroup
  29844. urlParams_ gensupport.URLParams
  29845. ctx_ context.Context
  29846. header_ http.Header
  29847. }
  29848. // Insert: Inserts a new floodlight activity group.
  29849. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  29850. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29851. c.profileId = profileId
  29852. c.floodlightactivitygroup = floodlightactivitygroup
  29853. return c
  29854. }
  29855. // Fields allows partial responses to be retrieved. See
  29856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29857. // for more information.
  29858. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  29859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29860. return c
  29861. }
  29862. // Context sets the context to be used in this call's Do method. Any
  29863. // pending HTTP request will be aborted if the provided context is
  29864. // canceled.
  29865. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  29866. c.ctx_ = ctx
  29867. return c
  29868. }
  29869. // Header returns an http.Header that can be modified by the caller to
  29870. // add HTTP headers to the request.
  29871. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  29872. if c.header_ == nil {
  29873. c.header_ = make(http.Header)
  29874. }
  29875. return c.header_
  29876. }
  29877. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  29878. reqHeaders := make(http.Header)
  29879. for k, v := range c.header_ {
  29880. reqHeaders[k] = v
  29881. }
  29882. reqHeaders.Set("User-Agent", c.s.userAgent())
  29883. var body io.Reader = nil
  29884. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  29885. if err != nil {
  29886. return nil, err
  29887. }
  29888. reqHeaders.Set("Content-Type", "application/json")
  29889. c.urlParams_.Set("alt", alt)
  29890. c.urlParams_.Set("prettyPrint", "false")
  29891. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29892. urls += "?" + c.urlParams_.Encode()
  29893. req, err := http.NewRequest("POST", urls, body)
  29894. if err != nil {
  29895. return nil, err
  29896. }
  29897. req.Header = reqHeaders
  29898. googleapi.Expand(req.URL, map[string]string{
  29899. "profileId": strconv.FormatInt(c.profileId, 10),
  29900. })
  29901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29902. }
  29903. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  29904. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29905. // non-2xx status code is an error. Response headers are in either
  29906. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29907. // returned at all) in error.(*googleapi.Error).Header. Use
  29908. // googleapi.IsNotModified to check whether the returned error was
  29909. // because http.StatusNotModified was returned.
  29910. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29911. gensupport.SetOptions(c.urlParams_, opts...)
  29912. res, err := c.doRequest("json")
  29913. if res != nil && res.StatusCode == http.StatusNotModified {
  29914. if res.Body != nil {
  29915. res.Body.Close()
  29916. }
  29917. return nil, &googleapi.Error{
  29918. Code: res.StatusCode,
  29919. Header: res.Header,
  29920. }
  29921. }
  29922. if err != nil {
  29923. return nil, err
  29924. }
  29925. defer googleapi.CloseBody(res)
  29926. if err := googleapi.CheckResponse(res); err != nil {
  29927. return nil, err
  29928. }
  29929. ret := &FloodlightActivityGroup{
  29930. ServerResponse: googleapi.ServerResponse{
  29931. Header: res.Header,
  29932. HTTPStatusCode: res.StatusCode,
  29933. },
  29934. }
  29935. target := &ret
  29936. if err := gensupport.DecodeResponse(target, res); err != nil {
  29937. return nil, err
  29938. }
  29939. return ret, nil
  29940. // {
  29941. // "description": "Inserts a new floodlight activity group.",
  29942. // "httpMethod": "POST",
  29943. // "id": "dfareporting.floodlightActivityGroups.insert",
  29944. // "parameterOrder": [
  29945. // "profileId"
  29946. // ],
  29947. // "parameters": {
  29948. // "profileId": {
  29949. // "description": "User profile ID associated with this request.",
  29950. // "format": "int64",
  29951. // "location": "path",
  29952. // "required": true,
  29953. // "type": "string"
  29954. // }
  29955. // },
  29956. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29957. // "request": {
  29958. // "$ref": "FloodlightActivityGroup"
  29959. // },
  29960. // "response": {
  29961. // "$ref": "FloodlightActivityGroup"
  29962. // },
  29963. // "scopes": [
  29964. // "https://www.googleapis.com/auth/dfatrafficking"
  29965. // ]
  29966. // }
  29967. }
  29968. // method id "dfareporting.floodlightActivityGroups.list":
  29969. type FloodlightActivityGroupsListCall struct {
  29970. s *Service
  29971. profileId int64
  29972. urlParams_ gensupport.URLParams
  29973. ifNoneMatch_ string
  29974. ctx_ context.Context
  29975. header_ http.Header
  29976. }
  29977. // List: Retrieves a list of floodlight activity groups, possibly
  29978. // filtered. This method supports paging.
  29979. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  29980. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29981. c.profileId = profileId
  29982. return c
  29983. }
  29984. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29985. // floodlight activity groups with the specified advertiser ID. Must
  29986. // specify either advertiserId or floodlightConfigurationId for a
  29987. // non-empty result.
  29988. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  29989. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29990. return c
  29991. }
  29992. // FloodlightConfigurationId sets the optional parameter
  29993. // "floodlightConfigurationId": Select only floodlight activity groups
  29994. // with the specified floodlight configuration ID. Must specify either
  29995. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29996. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  29997. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29998. return c
  29999. }
  30000. // Ids sets the optional parameter "ids": Select only floodlight
  30001. // activity groups with the specified IDs. Must specify either
  30002. // advertiserId or floodlightConfigurationId for a non-empty result.
  30003. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  30004. var ids_ []string
  30005. for _, v := range ids {
  30006. ids_ = append(ids_, fmt.Sprint(v))
  30007. }
  30008. c.urlParams_.SetMulti("ids", ids_)
  30009. return c
  30010. }
  30011. // MaxResults sets the optional parameter "maxResults": Maximum number
  30012. // of results to return.
  30013. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  30014. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30015. return c
  30016. }
  30017. // PageToken sets the optional parameter "pageToken": Value of the
  30018. // nextPageToken from the previous result page.
  30019. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  30020. c.urlParams_.Set("pageToken", pageToken)
  30021. return c
  30022. }
  30023. // SearchString sets the optional parameter "searchString": Allows
  30024. // searching for objects by name or ID. Wildcards (*) are allowed. For
  30025. // example, "floodlightactivitygroup*2015" will return objects with
  30026. // names like "floodlightactivitygroup June 2015",
  30027. // "floodlightactivitygroup April 2015", or simply
  30028. // "floodlightactivitygroup 2015". Most of the searches also add
  30029. // wildcards implicitly at the start and the end of the search string.
  30030. // For example, a search string of "floodlightactivitygroup" will match
  30031. // objects with name "my floodlightactivitygroup activity",
  30032. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  30033. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  30034. c.urlParams_.Set("searchString", searchString)
  30035. return c
  30036. }
  30037. // SortField sets the optional parameter "sortField": Field by which to
  30038. // sort the list.
  30039. //
  30040. // Possible values:
  30041. // "ID" (default)
  30042. // "NAME"
  30043. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  30044. c.urlParams_.Set("sortField", sortField)
  30045. return c
  30046. }
  30047. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  30048. // results.
  30049. //
  30050. // Possible values:
  30051. // "ASCENDING" (default)
  30052. // "DESCENDING"
  30053. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  30054. c.urlParams_.Set("sortOrder", sortOrder)
  30055. return c
  30056. }
  30057. // Type sets the optional parameter "type": Select only floodlight
  30058. // activity groups with the specified floodlight activity group type.
  30059. //
  30060. // Possible values:
  30061. // "COUNTER"
  30062. // "SALE"
  30063. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  30064. c.urlParams_.Set("type", type_)
  30065. return c
  30066. }
  30067. // Fields allows partial responses to be retrieved. See
  30068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30069. // for more information.
  30070. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  30071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30072. return c
  30073. }
  30074. // IfNoneMatch sets the optional parameter which makes the operation
  30075. // fail if the object's ETag matches the given value. This is useful for
  30076. // getting updates only after the object has changed since the last
  30077. // request. Use googleapi.IsNotModified to check whether the response
  30078. // error from Do is the result of In-None-Match.
  30079. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  30080. c.ifNoneMatch_ = entityTag
  30081. return c
  30082. }
  30083. // Context sets the context to be used in this call's Do method. Any
  30084. // pending HTTP request will be aborted if the provided context is
  30085. // canceled.
  30086. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  30087. c.ctx_ = ctx
  30088. return c
  30089. }
  30090. // Header returns an http.Header that can be modified by the caller to
  30091. // add HTTP headers to the request.
  30092. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  30093. if c.header_ == nil {
  30094. c.header_ = make(http.Header)
  30095. }
  30096. return c.header_
  30097. }
  30098. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  30099. reqHeaders := make(http.Header)
  30100. for k, v := range c.header_ {
  30101. reqHeaders[k] = v
  30102. }
  30103. reqHeaders.Set("User-Agent", c.s.userAgent())
  30104. if c.ifNoneMatch_ != "" {
  30105. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30106. }
  30107. var body io.Reader = nil
  30108. c.urlParams_.Set("alt", alt)
  30109. c.urlParams_.Set("prettyPrint", "false")
  30110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30111. urls += "?" + c.urlParams_.Encode()
  30112. req, err := http.NewRequest("GET", urls, body)
  30113. if err != nil {
  30114. return nil, err
  30115. }
  30116. req.Header = reqHeaders
  30117. googleapi.Expand(req.URL, map[string]string{
  30118. "profileId": strconv.FormatInt(c.profileId, 10),
  30119. })
  30120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30121. }
  30122. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  30123. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  30124. // non-nil. Any non-2xx status code is an error. Response headers are in
  30125. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  30126. // (if a response was returned at all) in
  30127. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30128. // whether the returned error was because http.StatusNotModified was
  30129. // returned.
  30130. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  30131. gensupport.SetOptions(c.urlParams_, opts...)
  30132. res, err := c.doRequest("json")
  30133. if res != nil && res.StatusCode == http.StatusNotModified {
  30134. if res.Body != nil {
  30135. res.Body.Close()
  30136. }
  30137. return nil, &googleapi.Error{
  30138. Code: res.StatusCode,
  30139. Header: res.Header,
  30140. }
  30141. }
  30142. if err != nil {
  30143. return nil, err
  30144. }
  30145. defer googleapi.CloseBody(res)
  30146. if err := googleapi.CheckResponse(res); err != nil {
  30147. return nil, err
  30148. }
  30149. ret := &FloodlightActivityGroupsListResponse{
  30150. ServerResponse: googleapi.ServerResponse{
  30151. Header: res.Header,
  30152. HTTPStatusCode: res.StatusCode,
  30153. },
  30154. }
  30155. target := &ret
  30156. if err := gensupport.DecodeResponse(target, res); err != nil {
  30157. return nil, err
  30158. }
  30159. return ret, nil
  30160. // {
  30161. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  30162. // "httpMethod": "GET",
  30163. // "id": "dfareporting.floodlightActivityGroups.list",
  30164. // "parameterOrder": [
  30165. // "profileId"
  30166. // ],
  30167. // "parameters": {
  30168. // "advertiserId": {
  30169. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30170. // "format": "int64",
  30171. // "location": "query",
  30172. // "type": "string"
  30173. // },
  30174. // "floodlightConfigurationId": {
  30175. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  30176. // "format": "int64",
  30177. // "location": "query",
  30178. // "type": "string"
  30179. // },
  30180. // "ids": {
  30181. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  30182. // "format": "int64",
  30183. // "location": "query",
  30184. // "repeated": true,
  30185. // "type": "string"
  30186. // },
  30187. // "maxResults": {
  30188. // "default": "1000",
  30189. // "description": "Maximum number of results to return.",
  30190. // "format": "int32",
  30191. // "location": "query",
  30192. // "maximum": "1000",
  30193. // "minimum": "0",
  30194. // "type": "integer"
  30195. // },
  30196. // "pageToken": {
  30197. // "description": "Value of the nextPageToken from the previous result page.",
  30198. // "location": "query",
  30199. // "type": "string"
  30200. // },
  30201. // "profileId": {
  30202. // "description": "User profile ID associated with this request.",
  30203. // "format": "int64",
  30204. // "location": "path",
  30205. // "required": true,
  30206. // "type": "string"
  30207. // },
  30208. // "searchString": {
  30209. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"floodlightactivitygroup*2015\" will return objects with names like \"floodlightactivitygroup June 2015\", \"floodlightactivitygroup April 2015\", or simply \"floodlightactivitygroup 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"floodlightactivitygroup\" will match objects with name \"my floodlightactivitygroup activity\", \"floodlightactivitygroup 2015\", or simply \"floodlightactivitygroup\".",
  30210. // "location": "query",
  30211. // "type": "string"
  30212. // },
  30213. // "sortField": {
  30214. // "default": "ID",
  30215. // "description": "Field by which to sort the list.",
  30216. // "enum": [
  30217. // "ID",
  30218. // "NAME"
  30219. // ],
  30220. // "enumDescriptions": [
  30221. // "",
  30222. // ""
  30223. // ],
  30224. // "location": "query",
  30225. // "type": "string"
  30226. // },
  30227. // "sortOrder": {
  30228. // "default": "ASCENDING",
  30229. // "description": "Order of sorted results.",
  30230. // "enum": [
  30231. // "ASCENDING",
  30232. // "DESCENDING"
  30233. // ],
  30234. // "enumDescriptions": [
  30235. // "",
  30236. // ""
  30237. // ],
  30238. // "location": "query",
  30239. // "type": "string"
  30240. // },
  30241. // "type": {
  30242. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  30243. // "enum": [
  30244. // "COUNTER",
  30245. // "SALE"
  30246. // ],
  30247. // "enumDescriptions": [
  30248. // "",
  30249. // ""
  30250. // ],
  30251. // "location": "query",
  30252. // "type": "string"
  30253. // }
  30254. // },
  30255. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30256. // "response": {
  30257. // "$ref": "FloodlightActivityGroupsListResponse"
  30258. // },
  30259. // "scopes": [
  30260. // "https://www.googleapis.com/auth/dfatrafficking"
  30261. // ]
  30262. // }
  30263. }
  30264. // Pages invokes f for each page of results.
  30265. // A non-nil error returned from f will halt the iteration.
  30266. // The provided context supersedes any context provided to the Context method.
  30267. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  30268. c.ctx_ = ctx
  30269. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  30270. for {
  30271. x, err := c.Do()
  30272. if err != nil {
  30273. return err
  30274. }
  30275. if err := f(x); err != nil {
  30276. return err
  30277. }
  30278. if x.NextPageToken == "" {
  30279. return nil
  30280. }
  30281. c.PageToken(x.NextPageToken)
  30282. }
  30283. }
  30284. // method id "dfareporting.floodlightActivityGroups.patch":
  30285. type FloodlightActivityGroupsPatchCall struct {
  30286. s *Service
  30287. profileId int64
  30288. floodlightactivitygroup *FloodlightActivityGroup
  30289. urlParams_ gensupport.URLParams
  30290. ctx_ context.Context
  30291. header_ http.Header
  30292. }
  30293. // Patch: Updates an existing floodlight activity group. This method
  30294. // supports patch semantics.
  30295. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  30296. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30297. c.profileId = profileId
  30298. c.urlParams_.Set("id", fmt.Sprint(id))
  30299. c.floodlightactivitygroup = floodlightactivitygroup
  30300. return c
  30301. }
  30302. // Fields allows partial responses to be retrieved. See
  30303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30304. // for more information.
  30305. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  30306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30307. return c
  30308. }
  30309. // Context sets the context to be used in this call's Do method. Any
  30310. // pending HTTP request will be aborted if the provided context is
  30311. // canceled.
  30312. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  30313. c.ctx_ = ctx
  30314. return c
  30315. }
  30316. // Header returns an http.Header that can be modified by the caller to
  30317. // add HTTP headers to the request.
  30318. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  30319. if c.header_ == nil {
  30320. c.header_ = make(http.Header)
  30321. }
  30322. return c.header_
  30323. }
  30324. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  30325. reqHeaders := make(http.Header)
  30326. for k, v := range c.header_ {
  30327. reqHeaders[k] = v
  30328. }
  30329. reqHeaders.Set("User-Agent", c.s.userAgent())
  30330. var body io.Reader = nil
  30331. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30332. if err != nil {
  30333. return nil, err
  30334. }
  30335. reqHeaders.Set("Content-Type", "application/json")
  30336. c.urlParams_.Set("alt", alt)
  30337. c.urlParams_.Set("prettyPrint", "false")
  30338. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30339. urls += "?" + c.urlParams_.Encode()
  30340. req, err := http.NewRequest("PATCH", urls, body)
  30341. if err != nil {
  30342. return nil, err
  30343. }
  30344. req.Header = reqHeaders
  30345. googleapi.Expand(req.URL, map[string]string{
  30346. "profileId": strconv.FormatInt(c.profileId, 10),
  30347. })
  30348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30349. }
  30350. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  30351. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30352. // non-2xx status code is an error. Response headers are in either
  30353. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30354. // returned at all) in error.(*googleapi.Error).Header. Use
  30355. // googleapi.IsNotModified to check whether the returned error was
  30356. // because http.StatusNotModified was returned.
  30357. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30358. gensupport.SetOptions(c.urlParams_, opts...)
  30359. res, err := c.doRequest("json")
  30360. if res != nil && res.StatusCode == http.StatusNotModified {
  30361. if res.Body != nil {
  30362. res.Body.Close()
  30363. }
  30364. return nil, &googleapi.Error{
  30365. Code: res.StatusCode,
  30366. Header: res.Header,
  30367. }
  30368. }
  30369. if err != nil {
  30370. return nil, err
  30371. }
  30372. defer googleapi.CloseBody(res)
  30373. if err := googleapi.CheckResponse(res); err != nil {
  30374. return nil, err
  30375. }
  30376. ret := &FloodlightActivityGroup{
  30377. ServerResponse: googleapi.ServerResponse{
  30378. Header: res.Header,
  30379. HTTPStatusCode: res.StatusCode,
  30380. },
  30381. }
  30382. target := &ret
  30383. if err := gensupport.DecodeResponse(target, res); err != nil {
  30384. return nil, err
  30385. }
  30386. return ret, nil
  30387. // {
  30388. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  30389. // "httpMethod": "PATCH",
  30390. // "id": "dfareporting.floodlightActivityGroups.patch",
  30391. // "parameterOrder": [
  30392. // "profileId",
  30393. // "id"
  30394. // ],
  30395. // "parameters": {
  30396. // "id": {
  30397. // "description": "Floodlight activity Group ID.",
  30398. // "format": "int64",
  30399. // "location": "query",
  30400. // "required": true,
  30401. // "type": "string"
  30402. // },
  30403. // "profileId": {
  30404. // "description": "User profile ID associated with this request.",
  30405. // "format": "int64",
  30406. // "location": "path",
  30407. // "required": true,
  30408. // "type": "string"
  30409. // }
  30410. // },
  30411. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30412. // "request": {
  30413. // "$ref": "FloodlightActivityGroup"
  30414. // },
  30415. // "response": {
  30416. // "$ref": "FloodlightActivityGroup"
  30417. // },
  30418. // "scopes": [
  30419. // "https://www.googleapis.com/auth/dfatrafficking"
  30420. // ]
  30421. // }
  30422. }
  30423. // method id "dfareporting.floodlightActivityGroups.update":
  30424. type FloodlightActivityGroupsUpdateCall struct {
  30425. s *Service
  30426. profileId int64
  30427. floodlightactivitygroup *FloodlightActivityGroup
  30428. urlParams_ gensupport.URLParams
  30429. ctx_ context.Context
  30430. header_ http.Header
  30431. }
  30432. // Update: Updates an existing floodlight activity group.
  30433. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  30434. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30435. c.profileId = profileId
  30436. c.floodlightactivitygroup = floodlightactivitygroup
  30437. return c
  30438. }
  30439. // Fields allows partial responses to be retrieved. See
  30440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30441. // for more information.
  30442. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30444. return c
  30445. }
  30446. // Context sets the context to be used in this call's Do method. Any
  30447. // pending HTTP request will be aborted if the provided context is
  30448. // canceled.
  30449. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30450. c.ctx_ = ctx
  30451. return c
  30452. }
  30453. // Header returns an http.Header that can be modified by the caller to
  30454. // add HTTP headers to the request.
  30455. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30456. if c.header_ == nil {
  30457. c.header_ = make(http.Header)
  30458. }
  30459. return c.header_
  30460. }
  30461. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30462. reqHeaders := make(http.Header)
  30463. for k, v := range c.header_ {
  30464. reqHeaders[k] = v
  30465. }
  30466. reqHeaders.Set("User-Agent", c.s.userAgent())
  30467. var body io.Reader = nil
  30468. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30469. if err != nil {
  30470. return nil, err
  30471. }
  30472. reqHeaders.Set("Content-Type", "application/json")
  30473. c.urlParams_.Set("alt", alt)
  30474. c.urlParams_.Set("prettyPrint", "false")
  30475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30476. urls += "?" + c.urlParams_.Encode()
  30477. req, err := http.NewRequest("PUT", urls, body)
  30478. if err != nil {
  30479. return nil, err
  30480. }
  30481. req.Header = reqHeaders
  30482. googleapi.Expand(req.URL, map[string]string{
  30483. "profileId": strconv.FormatInt(c.profileId, 10),
  30484. })
  30485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30486. }
  30487. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30488. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30489. // non-2xx status code is an error. Response headers are in either
  30490. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30491. // returned at all) in error.(*googleapi.Error).Header. Use
  30492. // googleapi.IsNotModified to check whether the returned error was
  30493. // because http.StatusNotModified was returned.
  30494. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30495. gensupport.SetOptions(c.urlParams_, opts...)
  30496. res, err := c.doRequest("json")
  30497. if res != nil && res.StatusCode == http.StatusNotModified {
  30498. if res.Body != nil {
  30499. res.Body.Close()
  30500. }
  30501. return nil, &googleapi.Error{
  30502. Code: res.StatusCode,
  30503. Header: res.Header,
  30504. }
  30505. }
  30506. if err != nil {
  30507. return nil, err
  30508. }
  30509. defer googleapi.CloseBody(res)
  30510. if err := googleapi.CheckResponse(res); err != nil {
  30511. return nil, err
  30512. }
  30513. ret := &FloodlightActivityGroup{
  30514. ServerResponse: googleapi.ServerResponse{
  30515. Header: res.Header,
  30516. HTTPStatusCode: res.StatusCode,
  30517. },
  30518. }
  30519. target := &ret
  30520. if err := gensupport.DecodeResponse(target, res); err != nil {
  30521. return nil, err
  30522. }
  30523. return ret, nil
  30524. // {
  30525. // "description": "Updates an existing floodlight activity group.",
  30526. // "httpMethod": "PUT",
  30527. // "id": "dfareporting.floodlightActivityGroups.update",
  30528. // "parameterOrder": [
  30529. // "profileId"
  30530. // ],
  30531. // "parameters": {
  30532. // "profileId": {
  30533. // "description": "User profile ID associated with this request.",
  30534. // "format": "int64",
  30535. // "location": "path",
  30536. // "required": true,
  30537. // "type": "string"
  30538. // }
  30539. // },
  30540. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30541. // "request": {
  30542. // "$ref": "FloodlightActivityGroup"
  30543. // },
  30544. // "response": {
  30545. // "$ref": "FloodlightActivityGroup"
  30546. // },
  30547. // "scopes": [
  30548. // "https://www.googleapis.com/auth/dfatrafficking"
  30549. // ]
  30550. // }
  30551. }
  30552. // method id "dfareporting.floodlightConfigurations.get":
  30553. type FloodlightConfigurationsGetCall struct {
  30554. s *Service
  30555. profileId int64
  30556. id int64
  30557. urlParams_ gensupport.URLParams
  30558. ifNoneMatch_ string
  30559. ctx_ context.Context
  30560. header_ http.Header
  30561. }
  30562. // Get: Gets one floodlight configuration by ID.
  30563. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30564. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30565. c.profileId = profileId
  30566. c.id = id
  30567. return c
  30568. }
  30569. // Fields allows partial responses to be retrieved. See
  30570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30571. // for more information.
  30572. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30574. return c
  30575. }
  30576. // IfNoneMatch sets the optional parameter which makes the operation
  30577. // fail if the object's ETag matches the given value. This is useful for
  30578. // getting updates only after the object has changed since the last
  30579. // request. Use googleapi.IsNotModified to check whether the response
  30580. // error from Do is the result of In-None-Match.
  30581. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30582. c.ifNoneMatch_ = entityTag
  30583. return c
  30584. }
  30585. // Context sets the context to be used in this call's Do method. Any
  30586. // pending HTTP request will be aborted if the provided context is
  30587. // canceled.
  30588. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30589. c.ctx_ = ctx
  30590. return c
  30591. }
  30592. // Header returns an http.Header that can be modified by the caller to
  30593. // add HTTP headers to the request.
  30594. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30595. if c.header_ == nil {
  30596. c.header_ = make(http.Header)
  30597. }
  30598. return c.header_
  30599. }
  30600. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30601. reqHeaders := make(http.Header)
  30602. for k, v := range c.header_ {
  30603. reqHeaders[k] = v
  30604. }
  30605. reqHeaders.Set("User-Agent", c.s.userAgent())
  30606. if c.ifNoneMatch_ != "" {
  30607. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30608. }
  30609. var body io.Reader = nil
  30610. c.urlParams_.Set("alt", alt)
  30611. c.urlParams_.Set("prettyPrint", "false")
  30612. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30613. urls += "?" + c.urlParams_.Encode()
  30614. req, err := http.NewRequest("GET", urls, body)
  30615. if err != nil {
  30616. return nil, err
  30617. }
  30618. req.Header = reqHeaders
  30619. googleapi.Expand(req.URL, map[string]string{
  30620. "profileId": strconv.FormatInt(c.profileId, 10),
  30621. "id": strconv.FormatInt(c.id, 10),
  30622. })
  30623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30624. }
  30625. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30626. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30627. // non-2xx status code is an error. Response headers are in either
  30628. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30629. // returned at all) in error.(*googleapi.Error).Header. Use
  30630. // googleapi.IsNotModified to check whether the returned error was
  30631. // because http.StatusNotModified was returned.
  30632. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30633. gensupport.SetOptions(c.urlParams_, opts...)
  30634. res, err := c.doRequest("json")
  30635. if res != nil && res.StatusCode == http.StatusNotModified {
  30636. if res.Body != nil {
  30637. res.Body.Close()
  30638. }
  30639. return nil, &googleapi.Error{
  30640. Code: res.StatusCode,
  30641. Header: res.Header,
  30642. }
  30643. }
  30644. if err != nil {
  30645. return nil, err
  30646. }
  30647. defer googleapi.CloseBody(res)
  30648. if err := googleapi.CheckResponse(res); err != nil {
  30649. return nil, err
  30650. }
  30651. ret := &FloodlightConfiguration{
  30652. ServerResponse: googleapi.ServerResponse{
  30653. Header: res.Header,
  30654. HTTPStatusCode: res.StatusCode,
  30655. },
  30656. }
  30657. target := &ret
  30658. if err := gensupport.DecodeResponse(target, res); err != nil {
  30659. return nil, err
  30660. }
  30661. return ret, nil
  30662. // {
  30663. // "description": "Gets one floodlight configuration by ID.",
  30664. // "httpMethod": "GET",
  30665. // "id": "dfareporting.floodlightConfigurations.get",
  30666. // "parameterOrder": [
  30667. // "profileId",
  30668. // "id"
  30669. // ],
  30670. // "parameters": {
  30671. // "id": {
  30672. // "description": "Floodlight configuration ID.",
  30673. // "format": "int64",
  30674. // "location": "path",
  30675. // "required": true,
  30676. // "type": "string"
  30677. // },
  30678. // "profileId": {
  30679. // "description": "User profile ID associated with this request.",
  30680. // "format": "int64",
  30681. // "location": "path",
  30682. // "required": true,
  30683. // "type": "string"
  30684. // }
  30685. // },
  30686. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30687. // "response": {
  30688. // "$ref": "FloodlightConfiguration"
  30689. // },
  30690. // "scopes": [
  30691. // "https://www.googleapis.com/auth/dfatrafficking"
  30692. // ]
  30693. // }
  30694. }
  30695. // method id "dfareporting.floodlightConfigurations.list":
  30696. type FloodlightConfigurationsListCall struct {
  30697. s *Service
  30698. profileId int64
  30699. urlParams_ gensupport.URLParams
  30700. ifNoneMatch_ string
  30701. ctx_ context.Context
  30702. header_ http.Header
  30703. }
  30704. // List: Retrieves a list of floodlight configurations, possibly
  30705. // filtered.
  30706. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30707. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30708. c.profileId = profileId
  30709. return c
  30710. }
  30711. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30712. // configurations to retrieve. Required field; otherwise an empty list
  30713. // will be returned.
  30714. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30715. var ids_ []string
  30716. for _, v := range ids {
  30717. ids_ = append(ids_, fmt.Sprint(v))
  30718. }
  30719. c.urlParams_.SetMulti("ids", ids_)
  30720. return c
  30721. }
  30722. // Fields allows partial responses to be retrieved. See
  30723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30724. // for more information.
  30725. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30727. return c
  30728. }
  30729. // IfNoneMatch sets the optional parameter which makes the operation
  30730. // fail if the object's ETag matches the given value. This is useful for
  30731. // getting updates only after the object has changed since the last
  30732. // request. Use googleapi.IsNotModified to check whether the response
  30733. // error from Do is the result of In-None-Match.
  30734. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30735. c.ifNoneMatch_ = entityTag
  30736. return c
  30737. }
  30738. // Context sets the context to be used in this call's Do method. Any
  30739. // pending HTTP request will be aborted if the provided context is
  30740. // canceled.
  30741. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30742. c.ctx_ = ctx
  30743. return c
  30744. }
  30745. // Header returns an http.Header that can be modified by the caller to
  30746. // add HTTP headers to the request.
  30747. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30748. if c.header_ == nil {
  30749. c.header_ = make(http.Header)
  30750. }
  30751. return c.header_
  30752. }
  30753. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30754. reqHeaders := make(http.Header)
  30755. for k, v := range c.header_ {
  30756. reqHeaders[k] = v
  30757. }
  30758. reqHeaders.Set("User-Agent", c.s.userAgent())
  30759. if c.ifNoneMatch_ != "" {
  30760. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30761. }
  30762. var body io.Reader = nil
  30763. c.urlParams_.Set("alt", alt)
  30764. c.urlParams_.Set("prettyPrint", "false")
  30765. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30766. urls += "?" + c.urlParams_.Encode()
  30767. req, err := http.NewRequest("GET", urls, body)
  30768. if err != nil {
  30769. return nil, err
  30770. }
  30771. req.Header = reqHeaders
  30772. googleapi.Expand(req.URL, map[string]string{
  30773. "profileId": strconv.FormatInt(c.profileId, 10),
  30774. })
  30775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30776. }
  30777. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  30778. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  30779. // non-nil. Any non-2xx status code is an error. Response headers are in
  30780. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  30781. // (if a response was returned at all) in
  30782. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30783. // whether the returned error was because http.StatusNotModified was
  30784. // returned.
  30785. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  30786. gensupport.SetOptions(c.urlParams_, opts...)
  30787. res, err := c.doRequest("json")
  30788. if res != nil && res.StatusCode == http.StatusNotModified {
  30789. if res.Body != nil {
  30790. res.Body.Close()
  30791. }
  30792. return nil, &googleapi.Error{
  30793. Code: res.StatusCode,
  30794. Header: res.Header,
  30795. }
  30796. }
  30797. if err != nil {
  30798. return nil, err
  30799. }
  30800. defer googleapi.CloseBody(res)
  30801. if err := googleapi.CheckResponse(res); err != nil {
  30802. return nil, err
  30803. }
  30804. ret := &FloodlightConfigurationsListResponse{
  30805. ServerResponse: googleapi.ServerResponse{
  30806. Header: res.Header,
  30807. HTTPStatusCode: res.StatusCode,
  30808. },
  30809. }
  30810. target := &ret
  30811. if err := gensupport.DecodeResponse(target, res); err != nil {
  30812. return nil, err
  30813. }
  30814. return ret, nil
  30815. // {
  30816. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  30817. // "httpMethod": "GET",
  30818. // "id": "dfareporting.floodlightConfigurations.list",
  30819. // "parameterOrder": [
  30820. // "profileId"
  30821. // ],
  30822. // "parameters": {
  30823. // "ids": {
  30824. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  30825. // "format": "int64",
  30826. // "location": "query",
  30827. // "repeated": true,
  30828. // "type": "string"
  30829. // },
  30830. // "profileId": {
  30831. // "description": "User profile ID associated with this request.",
  30832. // "format": "int64",
  30833. // "location": "path",
  30834. // "required": true,
  30835. // "type": "string"
  30836. // }
  30837. // },
  30838. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30839. // "response": {
  30840. // "$ref": "FloodlightConfigurationsListResponse"
  30841. // },
  30842. // "scopes": [
  30843. // "https://www.googleapis.com/auth/dfatrafficking"
  30844. // ]
  30845. // }
  30846. }
  30847. // method id "dfareporting.floodlightConfigurations.patch":
  30848. type FloodlightConfigurationsPatchCall struct {
  30849. s *Service
  30850. profileId int64
  30851. floodlightconfiguration *FloodlightConfiguration
  30852. urlParams_ gensupport.URLParams
  30853. ctx_ context.Context
  30854. header_ http.Header
  30855. }
  30856. // Patch: Updates an existing floodlight configuration. This method
  30857. // supports patch semantics.
  30858. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  30859. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30860. c.profileId = profileId
  30861. c.urlParams_.Set("id", fmt.Sprint(id))
  30862. c.floodlightconfiguration = floodlightconfiguration
  30863. return c
  30864. }
  30865. // Fields allows partial responses to be retrieved. See
  30866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30867. // for more information.
  30868. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  30869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30870. return c
  30871. }
  30872. // Context sets the context to be used in this call's Do method. Any
  30873. // pending HTTP request will be aborted if the provided context is
  30874. // canceled.
  30875. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  30876. c.ctx_ = ctx
  30877. return c
  30878. }
  30879. // Header returns an http.Header that can be modified by the caller to
  30880. // add HTTP headers to the request.
  30881. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  30882. if c.header_ == nil {
  30883. c.header_ = make(http.Header)
  30884. }
  30885. return c.header_
  30886. }
  30887. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  30888. reqHeaders := make(http.Header)
  30889. for k, v := range c.header_ {
  30890. reqHeaders[k] = v
  30891. }
  30892. reqHeaders.Set("User-Agent", c.s.userAgent())
  30893. var body io.Reader = nil
  30894. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30895. if err != nil {
  30896. return nil, err
  30897. }
  30898. reqHeaders.Set("Content-Type", "application/json")
  30899. c.urlParams_.Set("alt", alt)
  30900. c.urlParams_.Set("prettyPrint", "false")
  30901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30902. urls += "?" + c.urlParams_.Encode()
  30903. req, err := http.NewRequest("PATCH", urls, body)
  30904. if err != nil {
  30905. return nil, err
  30906. }
  30907. req.Header = reqHeaders
  30908. googleapi.Expand(req.URL, map[string]string{
  30909. "profileId": strconv.FormatInt(c.profileId, 10),
  30910. })
  30911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30912. }
  30913. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  30914. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30915. // non-2xx status code is an error. Response headers are in either
  30916. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30917. // returned at all) in error.(*googleapi.Error).Header. Use
  30918. // googleapi.IsNotModified to check whether the returned error was
  30919. // because http.StatusNotModified was returned.
  30920. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30921. gensupport.SetOptions(c.urlParams_, opts...)
  30922. res, err := c.doRequest("json")
  30923. if res != nil && res.StatusCode == http.StatusNotModified {
  30924. if res.Body != nil {
  30925. res.Body.Close()
  30926. }
  30927. return nil, &googleapi.Error{
  30928. Code: res.StatusCode,
  30929. Header: res.Header,
  30930. }
  30931. }
  30932. if err != nil {
  30933. return nil, err
  30934. }
  30935. defer googleapi.CloseBody(res)
  30936. if err := googleapi.CheckResponse(res); err != nil {
  30937. return nil, err
  30938. }
  30939. ret := &FloodlightConfiguration{
  30940. ServerResponse: googleapi.ServerResponse{
  30941. Header: res.Header,
  30942. HTTPStatusCode: res.StatusCode,
  30943. },
  30944. }
  30945. target := &ret
  30946. if err := gensupport.DecodeResponse(target, res); err != nil {
  30947. return nil, err
  30948. }
  30949. return ret, nil
  30950. // {
  30951. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  30952. // "httpMethod": "PATCH",
  30953. // "id": "dfareporting.floodlightConfigurations.patch",
  30954. // "parameterOrder": [
  30955. // "profileId",
  30956. // "id"
  30957. // ],
  30958. // "parameters": {
  30959. // "id": {
  30960. // "description": "Floodlight configuration ID.",
  30961. // "format": "int64",
  30962. // "location": "query",
  30963. // "required": true,
  30964. // "type": "string"
  30965. // },
  30966. // "profileId": {
  30967. // "description": "User profile ID associated with this request.",
  30968. // "format": "int64",
  30969. // "location": "path",
  30970. // "required": true,
  30971. // "type": "string"
  30972. // }
  30973. // },
  30974. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30975. // "request": {
  30976. // "$ref": "FloodlightConfiguration"
  30977. // },
  30978. // "response": {
  30979. // "$ref": "FloodlightConfiguration"
  30980. // },
  30981. // "scopes": [
  30982. // "https://www.googleapis.com/auth/dfatrafficking"
  30983. // ]
  30984. // }
  30985. }
  30986. // method id "dfareporting.floodlightConfigurations.update":
  30987. type FloodlightConfigurationsUpdateCall struct {
  30988. s *Service
  30989. profileId int64
  30990. floodlightconfiguration *FloodlightConfiguration
  30991. urlParams_ gensupport.URLParams
  30992. ctx_ context.Context
  30993. header_ http.Header
  30994. }
  30995. // Update: Updates an existing floodlight configuration.
  30996. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  30997. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30998. c.profileId = profileId
  30999. c.floodlightconfiguration = floodlightconfiguration
  31000. return c
  31001. }
  31002. // Fields allows partial responses to be retrieved. See
  31003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31004. // for more information.
  31005. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  31006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31007. return c
  31008. }
  31009. // Context sets the context to be used in this call's Do method. Any
  31010. // pending HTTP request will be aborted if the provided context is
  31011. // canceled.
  31012. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  31013. c.ctx_ = ctx
  31014. return c
  31015. }
  31016. // Header returns an http.Header that can be modified by the caller to
  31017. // add HTTP headers to the request.
  31018. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  31019. if c.header_ == nil {
  31020. c.header_ = make(http.Header)
  31021. }
  31022. return c.header_
  31023. }
  31024. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  31025. reqHeaders := make(http.Header)
  31026. for k, v := range c.header_ {
  31027. reqHeaders[k] = v
  31028. }
  31029. reqHeaders.Set("User-Agent", c.s.userAgent())
  31030. var body io.Reader = nil
  31031. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  31032. if err != nil {
  31033. return nil, err
  31034. }
  31035. reqHeaders.Set("Content-Type", "application/json")
  31036. c.urlParams_.Set("alt", alt)
  31037. c.urlParams_.Set("prettyPrint", "false")
  31038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  31039. urls += "?" + c.urlParams_.Encode()
  31040. req, err := http.NewRequest("PUT", urls, body)
  31041. if err != nil {
  31042. return nil, err
  31043. }
  31044. req.Header = reqHeaders
  31045. googleapi.Expand(req.URL, map[string]string{
  31046. "profileId": strconv.FormatInt(c.profileId, 10),
  31047. })
  31048. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31049. }
  31050. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  31051. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  31052. // non-2xx status code is an error. Response headers are in either
  31053. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  31054. // returned at all) in error.(*googleapi.Error).Header. Use
  31055. // googleapi.IsNotModified to check whether the returned error was
  31056. // because http.StatusNotModified was returned.
  31057. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  31058. gensupport.SetOptions(c.urlParams_, opts...)
  31059. res, err := c.doRequest("json")
  31060. if res != nil && res.StatusCode == http.StatusNotModified {
  31061. if res.Body != nil {
  31062. res.Body.Close()
  31063. }
  31064. return nil, &googleapi.Error{
  31065. Code: res.StatusCode,
  31066. Header: res.Header,
  31067. }
  31068. }
  31069. if err != nil {
  31070. return nil, err
  31071. }
  31072. defer googleapi.CloseBody(res)
  31073. if err := googleapi.CheckResponse(res); err != nil {
  31074. return nil, err
  31075. }
  31076. ret := &FloodlightConfiguration{
  31077. ServerResponse: googleapi.ServerResponse{
  31078. Header: res.Header,
  31079. HTTPStatusCode: res.StatusCode,
  31080. },
  31081. }
  31082. target := &ret
  31083. if err := gensupport.DecodeResponse(target, res); err != nil {
  31084. return nil, err
  31085. }
  31086. return ret, nil
  31087. // {
  31088. // "description": "Updates an existing floodlight configuration.",
  31089. // "httpMethod": "PUT",
  31090. // "id": "dfareporting.floodlightConfigurations.update",
  31091. // "parameterOrder": [
  31092. // "profileId"
  31093. // ],
  31094. // "parameters": {
  31095. // "profileId": {
  31096. // "description": "User profile ID associated with this request.",
  31097. // "format": "int64",
  31098. // "location": "path",
  31099. // "required": true,
  31100. // "type": "string"
  31101. // }
  31102. // },
  31103. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  31104. // "request": {
  31105. // "$ref": "FloodlightConfiguration"
  31106. // },
  31107. // "response": {
  31108. // "$ref": "FloodlightConfiguration"
  31109. // },
  31110. // "scopes": [
  31111. // "https://www.googleapis.com/auth/dfatrafficking"
  31112. // ]
  31113. // }
  31114. }
  31115. // method id "dfareporting.inventoryItems.get":
  31116. type InventoryItemsGetCall struct {
  31117. s *Service
  31118. profileId int64
  31119. projectId int64
  31120. id int64
  31121. urlParams_ gensupport.URLParams
  31122. ifNoneMatch_ string
  31123. ctx_ context.Context
  31124. header_ http.Header
  31125. }
  31126. // Get: Gets one inventory item by ID.
  31127. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  31128. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31129. c.profileId = profileId
  31130. c.projectId = projectId
  31131. c.id = id
  31132. return c
  31133. }
  31134. // Fields allows partial responses to be retrieved. See
  31135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31136. // for more information.
  31137. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  31138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31139. return c
  31140. }
  31141. // IfNoneMatch sets the optional parameter which makes the operation
  31142. // fail if the object's ETag matches the given value. This is useful for
  31143. // getting updates only after the object has changed since the last
  31144. // request. Use googleapi.IsNotModified to check whether the response
  31145. // error from Do is the result of In-None-Match.
  31146. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  31147. c.ifNoneMatch_ = entityTag
  31148. return c
  31149. }
  31150. // Context sets the context to be used in this call's Do method. Any
  31151. // pending HTTP request will be aborted if the provided context is
  31152. // canceled.
  31153. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  31154. c.ctx_ = ctx
  31155. return c
  31156. }
  31157. // Header returns an http.Header that can be modified by the caller to
  31158. // add HTTP headers to the request.
  31159. func (c *InventoryItemsGetCall) Header() http.Header {
  31160. if c.header_ == nil {
  31161. c.header_ = make(http.Header)
  31162. }
  31163. return c.header_
  31164. }
  31165. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  31166. reqHeaders := make(http.Header)
  31167. for k, v := range c.header_ {
  31168. reqHeaders[k] = v
  31169. }
  31170. reqHeaders.Set("User-Agent", c.s.userAgent())
  31171. if c.ifNoneMatch_ != "" {
  31172. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31173. }
  31174. var body io.Reader = nil
  31175. c.urlParams_.Set("alt", alt)
  31176. c.urlParams_.Set("prettyPrint", "false")
  31177. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  31178. urls += "?" + c.urlParams_.Encode()
  31179. req, err := http.NewRequest("GET", urls, body)
  31180. if err != nil {
  31181. return nil, err
  31182. }
  31183. req.Header = reqHeaders
  31184. googleapi.Expand(req.URL, map[string]string{
  31185. "profileId": strconv.FormatInt(c.profileId, 10),
  31186. "projectId": strconv.FormatInt(c.projectId, 10),
  31187. "id": strconv.FormatInt(c.id, 10),
  31188. })
  31189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31190. }
  31191. // Do executes the "dfareporting.inventoryItems.get" call.
  31192. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  31193. // status code is an error. Response headers are in either
  31194. // *InventoryItem.ServerResponse.Header or (if a response was returned
  31195. // at all) in error.(*googleapi.Error).Header. Use
  31196. // googleapi.IsNotModified to check whether the returned error was
  31197. // because http.StatusNotModified was returned.
  31198. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  31199. gensupport.SetOptions(c.urlParams_, opts...)
  31200. res, err := c.doRequest("json")
  31201. if res != nil && res.StatusCode == http.StatusNotModified {
  31202. if res.Body != nil {
  31203. res.Body.Close()
  31204. }
  31205. return nil, &googleapi.Error{
  31206. Code: res.StatusCode,
  31207. Header: res.Header,
  31208. }
  31209. }
  31210. if err != nil {
  31211. return nil, err
  31212. }
  31213. defer googleapi.CloseBody(res)
  31214. if err := googleapi.CheckResponse(res); err != nil {
  31215. return nil, err
  31216. }
  31217. ret := &InventoryItem{
  31218. ServerResponse: googleapi.ServerResponse{
  31219. Header: res.Header,
  31220. HTTPStatusCode: res.StatusCode,
  31221. },
  31222. }
  31223. target := &ret
  31224. if err := gensupport.DecodeResponse(target, res); err != nil {
  31225. return nil, err
  31226. }
  31227. return ret, nil
  31228. // {
  31229. // "description": "Gets one inventory item by ID.",
  31230. // "httpMethod": "GET",
  31231. // "id": "dfareporting.inventoryItems.get",
  31232. // "parameterOrder": [
  31233. // "profileId",
  31234. // "projectId",
  31235. // "id"
  31236. // ],
  31237. // "parameters": {
  31238. // "id": {
  31239. // "description": "Inventory item ID.",
  31240. // "format": "int64",
  31241. // "location": "path",
  31242. // "required": true,
  31243. // "type": "string"
  31244. // },
  31245. // "profileId": {
  31246. // "description": "User profile ID associated with this request.",
  31247. // "format": "int64",
  31248. // "location": "path",
  31249. // "required": true,
  31250. // "type": "string"
  31251. // },
  31252. // "projectId": {
  31253. // "description": "Project ID for order documents.",
  31254. // "format": "int64",
  31255. // "location": "path",
  31256. // "required": true,
  31257. // "type": "string"
  31258. // }
  31259. // },
  31260. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  31261. // "response": {
  31262. // "$ref": "InventoryItem"
  31263. // },
  31264. // "scopes": [
  31265. // "https://www.googleapis.com/auth/dfatrafficking"
  31266. // ]
  31267. // }
  31268. }
  31269. // method id "dfareporting.inventoryItems.list":
  31270. type InventoryItemsListCall struct {
  31271. s *Service
  31272. profileId int64
  31273. projectId int64
  31274. urlParams_ gensupport.URLParams
  31275. ifNoneMatch_ string
  31276. ctx_ context.Context
  31277. header_ http.Header
  31278. }
  31279. // List: Retrieves a list of inventory items, possibly filtered. This
  31280. // method supports paging.
  31281. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  31282. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31283. c.profileId = profileId
  31284. c.projectId = projectId
  31285. return c
  31286. }
  31287. // Ids sets the optional parameter "ids": Select only inventory items
  31288. // with these IDs.
  31289. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  31290. var ids_ []string
  31291. for _, v := range ids {
  31292. ids_ = append(ids_, fmt.Sprint(v))
  31293. }
  31294. c.urlParams_.SetMulti("ids", ids_)
  31295. return c
  31296. }
  31297. // InPlan sets the optional parameter "inPlan": Select only inventory
  31298. // items that are in plan.
  31299. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  31300. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  31301. return c
  31302. }
  31303. // MaxResults sets the optional parameter "maxResults": Maximum number
  31304. // of results to return.
  31305. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  31306. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  31307. return c
  31308. }
  31309. // OrderId sets the optional parameter "orderId": Select only inventory
  31310. // items that belong to specified orders.
  31311. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  31312. var orderId_ []string
  31313. for _, v := range orderId {
  31314. orderId_ = append(orderId_, fmt.Sprint(v))
  31315. }
  31316. c.urlParams_.SetMulti("orderId", orderId_)
  31317. return c
  31318. }
  31319. // PageToken sets the optional parameter "pageToken": Value of the
  31320. // nextPageToken from the previous result page.
  31321. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  31322. c.urlParams_.Set("pageToken", pageToken)
  31323. return c
  31324. }
  31325. // SiteId sets the optional parameter "siteId": Select only inventory
  31326. // items that are associated with these sites.
  31327. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  31328. var siteId_ []string
  31329. for _, v := range siteId {
  31330. siteId_ = append(siteId_, fmt.Sprint(v))
  31331. }
  31332. c.urlParams_.SetMulti("siteId", siteId_)
  31333. return c
  31334. }
  31335. // SortField sets the optional parameter "sortField": Field by which to
  31336. // sort the list.
  31337. //
  31338. // Possible values:
  31339. // "ID" (default)
  31340. // "NAME"
  31341. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  31342. c.urlParams_.Set("sortField", sortField)
  31343. return c
  31344. }
  31345. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  31346. // results.
  31347. //
  31348. // Possible values:
  31349. // "ASCENDING" (default)
  31350. // "DESCENDING"
  31351. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  31352. c.urlParams_.Set("sortOrder", sortOrder)
  31353. return c
  31354. }
  31355. // Type sets the optional parameter "type": Select only inventory items
  31356. // with this type.
  31357. //
  31358. // Possible values:
  31359. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  31360. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31361. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  31362. c.urlParams_.Set("type", type_)
  31363. return c
  31364. }
  31365. // Fields allows partial responses to be retrieved. See
  31366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31367. // for more information.
  31368. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  31369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31370. return c
  31371. }
  31372. // IfNoneMatch sets the optional parameter which makes the operation
  31373. // fail if the object's ETag matches the given value. This is useful for
  31374. // getting updates only after the object has changed since the last
  31375. // request. Use googleapi.IsNotModified to check whether the response
  31376. // error from Do is the result of In-None-Match.
  31377. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  31378. c.ifNoneMatch_ = entityTag
  31379. return c
  31380. }
  31381. // Context sets the context to be used in this call's Do method. Any
  31382. // pending HTTP request will be aborted if the provided context is
  31383. // canceled.
  31384. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  31385. c.ctx_ = ctx
  31386. return c
  31387. }
  31388. // Header returns an http.Header that can be modified by the caller to
  31389. // add HTTP headers to the request.
  31390. func (c *InventoryItemsListCall) Header() http.Header {
  31391. if c.header_ == nil {
  31392. c.header_ = make(http.Header)
  31393. }
  31394. return c.header_
  31395. }
  31396. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  31397. reqHeaders := make(http.Header)
  31398. for k, v := range c.header_ {
  31399. reqHeaders[k] = v
  31400. }
  31401. reqHeaders.Set("User-Agent", c.s.userAgent())
  31402. if c.ifNoneMatch_ != "" {
  31403. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31404. }
  31405. var body io.Reader = nil
  31406. c.urlParams_.Set("alt", alt)
  31407. c.urlParams_.Set("prettyPrint", "false")
  31408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  31409. urls += "?" + c.urlParams_.Encode()
  31410. req, err := http.NewRequest("GET", urls, body)
  31411. if err != nil {
  31412. return nil, err
  31413. }
  31414. req.Header = reqHeaders
  31415. googleapi.Expand(req.URL, map[string]string{
  31416. "profileId": strconv.FormatInt(c.profileId, 10),
  31417. "projectId": strconv.FormatInt(c.projectId, 10),
  31418. })
  31419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31420. }
  31421. // Do executes the "dfareporting.inventoryItems.list" call.
  31422. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  31423. // Any non-2xx status code is an error. Response headers are in either
  31424. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  31425. // was returned at all) in error.(*googleapi.Error).Header. Use
  31426. // googleapi.IsNotModified to check whether the returned error was
  31427. // because http.StatusNotModified was returned.
  31428. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  31429. gensupport.SetOptions(c.urlParams_, opts...)
  31430. res, err := c.doRequest("json")
  31431. if res != nil && res.StatusCode == http.StatusNotModified {
  31432. if res.Body != nil {
  31433. res.Body.Close()
  31434. }
  31435. return nil, &googleapi.Error{
  31436. Code: res.StatusCode,
  31437. Header: res.Header,
  31438. }
  31439. }
  31440. if err != nil {
  31441. return nil, err
  31442. }
  31443. defer googleapi.CloseBody(res)
  31444. if err := googleapi.CheckResponse(res); err != nil {
  31445. return nil, err
  31446. }
  31447. ret := &InventoryItemsListResponse{
  31448. ServerResponse: googleapi.ServerResponse{
  31449. Header: res.Header,
  31450. HTTPStatusCode: res.StatusCode,
  31451. },
  31452. }
  31453. target := &ret
  31454. if err := gensupport.DecodeResponse(target, res); err != nil {
  31455. return nil, err
  31456. }
  31457. return ret, nil
  31458. // {
  31459. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  31460. // "httpMethod": "GET",
  31461. // "id": "dfareporting.inventoryItems.list",
  31462. // "parameterOrder": [
  31463. // "profileId",
  31464. // "projectId"
  31465. // ],
  31466. // "parameters": {
  31467. // "ids": {
  31468. // "description": "Select only inventory items with these IDs.",
  31469. // "format": "int64",
  31470. // "location": "query",
  31471. // "repeated": true,
  31472. // "type": "string"
  31473. // },
  31474. // "inPlan": {
  31475. // "description": "Select only inventory items that are in plan.",
  31476. // "location": "query",
  31477. // "type": "boolean"
  31478. // },
  31479. // "maxResults": {
  31480. // "default": "1000",
  31481. // "description": "Maximum number of results to return.",
  31482. // "format": "int32",
  31483. // "location": "query",
  31484. // "maximum": "1000",
  31485. // "minimum": "0",
  31486. // "type": "integer"
  31487. // },
  31488. // "orderId": {
  31489. // "description": "Select only inventory items that belong to specified orders.",
  31490. // "format": "int64",
  31491. // "location": "query",
  31492. // "repeated": true,
  31493. // "type": "string"
  31494. // },
  31495. // "pageToken": {
  31496. // "description": "Value of the nextPageToken from the previous result page.",
  31497. // "location": "query",
  31498. // "type": "string"
  31499. // },
  31500. // "profileId": {
  31501. // "description": "User profile ID associated with this request.",
  31502. // "format": "int64",
  31503. // "location": "path",
  31504. // "required": true,
  31505. // "type": "string"
  31506. // },
  31507. // "projectId": {
  31508. // "description": "Project ID for order documents.",
  31509. // "format": "int64",
  31510. // "location": "path",
  31511. // "required": true,
  31512. // "type": "string"
  31513. // },
  31514. // "siteId": {
  31515. // "description": "Select only inventory items that are associated with these sites.",
  31516. // "format": "int64",
  31517. // "location": "query",
  31518. // "repeated": true,
  31519. // "type": "string"
  31520. // },
  31521. // "sortField": {
  31522. // "default": "ID",
  31523. // "description": "Field by which to sort the list.",
  31524. // "enum": [
  31525. // "ID",
  31526. // "NAME"
  31527. // ],
  31528. // "enumDescriptions": [
  31529. // "",
  31530. // ""
  31531. // ],
  31532. // "location": "query",
  31533. // "type": "string"
  31534. // },
  31535. // "sortOrder": {
  31536. // "default": "ASCENDING",
  31537. // "description": "Order of sorted results.",
  31538. // "enum": [
  31539. // "ASCENDING",
  31540. // "DESCENDING"
  31541. // ],
  31542. // "enumDescriptions": [
  31543. // "",
  31544. // ""
  31545. // ],
  31546. // "location": "query",
  31547. // "type": "string"
  31548. // },
  31549. // "type": {
  31550. // "description": "Select only inventory items with this type.",
  31551. // "enum": [
  31552. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31553. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31554. // ],
  31555. // "enumDescriptions": [
  31556. // "",
  31557. // ""
  31558. // ],
  31559. // "location": "query",
  31560. // "type": "string"
  31561. // }
  31562. // },
  31563. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31564. // "response": {
  31565. // "$ref": "InventoryItemsListResponse"
  31566. // },
  31567. // "scopes": [
  31568. // "https://www.googleapis.com/auth/dfatrafficking"
  31569. // ]
  31570. // }
  31571. }
  31572. // Pages invokes f for each page of results.
  31573. // A non-nil error returned from f will halt the iteration.
  31574. // The provided context supersedes any context provided to the Context method.
  31575. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31576. c.ctx_ = ctx
  31577. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31578. for {
  31579. x, err := c.Do()
  31580. if err != nil {
  31581. return err
  31582. }
  31583. if err := f(x); err != nil {
  31584. return err
  31585. }
  31586. if x.NextPageToken == "" {
  31587. return nil
  31588. }
  31589. c.PageToken(x.NextPageToken)
  31590. }
  31591. }
  31592. // method id "dfareporting.languages.list":
  31593. type LanguagesListCall struct {
  31594. s *Service
  31595. profileId int64
  31596. urlParams_ gensupport.URLParams
  31597. ifNoneMatch_ string
  31598. ctx_ context.Context
  31599. header_ http.Header
  31600. }
  31601. // List: Retrieves a list of languages.
  31602. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31603. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31604. c.profileId = profileId
  31605. return c
  31606. }
  31607. // Fields allows partial responses to be retrieved. See
  31608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31609. // for more information.
  31610. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31612. return c
  31613. }
  31614. // IfNoneMatch sets the optional parameter which makes the operation
  31615. // fail if the object's ETag matches the given value. This is useful for
  31616. // getting updates only after the object has changed since the last
  31617. // request. Use googleapi.IsNotModified to check whether the response
  31618. // error from Do is the result of In-None-Match.
  31619. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31620. c.ifNoneMatch_ = entityTag
  31621. return c
  31622. }
  31623. // Context sets the context to be used in this call's Do method. Any
  31624. // pending HTTP request will be aborted if the provided context is
  31625. // canceled.
  31626. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31627. c.ctx_ = ctx
  31628. return c
  31629. }
  31630. // Header returns an http.Header that can be modified by the caller to
  31631. // add HTTP headers to the request.
  31632. func (c *LanguagesListCall) Header() http.Header {
  31633. if c.header_ == nil {
  31634. c.header_ = make(http.Header)
  31635. }
  31636. return c.header_
  31637. }
  31638. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31639. reqHeaders := make(http.Header)
  31640. for k, v := range c.header_ {
  31641. reqHeaders[k] = v
  31642. }
  31643. reqHeaders.Set("User-Agent", c.s.userAgent())
  31644. if c.ifNoneMatch_ != "" {
  31645. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31646. }
  31647. var body io.Reader = nil
  31648. c.urlParams_.Set("alt", alt)
  31649. c.urlParams_.Set("prettyPrint", "false")
  31650. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31651. urls += "?" + c.urlParams_.Encode()
  31652. req, err := http.NewRequest("GET", urls, body)
  31653. if err != nil {
  31654. return nil, err
  31655. }
  31656. req.Header = reqHeaders
  31657. googleapi.Expand(req.URL, map[string]string{
  31658. "profileId": strconv.FormatInt(c.profileId, 10),
  31659. })
  31660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31661. }
  31662. // Do executes the "dfareporting.languages.list" call.
  31663. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31664. // non-2xx status code is an error. Response headers are in either
  31665. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31666. // returned at all) in error.(*googleapi.Error).Header. Use
  31667. // googleapi.IsNotModified to check whether the returned error was
  31668. // because http.StatusNotModified was returned.
  31669. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31670. gensupport.SetOptions(c.urlParams_, opts...)
  31671. res, err := c.doRequest("json")
  31672. if res != nil && res.StatusCode == http.StatusNotModified {
  31673. if res.Body != nil {
  31674. res.Body.Close()
  31675. }
  31676. return nil, &googleapi.Error{
  31677. Code: res.StatusCode,
  31678. Header: res.Header,
  31679. }
  31680. }
  31681. if err != nil {
  31682. return nil, err
  31683. }
  31684. defer googleapi.CloseBody(res)
  31685. if err := googleapi.CheckResponse(res); err != nil {
  31686. return nil, err
  31687. }
  31688. ret := &LanguagesListResponse{
  31689. ServerResponse: googleapi.ServerResponse{
  31690. Header: res.Header,
  31691. HTTPStatusCode: res.StatusCode,
  31692. },
  31693. }
  31694. target := &ret
  31695. if err := gensupport.DecodeResponse(target, res); err != nil {
  31696. return nil, err
  31697. }
  31698. return ret, nil
  31699. // {
  31700. // "description": "Retrieves a list of languages.",
  31701. // "httpMethod": "GET",
  31702. // "id": "dfareporting.languages.list",
  31703. // "parameterOrder": [
  31704. // "profileId"
  31705. // ],
  31706. // "parameters": {
  31707. // "profileId": {
  31708. // "description": "User profile ID associated with this request.",
  31709. // "format": "int64",
  31710. // "location": "path",
  31711. // "required": true,
  31712. // "type": "string"
  31713. // }
  31714. // },
  31715. // "path": "userprofiles/{profileId}/languages",
  31716. // "response": {
  31717. // "$ref": "LanguagesListResponse"
  31718. // },
  31719. // "scopes": [
  31720. // "https://www.googleapis.com/auth/dfatrafficking"
  31721. // ]
  31722. // }
  31723. }
  31724. // method id "dfareporting.metros.list":
  31725. type MetrosListCall struct {
  31726. s *Service
  31727. profileId int64
  31728. urlParams_ gensupport.URLParams
  31729. ifNoneMatch_ string
  31730. ctx_ context.Context
  31731. header_ http.Header
  31732. }
  31733. // List: Retrieves a list of metros.
  31734. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31735. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31736. c.profileId = profileId
  31737. return c
  31738. }
  31739. // Fields allows partial responses to be retrieved. See
  31740. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31741. // for more information.
  31742. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31743. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31744. return c
  31745. }
  31746. // IfNoneMatch sets the optional parameter which makes the operation
  31747. // fail if the object's ETag matches the given value. This is useful for
  31748. // getting updates only after the object has changed since the last
  31749. // request. Use googleapi.IsNotModified to check whether the response
  31750. // error from Do is the result of In-None-Match.
  31751. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31752. c.ifNoneMatch_ = entityTag
  31753. return c
  31754. }
  31755. // Context sets the context to be used in this call's Do method. Any
  31756. // pending HTTP request will be aborted if the provided context is
  31757. // canceled.
  31758. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31759. c.ctx_ = ctx
  31760. return c
  31761. }
  31762. // Header returns an http.Header that can be modified by the caller to
  31763. // add HTTP headers to the request.
  31764. func (c *MetrosListCall) Header() http.Header {
  31765. if c.header_ == nil {
  31766. c.header_ = make(http.Header)
  31767. }
  31768. return c.header_
  31769. }
  31770. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  31771. reqHeaders := make(http.Header)
  31772. for k, v := range c.header_ {
  31773. reqHeaders[k] = v
  31774. }
  31775. reqHeaders.Set("User-Agent", c.s.userAgent())
  31776. if c.ifNoneMatch_ != "" {
  31777. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31778. }
  31779. var body io.Reader = nil
  31780. c.urlParams_.Set("alt", alt)
  31781. c.urlParams_.Set("prettyPrint", "false")
  31782. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  31783. urls += "?" + c.urlParams_.Encode()
  31784. req, err := http.NewRequest("GET", urls, body)
  31785. if err != nil {
  31786. return nil, err
  31787. }
  31788. req.Header = reqHeaders
  31789. googleapi.Expand(req.URL, map[string]string{
  31790. "profileId": strconv.FormatInt(c.profileId, 10),
  31791. })
  31792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31793. }
  31794. // Do executes the "dfareporting.metros.list" call.
  31795. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  31796. // non-2xx status code is an error. Response headers are in either
  31797. // *MetrosListResponse.ServerResponse.Header or (if a response was
  31798. // returned at all) in error.(*googleapi.Error).Header. Use
  31799. // googleapi.IsNotModified to check whether the returned error was
  31800. // because http.StatusNotModified was returned.
  31801. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  31802. gensupport.SetOptions(c.urlParams_, opts...)
  31803. res, err := c.doRequest("json")
  31804. if res != nil && res.StatusCode == http.StatusNotModified {
  31805. if res.Body != nil {
  31806. res.Body.Close()
  31807. }
  31808. return nil, &googleapi.Error{
  31809. Code: res.StatusCode,
  31810. Header: res.Header,
  31811. }
  31812. }
  31813. if err != nil {
  31814. return nil, err
  31815. }
  31816. defer googleapi.CloseBody(res)
  31817. if err := googleapi.CheckResponse(res); err != nil {
  31818. return nil, err
  31819. }
  31820. ret := &MetrosListResponse{
  31821. ServerResponse: googleapi.ServerResponse{
  31822. Header: res.Header,
  31823. HTTPStatusCode: res.StatusCode,
  31824. },
  31825. }
  31826. target := &ret
  31827. if err := gensupport.DecodeResponse(target, res); err != nil {
  31828. return nil, err
  31829. }
  31830. return ret, nil
  31831. // {
  31832. // "description": "Retrieves a list of metros.",
  31833. // "httpMethod": "GET",
  31834. // "id": "dfareporting.metros.list",
  31835. // "parameterOrder": [
  31836. // "profileId"
  31837. // ],
  31838. // "parameters": {
  31839. // "profileId": {
  31840. // "description": "User profile ID associated with this request.",
  31841. // "format": "int64",
  31842. // "location": "path",
  31843. // "required": true,
  31844. // "type": "string"
  31845. // }
  31846. // },
  31847. // "path": "userprofiles/{profileId}/metros",
  31848. // "response": {
  31849. // "$ref": "MetrosListResponse"
  31850. // },
  31851. // "scopes": [
  31852. // "https://www.googleapis.com/auth/dfatrafficking"
  31853. // ]
  31854. // }
  31855. }
  31856. // method id "dfareporting.mobileCarriers.get":
  31857. type MobileCarriersGetCall struct {
  31858. s *Service
  31859. profileId int64
  31860. id int64
  31861. urlParams_ gensupport.URLParams
  31862. ifNoneMatch_ string
  31863. ctx_ context.Context
  31864. header_ http.Header
  31865. }
  31866. // Get: Gets one mobile carrier by ID.
  31867. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  31868. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31869. c.profileId = profileId
  31870. c.id = id
  31871. return c
  31872. }
  31873. // Fields allows partial responses to be retrieved. See
  31874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31875. // for more information.
  31876. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  31877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31878. return c
  31879. }
  31880. // IfNoneMatch sets the optional parameter which makes the operation
  31881. // fail if the object's ETag matches the given value. This is useful for
  31882. // getting updates only after the object has changed since the last
  31883. // request. Use googleapi.IsNotModified to check whether the response
  31884. // error from Do is the result of In-None-Match.
  31885. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  31886. c.ifNoneMatch_ = entityTag
  31887. return c
  31888. }
  31889. // Context sets the context to be used in this call's Do method. Any
  31890. // pending HTTP request will be aborted if the provided context is
  31891. // canceled.
  31892. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  31893. c.ctx_ = ctx
  31894. return c
  31895. }
  31896. // Header returns an http.Header that can be modified by the caller to
  31897. // add HTTP headers to the request.
  31898. func (c *MobileCarriersGetCall) Header() http.Header {
  31899. if c.header_ == nil {
  31900. c.header_ = make(http.Header)
  31901. }
  31902. return c.header_
  31903. }
  31904. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  31905. reqHeaders := make(http.Header)
  31906. for k, v := range c.header_ {
  31907. reqHeaders[k] = v
  31908. }
  31909. reqHeaders.Set("User-Agent", c.s.userAgent())
  31910. if c.ifNoneMatch_ != "" {
  31911. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31912. }
  31913. var body io.Reader = nil
  31914. c.urlParams_.Set("alt", alt)
  31915. c.urlParams_.Set("prettyPrint", "false")
  31916. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  31917. urls += "?" + c.urlParams_.Encode()
  31918. req, err := http.NewRequest("GET", urls, body)
  31919. if err != nil {
  31920. return nil, err
  31921. }
  31922. req.Header = reqHeaders
  31923. googleapi.Expand(req.URL, map[string]string{
  31924. "profileId": strconv.FormatInt(c.profileId, 10),
  31925. "id": strconv.FormatInt(c.id, 10),
  31926. })
  31927. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31928. }
  31929. // Do executes the "dfareporting.mobileCarriers.get" call.
  31930. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  31931. // status code is an error. Response headers are in either
  31932. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  31933. // at all) in error.(*googleapi.Error).Header. Use
  31934. // googleapi.IsNotModified to check whether the returned error was
  31935. // because http.StatusNotModified was returned.
  31936. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  31937. gensupport.SetOptions(c.urlParams_, opts...)
  31938. res, err := c.doRequest("json")
  31939. if res != nil && res.StatusCode == http.StatusNotModified {
  31940. if res.Body != nil {
  31941. res.Body.Close()
  31942. }
  31943. return nil, &googleapi.Error{
  31944. Code: res.StatusCode,
  31945. Header: res.Header,
  31946. }
  31947. }
  31948. if err != nil {
  31949. return nil, err
  31950. }
  31951. defer googleapi.CloseBody(res)
  31952. if err := googleapi.CheckResponse(res); err != nil {
  31953. return nil, err
  31954. }
  31955. ret := &MobileCarrier{
  31956. ServerResponse: googleapi.ServerResponse{
  31957. Header: res.Header,
  31958. HTTPStatusCode: res.StatusCode,
  31959. },
  31960. }
  31961. target := &ret
  31962. if err := gensupport.DecodeResponse(target, res); err != nil {
  31963. return nil, err
  31964. }
  31965. return ret, nil
  31966. // {
  31967. // "description": "Gets one mobile carrier by ID.",
  31968. // "httpMethod": "GET",
  31969. // "id": "dfareporting.mobileCarriers.get",
  31970. // "parameterOrder": [
  31971. // "profileId",
  31972. // "id"
  31973. // ],
  31974. // "parameters": {
  31975. // "id": {
  31976. // "description": "Mobile carrier ID.",
  31977. // "format": "int64",
  31978. // "location": "path",
  31979. // "required": true,
  31980. // "type": "string"
  31981. // },
  31982. // "profileId": {
  31983. // "description": "User profile ID associated with this request.",
  31984. // "format": "int64",
  31985. // "location": "path",
  31986. // "required": true,
  31987. // "type": "string"
  31988. // }
  31989. // },
  31990. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  31991. // "response": {
  31992. // "$ref": "MobileCarrier"
  31993. // },
  31994. // "scopes": [
  31995. // "https://www.googleapis.com/auth/dfatrafficking"
  31996. // ]
  31997. // }
  31998. }
  31999. // method id "dfareporting.mobileCarriers.list":
  32000. type MobileCarriersListCall struct {
  32001. s *Service
  32002. profileId int64
  32003. urlParams_ gensupport.URLParams
  32004. ifNoneMatch_ string
  32005. ctx_ context.Context
  32006. header_ http.Header
  32007. }
  32008. // List: Retrieves a list of mobile carriers.
  32009. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  32010. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32011. c.profileId = profileId
  32012. return c
  32013. }
  32014. // Fields allows partial responses to be retrieved. See
  32015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32016. // for more information.
  32017. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  32018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32019. return c
  32020. }
  32021. // IfNoneMatch sets the optional parameter which makes the operation
  32022. // fail if the object's ETag matches the given value. This is useful for
  32023. // getting updates only after the object has changed since the last
  32024. // request. Use googleapi.IsNotModified to check whether the response
  32025. // error from Do is the result of In-None-Match.
  32026. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  32027. c.ifNoneMatch_ = entityTag
  32028. return c
  32029. }
  32030. // Context sets the context to be used in this call's Do method. Any
  32031. // pending HTTP request will be aborted if the provided context is
  32032. // canceled.
  32033. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  32034. c.ctx_ = ctx
  32035. return c
  32036. }
  32037. // Header returns an http.Header that can be modified by the caller to
  32038. // add HTTP headers to the request.
  32039. func (c *MobileCarriersListCall) Header() http.Header {
  32040. if c.header_ == nil {
  32041. c.header_ = make(http.Header)
  32042. }
  32043. return c.header_
  32044. }
  32045. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  32046. reqHeaders := make(http.Header)
  32047. for k, v := range c.header_ {
  32048. reqHeaders[k] = v
  32049. }
  32050. reqHeaders.Set("User-Agent", c.s.userAgent())
  32051. if c.ifNoneMatch_ != "" {
  32052. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32053. }
  32054. var body io.Reader = nil
  32055. c.urlParams_.Set("alt", alt)
  32056. c.urlParams_.Set("prettyPrint", "false")
  32057. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  32058. urls += "?" + c.urlParams_.Encode()
  32059. req, err := http.NewRequest("GET", urls, body)
  32060. if err != nil {
  32061. return nil, err
  32062. }
  32063. req.Header = reqHeaders
  32064. googleapi.Expand(req.URL, map[string]string{
  32065. "profileId": strconv.FormatInt(c.profileId, 10),
  32066. })
  32067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32068. }
  32069. // Do executes the "dfareporting.mobileCarriers.list" call.
  32070. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  32071. // Any non-2xx status code is an error. Response headers are in either
  32072. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  32073. // was returned at all) in error.(*googleapi.Error).Header. Use
  32074. // googleapi.IsNotModified to check whether the returned error was
  32075. // because http.StatusNotModified was returned.
  32076. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  32077. gensupport.SetOptions(c.urlParams_, opts...)
  32078. res, err := c.doRequest("json")
  32079. if res != nil && res.StatusCode == http.StatusNotModified {
  32080. if res.Body != nil {
  32081. res.Body.Close()
  32082. }
  32083. return nil, &googleapi.Error{
  32084. Code: res.StatusCode,
  32085. Header: res.Header,
  32086. }
  32087. }
  32088. if err != nil {
  32089. return nil, err
  32090. }
  32091. defer googleapi.CloseBody(res)
  32092. if err := googleapi.CheckResponse(res); err != nil {
  32093. return nil, err
  32094. }
  32095. ret := &MobileCarriersListResponse{
  32096. ServerResponse: googleapi.ServerResponse{
  32097. Header: res.Header,
  32098. HTTPStatusCode: res.StatusCode,
  32099. },
  32100. }
  32101. target := &ret
  32102. if err := gensupport.DecodeResponse(target, res); err != nil {
  32103. return nil, err
  32104. }
  32105. return ret, nil
  32106. // {
  32107. // "description": "Retrieves a list of mobile carriers.",
  32108. // "httpMethod": "GET",
  32109. // "id": "dfareporting.mobileCarriers.list",
  32110. // "parameterOrder": [
  32111. // "profileId"
  32112. // ],
  32113. // "parameters": {
  32114. // "profileId": {
  32115. // "description": "User profile ID associated with this request.",
  32116. // "format": "int64",
  32117. // "location": "path",
  32118. // "required": true,
  32119. // "type": "string"
  32120. // }
  32121. // },
  32122. // "path": "userprofiles/{profileId}/mobileCarriers",
  32123. // "response": {
  32124. // "$ref": "MobileCarriersListResponse"
  32125. // },
  32126. // "scopes": [
  32127. // "https://www.googleapis.com/auth/dfatrafficking"
  32128. // ]
  32129. // }
  32130. }
  32131. // method id "dfareporting.operatingSystemVersions.get":
  32132. type OperatingSystemVersionsGetCall struct {
  32133. s *Service
  32134. profileId int64
  32135. id int64
  32136. urlParams_ gensupport.URLParams
  32137. ifNoneMatch_ string
  32138. ctx_ context.Context
  32139. header_ http.Header
  32140. }
  32141. // Get: Gets one operating system version by ID.
  32142. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  32143. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32144. c.profileId = profileId
  32145. c.id = id
  32146. return c
  32147. }
  32148. // Fields allows partial responses to be retrieved. See
  32149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32150. // for more information.
  32151. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  32152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32153. return c
  32154. }
  32155. // IfNoneMatch sets the optional parameter which makes the operation
  32156. // fail if the object's ETag matches the given value. This is useful for
  32157. // getting updates only after the object has changed since the last
  32158. // request. Use googleapi.IsNotModified to check whether the response
  32159. // error from Do is the result of In-None-Match.
  32160. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  32161. c.ifNoneMatch_ = entityTag
  32162. return c
  32163. }
  32164. // Context sets the context to be used in this call's Do method. Any
  32165. // pending HTTP request will be aborted if the provided context is
  32166. // canceled.
  32167. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  32168. c.ctx_ = ctx
  32169. return c
  32170. }
  32171. // Header returns an http.Header that can be modified by the caller to
  32172. // add HTTP headers to the request.
  32173. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  32174. if c.header_ == nil {
  32175. c.header_ = make(http.Header)
  32176. }
  32177. return c.header_
  32178. }
  32179. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  32180. reqHeaders := make(http.Header)
  32181. for k, v := range c.header_ {
  32182. reqHeaders[k] = v
  32183. }
  32184. reqHeaders.Set("User-Agent", c.s.userAgent())
  32185. if c.ifNoneMatch_ != "" {
  32186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32187. }
  32188. var body io.Reader = nil
  32189. c.urlParams_.Set("alt", alt)
  32190. c.urlParams_.Set("prettyPrint", "false")
  32191. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  32192. urls += "?" + c.urlParams_.Encode()
  32193. req, err := http.NewRequest("GET", urls, body)
  32194. if err != nil {
  32195. return nil, err
  32196. }
  32197. req.Header = reqHeaders
  32198. googleapi.Expand(req.URL, map[string]string{
  32199. "profileId": strconv.FormatInt(c.profileId, 10),
  32200. "id": strconv.FormatInt(c.id, 10),
  32201. })
  32202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32203. }
  32204. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  32205. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  32206. // non-2xx status code is an error. Response headers are in either
  32207. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  32208. // returned at all) in error.(*googleapi.Error).Header. Use
  32209. // googleapi.IsNotModified to check whether the returned error was
  32210. // because http.StatusNotModified was returned.
  32211. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  32212. gensupport.SetOptions(c.urlParams_, opts...)
  32213. res, err := c.doRequest("json")
  32214. if res != nil && res.StatusCode == http.StatusNotModified {
  32215. if res.Body != nil {
  32216. res.Body.Close()
  32217. }
  32218. return nil, &googleapi.Error{
  32219. Code: res.StatusCode,
  32220. Header: res.Header,
  32221. }
  32222. }
  32223. if err != nil {
  32224. return nil, err
  32225. }
  32226. defer googleapi.CloseBody(res)
  32227. if err := googleapi.CheckResponse(res); err != nil {
  32228. return nil, err
  32229. }
  32230. ret := &OperatingSystemVersion{
  32231. ServerResponse: googleapi.ServerResponse{
  32232. Header: res.Header,
  32233. HTTPStatusCode: res.StatusCode,
  32234. },
  32235. }
  32236. target := &ret
  32237. if err := gensupport.DecodeResponse(target, res); err != nil {
  32238. return nil, err
  32239. }
  32240. return ret, nil
  32241. // {
  32242. // "description": "Gets one operating system version by ID.",
  32243. // "httpMethod": "GET",
  32244. // "id": "dfareporting.operatingSystemVersions.get",
  32245. // "parameterOrder": [
  32246. // "profileId",
  32247. // "id"
  32248. // ],
  32249. // "parameters": {
  32250. // "id": {
  32251. // "description": "Operating system version ID.",
  32252. // "format": "int64",
  32253. // "location": "path",
  32254. // "required": true,
  32255. // "type": "string"
  32256. // },
  32257. // "profileId": {
  32258. // "description": "User profile ID associated with this request.",
  32259. // "format": "int64",
  32260. // "location": "path",
  32261. // "required": true,
  32262. // "type": "string"
  32263. // }
  32264. // },
  32265. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  32266. // "response": {
  32267. // "$ref": "OperatingSystemVersion"
  32268. // },
  32269. // "scopes": [
  32270. // "https://www.googleapis.com/auth/dfatrafficking"
  32271. // ]
  32272. // }
  32273. }
  32274. // method id "dfareporting.operatingSystemVersions.list":
  32275. type OperatingSystemVersionsListCall struct {
  32276. s *Service
  32277. profileId int64
  32278. urlParams_ gensupport.URLParams
  32279. ifNoneMatch_ string
  32280. ctx_ context.Context
  32281. header_ http.Header
  32282. }
  32283. // List: Retrieves a list of operating system versions.
  32284. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  32285. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32286. c.profileId = profileId
  32287. return c
  32288. }
  32289. // Fields allows partial responses to be retrieved. See
  32290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32291. // for more information.
  32292. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  32293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32294. return c
  32295. }
  32296. // IfNoneMatch sets the optional parameter which makes the operation
  32297. // fail if the object's ETag matches the given value. This is useful for
  32298. // getting updates only after the object has changed since the last
  32299. // request. Use googleapi.IsNotModified to check whether the response
  32300. // error from Do is the result of In-None-Match.
  32301. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  32302. c.ifNoneMatch_ = entityTag
  32303. return c
  32304. }
  32305. // Context sets the context to be used in this call's Do method. Any
  32306. // pending HTTP request will be aborted if the provided context is
  32307. // canceled.
  32308. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  32309. c.ctx_ = ctx
  32310. return c
  32311. }
  32312. // Header returns an http.Header that can be modified by the caller to
  32313. // add HTTP headers to the request.
  32314. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  32315. if c.header_ == nil {
  32316. c.header_ = make(http.Header)
  32317. }
  32318. return c.header_
  32319. }
  32320. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  32321. reqHeaders := make(http.Header)
  32322. for k, v := range c.header_ {
  32323. reqHeaders[k] = v
  32324. }
  32325. reqHeaders.Set("User-Agent", c.s.userAgent())
  32326. if c.ifNoneMatch_ != "" {
  32327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32328. }
  32329. var body io.Reader = nil
  32330. c.urlParams_.Set("alt", alt)
  32331. c.urlParams_.Set("prettyPrint", "false")
  32332. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  32333. urls += "?" + c.urlParams_.Encode()
  32334. req, err := http.NewRequest("GET", urls, body)
  32335. if err != nil {
  32336. return nil, err
  32337. }
  32338. req.Header = reqHeaders
  32339. googleapi.Expand(req.URL, map[string]string{
  32340. "profileId": strconv.FormatInt(c.profileId, 10),
  32341. })
  32342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32343. }
  32344. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  32345. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  32346. // non-nil. Any non-2xx status code is an error. Response headers are in
  32347. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  32348. // (if a response was returned at all) in
  32349. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  32350. // whether the returned error was because http.StatusNotModified was
  32351. // returned.
  32352. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  32353. gensupport.SetOptions(c.urlParams_, opts...)
  32354. res, err := c.doRequest("json")
  32355. if res != nil && res.StatusCode == http.StatusNotModified {
  32356. if res.Body != nil {
  32357. res.Body.Close()
  32358. }
  32359. return nil, &googleapi.Error{
  32360. Code: res.StatusCode,
  32361. Header: res.Header,
  32362. }
  32363. }
  32364. if err != nil {
  32365. return nil, err
  32366. }
  32367. defer googleapi.CloseBody(res)
  32368. if err := googleapi.CheckResponse(res); err != nil {
  32369. return nil, err
  32370. }
  32371. ret := &OperatingSystemVersionsListResponse{
  32372. ServerResponse: googleapi.ServerResponse{
  32373. Header: res.Header,
  32374. HTTPStatusCode: res.StatusCode,
  32375. },
  32376. }
  32377. target := &ret
  32378. if err := gensupport.DecodeResponse(target, res); err != nil {
  32379. return nil, err
  32380. }
  32381. return ret, nil
  32382. // {
  32383. // "description": "Retrieves a list of operating system versions.",
  32384. // "httpMethod": "GET",
  32385. // "id": "dfareporting.operatingSystemVersions.list",
  32386. // "parameterOrder": [
  32387. // "profileId"
  32388. // ],
  32389. // "parameters": {
  32390. // "profileId": {
  32391. // "description": "User profile ID associated with this request.",
  32392. // "format": "int64",
  32393. // "location": "path",
  32394. // "required": true,
  32395. // "type": "string"
  32396. // }
  32397. // },
  32398. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  32399. // "response": {
  32400. // "$ref": "OperatingSystemVersionsListResponse"
  32401. // },
  32402. // "scopes": [
  32403. // "https://www.googleapis.com/auth/dfatrafficking"
  32404. // ]
  32405. // }
  32406. }
  32407. // method id "dfareporting.operatingSystems.get":
  32408. type OperatingSystemsGetCall struct {
  32409. s *Service
  32410. profileId int64
  32411. dartId int64
  32412. urlParams_ gensupport.URLParams
  32413. ifNoneMatch_ string
  32414. ctx_ context.Context
  32415. header_ http.Header
  32416. }
  32417. // Get: Gets one operating system by DART ID.
  32418. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  32419. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32420. c.profileId = profileId
  32421. c.dartId = dartId
  32422. return c
  32423. }
  32424. // Fields allows partial responses to be retrieved. See
  32425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32426. // for more information.
  32427. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  32428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32429. return c
  32430. }
  32431. // IfNoneMatch sets the optional parameter which makes the operation
  32432. // fail if the object's ETag matches the given value. This is useful for
  32433. // getting updates only after the object has changed since the last
  32434. // request. Use googleapi.IsNotModified to check whether the response
  32435. // error from Do is the result of In-None-Match.
  32436. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  32437. c.ifNoneMatch_ = entityTag
  32438. return c
  32439. }
  32440. // Context sets the context to be used in this call's Do method. Any
  32441. // pending HTTP request will be aborted if the provided context is
  32442. // canceled.
  32443. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  32444. c.ctx_ = ctx
  32445. return c
  32446. }
  32447. // Header returns an http.Header that can be modified by the caller to
  32448. // add HTTP headers to the request.
  32449. func (c *OperatingSystemsGetCall) Header() http.Header {
  32450. if c.header_ == nil {
  32451. c.header_ = make(http.Header)
  32452. }
  32453. return c.header_
  32454. }
  32455. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  32456. reqHeaders := make(http.Header)
  32457. for k, v := range c.header_ {
  32458. reqHeaders[k] = v
  32459. }
  32460. reqHeaders.Set("User-Agent", c.s.userAgent())
  32461. if c.ifNoneMatch_ != "" {
  32462. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32463. }
  32464. var body io.Reader = nil
  32465. c.urlParams_.Set("alt", alt)
  32466. c.urlParams_.Set("prettyPrint", "false")
  32467. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  32468. urls += "?" + c.urlParams_.Encode()
  32469. req, err := http.NewRequest("GET", urls, body)
  32470. if err != nil {
  32471. return nil, err
  32472. }
  32473. req.Header = reqHeaders
  32474. googleapi.Expand(req.URL, map[string]string{
  32475. "profileId": strconv.FormatInt(c.profileId, 10),
  32476. "dartId": strconv.FormatInt(c.dartId, 10),
  32477. })
  32478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32479. }
  32480. // Do executes the "dfareporting.operatingSystems.get" call.
  32481. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  32482. // status code is an error. Response headers are in either
  32483. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  32484. // at all) in error.(*googleapi.Error).Header. Use
  32485. // googleapi.IsNotModified to check whether the returned error was
  32486. // because http.StatusNotModified was returned.
  32487. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  32488. gensupport.SetOptions(c.urlParams_, opts...)
  32489. res, err := c.doRequest("json")
  32490. if res != nil && res.StatusCode == http.StatusNotModified {
  32491. if res.Body != nil {
  32492. res.Body.Close()
  32493. }
  32494. return nil, &googleapi.Error{
  32495. Code: res.StatusCode,
  32496. Header: res.Header,
  32497. }
  32498. }
  32499. if err != nil {
  32500. return nil, err
  32501. }
  32502. defer googleapi.CloseBody(res)
  32503. if err := googleapi.CheckResponse(res); err != nil {
  32504. return nil, err
  32505. }
  32506. ret := &OperatingSystem{
  32507. ServerResponse: googleapi.ServerResponse{
  32508. Header: res.Header,
  32509. HTTPStatusCode: res.StatusCode,
  32510. },
  32511. }
  32512. target := &ret
  32513. if err := gensupport.DecodeResponse(target, res); err != nil {
  32514. return nil, err
  32515. }
  32516. return ret, nil
  32517. // {
  32518. // "description": "Gets one operating system by DART ID.",
  32519. // "httpMethod": "GET",
  32520. // "id": "dfareporting.operatingSystems.get",
  32521. // "parameterOrder": [
  32522. // "profileId",
  32523. // "dartId"
  32524. // ],
  32525. // "parameters": {
  32526. // "dartId": {
  32527. // "description": "Operating system DART ID.",
  32528. // "format": "int64",
  32529. // "location": "path",
  32530. // "required": true,
  32531. // "type": "string"
  32532. // },
  32533. // "profileId": {
  32534. // "description": "User profile ID associated with this request.",
  32535. // "format": "int64",
  32536. // "location": "path",
  32537. // "required": true,
  32538. // "type": "string"
  32539. // }
  32540. // },
  32541. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  32542. // "response": {
  32543. // "$ref": "OperatingSystem"
  32544. // },
  32545. // "scopes": [
  32546. // "https://www.googleapis.com/auth/dfatrafficking"
  32547. // ]
  32548. // }
  32549. }
  32550. // method id "dfareporting.operatingSystems.list":
  32551. type OperatingSystemsListCall struct {
  32552. s *Service
  32553. profileId int64
  32554. urlParams_ gensupport.URLParams
  32555. ifNoneMatch_ string
  32556. ctx_ context.Context
  32557. header_ http.Header
  32558. }
  32559. // List: Retrieves a list of operating systems.
  32560. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  32561. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32562. c.profileId = profileId
  32563. return c
  32564. }
  32565. // Fields allows partial responses to be retrieved. See
  32566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32567. // for more information.
  32568. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  32569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32570. return c
  32571. }
  32572. // IfNoneMatch sets the optional parameter which makes the operation
  32573. // fail if the object's ETag matches the given value. This is useful for
  32574. // getting updates only after the object has changed since the last
  32575. // request. Use googleapi.IsNotModified to check whether the response
  32576. // error from Do is the result of In-None-Match.
  32577. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  32578. c.ifNoneMatch_ = entityTag
  32579. return c
  32580. }
  32581. // Context sets the context to be used in this call's Do method. Any
  32582. // pending HTTP request will be aborted if the provided context is
  32583. // canceled.
  32584. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  32585. c.ctx_ = ctx
  32586. return c
  32587. }
  32588. // Header returns an http.Header that can be modified by the caller to
  32589. // add HTTP headers to the request.
  32590. func (c *OperatingSystemsListCall) Header() http.Header {
  32591. if c.header_ == nil {
  32592. c.header_ = make(http.Header)
  32593. }
  32594. return c.header_
  32595. }
  32596. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  32597. reqHeaders := make(http.Header)
  32598. for k, v := range c.header_ {
  32599. reqHeaders[k] = v
  32600. }
  32601. reqHeaders.Set("User-Agent", c.s.userAgent())
  32602. if c.ifNoneMatch_ != "" {
  32603. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32604. }
  32605. var body io.Reader = nil
  32606. c.urlParams_.Set("alt", alt)
  32607. c.urlParams_.Set("prettyPrint", "false")
  32608. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  32609. urls += "?" + c.urlParams_.Encode()
  32610. req, err := http.NewRequest("GET", urls, body)
  32611. if err != nil {
  32612. return nil, err
  32613. }
  32614. req.Header = reqHeaders
  32615. googleapi.Expand(req.URL, map[string]string{
  32616. "profileId": strconv.FormatInt(c.profileId, 10),
  32617. })
  32618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32619. }
  32620. // Do executes the "dfareporting.operatingSystems.list" call.
  32621. // Exactly one of *OperatingSystemsListResponse or error will be
  32622. // non-nil. Any non-2xx status code is an error. Response headers are in
  32623. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  32624. // response was returned at all) in error.(*googleapi.Error).Header. Use
  32625. // googleapi.IsNotModified to check whether the returned error was
  32626. // because http.StatusNotModified was returned.
  32627. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  32628. gensupport.SetOptions(c.urlParams_, opts...)
  32629. res, err := c.doRequest("json")
  32630. if res != nil && res.StatusCode == http.StatusNotModified {
  32631. if res.Body != nil {
  32632. res.Body.Close()
  32633. }
  32634. return nil, &googleapi.Error{
  32635. Code: res.StatusCode,
  32636. Header: res.Header,
  32637. }
  32638. }
  32639. if err != nil {
  32640. return nil, err
  32641. }
  32642. defer googleapi.CloseBody(res)
  32643. if err := googleapi.CheckResponse(res); err != nil {
  32644. return nil, err
  32645. }
  32646. ret := &OperatingSystemsListResponse{
  32647. ServerResponse: googleapi.ServerResponse{
  32648. Header: res.Header,
  32649. HTTPStatusCode: res.StatusCode,
  32650. },
  32651. }
  32652. target := &ret
  32653. if err := gensupport.DecodeResponse(target, res); err != nil {
  32654. return nil, err
  32655. }
  32656. return ret, nil
  32657. // {
  32658. // "description": "Retrieves a list of operating systems.",
  32659. // "httpMethod": "GET",
  32660. // "id": "dfareporting.operatingSystems.list",
  32661. // "parameterOrder": [
  32662. // "profileId"
  32663. // ],
  32664. // "parameters": {
  32665. // "profileId": {
  32666. // "description": "User profile ID associated with this request.",
  32667. // "format": "int64",
  32668. // "location": "path",
  32669. // "required": true,
  32670. // "type": "string"
  32671. // }
  32672. // },
  32673. // "path": "userprofiles/{profileId}/operatingSystems",
  32674. // "response": {
  32675. // "$ref": "OperatingSystemsListResponse"
  32676. // },
  32677. // "scopes": [
  32678. // "https://www.googleapis.com/auth/dfatrafficking"
  32679. // ]
  32680. // }
  32681. }
  32682. // method id "dfareporting.orderDocuments.get":
  32683. type OrderDocumentsGetCall struct {
  32684. s *Service
  32685. profileId int64
  32686. projectId int64
  32687. id int64
  32688. urlParams_ gensupport.URLParams
  32689. ifNoneMatch_ string
  32690. ctx_ context.Context
  32691. header_ http.Header
  32692. }
  32693. // Get: Gets one order document by ID.
  32694. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  32695. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32696. c.profileId = profileId
  32697. c.projectId = projectId
  32698. c.id = id
  32699. return c
  32700. }
  32701. // Fields allows partial responses to be retrieved. See
  32702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32703. // for more information.
  32704. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  32705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32706. return c
  32707. }
  32708. // IfNoneMatch sets the optional parameter which makes the operation
  32709. // fail if the object's ETag matches the given value. This is useful for
  32710. // getting updates only after the object has changed since the last
  32711. // request. Use googleapi.IsNotModified to check whether the response
  32712. // error from Do is the result of In-None-Match.
  32713. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  32714. c.ifNoneMatch_ = entityTag
  32715. return c
  32716. }
  32717. // Context sets the context to be used in this call's Do method. Any
  32718. // pending HTTP request will be aborted if the provided context is
  32719. // canceled.
  32720. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  32721. c.ctx_ = ctx
  32722. return c
  32723. }
  32724. // Header returns an http.Header that can be modified by the caller to
  32725. // add HTTP headers to the request.
  32726. func (c *OrderDocumentsGetCall) Header() http.Header {
  32727. if c.header_ == nil {
  32728. c.header_ = make(http.Header)
  32729. }
  32730. return c.header_
  32731. }
  32732. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  32733. reqHeaders := make(http.Header)
  32734. for k, v := range c.header_ {
  32735. reqHeaders[k] = v
  32736. }
  32737. reqHeaders.Set("User-Agent", c.s.userAgent())
  32738. if c.ifNoneMatch_ != "" {
  32739. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32740. }
  32741. var body io.Reader = nil
  32742. c.urlParams_.Set("alt", alt)
  32743. c.urlParams_.Set("prettyPrint", "false")
  32744. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  32745. urls += "?" + c.urlParams_.Encode()
  32746. req, err := http.NewRequest("GET", urls, body)
  32747. if err != nil {
  32748. return nil, err
  32749. }
  32750. req.Header = reqHeaders
  32751. googleapi.Expand(req.URL, map[string]string{
  32752. "profileId": strconv.FormatInt(c.profileId, 10),
  32753. "projectId": strconv.FormatInt(c.projectId, 10),
  32754. "id": strconv.FormatInt(c.id, 10),
  32755. })
  32756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32757. }
  32758. // Do executes the "dfareporting.orderDocuments.get" call.
  32759. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  32760. // status code is an error. Response headers are in either
  32761. // *OrderDocument.ServerResponse.Header or (if a response was returned
  32762. // at all) in error.(*googleapi.Error).Header. Use
  32763. // googleapi.IsNotModified to check whether the returned error was
  32764. // because http.StatusNotModified was returned.
  32765. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  32766. gensupport.SetOptions(c.urlParams_, opts...)
  32767. res, err := c.doRequest("json")
  32768. if res != nil && res.StatusCode == http.StatusNotModified {
  32769. if res.Body != nil {
  32770. res.Body.Close()
  32771. }
  32772. return nil, &googleapi.Error{
  32773. Code: res.StatusCode,
  32774. Header: res.Header,
  32775. }
  32776. }
  32777. if err != nil {
  32778. return nil, err
  32779. }
  32780. defer googleapi.CloseBody(res)
  32781. if err := googleapi.CheckResponse(res); err != nil {
  32782. return nil, err
  32783. }
  32784. ret := &OrderDocument{
  32785. ServerResponse: googleapi.ServerResponse{
  32786. Header: res.Header,
  32787. HTTPStatusCode: res.StatusCode,
  32788. },
  32789. }
  32790. target := &ret
  32791. if err := gensupport.DecodeResponse(target, res); err != nil {
  32792. return nil, err
  32793. }
  32794. return ret, nil
  32795. // {
  32796. // "description": "Gets one order document by ID.",
  32797. // "httpMethod": "GET",
  32798. // "id": "dfareporting.orderDocuments.get",
  32799. // "parameterOrder": [
  32800. // "profileId",
  32801. // "projectId",
  32802. // "id"
  32803. // ],
  32804. // "parameters": {
  32805. // "id": {
  32806. // "description": "Order document ID.",
  32807. // "format": "int64",
  32808. // "location": "path",
  32809. // "required": true,
  32810. // "type": "string"
  32811. // },
  32812. // "profileId": {
  32813. // "description": "User profile ID associated with this request.",
  32814. // "format": "int64",
  32815. // "location": "path",
  32816. // "required": true,
  32817. // "type": "string"
  32818. // },
  32819. // "projectId": {
  32820. // "description": "Project ID for order documents.",
  32821. // "format": "int64",
  32822. // "location": "path",
  32823. // "required": true,
  32824. // "type": "string"
  32825. // }
  32826. // },
  32827. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  32828. // "response": {
  32829. // "$ref": "OrderDocument"
  32830. // },
  32831. // "scopes": [
  32832. // "https://www.googleapis.com/auth/dfatrafficking"
  32833. // ]
  32834. // }
  32835. }
  32836. // method id "dfareporting.orderDocuments.list":
  32837. type OrderDocumentsListCall struct {
  32838. s *Service
  32839. profileId int64
  32840. projectId int64
  32841. urlParams_ gensupport.URLParams
  32842. ifNoneMatch_ string
  32843. ctx_ context.Context
  32844. header_ http.Header
  32845. }
  32846. // List: Retrieves a list of order documents, possibly filtered. This
  32847. // method supports paging.
  32848. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32849. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32850. c.profileId = profileId
  32851. c.projectId = projectId
  32852. return c
  32853. }
  32854. // Approved sets the optional parameter "approved": Select only order
  32855. // documents that have been approved by at least one user.
  32856. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  32857. c.urlParams_.Set("approved", fmt.Sprint(approved))
  32858. return c
  32859. }
  32860. // Ids sets the optional parameter "ids": Select only order documents
  32861. // with these IDs.
  32862. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  32863. var ids_ []string
  32864. for _, v := range ids {
  32865. ids_ = append(ids_, fmt.Sprint(v))
  32866. }
  32867. c.urlParams_.SetMulti("ids", ids_)
  32868. return c
  32869. }
  32870. // MaxResults sets the optional parameter "maxResults": Maximum number
  32871. // of results to return.
  32872. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  32873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32874. return c
  32875. }
  32876. // OrderId sets the optional parameter "orderId": Select only order
  32877. // documents for specified orders.
  32878. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  32879. var orderId_ []string
  32880. for _, v := range orderId {
  32881. orderId_ = append(orderId_, fmt.Sprint(v))
  32882. }
  32883. c.urlParams_.SetMulti("orderId", orderId_)
  32884. return c
  32885. }
  32886. // PageToken sets the optional parameter "pageToken": Value of the
  32887. // nextPageToken from the previous result page.
  32888. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  32889. c.urlParams_.Set("pageToken", pageToken)
  32890. return c
  32891. }
  32892. // SearchString sets the optional parameter "searchString": Allows
  32893. // searching for order documents by name or ID. Wildcards (*) are
  32894. // allowed. For example, "orderdocument*2015" will return order
  32895. // documents with names like "orderdocument June 2015", "orderdocument
  32896. // April 2015", or simply "orderdocument 2015". Most of the searches
  32897. // also add wildcards implicitly at the start and the end of the search
  32898. // string. For example, a search string of "orderdocument" will match
  32899. // order documents with name "my orderdocument", "orderdocument 2015",
  32900. // or simply "orderdocument".
  32901. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  32902. c.urlParams_.Set("searchString", searchString)
  32903. return c
  32904. }
  32905. // SiteId sets the optional parameter "siteId": Select only order
  32906. // documents that are associated with these sites.
  32907. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  32908. var siteId_ []string
  32909. for _, v := range siteId {
  32910. siteId_ = append(siteId_, fmt.Sprint(v))
  32911. }
  32912. c.urlParams_.SetMulti("siteId", siteId_)
  32913. return c
  32914. }
  32915. // SortField sets the optional parameter "sortField": Field by which to
  32916. // sort the list.
  32917. //
  32918. // Possible values:
  32919. // "ID" (default)
  32920. // "NAME"
  32921. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  32922. c.urlParams_.Set("sortField", sortField)
  32923. return c
  32924. }
  32925. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32926. // results.
  32927. //
  32928. // Possible values:
  32929. // "ASCENDING" (default)
  32930. // "DESCENDING"
  32931. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  32932. c.urlParams_.Set("sortOrder", sortOrder)
  32933. return c
  32934. }
  32935. // Fields allows partial responses to be retrieved. See
  32936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32937. // for more information.
  32938. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  32939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32940. return c
  32941. }
  32942. // IfNoneMatch sets the optional parameter which makes the operation
  32943. // fail if the object's ETag matches the given value. This is useful for
  32944. // getting updates only after the object has changed since the last
  32945. // request. Use googleapi.IsNotModified to check whether the response
  32946. // error from Do is the result of In-None-Match.
  32947. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  32948. c.ifNoneMatch_ = entityTag
  32949. return c
  32950. }
  32951. // Context sets the context to be used in this call's Do method. Any
  32952. // pending HTTP request will be aborted if the provided context is
  32953. // canceled.
  32954. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  32955. c.ctx_ = ctx
  32956. return c
  32957. }
  32958. // Header returns an http.Header that can be modified by the caller to
  32959. // add HTTP headers to the request.
  32960. func (c *OrderDocumentsListCall) Header() http.Header {
  32961. if c.header_ == nil {
  32962. c.header_ = make(http.Header)
  32963. }
  32964. return c.header_
  32965. }
  32966. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  32967. reqHeaders := make(http.Header)
  32968. for k, v := range c.header_ {
  32969. reqHeaders[k] = v
  32970. }
  32971. reqHeaders.Set("User-Agent", c.s.userAgent())
  32972. if c.ifNoneMatch_ != "" {
  32973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32974. }
  32975. var body io.Reader = nil
  32976. c.urlParams_.Set("alt", alt)
  32977. c.urlParams_.Set("prettyPrint", "false")
  32978. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  32979. urls += "?" + c.urlParams_.Encode()
  32980. req, err := http.NewRequest("GET", urls, body)
  32981. if err != nil {
  32982. return nil, err
  32983. }
  32984. req.Header = reqHeaders
  32985. googleapi.Expand(req.URL, map[string]string{
  32986. "profileId": strconv.FormatInt(c.profileId, 10),
  32987. "projectId": strconv.FormatInt(c.projectId, 10),
  32988. })
  32989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32990. }
  32991. // Do executes the "dfareporting.orderDocuments.list" call.
  32992. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  32993. // Any non-2xx status code is an error. Response headers are in either
  32994. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  32995. // was returned at all) in error.(*googleapi.Error).Header. Use
  32996. // googleapi.IsNotModified to check whether the returned error was
  32997. // because http.StatusNotModified was returned.
  32998. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  32999. gensupport.SetOptions(c.urlParams_, opts...)
  33000. res, err := c.doRequest("json")
  33001. if res != nil && res.StatusCode == http.StatusNotModified {
  33002. if res.Body != nil {
  33003. res.Body.Close()
  33004. }
  33005. return nil, &googleapi.Error{
  33006. Code: res.StatusCode,
  33007. Header: res.Header,
  33008. }
  33009. }
  33010. if err != nil {
  33011. return nil, err
  33012. }
  33013. defer googleapi.CloseBody(res)
  33014. if err := googleapi.CheckResponse(res); err != nil {
  33015. return nil, err
  33016. }
  33017. ret := &OrderDocumentsListResponse{
  33018. ServerResponse: googleapi.ServerResponse{
  33019. Header: res.Header,
  33020. HTTPStatusCode: res.StatusCode,
  33021. },
  33022. }
  33023. target := &ret
  33024. if err := gensupport.DecodeResponse(target, res); err != nil {
  33025. return nil, err
  33026. }
  33027. return ret, nil
  33028. // {
  33029. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  33030. // "httpMethod": "GET",
  33031. // "id": "dfareporting.orderDocuments.list",
  33032. // "parameterOrder": [
  33033. // "profileId",
  33034. // "projectId"
  33035. // ],
  33036. // "parameters": {
  33037. // "approved": {
  33038. // "description": "Select only order documents that have been approved by at least one user.",
  33039. // "location": "query",
  33040. // "type": "boolean"
  33041. // },
  33042. // "ids": {
  33043. // "description": "Select only order documents with these IDs.",
  33044. // "format": "int64",
  33045. // "location": "query",
  33046. // "repeated": true,
  33047. // "type": "string"
  33048. // },
  33049. // "maxResults": {
  33050. // "default": "1000",
  33051. // "description": "Maximum number of results to return.",
  33052. // "format": "int32",
  33053. // "location": "query",
  33054. // "maximum": "1000",
  33055. // "minimum": "0",
  33056. // "type": "integer"
  33057. // },
  33058. // "orderId": {
  33059. // "description": "Select only order documents for specified orders.",
  33060. // "format": "int64",
  33061. // "location": "query",
  33062. // "repeated": true,
  33063. // "type": "string"
  33064. // },
  33065. // "pageToken": {
  33066. // "description": "Value of the nextPageToken from the previous result page.",
  33067. // "location": "query",
  33068. // "type": "string"
  33069. // },
  33070. // "profileId": {
  33071. // "description": "User profile ID associated with this request.",
  33072. // "format": "int64",
  33073. // "location": "path",
  33074. // "required": true,
  33075. // "type": "string"
  33076. // },
  33077. // "projectId": {
  33078. // "description": "Project ID for order documents.",
  33079. // "format": "int64",
  33080. // "location": "path",
  33081. // "required": true,
  33082. // "type": "string"
  33083. // },
  33084. // "searchString": {
  33085. // "description": "Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, \"orderdocument*2015\" will return order documents with names like \"orderdocument June 2015\", \"orderdocument April 2015\", or simply \"orderdocument 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"orderdocument\" will match order documents with name \"my orderdocument\", \"orderdocument 2015\", or simply \"orderdocument\".",
  33086. // "location": "query",
  33087. // "type": "string"
  33088. // },
  33089. // "siteId": {
  33090. // "description": "Select only order documents that are associated with these sites.",
  33091. // "format": "int64",
  33092. // "location": "query",
  33093. // "repeated": true,
  33094. // "type": "string"
  33095. // },
  33096. // "sortField": {
  33097. // "default": "ID",
  33098. // "description": "Field by which to sort the list.",
  33099. // "enum": [
  33100. // "ID",
  33101. // "NAME"
  33102. // ],
  33103. // "enumDescriptions": [
  33104. // "",
  33105. // ""
  33106. // ],
  33107. // "location": "query",
  33108. // "type": "string"
  33109. // },
  33110. // "sortOrder": {
  33111. // "default": "ASCENDING",
  33112. // "description": "Order of sorted results.",
  33113. // "enum": [
  33114. // "ASCENDING",
  33115. // "DESCENDING"
  33116. // ],
  33117. // "enumDescriptions": [
  33118. // "",
  33119. // ""
  33120. // ],
  33121. // "location": "query",
  33122. // "type": "string"
  33123. // }
  33124. // },
  33125. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  33126. // "response": {
  33127. // "$ref": "OrderDocumentsListResponse"
  33128. // },
  33129. // "scopes": [
  33130. // "https://www.googleapis.com/auth/dfatrafficking"
  33131. // ]
  33132. // }
  33133. }
  33134. // Pages invokes f for each page of results.
  33135. // A non-nil error returned from f will halt the iteration.
  33136. // The provided context supersedes any context provided to the Context method.
  33137. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  33138. c.ctx_ = ctx
  33139. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33140. for {
  33141. x, err := c.Do()
  33142. if err != nil {
  33143. return err
  33144. }
  33145. if err := f(x); err != nil {
  33146. return err
  33147. }
  33148. if x.NextPageToken == "" {
  33149. return nil
  33150. }
  33151. c.PageToken(x.NextPageToken)
  33152. }
  33153. }
  33154. // method id "dfareporting.orders.get":
  33155. type OrdersGetCall struct {
  33156. s *Service
  33157. profileId int64
  33158. projectId int64
  33159. id int64
  33160. urlParams_ gensupport.URLParams
  33161. ifNoneMatch_ string
  33162. ctx_ context.Context
  33163. header_ http.Header
  33164. }
  33165. // Get: Gets one order by ID.
  33166. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  33167. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33168. c.profileId = profileId
  33169. c.projectId = projectId
  33170. c.id = id
  33171. return c
  33172. }
  33173. // Fields allows partial responses to be retrieved. See
  33174. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33175. // for more information.
  33176. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  33177. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33178. return c
  33179. }
  33180. // IfNoneMatch sets the optional parameter which makes the operation
  33181. // fail if the object's ETag matches the given value. This is useful for
  33182. // getting updates only after the object has changed since the last
  33183. // request. Use googleapi.IsNotModified to check whether the response
  33184. // error from Do is the result of In-None-Match.
  33185. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  33186. c.ifNoneMatch_ = entityTag
  33187. return c
  33188. }
  33189. // Context sets the context to be used in this call's Do method. Any
  33190. // pending HTTP request will be aborted if the provided context is
  33191. // canceled.
  33192. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  33193. c.ctx_ = ctx
  33194. return c
  33195. }
  33196. // Header returns an http.Header that can be modified by the caller to
  33197. // add HTTP headers to the request.
  33198. func (c *OrdersGetCall) Header() http.Header {
  33199. if c.header_ == nil {
  33200. c.header_ = make(http.Header)
  33201. }
  33202. return c.header_
  33203. }
  33204. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  33205. reqHeaders := make(http.Header)
  33206. for k, v := range c.header_ {
  33207. reqHeaders[k] = v
  33208. }
  33209. reqHeaders.Set("User-Agent", c.s.userAgent())
  33210. if c.ifNoneMatch_ != "" {
  33211. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33212. }
  33213. var body io.Reader = nil
  33214. c.urlParams_.Set("alt", alt)
  33215. c.urlParams_.Set("prettyPrint", "false")
  33216. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  33217. urls += "?" + c.urlParams_.Encode()
  33218. req, err := http.NewRequest("GET", urls, body)
  33219. if err != nil {
  33220. return nil, err
  33221. }
  33222. req.Header = reqHeaders
  33223. googleapi.Expand(req.URL, map[string]string{
  33224. "profileId": strconv.FormatInt(c.profileId, 10),
  33225. "projectId": strconv.FormatInt(c.projectId, 10),
  33226. "id": strconv.FormatInt(c.id, 10),
  33227. })
  33228. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33229. }
  33230. // Do executes the "dfareporting.orders.get" call.
  33231. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  33232. // code is an error. Response headers are in either
  33233. // *Order.ServerResponse.Header or (if a response was returned at all)
  33234. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  33235. // check whether the returned error was because http.StatusNotModified
  33236. // was returned.
  33237. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  33238. gensupport.SetOptions(c.urlParams_, opts...)
  33239. res, err := c.doRequest("json")
  33240. if res != nil && res.StatusCode == http.StatusNotModified {
  33241. if res.Body != nil {
  33242. res.Body.Close()
  33243. }
  33244. return nil, &googleapi.Error{
  33245. Code: res.StatusCode,
  33246. Header: res.Header,
  33247. }
  33248. }
  33249. if err != nil {
  33250. return nil, err
  33251. }
  33252. defer googleapi.CloseBody(res)
  33253. if err := googleapi.CheckResponse(res); err != nil {
  33254. return nil, err
  33255. }
  33256. ret := &Order{
  33257. ServerResponse: googleapi.ServerResponse{
  33258. Header: res.Header,
  33259. HTTPStatusCode: res.StatusCode,
  33260. },
  33261. }
  33262. target := &ret
  33263. if err := gensupport.DecodeResponse(target, res); err != nil {
  33264. return nil, err
  33265. }
  33266. return ret, nil
  33267. // {
  33268. // "description": "Gets one order by ID.",
  33269. // "httpMethod": "GET",
  33270. // "id": "dfareporting.orders.get",
  33271. // "parameterOrder": [
  33272. // "profileId",
  33273. // "projectId",
  33274. // "id"
  33275. // ],
  33276. // "parameters": {
  33277. // "id": {
  33278. // "description": "Order ID.",
  33279. // "format": "int64",
  33280. // "location": "path",
  33281. // "required": true,
  33282. // "type": "string"
  33283. // },
  33284. // "profileId": {
  33285. // "description": "User profile ID associated with this request.",
  33286. // "format": "int64",
  33287. // "location": "path",
  33288. // "required": true,
  33289. // "type": "string"
  33290. // },
  33291. // "projectId": {
  33292. // "description": "Project ID for orders.",
  33293. // "format": "int64",
  33294. // "location": "path",
  33295. // "required": true,
  33296. // "type": "string"
  33297. // }
  33298. // },
  33299. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  33300. // "response": {
  33301. // "$ref": "Order"
  33302. // },
  33303. // "scopes": [
  33304. // "https://www.googleapis.com/auth/dfatrafficking"
  33305. // ]
  33306. // }
  33307. }
  33308. // method id "dfareporting.orders.list":
  33309. type OrdersListCall struct {
  33310. s *Service
  33311. profileId int64
  33312. projectId int64
  33313. urlParams_ gensupport.URLParams
  33314. ifNoneMatch_ string
  33315. ctx_ context.Context
  33316. header_ http.Header
  33317. }
  33318. // List: Retrieves a list of orders, possibly filtered. This method
  33319. // supports paging.
  33320. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  33321. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33322. c.profileId = profileId
  33323. c.projectId = projectId
  33324. return c
  33325. }
  33326. // Ids sets the optional parameter "ids": Select only orders with these
  33327. // IDs.
  33328. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  33329. var ids_ []string
  33330. for _, v := range ids {
  33331. ids_ = append(ids_, fmt.Sprint(v))
  33332. }
  33333. c.urlParams_.SetMulti("ids", ids_)
  33334. return c
  33335. }
  33336. // MaxResults sets the optional parameter "maxResults": Maximum number
  33337. // of results to return.
  33338. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  33339. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33340. return c
  33341. }
  33342. // PageToken sets the optional parameter "pageToken": Value of the
  33343. // nextPageToken from the previous result page.
  33344. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  33345. c.urlParams_.Set("pageToken", pageToken)
  33346. return c
  33347. }
  33348. // SearchString sets the optional parameter "searchString": Allows
  33349. // searching for orders by name or ID. Wildcards (*) are allowed. For
  33350. // example, "order*2015" will return orders with names like "order June
  33351. // 2015", "order April 2015", or simply "order 2015". Most of the
  33352. // searches also add wildcards implicitly at the start and the end of
  33353. // the search string. For example, a search string of "order" will match
  33354. // orders with name "my order", "order 2015", or simply "order".
  33355. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  33356. c.urlParams_.Set("searchString", searchString)
  33357. return c
  33358. }
  33359. // SiteId sets the optional parameter "siteId": Select only orders that
  33360. // are associated with these site IDs.
  33361. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  33362. var siteId_ []string
  33363. for _, v := range siteId {
  33364. siteId_ = append(siteId_, fmt.Sprint(v))
  33365. }
  33366. c.urlParams_.SetMulti("siteId", siteId_)
  33367. return c
  33368. }
  33369. // SortField sets the optional parameter "sortField": Field by which to
  33370. // sort the list.
  33371. //
  33372. // Possible values:
  33373. // "ID" (default)
  33374. // "NAME"
  33375. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  33376. c.urlParams_.Set("sortField", sortField)
  33377. return c
  33378. }
  33379. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33380. // results.
  33381. //
  33382. // Possible values:
  33383. // "ASCENDING" (default)
  33384. // "DESCENDING"
  33385. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  33386. c.urlParams_.Set("sortOrder", sortOrder)
  33387. return c
  33388. }
  33389. // Fields allows partial responses to be retrieved. See
  33390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33391. // for more information.
  33392. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  33393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33394. return c
  33395. }
  33396. // IfNoneMatch sets the optional parameter which makes the operation
  33397. // fail if the object's ETag matches the given value. This is useful for
  33398. // getting updates only after the object has changed since the last
  33399. // request. Use googleapi.IsNotModified to check whether the response
  33400. // error from Do is the result of In-None-Match.
  33401. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  33402. c.ifNoneMatch_ = entityTag
  33403. return c
  33404. }
  33405. // Context sets the context to be used in this call's Do method. Any
  33406. // pending HTTP request will be aborted if the provided context is
  33407. // canceled.
  33408. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  33409. c.ctx_ = ctx
  33410. return c
  33411. }
  33412. // Header returns an http.Header that can be modified by the caller to
  33413. // add HTTP headers to the request.
  33414. func (c *OrdersListCall) Header() http.Header {
  33415. if c.header_ == nil {
  33416. c.header_ = make(http.Header)
  33417. }
  33418. return c.header_
  33419. }
  33420. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  33421. reqHeaders := make(http.Header)
  33422. for k, v := range c.header_ {
  33423. reqHeaders[k] = v
  33424. }
  33425. reqHeaders.Set("User-Agent", c.s.userAgent())
  33426. if c.ifNoneMatch_ != "" {
  33427. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33428. }
  33429. var body io.Reader = nil
  33430. c.urlParams_.Set("alt", alt)
  33431. c.urlParams_.Set("prettyPrint", "false")
  33432. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  33433. urls += "?" + c.urlParams_.Encode()
  33434. req, err := http.NewRequest("GET", urls, body)
  33435. if err != nil {
  33436. return nil, err
  33437. }
  33438. req.Header = reqHeaders
  33439. googleapi.Expand(req.URL, map[string]string{
  33440. "profileId": strconv.FormatInt(c.profileId, 10),
  33441. "projectId": strconv.FormatInt(c.projectId, 10),
  33442. })
  33443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33444. }
  33445. // Do executes the "dfareporting.orders.list" call.
  33446. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  33447. // non-2xx status code is an error. Response headers are in either
  33448. // *OrdersListResponse.ServerResponse.Header or (if a response was
  33449. // returned at all) in error.(*googleapi.Error).Header. Use
  33450. // googleapi.IsNotModified to check whether the returned error was
  33451. // because http.StatusNotModified was returned.
  33452. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  33453. gensupport.SetOptions(c.urlParams_, opts...)
  33454. res, err := c.doRequest("json")
  33455. if res != nil && res.StatusCode == http.StatusNotModified {
  33456. if res.Body != nil {
  33457. res.Body.Close()
  33458. }
  33459. return nil, &googleapi.Error{
  33460. Code: res.StatusCode,
  33461. Header: res.Header,
  33462. }
  33463. }
  33464. if err != nil {
  33465. return nil, err
  33466. }
  33467. defer googleapi.CloseBody(res)
  33468. if err := googleapi.CheckResponse(res); err != nil {
  33469. return nil, err
  33470. }
  33471. ret := &OrdersListResponse{
  33472. ServerResponse: googleapi.ServerResponse{
  33473. Header: res.Header,
  33474. HTTPStatusCode: res.StatusCode,
  33475. },
  33476. }
  33477. target := &ret
  33478. if err := gensupport.DecodeResponse(target, res); err != nil {
  33479. return nil, err
  33480. }
  33481. return ret, nil
  33482. // {
  33483. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  33484. // "httpMethod": "GET",
  33485. // "id": "dfareporting.orders.list",
  33486. // "parameterOrder": [
  33487. // "profileId",
  33488. // "projectId"
  33489. // ],
  33490. // "parameters": {
  33491. // "ids": {
  33492. // "description": "Select only orders with these IDs.",
  33493. // "format": "int64",
  33494. // "location": "query",
  33495. // "repeated": true,
  33496. // "type": "string"
  33497. // },
  33498. // "maxResults": {
  33499. // "default": "1000",
  33500. // "description": "Maximum number of results to return.",
  33501. // "format": "int32",
  33502. // "location": "query",
  33503. // "maximum": "1000",
  33504. // "minimum": "0",
  33505. // "type": "integer"
  33506. // },
  33507. // "pageToken": {
  33508. // "description": "Value of the nextPageToken from the previous result page.",
  33509. // "location": "query",
  33510. // "type": "string"
  33511. // },
  33512. // "profileId": {
  33513. // "description": "User profile ID associated with this request.",
  33514. // "format": "int64",
  33515. // "location": "path",
  33516. // "required": true,
  33517. // "type": "string"
  33518. // },
  33519. // "projectId": {
  33520. // "description": "Project ID for orders.",
  33521. // "format": "int64",
  33522. // "location": "path",
  33523. // "required": true,
  33524. // "type": "string"
  33525. // },
  33526. // "searchString": {
  33527. // "description": "Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, \"order*2015\" will return orders with names like \"order June 2015\", \"order April 2015\", or simply \"order 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"order\" will match orders with name \"my order\", \"order 2015\", or simply \"order\".",
  33528. // "location": "query",
  33529. // "type": "string"
  33530. // },
  33531. // "siteId": {
  33532. // "description": "Select only orders that are associated with these site IDs.",
  33533. // "format": "int64",
  33534. // "location": "query",
  33535. // "repeated": true,
  33536. // "type": "string"
  33537. // },
  33538. // "sortField": {
  33539. // "default": "ID",
  33540. // "description": "Field by which to sort the list.",
  33541. // "enum": [
  33542. // "ID",
  33543. // "NAME"
  33544. // ],
  33545. // "enumDescriptions": [
  33546. // "",
  33547. // ""
  33548. // ],
  33549. // "location": "query",
  33550. // "type": "string"
  33551. // },
  33552. // "sortOrder": {
  33553. // "default": "ASCENDING",
  33554. // "description": "Order of sorted results.",
  33555. // "enum": [
  33556. // "ASCENDING",
  33557. // "DESCENDING"
  33558. // ],
  33559. // "enumDescriptions": [
  33560. // "",
  33561. // ""
  33562. // ],
  33563. // "location": "query",
  33564. // "type": "string"
  33565. // }
  33566. // },
  33567. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  33568. // "response": {
  33569. // "$ref": "OrdersListResponse"
  33570. // },
  33571. // "scopes": [
  33572. // "https://www.googleapis.com/auth/dfatrafficking"
  33573. // ]
  33574. // }
  33575. }
  33576. // Pages invokes f for each page of results.
  33577. // A non-nil error returned from f will halt the iteration.
  33578. // The provided context supersedes any context provided to the Context method.
  33579. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  33580. c.ctx_ = ctx
  33581. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33582. for {
  33583. x, err := c.Do()
  33584. if err != nil {
  33585. return err
  33586. }
  33587. if err := f(x); err != nil {
  33588. return err
  33589. }
  33590. if x.NextPageToken == "" {
  33591. return nil
  33592. }
  33593. c.PageToken(x.NextPageToken)
  33594. }
  33595. }
  33596. // method id "dfareporting.placementGroups.get":
  33597. type PlacementGroupsGetCall struct {
  33598. s *Service
  33599. profileId int64
  33600. id int64
  33601. urlParams_ gensupport.URLParams
  33602. ifNoneMatch_ string
  33603. ctx_ context.Context
  33604. header_ http.Header
  33605. }
  33606. // Get: Gets one placement group by ID.
  33607. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  33608. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33609. c.profileId = profileId
  33610. c.id = id
  33611. return c
  33612. }
  33613. // Fields allows partial responses to be retrieved. See
  33614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33615. // for more information.
  33616. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  33617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33618. return c
  33619. }
  33620. // IfNoneMatch sets the optional parameter which makes the operation
  33621. // fail if the object's ETag matches the given value. This is useful for
  33622. // getting updates only after the object has changed since the last
  33623. // request. Use googleapi.IsNotModified to check whether the response
  33624. // error from Do is the result of In-None-Match.
  33625. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  33626. c.ifNoneMatch_ = entityTag
  33627. return c
  33628. }
  33629. // Context sets the context to be used in this call's Do method. Any
  33630. // pending HTTP request will be aborted if the provided context is
  33631. // canceled.
  33632. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  33633. c.ctx_ = ctx
  33634. return c
  33635. }
  33636. // Header returns an http.Header that can be modified by the caller to
  33637. // add HTTP headers to the request.
  33638. func (c *PlacementGroupsGetCall) Header() http.Header {
  33639. if c.header_ == nil {
  33640. c.header_ = make(http.Header)
  33641. }
  33642. return c.header_
  33643. }
  33644. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  33645. reqHeaders := make(http.Header)
  33646. for k, v := range c.header_ {
  33647. reqHeaders[k] = v
  33648. }
  33649. reqHeaders.Set("User-Agent", c.s.userAgent())
  33650. if c.ifNoneMatch_ != "" {
  33651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33652. }
  33653. var body io.Reader = nil
  33654. c.urlParams_.Set("alt", alt)
  33655. c.urlParams_.Set("prettyPrint", "false")
  33656. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  33657. urls += "?" + c.urlParams_.Encode()
  33658. req, err := http.NewRequest("GET", urls, body)
  33659. if err != nil {
  33660. return nil, err
  33661. }
  33662. req.Header = reqHeaders
  33663. googleapi.Expand(req.URL, map[string]string{
  33664. "profileId": strconv.FormatInt(c.profileId, 10),
  33665. "id": strconv.FormatInt(c.id, 10),
  33666. })
  33667. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33668. }
  33669. // Do executes the "dfareporting.placementGroups.get" call.
  33670. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33671. // status code is an error. Response headers are in either
  33672. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33673. // at all) in error.(*googleapi.Error).Header. Use
  33674. // googleapi.IsNotModified to check whether the returned error was
  33675. // because http.StatusNotModified was returned.
  33676. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33677. gensupport.SetOptions(c.urlParams_, opts...)
  33678. res, err := c.doRequest("json")
  33679. if res != nil && res.StatusCode == http.StatusNotModified {
  33680. if res.Body != nil {
  33681. res.Body.Close()
  33682. }
  33683. return nil, &googleapi.Error{
  33684. Code: res.StatusCode,
  33685. Header: res.Header,
  33686. }
  33687. }
  33688. if err != nil {
  33689. return nil, err
  33690. }
  33691. defer googleapi.CloseBody(res)
  33692. if err := googleapi.CheckResponse(res); err != nil {
  33693. return nil, err
  33694. }
  33695. ret := &PlacementGroup{
  33696. ServerResponse: googleapi.ServerResponse{
  33697. Header: res.Header,
  33698. HTTPStatusCode: res.StatusCode,
  33699. },
  33700. }
  33701. target := &ret
  33702. if err := gensupport.DecodeResponse(target, res); err != nil {
  33703. return nil, err
  33704. }
  33705. return ret, nil
  33706. // {
  33707. // "description": "Gets one placement group by ID.",
  33708. // "httpMethod": "GET",
  33709. // "id": "dfareporting.placementGroups.get",
  33710. // "parameterOrder": [
  33711. // "profileId",
  33712. // "id"
  33713. // ],
  33714. // "parameters": {
  33715. // "id": {
  33716. // "description": "Placement group ID.",
  33717. // "format": "int64",
  33718. // "location": "path",
  33719. // "required": true,
  33720. // "type": "string"
  33721. // },
  33722. // "profileId": {
  33723. // "description": "User profile ID associated with this request.",
  33724. // "format": "int64",
  33725. // "location": "path",
  33726. // "required": true,
  33727. // "type": "string"
  33728. // }
  33729. // },
  33730. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  33731. // "response": {
  33732. // "$ref": "PlacementGroup"
  33733. // },
  33734. // "scopes": [
  33735. // "https://www.googleapis.com/auth/dfatrafficking"
  33736. // ]
  33737. // }
  33738. }
  33739. // method id "dfareporting.placementGroups.insert":
  33740. type PlacementGroupsInsertCall struct {
  33741. s *Service
  33742. profileId int64
  33743. placementgroup *PlacementGroup
  33744. urlParams_ gensupport.URLParams
  33745. ctx_ context.Context
  33746. header_ http.Header
  33747. }
  33748. // Insert: Inserts a new placement group.
  33749. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  33750. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33751. c.profileId = profileId
  33752. c.placementgroup = placementgroup
  33753. return c
  33754. }
  33755. // Fields allows partial responses to be retrieved. See
  33756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33757. // for more information.
  33758. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  33759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33760. return c
  33761. }
  33762. // Context sets the context to be used in this call's Do method. Any
  33763. // pending HTTP request will be aborted if the provided context is
  33764. // canceled.
  33765. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  33766. c.ctx_ = ctx
  33767. return c
  33768. }
  33769. // Header returns an http.Header that can be modified by the caller to
  33770. // add HTTP headers to the request.
  33771. func (c *PlacementGroupsInsertCall) Header() http.Header {
  33772. if c.header_ == nil {
  33773. c.header_ = make(http.Header)
  33774. }
  33775. return c.header_
  33776. }
  33777. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  33778. reqHeaders := make(http.Header)
  33779. for k, v := range c.header_ {
  33780. reqHeaders[k] = v
  33781. }
  33782. reqHeaders.Set("User-Agent", c.s.userAgent())
  33783. var body io.Reader = nil
  33784. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33785. if err != nil {
  33786. return nil, err
  33787. }
  33788. reqHeaders.Set("Content-Type", "application/json")
  33789. c.urlParams_.Set("alt", alt)
  33790. c.urlParams_.Set("prettyPrint", "false")
  33791. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33792. urls += "?" + c.urlParams_.Encode()
  33793. req, err := http.NewRequest("POST", urls, body)
  33794. if err != nil {
  33795. return nil, err
  33796. }
  33797. req.Header = reqHeaders
  33798. googleapi.Expand(req.URL, map[string]string{
  33799. "profileId": strconv.FormatInt(c.profileId, 10),
  33800. })
  33801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33802. }
  33803. // Do executes the "dfareporting.placementGroups.insert" call.
  33804. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33805. // status code is an error. Response headers are in either
  33806. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33807. // at all) in error.(*googleapi.Error).Header. Use
  33808. // googleapi.IsNotModified to check whether the returned error was
  33809. // because http.StatusNotModified was returned.
  33810. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33811. gensupport.SetOptions(c.urlParams_, opts...)
  33812. res, err := c.doRequest("json")
  33813. if res != nil && res.StatusCode == http.StatusNotModified {
  33814. if res.Body != nil {
  33815. res.Body.Close()
  33816. }
  33817. return nil, &googleapi.Error{
  33818. Code: res.StatusCode,
  33819. Header: res.Header,
  33820. }
  33821. }
  33822. if err != nil {
  33823. return nil, err
  33824. }
  33825. defer googleapi.CloseBody(res)
  33826. if err := googleapi.CheckResponse(res); err != nil {
  33827. return nil, err
  33828. }
  33829. ret := &PlacementGroup{
  33830. ServerResponse: googleapi.ServerResponse{
  33831. Header: res.Header,
  33832. HTTPStatusCode: res.StatusCode,
  33833. },
  33834. }
  33835. target := &ret
  33836. if err := gensupport.DecodeResponse(target, res); err != nil {
  33837. return nil, err
  33838. }
  33839. return ret, nil
  33840. // {
  33841. // "description": "Inserts a new placement group.",
  33842. // "httpMethod": "POST",
  33843. // "id": "dfareporting.placementGroups.insert",
  33844. // "parameterOrder": [
  33845. // "profileId"
  33846. // ],
  33847. // "parameters": {
  33848. // "profileId": {
  33849. // "description": "User profile ID associated with this request.",
  33850. // "format": "int64",
  33851. // "location": "path",
  33852. // "required": true,
  33853. // "type": "string"
  33854. // }
  33855. // },
  33856. // "path": "userprofiles/{profileId}/placementGroups",
  33857. // "request": {
  33858. // "$ref": "PlacementGroup"
  33859. // },
  33860. // "response": {
  33861. // "$ref": "PlacementGroup"
  33862. // },
  33863. // "scopes": [
  33864. // "https://www.googleapis.com/auth/dfatrafficking"
  33865. // ]
  33866. // }
  33867. }
  33868. // method id "dfareporting.placementGroups.list":
  33869. type PlacementGroupsListCall struct {
  33870. s *Service
  33871. profileId int64
  33872. urlParams_ gensupport.URLParams
  33873. ifNoneMatch_ string
  33874. ctx_ context.Context
  33875. header_ http.Header
  33876. }
  33877. // List: Retrieves a list of placement groups, possibly filtered. This
  33878. // method supports paging.
  33879. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  33880. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33881. c.profileId = profileId
  33882. return c
  33883. }
  33884. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  33885. // only placement groups that belong to these advertisers.
  33886. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  33887. var advertiserIds_ []string
  33888. for _, v := range advertiserIds {
  33889. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  33890. }
  33891. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  33892. return c
  33893. }
  33894. // Archived sets the optional parameter "archived": Select only archived
  33895. // placements. Don't set this field to select both archived and
  33896. // non-archived placements.
  33897. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  33898. c.urlParams_.Set("archived", fmt.Sprint(archived))
  33899. return c
  33900. }
  33901. // CampaignIds sets the optional parameter "campaignIds": Select only
  33902. // placement groups that belong to these campaigns.
  33903. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  33904. var campaignIds_ []string
  33905. for _, v := range campaignIds {
  33906. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  33907. }
  33908. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  33909. return c
  33910. }
  33911. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  33912. // Select only placement groups that are associated with these content
  33913. // categories.
  33914. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  33915. var contentCategoryIds_ []string
  33916. for _, v := range contentCategoryIds {
  33917. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  33918. }
  33919. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  33920. return c
  33921. }
  33922. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  33923. // Select only placement groups that are associated with these directory
  33924. // sites.
  33925. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  33926. var directorySiteIds_ []string
  33927. for _, v := range directorySiteIds {
  33928. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  33929. }
  33930. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  33931. return c
  33932. }
  33933. // Ids sets the optional parameter "ids": Select only placement groups
  33934. // with these IDs.
  33935. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  33936. var ids_ []string
  33937. for _, v := range ids {
  33938. ids_ = append(ids_, fmt.Sprint(v))
  33939. }
  33940. c.urlParams_.SetMulti("ids", ids_)
  33941. return c
  33942. }
  33943. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  33944. // placements or placement groups whose end date is on or before the
  33945. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  33946. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  33947. c.urlParams_.Set("maxEndDate", maxEndDate)
  33948. return c
  33949. }
  33950. // MaxResults sets the optional parameter "maxResults": Maximum number
  33951. // of results to return.
  33952. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  33953. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33954. return c
  33955. }
  33956. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  33957. // placements or placement groups whose start date is on or before the
  33958. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  33959. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  33960. c.urlParams_.Set("maxStartDate", maxStartDate)
  33961. return c
  33962. }
  33963. // MinEndDate sets the optional parameter "minEndDate": Select only
  33964. // placements or placement groups whose end date is on or after the
  33965. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  33966. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  33967. c.urlParams_.Set("minEndDate", minEndDate)
  33968. return c
  33969. }
  33970. // MinStartDate sets the optional parameter "minStartDate": Select only
  33971. // placements or placement groups whose start date is on or after the
  33972. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  33973. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  33974. c.urlParams_.Set("minStartDate", minStartDate)
  33975. return c
  33976. }
  33977. // PageToken sets the optional parameter "pageToken": Value of the
  33978. // nextPageToken from the previous result page.
  33979. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  33980. c.urlParams_.Set("pageToken", pageToken)
  33981. return c
  33982. }
  33983. // PlacementGroupType sets the optional parameter "placementGroupType":
  33984. // Select only placement groups belonging with this group type. A
  33985. // package is a simple group of placements that acts as a single pricing
  33986. // point for a group of tags. A roadblock is a group of placements that
  33987. // not only acts as a single pricing point but also assumes that all the
  33988. // tags in it will be served at the same time. A roadblock requires one
  33989. // of its assigned placements to be marked as primary for reporting.
  33990. //
  33991. // Possible values:
  33992. // "PLACEMENT_PACKAGE"
  33993. // "PLACEMENT_ROADBLOCK"
  33994. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  33995. c.urlParams_.Set("placementGroupType", placementGroupType)
  33996. return c
  33997. }
  33998. // PlacementStrategyIds sets the optional parameter
  33999. // "placementStrategyIds": Select only placement groups that are
  34000. // associated with these placement strategies.
  34001. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  34002. var placementStrategyIds_ []string
  34003. for _, v := range placementStrategyIds {
  34004. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  34005. }
  34006. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  34007. return c
  34008. }
  34009. // PricingTypes sets the optional parameter "pricingTypes": Select only
  34010. // placement groups with these pricing types.
  34011. //
  34012. // Possible values:
  34013. // "PRICING_TYPE_CPA"
  34014. // "PRICING_TYPE_CPC"
  34015. // "PRICING_TYPE_CPM"
  34016. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  34017. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  34018. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34019. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  34020. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  34021. return c
  34022. }
  34023. // SearchString sets the optional parameter "searchString": Allows
  34024. // searching for placement groups by name or ID. Wildcards (*) are
  34025. // allowed. For example, "placement*2015" will return placement groups
  34026. // with names like "placement group June 2015", "placement group May
  34027. // 2015", or simply "placements 2015". Most of the searches also add
  34028. // wildcards implicitly at the start and the end of the search string.
  34029. // For example, a search string of "placementgroup" will match placement
  34030. // groups with name "my placementgroup", "placementgroup 2015", or
  34031. // simply "placementgroup".
  34032. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  34033. c.urlParams_.Set("searchString", searchString)
  34034. return c
  34035. }
  34036. // SiteIds sets the optional parameter "siteIds": Select only placement
  34037. // groups that are associated with these sites.
  34038. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  34039. var siteIds_ []string
  34040. for _, v := range siteIds {
  34041. siteIds_ = append(siteIds_, fmt.Sprint(v))
  34042. }
  34043. c.urlParams_.SetMulti("siteIds", siteIds_)
  34044. return c
  34045. }
  34046. // SortField sets the optional parameter "sortField": Field by which to
  34047. // sort the list.
  34048. //
  34049. // Possible values:
  34050. // "ID" (default)
  34051. // "NAME"
  34052. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  34053. c.urlParams_.Set("sortField", sortField)
  34054. return c
  34055. }
  34056. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34057. // results.
  34058. //
  34059. // Possible values:
  34060. // "ASCENDING" (default)
  34061. // "DESCENDING"
  34062. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  34063. c.urlParams_.Set("sortOrder", sortOrder)
  34064. return c
  34065. }
  34066. // Fields allows partial responses to be retrieved. See
  34067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34068. // for more information.
  34069. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  34070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34071. return c
  34072. }
  34073. // IfNoneMatch sets the optional parameter which makes the operation
  34074. // fail if the object's ETag matches the given value. This is useful for
  34075. // getting updates only after the object has changed since the last
  34076. // request. Use googleapi.IsNotModified to check whether the response
  34077. // error from Do is the result of In-None-Match.
  34078. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  34079. c.ifNoneMatch_ = entityTag
  34080. return c
  34081. }
  34082. // Context sets the context to be used in this call's Do method. Any
  34083. // pending HTTP request will be aborted if the provided context is
  34084. // canceled.
  34085. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  34086. c.ctx_ = ctx
  34087. return c
  34088. }
  34089. // Header returns an http.Header that can be modified by the caller to
  34090. // add HTTP headers to the request.
  34091. func (c *PlacementGroupsListCall) Header() http.Header {
  34092. if c.header_ == nil {
  34093. c.header_ = make(http.Header)
  34094. }
  34095. return c.header_
  34096. }
  34097. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  34098. reqHeaders := make(http.Header)
  34099. for k, v := range c.header_ {
  34100. reqHeaders[k] = v
  34101. }
  34102. reqHeaders.Set("User-Agent", c.s.userAgent())
  34103. if c.ifNoneMatch_ != "" {
  34104. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34105. }
  34106. var body io.Reader = nil
  34107. c.urlParams_.Set("alt", alt)
  34108. c.urlParams_.Set("prettyPrint", "false")
  34109. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34110. urls += "?" + c.urlParams_.Encode()
  34111. req, err := http.NewRequest("GET", urls, body)
  34112. if err != nil {
  34113. return nil, err
  34114. }
  34115. req.Header = reqHeaders
  34116. googleapi.Expand(req.URL, map[string]string{
  34117. "profileId": strconv.FormatInt(c.profileId, 10),
  34118. })
  34119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34120. }
  34121. // Do executes the "dfareporting.placementGroups.list" call.
  34122. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  34123. // Any non-2xx status code is an error. Response headers are in either
  34124. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  34125. // was returned at all) in error.(*googleapi.Error).Header. Use
  34126. // googleapi.IsNotModified to check whether the returned error was
  34127. // because http.StatusNotModified was returned.
  34128. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  34129. gensupport.SetOptions(c.urlParams_, opts...)
  34130. res, err := c.doRequest("json")
  34131. if res != nil && res.StatusCode == http.StatusNotModified {
  34132. if res.Body != nil {
  34133. res.Body.Close()
  34134. }
  34135. return nil, &googleapi.Error{
  34136. Code: res.StatusCode,
  34137. Header: res.Header,
  34138. }
  34139. }
  34140. if err != nil {
  34141. return nil, err
  34142. }
  34143. defer googleapi.CloseBody(res)
  34144. if err := googleapi.CheckResponse(res); err != nil {
  34145. return nil, err
  34146. }
  34147. ret := &PlacementGroupsListResponse{
  34148. ServerResponse: googleapi.ServerResponse{
  34149. Header: res.Header,
  34150. HTTPStatusCode: res.StatusCode,
  34151. },
  34152. }
  34153. target := &ret
  34154. if err := gensupport.DecodeResponse(target, res); err != nil {
  34155. return nil, err
  34156. }
  34157. return ret, nil
  34158. // {
  34159. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  34160. // "httpMethod": "GET",
  34161. // "id": "dfareporting.placementGroups.list",
  34162. // "parameterOrder": [
  34163. // "profileId"
  34164. // ],
  34165. // "parameters": {
  34166. // "advertiserIds": {
  34167. // "description": "Select only placement groups that belong to these advertisers.",
  34168. // "format": "int64",
  34169. // "location": "query",
  34170. // "repeated": true,
  34171. // "type": "string"
  34172. // },
  34173. // "archived": {
  34174. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  34175. // "location": "query",
  34176. // "type": "boolean"
  34177. // },
  34178. // "campaignIds": {
  34179. // "description": "Select only placement groups that belong to these campaigns.",
  34180. // "format": "int64",
  34181. // "location": "query",
  34182. // "repeated": true,
  34183. // "type": "string"
  34184. // },
  34185. // "contentCategoryIds": {
  34186. // "description": "Select only placement groups that are associated with these content categories.",
  34187. // "format": "int64",
  34188. // "location": "query",
  34189. // "repeated": true,
  34190. // "type": "string"
  34191. // },
  34192. // "directorySiteIds": {
  34193. // "description": "Select only placement groups that are associated with these directory sites.",
  34194. // "format": "int64",
  34195. // "location": "query",
  34196. // "repeated": true,
  34197. // "type": "string"
  34198. // },
  34199. // "ids": {
  34200. // "description": "Select only placement groups with these IDs.",
  34201. // "format": "int64",
  34202. // "location": "query",
  34203. // "repeated": true,
  34204. // "type": "string"
  34205. // },
  34206. // "maxEndDate": {
  34207. // "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".",
  34208. // "location": "query",
  34209. // "type": "string"
  34210. // },
  34211. // "maxResults": {
  34212. // "default": "800",
  34213. // "description": "Maximum number of results to return.",
  34214. // "format": "int32",
  34215. // "location": "query",
  34216. // "maximum": "800",
  34217. // "minimum": "0",
  34218. // "type": "integer"
  34219. // },
  34220. // "maxStartDate": {
  34221. // "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".",
  34222. // "location": "query",
  34223. // "type": "string"
  34224. // },
  34225. // "minEndDate": {
  34226. // "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".",
  34227. // "location": "query",
  34228. // "type": "string"
  34229. // },
  34230. // "minStartDate": {
  34231. // "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".",
  34232. // "location": "query",
  34233. // "type": "string"
  34234. // },
  34235. // "pageToken": {
  34236. // "description": "Value of the nextPageToken from the previous result page.",
  34237. // "location": "query",
  34238. // "type": "string"
  34239. // },
  34240. // "placementGroupType": {
  34241. // "description": "Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting.",
  34242. // "enum": [
  34243. // "PLACEMENT_PACKAGE",
  34244. // "PLACEMENT_ROADBLOCK"
  34245. // ],
  34246. // "enumDescriptions": [
  34247. // "",
  34248. // ""
  34249. // ],
  34250. // "location": "query",
  34251. // "type": "string"
  34252. // },
  34253. // "placementStrategyIds": {
  34254. // "description": "Select only placement groups that are associated with these placement strategies.",
  34255. // "format": "int64",
  34256. // "location": "query",
  34257. // "repeated": true,
  34258. // "type": "string"
  34259. // },
  34260. // "pricingTypes": {
  34261. // "description": "Select only placement groups with these pricing types.",
  34262. // "enum": [
  34263. // "PRICING_TYPE_CPA",
  34264. // "PRICING_TYPE_CPC",
  34265. // "PRICING_TYPE_CPM",
  34266. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  34267. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  34268. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  34269. // ],
  34270. // "enumDescriptions": [
  34271. // "",
  34272. // "",
  34273. // "",
  34274. // "",
  34275. // "",
  34276. // ""
  34277. // ],
  34278. // "location": "query",
  34279. // "repeated": true,
  34280. // "type": "string"
  34281. // },
  34282. // "profileId": {
  34283. // "description": "User profile ID associated with this request.",
  34284. // "format": "int64",
  34285. // "location": "path",
  34286. // "required": true,
  34287. // "type": "string"
  34288. // },
  34289. // "searchString": {
  34290. // "description": "Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placement groups with names like \"placement group June 2015\", \"placement group May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementgroup\" will match placement groups with name \"my placementgroup\", \"placementgroup 2015\", or simply \"placementgroup\".",
  34291. // "location": "query",
  34292. // "type": "string"
  34293. // },
  34294. // "siteIds": {
  34295. // "description": "Select only placement groups that are associated with these sites.",
  34296. // "format": "int64",
  34297. // "location": "query",
  34298. // "repeated": true,
  34299. // "type": "string"
  34300. // },
  34301. // "sortField": {
  34302. // "default": "ID",
  34303. // "description": "Field by which to sort the list.",
  34304. // "enum": [
  34305. // "ID",
  34306. // "NAME"
  34307. // ],
  34308. // "enumDescriptions": [
  34309. // "",
  34310. // ""
  34311. // ],
  34312. // "location": "query",
  34313. // "type": "string"
  34314. // },
  34315. // "sortOrder": {
  34316. // "default": "ASCENDING",
  34317. // "description": "Order of sorted results.",
  34318. // "enum": [
  34319. // "ASCENDING",
  34320. // "DESCENDING"
  34321. // ],
  34322. // "enumDescriptions": [
  34323. // "",
  34324. // ""
  34325. // ],
  34326. // "location": "query",
  34327. // "type": "string"
  34328. // }
  34329. // },
  34330. // "path": "userprofiles/{profileId}/placementGroups",
  34331. // "response": {
  34332. // "$ref": "PlacementGroupsListResponse"
  34333. // },
  34334. // "scopes": [
  34335. // "https://www.googleapis.com/auth/dfatrafficking"
  34336. // ]
  34337. // }
  34338. }
  34339. // Pages invokes f for each page of results.
  34340. // A non-nil error returned from f will halt the iteration.
  34341. // The provided context supersedes any context provided to the Context method.
  34342. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  34343. c.ctx_ = ctx
  34344. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34345. for {
  34346. x, err := c.Do()
  34347. if err != nil {
  34348. return err
  34349. }
  34350. if err := f(x); err != nil {
  34351. return err
  34352. }
  34353. if x.NextPageToken == "" {
  34354. return nil
  34355. }
  34356. c.PageToken(x.NextPageToken)
  34357. }
  34358. }
  34359. // method id "dfareporting.placementGroups.patch":
  34360. type PlacementGroupsPatchCall struct {
  34361. s *Service
  34362. profileId int64
  34363. placementgroup *PlacementGroup
  34364. urlParams_ gensupport.URLParams
  34365. ctx_ context.Context
  34366. header_ http.Header
  34367. }
  34368. // Patch: Updates an existing placement group. This method supports
  34369. // patch semantics.
  34370. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  34371. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34372. c.profileId = profileId
  34373. c.urlParams_.Set("id", fmt.Sprint(id))
  34374. c.placementgroup = placementgroup
  34375. return c
  34376. }
  34377. // Fields allows partial responses to be retrieved. See
  34378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34379. // for more information.
  34380. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  34381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34382. return c
  34383. }
  34384. // Context sets the context to be used in this call's Do method. Any
  34385. // pending HTTP request will be aborted if the provided context is
  34386. // canceled.
  34387. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  34388. c.ctx_ = ctx
  34389. return c
  34390. }
  34391. // Header returns an http.Header that can be modified by the caller to
  34392. // add HTTP headers to the request.
  34393. func (c *PlacementGroupsPatchCall) Header() http.Header {
  34394. if c.header_ == nil {
  34395. c.header_ = make(http.Header)
  34396. }
  34397. return c.header_
  34398. }
  34399. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  34400. reqHeaders := make(http.Header)
  34401. for k, v := range c.header_ {
  34402. reqHeaders[k] = v
  34403. }
  34404. reqHeaders.Set("User-Agent", c.s.userAgent())
  34405. var body io.Reader = nil
  34406. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34407. if err != nil {
  34408. return nil, err
  34409. }
  34410. reqHeaders.Set("Content-Type", "application/json")
  34411. c.urlParams_.Set("alt", alt)
  34412. c.urlParams_.Set("prettyPrint", "false")
  34413. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34414. urls += "?" + c.urlParams_.Encode()
  34415. req, err := http.NewRequest("PATCH", urls, body)
  34416. if err != nil {
  34417. return nil, err
  34418. }
  34419. req.Header = reqHeaders
  34420. googleapi.Expand(req.URL, map[string]string{
  34421. "profileId": strconv.FormatInt(c.profileId, 10),
  34422. })
  34423. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34424. }
  34425. // Do executes the "dfareporting.placementGroups.patch" call.
  34426. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34427. // status code is an error. Response headers are in either
  34428. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34429. // at all) in error.(*googleapi.Error).Header. Use
  34430. // googleapi.IsNotModified to check whether the returned error was
  34431. // because http.StatusNotModified was returned.
  34432. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34433. gensupport.SetOptions(c.urlParams_, opts...)
  34434. res, err := c.doRequest("json")
  34435. if res != nil && res.StatusCode == http.StatusNotModified {
  34436. if res.Body != nil {
  34437. res.Body.Close()
  34438. }
  34439. return nil, &googleapi.Error{
  34440. Code: res.StatusCode,
  34441. Header: res.Header,
  34442. }
  34443. }
  34444. if err != nil {
  34445. return nil, err
  34446. }
  34447. defer googleapi.CloseBody(res)
  34448. if err := googleapi.CheckResponse(res); err != nil {
  34449. return nil, err
  34450. }
  34451. ret := &PlacementGroup{
  34452. ServerResponse: googleapi.ServerResponse{
  34453. Header: res.Header,
  34454. HTTPStatusCode: res.StatusCode,
  34455. },
  34456. }
  34457. target := &ret
  34458. if err := gensupport.DecodeResponse(target, res); err != nil {
  34459. return nil, err
  34460. }
  34461. return ret, nil
  34462. // {
  34463. // "description": "Updates an existing placement group. This method supports patch semantics.",
  34464. // "httpMethod": "PATCH",
  34465. // "id": "dfareporting.placementGroups.patch",
  34466. // "parameterOrder": [
  34467. // "profileId",
  34468. // "id"
  34469. // ],
  34470. // "parameters": {
  34471. // "id": {
  34472. // "description": "Placement group ID.",
  34473. // "format": "int64",
  34474. // "location": "query",
  34475. // "required": true,
  34476. // "type": "string"
  34477. // },
  34478. // "profileId": {
  34479. // "description": "User profile ID associated with this request.",
  34480. // "format": "int64",
  34481. // "location": "path",
  34482. // "required": true,
  34483. // "type": "string"
  34484. // }
  34485. // },
  34486. // "path": "userprofiles/{profileId}/placementGroups",
  34487. // "request": {
  34488. // "$ref": "PlacementGroup"
  34489. // },
  34490. // "response": {
  34491. // "$ref": "PlacementGroup"
  34492. // },
  34493. // "scopes": [
  34494. // "https://www.googleapis.com/auth/dfatrafficking"
  34495. // ]
  34496. // }
  34497. }
  34498. // method id "dfareporting.placementGroups.update":
  34499. type PlacementGroupsUpdateCall struct {
  34500. s *Service
  34501. profileId int64
  34502. placementgroup *PlacementGroup
  34503. urlParams_ gensupport.URLParams
  34504. ctx_ context.Context
  34505. header_ http.Header
  34506. }
  34507. // Update: Updates an existing placement group.
  34508. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  34509. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34510. c.profileId = profileId
  34511. c.placementgroup = placementgroup
  34512. return c
  34513. }
  34514. // Fields allows partial responses to be retrieved. See
  34515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34516. // for more information.
  34517. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  34518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34519. return c
  34520. }
  34521. // Context sets the context to be used in this call's Do method. Any
  34522. // pending HTTP request will be aborted if the provided context is
  34523. // canceled.
  34524. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  34525. c.ctx_ = ctx
  34526. return c
  34527. }
  34528. // Header returns an http.Header that can be modified by the caller to
  34529. // add HTTP headers to the request.
  34530. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  34531. if c.header_ == nil {
  34532. c.header_ = make(http.Header)
  34533. }
  34534. return c.header_
  34535. }
  34536. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  34537. reqHeaders := make(http.Header)
  34538. for k, v := range c.header_ {
  34539. reqHeaders[k] = v
  34540. }
  34541. reqHeaders.Set("User-Agent", c.s.userAgent())
  34542. var body io.Reader = nil
  34543. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34544. if err != nil {
  34545. return nil, err
  34546. }
  34547. reqHeaders.Set("Content-Type", "application/json")
  34548. c.urlParams_.Set("alt", alt)
  34549. c.urlParams_.Set("prettyPrint", "false")
  34550. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34551. urls += "?" + c.urlParams_.Encode()
  34552. req, err := http.NewRequest("PUT", urls, body)
  34553. if err != nil {
  34554. return nil, err
  34555. }
  34556. req.Header = reqHeaders
  34557. googleapi.Expand(req.URL, map[string]string{
  34558. "profileId": strconv.FormatInt(c.profileId, 10),
  34559. })
  34560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34561. }
  34562. // Do executes the "dfareporting.placementGroups.update" call.
  34563. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34564. // status code is an error. Response headers are in either
  34565. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34566. // at all) in error.(*googleapi.Error).Header. Use
  34567. // googleapi.IsNotModified to check whether the returned error was
  34568. // because http.StatusNotModified was returned.
  34569. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34570. gensupport.SetOptions(c.urlParams_, opts...)
  34571. res, err := c.doRequest("json")
  34572. if res != nil && res.StatusCode == http.StatusNotModified {
  34573. if res.Body != nil {
  34574. res.Body.Close()
  34575. }
  34576. return nil, &googleapi.Error{
  34577. Code: res.StatusCode,
  34578. Header: res.Header,
  34579. }
  34580. }
  34581. if err != nil {
  34582. return nil, err
  34583. }
  34584. defer googleapi.CloseBody(res)
  34585. if err := googleapi.CheckResponse(res); err != nil {
  34586. return nil, err
  34587. }
  34588. ret := &PlacementGroup{
  34589. ServerResponse: googleapi.ServerResponse{
  34590. Header: res.Header,
  34591. HTTPStatusCode: res.StatusCode,
  34592. },
  34593. }
  34594. target := &ret
  34595. if err := gensupport.DecodeResponse(target, res); err != nil {
  34596. return nil, err
  34597. }
  34598. return ret, nil
  34599. // {
  34600. // "description": "Updates an existing placement group.",
  34601. // "httpMethod": "PUT",
  34602. // "id": "dfareporting.placementGroups.update",
  34603. // "parameterOrder": [
  34604. // "profileId"
  34605. // ],
  34606. // "parameters": {
  34607. // "profileId": {
  34608. // "description": "User profile ID associated with this request.",
  34609. // "format": "int64",
  34610. // "location": "path",
  34611. // "required": true,
  34612. // "type": "string"
  34613. // }
  34614. // },
  34615. // "path": "userprofiles/{profileId}/placementGroups",
  34616. // "request": {
  34617. // "$ref": "PlacementGroup"
  34618. // },
  34619. // "response": {
  34620. // "$ref": "PlacementGroup"
  34621. // },
  34622. // "scopes": [
  34623. // "https://www.googleapis.com/auth/dfatrafficking"
  34624. // ]
  34625. // }
  34626. }
  34627. // method id "dfareporting.placementStrategies.delete":
  34628. type PlacementStrategiesDeleteCall struct {
  34629. s *Service
  34630. profileId int64
  34631. id int64
  34632. urlParams_ gensupport.URLParams
  34633. ctx_ context.Context
  34634. header_ http.Header
  34635. }
  34636. // Delete: Deletes an existing placement strategy.
  34637. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  34638. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34639. c.profileId = profileId
  34640. c.id = id
  34641. return c
  34642. }
  34643. // Fields allows partial responses to be retrieved. See
  34644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34645. // for more information.
  34646. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  34647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34648. return c
  34649. }
  34650. // Context sets the context to be used in this call's Do method. Any
  34651. // pending HTTP request will be aborted if the provided context is
  34652. // canceled.
  34653. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  34654. c.ctx_ = ctx
  34655. return c
  34656. }
  34657. // Header returns an http.Header that can be modified by the caller to
  34658. // add HTTP headers to the request.
  34659. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  34660. if c.header_ == nil {
  34661. c.header_ = make(http.Header)
  34662. }
  34663. return c.header_
  34664. }
  34665. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  34666. reqHeaders := make(http.Header)
  34667. for k, v := range c.header_ {
  34668. reqHeaders[k] = v
  34669. }
  34670. reqHeaders.Set("User-Agent", c.s.userAgent())
  34671. var body io.Reader = nil
  34672. c.urlParams_.Set("alt", alt)
  34673. c.urlParams_.Set("prettyPrint", "false")
  34674. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34675. urls += "?" + c.urlParams_.Encode()
  34676. req, err := http.NewRequest("DELETE", urls, body)
  34677. if err != nil {
  34678. return nil, err
  34679. }
  34680. req.Header = reqHeaders
  34681. googleapi.Expand(req.URL, map[string]string{
  34682. "profileId": strconv.FormatInt(c.profileId, 10),
  34683. "id": strconv.FormatInt(c.id, 10),
  34684. })
  34685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34686. }
  34687. // Do executes the "dfareporting.placementStrategies.delete" call.
  34688. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  34689. gensupport.SetOptions(c.urlParams_, opts...)
  34690. res, err := c.doRequest("json")
  34691. if err != nil {
  34692. return err
  34693. }
  34694. defer googleapi.CloseBody(res)
  34695. if err := googleapi.CheckResponse(res); err != nil {
  34696. return err
  34697. }
  34698. return nil
  34699. // {
  34700. // "description": "Deletes an existing placement strategy.",
  34701. // "httpMethod": "DELETE",
  34702. // "id": "dfareporting.placementStrategies.delete",
  34703. // "parameterOrder": [
  34704. // "profileId",
  34705. // "id"
  34706. // ],
  34707. // "parameters": {
  34708. // "id": {
  34709. // "description": "Placement strategy ID.",
  34710. // "format": "int64",
  34711. // "location": "path",
  34712. // "required": true,
  34713. // "type": "string"
  34714. // },
  34715. // "profileId": {
  34716. // "description": "User profile ID associated with this request.",
  34717. // "format": "int64",
  34718. // "location": "path",
  34719. // "required": true,
  34720. // "type": "string"
  34721. // }
  34722. // },
  34723. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34724. // "scopes": [
  34725. // "https://www.googleapis.com/auth/dfatrafficking"
  34726. // ]
  34727. // }
  34728. }
  34729. // method id "dfareporting.placementStrategies.get":
  34730. type PlacementStrategiesGetCall struct {
  34731. s *Service
  34732. profileId int64
  34733. id int64
  34734. urlParams_ gensupport.URLParams
  34735. ifNoneMatch_ string
  34736. ctx_ context.Context
  34737. header_ http.Header
  34738. }
  34739. // Get: Gets one placement strategy by ID.
  34740. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  34741. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34742. c.profileId = profileId
  34743. c.id = id
  34744. return c
  34745. }
  34746. // Fields allows partial responses to be retrieved. See
  34747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34748. // for more information.
  34749. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  34750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34751. return c
  34752. }
  34753. // IfNoneMatch sets the optional parameter which makes the operation
  34754. // fail if the object's ETag matches the given value. This is useful for
  34755. // getting updates only after the object has changed since the last
  34756. // request. Use googleapi.IsNotModified to check whether the response
  34757. // error from Do is the result of In-None-Match.
  34758. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  34759. c.ifNoneMatch_ = entityTag
  34760. return c
  34761. }
  34762. // Context sets the context to be used in this call's Do method. Any
  34763. // pending HTTP request will be aborted if the provided context is
  34764. // canceled.
  34765. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  34766. c.ctx_ = ctx
  34767. return c
  34768. }
  34769. // Header returns an http.Header that can be modified by the caller to
  34770. // add HTTP headers to the request.
  34771. func (c *PlacementStrategiesGetCall) Header() http.Header {
  34772. if c.header_ == nil {
  34773. c.header_ = make(http.Header)
  34774. }
  34775. return c.header_
  34776. }
  34777. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  34778. reqHeaders := make(http.Header)
  34779. for k, v := range c.header_ {
  34780. reqHeaders[k] = v
  34781. }
  34782. reqHeaders.Set("User-Agent", c.s.userAgent())
  34783. if c.ifNoneMatch_ != "" {
  34784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34785. }
  34786. var body io.Reader = nil
  34787. c.urlParams_.Set("alt", alt)
  34788. c.urlParams_.Set("prettyPrint", "false")
  34789. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34790. urls += "?" + c.urlParams_.Encode()
  34791. req, err := http.NewRequest("GET", urls, body)
  34792. if err != nil {
  34793. return nil, err
  34794. }
  34795. req.Header = reqHeaders
  34796. googleapi.Expand(req.URL, map[string]string{
  34797. "profileId": strconv.FormatInt(c.profileId, 10),
  34798. "id": strconv.FormatInt(c.id, 10),
  34799. })
  34800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34801. }
  34802. // Do executes the "dfareporting.placementStrategies.get" call.
  34803. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34804. // non-2xx status code is an error. Response headers are in either
  34805. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34806. // returned at all) in error.(*googleapi.Error).Header. Use
  34807. // googleapi.IsNotModified to check whether the returned error was
  34808. // because http.StatusNotModified was returned.
  34809. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34810. gensupport.SetOptions(c.urlParams_, opts...)
  34811. res, err := c.doRequest("json")
  34812. if res != nil && res.StatusCode == http.StatusNotModified {
  34813. if res.Body != nil {
  34814. res.Body.Close()
  34815. }
  34816. return nil, &googleapi.Error{
  34817. Code: res.StatusCode,
  34818. Header: res.Header,
  34819. }
  34820. }
  34821. if err != nil {
  34822. return nil, err
  34823. }
  34824. defer googleapi.CloseBody(res)
  34825. if err := googleapi.CheckResponse(res); err != nil {
  34826. return nil, err
  34827. }
  34828. ret := &PlacementStrategy{
  34829. ServerResponse: googleapi.ServerResponse{
  34830. Header: res.Header,
  34831. HTTPStatusCode: res.StatusCode,
  34832. },
  34833. }
  34834. target := &ret
  34835. if err := gensupport.DecodeResponse(target, res); err != nil {
  34836. return nil, err
  34837. }
  34838. return ret, nil
  34839. // {
  34840. // "description": "Gets one placement strategy by ID.",
  34841. // "httpMethod": "GET",
  34842. // "id": "dfareporting.placementStrategies.get",
  34843. // "parameterOrder": [
  34844. // "profileId",
  34845. // "id"
  34846. // ],
  34847. // "parameters": {
  34848. // "id": {
  34849. // "description": "Placement strategy ID.",
  34850. // "format": "int64",
  34851. // "location": "path",
  34852. // "required": true,
  34853. // "type": "string"
  34854. // },
  34855. // "profileId": {
  34856. // "description": "User profile ID associated with this request.",
  34857. // "format": "int64",
  34858. // "location": "path",
  34859. // "required": true,
  34860. // "type": "string"
  34861. // }
  34862. // },
  34863. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34864. // "response": {
  34865. // "$ref": "PlacementStrategy"
  34866. // },
  34867. // "scopes": [
  34868. // "https://www.googleapis.com/auth/dfatrafficking"
  34869. // ]
  34870. // }
  34871. }
  34872. // method id "dfareporting.placementStrategies.insert":
  34873. type PlacementStrategiesInsertCall struct {
  34874. s *Service
  34875. profileId int64
  34876. placementstrategy *PlacementStrategy
  34877. urlParams_ gensupport.URLParams
  34878. ctx_ context.Context
  34879. header_ http.Header
  34880. }
  34881. // Insert: Inserts a new placement strategy.
  34882. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  34883. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34884. c.profileId = profileId
  34885. c.placementstrategy = placementstrategy
  34886. return c
  34887. }
  34888. // Fields allows partial responses to be retrieved. See
  34889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34890. // for more information.
  34891. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  34892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34893. return c
  34894. }
  34895. // Context sets the context to be used in this call's Do method. Any
  34896. // pending HTTP request will be aborted if the provided context is
  34897. // canceled.
  34898. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  34899. c.ctx_ = ctx
  34900. return c
  34901. }
  34902. // Header returns an http.Header that can be modified by the caller to
  34903. // add HTTP headers to the request.
  34904. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  34905. if c.header_ == nil {
  34906. c.header_ = make(http.Header)
  34907. }
  34908. return c.header_
  34909. }
  34910. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  34911. reqHeaders := make(http.Header)
  34912. for k, v := range c.header_ {
  34913. reqHeaders[k] = v
  34914. }
  34915. reqHeaders.Set("User-Agent", c.s.userAgent())
  34916. var body io.Reader = nil
  34917. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34918. if err != nil {
  34919. return nil, err
  34920. }
  34921. reqHeaders.Set("Content-Type", "application/json")
  34922. c.urlParams_.Set("alt", alt)
  34923. c.urlParams_.Set("prettyPrint", "false")
  34924. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34925. urls += "?" + c.urlParams_.Encode()
  34926. req, err := http.NewRequest("POST", urls, body)
  34927. if err != nil {
  34928. return nil, err
  34929. }
  34930. req.Header = reqHeaders
  34931. googleapi.Expand(req.URL, map[string]string{
  34932. "profileId": strconv.FormatInt(c.profileId, 10),
  34933. })
  34934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34935. }
  34936. // Do executes the "dfareporting.placementStrategies.insert" call.
  34937. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34938. // non-2xx status code is an error. Response headers are in either
  34939. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34940. // returned at all) in error.(*googleapi.Error).Header. Use
  34941. // googleapi.IsNotModified to check whether the returned error was
  34942. // because http.StatusNotModified was returned.
  34943. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34944. gensupport.SetOptions(c.urlParams_, opts...)
  34945. res, err := c.doRequest("json")
  34946. if res != nil && res.StatusCode == http.StatusNotModified {
  34947. if res.Body != nil {
  34948. res.Body.Close()
  34949. }
  34950. return nil, &googleapi.Error{
  34951. Code: res.StatusCode,
  34952. Header: res.Header,
  34953. }
  34954. }
  34955. if err != nil {
  34956. return nil, err
  34957. }
  34958. defer googleapi.CloseBody(res)
  34959. if err := googleapi.CheckResponse(res); err != nil {
  34960. return nil, err
  34961. }
  34962. ret := &PlacementStrategy{
  34963. ServerResponse: googleapi.ServerResponse{
  34964. Header: res.Header,
  34965. HTTPStatusCode: res.StatusCode,
  34966. },
  34967. }
  34968. target := &ret
  34969. if err := gensupport.DecodeResponse(target, res); err != nil {
  34970. return nil, err
  34971. }
  34972. return ret, nil
  34973. // {
  34974. // "description": "Inserts a new placement strategy.",
  34975. // "httpMethod": "POST",
  34976. // "id": "dfareporting.placementStrategies.insert",
  34977. // "parameterOrder": [
  34978. // "profileId"
  34979. // ],
  34980. // "parameters": {
  34981. // "profileId": {
  34982. // "description": "User profile ID associated with this request.",
  34983. // "format": "int64",
  34984. // "location": "path",
  34985. // "required": true,
  34986. // "type": "string"
  34987. // }
  34988. // },
  34989. // "path": "userprofiles/{profileId}/placementStrategies",
  34990. // "request": {
  34991. // "$ref": "PlacementStrategy"
  34992. // },
  34993. // "response": {
  34994. // "$ref": "PlacementStrategy"
  34995. // },
  34996. // "scopes": [
  34997. // "https://www.googleapis.com/auth/dfatrafficking"
  34998. // ]
  34999. // }
  35000. }
  35001. // method id "dfareporting.placementStrategies.list":
  35002. type PlacementStrategiesListCall struct {
  35003. s *Service
  35004. profileId int64
  35005. urlParams_ gensupport.URLParams
  35006. ifNoneMatch_ string
  35007. ctx_ context.Context
  35008. header_ http.Header
  35009. }
  35010. // List: Retrieves a list of placement strategies, possibly filtered.
  35011. // This method supports paging.
  35012. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  35013. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35014. c.profileId = profileId
  35015. return c
  35016. }
  35017. // Ids sets the optional parameter "ids": Select only placement
  35018. // strategies with these IDs.
  35019. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  35020. var ids_ []string
  35021. for _, v := range ids {
  35022. ids_ = append(ids_, fmt.Sprint(v))
  35023. }
  35024. c.urlParams_.SetMulti("ids", ids_)
  35025. return c
  35026. }
  35027. // MaxResults sets the optional parameter "maxResults": Maximum number
  35028. // of results to return.
  35029. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  35030. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35031. return c
  35032. }
  35033. // PageToken sets the optional parameter "pageToken": Value of the
  35034. // nextPageToken from the previous result page.
  35035. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  35036. c.urlParams_.Set("pageToken", pageToken)
  35037. return c
  35038. }
  35039. // SearchString sets the optional parameter "searchString": Allows
  35040. // searching for objects by name or ID. Wildcards (*) are allowed. For
  35041. // example, "placementstrategy*2015" will return objects with names like
  35042. // "placementstrategy June 2015", "placementstrategy April 2015", or
  35043. // simply "placementstrategy 2015". Most of the searches also add
  35044. // wildcards implicitly at the start and the end of the search string.
  35045. // For example, a search string of "placementstrategy" will match
  35046. // objects with name "my placementstrategy", "placementstrategy 2015",
  35047. // or simply "placementstrategy".
  35048. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  35049. c.urlParams_.Set("searchString", searchString)
  35050. return c
  35051. }
  35052. // SortField sets the optional parameter "sortField": Field by which to
  35053. // sort the list.
  35054. //
  35055. // Possible values:
  35056. // "ID" (default)
  35057. // "NAME"
  35058. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  35059. c.urlParams_.Set("sortField", sortField)
  35060. return c
  35061. }
  35062. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35063. // results.
  35064. //
  35065. // Possible values:
  35066. // "ASCENDING" (default)
  35067. // "DESCENDING"
  35068. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  35069. c.urlParams_.Set("sortOrder", sortOrder)
  35070. return c
  35071. }
  35072. // Fields allows partial responses to be retrieved. See
  35073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35074. // for more information.
  35075. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  35076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35077. return c
  35078. }
  35079. // IfNoneMatch sets the optional parameter which makes the operation
  35080. // fail if the object's ETag matches the given value. This is useful for
  35081. // getting updates only after the object has changed since the last
  35082. // request. Use googleapi.IsNotModified to check whether the response
  35083. // error from Do is the result of In-None-Match.
  35084. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  35085. c.ifNoneMatch_ = entityTag
  35086. return c
  35087. }
  35088. // Context sets the context to be used in this call's Do method. Any
  35089. // pending HTTP request will be aborted if the provided context is
  35090. // canceled.
  35091. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  35092. c.ctx_ = ctx
  35093. return c
  35094. }
  35095. // Header returns an http.Header that can be modified by the caller to
  35096. // add HTTP headers to the request.
  35097. func (c *PlacementStrategiesListCall) Header() http.Header {
  35098. if c.header_ == nil {
  35099. c.header_ = make(http.Header)
  35100. }
  35101. return c.header_
  35102. }
  35103. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  35104. reqHeaders := make(http.Header)
  35105. for k, v := range c.header_ {
  35106. reqHeaders[k] = v
  35107. }
  35108. reqHeaders.Set("User-Agent", c.s.userAgent())
  35109. if c.ifNoneMatch_ != "" {
  35110. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35111. }
  35112. var body io.Reader = nil
  35113. c.urlParams_.Set("alt", alt)
  35114. c.urlParams_.Set("prettyPrint", "false")
  35115. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35116. urls += "?" + c.urlParams_.Encode()
  35117. req, err := http.NewRequest("GET", urls, body)
  35118. if err != nil {
  35119. return nil, err
  35120. }
  35121. req.Header = reqHeaders
  35122. googleapi.Expand(req.URL, map[string]string{
  35123. "profileId": strconv.FormatInt(c.profileId, 10),
  35124. })
  35125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35126. }
  35127. // Do executes the "dfareporting.placementStrategies.list" call.
  35128. // Exactly one of *PlacementStrategiesListResponse or error will be
  35129. // non-nil. Any non-2xx status code is an error. Response headers are in
  35130. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  35131. // a response was returned at all) in error.(*googleapi.Error).Header.
  35132. // Use googleapi.IsNotModified to check whether the returned error was
  35133. // because http.StatusNotModified was returned.
  35134. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  35135. gensupport.SetOptions(c.urlParams_, opts...)
  35136. res, err := c.doRequest("json")
  35137. if res != nil && res.StatusCode == http.StatusNotModified {
  35138. if res.Body != nil {
  35139. res.Body.Close()
  35140. }
  35141. return nil, &googleapi.Error{
  35142. Code: res.StatusCode,
  35143. Header: res.Header,
  35144. }
  35145. }
  35146. if err != nil {
  35147. return nil, err
  35148. }
  35149. defer googleapi.CloseBody(res)
  35150. if err := googleapi.CheckResponse(res); err != nil {
  35151. return nil, err
  35152. }
  35153. ret := &PlacementStrategiesListResponse{
  35154. ServerResponse: googleapi.ServerResponse{
  35155. Header: res.Header,
  35156. HTTPStatusCode: res.StatusCode,
  35157. },
  35158. }
  35159. target := &ret
  35160. if err := gensupport.DecodeResponse(target, res); err != nil {
  35161. return nil, err
  35162. }
  35163. return ret, nil
  35164. // {
  35165. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  35166. // "httpMethod": "GET",
  35167. // "id": "dfareporting.placementStrategies.list",
  35168. // "parameterOrder": [
  35169. // "profileId"
  35170. // ],
  35171. // "parameters": {
  35172. // "ids": {
  35173. // "description": "Select only placement strategies with these IDs.",
  35174. // "format": "int64",
  35175. // "location": "query",
  35176. // "repeated": true,
  35177. // "type": "string"
  35178. // },
  35179. // "maxResults": {
  35180. // "default": "1000",
  35181. // "description": "Maximum number of results to return.",
  35182. // "format": "int32",
  35183. // "location": "query",
  35184. // "maximum": "1000",
  35185. // "minimum": "0",
  35186. // "type": "integer"
  35187. // },
  35188. // "pageToken": {
  35189. // "description": "Value of the nextPageToken from the previous result page.",
  35190. // "location": "query",
  35191. // "type": "string"
  35192. // },
  35193. // "profileId": {
  35194. // "description": "User profile ID associated with this request.",
  35195. // "format": "int64",
  35196. // "location": "path",
  35197. // "required": true,
  35198. // "type": "string"
  35199. // },
  35200. // "searchString": {
  35201. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"placementstrategy*2015\" will return objects with names like \"placementstrategy June 2015\", \"placementstrategy April 2015\", or simply \"placementstrategy 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placementstrategy\" will match objects with name \"my placementstrategy\", \"placementstrategy 2015\", or simply \"placementstrategy\".",
  35202. // "location": "query",
  35203. // "type": "string"
  35204. // },
  35205. // "sortField": {
  35206. // "default": "ID",
  35207. // "description": "Field by which to sort the list.",
  35208. // "enum": [
  35209. // "ID",
  35210. // "NAME"
  35211. // ],
  35212. // "enumDescriptions": [
  35213. // "",
  35214. // ""
  35215. // ],
  35216. // "location": "query",
  35217. // "type": "string"
  35218. // },
  35219. // "sortOrder": {
  35220. // "default": "ASCENDING",
  35221. // "description": "Order of sorted results.",
  35222. // "enum": [
  35223. // "ASCENDING",
  35224. // "DESCENDING"
  35225. // ],
  35226. // "enumDescriptions": [
  35227. // "",
  35228. // ""
  35229. // ],
  35230. // "location": "query",
  35231. // "type": "string"
  35232. // }
  35233. // },
  35234. // "path": "userprofiles/{profileId}/placementStrategies",
  35235. // "response": {
  35236. // "$ref": "PlacementStrategiesListResponse"
  35237. // },
  35238. // "scopes": [
  35239. // "https://www.googleapis.com/auth/dfatrafficking"
  35240. // ]
  35241. // }
  35242. }
  35243. // Pages invokes f for each page of results.
  35244. // A non-nil error returned from f will halt the iteration.
  35245. // The provided context supersedes any context provided to the Context method.
  35246. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  35247. c.ctx_ = ctx
  35248. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35249. for {
  35250. x, err := c.Do()
  35251. if err != nil {
  35252. return err
  35253. }
  35254. if err := f(x); err != nil {
  35255. return err
  35256. }
  35257. if x.NextPageToken == "" {
  35258. return nil
  35259. }
  35260. c.PageToken(x.NextPageToken)
  35261. }
  35262. }
  35263. // method id "dfareporting.placementStrategies.patch":
  35264. type PlacementStrategiesPatchCall struct {
  35265. s *Service
  35266. profileId int64
  35267. placementstrategy *PlacementStrategy
  35268. urlParams_ gensupport.URLParams
  35269. ctx_ context.Context
  35270. header_ http.Header
  35271. }
  35272. // Patch: Updates an existing placement strategy. This method supports
  35273. // patch semantics.
  35274. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  35275. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35276. c.profileId = profileId
  35277. c.urlParams_.Set("id", fmt.Sprint(id))
  35278. c.placementstrategy = placementstrategy
  35279. return c
  35280. }
  35281. // Fields allows partial responses to be retrieved. See
  35282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35283. // for more information.
  35284. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  35285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35286. return c
  35287. }
  35288. // Context sets the context to be used in this call's Do method. Any
  35289. // pending HTTP request will be aborted if the provided context is
  35290. // canceled.
  35291. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  35292. c.ctx_ = ctx
  35293. return c
  35294. }
  35295. // Header returns an http.Header that can be modified by the caller to
  35296. // add HTTP headers to the request.
  35297. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  35298. if c.header_ == nil {
  35299. c.header_ = make(http.Header)
  35300. }
  35301. return c.header_
  35302. }
  35303. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  35304. reqHeaders := make(http.Header)
  35305. for k, v := range c.header_ {
  35306. reqHeaders[k] = v
  35307. }
  35308. reqHeaders.Set("User-Agent", c.s.userAgent())
  35309. var body io.Reader = nil
  35310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35311. if err != nil {
  35312. return nil, err
  35313. }
  35314. reqHeaders.Set("Content-Type", "application/json")
  35315. c.urlParams_.Set("alt", alt)
  35316. c.urlParams_.Set("prettyPrint", "false")
  35317. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35318. urls += "?" + c.urlParams_.Encode()
  35319. req, err := http.NewRequest("PATCH", urls, body)
  35320. if err != nil {
  35321. return nil, err
  35322. }
  35323. req.Header = reqHeaders
  35324. googleapi.Expand(req.URL, map[string]string{
  35325. "profileId": strconv.FormatInt(c.profileId, 10),
  35326. })
  35327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35328. }
  35329. // Do executes the "dfareporting.placementStrategies.patch" call.
  35330. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35331. // non-2xx status code is an error. Response headers are in either
  35332. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35333. // returned at all) in error.(*googleapi.Error).Header. Use
  35334. // googleapi.IsNotModified to check whether the returned error was
  35335. // because http.StatusNotModified was returned.
  35336. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35337. gensupport.SetOptions(c.urlParams_, opts...)
  35338. res, err := c.doRequest("json")
  35339. if res != nil && res.StatusCode == http.StatusNotModified {
  35340. if res.Body != nil {
  35341. res.Body.Close()
  35342. }
  35343. return nil, &googleapi.Error{
  35344. Code: res.StatusCode,
  35345. Header: res.Header,
  35346. }
  35347. }
  35348. if err != nil {
  35349. return nil, err
  35350. }
  35351. defer googleapi.CloseBody(res)
  35352. if err := googleapi.CheckResponse(res); err != nil {
  35353. return nil, err
  35354. }
  35355. ret := &PlacementStrategy{
  35356. ServerResponse: googleapi.ServerResponse{
  35357. Header: res.Header,
  35358. HTTPStatusCode: res.StatusCode,
  35359. },
  35360. }
  35361. target := &ret
  35362. if err := gensupport.DecodeResponse(target, res); err != nil {
  35363. return nil, err
  35364. }
  35365. return ret, nil
  35366. // {
  35367. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  35368. // "httpMethod": "PATCH",
  35369. // "id": "dfareporting.placementStrategies.patch",
  35370. // "parameterOrder": [
  35371. // "profileId",
  35372. // "id"
  35373. // ],
  35374. // "parameters": {
  35375. // "id": {
  35376. // "description": "Placement strategy ID.",
  35377. // "format": "int64",
  35378. // "location": "query",
  35379. // "required": true,
  35380. // "type": "string"
  35381. // },
  35382. // "profileId": {
  35383. // "description": "User profile ID associated with this request.",
  35384. // "format": "int64",
  35385. // "location": "path",
  35386. // "required": true,
  35387. // "type": "string"
  35388. // }
  35389. // },
  35390. // "path": "userprofiles/{profileId}/placementStrategies",
  35391. // "request": {
  35392. // "$ref": "PlacementStrategy"
  35393. // },
  35394. // "response": {
  35395. // "$ref": "PlacementStrategy"
  35396. // },
  35397. // "scopes": [
  35398. // "https://www.googleapis.com/auth/dfatrafficking"
  35399. // ]
  35400. // }
  35401. }
  35402. // method id "dfareporting.placementStrategies.update":
  35403. type PlacementStrategiesUpdateCall struct {
  35404. s *Service
  35405. profileId int64
  35406. placementstrategy *PlacementStrategy
  35407. urlParams_ gensupport.URLParams
  35408. ctx_ context.Context
  35409. header_ http.Header
  35410. }
  35411. // Update: Updates an existing placement strategy.
  35412. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  35413. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35414. c.profileId = profileId
  35415. c.placementstrategy = placementstrategy
  35416. return c
  35417. }
  35418. // Fields allows partial responses to be retrieved. See
  35419. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35420. // for more information.
  35421. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  35422. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35423. return c
  35424. }
  35425. // Context sets the context to be used in this call's Do method. Any
  35426. // pending HTTP request will be aborted if the provided context is
  35427. // canceled.
  35428. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  35429. c.ctx_ = ctx
  35430. return c
  35431. }
  35432. // Header returns an http.Header that can be modified by the caller to
  35433. // add HTTP headers to the request.
  35434. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  35435. if c.header_ == nil {
  35436. c.header_ = make(http.Header)
  35437. }
  35438. return c.header_
  35439. }
  35440. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  35441. reqHeaders := make(http.Header)
  35442. for k, v := range c.header_ {
  35443. reqHeaders[k] = v
  35444. }
  35445. reqHeaders.Set("User-Agent", c.s.userAgent())
  35446. var body io.Reader = nil
  35447. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  35448. if err != nil {
  35449. return nil, err
  35450. }
  35451. reqHeaders.Set("Content-Type", "application/json")
  35452. c.urlParams_.Set("alt", alt)
  35453. c.urlParams_.Set("prettyPrint", "false")
  35454. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  35455. urls += "?" + c.urlParams_.Encode()
  35456. req, err := http.NewRequest("PUT", urls, body)
  35457. if err != nil {
  35458. return nil, err
  35459. }
  35460. req.Header = reqHeaders
  35461. googleapi.Expand(req.URL, map[string]string{
  35462. "profileId": strconv.FormatInt(c.profileId, 10),
  35463. })
  35464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35465. }
  35466. // Do executes the "dfareporting.placementStrategies.update" call.
  35467. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  35468. // non-2xx status code is an error. Response headers are in either
  35469. // *PlacementStrategy.ServerResponse.Header or (if a response was
  35470. // returned at all) in error.(*googleapi.Error).Header. Use
  35471. // googleapi.IsNotModified to check whether the returned error was
  35472. // because http.StatusNotModified was returned.
  35473. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  35474. gensupport.SetOptions(c.urlParams_, opts...)
  35475. res, err := c.doRequest("json")
  35476. if res != nil && res.StatusCode == http.StatusNotModified {
  35477. if res.Body != nil {
  35478. res.Body.Close()
  35479. }
  35480. return nil, &googleapi.Error{
  35481. Code: res.StatusCode,
  35482. Header: res.Header,
  35483. }
  35484. }
  35485. if err != nil {
  35486. return nil, err
  35487. }
  35488. defer googleapi.CloseBody(res)
  35489. if err := googleapi.CheckResponse(res); err != nil {
  35490. return nil, err
  35491. }
  35492. ret := &PlacementStrategy{
  35493. ServerResponse: googleapi.ServerResponse{
  35494. Header: res.Header,
  35495. HTTPStatusCode: res.StatusCode,
  35496. },
  35497. }
  35498. target := &ret
  35499. if err := gensupport.DecodeResponse(target, res); err != nil {
  35500. return nil, err
  35501. }
  35502. return ret, nil
  35503. // {
  35504. // "description": "Updates an existing placement strategy.",
  35505. // "httpMethod": "PUT",
  35506. // "id": "dfareporting.placementStrategies.update",
  35507. // "parameterOrder": [
  35508. // "profileId"
  35509. // ],
  35510. // "parameters": {
  35511. // "profileId": {
  35512. // "description": "User profile ID associated with this request.",
  35513. // "format": "int64",
  35514. // "location": "path",
  35515. // "required": true,
  35516. // "type": "string"
  35517. // }
  35518. // },
  35519. // "path": "userprofiles/{profileId}/placementStrategies",
  35520. // "request": {
  35521. // "$ref": "PlacementStrategy"
  35522. // },
  35523. // "response": {
  35524. // "$ref": "PlacementStrategy"
  35525. // },
  35526. // "scopes": [
  35527. // "https://www.googleapis.com/auth/dfatrafficking"
  35528. // ]
  35529. // }
  35530. }
  35531. // method id "dfareporting.placements.generatetags":
  35532. type PlacementsGeneratetagsCall struct {
  35533. s *Service
  35534. profileId int64
  35535. urlParams_ gensupport.URLParams
  35536. ctx_ context.Context
  35537. header_ http.Header
  35538. }
  35539. // Generatetags: Generates tags for a placement.
  35540. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  35541. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35542. c.profileId = profileId
  35543. return c
  35544. }
  35545. // CampaignId sets the optional parameter "campaignId": Generate
  35546. // placements belonging to this campaign. This is a required field.
  35547. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  35548. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  35549. return c
  35550. }
  35551. // PlacementIds sets the optional parameter "placementIds": Generate
  35552. // tags for these placements.
  35553. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  35554. var placementIds_ []string
  35555. for _, v := range placementIds {
  35556. placementIds_ = append(placementIds_, fmt.Sprint(v))
  35557. }
  35558. c.urlParams_.SetMulti("placementIds", placementIds_)
  35559. return c
  35560. }
  35561. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  35562. // generate for these placements.
  35563. //
  35564. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  35565. // placements.
  35566. //
  35567. // Possible values:
  35568. // "PLACEMENT_TAG_CLICK_COMMANDS"
  35569. // "PLACEMENT_TAG_IFRAME_ILAYER"
  35570. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  35571. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  35572. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  35573. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  35574. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  35575. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  35576. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  35577. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  35578. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  35579. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  35580. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  35581. // "PLACEMENT_TAG_JAVASCRIPT"
  35582. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  35583. // "PLACEMENT_TAG_STANDARD"
  35584. // "PLACEMENT_TAG_TRACKING"
  35585. // "PLACEMENT_TAG_TRACKING_IFRAME"
  35586. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35587. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  35588. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  35589. return c
  35590. }
  35591. // Fields allows partial responses to be retrieved. See
  35592. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35593. // for more information.
  35594. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  35595. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35596. return c
  35597. }
  35598. // Context sets the context to be used in this call's Do method. Any
  35599. // pending HTTP request will be aborted if the provided context is
  35600. // canceled.
  35601. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  35602. c.ctx_ = ctx
  35603. return c
  35604. }
  35605. // Header returns an http.Header that can be modified by the caller to
  35606. // add HTTP headers to the request.
  35607. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  35608. if c.header_ == nil {
  35609. c.header_ = make(http.Header)
  35610. }
  35611. return c.header_
  35612. }
  35613. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  35614. reqHeaders := make(http.Header)
  35615. for k, v := range c.header_ {
  35616. reqHeaders[k] = v
  35617. }
  35618. reqHeaders.Set("User-Agent", c.s.userAgent())
  35619. var body io.Reader = nil
  35620. c.urlParams_.Set("alt", alt)
  35621. c.urlParams_.Set("prettyPrint", "false")
  35622. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  35623. urls += "?" + c.urlParams_.Encode()
  35624. req, err := http.NewRequest("POST", urls, body)
  35625. if err != nil {
  35626. return nil, err
  35627. }
  35628. req.Header = reqHeaders
  35629. googleapi.Expand(req.URL, map[string]string{
  35630. "profileId": strconv.FormatInt(c.profileId, 10),
  35631. })
  35632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35633. }
  35634. // Do executes the "dfareporting.placements.generatetags" call.
  35635. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  35636. // non-nil. Any non-2xx status code is an error. Response headers are in
  35637. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  35638. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35639. // googleapi.IsNotModified to check whether the returned error was
  35640. // because http.StatusNotModified was returned.
  35641. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  35642. gensupport.SetOptions(c.urlParams_, opts...)
  35643. res, err := c.doRequest("json")
  35644. if res != nil && res.StatusCode == http.StatusNotModified {
  35645. if res.Body != nil {
  35646. res.Body.Close()
  35647. }
  35648. return nil, &googleapi.Error{
  35649. Code: res.StatusCode,
  35650. Header: res.Header,
  35651. }
  35652. }
  35653. if err != nil {
  35654. return nil, err
  35655. }
  35656. defer googleapi.CloseBody(res)
  35657. if err := googleapi.CheckResponse(res); err != nil {
  35658. return nil, err
  35659. }
  35660. ret := &PlacementsGenerateTagsResponse{
  35661. ServerResponse: googleapi.ServerResponse{
  35662. Header: res.Header,
  35663. HTTPStatusCode: res.StatusCode,
  35664. },
  35665. }
  35666. target := &ret
  35667. if err := gensupport.DecodeResponse(target, res); err != nil {
  35668. return nil, err
  35669. }
  35670. return ret, nil
  35671. // {
  35672. // "description": "Generates tags for a placement.",
  35673. // "httpMethod": "POST",
  35674. // "id": "dfareporting.placements.generatetags",
  35675. // "parameterOrder": [
  35676. // "profileId"
  35677. // ],
  35678. // "parameters": {
  35679. // "campaignId": {
  35680. // "description": "Generate placements belonging to this campaign. This is a required field.",
  35681. // "format": "int64",
  35682. // "location": "query",
  35683. // "type": "string"
  35684. // },
  35685. // "placementIds": {
  35686. // "description": "Generate tags for these placements.",
  35687. // "format": "int64",
  35688. // "location": "query",
  35689. // "repeated": true,
  35690. // "type": "string"
  35691. // },
  35692. // "profileId": {
  35693. // "description": "User profile ID associated with this request.",
  35694. // "format": "int64",
  35695. // "location": "path",
  35696. // "required": true,
  35697. // "type": "string"
  35698. // },
  35699. // "tagFormats": {
  35700. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  35701. // "enum": [
  35702. // "PLACEMENT_TAG_CLICK_COMMANDS",
  35703. // "PLACEMENT_TAG_IFRAME_ILAYER",
  35704. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  35705. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  35706. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  35707. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  35708. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  35709. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  35710. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  35711. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  35712. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  35713. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  35714. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  35715. // "PLACEMENT_TAG_JAVASCRIPT",
  35716. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  35717. // "PLACEMENT_TAG_STANDARD",
  35718. // "PLACEMENT_TAG_TRACKING",
  35719. // "PLACEMENT_TAG_TRACKING_IFRAME",
  35720. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35721. // ],
  35722. // "enumDescriptions": [
  35723. // "",
  35724. // "",
  35725. // "",
  35726. // "",
  35727. // "",
  35728. // "",
  35729. // "",
  35730. // "",
  35731. // "",
  35732. // "",
  35733. // "",
  35734. // "",
  35735. // "",
  35736. // "",
  35737. // "",
  35738. // "",
  35739. // "",
  35740. // "",
  35741. // ""
  35742. // ],
  35743. // "location": "query",
  35744. // "repeated": true,
  35745. // "type": "string"
  35746. // }
  35747. // },
  35748. // "path": "userprofiles/{profileId}/placements/generatetags",
  35749. // "response": {
  35750. // "$ref": "PlacementsGenerateTagsResponse"
  35751. // },
  35752. // "scopes": [
  35753. // "https://www.googleapis.com/auth/dfatrafficking"
  35754. // ]
  35755. // }
  35756. }
  35757. // method id "dfareporting.placements.get":
  35758. type PlacementsGetCall struct {
  35759. s *Service
  35760. profileId int64
  35761. id int64
  35762. urlParams_ gensupport.URLParams
  35763. ifNoneMatch_ string
  35764. ctx_ context.Context
  35765. header_ http.Header
  35766. }
  35767. // Get: Gets one placement by ID.
  35768. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  35769. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35770. c.profileId = profileId
  35771. c.id = id
  35772. return c
  35773. }
  35774. // Fields allows partial responses to be retrieved. See
  35775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35776. // for more information.
  35777. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  35778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35779. return c
  35780. }
  35781. // IfNoneMatch sets the optional parameter which makes the operation
  35782. // fail if the object's ETag matches the given value. This is useful for
  35783. // getting updates only after the object has changed since the last
  35784. // request. Use googleapi.IsNotModified to check whether the response
  35785. // error from Do is the result of In-None-Match.
  35786. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  35787. c.ifNoneMatch_ = entityTag
  35788. return c
  35789. }
  35790. // Context sets the context to be used in this call's Do method. Any
  35791. // pending HTTP request will be aborted if the provided context is
  35792. // canceled.
  35793. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  35794. c.ctx_ = ctx
  35795. return c
  35796. }
  35797. // Header returns an http.Header that can be modified by the caller to
  35798. // add HTTP headers to the request.
  35799. func (c *PlacementsGetCall) Header() http.Header {
  35800. if c.header_ == nil {
  35801. c.header_ = make(http.Header)
  35802. }
  35803. return c.header_
  35804. }
  35805. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  35806. reqHeaders := make(http.Header)
  35807. for k, v := range c.header_ {
  35808. reqHeaders[k] = v
  35809. }
  35810. reqHeaders.Set("User-Agent", c.s.userAgent())
  35811. if c.ifNoneMatch_ != "" {
  35812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35813. }
  35814. var body io.Reader = nil
  35815. c.urlParams_.Set("alt", alt)
  35816. c.urlParams_.Set("prettyPrint", "false")
  35817. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  35818. urls += "?" + c.urlParams_.Encode()
  35819. req, err := http.NewRequest("GET", urls, body)
  35820. if err != nil {
  35821. return nil, err
  35822. }
  35823. req.Header = reqHeaders
  35824. googleapi.Expand(req.URL, map[string]string{
  35825. "profileId": strconv.FormatInt(c.profileId, 10),
  35826. "id": strconv.FormatInt(c.id, 10),
  35827. })
  35828. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35829. }
  35830. // Do executes the "dfareporting.placements.get" call.
  35831. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35832. // status code is an error. Response headers are in either
  35833. // *Placement.ServerResponse.Header or (if a response was returned at
  35834. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35835. // to check whether the returned error was because
  35836. // http.StatusNotModified was returned.
  35837. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35838. gensupport.SetOptions(c.urlParams_, opts...)
  35839. res, err := c.doRequest("json")
  35840. if res != nil && res.StatusCode == http.StatusNotModified {
  35841. if res.Body != nil {
  35842. res.Body.Close()
  35843. }
  35844. return nil, &googleapi.Error{
  35845. Code: res.StatusCode,
  35846. Header: res.Header,
  35847. }
  35848. }
  35849. if err != nil {
  35850. return nil, err
  35851. }
  35852. defer googleapi.CloseBody(res)
  35853. if err := googleapi.CheckResponse(res); err != nil {
  35854. return nil, err
  35855. }
  35856. ret := &Placement{
  35857. ServerResponse: googleapi.ServerResponse{
  35858. Header: res.Header,
  35859. HTTPStatusCode: res.StatusCode,
  35860. },
  35861. }
  35862. target := &ret
  35863. if err := gensupport.DecodeResponse(target, res); err != nil {
  35864. return nil, err
  35865. }
  35866. return ret, nil
  35867. // {
  35868. // "description": "Gets one placement by ID.",
  35869. // "httpMethod": "GET",
  35870. // "id": "dfareporting.placements.get",
  35871. // "parameterOrder": [
  35872. // "profileId",
  35873. // "id"
  35874. // ],
  35875. // "parameters": {
  35876. // "id": {
  35877. // "description": "Placement ID.",
  35878. // "format": "int64",
  35879. // "location": "path",
  35880. // "required": true,
  35881. // "type": "string"
  35882. // },
  35883. // "profileId": {
  35884. // "description": "User profile ID associated with this request.",
  35885. // "format": "int64",
  35886. // "location": "path",
  35887. // "required": true,
  35888. // "type": "string"
  35889. // }
  35890. // },
  35891. // "path": "userprofiles/{profileId}/placements/{id}",
  35892. // "response": {
  35893. // "$ref": "Placement"
  35894. // },
  35895. // "scopes": [
  35896. // "https://www.googleapis.com/auth/dfatrafficking"
  35897. // ]
  35898. // }
  35899. }
  35900. // method id "dfareporting.placements.insert":
  35901. type PlacementsInsertCall struct {
  35902. s *Service
  35903. profileId int64
  35904. placement *Placement
  35905. urlParams_ gensupport.URLParams
  35906. ctx_ context.Context
  35907. header_ http.Header
  35908. }
  35909. // Insert: Inserts a new placement.
  35910. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  35911. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35912. c.profileId = profileId
  35913. c.placement = placement
  35914. return c
  35915. }
  35916. // Fields allows partial responses to be retrieved. See
  35917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35918. // for more information.
  35919. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  35920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35921. return c
  35922. }
  35923. // Context sets the context to be used in this call's Do method. Any
  35924. // pending HTTP request will be aborted if the provided context is
  35925. // canceled.
  35926. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  35927. c.ctx_ = ctx
  35928. return c
  35929. }
  35930. // Header returns an http.Header that can be modified by the caller to
  35931. // add HTTP headers to the request.
  35932. func (c *PlacementsInsertCall) Header() http.Header {
  35933. if c.header_ == nil {
  35934. c.header_ = make(http.Header)
  35935. }
  35936. return c.header_
  35937. }
  35938. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  35939. reqHeaders := make(http.Header)
  35940. for k, v := range c.header_ {
  35941. reqHeaders[k] = v
  35942. }
  35943. reqHeaders.Set("User-Agent", c.s.userAgent())
  35944. var body io.Reader = nil
  35945. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35946. if err != nil {
  35947. return nil, err
  35948. }
  35949. reqHeaders.Set("Content-Type", "application/json")
  35950. c.urlParams_.Set("alt", alt)
  35951. c.urlParams_.Set("prettyPrint", "false")
  35952. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35953. urls += "?" + c.urlParams_.Encode()
  35954. req, err := http.NewRequest("POST", urls, body)
  35955. if err != nil {
  35956. return nil, err
  35957. }
  35958. req.Header = reqHeaders
  35959. googleapi.Expand(req.URL, map[string]string{
  35960. "profileId": strconv.FormatInt(c.profileId, 10),
  35961. })
  35962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35963. }
  35964. // Do executes the "dfareporting.placements.insert" call.
  35965. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35966. // status code is an error. Response headers are in either
  35967. // *Placement.ServerResponse.Header or (if a response was returned at
  35968. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35969. // to check whether the returned error was because
  35970. // http.StatusNotModified was returned.
  35971. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35972. gensupport.SetOptions(c.urlParams_, opts...)
  35973. res, err := c.doRequest("json")
  35974. if res != nil && res.StatusCode == http.StatusNotModified {
  35975. if res.Body != nil {
  35976. res.Body.Close()
  35977. }
  35978. return nil, &googleapi.Error{
  35979. Code: res.StatusCode,
  35980. Header: res.Header,
  35981. }
  35982. }
  35983. if err != nil {
  35984. return nil, err
  35985. }
  35986. defer googleapi.CloseBody(res)
  35987. if err := googleapi.CheckResponse(res); err != nil {
  35988. return nil, err
  35989. }
  35990. ret := &Placement{
  35991. ServerResponse: googleapi.ServerResponse{
  35992. Header: res.Header,
  35993. HTTPStatusCode: res.StatusCode,
  35994. },
  35995. }
  35996. target := &ret
  35997. if err := gensupport.DecodeResponse(target, res); err != nil {
  35998. return nil, err
  35999. }
  36000. return ret, nil
  36001. // {
  36002. // "description": "Inserts a new placement.",
  36003. // "httpMethod": "POST",
  36004. // "id": "dfareporting.placements.insert",
  36005. // "parameterOrder": [
  36006. // "profileId"
  36007. // ],
  36008. // "parameters": {
  36009. // "profileId": {
  36010. // "description": "User profile ID associated with this request.",
  36011. // "format": "int64",
  36012. // "location": "path",
  36013. // "required": true,
  36014. // "type": "string"
  36015. // }
  36016. // },
  36017. // "path": "userprofiles/{profileId}/placements",
  36018. // "request": {
  36019. // "$ref": "Placement"
  36020. // },
  36021. // "response": {
  36022. // "$ref": "Placement"
  36023. // },
  36024. // "scopes": [
  36025. // "https://www.googleapis.com/auth/dfatrafficking"
  36026. // ]
  36027. // }
  36028. }
  36029. // method id "dfareporting.placements.list":
  36030. type PlacementsListCall struct {
  36031. s *Service
  36032. profileId int64
  36033. urlParams_ gensupport.URLParams
  36034. ifNoneMatch_ string
  36035. ctx_ context.Context
  36036. header_ http.Header
  36037. }
  36038. // List: Retrieves a list of placements, possibly filtered. This method
  36039. // supports paging.
  36040. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  36041. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36042. c.profileId = profileId
  36043. return c
  36044. }
  36045. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36046. // only placements that belong to these advertisers.
  36047. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  36048. var advertiserIds_ []string
  36049. for _, v := range advertiserIds {
  36050. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36051. }
  36052. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36053. return c
  36054. }
  36055. // Archived sets the optional parameter "archived": Select only archived
  36056. // placements. Don't set this field to select both archived and
  36057. // non-archived placements.
  36058. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  36059. c.urlParams_.Set("archived", fmt.Sprint(archived))
  36060. return c
  36061. }
  36062. // CampaignIds sets the optional parameter "campaignIds": Select only
  36063. // placements that belong to these campaigns.
  36064. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  36065. var campaignIds_ []string
  36066. for _, v := range campaignIds {
  36067. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  36068. }
  36069. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  36070. return c
  36071. }
  36072. // Compatibilities sets the optional parameter "compatibilities": Select
  36073. // only placements that are associated with these compatibilities.
  36074. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  36075. // or on mobile devices for regular or interstitial ads respectively.
  36076. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  36077. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  36078. // with the VAST standard.
  36079. //
  36080. // Possible values:
  36081. // "APP"
  36082. // "APP_INTERSTITIAL"
  36083. // "DISPLAY"
  36084. // "DISPLAY_INTERSTITIAL"
  36085. // "IN_STREAM_AUDIO"
  36086. // "IN_STREAM_VIDEO"
  36087. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  36088. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  36089. return c
  36090. }
  36091. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  36092. // Select only placements that are associated with these content
  36093. // categories.
  36094. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  36095. var contentCategoryIds_ []string
  36096. for _, v := range contentCategoryIds {
  36097. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  36098. }
  36099. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  36100. return c
  36101. }
  36102. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  36103. // Select only placements that are associated with these directory
  36104. // sites.
  36105. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  36106. var directorySiteIds_ []string
  36107. for _, v := range directorySiteIds {
  36108. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  36109. }
  36110. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  36111. return c
  36112. }
  36113. // GroupIds sets the optional parameter "groupIds": Select only
  36114. // placements that belong to these placement groups.
  36115. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  36116. var groupIds_ []string
  36117. for _, v := range groupIds {
  36118. groupIds_ = append(groupIds_, fmt.Sprint(v))
  36119. }
  36120. c.urlParams_.SetMulti("groupIds", groupIds_)
  36121. return c
  36122. }
  36123. // Ids sets the optional parameter "ids": Select only placements with
  36124. // these IDs.
  36125. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  36126. var ids_ []string
  36127. for _, v := range ids {
  36128. ids_ = append(ids_, fmt.Sprint(v))
  36129. }
  36130. c.urlParams_.SetMulti("ids", ids_)
  36131. return c
  36132. }
  36133. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  36134. // placements or placement groups whose end date is on or before the
  36135. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  36136. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  36137. c.urlParams_.Set("maxEndDate", maxEndDate)
  36138. return c
  36139. }
  36140. // MaxResults sets the optional parameter "maxResults": Maximum number
  36141. // of results to return.
  36142. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  36143. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36144. return c
  36145. }
  36146. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  36147. // placements or placement groups whose start date is on or before the
  36148. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  36149. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  36150. c.urlParams_.Set("maxStartDate", maxStartDate)
  36151. return c
  36152. }
  36153. // MinEndDate sets the optional parameter "minEndDate": Select only
  36154. // placements or placement groups whose end date is on or after the
  36155. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  36156. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  36157. c.urlParams_.Set("minEndDate", minEndDate)
  36158. return c
  36159. }
  36160. // MinStartDate sets the optional parameter "minStartDate": Select only
  36161. // placements or placement groups whose start date is on or after the
  36162. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  36163. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  36164. c.urlParams_.Set("minStartDate", minStartDate)
  36165. return c
  36166. }
  36167. // PageToken sets the optional parameter "pageToken": Value of the
  36168. // nextPageToken from the previous result page.
  36169. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  36170. c.urlParams_.Set("pageToken", pageToken)
  36171. return c
  36172. }
  36173. // PaymentSource sets the optional parameter "paymentSource": Select
  36174. // only placements with this payment source.
  36175. //
  36176. // Possible values:
  36177. // "PLACEMENT_AGENCY_PAID"
  36178. // "PLACEMENT_PUBLISHER_PAID"
  36179. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  36180. c.urlParams_.Set("paymentSource", paymentSource)
  36181. return c
  36182. }
  36183. // PlacementStrategyIds sets the optional parameter
  36184. // "placementStrategyIds": Select only placements that are associated
  36185. // with these placement strategies.
  36186. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  36187. var placementStrategyIds_ []string
  36188. for _, v := range placementStrategyIds {
  36189. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  36190. }
  36191. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  36192. return c
  36193. }
  36194. // PricingTypes sets the optional parameter "pricingTypes": Select only
  36195. // placements with these pricing types.
  36196. //
  36197. // Possible values:
  36198. // "PRICING_TYPE_CPA"
  36199. // "PRICING_TYPE_CPC"
  36200. // "PRICING_TYPE_CPM"
  36201. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  36202. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  36203. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36204. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  36205. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  36206. return c
  36207. }
  36208. // SearchString sets the optional parameter "searchString": Allows
  36209. // searching for placements by name or ID. Wildcards (*) are allowed.
  36210. // For example, "placement*2015" will return placements with names like
  36211. // "placement June 2015", "placement May 2015", or simply "placements
  36212. // 2015". Most of the searches also add wildcards implicitly at the
  36213. // start and the end of the search string. For example, a search string
  36214. // of "placement" will match placements with name "my placement",
  36215. // "placement 2015", or simply "placement".
  36216. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  36217. c.urlParams_.Set("searchString", searchString)
  36218. return c
  36219. }
  36220. // SiteIds sets the optional parameter "siteIds": Select only placements
  36221. // that are associated with these sites.
  36222. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  36223. var siteIds_ []string
  36224. for _, v := range siteIds {
  36225. siteIds_ = append(siteIds_, fmt.Sprint(v))
  36226. }
  36227. c.urlParams_.SetMulti("siteIds", siteIds_)
  36228. return c
  36229. }
  36230. // SizeIds sets the optional parameter "sizeIds": Select only placements
  36231. // that are associated with these sizes.
  36232. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  36233. var sizeIds_ []string
  36234. for _, v := range sizeIds {
  36235. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  36236. }
  36237. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  36238. return c
  36239. }
  36240. // SortField sets the optional parameter "sortField": Field by which to
  36241. // sort the list.
  36242. //
  36243. // Possible values:
  36244. // "ID" (default)
  36245. // "NAME"
  36246. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  36247. c.urlParams_.Set("sortField", sortField)
  36248. return c
  36249. }
  36250. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36251. // results.
  36252. //
  36253. // Possible values:
  36254. // "ASCENDING" (default)
  36255. // "DESCENDING"
  36256. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  36257. c.urlParams_.Set("sortOrder", sortOrder)
  36258. return c
  36259. }
  36260. // Fields allows partial responses to be retrieved. See
  36261. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36262. // for more information.
  36263. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  36264. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36265. return c
  36266. }
  36267. // IfNoneMatch sets the optional parameter which makes the operation
  36268. // fail if the object's ETag matches the given value. This is useful for
  36269. // getting updates only after the object has changed since the last
  36270. // request. Use googleapi.IsNotModified to check whether the response
  36271. // error from Do is the result of In-None-Match.
  36272. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  36273. c.ifNoneMatch_ = entityTag
  36274. return c
  36275. }
  36276. // Context sets the context to be used in this call's Do method. Any
  36277. // pending HTTP request will be aborted if the provided context is
  36278. // canceled.
  36279. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  36280. c.ctx_ = ctx
  36281. return c
  36282. }
  36283. // Header returns an http.Header that can be modified by the caller to
  36284. // add HTTP headers to the request.
  36285. func (c *PlacementsListCall) Header() http.Header {
  36286. if c.header_ == nil {
  36287. c.header_ = make(http.Header)
  36288. }
  36289. return c.header_
  36290. }
  36291. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  36292. reqHeaders := make(http.Header)
  36293. for k, v := range c.header_ {
  36294. reqHeaders[k] = v
  36295. }
  36296. reqHeaders.Set("User-Agent", c.s.userAgent())
  36297. if c.ifNoneMatch_ != "" {
  36298. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36299. }
  36300. var body io.Reader = nil
  36301. c.urlParams_.Set("alt", alt)
  36302. c.urlParams_.Set("prettyPrint", "false")
  36303. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36304. urls += "?" + c.urlParams_.Encode()
  36305. req, err := http.NewRequest("GET", urls, body)
  36306. if err != nil {
  36307. return nil, err
  36308. }
  36309. req.Header = reqHeaders
  36310. googleapi.Expand(req.URL, map[string]string{
  36311. "profileId": strconv.FormatInt(c.profileId, 10),
  36312. })
  36313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36314. }
  36315. // Do executes the "dfareporting.placements.list" call.
  36316. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  36317. // non-2xx status code is an error. Response headers are in either
  36318. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  36319. // returned at all) in error.(*googleapi.Error).Header. Use
  36320. // googleapi.IsNotModified to check whether the returned error was
  36321. // because http.StatusNotModified was returned.
  36322. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  36323. gensupport.SetOptions(c.urlParams_, opts...)
  36324. res, err := c.doRequest("json")
  36325. if res != nil && res.StatusCode == http.StatusNotModified {
  36326. if res.Body != nil {
  36327. res.Body.Close()
  36328. }
  36329. return nil, &googleapi.Error{
  36330. Code: res.StatusCode,
  36331. Header: res.Header,
  36332. }
  36333. }
  36334. if err != nil {
  36335. return nil, err
  36336. }
  36337. defer googleapi.CloseBody(res)
  36338. if err := googleapi.CheckResponse(res); err != nil {
  36339. return nil, err
  36340. }
  36341. ret := &PlacementsListResponse{
  36342. ServerResponse: googleapi.ServerResponse{
  36343. Header: res.Header,
  36344. HTTPStatusCode: res.StatusCode,
  36345. },
  36346. }
  36347. target := &ret
  36348. if err := gensupport.DecodeResponse(target, res); err != nil {
  36349. return nil, err
  36350. }
  36351. return ret, nil
  36352. // {
  36353. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  36354. // "httpMethod": "GET",
  36355. // "id": "dfareporting.placements.list",
  36356. // "parameterOrder": [
  36357. // "profileId"
  36358. // ],
  36359. // "parameters": {
  36360. // "advertiserIds": {
  36361. // "description": "Select only placements that belong to these advertisers.",
  36362. // "format": "int64",
  36363. // "location": "query",
  36364. // "repeated": true,
  36365. // "type": "string"
  36366. // },
  36367. // "archived": {
  36368. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  36369. // "location": "query",
  36370. // "type": "boolean"
  36371. // },
  36372. // "campaignIds": {
  36373. // "description": "Select only placements that belong to these campaigns.",
  36374. // "format": "int64",
  36375. // "location": "query",
  36376. // "repeated": true,
  36377. // "type": "string"
  36378. // },
  36379. // "compatibilities": {
  36380. // "description": "Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard.",
  36381. // "enum": [
  36382. // "APP",
  36383. // "APP_INTERSTITIAL",
  36384. // "DISPLAY",
  36385. // "DISPLAY_INTERSTITIAL",
  36386. // "IN_STREAM_AUDIO",
  36387. // "IN_STREAM_VIDEO"
  36388. // ],
  36389. // "enumDescriptions": [
  36390. // "",
  36391. // "",
  36392. // "",
  36393. // "",
  36394. // "",
  36395. // ""
  36396. // ],
  36397. // "location": "query",
  36398. // "repeated": true,
  36399. // "type": "string"
  36400. // },
  36401. // "contentCategoryIds": {
  36402. // "description": "Select only placements that are associated with these content categories.",
  36403. // "format": "int64",
  36404. // "location": "query",
  36405. // "repeated": true,
  36406. // "type": "string"
  36407. // },
  36408. // "directorySiteIds": {
  36409. // "description": "Select only placements that are associated with these directory sites.",
  36410. // "format": "int64",
  36411. // "location": "query",
  36412. // "repeated": true,
  36413. // "type": "string"
  36414. // },
  36415. // "groupIds": {
  36416. // "description": "Select only placements that belong to these placement groups.",
  36417. // "format": "int64",
  36418. // "location": "query",
  36419. // "repeated": true,
  36420. // "type": "string"
  36421. // },
  36422. // "ids": {
  36423. // "description": "Select only placements with these IDs.",
  36424. // "format": "int64",
  36425. // "location": "query",
  36426. // "repeated": true,
  36427. // "type": "string"
  36428. // },
  36429. // "maxEndDate": {
  36430. // "description": "Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as \"yyyy-MM-dd\".",
  36431. // "location": "query",
  36432. // "type": "string"
  36433. // },
  36434. // "maxResults": {
  36435. // "default": "1000",
  36436. // "description": "Maximum number of results to return.",
  36437. // "format": "int32",
  36438. // "location": "query",
  36439. // "maximum": "1000",
  36440. // "minimum": "0",
  36441. // "type": "integer"
  36442. // },
  36443. // "maxStartDate": {
  36444. // "description": "Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as \"yyyy-MM-dd\".",
  36445. // "location": "query",
  36446. // "type": "string"
  36447. // },
  36448. // "minEndDate": {
  36449. // "description": "Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as \"yyyy-MM-dd\".",
  36450. // "location": "query",
  36451. // "type": "string"
  36452. // },
  36453. // "minStartDate": {
  36454. // "description": "Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as \"yyyy-MM-dd\".",
  36455. // "location": "query",
  36456. // "type": "string"
  36457. // },
  36458. // "pageToken": {
  36459. // "description": "Value of the nextPageToken from the previous result page.",
  36460. // "location": "query",
  36461. // "type": "string"
  36462. // },
  36463. // "paymentSource": {
  36464. // "description": "Select only placements with this payment source.",
  36465. // "enum": [
  36466. // "PLACEMENT_AGENCY_PAID",
  36467. // "PLACEMENT_PUBLISHER_PAID"
  36468. // ],
  36469. // "enumDescriptions": [
  36470. // "",
  36471. // ""
  36472. // ],
  36473. // "location": "query",
  36474. // "type": "string"
  36475. // },
  36476. // "placementStrategyIds": {
  36477. // "description": "Select only placements that are associated with these placement strategies.",
  36478. // "format": "int64",
  36479. // "location": "query",
  36480. // "repeated": true,
  36481. // "type": "string"
  36482. // },
  36483. // "pricingTypes": {
  36484. // "description": "Select only placements with these pricing types.",
  36485. // "enum": [
  36486. // "PRICING_TYPE_CPA",
  36487. // "PRICING_TYPE_CPC",
  36488. // "PRICING_TYPE_CPM",
  36489. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  36490. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  36491. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  36492. // ],
  36493. // "enumDescriptions": [
  36494. // "",
  36495. // "",
  36496. // "",
  36497. // "",
  36498. // "",
  36499. // ""
  36500. // ],
  36501. // "location": "query",
  36502. // "repeated": true,
  36503. // "type": "string"
  36504. // },
  36505. // "profileId": {
  36506. // "description": "User profile ID associated with this request.",
  36507. // "format": "int64",
  36508. // "location": "path",
  36509. // "required": true,
  36510. // "type": "string"
  36511. // },
  36512. // "searchString": {
  36513. // "description": "Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, \"placement*2015\" will return placements with names like \"placement June 2015\", \"placement May 2015\", or simply \"placements 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"placement\" will match placements with name \"my placement\", \"placement 2015\", or simply \"placement\".",
  36514. // "location": "query",
  36515. // "type": "string"
  36516. // },
  36517. // "siteIds": {
  36518. // "description": "Select only placements that are associated with these sites.",
  36519. // "format": "int64",
  36520. // "location": "query",
  36521. // "repeated": true,
  36522. // "type": "string"
  36523. // },
  36524. // "sizeIds": {
  36525. // "description": "Select only placements that are associated with these sizes.",
  36526. // "format": "int64",
  36527. // "location": "query",
  36528. // "repeated": true,
  36529. // "type": "string"
  36530. // },
  36531. // "sortField": {
  36532. // "default": "ID",
  36533. // "description": "Field by which to sort the list.",
  36534. // "enum": [
  36535. // "ID",
  36536. // "NAME"
  36537. // ],
  36538. // "enumDescriptions": [
  36539. // "",
  36540. // ""
  36541. // ],
  36542. // "location": "query",
  36543. // "type": "string"
  36544. // },
  36545. // "sortOrder": {
  36546. // "default": "ASCENDING",
  36547. // "description": "Order of sorted results.",
  36548. // "enum": [
  36549. // "ASCENDING",
  36550. // "DESCENDING"
  36551. // ],
  36552. // "enumDescriptions": [
  36553. // "",
  36554. // ""
  36555. // ],
  36556. // "location": "query",
  36557. // "type": "string"
  36558. // }
  36559. // },
  36560. // "path": "userprofiles/{profileId}/placements",
  36561. // "response": {
  36562. // "$ref": "PlacementsListResponse"
  36563. // },
  36564. // "scopes": [
  36565. // "https://www.googleapis.com/auth/dfatrafficking"
  36566. // ]
  36567. // }
  36568. }
  36569. // Pages invokes f for each page of results.
  36570. // A non-nil error returned from f will halt the iteration.
  36571. // The provided context supersedes any context provided to the Context method.
  36572. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  36573. c.ctx_ = ctx
  36574. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36575. for {
  36576. x, err := c.Do()
  36577. if err != nil {
  36578. return err
  36579. }
  36580. if err := f(x); err != nil {
  36581. return err
  36582. }
  36583. if x.NextPageToken == "" {
  36584. return nil
  36585. }
  36586. c.PageToken(x.NextPageToken)
  36587. }
  36588. }
  36589. // method id "dfareporting.placements.patch":
  36590. type PlacementsPatchCall struct {
  36591. s *Service
  36592. profileId int64
  36593. placement *Placement
  36594. urlParams_ gensupport.URLParams
  36595. ctx_ context.Context
  36596. header_ http.Header
  36597. }
  36598. // Patch: Updates an existing placement. This method supports patch
  36599. // semantics.
  36600. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  36601. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36602. c.profileId = profileId
  36603. c.urlParams_.Set("id", fmt.Sprint(id))
  36604. c.placement = placement
  36605. return c
  36606. }
  36607. // Fields allows partial responses to be retrieved. See
  36608. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36609. // for more information.
  36610. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  36611. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36612. return c
  36613. }
  36614. // Context sets the context to be used in this call's Do method. Any
  36615. // pending HTTP request will be aborted if the provided context is
  36616. // canceled.
  36617. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  36618. c.ctx_ = ctx
  36619. return c
  36620. }
  36621. // Header returns an http.Header that can be modified by the caller to
  36622. // add HTTP headers to the request.
  36623. func (c *PlacementsPatchCall) Header() http.Header {
  36624. if c.header_ == nil {
  36625. c.header_ = make(http.Header)
  36626. }
  36627. return c.header_
  36628. }
  36629. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  36630. reqHeaders := make(http.Header)
  36631. for k, v := range c.header_ {
  36632. reqHeaders[k] = v
  36633. }
  36634. reqHeaders.Set("User-Agent", c.s.userAgent())
  36635. var body io.Reader = nil
  36636. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36637. if err != nil {
  36638. return nil, err
  36639. }
  36640. reqHeaders.Set("Content-Type", "application/json")
  36641. c.urlParams_.Set("alt", alt)
  36642. c.urlParams_.Set("prettyPrint", "false")
  36643. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36644. urls += "?" + c.urlParams_.Encode()
  36645. req, err := http.NewRequest("PATCH", urls, body)
  36646. if err != nil {
  36647. return nil, err
  36648. }
  36649. req.Header = reqHeaders
  36650. googleapi.Expand(req.URL, map[string]string{
  36651. "profileId": strconv.FormatInt(c.profileId, 10),
  36652. })
  36653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36654. }
  36655. // Do executes the "dfareporting.placements.patch" call.
  36656. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36657. // status code is an error. Response headers are in either
  36658. // *Placement.ServerResponse.Header or (if a response was returned at
  36659. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36660. // to check whether the returned error was because
  36661. // http.StatusNotModified was returned.
  36662. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36663. gensupport.SetOptions(c.urlParams_, opts...)
  36664. res, err := c.doRequest("json")
  36665. if res != nil && res.StatusCode == http.StatusNotModified {
  36666. if res.Body != nil {
  36667. res.Body.Close()
  36668. }
  36669. return nil, &googleapi.Error{
  36670. Code: res.StatusCode,
  36671. Header: res.Header,
  36672. }
  36673. }
  36674. if err != nil {
  36675. return nil, err
  36676. }
  36677. defer googleapi.CloseBody(res)
  36678. if err := googleapi.CheckResponse(res); err != nil {
  36679. return nil, err
  36680. }
  36681. ret := &Placement{
  36682. ServerResponse: googleapi.ServerResponse{
  36683. Header: res.Header,
  36684. HTTPStatusCode: res.StatusCode,
  36685. },
  36686. }
  36687. target := &ret
  36688. if err := gensupport.DecodeResponse(target, res); err != nil {
  36689. return nil, err
  36690. }
  36691. return ret, nil
  36692. // {
  36693. // "description": "Updates an existing placement. This method supports patch semantics.",
  36694. // "httpMethod": "PATCH",
  36695. // "id": "dfareporting.placements.patch",
  36696. // "parameterOrder": [
  36697. // "profileId",
  36698. // "id"
  36699. // ],
  36700. // "parameters": {
  36701. // "id": {
  36702. // "description": "Placement ID.",
  36703. // "format": "int64",
  36704. // "location": "query",
  36705. // "required": true,
  36706. // "type": "string"
  36707. // },
  36708. // "profileId": {
  36709. // "description": "User profile ID associated with this request.",
  36710. // "format": "int64",
  36711. // "location": "path",
  36712. // "required": true,
  36713. // "type": "string"
  36714. // }
  36715. // },
  36716. // "path": "userprofiles/{profileId}/placements",
  36717. // "request": {
  36718. // "$ref": "Placement"
  36719. // },
  36720. // "response": {
  36721. // "$ref": "Placement"
  36722. // },
  36723. // "scopes": [
  36724. // "https://www.googleapis.com/auth/dfatrafficking"
  36725. // ]
  36726. // }
  36727. }
  36728. // method id "dfareporting.placements.update":
  36729. type PlacementsUpdateCall struct {
  36730. s *Service
  36731. profileId int64
  36732. placement *Placement
  36733. urlParams_ gensupport.URLParams
  36734. ctx_ context.Context
  36735. header_ http.Header
  36736. }
  36737. // Update: Updates an existing placement.
  36738. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  36739. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36740. c.profileId = profileId
  36741. c.placement = placement
  36742. return c
  36743. }
  36744. // Fields allows partial responses to be retrieved. See
  36745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36746. // for more information.
  36747. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  36748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36749. return c
  36750. }
  36751. // Context sets the context to be used in this call's Do method. Any
  36752. // pending HTTP request will be aborted if the provided context is
  36753. // canceled.
  36754. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  36755. c.ctx_ = ctx
  36756. return c
  36757. }
  36758. // Header returns an http.Header that can be modified by the caller to
  36759. // add HTTP headers to the request.
  36760. func (c *PlacementsUpdateCall) Header() http.Header {
  36761. if c.header_ == nil {
  36762. c.header_ = make(http.Header)
  36763. }
  36764. return c.header_
  36765. }
  36766. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36767. reqHeaders := make(http.Header)
  36768. for k, v := range c.header_ {
  36769. reqHeaders[k] = v
  36770. }
  36771. reqHeaders.Set("User-Agent", c.s.userAgent())
  36772. var body io.Reader = nil
  36773. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36774. if err != nil {
  36775. return nil, err
  36776. }
  36777. reqHeaders.Set("Content-Type", "application/json")
  36778. c.urlParams_.Set("alt", alt)
  36779. c.urlParams_.Set("prettyPrint", "false")
  36780. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36781. urls += "?" + c.urlParams_.Encode()
  36782. req, err := http.NewRequest("PUT", urls, body)
  36783. if err != nil {
  36784. return nil, err
  36785. }
  36786. req.Header = reqHeaders
  36787. googleapi.Expand(req.URL, map[string]string{
  36788. "profileId": strconv.FormatInt(c.profileId, 10),
  36789. })
  36790. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36791. }
  36792. // Do executes the "dfareporting.placements.update" call.
  36793. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36794. // status code is an error. Response headers are in either
  36795. // *Placement.ServerResponse.Header or (if a response was returned at
  36796. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36797. // to check whether the returned error was because
  36798. // http.StatusNotModified was returned.
  36799. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36800. gensupport.SetOptions(c.urlParams_, opts...)
  36801. res, err := c.doRequest("json")
  36802. if res != nil && res.StatusCode == http.StatusNotModified {
  36803. if res.Body != nil {
  36804. res.Body.Close()
  36805. }
  36806. return nil, &googleapi.Error{
  36807. Code: res.StatusCode,
  36808. Header: res.Header,
  36809. }
  36810. }
  36811. if err != nil {
  36812. return nil, err
  36813. }
  36814. defer googleapi.CloseBody(res)
  36815. if err := googleapi.CheckResponse(res); err != nil {
  36816. return nil, err
  36817. }
  36818. ret := &Placement{
  36819. ServerResponse: googleapi.ServerResponse{
  36820. Header: res.Header,
  36821. HTTPStatusCode: res.StatusCode,
  36822. },
  36823. }
  36824. target := &ret
  36825. if err := gensupport.DecodeResponse(target, res); err != nil {
  36826. return nil, err
  36827. }
  36828. return ret, nil
  36829. // {
  36830. // "description": "Updates an existing placement.",
  36831. // "httpMethod": "PUT",
  36832. // "id": "dfareporting.placements.update",
  36833. // "parameterOrder": [
  36834. // "profileId"
  36835. // ],
  36836. // "parameters": {
  36837. // "profileId": {
  36838. // "description": "User profile ID associated with this request.",
  36839. // "format": "int64",
  36840. // "location": "path",
  36841. // "required": true,
  36842. // "type": "string"
  36843. // }
  36844. // },
  36845. // "path": "userprofiles/{profileId}/placements",
  36846. // "request": {
  36847. // "$ref": "Placement"
  36848. // },
  36849. // "response": {
  36850. // "$ref": "Placement"
  36851. // },
  36852. // "scopes": [
  36853. // "https://www.googleapis.com/auth/dfatrafficking"
  36854. // ]
  36855. // }
  36856. }
  36857. // method id "dfareporting.platformTypes.get":
  36858. type PlatformTypesGetCall struct {
  36859. s *Service
  36860. profileId int64
  36861. id int64
  36862. urlParams_ gensupport.URLParams
  36863. ifNoneMatch_ string
  36864. ctx_ context.Context
  36865. header_ http.Header
  36866. }
  36867. // Get: Gets one platform type by ID.
  36868. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  36869. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36870. c.profileId = profileId
  36871. c.id = id
  36872. return c
  36873. }
  36874. // Fields allows partial responses to be retrieved. See
  36875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36876. // for more information.
  36877. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  36878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36879. return c
  36880. }
  36881. // IfNoneMatch sets the optional parameter which makes the operation
  36882. // fail if the object's ETag matches the given value. This is useful for
  36883. // getting updates only after the object has changed since the last
  36884. // request. Use googleapi.IsNotModified to check whether the response
  36885. // error from Do is the result of In-None-Match.
  36886. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  36887. c.ifNoneMatch_ = entityTag
  36888. return c
  36889. }
  36890. // Context sets the context to be used in this call's Do method. Any
  36891. // pending HTTP request will be aborted if the provided context is
  36892. // canceled.
  36893. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  36894. c.ctx_ = ctx
  36895. return c
  36896. }
  36897. // Header returns an http.Header that can be modified by the caller to
  36898. // add HTTP headers to the request.
  36899. func (c *PlatformTypesGetCall) Header() http.Header {
  36900. if c.header_ == nil {
  36901. c.header_ = make(http.Header)
  36902. }
  36903. return c.header_
  36904. }
  36905. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  36906. reqHeaders := make(http.Header)
  36907. for k, v := range c.header_ {
  36908. reqHeaders[k] = v
  36909. }
  36910. reqHeaders.Set("User-Agent", c.s.userAgent())
  36911. if c.ifNoneMatch_ != "" {
  36912. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36913. }
  36914. var body io.Reader = nil
  36915. c.urlParams_.Set("alt", alt)
  36916. c.urlParams_.Set("prettyPrint", "false")
  36917. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  36918. urls += "?" + c.urlParams_.Encode()
  36919. req, err := http.NewRequest("GET", urls, body)
  36920. if err != nil {
  36921. return nil, err
  36922. }
  36923. req.Header = reqHeaders
  36924. googleapi.Expand(req.URL, map[string]string{
  36925. "profileId": strconv.FormatInt(c.profileId, 10),
  36926. "id": strconv.FormatInt(c.id, 10),
  36927. })
  36928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36929. }
  36930. // Do executes the "dfareporting.platformTypes.get" call.
  36931. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  36932. // status code is an error. Response headers are in either
  36933. // *PlatformType.ServerResponse.Header or (if a response was returned at
  36934. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36935. // to check whether the returned error was because
  36936. // http.StatusNotModified was returned.
  36937. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  36938. gensupport.SetOptions(c.urlParams_, opts...)
  36939. res, err := c.doRequest("json")
  36940. if res != nil && res.StatusCode == http.StatusNotModified {
  36941. if res.Body != nil {
  36942. res.Body.Close()
  36943. }
  36944. return nil, &googleapi.Error{
  36945. Code: res.StatusCode,
  36946. Header: res.Header,
  36947. }
  36948. }
  36949. if err != nil {
  36950. return nil, err
  36951. }
  36952. defer googleapi.CloseBody(res)
  36953. if err := googleapi.CheckResponse(res); err != nil {
  36954. return nil, err
  36955. }
  36956. ret := &PlatformType{
  36957. ServerResponse: googleapi.ServerResponse{
  36958. Header: res.Header,
  36959. HTTPStatusCode: res.StatusCode,
  36960. },
  36961. }
  36962. target := &ret
  36963. if err := gensupport.DecodeResponse(target, res); err != nil {
  36964. return nil, err
  36965. }
  36966. return ret, nil
  36967. // {
  36968. // "description": "Gets one platform type by ID.",
  36969. // "httpMethod": "GET",
  36970. // "id": "dfareporting.platformTypes.get",
  36971. // "parameterOrder": [
  36972. // "profileId",
  36973. // "id"
  36974. // ],
  36975. // "parameters": {
  36976. // "id": {
  36977. // "description": "Platform type ID.",
  36978. // "format": "int64",
  36979. // "location": "path",
  36980. // "required": true,
  36981. // "type": "string"
  36982. // },
  36983. // "profileId": {
  36984. // "description": "User profile ID associated with this request.",
  36985. // "format": "int64",
  36986. // "location": "path",
  36987. // "required": true,
  36988. // "type": "string"
  36989. // }
  36990. // },
  36991. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  36992. // "response": {
  36993. // "$ref": "PlatformType"
  36994. // },
  36995. // "scopes": [
  36996. // "https://www.googleapis.com/auth/dfatrafficking"
  36997. // ]
  36998. // }
  36999. }
  37000. // method id "dfareporting.platformTypes.list":
  37001. type PlatformTypesListCall struct {
  37002. s *Service
  37003. profileId int64
  37004. urlParams_ gensupport.URLParams
  37005. ifNoneMatch_ string
  37006. ctx_ context.Context
  37007. header_ http.Header
  37008. }
  37009. // List: Retrieves a list of platform types.
  37010. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  37011. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37012. c.profileId = profileId
  37013. return c
  37014. }
  37015. // Fields allows partial responses to be retrieved. See
  37016. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37017. // for more information.
  37018. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  37019. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37020. return c
  37021. }
  37022. // IfNoneMatch sets the optional parameter which makes the operation
  37023. // fail if the object's ETag matches the given value. This is useful for
  37024. // getting updates only after the object has changed since the last
  37025. // request. Use googleapi.IsNotModified to check whether the response
  37026. // error from Do is the result of In-None-Match.
  37027. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  37028. c.ifNoneMatch_ = entityTag
  37029. return c
  37030. }
  37031. // Context sets the context to be used in this call's Do method. Any
  37032. // pending HTTP request will be aborted if the provided context is
  37033. // canceled.
  37034. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  37035. c.ctx_ = ctx
  37036. return c
  37037. }
  37038. // Header returns an http.Header that can be modified by the caller to
  37039. // add HTTP headers to the request.
  37040. func (c *PlatformTypesListCall) Header() http.Header {
  37041. if c.header_ == nil {
  37042. c.header_ = make(http.Header)
  37043. }
  37044. return c.header_
  37045. }
  37046. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  37047. reqHeaders := make(http.Header)
  37048. for k, v := range c.header_ {
  37049. reqHeaders[k] = v
  37050. }
  37051. reqHeaders.Set("User-Agent", c.s.userAgent())
  37052. if c.ifNoneMatch_ != "" {
  37053. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37054. }
  37055. var body io.Reader = nil
  37056. c.urlParams_.Set("alt", alt)
  37057. c.urlParams_.Set("prettyPrint", "false")
  37058. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  37059. urls += "?" + c.urlParams_.Encode()
  37060. req, err := http.NewRequest("GET", urls, body)
  37061. if err != nil {
  37062. return nil, err
  37063. }
  37064. req.Header = reqHeaders
  37065. googleapi.Expand(req.URL, map[string]string{
  37066. "profileId": strconv.FormatInt(c.profileId, 10),
  37067. })
  37068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37069. }
  37070. // Do executes the "dfareporting.platformTypes.list" call.
  37071. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  37072. // Any non-2xx status code is an error. Response headers are in either
  37073. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  37074. // was returned at all) in error.(*googleapi.Error).Header. Use
  37075. // googleapi.IsNotModified to check whether the returned error was
  37076. // because http.StatusNotModified was returned.
  37077. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  37078. gensupport.SetOptions(c.urlParams_, opts...)
  37079. res, err := c.doRequest("json")
  37080. if res != nil && res.StatusCode == http.StatusNotModified {
  37081. if res.Body != nil {
  37082. res.Body.Close()
  37083. }
  37084. return nil, &googleapi.Error{
  37085. Code: res.StatusCode,
  37086. Header: res.Header,
  37087. }
  37088. }
  37089. if err != nil {
  37090. return nil, err
  37091. }
  37092. defer googleapi.CloseBody(res)
  37093. if err := googleapi.CheckResponse(res); err != nil {
  37094. return nil, err
  37095. }
  37096. ret := &PlatformTypesListResponse{
  37097. ServerResponse: googleapi.ServerResponse{
  37098. Header: res.Header,
  37099. HTTPStatusCode: res.StatusCode,
  37100. },
  37101. }
  37102. target := &ret
  37103. if err := gensupport.DecodeResponse(target, res); err != nil {
  37104. return nil, err
  37105. }
  37106. return ret, nil
  37107. // {
  37108. // "description": "Retrieves a list of platform types.",
  37109. // "httpMethod": "GET",
  37110. // "id": "dfareporting.platformTypes.list",
  37111. // "parameterOrder": [
  37112. // "profileId"
  37113. // ],
  37114. // "parameters": {
  37115. // "profileId": {
  37116. // "description": "User profile ID associated with this request.",
  37117. // "format": "int64",
  37118. // "location": "path",
  37119. // "required": true,
  37120. // "type": "string"
  37121. // }
  37122. // },
  37123. // "path": "userprofiles/{profileId}/platformTypes",
  37124. // "response": {
  37125. // "$ref": "PlatformTypesListResponse"
  37126. // },
  37127. // "scopes": [
  37128. // "https://www.googleapis.com/auth/dfatrafficking"
  37129. // ]
  37130. // }
  37131. }
  37132. // method id "dfareporting.postalCodes.get":
  37133. type PostalCodesGetCall struct {
  37134. s *Service
  37135. profileId int64
  37136. code string
  37137. urlParams_ gensupport.URLParams
  37138. ifNoneMatch_ string
  37139. ctx_ context.Context
  37140. header_ http.Header
  37141. }
  37142. // Get: Gets one postal code by ID.
  37143. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  37144. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37145. c.profileId = profileId
  37146. c.code = code
  37147. return c
  37148. }
  37149. // Fields allows partial responses to be retrieved. See
  37150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37151. // for more information.
  37152. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  37153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37154. return c
  37155. }
  37156. // IfNoneMatch sets the optional parameter which makes the operation
  37157. // fail if the object's ETag matches the given value. This is useful for
  37158. // getting updates only after the object has changed since the last
  37159. // request. Use googleapi.IsNotModified to check whether the response
  37160. // error from Do is the result of In-None-Match.
  37161. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  37162. c.ifNoneMatch_ = entityTag
  37163. return c
  37164. }
  37165. // Context sets the context to be used in this call's Do method. Any
  37166. // pending HTTP request will be aborted if the provided context is
  37167. // canceled.
  37168. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  37169. c.ctx_ = ctx
  37170. return c
  37171. }
  37172. // Header returns an http.Header that can be modified by the caller to
  37173. // add HTTP headers to the request.
  37174. func (c *PostalCodesGetCall) Header() http.Header {
  37175. if c.header_ == nil {
  37176. c.header_ = make(http.Header)
  37177. }
  37178. return c.header_
  37179. }
  37180. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  37181. reqHeaders := make(http.Header)
  37182. for k, v := range c.header_ {
  37183. reqHeaders[k] = v
  37184. }
  37185. reqHeaders.Set("User-Agent", c.s.userAgent())
  37186. if c.ifNoneMatch_ != "" {
  37187. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37188. }
  37189. var body io.Reader = nil
  37190. c.urlParams_.Set("alt", alt)
  37191. c.urlParams_.Set("prettyPrint", "false")
  37192. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  37193. urls += "?" + c.urlParams_.Encode()
  37194. req, err := http.NewRequest("GET", urls, body)
  37195. if err != nil {
  37196. return nil, err
  37197. }
  37198. req.Header = reqHeaders
  37199. googleapi.Expand(req.URL, map[string]string{
  37200. "profileId": strconv.FormatInt(c.profileId, 10),
  37201. "code": c.code,
  37202. })
  37203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37204. }
  37205. // Do executes the "dfareporting.postalCodes.get" call.
  37206. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  37207. // status code is an error. Response headers are in either
  37208. // *PostalCode.ServerResponse.Header or (if a response was returned at
  37209. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  37210. // to check whether the returned error was because
  37211. // http.StatusNotModified was returned.
  37212. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  37213. gensupport.SetOptions(c.urlParams_, opts...)
  37214. res, err := c.doRequest("json")
  37215. if res != nil && res.StatusCode == http.StatusNotModified {
  37216. if res.Body != nil {
  37217. res.Body.Close()
  37218. }
  37219. return nil, &googleapi.Error{
  37220. Code: res.StatusCode,
  37221. Header: res.Header,
  37222. }
  37223. }
  37224. if err != nil {
  37225. return nil, err
  37226. }
  37227. defer googleapi.CloseBody(res)
  37228. if err := googleapi.CheckResponse(res); err != nil {
  37229. return nil, err
  37230. }
  37231. ret := &PostalCode{
  37232. ServerResponse: googleapi.ServerResponse{
  37233. Header: res.Header,
  37234. HTTPStatusCode: res.StatusCode,
  37235. },
  37236. }
  37237. target := &ret
  37238. if err := gensupport.DecodeResponse(target, res); err != nil {
  37239. return nil, err
  37240. }
  37241. return ret, nil
  37242. // {
  37243. // "description": "Gets one postal code by ID.",
  37244. // "httpMethod": "GET",
  37245. // "id": "dfareporting.postalCodes.get",
  37246. // "parameterOrder": [
  37247. // "profileId",
  37248. // "code"
  37249. // ],
  37250. // "parameters": {
  37251. // "code": {
  37252. // "description": "Postal code ID.",
  37253. // "location": "path",
  37254. // "required": true,
  37255. // "type": "string"
  37256. // },
  37257. // "profileId": {
  37258. // "description": "User profile ID associated with this request.",
  37259. // "format": "int64",
  37260. // "location": "path",
  37261. // "required": true,
  37262. // "type": "string"
  37263. // }
  37264. // },
  37265. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  37266. // "response": {
  37267. // "$ref": "PostalCode"
  37268. // },
  37269. // "scopes": [
  37270. // "https://www.googleapis.com/auth/dfatrafficking"
  37271. // ]
  37272. // }
  37273. }
  37274. // method id "dfareporting.postalCodes.list":
  37275. type PostalCodesListCall struct {
  37276. s *Service
  37277. profileId int64
  37278. urlParams_ gensupport.URLParams
  37279. ifNoneMatch_ string
  37280. ctx_ context.Context
  37281. header_ http.Header
  37282. }
  37283. // List: Retrieves a list of postal codes.
  37284. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  37285. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37286. c.profileId = profileId
  37287. return c
  37288. }
  37289. // Fields allows partial responses to be retrieved. See
  37290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37291. // for more information.
  37292. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  37293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37294. return c
  37295. }
  37296. // IfNoneMatch sets the optional parameter which makes the operation
  37297. // fail if the object's ETag matches the given value. This is useful for
  37298. // getting updates only after the object has changed since the last
  37299. // request. Use googleapi.IsNotModified to check whether the response
  37300. // error from Do is the result of In-None-Match.
  37301. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  37302. c.ifNoneMatch_ = entityTag
  37303. return c
  37304. }
  37305. // Context sets the context to be used in this call's Do method. Any
  37306. // pending HTTP request will be aborted if the provided context is
  37307. // canceled.
  37308. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  37309. c.ctx_ = ctx
  37310. return c
  37311. }
  37312. // Header returns an http.Header that can be modified by the caller to
  37313. // add HTTP headers to the request.
  37314. func (c *PostalCodesListCall) Header() http.Header {
  37315. if c.header_ == nil {
  37316. c.header_ = make(http.Header)
  37317. }
  37318. return c.header_
  37319. }
  37320. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  37321. reqHeaders := make(http.Header)
  37322. for k, v := range c.header_ {
  37323. reqHeaders[k] = v
  37324. }
  37325. reqHeaders.Set("User-Agent", c.s.userAgent())
  37326. if c.ifNoneMatch_ != "" {
  37327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37328. }
  37329. var body io.Reader = nil
  37330. c.urlParams_.Set("alt", alt)
  37331. c.urlParams_.Set("prettyPrint", "false")
  37332. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  37333. urls += "?" + c.urlParams_.Encode()
  37334. req, err := http.NewRequest("GET", urls, body)
  37335. if err != nil {
  37336. return nil, err
  37337. }
  37338. req.Header = reqHeaders
  37339. googleapi.Expand(req.URL, map[string]string{
  37340. "profileId": strconv.FormatInt(c.profileId, 10),
  37341. })
  37342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37343. }
  37344. // Do executes the "dfareporting.postalCodes.list" call.
  37345. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  37346. // non-2xx status code is an error. Response headers are in either
  37347. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  37348. // returned at all) in error.(*googleapi.Error).Header. Use
  37349. // googleapi.IsNotModified to check whether the returned error was
  37350. // because http.StatusNotModified was returned.
  37351. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  37352. gensupport.SetOptions(c.urlParams_, opts...)
  37353. res, err := c.doRequest("json")
  37354. if res != nil && res.StatusCode == http.StatusNotModified {
  37355. if res.Body != nil {
  37356. res.Body.Close()
  37357. }
  37358. return nil, &googleapi.Error{
  37359. Code: res.StatusCode,
  37360. Header: res.Header,
  37361. }
  37362. }
  37363. if err != nil {
  37364. return nil, err
  37365. }
  37366. defer googleapi.CloseBody(res)
  37367. if err := googleapi.CheckResponse(res); err != nil {
  37368. return nil, err
  37369. }
  37370. ret := &PostalCodesListResponse{
  37371. ServerResponse: googleapi.ServerResponse{
  37372. Header: res.Header,
  37373. HTTPStatusCode: res.StatusCode,
  37374. },
  37375. }
  37376. target := &ret
  37377. if err := gensupport.DecodeResponse(target, res); err != nil {
  37378. return nil, err
  37379. }
  37380. return ret, nil
  37381. // {
  37382. // "description": "Retrieves a list of postal codes.",
  37383. // "httpMethod": "GET",
  37384. // "id": "dfareporting.postalCodes.list",
  37385. // "parameterOrder": [
  37386. // "profileId"
  37387. // ],
  37388. // "parameters": {
  37389. // "profileId": {
  37390. // "description": "User profile ID associated with this request.",
  37391. // "format": "int64",
  37392. // "location": "path",
  37393. // "required": true,
  37394. // "type": "string"
  37395. // }
  37396. // },
  37397. // "path": "userprofiles/{profileId}/postalCodes",
  37398. // "response": {
  37399. // "$ref": "PostalCodesListResponse"
  37400. // },
  37401. // "scopes": [
  37402. // "https://www.googleapis.com/auth/dfatrafficking"
  37403. // ]
  37404. // }
  37405. }
  37406. // method id "dfareporting.projects.get":
  37407. type ProjectsGetCall struct {
  37408. s *Service
  37409. profileId int64
  37410. id int64
  37411. urlParams_ gensupport.URLParams
  37412. ifNoneMatch_ string
  37413. ctx_ context.Context
  37414. header_ http.Header
  37415. }
  37416. // Get: Gets one project by ID.
  37417. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  37418. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37419. c.profileId = profileId
  37420. c.id = id
  37421. return c
  37422. }
  37423. // Fields allows partial responses to be retrieved. See
  37424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37425. // for more information.
  37426. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  37427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37428. return c
  37429. }
  37430. // IfNoneMatch sets the optional parameter which makes the operation
  37431. // fail if the object's ETag matches the given value. This is useful for
  37432. // getting updates only after the object has changed since the last
  37433. // request. Use googleapi.IsNotModified to check whether the response
  37434. // error from Do is the result of In-None-Match.
  37435. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  37436. c.ifNoneMatch_ = entityTag
  37437. return c
  37438. }
  37439. // Context sets the context to be used in this call's Do method. Any
  37440. // pending HTTP request will be aborted if the provided context is
  37441. // canceled.
  37442. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  37443. c.ctx_ = ctx
  37444. return c
  37445. }
  37446. // Header returns an http.Header that can be modified by the caller to
  37447. // add HTTP headers to the request.
  37448. func (c *ProjectsGetCall) Header() http.Header {
  37449. if c.header_ == nil {
  37450. c.header_ = make(http.Header)
  37451. }
  37452. return c.header_
  37453. }
  37454. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  37455. reqHeaders := make(http.Header)
  37456. for k, v := range c.header_ {
  37457. reqHeaders[k] = v
  37458. }
  37459. reqHeaders.Set("User-Agent", c.s.userAgent())
  37460. if c.ifNoneMatch_ != "" {
  37461. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37462. }
  37463. var body io.Reader = nil
  37464. c.urlParams_.Set("alt", alt)
  37465. c.urlParams_.Set("prettyPrint", "false")
  37466. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  37467. urls += "?" + c.urlParams_.Encode()
  37468. req, err := http.NewRequest("GET", urls, body)
  37469. if err != nil {
  37470. return nil, err
  37471. }
  37472. req.Header = reqHeaders
  37473. googleapi.Expand(req.URL, map[string]string{
  37474. "profileId": strconv.FormatInt(c.profileId, 10),
  37475. "id": strconv.FormatInt(c.id, 10),
  37476. })
  37477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37478. }
  37479. // Do executes the "dfareporting.projects.get" call.
  37480. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  37481. // code is an error. Response headers are in either
  37482. // *Project.ServerResponse.Header or (if a response was returned at all)
  37483. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  37484. // check whether the returned error was because http.StatusNotModified
  37485. // was returned.
  37486. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  37487. gensupport.SetOptions(c.urlParams_, opts...)
  37488. res, err := c.doRequest("json")
  37489. if res != nil && res.StatusCode == http.StatusNotModified {
  37490. if res.Body != nil {
  37491. res.Body.Close()
  37492. }
  37493. return nil, &googleapi.Error{
  37494. Code: res.StatusCode,
  37495. Header: res.Header,
  37496. }
  37497. }
  37498. if err != nil {
  37499. return nil, err
  37500. }
  37501. defer googleapi.CloseBody(res)
  37502. if err := googleapi.CheckResponse(res); err != nil {
  37503. return nil, err
  37504. }
  37505. ret := &Project{
  37506. ServerResponse: googleapi.ServerResponse{
  37507. Header: res.Header,
  37508. HTTPStatusCode: res.StatusCode,
  37509. },
  37510. }
  37511. target := &ret
  37512. if err := gensupport.DecodeResponse(target, res); err != nil {
  37513. return nil, err
  37514. }
  37515. return ret, nil
  37516. // {
  37517. // "description": "Gets one project by ID.",
  37518. // "httpMethod": "GET",
  37519. // "id": "dfareporting.projects.get",
  37520. // "parameterOrder": [
  37521. // "profileId",
  37522. // "id"
  37523. // ],
  37524. // "parameters": {
  37525. // "id": {
  37526. // "description": "Project ID.",
  37527. // "format": "int64",
  37528. // "location": "path",
  37529. // "required": true,
  37530. // "type": "string"
  37531. // },
  37532. // "profileId": {
  37533. // "description": "User profile ID associated with this request.",
  37534. // "format": "int64",
  37535. // "location": "path",
  37536. // "required": true,
  37537. // "type": "string"
  37538. // }
  37539. // },
  37540. // "path": "userprofiles/{profileId}/projects/{id}",
  37541. // "response": {
  37542. // "$ref": "Project"
  37543. // },
  37544. // "scopes": [
  37545. // "https://www.googleapis.com/auth/dfatrafficking"
  37546. // ]
  37547. // }
  37548. }
  37549. // method id "dfareporting.projects.list":
  37550. type ProjectsListCall struct {
  37551. s *Service
  37552. profileId int64
  37553. urlParams_ gensupport.URLParams
  37554. ifNoneMatch_ string
  37555. ctx_ context.Context
  37556. header_ http.Header
  37557. }
  37558. // List: Retrieves a list of projects, possibly filtered. This method
  37559. // supports paging.
  37560. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  37561. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37562. c.profileId = profileId
  37563. return c
  37564. }
  37565. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  37566. // only projects with these advertiser IDs.
  37567. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  37568. var advertiserIds_ []string
  37569. for _, v := range advertiserIds {
  37570. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  37571. }
  37572. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  37573. return c
  37574. }
  37575. // Ids sets the optional parameter "ids": Select only projects with
  37576. // these IDs.
  37577. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  37578. var ids_ []string
  37579. for _, v := range ids {
  37580. ids_ = append(ids_, fmt.Sprint(v))
  37581. }
  37582. c.urlParams_.SetMulti("ids", ids_)
  37583. return c
  37584. }
  37585. // MaxResults sets the optional parameter "maxResults": Maximum number
  37586. // of results to return.
  37587. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  37588. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37589. return c
  37590. }
  37591. // PageToken sets the optional parameter "pageToken": Value of the
  37592. // nextPageToken from the previous result page.
  37593. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  37594. c.urlParams_.Set("pageToken", pageToken)
  37595. return c
  37596. }
  37597. // SearchString sets the optional parameter "searchString": Allows
  37598. // searching for projects by name or ID. Wildcards (*) are allowed. For
  37599. // example, "project*2015" will return projects with names like "project
  37600. // June 2015", "project April 2015", or simply "project 2015". Most of
  37601. // the searches also add wildcards implicitly at the start and the end
  37602. // of the search string. For example, a search string of "project" will
  37603. // match projects with name "my project", "project 2015", or simply
  37604. // "project".
  37605. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  37606. c.urlParams_.Set("searchString", searchString)
  37607. return c
  37608. }
  37609. // SortField sets the optional parameter "sortField": Field by which to
  37610. // sort the list.
  37611. //
  37612. // Possible values:
  37613. // "ID" (default)
  37614. // "NAME"
  37615. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  37616. c.urlParams_.Set("sortField", sortField)
  37617. return c
  37618. }
  37619. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37620. // results.
  37621. //
  37622. // Possible values:
  37623. // "ASCENDING" (default)
  37624. // "DESCENDING"
  37625. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  37626. c.urlParams_.Set("sortOrder", sortOrder)
  37627. return c
  37628. }
  37629. // Fields allows partial responses to be retrieved. See
  37630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37631. // for more information.
  37632. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  37633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37634. return c
  37635. }
  37636. // IfNoneMatch sets the optional parameter which makes the operation
  37637. // fail if the object's ETag matches the given value. This is useful for
  37638. // getting updates only after the object has changed since the last
  37639. // request. Use googleapi.IsNotModified to check whether the response
  37640. // error from Do is the result of In-None-Match.
  37641. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  37642. c.ifNoneMatch_ = entityTag
  37643. return c
  37644. }
  37645. // Context sets the context to be used in this call's Do method. Any
  37646. // pending HTTP request will be aborted if the provided context is
  37647. // canceled.
  37648. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  37649. c.ctx_ = ctx
  37650. return c
  37651. }
  37652. // Header returns an http.Header that can be modified by the caller to
  37653. // add HTTP headers to the request.
  37654. func (c *ProjectsListCall) Header() http.Header {
  37655. if c.header_ == nil {
  37656. c.header_ = make(http.Header)
  37657. }
  37658. return c.header_
  37659. }
  37660. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  37661. reqHeaders := make(http.Header)
  37662. for k, v := range c.header_ {
  37663. reqHeaders[k] = v
  37664. }
  37665. reqHeaders.Set("User-Agent", c.s.userAgent())
  37666. if c.ifNoneMatch_ != "" {
  37667. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37668. }
  37669. var body io.Reader = nil
  37670. c.urlParams_.Set("alt", alt)
  37671. c.urlParams_.Set("prettyPrint", "false")
  37672. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  37673. urls += "?" + c.urlParams_.Encode()
  37674. req, err := http.NewRequest("GET", urls, body)
  37675. if err != nil {
  37676. return nil, err
  37677. }
  37678. req.Header = reqHeaders
  37679. googleapi.Expand(req.URL, map[string]string{
  37680. "profileId": strconv.FormatInt(c.profileId, 10),
  37681. })
  37682. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37683. }
  37684. // Do executes the "dfareporting.projects.list" call.
  37685. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  37686. // non-2xx status code is an error. Response headers are in either
  37687. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  37688. // returned at all) in error.(*googleapi.Error).Header. Use
  37689. // googleapi.IsNotModified to check whether the returned error was
  37690. // because http.StatusNotModified was returned.
  37691. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  37692. gensupport.SetOptions(c.urlParams_, opts...)
  37693. res, err := c.doRequest("json")
  37694. if res != nil && res.StatusCode == http.StatusNotModified {
  37695. if res.Body != nil {
  37696. res.Body.Close()
  37697. }
  37698. return nil, &googleapi.Error{
  37699. Code: res.StatusCode,
  37700. Header: res.Header,
  37701. }
  37702. }
  37703. if err != nil {
  37704. return nil, err
  37705. }
  37706. defer googleapi.CloseBody(res)
  37707. if err := googleapi.CheckResponse(res); err != nil {
  37708. return nil, err
  37709. }
  37710. ret := &ProjectsListResponse{
  37711. ServerResponse: googleapi.ServerResponse{
  37712. Header: res.Header,
  37713. HTTPStatusCode: res.StatusCode,
  37714. },
  37715. }
  37716. target := &ret
  37717. if err := gensupport.DecodeResponse(target, res); err != nil {
  37718. return nil, err
  37719. }
  37720. return ret, nil
  37721. // {
  37722. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  37723. // "httpMethod": "GET",
  37724. // "id": "dfareporting.projects.list",
  37725. // "parameterOrder": [
  37726. // "profileId"
  37727. // ],
  37728. // "parameters": {
  37729. // "advertiserIds": {
  37730. // "description": "Select only projects with these advertiser IDs.",
  37731. // "format": "int64",
  37732. // "location": "query",
  37733. // "repeated": true,
  37734. // "type": "string"
  37735. // },
  37736. // "ids": {
  37737. // "description": "Select only projects with these IDs.",
  37738. // "format": "int64",
  37739. // "location": "query",
  37740. // "repeated": true,
  37741. // "type": "string"
  37742. // },
  37743. // "maxResults": {
  37744. // "default": "1000",
  37745. // "description": "Maximum number of results to return.",
  37746. // "format": "int32",
  37747. // "location": "query",
  37748. // "maximum": "1000",
  37749. // "minimum": "0",
  37750. // "type": "integer"
  37751. // },
  37752. // "pageToken": {
  37753. // "description": "Value of the nextPageToken from the previous result page.",
  37754. // "location": "query",
  37755. // "type": "string"
  37756. // },
  37757. // "profileId": {
  37758. // "description": "User profile ID associated with this request.",
  37759. // "format": "int64",
  37760. // "location": "path",
  37761. // "required": true,
  37762. // "type": "string"
  37763. // },
  37764. // "searchString": {
  37765. // "description": "Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, \"project*2015\" will return projects with names like \"project June 2015\", \"project April 2015\", or simply \"project 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"project\" will match projects with name \"my project\", \"project 2015\", or simply \"project\".",
  37766. // "location": "query",
  37767. // "type": "string"
  37768. // },
  37769. // "sortField": {
  37770. // "default": "ID",
  37771. // "description": "Field by which to sort the list.",
  37772. // "enum": [
  37773. // "ID",
  37774. // "NAME"
  37775. // ],
  37776. // "enumDescriptions": [
  37777. // "",
  37778. // ""
  37779. // ],
  37780. // "location": "query",
  37781. // "type": "string"
  37782. // },
  37783. // "sortOrder": {
  37784. // "default": "ASCENDING",
  37785. // "description": "Order of sorted results.",
  37786. // "enum": [
  37787. // "ASCENDING",
  37788. // "DESCENDING"
  37789. // ],
  37790. // "enumDescriptions": [
  37791. // "",
  37792. // ""
  37793. // ],
  37794. // "location": "query",
  37795. // "type": "string"
  37796. // }
  37797. // },
  37798. // "path": "userprofiles/{profileId}/projects",
  37799. // "response": {
  37800. // "$ref": "ProjectsListResponse"
  37801. // },
  37802. // "scopes": [
  37803. // "https://www.googleapis.com/auth/dfatrafficking"
  37804. // ]
  37805. // }
  37806. }
  37807. // Pages invokes f for each page of results.
  37808. // A non-nil error returned from f will halt the iteration.
  37809. // The provided context supersedes any context provided to the Context method.
  37810. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  37811. c.ctx_ = ctx
  37812. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37813. for {
  37814. x, err := c.Do()
  37815. if err != nil {
  37816. return err
  37817. }
  37818. if err := f(x); err != nil {
  37819. return err
  37820. }
  37821. if x.NextPageToken == "" {
  37822. return nil
  37823. }
  37824. c.PageToken(x.NextPageToken)
  37825. }
  37826. }
  37827. // method id "dfareporting.regions.list":
  37828. type RegionsListCall struct {
  37829. s *Service
  37830. profileId int64
  37831. urlParams_ gensupport.URLParams
  37832. ifNoneMatch_ string
  37833. ctx_ context.Context
  37834. header_ http.Header
  37835. }
  37836. // List: Retrieves a list of regions.
  37837. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  37838. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37839. c.profileId = profileId
  37840. return c
  37841. }
  37842. // Fields allows partial responses to be retrieved. See
  37843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37844. // for more information.
  37845. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  37846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37847. return c
  37848. }
  37849. // IfNoneMatch sets the optional parameter which makes the operation
  37850. // fail if the object's ETag matches the given value. This is useful for
  37851. // getting updates only after the object has changed since the last
  37852. // request. Use googleapi.IsNotModified to check whether the response
  37853. // error from Do is the result of In-None-Match.
  37854. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  37855. c.ifNoneMatch_ = entityTag
  37856. return c
  37857. }
  37858. // Context sets the context to be used in this call's Do method. Any
  37859. // pending HTTP request will be aborted if the provided context is
  37860. // canceled.
  37861. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  37862. c.ctx_ = ctx
  37863. return c
  37864. }
  37865. // Header returns an http.Header that can be modified by the caller to
  37866. // add HTTP headers to the request.
  37867. func (c *RegionsListCall) Header() http.Header {
  37868. if c.header_ == nil {
  37869. c.header_ = make(http.Header)
  37870. }
  37871. return c.header_
  37872. }
  37873. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  37874. reqHeaders := make(http.Header)
  37875. for k, v := range c.header_ {
  37876. reqHeaders[k] = v
  37877. }
  37878. reqHeaders.Set("User-Agent", c.s.userAgent())
  37879. if c.ifNoneMatch_ != "" {
  37880. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37881. }
  37882. var body io.Reader = nil
  37883. c.urlParams_.Set("alt", alt)
  37884. c.urlParams_.Set("prettyPrint", "false")
  37885. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  37886. urls += "?" + c.urlParams_.Encode()
  37887. req, err := http.NewRequest("GET", urls, body)
  37888. if err != nil {
  37889. return nil, err
  37890. }
  37891. req.Header = reqHeaders
  37892. googleapi.Expand(req.URL, map[string]string{
  37893. "profileId": strconv.FormatInt(c.profileId, 10),
  37894. })
  37895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37896. }
  37897. // Do executes the "dfareporting.regions.list" call.
  37898. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  37899. // non-2xx status code is an error. Response headers are in either
  37900. // *RegionsListResponse.ServerResponse.Header or (if a response was
  37901. // returned at all) in error.(*googleapi.Error).Header. Use
  37902. // googleapi.IsNotModified to check whether the returned error was
  37903. // because http.StatusNotModified was returned.
  37904. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  37905. gensupport.SetOptions(c.urlParams_, opts...)
  37906. res, err := c.doRequest("json")
  37907. if res != nil && res.StatusCode == http.StatusNotModified {
  37908. if res.Body != nil {
  37909. res.Body.Close()
  37910. }
  37911. return nil, &googleapi.Error{
  37912. Code: res.StatusCode,
  37913. Header: res.Header,
  37914. }
  37915. }
  37916. if err != nil {
  37917. return nil, err
  37918. }
  37919. defer googleapi.CloseBody(res)
  37920. if err := googleapi.CheckResponse(res); err != nil {
  37921. return nil, err
  37922. }
  37923. ret := &RegionsListResponse{
  37924. ServerResponse: googleapi.ServerResponse{
  37925. Header: res.Header,
  37926. HTTPStatusCode: res.StatusCode,
  37927. },
  37928. }
  37929. target := &ret
  37930. if err := gensupport.DecodeResponse(target, res); err != nil {
  37931. return nil, err
  37932. }
  37933. return ret, nil
  37934. // {
  37935. // "description": "Retrieves a list of regions.",
  37936. // "httpMethod": "GET",
  37937. // "id": "dfareporting.regions.list",
  37938. // "parameterOrder": [
  37939. // "profileId"
  37940. // ],
  37941. // "parameters": {
  37942. // "profileId": {
  37943. // "description": "User profile ID associated with this request.",
  37944. // "format": "int64",
  37945. // "location": "path",
  37946. // "required": true,
  37947. // "type": "string"
  37948. // }
  37949. // },
  37950. // "path": "userprofiles/{profileId}/regions",
  37951. // "response": {
  37952. // "$ref": "RegionsListResponse"
  37953. // },
  37954. // "scopes": [
  37955. // "https://www.googleapis.com/auth/dfatrafficking"
  37956. // ]
  37957. // }
  37958. }
  37959. // method id "dfareporting.remarketingListShares.get":
  37960. type RemarketingListSharesGetCall struct {
  37961. s *Service
  37962. profileId int64
  37963. remarketingListId int64
  37964. urlParams_ gensupport.URLParams
  37965. ifNoneMatch_ string
  37966. ctx_ context.Context
  37967. header_ http.Header
  37968. }
  37969. // Get: Gets one remarketing list share by remarketing list ID.
  37970. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  37971. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37972. c.profileId = profileId
  37973. c.remarketingListId = remarketingListId
  37974. return c
  37975. }
  37976. // Fields allows partial responses to be retrieved. See
  37977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37978. // for more information.
  37979. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  37980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37981. return c
  37982. }
  37983. // IfNoneMatch sets the optional parameter which makes the operation
  37984. // fail if the object's ETag matches the given value. This is useful for
  37985. // getting updates only after the object has changed since the last
  37986. // request. Use googleapi.IsNotModified to check whether the response
  37987. // error from Do is the result of In-None-Match.
  37988. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  37989. c.ifNoneMatch_ = entityTag
  37990. return c
  37991. }
  37992. // Context sets the context to be used in this call's Do method. Any
  37993. // pending HTTP request will be aborted if the provided context is
  37994. // canceled.
  37995. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  37996. c.ctx_ = ctx
  37997. return c
  37998. }
  37999. // Header returns an http.Header that can be modified by the caller to
  38000. // add HTTP headers to the request.
  38001. func (c *RemarketingListSharesGetCall) Header() http.Header {
  38002. if c.header_ == nil {
  38003. c.header_ = make(http.Header)
  38004. }
  38005. return c.header_
  38006. }
  38007. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  38008. reqHeaders := make(http.Header)
  38009. for k, v := range c.header_ {
  38010. reqHeaders[k] = v
  38011. }
  38012. reqHeaders.Set("User-Agent", c.s.userAgent())
  38013. if c.ifNoneMatch_ != "" {
  38014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38015. }
  38016. var body io.Reader = nil
  38017. c.urlParams_.Set("alt", alt)
  38018. c.urlParams_.Set("prettyPrint", "false")
  38019. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  38020. urls += "?" + c.urlParams_.Encode()
  38021. req, err := http.NewRequest("GET", urls, body)
  38022. if err != nil {
  38023. return nil, err
  38024. }
  38025. req.Header = reqHeaders
  38026. googleapi.Expand(req.URL, map[string]string{
  38027. "profileId": strconv.FormatInt(c.profileId, 10),
  38028. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  38029. })
  38030. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38031. }
  38032. // Do executes the "dfareporting.remarketingListShares.get" call.
  38033. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38034. // non-2xx status code is an error. Response headers are in either
  38035. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38036. // returned at all) in error.(*googleapi.Error).Header. Use
  38037. // googleapi.IsNotModified to check whether the returned error was
  38038. // because http.StatusNotModified was returned.
  38039. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38040. gensupport.SetOptions(c.urlParams_, opts...)
  38041. res, err := c.doRequest("json")
  38042. if res != nil && res.StatusCode == http.StatusNotModified {
  38043. if res.Body != nil {
  38044. res.Body.Close()
  38045. }
  38046. return nil, &googleapi.Error{
  38047. Code: res.StatusCode,
  38048. Header: res.Header,
  38049. }
  38050. }
  38051. if err != nil {
  38052. return nil, err
  38053. }
  38054. defer googleapi.CloseBody(res)
  38055. if err := googleapi.CheckResponse(res); err != nil {
  38056. return nil, err
  38057. }
  38058. ret := &RemarketingListShare{
  38059. ServerResponse: googleapi.ServerResponse{
  38060. Header: res.Header,
  38061. HTTPStatusCode: res.StatusCode,
  38062. },
  38063. }
  38064. target := &ret
  38065. if err := gensupport.DecodeResponse(target, res); err != nil {
  38066. return nil, err
  38067. }
  38068. return ret, nil
  38069. // {
  38070. // "description": "Gets one remarketing list share by remarketing list ID.",
  38071. // "httpMethod": "GET",
  38072. // "id": "dfareporting.remarketingListShares.get",
  38073. // "parameterOrder": [
  38074. // "profileId",
  38075. // "remarketingListId"
  38076. // ],
  38077. // "parameters": {
  38078. // "profileId": {
  38079. // "description": "User profile ID associated with this request.",
  38080. // "format": "int64",
  38081. // "location": "path",
  38082. // "required": true,
  38083. // "type": "string"
  38084. // },
  38085. // "remarketingListId": {
  38086. // "description": "Remarketing list ID.",
  38087. // "format": "int64",
  38088. // "location": "path",
  38089. // "required": true,
  38090. // "type": "string"
  38091. // }
  38092. // },
  38093. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  38094. // "response": {
  38095. // "$ref": "RemarketingListShare"
  38096. // },
  38097. // "scopes": [
  38098. // "https://www.googleapis.com/auth/dfatrafficking"
  38099. // ]
  38100. // }
  38101. }
  38102. // method id "dfareporting.remarketingListShares.patch":
  38103. type RemarketingListSharesPatchCall struct {
  38104. s *Service
  38105. profileId int64
  38106. remarketinglistshare *RemarketingListShare
  38107. urlParams_ gensupport.URLParams
  38108. ctx_ context.Context
  38109. header_ http.Header
  38110. }
  38111. // Patch: Updates an existing remarketing list share. This method
  38112. // supports patch semantics.
  38113. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  38114. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38115. c.profileId = profileId
  38116. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  38117. c.remarketinglistshare = remarketinglistshare
  38118. return c
  38119. }
  38120. // Fields allows partial responses to be retrieved. See
  38121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38122. // for more information.
  38123. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  38124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38125. return c
  38126. }
  38127. // Context sets the context to be used in this call's Do method. Any
  38128. // pending HTTP request will be aborted if the provided context is
  38129. // canceled.
  38130. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  38131. c.ctx_ = ctx
  38132. return c
  38133. }
  38134. // Header returns an http.Header that can be modified by the caller to
  38135. // add HTTP headers to the request.
  38136. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  38137. if c.header_ == nil {
  38138. c.header_ = make(http.Header)
  38139. }
  38140. return c.header_
  38141. }
  38142. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  38143. reqHeaders := make(http.Header)
  38144. for k, v := range c.header_ {
  38145. reqHeaders[k] = v
  38146. }
  38147. reqHeaders.Set("User-Agent", c.s.userAgent())
  38148. var body io.Reader = nil
  38149. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38150. if err != nil {
  38151. return nil, err
  38152. }
  38153. reqHeaders.Set("Content-Type", "application/json")
  38154. c.urlParams_.Set("alt", alt)
  38155. c.urlParams_.Set("prettyPrint", "false")
  38156. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38157. urls += "?" + c.urlParams_.Encode()
  38158. req, err := http.NewRequest("PATCH", urls, body)
  38159. if err != nil {
  38160. return nil, err
  38161. }
  38162. req.Header = reqHeaders
  38163. googleapi.Expand(req.URL, map[string]string{
  38164. "profileId": strconv.FormatInt(c.profileId, 10),
  38165. })
  38166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38167. }
  38168. // Do executes the "dfareporting.remarketingListShares.patch" call.
  38169. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38170. // non-2xx status code is an error. Response headers are in either
  38171. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38172. // returned at all) in error.(*googleapi.Error).Header. Use
  38173. // googleapi.IsNotModified to check whether the returned error was
  38174. // because http.StatusNotModified was returned.
  38175. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38176. gensupport.SetOptions(c.urlParams_, opts...)
  38177. res, err := c.doRequest("json")
  38178. if res != nil && res.StatusCode == http.StatusNotModified {
  38179. if res.Body != nil {
  38180. res.Body.Close()
  38181. }
  38182. return nil, &googleapi.Error{
  38183. Code: res.StatusCode,
  38184. Header: res.Header,
  38185. }
  38186. }
  38187. if err != nil {
  38188. return nil, err
  38189. }
  38190. defer googleapi.CloseBody(res)
  38191. if err := googleapi.CheckResponse(res); err != nil {
  38192. return nil, err
  38193. }
  38194. ret := &RemarketingListShare{
  38195. ServerResponse: googleapi.ServerResponse{
  38196. Header: res.Header,
  38197. HTTPStatusCode: res.StatusCode,
  38198. },
  38199. }
  38200. target := &ret
  38201. if err := gensupport.DecodeResponse(target, res); err != nil {
  38202. return nil, err
  38203. }
  38204. return ret, nil
  38205. // {
  38206. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  38207. // "httpMethod": "PATCH",
  38208. // "id": "dfareporting.remarketingListShares.patch",
  38209. // "parameterOrder": [
  38210. // "profileId",
  38211. // "remarketingListId"
  38212. // ],
  38213. // "parameters": {
  38214. // "profileId": {
  38215. // "description": "User profile ID associated with this request.",
  38216. // "format": "int64",
  38217. // "location": "path",
  38218. // "required": true,
  38219. // "type": "string"
  38220. // },
  38221. // "remarketingListId": {
  38222. // "description": "Remarketing list ID.",
  38223. // "format": "int64",
  38224. // "location": "query",
  38225. // "required": true,
  38226. // "type": "string"
  38227. // }
  38228. // },
  38229. // "path": "userprofiles/{profileId}/remarketingListShares",
  38230. // "request": {
  38231. // "$ref": "RemarketingListShare"
  38232. // },
  38233. // "response": {
  38234. // "$ref": "RemarketingListShare"
  38235. // },
  38236. // "scopes": [
  38237. // "https://www.googleapis.com/auth/dfatrafficking"
  38238. // ]
  38239. // }
  38240. }
  38241. // method id "dfareporting.remarketingListShares.update":
  38242. type RemarketingListSharesUpdateCall struct {
  38243. s *Service
  38244. profileId int64
  38245. remarketinglistshare *RemarketingListShare
  38246. urlParams_ gensupport.URLParams
  38247. ctx_ context.Context
  38248. header_ http.Header
  38249. }
  38250. // Update: Updates an existing remarketing list share.
  38251. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  38252. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38253. c.profileId = profileId
  38254. c.remarketinglistshare = remarketinglistshare
  38255. return c
  38256. }
  38257. // Fields allows partial responses to be retrieved. See
  38258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38259. // for more information.
  38260. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  38261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38262. return c
  38263. }
  38264. // Context sets the context to be used in this call's Do method. Any
  38265. // pending HTTP request will be aborted if the provided context is
  38266. // canceled.
  38267. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  38268. c.ctx_ = ctx
  38269. return c
  38270. }
  38271. // Header returns an http.Header that can be modified by the caller to
  38272. // add HTTP headers to the request.
  38273. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  38274. if c.header_ == nil {
  38275. c.header_ = make(http.Header)
  38276. }
  38277. return c.header_
  38278. }
  38279. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  38280. reqHeaders := make(http.Header)
  38281. for k, v := range c.header_ {
  38282. reqHeaders[k] = v
  38283. }
  38284. reqHeaders.Set("User-Agent", c.s.userAgent())
  38285. var body io.Reader = nil
  38286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  38287. if err != nil {
  38288. return nil, err
  38289. }
  38290. reqHeaders.Set("Content-Type", "application/json")
  38291. c.urlParams_.Set("alt", alt)
  38292. c.urlParams_.Set("prettyPrint", "false")
  38293. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  38294. urls += "?" + c.urlParams_.Encode()
  38295. req, err := http.NewRequest("PUT", urls, body)
  38296. if err != nil {
  38297. return nil, err
  38298. }
  38299. req.Header = reqHeaders
  38300. googleapi.Expand(req.URL, map[string]string{
  38301. "profileId": strconv.FormatInt(c.profileId, 10),
  38302. })
  38303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38304. }
  38305. // Do executes the "dfareporting.remarketingListShares.update" call.
  38306. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  38307. // non-2xx status code is an error. Response headers are in either
  38308. // *RemarketingListShare.ServerResponse.Header or (if a response was
  38309. // returned at all) in error.(*googleapi.Error).Header. Use
  38310. // googleapi.IsNotModified to check whether the returned error was
  38311. // because http.StatusNotModified was returned.
  38312. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  38313. gensupport.SetOptions(c.urlParams_, opts...)
  38314. res, err := c.doRequest("json")
  38315. if res != nil && res.StatusCode == http.StatusNotModified {
  38316. if res.Body != nil {
  38317. res.Body.Close()
  38318. }
  38319. return nil, &googleapi.Error{
  38320. Code: res.StatusCode,
  38321. Header: res.Header,
  38322. }
  38323. }
  38324. if err != nil {
  38325. return nil, err
  38326. }
  38327. defer googleapi.CloseBody(res)
  38328. if err := googleapi.CheckResponse(res); err != nil {
  38329. return nil, err
  38330. }
  38331. ret := &RemarketingListShare{
  38332. ServerResponse: googleapi.ServerResponse{
  38333. Header: res.Header,
  38334. HTTPStatusCode: res.StatusCode,
  38335. },
  38336. }
  38337. target := &ret
  38338. if err := gensupport.DecodeResponse(target, res); err != nil {
  38339. return nil, err
  38340. }
  38341. return ret, nil
  38342. // {
  38343. // "description": "Updates an existing remarketing list share.",
  38344. // "httpMethod": "PUT",
  38345. // "id": "dfareporting.remarketingListShares.update",
  38346. // "parameterOrder": [
  38347. // "profileId"
  38348. // ],
  38349. // "parameters": {
  38350. // "profileId": {
  38351. // "description": "User profile ID associated with this request.",
  38352. // "format": "int64",
  38353. // "location": "path",
  38354. // "required": true,
  38355. // "type": "string"
  38356. // }
  38357. // },
  38358. // "path": "userprofiles/{profileId}/remarketingListShares",
  38359. // "request": {
  38360. // "$ref": "RemarketingListShare"
  38361. // },
  38362. // "response": {
  38363. // "$ref": "RemarketingListShare"
  38364. // },
  38365. // "scopes": [
  38366. // "https://www.googleapis.com/auth/dfatrafficking"
  38367. // ]
  38368. // }
  38369. }
  38370. // method id "dfareporting.remarketingLists.get":
  38371. type RemarketingListsGetCall struct {
  38372. s *Service
  38373. profileId int64
  38374. id int64
  38375. urlParams_ gensupport.URLParams
  38376. ifNoneMatch_ string
  38377. ctx_ context.Context
  38378. header_ http.Header
  38379. }
  38380. // Get: Gets one remarketing list by ID.
  38381. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  38382. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38383. c.profileId = profileId
  38384. c.id = id
  38385. return c
  38386. }
  38387. // Fields allows partial responses to be retrieved. See
  38388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38389. // for more information.
  38390. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  38391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38392. return c
  38393. }
  38394. // IfNoneMatch sets the optional parameter which makes the operation
  38395. // fail if the object's ETag matches the given value. This is useful for
  38396. // getting updates only after the object has changed since the last
  38397. // request. Use googleapi.IsNotModified to check whether the response
  38398. // error from Do is the result of In-None-Match.
  38399. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  38400. c.ifNoneMatch_ = entityTag
  38401. return c
  38402. }
  38403. // Context sets the context to be used in this call's Do method. Any
  38404. // pending HTTP request will be aborted if the provided context is
  38405. // canceled.
  38406. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  38407. c.ctx_ = ctx
  38408. return c
  38409. }
  38410. // Header returns an http.Header that can be modified by the caller to
  38411. // add HTTP headers to the request.
  38412. func (c *RemarketingListsGetCall) Header() http.Header {
  38413. if c.header_ == nil {
  38414. c.header_ = make(http.Header)
  38415. }
  38416. return c.header_
  38417. }
  38418. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  38419. reqHeaders := make(http.Header)
  38420. for k, v := range c.header_ {
  38421. reqHeaders[k] = v
  38422. }
  38423. reqHeaders.Set("User-Agent", c.s.userAgent())
  38424. if c.ifNoneMatch_ != "" {
  38425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38426. }
  38427. var body io.Reader = nil
  38428. c.urlParams_.Set("alt", alt)
  38429. c.urlParams_.Set("prettyPrint", "false")
  38430. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  38431. urls += "?" + c.urlParams_.Encode()
  38432. req, err := http.NewRequest("GET", urls, body)
  38433. if err != nil {
  38434. return nil, err
  38435. }
  38436. req.Header = reqHeaders
  38437. googleapi.Expand(req.URL, map[string]string{
  38438. "profileId": strconv.FormatInt(c.profileId, 10),
  38439. "id": strconv.FormatInt(c.id, 10),
  38440. })
  38441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38442. }
  38443. // Do executes the "dfareporting.remarketingLists.get" call.
  38444. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38445. // status code is an error. Response headers are in either
  38446. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38447. // at all) in error.(*googleapi.Error).Header. Use
  38448. // googleapi.IsNotModified to check whether the returned error was
  38449. // because http.StatusNotModified was returned.
  38450. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38451. gensupport.SetOptions(c.urlParams_, opts...)
  38452. res, err := c.doRequest("json")
  38453. if res != nil && res.StatusCode == http.StatusNotModified {
  38454. if res.Body != nil {
  38455. res.Body.Close()
  38456. }
  38457. return nil, &googleapi.Error{
  38458. Code: res.StatusCode,
  38459. Header: res.Header,
  38460. }
  38461. }
  38462. if err != nil {
  38463. return nil, err
  38464. }
  38465. defer googleapi.CloseBody(res)
  38466. if err := googleapi.CheckResponse(res); err != nil {
  38467. return nil, err
  38468. }
  38469. ret := &RemarketingList{
  38470. ServerResponse: googleapi.ServerResponse{
  38471. Header: res.Header,
  38472. HTTPStatusCode: res.StatusCode,
  38473. },
  38474. }
  38475. target := &ret
  38476. if err := gensupport.DecodeResponse(target, res); err != nil {
  38477. return nil, err
  38478. }
  38479. return ret, nil
  38480. // {
  38481. // "description": "Gets one remarketing list by ID.",
  38482. // "httpMethod": "GET",
  38483. // "id": "dfareporting.remarketingLists.get",
  38484. // "parameterOrder": [
  38485. // "profileId",
  38486. // "id"
  38487. // ],
  38488. // "parameters": {
  38489. // "id": {
  38490. // "description": "Remarketing list ID.",
  38491. // "format": "int64",
  38492. // "location": "path",
  38493. // "required": true,
  38494. // "type": "string"
  38495. // },
  38496. // "profileId": {
  38497. // "description": "User profile ID associated with this request.",
  38498. // "format": "int64",
  38499. // "location": "path",
  38500. // "required": true,
  38501. // "type": "string"
  38502. // }
  38503. // },
  38504. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  38505. // "response": {
  38506. // "$ref": "RemarketingList"
  38507. // },
  38508. // "scopes": [
  38509. // "https://www.googleapis.com/auth/dfatrafficking"
  38510. // ]
  38511. // }
  38512. }
  38513. // method id "dfareporting.remarketingLists.insert":
  38514. type RemarketingListsInsertCall struct {
  38515. s *Service
  38516. profileId int64
  38517. remarketinglist *RemarketingList
  38518. urlParams_ gensupport.URLParams
  38519. ctx_ context.Context
  38520. header_ http.Header
  38521. }
  38522. // Insert: Inserts a new remarketing list.
  38523. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  38524. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38525. c.profileId = profileId
  38526. c.remarketinglist = remarketinglist
  38527. return c
  38528. }
  38529. // Fields allows partial responses to be retrieved. See
  38530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38531. // for more information.
  38532. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  38533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38534. return c
  38535. }
  38536. // Context sets the context to be used in this call's Do method. Any
  38537. // pending HTTP request will be aborted if the provided context is
  38538. // canceled.
  38539. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  38540. c.ctx_ = ctx
  38541. return c
  38542. }
  38543. // Header returns an http.Header that can be modified by the caller to
  38544. // add HTTP headers to the request.
  38545. func (c *RemarketingListsInsertCall) Header() http.Header {
  38546. if c.header_ == nil {
  38547. c.header_ = make(http.Header)
  38548. }
  38549. return c.header_
  38550. }
  38551. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  38552. reqHeaders := make(http.Header)
  38553. for k, v := range c.header_ {
  38554. reqHeaders[k] = v
  38555. }
  38556. reqHeaders.Set("User-Agent", c.s.userAgent())
  38557. var body io.Reader = nil
  38558. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38559. if err != nil {
  38560. return nil, err
  38561. }
  38562. reqHeaders.Set("Content-Type", "application/json")
  38563. c.urlParams_.Set("alt", alt)
  38564. c.urlParams_.Set("prettyPrint", "false")
  38565. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38566. urls += "?" + c.urlParams_.Encode()
  38567. req, err := http.NewRequest("POST", urls, body)
  38568. if err != nil {
  38569. return nil, err
  38570. }
  38571. req.Header = reqHeaders
  38572. googleapi.Expand(req.URL, map[string]string{
  38573. "profileId": strconv.FormatInt(c.profileId, 10),
  38574. })
  38575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38576. }
  38577. // Do executes the "dfareporting.remarketingLists.insert" call.
  38578. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38579. // status code is an error. Response headers are in either
  38580. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38581. // at all) in error.(*googleapi.Error).Header. Use
  38582. // googleapi.IsNotModified to check whether the returned error was
  38583. // because http.StatusNotModified was returned.
  38584. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38585. gensupport.SetOptions(c.urlParams_, opts...)
  38586. res, err := c.doRequest("json")
  38587. if res != nil && res.StatusCode == http.StatusNotModified {
  38588. if res.Body != nil {
  38589. res.Body.Close()
  38590. }
  38591. return nil, &googleapi.Error{
  38592. Code: res.StatusCode,
  38593. Header: res.Header,
  38594. }
  38595. }
  38596. if err != nil {
  38597. return nil, err
  38598. }
  38599. defer googleapi.CloseBody(res)
  38600. if err := googleapi.CheckResponse(res); err != nil {
  38601. return nil, err
  38602. }
  38603. ret := &RemarketingList{
  38604. ServerResponse: googleapi.ServerResponse{
  38605. Header: res.Header,
  38606. HTTPStatusCode: res.StatusCode,
  38607. },
  38608. }
  38609. target := &ret
  38610. if err := gensupport.DecodeResponse(target, res); err != nil {
  38611. return nil, err
  38612. }
  38613. return ret, nil
  38614. // {
  38615. // "description": "Inserts a new remarketing list.",
  38616. // "httpMethod": "POST",
  38617. // "id": "dfareporting.remarketingLists.insert",
  38618. // "parameterOrder": [
  38619. // "profileId"
  38620. // ],
  38621. // "parameters": {
  38622. // "profileId": {
  38623. // "description": "User profile ID associated with this request.",
  38624. // "format": "int64",
  38625. // "location": "path",
  38626. // "required": true,
  38627. // "type": "string"
  38628. // }
  38629. // },
  38630. // "path": "userprofiles/{profileId}/remarketingLists",
  38631. // "request": {
  38632. // "$ref": "RemarketingList"
  38633. // },
  38634. // "response": {
  38635. // "$ref": "RemarketingList"
  38636. // },
  38637. // "scopes": [
  38638. // "https://www.googleapis.com/auth/dfatrafficking"
  38639. // ]
  38640. // }
  38641. }
  38642. // method id "dfareporting.remarketingLists.list":
  38643. type RemarketingListsListCall struct {
  38644. s *Service
  38645. profileId int64
  38646. urlParams_ gensupport.URLParams
  38647. ifNoneMatch_ string
  38648. ctx_ context.Context
  38649. header_ http.Header
  38650. }
  38651. // List: Retrieves a list of remarketing lists, possibly filtered. This
  38652. // method supports paging.
  38653. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  38654. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38655. c.profileId = profileId
  38656. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  38657. return c
  38658. }
  38659. // Active sets the optional parameter "active": Select only active or
  38660. // only inactive remarketing lists.
  38661. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  38662. c.urlParams_.Set("active", fmt.Sprint(active))
  38663. return c
  38664. }
  38665. // FloodlightActivityId sets the optional parameter
  38666. // "floodlightActivityId": Select only remarketing lists that have this
  38667. // floodlight activity ID.
  38668. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  38669. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  38670. return c
  38671. }
  38672. // MaxResults sets the optional parameter "maxResults": Maximum number
  38673. // of results to return.
  38674. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  38675. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38676. return c
  38677. }
  38678. // Name sets the optional parameter "name": Allows searching for objects
  38679. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  38680. // list*2015" will return objects with names like "remarketing list June
  38681. // 2015", "remarketing list April 2015", or simply "remarketing list
  38682. // 2015". Most of the searches also add wildcards implicitly at the
  38683. // start and the end of the search string. For example, a search string
  38684. // of "remarketing list" will match objects with name "my remarketing
  38685. // list", "remarketing list 2015", or simply "remarketing list".
  38686. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  38687. c.urlParams_.Set("name", name)
  38688. return c
  38689. }
  38690. // PageToken sets the optional parameter "pageToken": Value of the
  38691. // nextPageToken from the previous result page.
  38692. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  38693. c.urlParams_.Set("pageToken", pageToken)
  38694. return c
  38695. }
  38696. // SortField sets the optional parameter "sortField": Field by which to
  38697. // sort the list.
  38698. //
  38699. // Possible values:
  38700. // "ID" (default)
  38701. // "NAME"
  38702. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  38703. c.urlParams_.Set("sortField", sortField)
  38704. return c
  38705. }
  38706. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38707. // results.
  38708. //
  38709. // Possible values:
  38710. // "ASCENDING" (default)
  38711. // "DESCENDING"
  38712. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  38713. c.urlParams_.Set("sortOrder", sortOrder)
  38714. return c
  38715. }
  38716. // Fields allows partial responses to be retrieved. See
  38717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38718. // for more information.
  38719. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  38720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38721. return c
  38722. }
  38723. // IfNoneMatch sets the optional parameter which makes the operation
  38724. // fail if the object's ETag matches the given value. This is useful for
  38725. // getting updates only after the object has changed since the last
  38726. // request. Use googleapi.IsNotModified to check whether the response
  38727. // error from Do is the result of In-None-Match.
  38728. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  38729. c.ifNoneMatch_ = entityTag
  38730. return c
  38731. }
  38732. // Context sets the context to be used in this call's Do method. Any
  38733. // pending HTTP request will be aborted if the provided context is
  38734. // canceled.
  38735. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  38736. c.ctx_ = ctx
  38737. return c
  38738. }
  38739. // Header returns an http.Header that can be modified by the caller to
  38740. // add HTTP headers to the request.
  38741. func (c *RemarketingListsListCall) Header() http.Header {
  38742. if c.header_ == nil {
  38743. c.header_ = make(http.Header)
  38744. }
  38745. return c.header_
  38746. }
  38747. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  38748. reqHeaders := make(http.Header)
  38749. for k, v := range c.header_ {
  38750. reqHeaders[k] = v
  38751. }
  38752. reqHeaders.Set("User-Agent", c.s.userAgent())
  38753. if c.ifNoneMatch_ != "" {
  38754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38755. }
  38756. var body io.Reader = nil
  38757. c.urlParams_.Set("alt", alt)
  38758. c.urlParams_.Set("prettyPrint", "false")
  38759. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38760. urls += "?" + c.urlParams_.Encode()
  38761. req, err := http.NewRequest("GET", urls, body)
  38762. if err != nil {
  38763. return nil, err
  38764. }
  38765. req.Header = reqHeaders
  38766. googleapi.Expand(req.URL, map[string]string{
  38767. "profileId": strconv.FormatInt(c.profileId, 10),
  38768. })
  38769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38770. }
  38771. // Do executes the "dfareporting.remarketingLists.list" call.
  38772. // Exactly one of *RemarketingListsListResponse or error will be
  38773. // non-nil. Any non-2xx status code is an error. Response headers are in
  38774. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  38775. // response was returned at all) in error.(*googleapi.Error).Header. Use
  38776. // googleapi.IsNotModified to check whether the returned error was
  38777. // because http.StatusNotModified was returned.
  38778. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  38779. gensupport.SetOptions(c.urlParams_, opts...)
  38780. res, err := c.doRequest("json")
  38781. if res != nil && res.StatusCode == http.StatusNotModified {
  38782. if res.Body != nil {
  38783. res.Body.Close()
  38784. }
  38785. return nil, &googleapi.Error{
  38786. Code: res.StatusCode,
  38787. Header: res.Header,
  38788. }
  38789. }
  38790. if err != nil {
  38791. return nil, err
  38792. }
  38793. defer googleapi.CloseBody(res)
  38794. if err := googleapi.CheckResponse(res); err != nil {
  38795. return nil, err
  38796. }
  38797. ret := &RemarketingListsListResponse{
  38798. ServerResponse: googleapi.ServerResponse{
  38799. Header: res.Header,
  38800. HTTPStatusCode: res.StatusCode,
  38801. },
  38802. }
  38803. target := &ret
  38804. if err := gensupport.DecodeResponse(target, res); err != nil {
  38805. return nil, err
  38806. }
  38807. return ret, nil
  38808. // {
  38809. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  38810. // "httpMethod": "GET",
  38811. // "id": "dfareporting.remarketingLists.list",
  38812. // "parameterOrder": [
  38813. // "profileId",
  38814. // "advertiserId"
  38815. // ],
  38816. // "parameters": {
  38817. // "active": {
  38818. // "description": "Select only active or only inactive remarketing lists.",
  38819. // "location": "query",
  38820. // "type": "boolean"
  38821. // },
  38822. // "advertiserId": {
  38823. // "description": "Select only remarketing lists owned by this advertiser.",
  38824. // "format": "int64",
  38825. // "location": "query",
  38826. // "required": true,
  38827. // "type": "string"
  38828. // },
  38829. // "floodlightActivityId": {
  38830. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  38831. // "format": "int64",
  38832. // "location": "query",
  38833. // "type": "string"
  38834. // },
  38835. // "maxResults": {
  38836. // "default": "1000",
  38837. // "description": "Maximum number of results to return.",
  38838. // "format": "int32",
  38839. // "location": "query",
  38840. // "maximum": "1000",
  38841. // "minimum": "0",
  38842. // "type": "integer"
  38843. // },
  38844. // "name": {
  38845. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".",
  38846. // "location": "query",
  38847. // "type": "string"
  38848. // },
  38849. // "pageToken": {
  38850. // "description": "Value of the nextPageToken from the previous result page.",
  38851. // "location": "query",
  38852. // "type": "string"
  38853. // },
  38854. // "profileId": {
  38855. // "description": "User profile ID associated with this request.",
  38856. // "format": "int64",
  38857. // "location": "path",
  38858. // "required": true,
  38859. // "type": "string"
  38860. // },
  38861. // "sortField": {
  38862. // "default": "ID",
  38863. // "description": "Field by which to sort the list.",
  38864. // "enum": [
  38865. // "ID",
  38866. // "NAME"
  38867. // ],
  38868. // "enumDescriptions": [
  38869. // "",
  38870. // ""
  38871. // ],
  38872. // "location": "query",
  38873. // "type": "string"
  38874. // },
  38875. // "sortOrder": {
  38876. // "default": "ASCENDING",
  38877. // "description": "Order of sorted results.",
  38878. // "enum": [
  38879. // "ASCENDING",
  38880. // "DESCENDING"
  38881. // ],
  38882. // "enumDescriptions": [
  38883. // "",
  38884. // ""
  38885. // ],
  38886. // "location": "query",
  38887. // "type": "string"
  38888. // }
  38889. // },
  38890. // "path": "userprofiles/{profileId}/remarketingLists",
  38891. // "response": {
  38892. // "$ref": "RemarketingListsListResponse"
  38893. // },
  38894. // "scopes": [
  38895. // "https://www.googleapis.com/auth/dfatrafficking"
  38896. // ]
  38897. // }
  38898. }
  38899. // Pages invokes f for each page of results.
  38900. // A non-nil error returned from f will halt the iteration.
  38901. // The provided context supersedes any context provided to the Context method.
  38902. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  38903. c.ctx_ = ctx
  38904. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38905. for {
  38906. x, err := c.Do()
  38907. if err != nil {
  38908. return err
  38909. }
  38910. if err := f(x); err != nil {
  38911. return err
  38912. }
  38913. if x.NextPageToken == "" {
  38914. return nil
  38915. }
  38916. c.PageToken(x.NextPageToken)
  38917. }
  38918. }
  38919. // method id "dfareporting.remarketingLists.patch":
  38920. type RemarketingListsPatchCall struct {
  38921. s *Service
  38922. profileId int64
  38923. remarketinglist *RemarketingList
  38924. urlParams_ gensupport.URLParams
  38925. ctx_ context.Context
  38926. header_ http.Header
  38927. }
  38928. // Patch: Updates an existing remarketing list. This method supports
  38929. // patch semantics.
  38930. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  38931. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38932. c.profileId = profileId
  38933. c.urlParams_.Set("id", fmt.Sprint(id))
  38934. c.remarketinglist = remarketinglist
  38935. return c
  38936. }
  38937. // Fields allows partial responses to be retrieved. See
  38938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38939. // for more information.
  38940. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  38941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38942. return c
  38943. }
  38944. // Context sets the context to be used in this call's Do method. Any
  38945. // pending HTTP request will be aborted if the provided context is
  38946. // canceled.
  38947. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  38948. c.ctx_ = ctx
  38949. return c
  38950. }
  38951. // Header returns an http.Header that can be modified by the caller to
  38952. // add HTTP headers to the request.
  38953. func (c *RemarketingListsPatchCall) Header() http.Header {
  38954. if c.header_ == nil {
  38955. c.header_ = make(http.Header)
  38956. }
  38957. return c.header_
  38958. }
  38959. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  38960. reqHeaders := make(http.Header)
  38961. for k, v := range c.header_ {
  38962. reqHeaders[k] = v
  38963. }
  38964. reqHeaders.Set("User-Agent", c.s.userAgent())
  38965. var body io.Reader = nil
  38966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38967. if err != nil {
  38968. return nil, err
  38969. }
  38970. reqHeaders.Set("Content-Type", "application/json")
  38971. c.urlParams_.Set("alt", alt)
  38972. c.urlParams_.Set("prettyPrint", "false")
  38973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38974. urls += "?" + c.urlParams_.Encode()
  38975. req, err := http.NewRequest("PATCH", urls, body)
  38976. if err != nil {
  38977. return nil, err
  38978. }
  38979. req.Header = reqHeaders
  38980. googleapi.Expand(req.URL, map[string]string{
  38981. "profileId": strconv.FormatInt(c.profileId, 10),
  38982. })
  38983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38984. }
  38985. // Do executes the "dfareporting.remarketingLists.patch" call.
  38986. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38987. // status code is an error. Response headers are in either
  38988. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38989. // at all) in error.(*googleapi.Error).Header. Use
  38990. // googleapi.IsNotModified to check whether the returned error was
  38991. // because http.StatusNotModified was returned.
  38992. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38993. gensupport.SetOptions(c.urlParams_, opts...)
  38994. res, err := c.doRequest("json")
  38995. if res != nil && res.StatusCode == http.StatusNotModified {
  38996. if res.Body != nil {
  38997. res.Body.Close()
  38998. }
  38999. return nil, &googleapi.Error{
  39000. Code: res.StatusCode,
  39001. Header: res.Header,
  39002. }
  39003. }
  39004. if err != nil {
  39005. return nil, err
  39006. }
  39007. defer googleapi.CloseBody(res)
  39008. if err := googleapi.CheckResponse(res); err != nil {
  39009. return nil, err
  39010. }
  39011. ret := &RemarketingList{
  39012. ServerResponse: googleapi.ServerResponse{
  39013. Header: res.Header,
  39014. HTTPStatusCode: res.StatusCode,
  39015. },
  39016. }
  39017. target := &ret
  39018. if err := gensupport.DecodeResponse(target, res); err != nil {
  39019. return nil, err
  39020. }
  39021. return ret, nil
  39022. // {
  39023. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  39024. // "httpMethod": "PATCH",
  39025. // "id": "dfareporting.remarketingLists.patch",
  39026. // "parameterOrder": [
  39027. // "profileId",
  39028. // "id"
  39029. // ],
  39030. // "parameters": {
  39031. // "id": {
  39032. // "description": "Remarketing list ID.",
  39033. // "format": "int64",
  39034. // "location": "query",
  39035. // "required": true,
  39036. // "type": "string"
  39037. // },
  39038. // "profileId": {
  39039. // "description": "User profile ID associated with this request.",
  39040. // "format": "int64",
  39041. // "location": "path",
  39042. // "required": true,
  39043. // "type": "string"
  39044. // }
  39045. // },
  39046. // "path": "userprofiles/{profileId}/remarketingLists",
  39047. // "request": {
  39048. // "$ref": "RemarketingList"
  39049. // },
  39050. // "response": {
  39051. // "$ref": "RemarketingList"
  39052. // },
  39053. // "scopes": [
  39054. // "https://www.googleapis.com/auth/dfatrafficking"
  39055. // ]
  39056. // }
  39057. }
  39058. // method id "dfareporting.remarketingLists.update":
  39059. type RemarketingListsUpdateCall struct {
  39060. s *Service
  39061. profileId int64
  39062. remarketinglist *RemarketingList
  39063. urlParams_ gensupport.URLParams
  39064. ctx_ context.Context
  39065. header_ http.Header
  39066. }
  39067. // Update: Updates an existing remarketing list.
  39068. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  39069. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39070. c.profileId = profileId
  39071. c.remarketinglist = remarketinglist
  39072. return c
  39073. }
  39074. // Fields allows partial responses to be retrieved. See
  39075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39076. // for more information.
  39077. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  39078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39079. return c
  39080. }
  39081. // Context sets the context to be used in this call's Do method. Any
  39082. // pending HTTP request will be aborted if the provided context is
  39083. // canceled.
  39084. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  39085. c.ctx_ = ctx
  39086. return c
  39087. }
  39088. // Header returns an http.Header that can be modified by the caller to
  39089. // add HTTP headers to the request.
  39090. func (c *RemarketingListsUpdateCall) Header() http.Header {
  39091. if c.header_ == nil {
  39092. c.header_ = make(http.Header)
  39093. }
  39094. return c.header_
  39095. }
  39096. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39097. reqHeaders := make(http.Header)
  39098. for k, v := range c.header_ {
  39099. reqHeaders[k] = v
  39100. }
  39101. reqHeaders.Set("User-Agent", c.s.userAgent())
  39102. var body io.Reader = nil
  39103. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  39104. if err != nil {
  39105. return nil, err
  39106. }
  39107. reqHeaders.Set("Content-Type", "application/json")
  39108. c.urlParams_.Set("alt", alt)
  39109. c.urlParams_.Set("prettyPrint", "false")
  39110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  39111. urls += "?" + c.urlParams_.Encode()
  39112. req, err := http.NewRequest("PUT", urls, body)
  39113. if err != nil {
  39114. return nil, err
  39115. }
  39116. req.Header = reqHeaders
  39117. googleapi.Expand(req.URL, map[string]string{
  39118. "profileId": strconv.FormatInt(c.profileId, 10),
  39119. })
  39120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39121. }
  39122. // Do executes the "dfareporting.remarketingLists.update" call.
  39123. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  39124. // status code is an error. Response headers are in either
  39125. // *RemarketingList.ServerResponse.Header or (if a response was returned
  39126. // at all) in error.(*googleapi.Error).Header. Use
  39127. // googleapi.IsNotModified to check whether the returned error was
  39128. // because http.StatusNotModified was returned.
  39129. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  39130. gensupport.SetOptions(c.urlParams_, opts...)
  39131. res, err := c.doRequest("json")
  39132. if res != nil && res.StatusCode == http.StatusNotModified {
  39133. if res.Body != nil {
  39134. res.Body.Close()
  39135. }
  39136. return nil, &googleapi.Error{
  39137. Code: res.StatusCode,
  39138. Header: res.Header,
  39139. }
  39140. }
  39141. if err != nil {
  39142. return nil, err
  39143. }
  39144. defer googleapi.CloseBody(res)
  39145. if err := googleapi.CheckResponse(res); err != nil {
  39146. return nil, err
  39147. }
  39148. ret := &RemarketingList{
  39149. ServerResponse: googleapi.ServerResponse{
  39150. Header: res.Header,
  39151. HTTPStatusCode: res.StatusCode,
  39152. },
  39153. }
  39154. target := &ret
  39155. if err := gensupport.DecodeResponse(target, res); err != nil {
  39156. return nil, err
  39157. }
  39158. return ret, nil
  39159. // {
  39160. // "description": "Updates an existing remarketing list.",
  39161. // "httpMethod": "PUT",
  39162. // "id": "dfareporting.remarketingLists.update",
  39163. // "parameterOrder": [
  39164. // "profileId"
  39165. // ],
  39166. // "parameters": {
  39167. // "profileId": {
  39168. // "description": "User profile ID associated with this request.",
  39169. // "format": "int64",
  39170. // "location": "path",
  39171. // "required": true,
  39172. // "type": "string"
  39173. // }
  39174. // },
  39175. // "path": "userprofiles/{profileId}/remarketingLists",
  39176. // "request": {
  39177. // "$ref": "RemarketingList"
  39178. // },
  39179. // "response": {
  39180. // "$ref": "RemarketingList"
  39181. // },
  39182. // "scopes": [
  39183. // "https://www.googleapis.com/auth/dfatrafficking"
  39184. // ]
  39185. // }
  39186. }
  39187. // method id "dfareporting.reports.delete":
  39188. type ReportsDeleteCall struct {
  39189. s *Service
  39190. profileId int64
  39191. reportId int64
  39192. urlParams_ gensupport.URLParams
  39193. ctx_ context.Context
  39194. header_ http.Header
  39195. }
  39196. // Delete: Deletes a report by its ID.
  39197. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  39198. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39199. c.profileId = profileId
  39200. c.reportId = reportId
  39201. return c
  39202. }
  39203. // Fields allows partial responses to be retrieved. See
  39204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39205. // for more information.
  39206. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  39207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39208. return c
  39209. }
  39210. // Context sets the context to be used in this call's Do method. Any
  39211. // pending HTTP request will be aborted if the provided context is
  39212. // canceled.
  39213. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  39214. c.ctx_ = ctx
  39215. return c
  39216. }
  39217. // Header returns an http.Header that can be modified by the caller to
  39218. // add HTTP headers to the request.
  39219. func (c *ReportsDeleteCall) Header() http.Header {
  39220. if c.header_ == nil {
  39221. c.header_ = make(http.Header)
  39222. }
  39223. return c.header_
  39224. }
  39225. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  39226. reqHeaders := make(http.Header)
  39227. for k, v := range c.header_ {
  39228. reqHeaders[k] = v
  39229. }
  39230. reqHeaders.Set("User-Agent", c.s.userAgent())
  39231. var body io.Reader = nil
  39232. c.urlParams_.Set("alt", alt)
  39233. c.urlParams_.Set("prettyPrint", "false")
  39234. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39235. urls += "?" + c.urlParams_.Encode()
  39236. req, err := http.NewRequest("DELETE", urls, body)
  39237. if err != nil {
  39238. return nil, err
  39239. }
  39240. req.Header = reqHeaders
  39241. googleapi.Expand(req.URL, map[string]string{
  39242. "profileId": strconv.FormatInt(c.profileId, 10),
  39243. "reportId": strconv.FormatInt(c.reportId, 10),
  39244. })
  39245. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39246. }
  39247. // Do executes the "dfareporting.reports.delete" call.
  39248. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  39249. gensupport.SetOptions(c.urlParams_, opts...)
  39250. res, err := c.doRequest("json")
  39251. if err != nil {
  39252. return err
  39253. }
  39254. defer googleapi.CloseBody(res)
  39255. if err := googleapi.CheckResponse(res); err != nil {
  39256. return err
  39257. }
  39258. return nil
  39259. // {
  39260. // "description": "Deletes a report by its ID.",
  39261. // "httpMethod": "DELETE",
  39262. // "id": "dfareporting.reports.delete",
  39263. // "parameterOrder": [
  39264. // "profileId",
  39265. // "reportId"
  39266. // ],
  39267. // "parameters": {
  39268. // "profileId": {
  39269. // "description": "The DFA user profile ID.",
  39270. // "format": "int64",
  39271. // "location": "path",
  39272. // "required": true,
  39273. // "type": "string"
  39274. // },
  39275. // "reportId": {
  39276. // "description": "The ID of the report.",
  39277. // "format": "int64",
  39278. // "location": "path",
  39279. // "required": true,
  39280. // "type": "string"
  39281. // }
  39282. // },
  39283. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39284. // "scopes": [
  39285. // "https://www.googleapis.com/auth/dfareporting"
  39286. // ]
  39287. // }
  39288. }
  39289. // method id "dfareporting.reports.get":
  39290. type ReportsGetCall struct {
  39291. s *Service
  39292. profileId int64
  39293. reportId int64
  39294. urlParams_ gensupport.URLParams
  39295. ifNoneMatch_ string
  39296. ctx_ context.Context
  39297. header_ http.Header
  39298. }
  39299. // Get: Retrieves a report by its ID.
  39300. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  39301. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39302. c.profileId = profileId
  39303. c.reportId = reportId
  39304. return c
  39305. }
  39306. // Fields allows partial responses to be retrieved. See
  39307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39308. // for more information.
  39309. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  39310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39311. return c
  39312. }
  39313. // IfNoneMatch sets the optional parameter which makes the operation
  39314. // fail if the object's ETag matches the given value. This is useful for
  39315. // getting updates only after the object has changed since the last
  39316. // request. Use googleapi.IsNotModified to check whether the response
  39317. // error from Do is the result of In-None-Match.
  39318. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  39319. c.ifNoneMatch_ = entityTag
  39320. return c
  39321. }
  39322. // Context sets the context to be used in this call's Do method. Any
  39323. // pending HTTP request will be aborted if the provided context is
  39324. // canceled.
  39325. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  39326. c.ctx_ = ctx
  39327. return c
  39328. }
  39329. // Header returns an http.Header that can be modified by the caller to
  39330. // add HTTP headers to the request.
  39331. func (c *ReportsGetCall) Header() http.Header {
  39332. if c.header_ == nil {
  39333. c.header_ = make(http.Header)
  39334. }
  39335. return c.header_
  39336. }
  39337. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  39338. reqHeaders := make(http.Header)
  39339. for k, v := range c.header_ {
  39340. reqHeaders[k] = v
  39341. }
  39342. reqHeaders.Set("User-Agent", c.s.userAgent())
  39343. if c.ifNoneMatch_ != "" {
  39344. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39345. }
  39346. var body io.Reader = nil
  39347. c.urlParams_.Set("alt", alt)
  39348. c.urlParams_.Set("prettyPrint", "false")
  39349. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39350. urls += "?" + c.urlParams_.Encode()
  39351. req, err := http.NewRequest("GET", urls, body)
  39352. if err != nil {
  39353. return nil, err
  39354. }
  39355. req.Header = reqHeaders
  39356. googleapi.Expand(req.URL, map[string]string{
  39357. "profileId": strconv.FormatInt(c.profileId, 10),
  39358. "reportId": strconv.FormatInt(c.reportId, 10),
  39359. })
  39360. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39361. }
  39362. // Do executes the "dfareporting.reports.get" call.
  39363. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39364. // code is an error. Response headers are in either
  39365. // *Report.ServerResponse.Header or (if a response was returned at all)
  39366. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39367. // check whether the returned error was because http.StatusNotModified
  39368. // was returned.
  39369. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39370. gensupport.SetOptions(c.urlParams_, opts...)
  39371. res, err := c.doRequest("json")
  39372. if res != nil && res.StatusCode == http.StatusNotModified {
  39373. if res.Body != nil {
  39374. res.Body.Close()
  39375. }
  39376. return nil, &googleapi.Error{
  39377. Code: res.StatusCode,
  39378. Header: res.Header,
  39379. }
  39380. }
  39381. if err != nil {
  39382. return nil, err
  39383. }
  39384. defer googleapi.CloseBody(res)
  39385. if err := googleapi.CheckResponse(res); err != nil {
  39386. return nil, err
  39387. }
  39388. ret := &Report{
  39389. ServerResponse: googleapi.ServerResponse{
  39390. Header: res.Header,
  39391. HTTPStatusCode: res.StatusCode,
  39392. },
  39393. }
  39394. target := &ret
  39395. if err := gensupport.DecodeResponse(target, res); err != nil {
  39396. return nil, err
  39397. }
  39398. return ret, nil
  39399. // {
  39400. // "description": "Retrieves a report by its ID.",
  39401. // "httpMethod": "GET",
  39402. // "id": "dfareporting.reports.get",
  39403. // "parameterOrder": [
  39404. // "profileId",
  39405. // "reportId"
  39406. // ],
  39407. // "parameters": {
  39408. // "profileId": {
  39409. // "description": "The DFA user profile ID.",
  39410. // "format": "int64",
  39411. // "location": "path",
  39412. // "required": true,
  39413. // "type": "string"
  39414. // },
  39415. // "reportId": {
  39416. // "description": "The ID of the report.",
  39417. // "format": "int64",
  39418. // "location": "path",
  39419. // "required": true,
  39420. // "type": "string"
  39421. // }
  39422. // },
  39423. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39424. // "response": {
  39425. // "$ref": "Report"
  39426. // },
  39427. // "scopes": [
  39428. // "https://www.googleapis.com/auth/dfareporting"
  39429. // ]
  39430. // }
  39431. }
  39432. // method id "dfareporting.reports.insert":
  39433. type ReportsInsertCall struct {
  39434. s *Service
  39435. profileId int64
  39436. report *Report
  39437. urlParams_ gensupport.URLParams
  39438. ctx_ context.Context
  39439. header_ http.Header
  39440. }
  39441. // Insert: Creates a report.
  39442. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  39443. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39444. c.profileId = profileId
  39445. c.report = report
  39446. return c
  39447. }
  39448. // Fields allows partial responses to be retrieved. See
  39449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39450. // for more information.
  39451. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  39452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39453. return c
  39454. }
  39455. // Context sets the context to be used in this call's Do method. Any
  39456. // pending HTTP request will be aborted if the provided context is
  39457. // canceled.
  39458. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  39459. c.ctx_ = ctx
  39460. return c
  39461. }
  39462. // Header returns an http.Header that can be modified by the caller to
  39463. // add HTTP headers to the request.
  39464. func (c *ReportsInsertCall) Header() http.Header {
  39465. if c.header_ == nil {
  39466. c.header_ = make(http.Header)
  39467. }
  39468. return c.header_
  39469. }
  39470. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  39471. reqHeaders := make(http.Header)
  39472. for k, v := range c.header_ {
  39473. reqHeaders[k] = v
  39474. }
  39475. reqHeaders.Set("User-Agent", c.s.userAgent())
  39476. var body io.Reader = nil
  39477. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39478. if err != nil {
  39479. return nil, err
  39480. }
  39481. reqHeaders.Set("Content-Type", "application/json")
  39482. c.urlParams_.Set("alt", alt)
  39483. c.urlParams_.Set("prettyPrint", "false")
  39484. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39485. urls += "?" + c.urlParams_.Encode()
  39486. req, err := http.NewRequest("POST", urls, body)
  39487. if err != nil {
  39488. return nil, err
  39489. }
  39490. req.Header = reqHeaders
  39491. googleapi.Expand(req.URL, map[string]string{
  39492. "profileId": strconv.FormatInt(c.profileId, 10),
  39493. })
  39494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39495. }
  39496. // Do executes the "dfareporting.reports.insert" call.
  39497. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39498. // code is an error. Response headers are in either
  39499. // *Report.ServerResponse.Header or (if a response was returned at all)
  39500. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39501. // check whether the returned error was because http.StatusNotModified
  39502. // was returned.
  39503. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39504. gensupport.SetOptions(c.urlParams_, opts...)
  39505. res, err := c.doRequest("json")
  39506. if res != nil && res.StatusCode == http.StatusNotModified {
  39507. if res.Body != nil {
  39508. res.Body.Close()
  39509. }
  39510. return nil, &googleapi.Error{
  39511. Code: res.StatusCode,
  39512. Header: res.Header,
  39513. }
  39514. }
  39515. if err != nil {
  39516. return nil, err
  39517. }
  39518. defer googleapi.CloseBody(res)
  39519. if err := googleapi.CheckResponse(res); err != nil {
  39520. return nil, err
  39521. }
  39522. ret := &Report{
  39523. ServerResponse: googleapi.ServerResponse{
  39524. Header: res.Header,
  39525. HTTPStatusCode: res.StatusCode,
  39526. },
  39527. }
  39528. target := &ret
  39529. if err := gensupport.DecodeResponse(target, res); err != nil {
  39530. return nil, err
  39531. }
  39532. return ret, nil
  39533. // {
  39534. // "description": "Creates a report.",
  39535. // "httpMethod": "POST",
  39536. // "id": "dfareporting.reports.insert",
  39537. // "parameterOrder": [
  39538. // "profileId"
  39539. // ],
  39540. // "parameters": {
  39541. // "profileId": {
  39542. // "description": "The DFA user profile ID.",
  39543. // "format": "int64",
  39544. // "location": "path",
  39545. // "required": true,
  39546. // "type": "string"
  39547. // }
  39548. // },
  39549. // "path": "userprofiles/{profileId}/reports",
  39550. // "request": {
  39551. // "$ref": "Report"
  39552. // },
  39553. // "response": {
  39554. // "$ref": "Report"
  39555. // },
  39556. // "scopes": [
  39557. // "https://www.googleapis.com/auth/dfareporting"
  39558. // ]
  39559. // }
  39560. }
  39561. // method id "dfareporting.reports.list":
  39562. type ReportsListCall struct {
  39563. s *Service
  39564. profileId int64
  39565. urlParams_ gensupport.URLParams
  39566. ifNoneMatch_ string
  39567. ctx_ context.Context
  39568. header_ http.Header
  39569. }
  39570. // List: Retrieves list of reports.
  39571. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  39572. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39573. c.profileId = profileId
  39574. return c
  39575. }
  39576. // MaxResults sets the optional parameter "maxResults": Maximum number
  39577. // of results to return.
  39578. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  39579. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39580. return c
  39581. }
  39582. // PageToken sets the optional parameter "pageToken": The value of the
  39583. // nextToken from the previous result page.
  39584. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  39585. c.urlParams_.Set("pageToken", pageToken)
  39586. return c
  39587. }
  39588. // Scope sets the optional parameter "scope": The scope that defines
  39589. // which results are returned.
  39590. //
  39591. // Possible values:
  39592. // "ALL" - All reports in account.
  39593. // "MINE" (default) - My reports.
  39594. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  39595. c.urlParams_.Set("scope", scope)
  39596. return c
  39597. }
  39598. // SortField sets the optional parameter "sortField": The field by which
  39599. // to sort the list.
  39600. //
  39601. // Possible values:
  39602. // "ID" - Sort by report ID.
  39603. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  39604. // "NAME" - Sort by name of reports.
  39605. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  39606. c.urlParams_.Set("sortField", sortField)
  39607. return c
  39608. }
  39609. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39610. // results.
  39611. //
  39612. // Possible values:
  39613. // "ASCENDING" - Ascending order.
  39614. // "DESCENDING" (default) - Descending order.
  39615. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  39616. c.urlParams_.Set("sortOrder", sortOrder)
  39617. return c
  39618. }
  39619. // Fields allows partial responses to be retrieved. See
  39620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39621. // for more information.
  39622. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  39623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39624. return c
  39625. }
  39626. // IfNoneMatch sets the optional parameter which makes the operation
  39627. // fail if the object's ETag matches the given value. This is useful for
  39628. // getting updates only after the object has changed since the last
  39629. // request. Use googleapi.IsNotModified to check whether the response
  39630. // error from Do is the result of In-None-Match.
  39631. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  39632. c.ifNoneMatch_ = entityTag
  39633. return c
  39634. }
  39635. // Context sets the context to be used in this call's Do method. Any
  39636. // pending HTTP request will be aborted if the provided context is
  39637. // canceled.
  39638. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  39639. c.ctx_ = ctx
  39640. return c
  39641. }
  39642. // Header returns an http.Header that can be modified by the caller to
  39643. // add HTTP headers to the request.
  39644. func (c *ReportsListCall) Header() http.Header {
  39645. if c.header_ == nil {
  39646. c.header_ = make(http.Header)
  39647. }
  39648. return c.header_
  39649. }
  39650. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  39651. reqHeaders := make(http.Header)
  39652. for k, v := range c.header_ {
  39653. reqHeaders[k] = v
  39654. }
  39655. reqHeaders.Set("User-Agent", c.s.userAgent())
  39656. if c.ifNoneMatch_ != "" {
  39657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39658. }
  39659. var body io.Reader = nil
  39660. c.urlParams_.Set("alt", alt)
  39661. c.urlParams_.Set("prettyPrint", "false")
  39662. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39663. urls += "?" + c.urlParams_.Encode()
  39664. req, err := http.NewRequest("GET", urls, body)
  39665. if err != nil {
  39666. return nil, err
  39667. }
  39668. req.Header = reqHeaders
  39669. googleapi.Expand(req.URL, map[string]string{
  39670. "profileId": strconv.FormatInt(c.profileId, 10),
  39671. })
  39672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39673. }
  39674. // Do executes the "dfareporting.reports.list" call.
  39675. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  39676. // status code is an error. Response headers are in either
  39677. // *ReportList.ServerResponse.Header or (if a response was returned at
  39678. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39679. // to check whether the returned error was because
  39680. // http.StatusNotModified was returned.
  39681. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  39682. gensupport.SetOptions(c.urlParams_, opts...)
  39683. res, err := c.doRequest("json")
  39684. if res != nil && res.StatusCode == http.StatusNotModified {
  39685. if res.Body != nil {
  39686. res.Body.Close()
  39687. }
  39688. return nil, &googleapi.Error{
  39689. Code: res.StatusCode,
  39690. Header: res.Header,
  39691. }
  39692. }
  39693. if err != nil {
  39694. return nil, err
  39695. }
  39696. defer googleapi.CloseBody(res)
  39697. if err := googleapi.CheckResponse(res); err != nil {
  39698. return nil, err
  39699. }
  39700. ret := &ReportList{
  39701. ServerResponse: googleapi.ServerResponse{
  39702. Header: res.Header,
  39703. HTTPStatusCode: res.StatusCode,
  39704. },
  39705. }
  39706. target := &ret
  39707. if err := gensupport.DecodeResponse(target, res); err != nil {
  39708. return nil, err
  39709. }
  39710. return ret, nil
  39711. // {
  39712. // "description": "Retrieves list of reports.",
  39713. // "httpMethod": "GET",
  39714. // "id": "dfareporting.reports.list",
  39715. // "parameterOrder": [
  39716. // "profileId"
  39717. // ],
  39718. // "parameters": {
  39719. // "maxResults": {
  39720. // "default": "10",
  39721. // "description": "Maximum number of results to return.",
  39722. // "format": "int32",
  39723. // "location": "query",
  39724. // "maximum": "10",
  39725. // "minimum": "0",
  39726. // "type": "integer"
  39727. // },
  39728. // "pageToken": {
  39729. // "description": "The value of the nextToken from the previous result page.",
  39730. // "location": "query",
  39731. // "type": "string"
  39732. // },
  39733. // "profileId": {
  39734. // "description": "The DFA user profile ID.",
  39735. // "format": "int64",
  39736. // "location": "path",
  39737. // "required": true,
  39738. // "type": "string"
  39739. // },
  39740. // "scope": {
  39741. // "default": "MINE",
  39742. // "description": "The scope that defines which results are returned.",
  39743. // "enum": [
  39744. // "ALL",
  39745. // "MINE"
  39746. // ],
  39747. // "enumDescriptions": [
  39748. // "All reports in account.",
  39749. // "My reports."
  39750. // ],
  39751. // "location": "query",
  39752. // "type": "string"
  39753. // },
  39754. // "sortField": {
  39755. // "default": "LAST_MODIFIED_TIME",
  39756. // "description": "The field by which to sort the list.",
  39757. // "enum": [
  39758. // "ID",
  39759. // "LAST_MODIFIED_TIME",
  39760. // "NAME"
  39761. // ],
  39762. // "enumDescriptions": [
  39763. // "Sort by report ID.",
  39764. // "Sort by 'lastModifiedTime' field.",
  39765. // "Sort by name of reports."
  39766. // ],
  39767. // "location": "query",
  39768. // "type": "string"
  39769. // },
  39770. // "sortOrder": {
  39771. // "default": "DESCENDING",
  39772. // "description": "Order of sorted results.",
  39773. // "enum": [
  39774. // "ASCENDING",
  39775. // "DESCENDING"
  39776. // ],
  39777. // "enumDescriptions": [
  39778. // "Ascending order.",
  39779. // "Descending order."
  39780. // ],
  39781. // "location": "query",
  39782. // "type": "string"
  39783. // }
  39784. // },
  39785. // "path": "userprofiles/{profileId}/reports",
  39786. // "response": {
  39787. // "$ref": "ReportList"
  39788. // },
  39789. // "scopes": [
  39790. // "https://www.googleapis.com/auth/dfareporting"
  39791. // ]
  39792. // }
  39793. }
  39794. // Pages invokes f for each page of results.
  39795. // A non-nil error returned from f will halt the iteration.
  39796. // The provided context supersedes any context provided to the Context method.
  39797. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  39798. c.ctx_ = ctx
  39799. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39800. for {
  39801. x, err := c.Do()
  39802. if err != nil {
  39803. return err
  39804. }
  39805. if err := f(x); err != nil {
  39806. return err
  39807. }
  39808. if x.NextPageToken == "" {
  39809. return nil
  39810. }
  39811. c.PageToken(x.NextPageToken)
  39812. }
  39813. }
  39814. // method id "dfareporting.reports.patch":
  39815. type ReportsPatchCall struct {
  39816. s *Service
  39817. profileId int64
  39818. reportId int64
  39819. report *Report
  39820. urlParams_ gensupport.URLParams
  39821. ctx_ context.Context
  39822. header_ http.Header
  39823. }
  39824. // Patch: Updates a report. This method supports patch semantics.
  39825. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  39826. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39827. c.profileId = profileId
  39828. c.reportId = reportId
  39829. c.report = report
  39830. return c
  39831. }
  39832. // Fields allows partial responses to be retrieved. See
  39833. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39834. // for more information.
  39835. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  39836. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39837. return c
  39838. }
  39839. // Context sets the context to be used in this call's Do method. Any
  39840. // pending HTTP request will be aborted if the provided context is
  39841. // canceled.
  39842. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  39843. c.ctx_ = ctx
  39844. return c
  39845. }
  39846. // Header returns an http.Header that can be modified by the caller to
  39847. // add HTTP headers to the request.
  39848. func (c *ReportsPatchCall) Header() http.Header {
  39849. if c.header_ == nil {
  39850. c.header_ = make(http.Header)
  39851. }
  39852. return c.header_
  39853. }
  39854. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  39855. reqHeaders := make(http.Header)
  39856. for k, v := range c.header_ {
  39857. reqHeaders[k] = v
  39858. }
  39859. reqHeaders.Set("User-Agent", c.s.userAgent())
  39860. var body io.Reader = nil
  39861. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39862. if err != nil {
  39863. return nil, err
  39864. }
  39865. reqHeaders.Set("Content-Type", "application/json")
  39866. c.urlParams_.Set("alt", alt)
  39867. c.urlParams_.Set("prettyPrint", "false")
  39868. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39869. urls += "?" + c.urlParams_.Encode()
  39870. req, err := http.NewRequest("PATCH", urls, body)
  39871. if err != nil {
  39872. return nil, err
  39873. }
  39874. req.Header = reqHeaders
  39875. googleapi.Expand(req.URL, map[string]string{
  39876. "profileId": strconv.FormatInt(c.profileId, 10),
  39877. "reportId": strconv.FormatInt(c.reportId, 10),
  39878. })
  39879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39880. }
  39881. // Do executes the "dfareporting.reports.patch" call.
  39882. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39883. // code is an error. Response headers are in either
  39884. // *Report.ServerResponse.Header or (if a response was returned at all)
  39885. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39886. // check whether the returned error was because http.StatusNotModified
  39887. // was returned.
  39888. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39889. gensupport.SetOptions(c.urlParams_, opts...)
  39890. res, err := c.doRequest("json")
  39891. if res != nil && res.StatusCode == http.StatusNotModified {
  39892. if res.Body != nil {
  39893. res.Body.Close()
  39894. }
  39895. return nil, &googleapi.Error{
  39896. Code: res.StatusCode,
  39897. Header: res.Header,
  39898. }
  39899. }
  39900. if err != nil {
  39901. return nil, err
  39902. }
  39903. defer googleapi.CloseBody(res)
  39904. if err := googleapi.CheckResponse(res); err != nil {
  39905. return nil, err
  39906. }
  39907. ret := &Report{
  39908. ServerResponse: googleapi.ServerResponse{
  39909. Header: res.Header,
  39910. HTTPStatusCode: res.StatusCode,
  39911. },
  39912. }
  39913. target := &ret
  39914. if err := gensupport.DecodeResponse(target, res); err != nil {
  39915. return nil, err
  39916. }
  39917. return ret, nil
  39918. // {
  39919. // "description": "Updates a report. This method supports patch semantics.",
  39920. // "httpMethod": "PATCH",
  39921. // "id": "dfareporting.reports.patch",
  39922. // "parameterOrder": [
  39923. // "profileId",
  39924. // "reportId"
  39925. // ],
  39926. // "parameters": {
  39927. // "profileId": {
  39928. // "description": "The DFA user profile ID.",
  39929. // "format": "int64",
  39930. // "location": "path",
  39931. // "required": true,
  39932. // "type": "string"
  39933. // },
  39934. // "reportId": {
  39935. // "description": "The ID of the report.",
  39936. // "format": "int64",
  39937. // "location": "path",
  39938. // "required": true,
  39939. // "type": "string"
  39940. // }
  39941. // },
  39942. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39943. // "request": {
  39944. // "$ref": "Report"
  39945. // },
  39946. // "response": {
  39947. // "$ref": "Report"
  39948. // },
  39949. // "scopes": [
  39950. // "https://www.googleapis.com/auth/dfareporting"
  39951. // ]
  39952. // }
  39953. }
  39954. // method id "dfareporting.reports.run":
  39955. type ReportsRunCall struct {
  39956. s *Service
  39957. profileId int64
  39958. reportId int64
  39959. urlParams_ gensupport.URLParams
  39960. ctx_ context.Context
  39961. header_ http.Header
  39962. }
  39963. // Run: Runs a report.
  39964. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  39965. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39966. c.profileId = profileId
  39967. c.reportId = reportId
  39968. return c
  39969. }
  39970. // Synchronous sets the optional parameter "synchronous": If set and
  39971. // true, tries to run the report synchronously.
  39972. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  39973. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  39974. return c
  39975. }
  39976. // Fields allows partial responses to be retrieved. See
  39977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39978. // for more information.
  39979. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  39980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39981. return c
  39982. }
  39983. // Context sets the context to be used in this call's Do method. Any
  39984. // pending HTTP request will be aborted if the provided context is
  39985. // canceled.
  39986. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  39987. c.ctx_ = ctx
  39988. return c
  39989. }
  39990. // Header returns an http.Header that can be modified by the caller to
  39991. // add HTTP headers to the request.
  39992. func (c *ReportsRunCall) Header() http.Header {
  39993. if c.header_ == nil {
  39994. c.header_ = make(http.Header)
  39995. }
  39996. return c.header_
  39997. }
  39998. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  39999. reqHeaders := make(http.Header)
  40000. for k, v := range c.header_ {
  40001. reqHeaders[k] = v
  40002. }
  40003. reqHeaders.Set("User-Agent", c.s.userAgent())
  40004. var body io.Reader = nil
  40005. c.urlParams_.Set("alt", alt)
  40006. c.urlParams_.Set("prettyPrint", "false")
  40007. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  40008. urls += "?" + c.urlParams_.Encode()
  40009. req, err := http.NewRequest("POST", urls, body)
  40010. if err != nil {
  40011. return nil, err
  40012. }
  40013. req.Header = reqHeaders
  40014. googleapi.Expand(req.URL, map[string]string{
  40015. "profileId": strconv.FormatInt(c.profileId, 10),
  40016. "reportId": strconv.FormatInt(c.reportId, 10),
  40017. })
  40018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40019. }
  40020. // Do executes the "dfareporting.reports.run" call.
  40021. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40022. // code is an error. Response headers are in either
  40023. // *File.ServerResponse.Header or (if a response was returned at all) in
  40024. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40025. // whether the returned error was because http.StatusNotModified was
  40026. // returned.
  40027. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40028. gensupport.SetOptions(c.urlParams_, opts...)
  40029. res, err := c.doRequest("json")
  40030. if res != nil && res.StatusCode == http.StatusNotModified {
  40031. if res.Body != nil {
  40032. res.Body.Close()
  40033. }
  40034. return nil, &googleapi.Error{
  40035. Code: res.StatusCode,
  40036. Header: res.Header,
  40037. }
  40038. }
  40039. if err != nil {
  40040. return nil, err
  40041. }
  40042. defer googleapi.CloseBody(res)
  40043. if err := googleapi.CheckResponse(res); err != nil {
  40044. return nil, err
  40045. }
  40046. ret := &File{
  40047. ServerResponse: googleapi.ServerResponse{
  40048. Header: res.Header,
  40049. HTTPStatusCode: res.StatusCode,
  40050. },
  40051. }
  40052. target := &ret
  40053. if err := gensupport.DecodeResponse(target, res); err != nil {
  40054. return nil, err
  40055. }
  40056. return ret, nil
  40057. // {
  40058. // "description": "Runs a report.",
  40059. // "httpMethod": "POST",
  40060. // "id": "dfareporting.reports.run",
  40061. // "parameterOrder": [
  40062. // "profileId",
  40063. // "reportId"
  40064. // ],
  40065. // "parameters": {
  40066. // "profileId": {
  40067. // "description": "The DFA profile ID.",
  40068. // "format": "int64",
  40069. // "location": "path",
  40070. // "required": true,
  40071. // "type": "string"
  40072. // },
  40073. // "reportId": {
  40074. // "description": "The ID of the report.",
  40075. // "format": "int64",
  40076. // "location": "path",
  40077. // "required": true,
  40078. // "type": "string"
  40079. // },
  40080. // "synchronous": {
  40081. // "default": "false",
  40082. // "description": "If set and true, tries to run the report synchronously.",
  40083. // "location": "query",
  40084. // "type": "boolean"
  40085. // }
  40086. // },
  40087. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  40088. // "response": {
  40089. // "$ref": "File"
  40090. // },
  40091. // "scopes": [
  40092. // "https://www.googleapis.com/auth/dfareporting"
  40093. // ]
  40094. // }
  40095. }
  40096. // method id "dfareporting.reports.update":
  40097. type ReportsUpdateCall struct {
  40098. s *Service
  40099. profileId int64
  40100. reportId int64
  40101. report *Report
  40102. urlParams_ gensupport.URLParams
  40103. ctx_ context.Context
  40104. header_ http.Header
  40105. }
  40106. // Update: Updates a report.
  40107. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  40108. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40109. c.profileId = profileId
  40110. c.reportId = reportId
  40111. c.report = report
  40112. return c
  40113. }
  40114. // Fields allows partial responses to be retrieved. See
  40115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40116. // for more information.
  40117. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  40118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40119. return c
  40120. }
  40121. // Context sets the context to be used in this call's Do method. Any
  40122. // pending HTTP request will be aborted if the provided context is
  40123. // canceled.
  40124. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  40125. c.ctx_ = ctx
  40126. return c
  40127. }
  40128. // Header returns an http.Header that can be modified by the caller to
  40129. // add HTTP headers to the request.
  40130. func (c *ReportsUpdateCall) Header() http.Header {
  40131. if c.header_ == nil {
  40132. c.header_ = make(http.Header)
  40133. }
  40134. return c.header_
  40135. }
  40136. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  40137. reqHeaders := make(http.Header)
  40138. for k, v := range c.header_ {
  40139. reqHeaders[k] = v
  40140. }
  40141. reqHeaders.Set("User-Agent", c.s.userAgent())
  40142. var body io.Reader = nil
  40143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40144. if err != nil {
  40145. return nil, err
  40146. }
  40147. reqHeaders.Set("Content-Type", "application/json")
  40148. c.urlParams_.Set("alt", alt)
  40149. c.urlParams_.Set("prettyPrint", "false")
  40150. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  40151. urls += "?" + c.urlParams_.Encode()
  40152. req, err := http.NewRequest("PUT", urls, body)
  40153. if err != nil {
  40154. return nil, err
  40155. }
  40156. req.Header = reqHeaders
  40157. googleapi.Expand(req.URL, map[string]string{
  40158. "profileId": strconv.FormatInt(c.profileId, 10),
  40159. "reportId": strconv.FormatInt(c.reportId, 10),
  40160. })
  40161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40162. }
  40163. // Do executes the "dfareporting.reports.update" call.
  40164. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  40165. // code is an error. Response headers are in either
  40166. // *Report.ServerResponse.Header or (if a response was returned at all)
  40167. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  40168. // check whether the returned error was because http.StatusNotModified
  40169. // was returned.
  40170. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  40171. gensupport.SetOptions(c.urlParams_, opts...)
  40172. res, err := c.doRequest("json")
  40173. if res != nil && res.StatusCode == http.StatusNotModified {
  40174. if res.Body != nil {
  40175. res.Body.Close()
  40176. }
  40177. return nil, &googleapi.Error{
  40178. Code: res.StatusCode,
  40179. Header: res.Header,
  40180. }
  40181. }
  40182. if err != nil {
  40183. return nil, err
  40184. }
  40185. defer googleapi.CloseBody(res)
  40186. if err := googleapi.CheckResponse(res); err != nil {
  40187. return nil, err
  40188. }
  40189. ret := &Report{
  40190. ServerResponse: googleapi.ServerResponse{
  40191. Header: res.Header,
  40192. HTTPStatusCode: res.StatusCode,
  40193. },
  40194. }
  40195. target := &ret
  40196. if err := gensupport.DecodeResponse(target, res); err != nil {
  40197. return nil, err
  40198. }
  40199. return ret, nil
  40200. // {
  40201. // "description": "Updates a report.",
  40202. // "httpMethod": "PUT",
  40203. // "id": "dfareporting.reports.update",
  40204. // "parameterOrder": [
  40205. // "profileId",
  40206. // "reportId"
  40207. // ],
  40208. // "parameters": {
  40209. // "profileId": {
  40210. // "description": "The DFA user profile ID.",
  40211. // "format": "int64",
  40212. // "location": "path",
  40213. // "required": true,
  40214. // "type": "string"
  40215. // },
  40216. // "reportId": {
  40217. // "description": "The ID of the report.",
  40218. // "format": "int64",
  40219. // "location": "path",
  40220. // "required": true,
  40221. // "type": "string"
  40222. // }
  40223. // },
  40224. // "path": "userprofiles/{profileId}/reports/{reportId}",
  40225. // "request": {
  40226. // "$ref": "Report"
  40227. // },
  40228. // "response": {
  40229. // "$ref": "Report"
  40230. // },
  40231. // "scopes": [
  40232. // "https://www.googleapis.com/auth/dfareporting"
  40233. // ]
  40234. // }
  40235. }
  40236. // method id "dfareporting.reports.compatibleFields.query":
  40237. type ReportsCompatibleFieldsQueryCall struct {
  40238. s *Service
  40239. profileId int64
  40240. report *Report
  40241. urlParams_ gensupport.URLParams
  40242. ctx_ context.Context
  40243. header_ http.Header
  40244. }
  40245. // Query: Returns the fields that are compatible to be selected in the
  40246. // respective sections of a report criteria, given the fields already
  40247. // selected in the input report and user permissions.
  40248. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  40249. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40250. c.profileId = profileId
  40251. c.report = report
  40252. return c
  40253. }
  40254. // Fields allows partial responses to be retrieved. See
  40255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40256. // for more information.
  40257. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  40258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40259. return c
  40260. }
  40261. // Context sets the context to be used in this call's Do method. Any
  40262. // pending HTTP request will be aborted if the provided context is
  40263. // canceled.
  40264. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  40265. c.ctx_ = ctx
  40266. return c
  40267. }
  40268. // Header returns an http.Header that can be modified by the caller to
  40269. // add HTTP headers to the request.
  40270. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  40271. if c.header_ == nil {
  40272. c.header_ = make(http.Header)
  40273. }
  40274. return c.header_
  40275. }
  40276. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  40277. reqHeaders := make(http.Header)
  40278. for k, v := range c.header_ {
  40279. reqHeaders[k] = v
  40280. }
  40281. reqHeaders.Set("User-Agent", c.s.userAgent())
  40282. var body io.Reader = nil
  40283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  40284. if err != nil {
  40285. return nil, err
  40286. }
  40287. reqHeaders.Set("Content-Type", "application/json")
  40288. c.urlParams_.Set("alt", alt)
  40289. c.urlParams_.Set("prettyPrint", "false")
  40290. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  40291. urls += "?" + c.urlParams_.Encode()
  40292. req, err := http.NewRequest("POST", urls, body)
  40293. if err != nil {
  40294. return nil, err
  40295. }
  40296. req.Header = reqHeaders
  40297. googleapi.Expand(req.URL, map[string]string{
  40298. "profileId": strconv.FormatInt(c.profileId, 10),
  40299. })
  40300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40301. }
  40302. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  40303. // Exactly one of *CompatibleFields or error will be non-nil. Any
  40304. // non-2xx status code is an error. Response headers are in either
  40305. // *CompatibleFields.ServerResponse.Header or (if a response was
  40306. // returned at all) in error.(*googleapi.Error).Header. Use
  40307. // googleapi.IsNotModified to check whether the returned error was
  40308. // because http.StatusNotModified was returned.
  40309. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  40310. gensupport.SetOptions(c.urlParams_, opts...)
  40311. res, err := c.doRequest("json")
  40312. if res != nil && res.StatusCode == http.StatusNotModified {
  40313. if res.Body != nil {
  40314. res.Body.Close()
  40315. }
  40316. return nil, &googleapi.Error{
  40317. Code: res.StatusCode,
  40318. Header: res.Header,
  40319. }
  40320. }
  40321. if err != nil {
  40322. return nil, err
  40323. }
  40324. defer googleapi.CloseBody(res)
  40325. if err := googleapi.CheckResponse(res); err != nil {
  40326. return nil, err
  40327. }
  40328. ret := &CompatibleFields{
  40329. ServerResponse: googleapi.ServerResponse{
  40330. Header: res.Header,
  40331. HTTPStatusCode: res.StatusCode,
  40332. },
  40333. }
  40334. target := &ret
  40335. if err := gensupport.DecodeResponse(target, res); err != nil {
  40336. return nil, err
  40337. }
  40338. return ret, nil
  40339. // {
  40340. // "description": "Returns the fields that are compatible to be selected in the respective sections of a report criteria, given the fields already selected in the input report and user permissions.",
  40341. // "httpMethod": "POST",
  40342. // "id": "dfareporting.reports.compatibleFields.query",
  40343. // "parameterOrder": [
  40344. // "profileId"
  40345. // ],
  40346. // "parameters": {
  40347. // "profileId": {
  40348. // "description": "The DFA user profile ID.",
  40349. // "format": "int64",
  40350. // "location": "path",
  40351. // "required": true,
  40352. // "type": "string"
  40353. // }
  40354. // },
  40355. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  40356. // "request": {
  40357. // "$ref": "Report"
  40358. // },
  40359. // "response": {
  40360. // "$ref": "CompatibleFields"
  40361. // },
  40362. // "scopes": [
  40363. // "https://www.googleapis.com/auth/dfareporting"
  40364. // ]
  40365. // }
  40366. }
  40367. // method id "dfareporting.reports.files.get":
  40368. type ReportsFilesGetCall struct {
  40369. s *Service
  40370. profileId int64
  40371. reportId int64
  40372. fileId int64
  40373. urlParams_ gensupport.URLParams
  40374. ifNoneMatch_ string
  40375. ctx_ context.Context
  40376. header_ http.Header
  40377. }
  40378. // Get: Retrieves a report file. This method supports media download.
  40379. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  40380. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40381. c.profileId = profileId
  40382. c.reportId = reportId
  40383. c.fileId = fileId
  40384. return c
  40385. }
  40386. // Fields allows partial responses to be retrieved. See
  40387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40388. // for more information.
  40389. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  40390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40391. return c
  40392. }
  40393. // IfNoneMatch sets the optional parameter which makes the operation
  40394. // fail if the object's ETag matches the given value. This is useful for
  40395. // getting updates only after the object has changed since the last
  40396. // request. Use googleapi.IsNotModified to check whether the response
  40397. // error from Do is the result of In-None-Match.
  40398. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  40399. c.ifNoneMatch_ = entityTag
  40400. return c
  40401. }
  40402. // Context sets the context to be used in this call's Do and Download
  40403. // methods. Any pending HTTP request will be aborted if the provided
  40404. // context is canceled.
  40405. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  40406. c.ctx_ = ctx
  40407. return c
  40408. }
  40409. // Header returns an http.Header that can be modified by the caller to
  40410. // add HTTP headers to the request.
  40411. func (c *ReportsFilesGetCall) Header() http.Header {
  40412. if c.header_ == nil {
  40413. c.header_ = make(http.Header)
  40414. }
  40415. return c.header_
  40416. }
  40417. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  40418. reqHeaders := make(http.Header)
  40419. for k, v := range c.header_ {
  40420. reqHeaders[k] = v
  40421. }
  40422. reqHeaders.Set("User-Agent", c.s.userAgent())
  40423. if c.ifNoneMatch_ != "" {
  40424. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40425. }
  40426. var body io.Reader = nil
  40427. c.urlParams_.Set("alt", alt)
  40428. c.urlParams_.Set("prettyPrint", "false")
  40429. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  40430. urls += "?" + c.urlParams_.Encode()
  40431. req, err := http.NewRequest("GET", urls, body)
  40432. if err != nil {
  40433. return nil, err
  40434. }
  40435. req.Header = reqHeaders
  40436. googleapi.Expand(req.URL, map[string]string{
  40437. "profileId": strconv.FormatInt(c.profileId, 10),
  40438. "reportId": strconv.FormatInt(c.reportId, 10),
  40439. "fileId": strconv.FormatInt(c.fileId, 10),
  40440. })
  40441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40442. }
  40443. // Download fetches the API endpoint's "media" value, instead of the normal
  40444. // API response value. If the returned error is nil, the Response is guaranteed to
  40445. // have a 2xx status code. Callers must close the Response.Body as usual.
  40446. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  40447. gensupport.SetOptions(c.urlParams_, opts...)
  40448. res, err := c.doRequest("media")
  40449. if err != nil {
  40450. return nil, err
  40451. }
  40452. if err := googleapi.CheckMediaResponse(res); err != nil {
  40453. res.Body.Close()
  40454. return nil, err
  40455. }
  40456. return res, nil
  40457. }
  40458. // Do executes the "dfareporting.reports.files.get" call.
  40459. // Exactly one of *File or error will be non-nil. Any non-2xx status
  40460. // code is an error. Response headers are in either
  40461. // *File.ServerResponse.Header or (if a response was returned at all) in
  40462. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40463. // whether the returned error was because http.StatusNotModified was
  40464. // returned.
  40465. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  40466. gensupport.SetOptions(c.urlParams_, opts...)
  40467. res, err := c.doRequest("json")
  40468. if res != nil && res.StatusCode == http.StatusNotModified {
  40469. if res.Body != nil {
  40470. res.Body.Close()
  40471. }
  40472. return nil, &googleapi.Error{
  40473. Code: res.StatusCode,
  40474. Header: res.Header,
  40475. }
  40476. }
  40477. if err != nil {
  40478. return nil, err
  40479. }
  40480. defer googleapi.CloseBody(res)
  40481. if err := googleapi.CheckResponse(res); err != nil {
  40482. return nil, err
  40483. }
  40484. ret := &File{
  40485. ServerResponse: googleapi.ServerResponse{
  40486. Header: res.Header,
  40487. HTTPStatusCode: res.StatusCode,
  40488. },
  40489. }
  40490. target := &ret
  40491. if err := gensupport.DecodeResponse(target, res); err != nil {
  40492. return nil, err
  40493. }
  40494. return ret, nil
  40495. // {
  40496. // "description": "Retrieves a report file. This method supports media download.",
  40497. // "httpMethod": "GET",
  40498. // "id": "dfareporting.reports.files.get",
  40499. // "parameterOrder": [
  40500. // "profileId",
  40501. // "reportId",
  40502. // "fileId"
  40503. // ],
  40504. // "parameters": {
  40505. // "fileId": {
  40506. // "description": "The ID of the report file.",
  40507. // "format": "int64",
  40508. // "location": "path",
  40509. // "required": true,
  40510. // "type": "string"
  40511. // },
  40512. // "profileId": {
  40513. // "description": "The DFA profile ID.",
  40514. // "format": "int64",
  40515. // "location": "path",
  40516. // "required": true,
  40517. // "type": "string"
  40518. // },
  40519. // "reportId": {
  40520. // "description": "The ID of the report.",
  40521. // "format": "int64",
  40522. // "location": "path",
  40523. // "required": true,
  40524. // "type": "string"
  40525. // }
  40526. // },
  40527. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  40528. // "response": {
  40529. // "$ref": "File"
  40530. // },
  40531. // "scopes": [
  40532. // "https://www.googleapis.com/auth/dfareporting"
  40533. // ],
  40534. // "supportsMediaDownload": true
  40535. // }
  40536. }
  40537. // method id "dfareporting.reports.files.list":
  40538. type ReportsFilesListCall struct {
  40539. s *Service
  40540. profileId int64
  40541. reportId int64
  40542. urlParams_ gensupport.URLParams
  40543. ifNoneMatch_ string
  40544. ctx_ context.Context
  40545. header_ http.Header
  40546. }
  40547. // List: Lists files for a report.
  40548. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  40549. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40550. c.profileId = profileId
  40551. c.reportId = reportId
  40552. return c
  40553. }
  40554. // MaxResults sets the optional parameter "maxResults": Maximum number
  40555. // of results to return.
  40556. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  40557. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40558. return c
  40559. }
  40560. // PageToken sets the optional parameter "pageToken": The value of the
  40561. // nextToken from the previous result page.
  40562. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  40563. c.urlParams_.Set("pageToken", pageToken)
  40564. return c
  40565. }
  40566. // SortField sets the optional parameter "sortField": The field by which
  40567. // to sort the list.
  40568. //
  40569. // Possible values:
  40570. // "ID" - Sort by file ID.
  40571. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  40572. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  40573. c.urlParams_.Set("sortField", sortField)
  40574. return c
  40575. }
  40576. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40577. // results.
  40578. //
  40579. // Possible values:
  40580. // "ASCENDING" - Ascending order.
  40581. // "DESCENDING" (default) - Descending order.
  40582. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  40583. c.urlParams_.Set("sortOrder", sortOrder)
  40584. return c
  40585. }
  40586. // Fields allows partial responses to be retrieved. See
  40587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40588. // for more information.
  40589. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  40590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40591. return c
  40592. }
  40593. // IfNoneMatch sets the optional parameter which makes the operation
  40594. // fail if the object's ETag matches the given value. This is useful for
  40595. // getting updates only after the object has changed since the last
  40596. // request. Use googleapi.IsNotModified to check whether the response
  40597. // error from Do is the result of In-None-Match.
  40598. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  40599. c.ifNoneMatch_ = entityTag
  40600. return c
  40601. }
  40602. // Context sets the context to be used in this call's Do method. Any
  40603. // pending HTTP request will be aborted if the provided context is
  40604. // canceled.
  40605. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  40606. c.ctx_ = ctx
  40607. return c
  40608. }
  40609. // Header returns an http.Header that can be modified by the caller to
  40610. // add HTTP headers to the request.
  40611. func (c *ReportsFilesListCall) Header() http.Header {
  40612. if c.header_ == nil {
  40613. c.header_ = make(http.Header)
  40614. }
  40615. return c.header_
  40616. }
  40617. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  40618. reqHeaders := make(http.Header)
  40619. for k, v := range c.header_ {
  40620. reqHeaders[k] = v
  40621. }
  40622. reqHeaders.Set("User-Agent", c.s.userAgent())
  40623. if c.ifNoneMatch_ != "" {
  40624. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40625. }
  40626. var body io.Reader = nil
  40627. c.urlParams_.Set("alt", alt)
  40628. c.urlParams_.Set("prettyPrint", "false")
  40629. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  40630. urls += "?" + c.urlParams_.Encode()
  40631. req, err := http.NewRequest("GET", urls, body)
  40632. if err != nil {
  40633. return nil, err
  40634. }
  40635. req.Header = reqHeaders
  40636. googleapi.Expand(req.URL, map[string]string{
  40637. "profileId": strconv.FormatInt(c.profileId, 10),
  40638. "reportId": strconv.FormatInt(c.reportId, 10),
  40639. })
  40640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40641. }
  40642. // Do executes the "dfareporting.reports.files.list" call.
  40643. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  40644. // code is an error. Response headers are in either
  40645. // *FileList.ServerResponse.Header or (if a response was returned at
  40646. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  40647. // to check whether the returned error was because
  40648. // http.StatusNotModified was returned.
  40649. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  40650. gensupport.SetOptions(c.urlParams_, opts...)
  40651. res, err := c.doRequest("json")
  40652. if res != nil && res.StatusCode == http.StatusNotModified {
  40653. if res.Body != nil {
  40654. res.Body.Close()
  40655. }
  40656. return nil, &googleapi.Error{
  40657. Code: res.StatusCode,
  40658. Header: res.Header,
  40659. }
  40660. }
  40661. if err != nil {
  40662. return nil, err
  40663. }
  40664. defer googleapi.CloseBody(res)
  40665. if err := googleapi.CheckResponse(res); err != nil {
  40666. return nil, err
  40667. }
  40668. ret := &FileList{
  40669. ServerResponse: googleapi.ServerResponse{
  40670. Header: res.Header,
  40671. HTTPStatusCode: res.StatusCode,
  40672. },
  40673. }
  40674. target := &ret
  40675. if err := gensupport.DecodeResponse(target, res); err != nil {
  40676. return nil, err
  40677. }
  40678. return ret, nil
  40679. // {
  40680. // "description": "Lists files for a report.",
  40681. // "httpMethod": "GET",
  40682. // "id": "dfareporting.reports.files.list",
  40683. // "parameterOrder": [
  40684. // "profileId",
  40685. // "reportId"
  40686. // ],
  40687. // "parameters": {
  40688. // "maxResults": {
  40689. // "default": "10",
  40690. // "description": "Maximum number of results to return.",
  40691. // "format": "int32",
  40692. // "location": "query",
  40693. // "maximum": "10",
  40694. // "minimum": "0",
  40695. // "type": "integer"
  40696. // },
  40697. // "pageToken": {
  40698. // "description": "The value of the nextToken from the previous result page.",
  40699. // "location": "query",
  40700. // "type": "string"
  40701. // },
  40702. // "profileId": {
  40703. // "description": "The DFA profile ID.",
  40704. // "format": "int64",
  40705. // "location": "path",
  40706. // "required": true,
  40707. // "type": "string"
  40708. // },
  40709. // "reportId": {
  40710. // "description": "The ID of the parent report.",
  40711. // "format": "int64",
  40712. // "location": "path",
  40713. // "required": true,
  40714. // "type": "string"
  40715. // },
  40716. // "sortField": {
  40717. // "default": "LAST_MODIFIED_TIME",
  40718. // "description": "The field by which to sort the list.",
  40719. // "enum": [
  40720. // "ID",
  40721. // "LAST_MODIFIED_TIME"
  40722. // ],
  40723. // "enumDescriptions": [
  40724. // "Sort by file ID.",
  40725. // "Sort by 'lastmodifiedAt' field."
  40726. // ],
  40727. // "location": "query",
  40728. // "type": "string"
  40729. // },
  40730. // "sortOrder": {
  40731. // "default": "DESCENDING",
  40732. // "description": "Order of sorted results.",
  40733. // "enum": [
  40734. // "ASCENDING",
  40735. // "DESCENDING"
  40736. // ],
  40737. // "enumDescriptions": [
  40738. // "Ascending order.",
  40739. // "Descending order."
  40740. // ],
  40741. // "location": "query",
  40742. // "type": "string"
  40743. // }
  40744. // },
  40745. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  40746. // "response": {
  40747. // "$ref": "FileList"
  40748. // },
  40749. // "scopes": [
  40750. // "https://www.googleapis.com/auth/dfareporting"
  40751. // ]
  40752. // }
  40753. }
  40754. // Pages invokes f for each page of results.
  40755. // A non-nil error returned from f will halt the iteration.
  40756. // The provided context supersedes any context provided to the Context method.
  40757. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  40758. c.ctx_ = ctx
  40759. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40760. for {
  40761. x, err := c.Do()
  40762. if err != nil {
  40763. return err
  40764. }
  40765. if err := f(x); err != nil {
  40766. return err
  40767. }
  40768. if x.NextPageToken == "" {
  40769. return nil
  40770. }
  40771. c.PageToken(x.NextPageToken)
  40772. }
  40773. }
  40774. // method id "dfareporting.sites.get":
  40775. type SitesGetCall struct {
  40776. s *Service
  40777. profileId int64
  40778. id int64
  40779. urlParams_ gensupport.URLParams
  40780. ifNoneMatch_ string
  40781. ctx_ context.Context
  40782. header_ http.Header
  40783. }
  40784. // Get: Gets one site by ID.
  40785. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  40786. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40787. c.profileId = profileId
  40788. c.id = id
  40789. return c
  40790. }
  40791. // Fields allows partial responses to be retrieved. See
  40792. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40793. // for more information.
  40794. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  40795. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40796. return c
  40797. }
  40798. // IfNoneMatch sets the optional parameter which makes the operation
  40799. // fail if the object's ETag matches the given value. This is useful for
  40800. // getting updates only after the object has changed since the last
  40801. // request. Use googleapi.IsNotModified to check whether the response
  40802. // error from Do is the result of In-None-Match.
  40803. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  40804. c.ifNoneMatch_ = entityTag
  40805. return c
  40806. }
  40807. // Context sets the context to be used in this call's Do method. Any
  40808. // pending HTTP request will be aborted if the provided context is
  40809. // canceled.
  40810. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  40811. c.ctx_ = ctx
  40812. return c
  40813. }
  40814. // Header returns an http.Header that can be modified by the caller to
  40815. // add HTTP headers to the request.
  40816. func (c *SitesGetCall) Header() http.Header {
  40817. if c.header_ == nil {
  40818. c.header_ = make(http.Header)
  40819. }
  40820. return c.header_
  40821. }
  40822. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  40823. reqHeaders := make(http.Header)
  40824. for k, v := range c.header_ {
  40825. reqHeaders[k] = v
  40826. }
  40827. reqHeaders.Set("User-Agent", c.s.userAgent())
  40828. if c.ifNoneMatch_ != "" {
  40829. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40830. }
  40831. var body io.Reader = nil
  40832. c.urlParams_.Set("alt", alt)
  40833. c.urlParams_.Set("prettyPrint", "false")
  40834. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  40835. urls += "?" + c.urlParams_.Encode()
  40836. req, err := http.NewRequest("GET", urls, body)
  40837. if err != nil {
  40838. return nil, err
  40839. }
  40840. req.Header = reqHeaders
  40841. googleapi.Expand(req.URL, map[string]string{
  40842. "profileId": strconv.FormatInt(c.profileId, 10),
  40843. "id": strconv.FormatInt(c.id, 10),
  40844. })
  40845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40846. }
  40847. // Do executes the "dfareporting.sites.get" call.
  40848. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40849. // code is an error. Response headers are in either
  40850. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40851. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40852. // whether the returned error was because http.StatusNotModified was
  40853. // returned.
  40854. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40855. gensupport.SetOptions(c.urlParams_, opts...)
  40856. res, err := c.doRequest("json")
  40857. if res != nil && res.StatusCode == http.StatusNotModified {
  40858. if res.Body != nil {
  40859. res.Body.Close()
  40860. }
  40861. return nil, &googleapi.Error{
  40862. Code: res.StatusCode,
  40863. Header: res.Header,
  40864. }
  40865. }
  40866. if err != nil {
  40867. return nil, err
  40868. }
  40869. defer googleapi.CloseBody(res)
  40870. if err := googleapi.CheckResponse(res); err != nil {
  40871. return nil, err
  40872. }
  40873. ret := &Site{
  40874. ServerResponse: googleapi.ServerResponse{
  40875. Header: res.Header,
  40876. HTTPStatusCode: res.StatusCode,
  40877. },
  40878. }
  40879. target := &ret
  40880. if err := gensupport.DecodeResponse(target, res); err != nil {
  40881. return nil, err
  40882. }
  40883. return ret, nil
  40884. // {
  40885. // "description": "Gets one site by ID.",
  40886. // "httpMethod": "GET",
  40887. // "id": "dfareporting.sites.get",
  40888. // "parameterOrder": [
  40889. // "profileId",
  40890. // "id"
  40891. // ],
  40892. // "parameters": {
  40893. // "id": {
  40894. // "description": "Site ID.",
  40895. // "format": "int64",
  40896. // "location": "path",
  40897. // "required": true,
  40898. // "type": "string"
  40899. // },
  40900. // "profileId": {
  40901. // "description": "User profile ID associated with this request.",
  40902. // "format": "int64",
  40903. // "location": "path",
  40904. // "required": true,
  40905. // "type": "string"
  40906. // }
  40907. // },
  40908. // "path": "userprofiles/{profileId}/sites/{id}",
  40909. // "response": {
  40910. // "$ref": "Site"
  40911. // },
  40912. // "scopes": [
  40913. // "https://www.googleapis.com/auth/dfatrafficking"
  40914. // ]
  40915. // }
  40916. }
  40917. // method id "dfareporting.sites.insert":
  40918. type SitesInsertCall struct {
  40919. s *Service
  40920. profileId int64
  40921. site *Site
  40922. urlParams_ gensupport.URLParams
  40923. ctx_ context.Context
  40924. header_ http.Header
  40925. }
  40926. // Insert: Inserts a new site.
  40927. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  40928. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40929. c.profileId = profileId
  40930. c.site = site
  40931. return c
  40932. }
  40933. // Fields allows partial responses to be retrieved. See
  40934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40935. // for more information.
  40936. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  40937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40938. return c
  40939. }
  40940. // Context sets the context to be used in this call's Do method. Any
  40941. // pending HTTP request will be aborted if the provided context is
  40942. // canceled.
  40943. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  40944. c.ctx_ = ctx
  40945. return c
  40946. }
  40947. // Header returns an http.Header that can be modified by the caller to
  40948. // add HTTP headers to the request.
  40949. func (c *SitesInsertCall) Header() http.Header {
  40950. if c.header_ == nil {
  40951. c.header_ = make(http.Header)
  40952. }
  40953. return c.header_
  40954. }
  40955. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  40956. reqHeaders := make(http.Header)
  40957. for k, v := range c.header_ {
  40958. reqHeaders[k] = v
  40959. }
  40960. reqHeaders.Set("User-Agent", c.s.userAgent())
  40961. var body io.Reader = nil
  40962. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40963. if err != nil {
  40964. return nil, err
  40965. }
  40966. reqHeaders.Set("Content-Type", "application/json")
  40967. c.urlParams_.Set("alt", alt)
  40968. c.urlParams_.Set("prettyPrint", "false")
  40969. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40970. urls += "?" + c.urlParams_.Encode()
  40971. req, err := http.NewRequest("POST", urls, body)
  40972. if err != nil {
  40973. return nil, err
  40974. }
  40975. req.Header = reqHeaders
  40976. googleapi.Expand(req.URL, map[string]string{
  40977. "profileId": strconv.FormatInt(c.profileId, 10),
  40978. })
  40979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40980. }
  40981. // Do executes the "dfareporting.sites.insert" call.
  40982. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40983. // code is an error. Response headers are in either
  40984. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40985. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40986. // whether the returned error was because http.StatusNotModified was
  40987. // returned.
  40988. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40989. gensupport.SetOptions(c.urlParams_, opts...)
  40990. res, err := c.doRequest("json")
  40991. if res != nil && res.StatusCode == http.StatusNotModified {
  40992. if res.Body != nil {
  40993. res.Body.Close()
  40994. }
  40995. return nil, &googleapi.Error{
  40996. Code: res.StatusCode,
  40997. Header: res.Header,
  40998. }
  40999. }
  41000. if err != nil {
  41001. return nil, err
  41002. }
  41003. defer googleapi.CloseBody(res)
  41004. if err := googleapi.CheckResponse(res); err != nil {
  41005. return nil, err
  41006. }
  41007. ret := &Site{
  41008. ServerResponse: googleapi.ServerResponse{
  41009. Header: res.Header,
  41010. HTTPStatusCode: res.StatusCode,
  41011. },
  41012. }
  41013. target := &ret
  41014. if err := gensupport.DecodeResponse(target, res); err != nil {
  41015. return nil, err
  41016. }
  41017. return ret, nil
  41018. // {
  41019. // "description": "Inserts a new site.",
  41020. // "httpMethod": "POST",
  41021. // "id": "dfareporting.sites.insert",
  41022. // "parameterOrder": [
  41023. // "profileId"
  41024. // ],
  41025. // "parameters": {
  41026. // "profileId": {
  41027. // "description": "User profile ID associated with this request.",
  41028. // "format": "int64",
  41029. // "location": "path",
  41030. // "required": true,
  41031. // "type": "string"
  41032. // }
  41033. // },
  41034. // "path": "userprofiles/{profileId}/sites",
  41035. // "request": {
  41036. // "$ref": "Site"
  41037. // },
  41038. // "response": {
  41039. // "$ref": "Site"
  41040. // },
  41041. // "scopes": [
  41042. // "https://www.googleapis.com/auth/dfatrafficking"
  41043. // ]
  41044. // }
  41045. }
  41046. // method id "dfareporting.sites.list":
  41047. type SitesListCall struct {
  41048. s *Service
  41049. profileId int64
  41050. urlParams_ gensupport.URLParams
  41051. ifNoneMatch_ string
  41052. ctx_ context.Context
  41053. header_ http.Header
  41054. }
  41055. // List: Retrieves a list of sites, possibly filtered. This method
  41056. // supports paging.
  41057. func (r *SitesService) List(profileId int64) *SitesListCall {
  41058. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41059. c.profileId = profileId
  41060. return c
  41061. }
  41062. // AcceptsInStreamVideoPlacements sets the optional parameter
  41063. // "acceptsInStreamVideoPlacements": This search filter is no longer
  41064. // supported and will have no effect on the results returned.
  41065. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  41066. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  41067. return c
  41068. }
  41069. // AcceptsInterstitialPlacements sets the optional parameter
  41070. // "acceptsInterstitialPlacements": This search filter is no longer
  41071. // supported and will have no effect on the results returned.
  41072. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  41073. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  41074. return c
  41075. }
  41076. // AcceptsPublisherPaidPlacements sets the optional parameter
  41077. // "acceptsPublisherPaidPlacements": Select only sites that accept
  41078. // publisher paid placements.
  41079. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  41080. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  41081. return c
  41082. }
  41083. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  41084. // AdWords sites.
  41085. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  41086. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  41087. return c
  41088. }
  41089. // Approved sets the optional parameter "approved": Select only approved
  41090. // sites.
  41091. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  41092. c.urlParams_.Set("approved", fmt.Sprint(approved))
  41093. return c
  41094. }
  41095. // CampaignIds sets the optional parameter "campaignIds": Select only
  41096. // sites with these campaign IDs.
  41097. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  41098. var campaignIds_ []string
  41099. for _, v := range campaignIds {
  41100. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  41101. }
  41102. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  41103. return c
  41104. }
  41105. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  41106. // Select only sites with these directory site IDs.
  41107. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  41108. var directorySiteIds_ []string
  41109. for _, v := range directorySiteIds {
  41110. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  41111. }
  41112. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  41113. return c
  41114. }
  41115. // Ids sets the optional parameter "ids": Select only sites with these
  41116. // IDs.
  41117. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  41118. var ids_ []string
  41119. for _, v := range ids {
  41120. ids_ = append(ids_, fmt.Sprint(v))
  41121. }
  41122. c.urlParams_.SetMulti("ids", ids_)
  41123. return c
  41124. }
  41125. // MaxResults sets the optional parameter "maxResults": Maximum number
  41126. // of results to return.
  41127. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  41128. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41129. return c
  41130. }
  41131. // PageToken sets the optional parameter "pageToken": Value of the
  41132. // nextPageToken from the previous result page.
  41133. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  41134. c.urlParams_.Set("pageToken", pageToken)
  41135. return c
  41136. }
  41137. // SearchString sets the optional parameter "searchString": Allows
  41138. // searching for objects by name, ID or keyName. Wildcards (*) are
  41139. // allowed. For example, "site*2015" will return objects with names like
  41140. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  41141. // the searches also add wildcards implicitly at the start and the end
  41142. // of the search string. For example, a search string of "site" will
  41143. // match objects with name "my site", "site 2015", or simply "site".
  41144. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  41145. c.urlParams_.Set("searchString", searchString)
  41146. return c
  41147. }
  41148. // SortField sets the optional parameter "sortField": Field by which to
  41149. // sort the list.
  41150. //
  41151. // Possible values:
  41152. // "ID" (default)
  41153. // "NAME"
  41154. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  41155. c.urlParams_.Set("sortField", sortField)
  41156. return c
  41157. }
  41158. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41159. // results.
  41160. //
  41161. // Possible values:
  41162. // "ASCENDING" (default)
  41163. // "DESCENDING"
  41164. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  41165. c.urlParams_.Set("sortOrder", sortOrder)
  41166. return c
  41167. }
  41168. // SubaccountId sets the optional parameter "subaccountId": Select only
  41169. // sites with this subaccount ID.
  41170. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  41171. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  41172. return c
  41173. }
  41174. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  41175. // sites that have not been mapped to a directory site.
  41176. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  41177. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  41178. return c
  41179. }
  41180. // Fields allows partial responses to be retrieved. See
  41181. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41182. // for more information.
  41183. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  41184. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41185. return c
  41186. }
  41187. // IfNoneMatch sets the optional parameter which makes the operation
  41188. // fail if the object's ETag matches the given value. This is useful for
  41189. // getting updates only after the object has changed since the last
  41190. // request. Use googleapi.IsNotModified to check whether the response
  41191. // error from Do is the result of In-None-Match.
  41192. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  41193. c.ifNoneMatch_ = entityTag
  41194. return c
  41195. }
  41196. // Context sets the context to be used in this call's Do method. Any
  41197. // pending HTTP request will be aborted if the provided context is
  41198. // canceled.
  41199. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  41200. c.ctx_ = ctx
  41201. return c
  41202. }
  41203. // Header returns an http.Header that can be modified by the caller to
  41204. // add HTTP headers to the request.
  41205. func (c *SitesListCall) Header() http.Header {
  41206. if c.header_ == nil {
  41207. c.header_ = make(http.Header)
  41208. }
  41209. return c.header_
  41210. }
  41211. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  41212. reqHeaders := make(http.Header)
  41213. for k, v := range c.header_ {
  41214. reqHeaders[k] = v
  41215. }
  41216. reqHeaders.Set("User-Agent", c.s.userAgent())
  41217. if c.ifNoneMatch_ != "" {
  41218. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41219. }
  41220. var body io.Reader = nil
  41221. c.urlParams_.Set("alt", alt)
  41222. c.urlParams_.Set("prettyPrint", "false")
  41223. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41224. urls += "?" + c.urlParams_.Encode()
  41225. req, err := http.NewRequest("GET", urls, body)
  41226. if err != nil {
  41227. return nil, err
  41228. }
  41229. req.Header = reqHeaders
  41230. googleapi.Expand(req.URL, map[string]string{
  41231. "profileId": strconv.FormatInt(c.profileId, 10),
  41232. })
  41233. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41234. }
  41235. // Do executes the "dfareporting.sites.list" call.
  41236. // Exactly one of *SitesListResponse or error will be non-nil. Any
  41237. // non-2xx status code is an error. Response headers are in either
  41238. // *SitesListResponse.ServerResponse.Header or (if a response was
  41239. // returned at all) in error.(*googleapi.Error).Header. Use
  41240. // googleapi.IsNotModified to check whether the returned error was
  41241. // because http.StatusNotModified was returned.
  41242. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  41243. gensupport.SetOptions(c.urlParams_, opts...)
  41244. res, err := c.doRequest("json")
  41245. if res != nil && res.StatusCode == http.StatusNotModified {
  41246. if res.Body != nil {
  41247. res.Body.Close()
  41248. }
  41249. return nil, &googleapi.Error{
  41250. Code: res.StatusCode,
  41251. Header: res.Header,
  41252. }
  41253. }
  41254. if err != nil {
  41255. return nil, err
  41256. }
  41257. defer googleapi.CloseBody(res)
  41258. if err := googleapi.CheckResponse(res); err != nil {
  41259. return nil, err
  41260. }
  41261. ret := &SitesListResponse{
  41262. ServerResponse: googleapi.ServerResponse{
  41263. Header: res.Header,
  41264. HTTPStatusCode: res.StatusCode,
  41265. },
  41266. }
  41267. target := &ret
  41268. if err := gensupport.DecodeResponse(target, res); err != nil {
  41269. return nil, err
  41270. }
  41271. return ret, nil
  41272. // {
  41273. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  41274. // "httpMethod": "GET",
  41275. // "id": "dfareporting.sites.list",
  41276. // "parameterOrder": [
  41277. // "profileId"
  41278. // ],
  41279. // "parameters": {
  41280. // "acceptsInStreamVideoPlacements": {
  41281. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41282. // "location": "query",
  41283. // "type": "boolean"
  41284. // },
  41285. // "acceptsInterstitialPlacements": {
  41286. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  41287. // "location": "query",
  41288. // "type": "boolean"
  41289. // },
  41290. // "acceptsPublisherPaidPlacements": {
  41291. // "description": "Select only sites that accept publisher paid placements.",
  41292. // "location": "query",
  41293. // "type": "boolean"
  41294. // },
  41295. // "adWordsSite": {
  41296. // "description": "Select only AdWords sites.",
  41297. // "location": "query",
  41298. // "type": "boolean"
  41299. // },
  41300. // "approved": {
  41301. // "description": "Select only approved sites.",
  41302. // "location": "query",
  41303. // "type": "boolean"
  41304. // },
  41305. // "campaignIds": {
  41306. // "description": "Select only sites with these campaign IDs.",
  41307. // "format": "int64",
  41308. // "location": "query",
  41309. // "repeated": true,
  41310. // "type": "string"
  41311. // },
  41312. // "directorySiteIds": {
  41313. // "description": "Select only sites with these directory site IDs.",
  41314. // "format": "int64",
  41315. // "location": "query",
  41316. // "repeated": true,
  41317. // "type": "string"
  41318. // },
  41319. // "ids": {
  41320. // "description": "Select only sites with these IDs.",
  41321. // "format": "int64",
  41322. // "location": "query",
  41323. // "repeated": true,
  41324. // "type": "string"
  41325. // },
  41326. // "maxResults": {
  41327. // "default": "1000",
  41328. // "description": "Maximum number of results to return.",
  41329. // "format": "int32",
  41330. // "location": "query",
  41331. // "maximum": "1000",
  41332. // "minimum": "0",
  41333. // "type": "integer"
  41334. // },
  41335. // "pageToken": {
  41336. // "description": "Value of the nextPageToken from the previous result page.",
  41337. // "location": "query",
  41338. // "type": "string"
  41339. // },
  41340. // "profileId": {
  41341. // "description": "User profile ID associated with this request.",
  41342. // "format": "int64",
  41343. // "location": "path",
  41344. // "required": true,
  41345. // "type": "string"
  41346. // },
  41347. // "searchString": {
  41348. // "description": "Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, \"site*2015\" will return objects with names like \"site June 2015\", \"site April 2015\", or simply \"site 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"site\" will match objects with name \"my site\", \"site 2015\", or simply \"site\".",
  41349. // "location": "query",
  41350. // "type": "string"
  41351. // },
  41352. // "sortField": {
  41353. // "default": "ID",
  41354. // "description": "Field by which to sort the list.",
  41355. // "enum": [
  41356. // "ID",
  41357. // "NAME"
  41358. // ],
  41359. // "enumDescriptions": [
  41360. // "",
  41361. // ""
  41362. // ],
  41363. // "location": "query",
  41364. // "type": "string"
  41365. // },
  41366. // "sortOrder": {
  41367. // "default": "ASCENDING",
  41368. // "description": "Order of sorted results.",
  41369. // "enum": [
  41370. // "ASCENDING",
  41371. // "DESCENDING"
  41372. // ],
  41373. // "enumDescriptions": [
  41374. // "",
  41375. // ""
  41376. // ],
  41377. // "location": "query",
  41378. // "type": "string"
  41379. // },
  41380. // "subaccountId": {
  41381. // "description": "Select only sites with this subaccount ID.",
  41382. // "format": "int64",
  41383. // "location": "query",
  41384. // "type": "string"
  41385. // },
  41386. // "unmappedSite": {
  41387. // "description": "Select only sites that have not been mapped to a directory site.",
  41388. // "location": "query",
  41389. // "type": "boolean"
  41390. // }
  41391. // },
  41392. // "path": "userprofiles/{profileId}/sites",
  41393. // "response": {
  41394. // "$ref": "SitesListResponse"
  41395. // },
  41396. // "scopes": [
  41397. // "https://www.googleapis.com/auth/dfatrafficking"
  41398. // ]
  41399. // }
  41400. }
  41401. // Pages invokes f for each page of results.
  41402. // A non-nil error returned from f will halt the iteration.
  41403. // The provided context supersedes any context provided to the Context method.
  41404. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  41405. c.ctx_ = ctx
  41406. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41407. for {
  41408. x, err := c.Do()
  41409. if err != nil {
  41410. return err
  41411. }
  41412. if err := f(x); err != nil {
  41413. return err
  41414. }
  41415. if x.NextPageToken == "" {
  41416. return nil
  41417. }
  41418. c.PageToken(x.NextPageToken)
  41419. }
  41420. }
  41421. // method id "dfareporting.sites.patch":
  41422. type SitesPatchCall struct {
  41423. s *Service
  41424. profileId int64
  41425. site *Site
  41426. urlParams_ gensupport.URLParams
  41427. ctx_ context.Context
  41428. header_ http.Header
  41429. }
  41430. // Patch: Updates an existing site. This method supports patch
  41431. // semantics.
  41432. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  41433. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41434. c.profileId = profileId
  41435. c.urlParams_.Set("id", fmt.Sprint(id))
  41436. c.site = site
  41437. return c
  41438. }
  41439. // Fields allows partial responses to be retrieved. See
  41440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41441. // for more information.
  41442. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  41443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41444. return c
  41445. }
  41446. // Context sets the context to be used in this call's Do method. Any
  41447. // pending HTTP request will be aborted if the provided context is
  41448. // canceled.
  41449. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  41450. c.ctx_ = ctx
  41451. return c
  41452. }
  41453. // Header returns an http.Header that can be modified by the caller to
  41454. // add HTTP headers to the request.
  41455. func (c *SitesPatchCall) Header() http.Header {
  41456. if c.header_ == nil {
  41457. c.header_ = make(http.Header)
  41458. }
  41459. return c.header_
  41460. }
  41461. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  41462. reqHeaders := make(http.Header)
  41463. for k, v := range c.header_ {
  41464. reqHeaders[k] = v
  41465. }
  41466. reqHeaders.Set("User-Agent", c.s.userAgent())
  41467. var body io.Reader = nil
  41468. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41469. if err != nil {
  41470. return nil, err
  41471. }
  41472. reqHeaders.Set("Content-Type", "application/json")
  41473. c.urlParams_.Set("alt", alt)
  41474. c.urlParams_.Set("prettyPrint", "false")
  41475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41476. urls += "?" + c.urlParams_.Encode()
  41477. req, err := http.NewRequest("PATCH", urls, body)
  41478. if err != nil {
  41479. return nil, err
  41480. }
  41481. req.Header = reqHeaders
  41482. googleapi.Expand(req.URL, map[string]string{
  41483. "profileId": strconv.FormatInt(c.profileId, 10),
  41484. })
  41485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41486. }
  41487. // Do executes the "dfareporting.sites.patch" call.
  41488. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41489. // code is an error. Response headers are in either
  41490. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41491. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41492. // whether the returned error was because http.StatusNotModified was
  41493. // returned.
  41494. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41495. gensupport.SetOptions(c.urlParams_, opts...)
  41496. res, err := c.doRequest("json")
  41497. if res != nil && res.StatusCode == http.StatusNotModified {
  41498. if res.Body != nil {
  41499. res.Body.Close()
  41500. }
  41501. return nil, &googleapi.Error{
  41502. Code: res.StatusCode,
  41503. Header: res.Header,
  41504. }
  41505. }
  41506. if err != nil {
  41507. return nil, err
  41508. }
  41509. defer googleapi.CloseBody(res)
  41510. if err := googleapi.CheckResponse(res); err != nil {
  41511. return nil, err
  41512. }
  41513. ret := &Site{
  41514. ServerResponse: googleapi.ServerResponse{
  41515. Header: res.Header,
  41516. HTTPStatusCode: res.StatusCode,
  41517. },
  41518. }
  41519. target := &ret
  41520. if err := gensupport.DecodeResponse(target, res); err != nil {
  41521. return nil, err
  41522. }
  41523. return ret, nil
  41524. // {
  41525. // "description": "Updates an existing site. This method supports patch semantics.",
  41526. // "httpMethod": "PATCH",
  41527. // "id": "dfareporting.sites.patch",
  41528. // "parameterOrder": [
  41529. // "profileId",
  41530. // "id"
  41531. // ],
  41532. // "parameters": {
  41533. // "id": {
  41534. // "description": "Site ID.",
  41535. // "format": "int64",
  41536. // "location": "query",
  41537. // "required": true,
  41538. // "type": "string"
  41539. // },
  41540. // "profileId": {
  41541. // "description": "User profile ID associated with this request.",
  41542. // "format": "int64",
  41543. // "location": "path",
  41544. // "required": true,
  41545. // "type": "string"
  41546. // }
  41547. // },
  41548. // "path": "userprofiles/{profileId}/sites",
  41549. // "request": {
  41550. // "$ref": "Site"
  41551. // },
  41552. // "response": {
  41553. // "$ref": "Site"
  41554. // },
  41555. // "scopes": [
  41556. // "https://www.googleapis.com/auth/dfatrafficking"
  41557. // ]
  41558. // }
  41559. }
  41560. // method id "dfareporting.sites.update":
  41561. type SitesUpdateCall struct {
  41562. s *Service
  41563. profileId int64
  41564. site *Site
  41565. urlParams_ gensupport.URLParams
  41566. ctx_ context.Context
  41567. header_ http.Header
  41568. }
  41569. // Update: Updates an existing site.
  41570. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  41571. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41572. c.profileId = profileId
  41573. c.site = site
  41574. return c
  41575. }
  41576. // Fields allows partial responses to be retrieved. See
  41577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41578. // for more information.
  41579. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  41580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41581. return c
  41582. }
  41583. // Context sets the context to be used in this call's Do method. Any
  41584. // pending HTTP request will be aborted if the provided context is
  41585. // canceled.
  41586. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  41587. c.ctx_ = ctx
  41588. return c
  41589. }
  41590. // Header returns an http.Header that can be modified by the caller to
  41591. // add HTTP headers to the request.
  41592. func (c *SitesUpdateCall) Header() http.Header {
  41593. if c.header_ == nil {
  41594. c.header_ = make(http.Header)
  41595. }
  41596. return c.header_
  41597. }
  41598. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  41599. reqHeaders := make(http.Header)
  41600. for k, v := range c.header_ {
  41601. reqHeaders[k] = v
  41602. }
  41603. reqHeaders.Set("User-Agent", c.s.userAgent())
  41604. var body io.Reader = nil
  41605. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  41606. if err != nil {
  41607. return nil, err
  41608. }
  41609. reqHeaders.Set("Content-Type", "application/json")
  41610. c.urlParams_.Set("alt", alt)
  41611. c.urlParams_.Set("prettyPrint", "false")
  41612. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  41613. urls += "?" + c.urlParams_.Encode()
  41614. req, err := http.NewRequest("PUT", urls, body)
  41615. if err != nil {
  41616. return nil, err
  41617. }
  41618. req.Header = reqHeaders
  41619. googleapi.Expand(req.URL, map[string]string{
  41620. "profileId": strconv.FormatInt(c.profileId, 10),
  41621. })
  41622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41623. }
  41624. // Do executes the "dfareporting.sites.update" call.
  41625. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  41626. // code is an error. Response headers are in either
  41627. // *Site.ServerResponse.Header or (if a response was returned at all) in
  41628. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41629. // whether the returned error was because http.StatusNotModified was
  41630. // returned.
  41631. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  41632. gensupport.SetOptions(c.urlParams_, opts...)
  41633. res, err := c.doRequest("json")
  41634. if res != nil && res.StatusCode == http.StatusNotModified {
  41635. if res.Body != nil {
  41636. res.Body.Close()
  41637. }
  41638. return nil, &googleapi.Error{
  41639. Code: res.StatusCode,
  41640. Header: res.Header,
  41641. }
  41642. }
  41643. if err != nil {
  41644. return nil, err
  41645. }
  41646. defer googleapi.CloseBody(res)
  41647. if err := googleapi.CheckResponse(res); err != nil {
  41648. return nil, err
  41649. }
  41650. ret := &Site{
  41651. ServerResponse: googleapi.ServerResponse{
  41652. Header: res.Header,
  41653. HTTPStatusCode: res.StatusCode,
  41654. },
  41655. }
  41656. target := &ret
  41657. if err := gensupport.DecodeResponse(target, res); err != nil {
  41658. return nil, err
  41659. }
  41660. return ret, nil
  41661. // {
  41662. // "description": "Updates an existing site.",
  41663. // "httpMethod": "PUT",
  41664. // "id": "dfareporting.sites.update",
  41665. // "parameterOrder": [
  41666. // "profileId"
  41667. // ],
  41668. // "parameters": {
  41669. // "profileId": {
  41670. // "description": "User profile ID associated with this request.",
  41671. // "format": "int64",
  41672. // "location": "path",
  41673. // "required": true,
  41674. // "type": "string"
  41675. // }
  41676. // },
  41677. // "path": "userprofiles/{profileId}/sites",
  41678. // "request": {
  41679. // "$ref": "Site"
  41680. // },
  41681. // "response": {
  41682. // "$ref": "Site"
  41683. // },
  41684. // "scopes": [
  41685. // "https://www.googleapis.com/auth/dfatrafficking"
  41686. // ]
  41687. // }
  41688. }
  41689. // method id "dfareporting.sizes.get":
  41690. type SizesGetCall struct {
  41691. s *Service
  41692. profileId int64
  41693. id int64
  41694. urlParams_ gensupport.URLParams
  41695. ifNoneMatch_ string
  41696. ctx_ context.Context
  41697. header_ http.Header
  41698. }
  41699. // Get: Gets one size by ID.
  41700. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  41701. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41702. c.profileId = profileId
  41703. c.id = id
  41704. return c
  41705. }
  41706. // Fields allows partial responses to be retrieved. See
  41707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41708. // for more information.
  41709. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  41710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41711. return c
  41712. }
  41713. // IfNoneMatch sets the optional parameter which makes the operation
  41714. // fail if the object's ETag matches the given value. This is useful for
  41715. // getting updates only after the object has changed since the last
  41716. // request. Use googleapi.IsNotModified to check whether the response
  41717. // error from Do is the result of In-None-Match.
  41718. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  41719. c.ifNoneMatch_ = entityTag
  41720. return c
  41721. }
  41722. // Context sets the context to be used in this call's Do method. Any
  41723. // pending HTTP request will be aborted if the provided context is
  41724. // canceled.
  41725. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  41726. c.ctx_ = ctx
  41727. return c
  41728. }
  41729. // Header returns an http.Header that can be modified by the caller to
  41730. // add HTTP headers to the request.
  41731. func (c *SizesGetCall) Header() http.Header {
  41732. if c.header_ == nil {
  41733. c.header_ = make(http.Header)
  41734. }
  41735. return c.header_
  41736. }
  41737. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  41738. reqHeaders := make(http.Header)
  41739. for k, v := range c.header_ {
  41740. reqHeaders[k] = v
  41741. }
  41742. reqHeaders.Set("User-Agent", c.s.userAgent())
  41743. if c.ifNoneMatch_ != "" {
  41744. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41745. }
  41746. var body io.Reader = nil
  41747. c.urlParams_.Set("alt", alt)
  41748. c.urlParams_.Set("prettyPrint", "false")
  41749. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  41750. urls += "?" + c.urlParams_.Encode()
  41751. req, err := http.NewRequest("GET", urls, body)
  41752. if err != nil {
  41753. return nil, err
  41754. }
  41755. req.Header = reqHeaders
  41756. googleapi.Expand(req.URL, map[string]string{
  41757. "profileId": strconv.FormatInt(c.profileId, 10),
  41758. "id": strconv.FormatInt(c.id, 10),
  41759. })
  41760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41761. }
  41762. // Do executes the "dfareporting.sizes.get" call.
  41763. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41764. // code is an error. Response headers are in either
  41765. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41766. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41767. // whether the returned error was because http.StatusNotModified was
  41768. // returned.
  41769. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41770. gensupport.SetOptions(c.urlParams_, opts...)
  41771. res, err := c.doRequest("json")
  41772. if res != nil && res.StatusCode == http.StatusNotModified {
  41773. if res.Body != nil {
  41774. res.Body.Close()
  41775. }
  41776. return nil, &googleapi.Error{
  41777. Code: res.StatusCode,
  41778. Header: res.Header,
  41779. }
  41780. }
  41781. if err != nil {
  41782. return nil, err
  41783. }
  41784. defer googleapi.CloseBody(res)
  41785. if err := googleapi.CheckResponse(res); err != nil {
  41786. return nil, err
  41787. }
  41788. ret := &Size{
  41789. ServerResponse: googleapi.ServerResponse{
  41790. Header: res.Header,
  41791. HTTPStatusCode: res.StatusCode,
  41792. },
  41793. }
  41794. target := &ret
  41795. if err := gensupport.DecodeResponse(target, res); err != nil {
  41796. return nil, err
  41797. }
  41798. return ret, nil
  41799. // {
  41800. // "description": "Gets one size by ID.",
  41801. // "httpMethod": "GET",
  41802. // "id": "dfareporting.sizes.get",
  41803. // "parameterOrder": [
  41804. // "profileId",
  41805. // "id"
  41806. // ],
  41807. // "parameters": {
  41808. // "id": {
  41809. // "description": "Size ID.",
  41810. // "format": "int64",
  41811. // "location": "path",
  41812. // "required": true,
  41813. // "type": "string"
  41814. // },
  41815. // "profileId": {
  41816. // "description": "User profile ID associated with this request.",
  41817. // "format": "int64",
  41818. // "location": "path",
  41819. // "required": true,
  41820. // "type": "string"
  41821. // }
  41822. // },
  41823. // "path": "userprofiles/{profileId}/sizes/{id}",
  41824. // "response": {
  41825. // "$ref": "Size"
  41826. // },
  41827. // "scopes": [
  41828. // "https://www.googleapis.com/auth/dfatrafficking"
  41829. // ]
  41830. // }
  41831. }
  41832. // method id "dfareporting.sizes.insert":
  41833. type SizesInsertCall struct {
  41834. s *Service
  41835. profileId int64
  41836. size *Size
  41837. urlParams_ gensupport.URLParams
  41838. ctx_ context.Context
  41839. header_ http.Header
  41840. }
  41841. // Insert: Inserts a new size.
  41842. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  41843. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41844. c.profileId = profileId
  41845. c.size = size
  41846. return c
  41847. }
  41848. // Fields allows partial responses to be retrieved. See
  41849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41850. // for more information.
  41851. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  41852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41853. return c
  41854. }
  41855. // Context sets the context to be used in this call's Do method. Any
  41856. // pending HTTP request will be aborted if the provided context is
  41857. // canceled.
  41858. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  41859. c.ctx_ = ctx
  41860. return c
  41861. }
  41862. // Header returns an http.Header that can be modified by the caller to
  41863. // add HTTP headers to the request.
  41864. func (c *SizesInsertCall) Header() http.Header {
  41865. if c.header_ == nil {
  41866. c.header_ = make(http.Header)
  41867. }
  41868. return c.header_
  41869. }
  41870. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  41871. reqHeaders := make(http.Header)
  41872. for k, v := range c.header_ {
  41873. reqHeaders[k] = v
  41874. }
  41875. reqHeaders.Set("User-Agent", c.s.userAgent())
  41876. var body io.Reader = nil
  41877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  41878. if err != nil {
  41879. return nil, err
  41880. }
  41881. reqHeaders.Set("Content-Type", "application/json")
  41882. c.urlParams_.Set("alt", alt)
  41883. c.urlParams_.Set("prettyPrint", "false")
  41884. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  41885. urls += "?" + c.urlParams_.Encode()
  41886. req, err := http.NewRequest("POST", urls, body)
  41887. if err != nil {
  41888. return nil, err
  41889. }
  41890. req.Header = reqHeaders
  41891. googleapi.Expand(req.URL, map[string]string{
  41892. "profileId": strconv.FormatInt(c.profileId, 10),
  41893. })
  41894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41895. }
  41896. // Do executes the "dfareporting.sizes.insert" call.
  41897. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41898. // code is an error. Response headers are in either
  41899. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41900. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41901. // whether the returned error was because http.StatusNotModified was
  41902. // returned.
  41903. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41904. gensupport.SetOptions(c.urlParams_, opts...)
  41905. res, err := c.doRequest("json")
  41906. if res != nil && res.StatusCode == http.StatusNotModified {
  41907. if res.Body != nil {
  41908. res.Body.Close()
  41909. }
  41910. return nil, &googleapi.Error{
  41911. Code: res.StatusCode,
  41912. Header: res.Header,
  41913. }
  41914. }
  41915. if err != nil {
  41916. return nil, err
  41917. }
  41918. defer googleapi.CloseBody(res)
  41919. if err := googleapi.CheckResponse(res); err != nil {
  41920. return nil, err
  41921. }
  41922. ret := &Size{
  41923. ServerResponse: googleapi.ServerResponse{
  41924. Header: res.Header,
  41925. HTTPStatusCode: res.StatusCode,
  41926. },
  41927. }
  41928. target := &ret
  41929. if err := gensupport.DecodeResponse(target, res); err != nil {
  41930. return nil, err
  41931. }
  41932. return ret, nil
  41933. // {
  41934. // "description": "Inserts a new size.",
  41935. // "httpMethod": "POST",
  41936. // "id": "dfareporting.sizes.insert",
  41937. // "parameterOrder": [
  41938. // "profileId"
  41939. // ],
  41940. // "parameters": {
  41941. // "profileId": {
  41942. // "description": "User profile ID associated with this request.",
  41943. // "format": "int64",
  41944. // "location": "path",
  41945. // "required": true,
  41946. // "type": "string"
  41947. // }
  41948. // },
  41949. // "path": "userprofiles/{profileId}/sizes",
  41950. // "request": {
  41951. // "$ref": "Size"
  41952. // },
  41953. // "response": {
  41954. // "$ref": "Size"
  41955. // },
  41956. // "scopes": [
  41957. // "https://www.googleapis.com/auth/dfatrafficking"
  41958. // ]
  41959. // }
  41960. }
  41961. // method id "dfareporting.sizes.list":
  41962. type SizesListCall struct {
  41963. s *Service
  41964. profileId int64
  41965. urlParams_ gensupport.URLParams
  41966. ifNoneMatch_ string
  41967. ctx_ context.Context
  41968. header_ http.Header
  41969. }
  41970. // List: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  41971. // are globally unique and may include values not currently in use by
  41972. // your account. Due to this, the list of sizes returned by this method
  41973. // may differ from the list seen in the Trafficking UI.
  41974. func (r *SizesService) List(profileId int64) *SizesListCall {
  41975. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41976. c.profileId = profileId
  41977. return c
  41978. }
  41979. // Height sets the optional parameter "height": Select only sizes with
  41980. // this height.
  41981. func (c *SizesListCall) Height(height int64) *SizesListCall {
  41982. c.urlParams_.Set("height", fmt.Sprint(height))
  41983. return c
  41984. }
  41985. // IabStandard sets the optional parameter "iabStandard": Select only
  41986. // IAB standard sizes.
  41987. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  41988. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  41989. return c
  41990. }
  41991. // Ids sets the optional parameter "ids": Select only sizes with these
  41992. // IDs.
  41993. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  41994. var ids_ []string
  41995. for _, v := range ids {
  41996. ids_ = append(ids_, fmt.Sprint(v))
  41997. }
  41998. c.urlParams_.SetMulti("ids", ids_)
  41999. return c
  42000. }
  42001. // Width sets the optional parameter "width": Select only sizes with
  42002. // this width.
  42003. func (c *SizesListCall) Width(width int64) *SizesListCall {
  42004. c.urlParams_.Set("width", fmt.Sprint(width))
  42005. return c
  42006. }
  42007. // Fields allows partial responses to be retrieved. See
  42008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42009. // for more information.
  42010. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  42011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42012. return c
  42013. }
  42014. // IfNoneMatch sets the optional parameter which makes the operation
  42015. // fail if the object's ETag matches the given value. This is useful for
  42016. // getting updates only after the object has changed since the last
  42017. // request. Use googleapi.IsNotModified to check whether the response
  42018. // error from Do is the result of In-None-Match.
  42019. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  42020. c.ifNoneMatch_ = entityTag
  42021. return c
  42022. }
  42023. // Context sets the context to be used in this call's Do method. Any
  42024. // pending HTTP request will be aborted if the provided context is
  42025. // canceled.
  42026. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  42027. c.ctx_ = ctx
  42028. return c
  42029. }
  42030. // Header returns an http.Header that can be modified by the caller to
  42031. // add HTTP headers to the request.
  42032. func (c *SizesListCall) Header() http.Header {
  42033. if c.header_ == nil {
  42034. c.header_ = make(http.Header)
  42035. }
  42036. return c.header_
  42037. }
  42038. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  42039. reqHeaders := make(http.Header)
  42040. for k, v := range c.header_ {
  42041. reqHeaders[k] = v
  42042. }
  42043. reqHeaders.Set("User-Agent", c.s.userAgent())
  42044. if c.ifNoneMatch_ != "" {
  42045. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42046. }
  42047. var body io.Reader = nil
  42048. c.urlParams_.Set("alt", alt)
  42049. c.urlParams_.Set("prettyPrint", "false")
  42050. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  42051. urls += "?" + c.urlParams_.Encode()
  42052. req, err := http.NewRequest("GET", urls, body)
  42053. if err != nil {
  42054. return nil, err
  42055. }
  42056. req.Header = reqHeaders
  42057. googleapi.Expand(req.URL, map[string]string{
  42058. "profileId": strconv.FormatInt(c.profileId, 10),
  42059. })
  42060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42061. }
  42062. // Do executes the "dfareporting.sizes.list" call.
  42063. // Exactly one of *SizesListResponse or error will be non-nil. Any
  42064. // non-2xx status code is an error. Response headers are in either
  42065. // *SizesListResponse.ServerResponse.Header or (if a response was
  42066. // returned at all) in error.(*googleapi.Error).Header. Use
  42067. // googleapi.IsNotModified to check whether the returned error was
  42068. // because http.StatusNotModified was returned.
  42069. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  42070. gensupport.SetOptions(c.urlParams_, opts...)
  42071. res, err := c.doRequest("json")
  42072. if res != nil && res.StatusCode == http.StatusNotModified {
  42073. if res.Body != nil {
  42074. res.Body.Close()
  42075. }
  42076. return nil, &googleapi.Error{
  42077. Code: res.StatusCode,
  42078. Header: res.Header,
  42079. }
  42080. }
  42081. if err != nil {
  42082. return nil, err
  42083. }
  42084. defer googleapi.CloseBody(res)
  42085. if err := googleapi.CheckResponse(res); err != nil {
  42086. return nil, err
  42087. }
  42088. ret := &SizesListResponse{
  42089. ServerResponse: googleapi.ServerResponse{
  42090. Header: res.Header,
  42091. HTTPStatusCode: res.StatusCode,
  42092. },
  42093. }
  42094. target := &ret
  42095. if err := gensupport.DecodeResponse(target, res); err != nil {
  42096. return nil, err
  42097. }
  42098. return ret, nil
  42099. // {
  42100. // "description": "Retrieves a list of sizes, possibly filtered. Retrieved sizes are globally unique and may include values not currently in use by your account. Due to this, the list of sizes returned by this method may differ from the list seen in the Trafficking UI.",
  42101. // "httpMethod": "GET",
  42102. // "id": "dfareporting.sizes.list",
  42103. // "parameterOrder": [
  42104. // "profileId"
  42105. // ],
  42106. // "parameters": {
  42107. // "height": {
  42108. // "description": "Select only sizes with this height.",
  42109. // "format": "int32",
  42110. // "location": "query",
  42111. // "maximum": "32767",
  42112. // "minimum": "0",
  42113. // "type": "integer"
  42114. // },
  42115. // "iabStandard": {
  42116. // "description": "Select only IAB standard sizes.",
  42117. // "location": "query",
  42118. // "type": "boolean"
  42119. // },
  42120. // "ids": {
  42121. // "description": "Select only sizes with these IDs.",
  42122. // "format": "int64",
  42123. // "location": "query",
  42124. // "repeated": true,
  42125. // "type": "string"
  42126. // },
  42127. // "profileId": {
  42128. // "description": "User profile ID associated with this request.",
  42129. // "format": "int64",
  42130. // "location": "path",
  42131. // "required": true,
  42132. // "type": "string"
  42133. // },
  42134. // "width": {
  42135. // "description": "Select only sizes with this width.",
  42136. // "format": "int32",
  42137. // "location": "query",
  42138. // "maximum": "32767",
  42139. // "minimum": "0",
  42140. // "type": "integer"
  42141. // }
  42142. // },
  42143. // "path": "userprofiles/{profileId}/sizes",
  42144. // "response": {
  42145. // "$ref": "SizesListResponse"
  42146. // },
  42147. // "scopes": [
  42148. // "https://www.googleapis.com/auth/dfatrafficking"
  42149. // ]
  42150. // }
  42151. }
  42152. // method id "dfareporting.subaccounts.get":
  42153. type SubaccountsGetCall struct {
  42154. s *Service
  42155. profileId int64
  42156. id int64
  42157. urlParams_ gensupport.URLParams
  42158. ifNoneMatch_ string
  42159. ctx_ context.Context
  42160. header_ http.Header
  42161. }
  42162. // Get: Gets one subaccount by ID.
  42163. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  42164. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42165. c.profileId = profileId
  42166. c.id = id
  42167. return c
  42168. }
  42169. // Fields allows partial responses to be retrieved. See
  42170. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42171. // for more information.
  42172. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  42173. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42174. return c
  42175. }
  42176. // IfNoneMatch sets the optional parameter which makes the operation
  42177. // fail if the object's ETag matches the given value. This is useful for
  42178. // getting updates only after the object has changed since the last
  42179. // request. Use googleapi.IsNotModified to check whether the response
  42180. // error from Do is the result of In-None-Match.
  42181. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  42182. c.ifNoneMatch_ = entityTag
  42183. return c
  42184. }
  42185. // Context sets the context to be used in this call's Do method. Any
  42186. // pending HTTP request will be aborted if the provided context is
  42187. // canceled.
  42188. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  42189. c.ctx_ = ctx
  42190. return c
  42191. }
  42192. // Header returns an http.Header that can be modified by the caller to
  42193. // add HTTP headers to the request.
  42194. func (c *SubaccountsGetCall) Header() http.Header {
  42195. if c.header_ == nil {
  42196. c.header_ = make(http.Header)
  42197. }
  42198. return c.header_
  42199. }
  42200. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  42201. reqHeaders := make(http.Header)
  42202. for k, v := range c.header_ {
  42203. reqHeaders[k] = v
  42204. }
  42205. reqHeaders.Set("User-Agent", c.s.userAgent())
  42206. if c.ifNoneMatch_ != "" {
  42207. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42208. }
  42209. var body io.Reader = nil
  42210. c.urlParams_.Set("alt", alt)
  42211. c.urlParams_.Set("prettyPrint", "false")
  42212. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  42213. urls += "?" + c.urlParams_.Encode()
  42214. req, err := http.NewRequest("GET", urls, body)
  42215. if err != nil {
  42216. return nil, err
  42217. }
  42218. req.Header = reqHeaders
  42219. googleapi.Expand(req.URL, map[string]string{
  42220. "profileId": strconv.FormatInt(c.profileId, 10),
  42221. "id": strconv.FormatInt(c.id, 10),
  42222. })
  42223. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42224. }
  42225. // Do executes the "dfareporting.subaccounts.get" call.
  42226. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42227. // status code is an error. Response headers are in either
  42228. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42229. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42230. // to check whether the returned error was because
  42231. // http.StatusNotModified was returned.
  42232. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42233. gensupport.SetOptions(c.urlParams_, opts...)
  42234. res, err := c.doRequest("json")
  42235. if res != nil && res.StatusCode == http.StatusNotModified {
  42236. if res.Body != nil {
  42237. res.Body.Close()
  42238. }
  42239. return nil, &googleapi.Error{
  42240. Code: res.StatusCode,
  42241. Header: res.Header,
  42242. }
  42243. }
  42244. if err != nil {
  42245. return nil, err
  42246. }
  42247. defer googleapi.CloseBody(res)
  42248. if err := googleapi.CheckResponse(res); err != nil {
  42249. return nil, err
  42250. }
  42251. ret := &Subaccount{
  42252. ServerResponse: googleapi.ServerResponse{
  42253. Header: res.Header,
  42254. HTTPStatusCode: res.StatusCode,
  42255. },
  42256. }
  42257. target := &ret
  42258. if err := gensupport.DecodeResponse(target, res); err != nil {
  42259. return nil, err
  42260. }
  42261. return ret, nil
  42262. // {
  42263. // "description": "Gets one subaccount by ID.",
  42264. // "httpMethod": "GET",
  42265. // "id": "dfareporting.subaccounts.get",
  42266. // "parameterOrder": [
  42267. // "profileId",
  42268. // "id"
  42269. // ],
  42270. // "parameters": {
  42271. // "id": {
  42272. // "description": "Subaccount ID.",
  42273. // "format": "int64",
  42274. // "location": "path",
  42275. // "required": true,
  42276. // "type": "string"
  42277. // },
  42278. // "profileId": {
  42279. // "description": "User profile ID associated with this request.",
  42280. // "format": "int64",
  42281. // "location": "path",
  42282. // "required": true,
  42283. // "type": "string"
  42284. // }
  42285. // },
  42286. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  42287. // "response": {
  42288. // "$ref": "Subaccount"
  42289. // },
  42290. // "scopes": [
  42291. // "https://www.googleapis.com/auth/dfatrafficking"
  42292. // ]
  42293. // }
  42294. }
  42295. // method id "dfareporting.subaccounts.insert":
  42296. type SubaccountsInsertCall struct {
  42297. s *Service
  42298. profileId int64
  42299. subaccount *Subaccount
  42300. urlParams_ gensupport.URLParams
  42301. ctx_ context.Context
  42302. header_ http.Header
  42303. }
  42304. // Insert: Inserts a new subaccount.
  42305. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  42306. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42307. c.profileId = profileId
  42308. c.subaccount = subaccount
  42309. return c
  42310. }
  42311. // Fields allows partial responses to be retrieved. See
  42312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42313. // for more information.
  42314. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  42315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42316. return c
  42317. }
  42318. // Context sets the context to be used in this call's Do method. Any
  42319. // pending HTTP request will be aborted if the provided context is
  42320. // canceled.
  42321. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  42322. c.ctx_ = ctx
  42323. return c
  42324. }
  42325. // Header returns an http.Header that can be modified by the caller to
  42326. // add HTTP headers to the request.
  42327. func (c *SubaccountsInsertCall) Header() http.Header {
  42328. if c.header_ == nil {
  42329. c.header_ = make(http.Header)
  42330. }
  42331. return c.header_
  42332. }
  42333. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  42334. reqHeaders := make(http.Header)
  42335. for k, v := range c.header_ {
  42336. reqHeaders[k] = v
  42337. }
  42338. reqHeaders.Set("User-Agent", c.s.userAgent())
  42339. var body io.Reader = nil
  42340. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42341. if err != nil {
  42342. return nil, err
  42343. }
  42344. reqHeaders.Set("Content-Type", "application/json")
  42345. c.urlParams_.Set("alt", alt)
  42346. c.urlParams_.Set("prettyPrint", "false")
  42347. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42348. urls += "?" + c.urlParams_.Encode()
  42349. req, err := http.NewRequest("POST", urls, body)
  42350. if err != nil {
  42351. return nil, err
  42352. }
  42353. req.Header = reqHeaders
  42354. googleapi.Expand(req.URL, map[string]string{
  42355. "profileId": strconv.FormatInt(c.profileId, 10),
  42356. })
  42357. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42358. }
  42359. // Do executes the "dfareporting.subaccounts.insert" call.
  42360. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42361. // status code is an error. Response headers are in either
  42362. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42363. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42364. // to check whether the returned error was because
  42365. // http.StatusNotModified was returned.
  42366. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42367. gensupport.SetOptions(c.urlParams_, opts...)
  42368. res, err := c.doRequest("json")
  42369. if res != nil && res.StatusCode == http.StatusNotModified {
  42370. if res.Body != nil {
  42371. res.Body.Close()
  42372. }
  42373. return nil, &googleapi.Error{
  42374. Code: res.StatusCode,
  42375. Header: res.Header,
  42376. }
  42377. }
  42378. if err != nil {
  42379. return nil, err
  42380. }
  42381. defer googleapi.CloseBody(res)
  42382. if err := googleapi.CheckResponse(res); err != nil {
  42383. return nil, err
  42384. }
  42385. ret := &Subaccount{
  42386. ServerResponse: googleapi.ServerResponse{
  42387. Header: res.Header,
  42388. HTTPStatusCode: res.StatusCode,
  42389. },
  42390. }
  42391. target := &ret
  42392. if err := gensupport.DecodeResponse(target, res); err != nil {
  42393. return nil, err
  42394. }
  42395. return ret, nil
  42396. // {
  42397. // "description": "Inserts a new subaccount.",
  42398. // "httpMethod": "POST",
  42399. // "id": "dfareporting.subaccounts.insert",
  42400. // "parameterOrder": [
  42401. // "profileId"
  42402. // ],
  42403. // "parameters": {
  42404. // "profileId": {
  42405. // "description": "User profile ID associated with this request.",
  42406. // "format": "int64",
  42407. // "location": "path",
  42408. // "required": true,
  42409. // "type": "string"
  42410. // }
  42411. // },
  42412. // "path": "userprofiles/{profileId}/subaccounts",
  42413. // "request": {
  42414. // "$ref": "Subaccount"
  42415. // },
  42416. // "response": {
  42417. // "$ref": "Subaccount"
  42418. // },
  42419. // "scopes": [
  42420. // "https://www.googleapis.com/auth/dfatrafficking"
  42421. // ]
  42422. // }
  42423. }
  42424. // method id "dfareporting.subaccounts.list":
  42425. type SubaccountsListCall struct {
  42426. s *Service
  42427. profileId int64
  42428. urlParams_ gensupport.URLParams
  42429. ifNoneMatch_ string
  42430. ctx_ context.Context
  42431. header_ http.Header
  42432. }
  42433. // List: Gets a list of subaccounts, possibly filtered. This method
  42434. // supports paging.
  42435. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  42436. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42437. c.profileId = profileId
  42438. return c
  42439. }
  42440. // Ids sets the optional parameter "ids": Select only subaccounts with
  42441. // these IDs.
  42442. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  42443. var ids_ []string
  42444. for _, v := range ids {
  42445. ids_ = append(ids_, fmt.Sprint(v))
  42446. }
  42447. c.urlParams_.SetMulti("ids", ids_)
  42448. return c
  42449. }
  42450. // MaxResults sets the optional parameter "maxResults": Maximum number
  42451. // of results to return.
  42452. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  42453. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42454. return c
  42455. }
  42456. // PageToken sets the optional parameter "pageToken": Value of the
  42457. // nextPageToken from the previous result page.
  42458. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  42459. c.urlParams_.Set("pageToken", pageToken)
  42460. return c
  42461. }
  42462. // SearchString sets the optional parameter "searchString": Allows
  42463. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42464. // example, "subaccount*2015" will return objects with names like
  42465. // "subaccount June 2015", "subaccount April 2015", or simply
  42466. // "subaccount 2015". Most of the searches also add wildcards implicitly
  42467. // at the start and the end of the search string. For example, a search
  42468. // string of "subaccount" will match objects with name "my subaccount",
  42469. // "subaccount 2015", or simply "subaccount".
  42470. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  42471. c.urlParams_.Set("searchString", searchString)
  42472. return c
  42473. }
  42474. // SortField sets the optional parameter "sortField": Field by which to
  42475. // sort the list.
  42476. //
  42477. // Possible values:
  42478. // "ID" (default)
  42479. // "NAME"
  42480. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  42481. c.urlParams_.Set("sortField", sortField)
  42482. return c
  42483. }
  42484. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42485. // results.
  42486. //
  42487. // Possible values:
  42488. // "ASCENDING" (default)
  42489. // "DESCENDING"
  42490. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  42491. c.urlParams_.Set("sortOrder", sortOrder)
  42492. return c
  42493. }
  42494. // Fields allows partial responses to be retrieved. See
  42495. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42496. // for more information.
  42497. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  42498. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42499. return c
  42500. }
  42501. // IfNoneMatch sets the optional parameter which makes the operation
  42502. // fail if the object's ETag matches the given value. This is useful for
  42503. // getting updates only after the object has changed since the last
  42504. // request. Use googleapi.IsNotModified to check whether the response
  42505. // error from Do is the result of In-None-Match.
  42506. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  42507. c.ifNoneMatch_ = entityTag
  42508. return c
  42509. }
  42510. // Context sets the context to be used in this call's Do method. Any
  42511. // pending HTTP request will be aborted if the provided context is
  42512. // canceled.
  42513. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  42514. c.ctx_ = ctx
  42515. return c
  42516. }
  42517. // Header returns an http.Header that can be modified by the caller to
  42518. // add HTTP headers to the request.
  42519. func (c *SubaccountsListCall) Header() http.Header {
  42520. if c.header_ == nil {
  42521. c.header_ = make(http.Header)
  42522. }
  42523. return c.header_
  42524. }
  42525. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  42526. reqHeaders := make(http.Header)
  42527. for k, v := range c.header_ {
  42528. reqHeaders[k] = v
  42529. }
  42530. reqHeaders.Set("User-Agent", c.s.userAgent())
  42531. if c.ifNoneMatch_ != "" {
  42532. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42533. }
  42534. var body io.Reader = nil
  42535. c.urlParams_.Set("alt", alt)
  42536. c.urlParams_.Set("prettyPrint", "false")
  42537. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42538. urls += "?" + c.urlParams_.Encode()
  42539. req, err := http.NewRequest("GET", urls, body)
  42540. if err != nil {
  42541. return nil, err
  42542. }
  42543. req.Header = reqHeaders
  42544. googleapi.Expand(req.URL, map[string]string{
  42545. "profileId": strconv.FormatInt(c.profileId, 10),
  42546. })
  42547. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42548. }
  42549. // Do executes the "dfareporting.subaccounts.list" call.
  42550. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  42551. // non-2xx status code is an error. Response headers are in either
  42552. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  42553. // returned at all) in error.(*googleapi.Error).Header. Use
  42554. // googleapi.IsNotModified to check whether the returned error was
  42555. // because http.StatusNotModified was returned.
  42556. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  42557. gensupport.SetOptions(c.urlParams_, opts...)
  42558. res, err := c.doRequest("json")
  42559. if res != nil && res.StatusCode == http.StatusNotModified {
  42560. if res.Body != nil {
  42561. res.Body.Close()
  42562. }
  42563. return nil, &googleapi.Error{
  42564. Code: res.StatusCode,
  42565. Header: res.Header,
  42566. }
  42567. }
  42568. if err != nil {
  42569. return nil, err
  42570. }
  42571. defer googleapi.CloseBody(res)
  42572. if err := googleapi.CheckResponse(res); err != nil {
  42573. return nil, err
  42574. }
  42575. ret := &SubaccountsListResponse{
  42576. ServerResponse: googleapi.ServerResponse{
  42577. Header: res.Header,
  42578. HTTPStatusCode: res.StatusCode,
  42579. },
  42580. }
  42581. target := &ret
  42582. if err := gensupport.DecodeResponse(target, res); err != nil {
  42583. return nil, err
  42584. }
  42585. return ret, nil
  42586. // {
  42587. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  42588. // "httpMethod": "GET",
  42589. // "id": "dfareporting.subaccounts.list",
  42590. // "parameterOrder": [
  42591. // "profileId"
  42592. // ],
  42593. // "parameters": {
  42594. // "ids": {
  42595. // "description": "Select only subaccounts with these IDs.",
  42596. // "format": "int64",
  42597. // "location": "query",
  42598. // "repeated": true,
  42599. // "type": "string"
  42600. // },
  42601. // "maxResults": {
  42602. // "default": "1000",
  42603. // "description": "Maximum number of results to return.",
  42604. // "format": "int32",
  42605. // "location": "query",
  42606. // "maximum": "1000",
  42607. // "minimum": "0",
  42608. // "type": "integer"
  42609. // },
  42610. // "pageToken": {
  42611. // "description": "Value of the nextPageToken from the previous result page.",
  42612. // "location": "query",
  42613. // "type": "string"
  42614. // },
  42615. // "profileId": {
  42616. // "description": "User profile ID associated with this request.",
  42617. // "format": "int64",
  42618. // "location": "path",
  42619. // "required": true,
  42620. // "type": "string"
  42621. // },
  42622. // "searchString": {
  42623. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"subaccount*2015\" will return objects with names like \"subaccount June 2015\", \"subaccount April 2015\", or simply \"subaccount 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"subaccount\" will match objects with name \"my subaccount\", \"subaccount 2015\", or simply \"subaccount\".",
  42624. // "location": "query",
  42625. // "type": "string"
  42626. // },
  42627. // "sortField": {
  42628. // "default": "ID",
  42629. // "description": "Field by which to sort the list.",
  42630. // "enum": [
  42631. // "ID",
  42632. // "NAME"
  42633. // ],
  42634. // "enumDescriptions": [
  42635. // "",
  42636. // ""
  42637. // ],
  42638. // "location": "query",
  42639. // "type": "string"
  42640. // },
  42641. // "sortOrder": {
  42642. // "default": "ASCENDING",
  42643. // "description": "Order of sorted results.",
  42644. // "enum": [
  42645. // "ASCENDING",
  42646. // "DESCENDING"
  42647. // ],
  42648. // "enumDescriptions": [
  42649. // "",
  42650. // ""
  42651. // ],
  42652. // "location": "query",
  42653. // "type": "string"
  42654. // }
  42655. // },
  42656. // "path": "userprofiles/{profileId}/subaccounts",
  42657. // "response": {
  42658. // "$ref": "SubaccountsListResponse"
  42659. // },
  42660. // "scopes": [
  42661. // "https://www.googleapis.com/auth/dfatrafficking"
  42662. // ]
  42663. // }
  42664. }
  42665. // Pages invokes f for each page of results.
  42666. // A non-nil error returned from f will halt the iteration.
  42667. // The provided context supersedes any context provided to the Context method.
  42668. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  42669. c.ctx_ = ctx
  42670. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42671. for {
  42672. x, err := c.Do()
  42673. if err != nil {
  42674. return err
  42675. }
  42676. if err := f(x); err != nil {
  42677. return err
  42678. }
  42679. if x.NextPageToken == "" {
  42680. return nil
  42681. }
  42682. c.PageToken(x.NextPageToken)
  42683. }
  42684. }
  42685. // method id "dfareporting.subaccounts.patch":
  42686. type SubaccountsPatchCall struct {
  42687. s *Service
  42688. profileId int64
  42689. subaccount *Subaccount
  42690. urlParams_ gensupport.URLParams
  42691. ctx_ context.Context
  42692. header_ http.Header
  42693. }
  42694. // Patch: Updates an existing subaccount. This method supports patch
  42695. // semantics.
  42696. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  42697. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42698. c.profileId = profileId
  42699. c.urlParams_.Set("id", fmt.Sprint(id))
  42700. c.subaccount = subaccount
  42701. return c
  42702. }
  42703. // Fields allows partial responses to be retrieved. See
  42704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42705. // for more information.
  42706. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  42707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42708. return c
  42709. }
  42710. // Context sets the context to be used in this call's Do method. Any
  42711. // pending HTTP request will be aborted if the provided context is
  42712. // canceled.
  42713. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  42714. c.ctx_ = ctx
  42715. return c
  42716. }
  42717. // Header returns an http.Header that can be modified by the caller to
  42718. // add HTTP headers to the request.
  42719. func (c *SubaccountsPatchCall) Header() http.Header {
  42720. if c.header_ == nil {
  42721. c.header_ = make(http.Header)
  42722. }
  42723. return c.header_
  42724. }
  42725. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  42726. reqHeaders := make(http.Header)
  42727. for k, v := range c.header_ {
  42728. reqHeaders[k] = v
  42729. }
  42730. reqHeaders.Set("User-Agent", c.s.userAgent())
  42731. var body io.Reader = nil
  42732. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42733. if err != nil {
  42734. return nil, err
  42735. }
  42736. reqHeaders.Set("Content-Type", "application/json")
  42737. c.urlParams_.Set("alt", alt)
  42738. c.urlParams_.Set("prettyPrint", "false")
  42739. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42740. urls += "?" + c.urlParams_.Encode()
  42741. req, err := http.NewRequest("PATCH", urls, body)
  42742. if err != nil {
  42743. return nil, err
  42744. }
  42745. req.Header = reqHeaders
  42746. googleapi.Expand(req.URL, map[string]string{
  42747. "profileId": strconv.FormatInt(c.profileId, 10),
  42748. })
  42749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42750. }
  42751. // Do executes the "dfareporting.subaccounts.patch" call.
  42752. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42753. // status code is an error. Response headers are in either
  42754. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42755. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42756. // to check whether the returned error was because
  42757. // http.StatusNotModified was returned.
  42758. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42759. gensupport.SetOptions(c.urlParams_, opts...)
  42760. res, err := c.doRequest("json")
  42761. if res != nil && res.StatusCode == http.StatusNotModified {
  42762. if res.Body != nil {
  42763. res.Body.Close()
  42764. }
  42765. return nil, &googleapi.Error{
  42766. Code: res.StatusCode,
  42767. Header: res.Header,
  42768. }
  42769. }
  42770. if err != nil {
  42771. return nil, err
  42772. }
  42773. defer googleapi.CloseBody(res)
  42774. if err := googleapi.CheckResponse(res); err != nil {
  42775. return nil, err
  42776. }
  42777. ret := &Subaccount{
  42778. ServerResponse: googleapi.ServerResponse{
  42779. Header: res.Header,
  42780. HTTPStatusCode: res.StatusCode,
  42781. },
  42782. }
  42783. target := &ret
  42784. if err := gensupport.DecodeResponse(target, res); err != nil {
  42785. return nil, err
  42786. }
  42787. return ret, nil
  42788. // {
  42789. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  42790. // "httpMethod": "PATCH",
  42791. // "id": "dfareporting.subaccounts.patch",
  42792. // "parameterOrder": [
  42793. // "profileId",
  42794. // "id"
  42795. // ],
  42796. // "parameters": {
  42797. // "id": {
  42798. // "description": "Subaccount ID.",
  42799. // "format": "int64",
  42800. // "location": "query",
  42801. // "required": true,
  42802. // "type": "string"
  42803. // },
  42804. // "profileId": {
  42805. // "description": "User profile ID associated with this request.",
  42806. // "format": "int64",
  42807. // "location": "path",
  42808. // "required": true,
  42809. // "type": "string"
  42810. // }
  42811. // },
  42812. // "path": "userprofiles/{profileId}/subaccounts",
  42813. // "request": {
  42814. // "$ref": "Subaccount"
  42815. // },
  42816. // "response": {
  42817. // "$ref": "Subaccount"
  42818. // },
  42819. // "scopes": [
  42820. // "https://www.googleapis.com/auth/dfatrafficking"
  42821. // ]
  42822. // }
  42823. }
  42824. // method id "dfareporting.subaccounts.update":
  42825. type SubaccountsUpdateCall struct {
  42826. s *Service
  42827. profileId int64
  42828. subaccount *Subaccount
  42829. urlParams_ gensupport.URLParams
  42830. ctx_ context.Context
  42831. header_ http.Header
  42832. }
  42833. // Update: Updates an existing subaccount.
  42834. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  42835. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42836. c.profileId = profileId
  42837. c.subaccount = subaccount
  42838. return c
  42839. }
  42840. // Fields allows partial responses to be retrieved. See
  42841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42842. // for more information.
  42843. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  42844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42845. return c
  42846. }
  42847. // Context sets the context to be used in this call's Do method. Any
  42848. // pending HTTP request will be aborted if the provided context is
  42849. // canceled.
  42850. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  42851. c.ctx_ = ctx
  42852. return c
  42853. }
  42854. // Header returns an http.Header that can be modified by the caller to
  42855. // add HTTP headers to the request.
  42856. func (c *SubaccountsUpdateCall) Header() http.Header {
  42857. if c.header_ == nil {
  42858. c.header_ = make(http.Header)
  42859. }
  42860. return c.header_
  42861. }
  42862. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  42863. reqHeaders := make(http.Header)
  42864. for k, v := range c.header_ {
  42865. reqHeaders[k] = v
  42866. }
  42867. reqHeaders.Set("User-Agent", c.s.userAgent())
  42868. var body io.Reader = nil
  42869. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42870. if err != nil {
  42871. return nil, err
  42872. }
  42873. reqHeaders.Set("Content-Type", "application/json")
  42874. c.urlParams_.Set("alt", alt)
  42875. c.urlParams_.Set("prettyPrint", "false")
  42876. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42877. urls += "?" + c.urlParams_.Encode()
  42878. req, err := http.NewRequest("PUT", urls, body)
  42879. if err != nil {
  42880. return nil, err
  42881. }
  42882. req.Header = reqHeaders
  42883. googleapi.Expand(req.URL, map[string]string{
  42884. "profileId": strconv.FormatInt(c.profileId, 10),
  42885. })
  42886. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42887. }
  42888. // Do executes the "dfareporting.subaccounts.update" call.
  42889. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42890. // status code is an error. Response headers are in either
  42891. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42892. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42893. // to check whether the returned error was because
  42894. // http.StatusNotModified was returned.
  42895. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42896. gensupport.SetOptions(c.urlParams_, opts...)
  42897. res, err := c.doRequest("json")
  42898. if res != nil && res.StatusCode == http.StatusNotModified {
  42899. if res.Body != nil {
  42900. res.Body.Close()
  42901. }
  42902. return nil, &googleapi.Error{
  42903. Code: res.StatusCode,
  42904. Header: res.Header,
  42905. }
  42906. }
  42907. if err != nil {
  42908. return nil, err
  42909. }
  42910. defer googleapi.CloseBody(res)
  42911. if err := googleapi.CheckResponse(res); err != nil {
  42912. return nil, err
  42913. }
  42914. ret := &Subaccount{
  42915. ServerResponse: googleapi.ServerResponse{
  42916. Header: res.Header,
  42917. HTTPStatusCode: res.StatusCode,
  42918. },
  42919. }
  42920. target := &ret
  42921. if err := gensupport.DecodeResponse(target, res); err != nil {
  42922. return nil, err
  42923. }
  42924. return ret, nil
  42925. // {
  42926. // "description": "Updates an existing subaccount.",
  42927. // "httpMethod": "PUT",
  42928. // "id": "dfareporting.subaccounts.update",
  42929. // "parameterOrder": [
  42930. // "profileId"
  42931. // ],
  42932. // "parameters": {
  42933. // "profileId": {
  42934. // "description": "User profile ID associated with this request.",
  42935. // "format": "int64",
  42936. // "location": "path",
  42937. // "required": true,
  42938. // "type": "string"
  42939. // }
  42940. // },
  42941. // "path": "userprofiles/{profileId}/subaccounts",
  42942. // "request": {
  42943. // "$ref": "Subaccount"
  42944. // },
  42945. // "response": {
  42946. // "$ref": "Subaccount"
  42947. // },
  42948. // "scopes": [
  42949. // "https://www.googleapis.com/auth/dfatrafficking"
  42950. // ]
  42951. // }
  42952. }
  42953. // method id "dfareporting.targetableRemarketingLists.get":
  42954. type TargetableRemarketingListsGetCall struct {
  42955. s *Service
  42956. profileId int64
  42957. id int64
  42958. urlParams_ gensupport.URLParams
  42959. ifNoneMatch_ string
  42960. ctx_ context.Context
  42961. header_ http.Header
  42962. }
  42963. // Get: Gets one remarketing list by ID.
  42964. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  42965. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42966. c.profileId = profileId
  42967. c.id = id
  42968. return c
  42969. }
  42970. // Fields allows partial responses to be retrieved. See
  42971. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42972. // for more information.
  42973. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  42974. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42975. return c
  42976. }
  42977. // IfNoneMatch sets the optional parameter which makes the operation
  42978. // fail if the object's ETag matches the given value. This is useful for
  42979. // getting updates only after the object has changed since the last
  42980. // request. Use googleapi.IsNotModified to check whether the response
  42981. // error from Do is the result of In-None-Match.
  42982. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  42983. c.ifNoneMatch_ = entityTag
  42984. return c
  42985. }
  42986. // Context sets the context to be used in this call's Do method. Any
  42987. // pending HTTP request will be aborted if the provided context is
  42988. // canceled.
  42989. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  42990. c.ctx_ = ctx
  42991. return c
  42992. }
  42993. // Header returns an http.Header that can be modified by the caller to
  42994. // add HTTP headers to the request.
  42995. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  42996. if c.header_ == nil {
  42997. c.header_ = make(http.Header)
  42998. }
  42999. return c.header_
  43000. }
  43001. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  43002. reqHeaders := make(http.Header)
  43003. for k, v := range c.header_ {
  43004. reqHeaders[k] = v
  43005. }
  43006. reqHeaders.Set("User-Agent", c.s.userAgent())
  43007. if c.ifNoneMatch_ != "" {
  43008. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43009. }
  43010. var body io.Reader = nil
  43011. c.urlParams_.Set("alt", alt)
  43012. c.urlParams_.Set("prettyPrint", "false")
  43013. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  43014. urls += "?" + c.urlParams_.Encode()
  43015. req, err := http.NewRequest("GET", urls, body)
  43016. if err != nil {
  43017. return nil, err
  43018. }
  43019. req.Header = reqHeaders
  43020. googleapi.Expand(req.URL, map[string]string{
  43021. "profileId": strconv.FormatInt(c.profileId, 10),
  43022. "id": strconv.FormatInt(c.id, 10),
  43023. })
  43024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43025. }
  43026. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  43027. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  43028. // Any non-2xx status code is an error. Response headers are in either
  43029. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  43030. // was returned at all) in error.(*googleapi.Error).Header. Use
  43031. // googleapi.IsNotModified to check whether the returned error was
  43032. // because http.StatusNotModified was returned.
  43033. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  43034. gensupport.SetOptions(c.urlParams_, opts...)
  43035. res, err := c.doRequest("json")
  43036. if res != nil && res.StatusCode == http.StatusNotModified {
  43037. if res.Body != nil {
  43038. res.Body.Close()
  43039. }
  43040. return nil, &googleapi.Error{
  43041. Code: res.StatusCode,
  43042. Header: res.Header,
  43043. }
  43044. }
  43045. if err != nil {
  43046. return nil, err
  43047. }
  43048. defer googleapi.CloseBody(res)
  43049. if err := googleapi.CheckResponse(res); err != nil {
  43050. return nil, err
  43051. }
  43052. ret := &TargetableRemarketingList{
  43053. ServerResponse: googleapi.ServerResponse{
  43054. Header: res.Header,
  43055. HTTPStatusCode: res.StatusCode,
  43056. },
  43057. }
  43058. target := &ret
  43059. if err := gensupport.DecodeResponse(target, res); err != nil {
  43060. return nil, err
  43061. }
  43062. return ret, nil
  43063. // {
  43064. // "description": "Gets one remarketing list by ID.",
  43065. // "httpMethod": "GET",
  43066. // "id": "dfareporting.targetableRemarketingLists.get",
  43067. // "parameterOrder": [
  43068. // "profileId",
  43069. // "id"
  43070. // ],
  43071. // "parameters": {
  43072. // "id": {
  43073. // "description": "Remarketing list ID.",
  43074. // "format": "int64",
  43075. // "location": "path",
  43076. // "required": true,
  43077. // "type": "string"
  43078. // },
  43079. // "profileId": {
  43080. // "description": "User profile ID associated with this request.",
  43081. // "format": "int64",
  43082. // "location": "path",
  43083. // "required": true,
  43084. // "type": "string"
  43085. // }
  43086. // },
  43087. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  43088. // "response": {
  43089. // "$ref": "TargetableRemarketingList"
  43090. // },
  43091. // "scopes": [
  43092. // "https://www.googleapis.com/auth/dfatrafficking"
  43093. // ]
  43094. // }
  43095. }
  43096. // method id "dfareporting.targetableRemarketingLists.list":
  43097. type TargetableRemarketingListsListCall struct {
  43098. s *Service
  43099. profileId int64
  43100. urlParams_ gensupport.URLParams
  43101. ifNoneMatch_ string
  43102. ctx_ context.Context
  43103. header_ http.Header
  43104. }
  43105. // List: Retrieves a list of targetable remarketing lists, possibly
  43106. // filtered. This method supports paging.
  43107. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  43108. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43109. c.profileId = profileId
  43110. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43111. return c
  43112. }
  43113. // Active sets the optional parameter "active": Select only active or
  43114. // only inactive targetable remarketing lists.
  43115. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  43116. c.urlParams_.Set("active", fmt.Sprint(active))
  43117. return c
  43118. }
  43119. // MaxResults sets the optional parameter "maxResults": Maximum number
  43120. // of results to return.
  43121. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  43122. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43123. return c
  43124. }
  43125. // Name sets the optional parameter "name": Allows searching for objects
  43126. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  43127. // list*2015" will return objects with names like "remarketing list June
  43128. // 2015", "remarketing list April 2015", or simply "remarketing list
  43129. // 2015". Most of the searches also add wildcards implicitly at the
  43130. // start and the end of the search string. For example, a search string
  43131. // of "remarketing list" will match objects with name "my remarketing
  43132. // list", "remarketing list 2015", or simply "remarketing list".
  43133. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  43134. c.urlParams_.Set("name", name)
  43135. return c
  43136. }
  43137. // PageToken sets the optional parameter "pageToken": Value of the
  43138. // nextPageToken from the previous result page.
  43139. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  43140. c.urlParams_.Set("pageToken", pageToken)
  43141. return c
  43142. }
  43143. // SortField sets the optional parameter "sortField": Field by which to
  43144. // sort the list.
  43145. //
  43146. // Possible values:
  43147. // "ID" (default)
  43148. // "NAME"
  43149. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  43150. c.urlParams_.Set("sortField", sortField)
  43151. return c
  43152. }
  43153. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43154. // results.
  43155. //
  43156. // Possible values:
  43157. // "ASCENDING" (default)
  43158. // "DESCENDING"
  43159. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  43160. c.urlParams_.Set("sortOrder", sortOrder)
  43161. return c
  43162. }
  43163. // Fields allows partial responses to be retrieved. See
  43164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43165. // for more information.
  43166. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  43167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43168. return c
  43169. }
  43170. // IfNoneMatch sets the optional parameter which makes the operation
  43171. // fail if the object's ETag matches the given value. This is useful for
  43172. // getting updates only after the object has changed since the last
  43173. // request. Use googleapi.IsNotModified to check whether the response
  43174. // error from Do is the result of In-None-Match.
  43175. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  43176. c.ifNoneMatch_ = entityTag
  43177. return c
  43178. }
  43179. // Context sets the context to be used in this call's Do method. Any
  43180. // pending HTTP request will be aborted if the provided context is
  43181. // canceled.
  43182. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  43183. c.ctx_ = ctx
  43184. return c
  43185. }
  43186. // Header returns an http.Header that can be modified by the caller to
  43187. // add HTTP headers to the request.
  43188. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  43189. if c.header_ == nil {
  43190. c.header_ = make(http.Header)
  43191. }
  43192. return c.header_
  43193. }
  43194. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  43195. reqHeaders := make(http.Header)
  43196. for k, v := range c.header_ {
  43197. reqHeaders[k] = v
  43198. }
  43199. reqHeaders.Set("User-Agent", c.s.userAgent())
  43200. if c.ifNoneMatch_ != "" {
  43201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43202. }
  43203. var body io.Reader = nil
  43204. c.urlParams_.Set("alt", alt)
  43205. c.urlParams_.Set("prettyPrint", "false")
  43206. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  43207. urls += "?" + c.urlParams_.Encode()
  43208. req, err := http.NewRequest("GET", urls, body)
  43209. if err != nil {
  43210. return nil, err
  43211. }
  43212. req.Header = reqHeaders
  43213. googleapi.Expand(req.URL, map[string]string{
  43214. "profileId": strconv.FormatInt(c.profileId, 10),
  43215. })
  43216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43217. }
  43218. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  43219. // Exactly one of *TargetableRemarketingListsListResponse or error will
  43220. // be non-nil. Any non-2xx status code is an error. Response headers are
  43221. // in either
  43222. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  43223. // a response was returned at all) in error.(*googleapi.Error).Header.
  43224. // Use googleapi.IsNotModified to check whether the returned error was
  43225. // because http.StatusNotModified was returned.
  43226. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  43227. gensupport.SetOptions(c.urlParams_, opts...)
  43228. res, err := c.doRequest("json")
  43229. if res != nil && res.StatusCode == http.StatusNotModified {
  43230. if res.Body != nil {
  43231. res.Body.Close()
  43232. }
  43233. return nil, &googleapi.Error{
  43234. Code: res.StatusCode,
  43235. Header: res.Header,
  43236. }
  43237. }
  43238. if err != nil {
  43239. return nil, err
  43240. }
  43241. defer googleapi.CloseBody(res)
  43242. if err := googleapi.CheckResponse(res); err != nil {
  43243. return nil, err
  43244. }
  43245. ret := &TargetableRemarketingListsListResponse{
  43246. ServerResponse: googleapi.ServerResponse{
  43247. Header: res.Header,
  43248. HTTPStatusCode: res.StatusCode,
  43249. },
  43250. }
  43251. target := &ret
  43252. if err := gensupport.DecodeResponse(target, res); err != nil {
  43253. return nil, err
  43254. }
  43255. return ret, nil
  43256. // {
  43257. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  43258. // "httpMethod": "GET",
  43259. // "id": "dfareporting.targetableRemarketingLists.list",
  43260. // "parameterOrder": [
  43261. // "profileId",
  43262. // "advertiserId"
  43263. // ],
  43264. // "parameters": {
  43265. // "active": {
  43266. // "description": "Select only active or only inactive targetable remarketing lists.",
  43267. // "location": "query",
  43268. // "type": "boolean"
  43269. // },
  43270. // "advertiserId": {
  43271. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  43272. // "format": "int64",
  43273. // "location": "query",
  43274. // "required": true,
  43275. // "type": "string"
  43276. // },
  43277. // "maxResults": {
  43278. // "default": "1000",
  43279. // "description": "Maximum number of results to return.",
  43280. // "format": "int32",
  43281. // "location": "query",
  43282. // "maximum": "1000",
  43283. // "minimum": "0",
  43284. // "type": "integer"
  43285. // },
  43286. // "name": {
  43287. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"remarketing list*2015\" will return objects with names like \"remarketing list June 2015\", \"remarketing list April 2015\", or simply \"remarketing list 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"remarketing list\" will match objects with name \"my remarketing list\", \"remarketing list 2015\", or simply \"remarketing list\".",
  43288. // "location": "query",
  43289. // "type": "string"
  43290. // },
  43291. // "pageToken": {
  43292. // "description": "Value of the nextPageToken from the previous result page.",
  43293. // "location": "query",
  43294. // "type": "string"
  43295. // },
  43296. // "profileId": {
  43297. // "description": "User profile ID associated with this request.",
  43298. // "format": "int64",
  43299. // "location": "path",
  43300. // "required": true,
  43301. // "type": "string"
  43302. // },
  43303. // "sortField": {
  43304. // "default": "ID",
  43305. // "description": "Field by which to sort the list.",
  43306. // "enum": [
  43307. // "ID",
  43308. // "NAME"
  43309. // ],
  43310. // "enumDescriptions": [
  43311. // "",
  43312. // ""
  43313. // ],
  43314. // "location": "query",
  43315. // "type": "string"
  43316. // },
  43317. // "sortOrder": {
  43318. // "default": "ASCENDING",
  43319. // "description": "Order of sorted results.",
  43320. // "enum": [
  43321. // "ASCENDING",
  43322. // "DESCENDING"
  43323. // ],
  43324. // "enumDescriptions": [
  43325. // "",
  43326. // ""
  43327. // ],
  43328. // "location": "query",
  43329. // "type": "string"
  43330. // }
  43331. // },
  43332. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  43333. // "response": {
  43334. // "$ref": "TargetableRemarketingListsListResponse"
  43335. // },
  43336. // "scopes": [
  43337. // "https://www.googleapis.com/auth/dfatrafficking"
  43338. // ]
  43339. // }
  43340. }
  43341. // Pages invokes f for each page of results.
  43342. // A non-nil error returned from f will halt the iteration.
  43343. // The provided context supersedes any context provided to the Context method.
  43344. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  43345. c.ctx_ = ctx
  43346. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43347. for {
  43348. x, err := c.Do()
  43349. if err != nil {
  43350. return err
  43351. }
  43352. if err := f(x); err != nil {
  43353. return err
  43354. }
  43355. if x.NextPageToken == "" {
  43356. return nil
  43357. }
  43358. c.PageToken(x.NextPageToken)
  43359. }
  43360. }
  43361. // method id "dfareporting.targetingTemplates.get":
  43362. type TargetingTemplatesGetCall struct {
  43363. s *Service
  43364. profileId int64
  43365. id int64
  43366. urlParams_ gensupport.URLParams
  43367. ifNoneMatch_ string
  43368. ctx_ context.Context
  43369. header_ http.Header
  43370. }
  43371. // Get: Gets one targeting template by ID.
  43372. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  43373. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43374. c.profileId = profileId
  43375. c.id = id
  43376. return c
  43377. }
  43378. // Fields allows partial responses to be retrieved. See
  43379. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43380. // for more information.
  43381. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  43382. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43383. return c
  43384. }
  43385. // IfNoneMatch sets the optional parameter which makes the operation
  43386. // fail if the object's ETag matches the given value. This is useful for
  43387. // getting updates only after the object has changed since the last
  43388. // request. Use googleapi.IsNotModified to check whether the response
  43389. // error from Do is the result of In-None-Match.
  43390. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  43391. c.ifNoneMatch_ = entityTag
  43392. return c
  43393. }
  43394. // Context sets the context to be used in this call's Do method. Any
  43395. // pending HTTP request will be aborted if the provided context is
  43396. // canceled.
  43397. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  43398. c.ctx_ = ctx
  43399. return c
  43400. }
  43401. // Header returns an http.Header that can be modified by the caller to
  43402. // add HTTP headers to the request.
  43403. func (c *TargetingTemplatesGetCall) Header() http.Header {
  43404. if c.header_ == nil {
  43405. c.header_ = make(http.Header)
  43406. }
  43407. return c.header_
  43408. }
  43409. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  43410. reqHeaders := make(http.Header)
  43411. for k, v := range c.header_ {
  43412. reqHeaders[k] = v
  43413. }
  43414. reqHeaders.Set("User-Agent", c.s.userAgent())
  43415. if c.ifNoneMatch_ != "" {
  43416. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43417. }
  43418. var body io.Reader = nil
  43419. c.urlParams_.Set("alt", alt)
  43420. c.urlParams_.Set("prettyPrint", "false")
  43421. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  43422. urls += "?" + c.urlParams_.Encode()
  43423. req, err := http.NewRequest("GET", urls, body)
  43424. if err != nil {
  43425. return nil, err
  43426. }
  43427. req.Header = reqHeaders
  43428. googleapi.Expand(req.URL, map[string]string{
  43429. "profileId": strconv.FormatInt(c.profileId, 10),
  43430. "id": strconv.FormatInt(c.id, 10),
  43431. })
  43432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43433. }
  43434. // Do executes the "dfareporting.targetingTemplates.get" call.
  43435. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43436. // non-2xx status code is an error. Response headers are in either
  43437. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43438. // returned at all) in error.(*googleapi.Error).Header. Use
  43439. // googleapi.IsNotModified to check whether the returned error was
  43440. // because http.StatusNotModified was returned.
  43441. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43442. gensupport.SetOptions(c.urlParams_, opts...)
  43443. res, err := c.doRequest("json")
  43444. if res != nil && res.StatusCode == http.StatusNotModified {
  43445. if res.Body != nil {
  43446. res.Body.Close()
  43447. }
  43448. return nil, &googleapi.Error{
  43449. Code: res.StatusCode,
  43450. Header: res.Header,
  43451. }
  43452. }
  43453. if err != nil {
  43454. return nil, err
  43455. }
  43456. defer googleapi.CloseBody(res)
  43457. if err := googleapi.CheckResponse(res); err != nil {
  43458. return nil, err
  43459. }
  43460. ret := &TargetingTemplate{
  43461. ServerResponse: googleapi.ServerResponse{
  43462. Header: res.Header,
  43463. HTTPStatusCode: res.StatusCode,
  43464. },
  43465. }
  43466. target := &ret
  43467. if err := gensupport.DecodeResponse(target, res); err != nil {
  43468. return nil, err
  43469. }
  43470. return ret, nil
  43471. // {
  43472. // "description": "Gets one targeting template by ID.",
  43473. // "httpMethod": "GET",
  43474. // "id": "dfareporting.targetingTemplates.get",
  43475. // "parameterOrder": [
  43476. // "profileId",
  43477. // "id"
  43478. // ],
  43479. // "parameters": {
  43480. // "id": {
  43481. // "description": "Targeting template ID.",
  43482. // "format": "int64",
  43483. // "location": "path",
  43484. // "required": true,
  43485. // "type": "string"
  43486. // },
  43487. // "profileId": {
  43488. // "description": "User profile ID associated with this request.",
  43489. // "format": "int64",
  43490. // "location": "path",
  43491. // "required": true,
  43492. // "type": "string"
  43493. // }
  43494. // },
  43495. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  43496. // "response": {
  43497. // "$ref": "TargetingTemplate"
  43498. // },
  43499. // "scopes": [
  43500. // "https://www.googleapis.com/auth/dfatrafficking"
  43501. // ]
  43502. // }
  43503. }
  43504. // method id "dfareporting.targetingTemplates.insert":
  43505. type TargetingTemplatesInsertCall struct {
  43506. s *Service
  43507. profileId int64
  43508. targetingtemplate *TargetingTemplate
  43509. urlParams_ gensupport.URLParams
  43510. ctx_ context.Context
  43511. header_ http.Header
  43512. }
  43513. // Insert: Inserts a new targeting template.
  43514. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  43515. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43516. c.profileId = profileId
  43517. c.targetingtemplate = targetingtemplate
  43518. return c
  43519. }
  43520. // Fields allows partial responses to be retrieved. See
  43521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43522. // for more information.
  43523. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  43524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43525. return c
  43526. }
  43527. // Context sets the context to be used in this call's Do method. Any
  43528. // pending HTTP request will be aborted if the provided context is
  43529. // canceled.
  43530. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  43531. c.ctx_ = ctx
  43532. return c
  43533. }
  43534. // Header returns an http.Header that can be modified by the caller to
  43535. // add HTTP headers to the request.
  43536. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  43537. if c.header_ == nil {
  43538. c.header_ = make(http.Header)
  43539. }
  43540. return c.header_
  43541. }
  43542. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  43543. reqHeaders := make(http.Header)
  43544. for k, v := range c.header_ {
  43545. reqHeaders[k] = v
  43546. }
  43547. reqHeaders.Set("User-Agent", c.s.userAgent())
  43548. var body io.Reader = nil
  43549. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43550. if err != nil {
  43551. return nil, err
  43552. }
  43553. reqHeaders.Set("Content-Type", "application/json")
  43554. c.urlParams_.Set("alt", alt)
  43555. c.urlParams_.Set("prettyPrint", "false")
  43556. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43557. urls += "?" + c.urlParams_.Encode()
  43558. req, err := http.NewRequest("POST", urls, body)
  43559. if err != nil {
  43560. return nil, err
  43561. }
  43562. req.Header = reqHeaders
  43563. googleapi.Expand(req.URL, map[string]string{
  43564. "profileId": strconv.FormatInt(c.profileId, 10),
  43565. })
  43566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43567. }
  43568. // Do executes the "dfareporting.targetingTemplates.insert" call.
  43569. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43570. // non-2xx status code is an error. Response headers are in either
  43571. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43572. // returned at all) in error.(*googleapi.Error).Header. Use
  43573. // googleapi.IsNotModified to check whether the returned error was
  43574. // because http.StatusNotModified was returned.
  43575. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43576. gensupport.SetOptions(c.urlParams_, opts...)
  43577. res, err := c.doRequest("json")
  43578. if res != nil && res.StatusCode == http.StatusNotModified {
  43579. if res.Body != nil {
  43580. res.Body.Close()
  43581. }
  43582. return nil, &googleapi.Error{
  43583. Code: res.StatusCode,
  43584. Header: res.Header,
  43585. }
  43586. }
  43587. if err != nil {
  43588. return nil, err
  43589. }
  43590. defer googleapi.CloseBody(res)
  43591. if err := googleapi.CheckResponse(res); err != nil {
  43592. return nil, err
  43593. }
  43594. ret := &TargetingTemplate{
  43595. ServerResponse: googleapi.ServerResponse{
  43596. Header: res.Header,
  43597. HTTPStatusCode: res.StatusCode,
  43598. },
  43599. }
  43600. target := &ret
  43601. if err := gensupport.DecodeResponse(target, res); err != nil {
  43602. return nil, err
  43603. }
  43604. return ret, nil
  43605. // {
  43606. // "description": "Inserts a new targeting template.",
  43607. // "httpMethod": "POST",
  43608. // "id": "dfareporting.targetingTemplates.insert",
  43609. // "parameterOrder": [
  43610. // "profileId"
  43611. // ],
  43612. // "parameters": {
  43613. // "profileId": {
  43614. // "description": "User profile ID associated with this request.",
  43615. // "format": "int64",
  43616. // "location": "path",
  43617. // "required": true,
  43618. // "type": "string"
  43619. // }
  43620. // },
  43621. // "path": "userprofiles/{profileId}/targetingTemplates",
  43622. // "request": {
  43623. // "$ref": "TargetingTemplate"
  43624. // },
  43625. // "response": {
  43626. // "$ref": "TargetingTemplate"
  43627. // },
  43628. // "scopes": [
  43629. // "https://www.googleapis.com/auth/dfatrafficking"
  43630. // ]
  43631. // }
  43632. }
  43633. // method id "dfareporting.targetingTemplates.list":
  43634. type TargetingTemplatesListCall struct {
  43635. s *Service
  43636. profileId int64
  43637. urlParams_ gensupport.URLParams
  43638. ifNoneMatch_ string
  43639. ctx_ context.Context
  43640. header_ http.Header
  43641. }
  43642. // List: Retrieves a list of targeting templates, optionally filtered.
  43643. // This method supports paging.
  43644. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  43645. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43646. c.profileId = profileId
  43647. return c
  43648. }
  43649. // AdvertiserId sets the optional parameter "advertiserId": Select only
  43650. // targeting templates with this advertiser ID.
  43651. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  43652. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  43653. return c
  43654. }
  43655. // Ids sets the optional parameter "ids": Select only targeting
  43656. // templates with these IDs.
  43657. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  43658. var ids_ []string
  43659. for _, v := range ids {
  43660. ids_ = append(ids_, fmt.Sprint(v))
  43661. }
  43662. c.urlParams_.SetMulti("ids", ids_)
  43663. return c
  43664. }
  43665. // MaxResults sets the optional parameter "maxResults": Maximum number
  43666. // of results to return.
  43667. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  43668. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  43669. return c
  43670. }
  43671. // PageToken sets the optional parameter "pageToken": Value of the
  43672. // nextPageToken from the previous result page.
  43673. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  43674. c.urlParams_.Set("pageToken", pageToken)
  43675. return c
  43676. }
  43677. // SearchString sets the optional parameter "searchString": Allows
  43678. // searching for objects by name or ID. Wildcards (*) are allowed. For
  43679. // example, "template*2015" will return objects with names like
  43680. // "template June 2015", "template April 2015", or simply "template
  43681. // 2015". Most of the searches also add wildcards implicitly at the
  43682. // start and the end of the search string. For example, a search string
  43683. // of "template" will match objects with name "my template", "template
  43684. // 2015", or simply "template".
  43685. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  43686. c.urlParams_.Set("searchString", searchString)
  43687. return c
  43688. }
  43689. // SortField sets the optional parameter "sortField": Field by which to
  43690. // sort the list.
  43691. //
  43692. // Possible values:
  43693. // "ID" (default)
  43694. // "NAME"
  43695. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  43696. c.urlParams_.Set("sortField", sortField)
  43697. return c
  43698. }
  43699. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  43700. // results.
  43701. //
  43702. // Possible values:
  43703. // "ASCENDING" (default)
  43704. // "DESCENDING"
  43705. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  43706. c.urlParams_.Set("sortOrder", sortOrder)
  43707. return c
  43708. }
  43709. // Fields allows partial responses to be retrieved. See
  43710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43711. // for more information.
  43712. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  43713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43714. return c
  43715. }
  43716. // IfNoneMatch sets the optional parameter which makes the operation
  43717. // fail if the object's ETag matches the given value. This is useful for
  43718. // getting updates only after the object has changed since the last
  43719. // request. Use googleapi.IsNotModified to check whether the response
  43720. // error from Do is the result of In-None-Match.
  43721. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  43722. c.ifNoneMatch_ = entityTag
  43723. return c
  43724. }
  43725. // Context sets the context to be used in this call's Do method. Any
  43726. // pending HTTP request will be aborted if the provided context is
  43727. // canceled.
  43728. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  43729. c.ctx_ = ctx
  43730. return c
  43731. }
  43732. // Header returns an http.Header that can be modified by the caller to
  43733. // add HTTP headers to the request.
  43734. func (c *TargetingTemplatesListCall) Header() http.Header {
  43735. if c.header_ == nil {
  43736. c.header_ = make(http.Header)
  43737. }
  43738. return c.header_
  43739. }
  43740. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  43741. reqHeaders := make(http.Header)
  43742. for k, v := range c.header_ {
  43743. reqHeaders[k] = v
  43744. }
  43745. reqHeaders.Set("User-Agent", c.s.userAgent())
  43746. if c.ifNoneMatch_ != "" {
  43747. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43748. }
  43749. var body io.Reader = nil
  43750. c.urlParams_.Set("alt", alt)
  43751. c.urlParams_.Set("prettyPrint", "false")
  43752. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43753. urls += "?" + c.urlParams_.Encode()
  43754. req, err := http.NewRequest("GET", urls, body)
  43755. if err != nil {
  43756. return nil, err
  43757. }
  43758. req.Header = reqHeaders
  43759. googleapi.Expand(req.URL, map[string]string{
  43760. "profileId": strconv.FormatInt(c.profileId, 10),
  43761. })
  43762. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43763. }
  43764. // Do executes the "dfareporting.targetingTemplates.list" call.
  43765. // Exactly one of *TargetingTemplatesListResponse or error will be
  43766. // non-nil. Any non-2xx status code is an error. Response headers are in
  43767. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  43768. // response was returned at all) in error.(*googleapi.Error).Header. Use
  43769. // googleapi.IsNotModified to check whether the returned error was
  43770. // because http.StatusNotModified was returned.
  43771. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  43772. gensupport.SetOptions(c.urlParams_, opts...)
  43773. res, err := c.doRequest("json")
  43774. if res != nil && res.StatusCode == http.StatusNotModified {
  43775. if res.Body != nil {
  43776. res.Body.Close()
  43777. }
  43778. return nil, &googleapi.Error{
  43779. Code: res.StatusCode,
  43780. Header: res.Header,
  43781. }
  43782. }
  43783. if err != nil {
  43784. return nil, err
  43785. }
  43786. defer googleapi.CloseBody(res)
  43787. if err := googleapi.CheckResponse(res); err != nil {
  43788. return nil, err
  43789. }
  43790. ret := &TargetingTemplatesListResponse{
  43791. ServerResponse: googleapi.ServerResponse{
  43792. Header: res.Header,
  43793. HTTPStatusCode: res.StatusCode,
  43794. },
  43795. }
  43796. target := &ret
  43797. if err := gensupport.DecodeResponse(target, res); err != nil {
  43798. return nil, err
  43799. }
  43800. return ret, nil
  43801. // {
  43802. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  43803. // "httpMethod": "GET",
  43804. // "id": "dfareporting.targetingTemplates.list",
  43805. // "parameterOrder": [
  43806. // "profileId"
  43807. // ],
  43808. // "parameters": {
  43809. // "advertiserId": {
  43810. // "description": "Select only targeting templates with this advertiser ID.",
  43811. // "format": "int64",
  43812. // "location": "query",
  43813. // "type": "string"
  43814. // },
  43815. // "ids": {
  43816. // "description": "Select only targeting templates with these IDs.",
  43817. // "format": "int64",
  43818. // "location": "query",
  43819. // "repeated": true,
  43820. // "type": "string"
  43821. // },
  43822. // "maxResults": {
  43823. // "default": "1000",
  43824. // "description": "Maximum number of results to return.",
  43825. // "format": "int32",
  43826. // "location": "query",
  43827. // "maximum": "1000",
  43828. // "minimum": "0",
  43829. // "type": "integer"
  43830. // },
  43831. // "pageToken": {
  43832. // "description": "Value of the nextPageToken from the previous result page.",
  43833. // "location": "query",
  43834. // "type": "string"
  43835. // },
  43836. // "profileId": {
  43837. // "description": "User profile ID associated with this request.",
  43838. // "format": "int64",
  43839. // "location": "path",
  43840. // "required": true,
  43841. // "type": "string"
  43842. // },
  43843. // "searchString": {
  43844. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"template*2015\" will return objects with names like \"template June 2015\", \"template April 2015\", or simply \"template 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"template\" will match objects with name \"my template\", \"template 2015\", or simply \"template\".",
  43845. // "location": "query",
  43846. // "type": "string"
  43847. // },
  43848. // "sortField": {
  43849. // "default": "ID",
  43850. // "description": "Field by which to sort the list.",
  43851. // "enum": [
  43852. // "ID",
  43853. // "NAME"
  43854. // ],
  43855. // "enumDescriptions": [
  43856. // "",
  43857. // ""
  43858. // ],
  43859. // "location": "query",
  43860. // "type": "string"
  43861. // },
  43862. // "sortOrder": {
  43863. // "default": "ASCENDING",
  43864. // "description": "Order of sorted results.",
  43865. // "enum": [
  43866. // "ASCENDING",
  43867. // "DESCENDING"
  43868. // ],
  43869. // "enumDescriptions": [
  43870. // "",
  43871. // ""
  43872. // ],
  43873. // "location": "query",
  43874. // "type": "string"
  43875. // }
  43876. // },
  43877. // "path": "userprofiles/{profileId}/targetingTemplates",
  43878. // "response": {
  43879. // "$ref": "TargetingTemplatesListResponse"
  43880. // },
  43881. // "scopes": [
  43882. // "https://www.googleapis.com/auth/dfatrafficking"
  43883. // ]
  43884. // }
  43885. }
  43886. // Pages invokes f for each page of results.
  43887. // A non-nil error returned from f will halt the iteration.
  43888. // The provided context supersedes any context provided to the Context method.
  43889. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  43890. c.ctx_ = ctx
  43891. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43892. for {
  43893. x, err := c.Do()
  43894. if err != nil {
  43895. return err
  43896. }
  43897. if err := f(x); err != nil {
  43898. return err
  43899. }
  43900. if x.NextPageToken == "" {
  43901. return nil
  43902. }
  43903. c.PageToken(x.NextPageToken)
  43904. }
  43905. }
  43906. // method id "dfareporting.targetingTemplates.patch":
  43907. type TargetingTemplatesPatchCall struct {
  43908. s *Service
  43909. profileId int64
  43910. targetingtemplate *TargetingTemplate
  43911. urlParams_ gensupport.URLParams
  43912. ctx_ context.Context
  43913. header_ http.Header
  43914. }
  43915. // Patch: Updates an existing targeting template. This method supports
  43916. // patch semantics.
  43917. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  43918. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43919. c.profileId = profileId
  43920. c.urlParams_.Set("id", fmt.Sprint(id))
  43921. c.targetingtemplate = targetingtemplate
  43922. return c
  43923. }
  43924. // Fields allows partial responses to be retrieved. See
  43925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43926. // for more information.
  43927. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  43928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43929. return c
  43930. }
  43931. // Context sets the context to be used in this call's Do method. Any
  43932. // pending HTTP request will be aborted if the provided context is
  43933. // canceled.
  43934. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  43935. c.ctx_ = ctx
  43936. return c
  43937. }
  43938. // Header returns an http.Header that can be modified by the caller to
  43939. // add HTTP headers to the request.
  43940. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  43941. if c.header_ == nil {
  43942. c.header_ = make(http.Header)
  43943. }
  43944. return c.header_
  43945. }
  43946. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  43947. reqHeaders := make(http.Header)
  43948. for k, v := range c.header_ {
  43949. reqHeaders[k] = v
  43950. }
  43951. reqHeaders.Set("User-Agent", c.s.userAgent())
  43952. var body io.Reader = nil
  43953. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43954. if err != nil {
  43955. return nil, err
  43956. }
  43957. reqHeaders.Set("Content-Type", "application/json")
  43958. c.urlParams_.Set("alt", alt)
  43959. c.urlParams_.Set("prettyPrint", "false")
  43960. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43961. urls += "?" + c.urlParams_.Encode()
  43962. req, err := http.NewRequest("PATCH", urls, body)
  43963. if err != nil {
  43964. return nil, err
  43965. }
  43966. req.Header = reqHeaders
  43967. googleapi.Expand(req.URL, map[string]string{
  43968. "profileId": strconv.FormatInt(c.profileId, 10),
  43969. })
  43970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43971. }
  43972. // Do executes the "dfareporting.targetingTemplates.patch" call.
  43973. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43974. // non-2xx status code is an error. Response headers are in either
  43975. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43976. // returned at all) in error.(*googleapi.Error).Header. Use
  43977. // googleapi.IsNotModified to check whether the returned error was
  43978. // because http.StatusNotModified was returned.
  43979. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43980. gensupport.SetOptions(c.urlParams_, opts...)
  43981. res, err := c.doRequest("json")
  43982. if res != nil && res.StatusCode == http.StatusNotModified {
  43983. if res.Body != nil {
  43984. res.Body.Close()
  43985. }
  43986. return nil, &googleapi.Error{
  43987. Code: res.StatusCode,
  43988. Header: res.Header,
  43989. }
  43990. }
  43991. if err != nil {
  43992. return nil, err
  43993. }
  43994. defer googleapi.CloseBody(res)
  43995. if err := googleapi.CheckResponse(res); err != nil {
  43996. return nil, err
  43997. }
  43998. ret := &TargetingTemplate{
  43999. ServerResponse: googleapi.ServerResponse{
  44000. Header: res.Header,
  44001. HTTPStatusCode: res.StatusCode,
  44002. },
  44003. }
  44004. target := &ret
  44005. if err := gensupport.DecodeResponse(target, res); err != nil {
  44006. return nil, err
  44007. }
  44008. return ret, nil
  44009. // {
  44010. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  44011. // "httpMethod": "PATCH",
  44012. // "id": "dfareporting.targetingTemplates.patch",
  44013. // "parameterOrder": [
  44014. // "profileId",
  44015. // "id"
  44016. // ],
  44017. // "parameters": {
  44018. // "id": {
  44019. // "description": "Targeting template ID.",
  44020. // "format": "int64",
  44021. // "location": "query",
  44022. // "required": true,
  44023. // "type": "string"
  44024. // },
  44025. // "profileId": {
  44026. // "description": "User profile ID associated with this request.",
  44027. // "format": "int64",
  44028. // "location": "path",
  44029. // "required": true,
  44030. // "type": "string"
  44031. // }
  44032. // },
  44033. // "path": "userprofiles/{profileId}/targetingTemplates",
  44034. // "request": {
  44035. // "$ref": "TargetingTemplate"
  44036. // },
  44037. // "response": {
  44038. // "$ref": "TargetingTemplate"
  44039. // },
  44040. // "scopes": [
  44041. // "https://www.googleapis.com/auth/dfatrafficking"
  44042. // ]
  44043. // }
  44044. }
  44045. // method id "dfareporting.targetingTemplates.update":
  44046. type TargetingTemplatesUpdateCall struct {
  44047. s *Service
  44048. profileId int64
  44049. targetingtemplate *TargetingTemplate
  44050. urlParams_ gensupport.URLParams
  44051. ctx_ context.Context
  44052. header_ http.Header
  44053. }
  44054. // Update: Updates an existing targeting template.
  44055. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  44056. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44057. c.profileId = profileId
  44058. c.targetingtemplate = targetingtemplate
  44059. return c
  44060. }
  44061. // Fields allows partial responses to be retrieved. See
  44062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44063. // for more information.
  44064. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  44065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44066. return c
  44067. }
  44068. // Context sets the context to be used in this call's Do method. Any
  44069. // pending HTTP request will be aborted if the provided context is
  44070. // canceled.
  44071. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  44072. c.ctx_ = ctx
  44073. return c
  44074. }
  44075. // Header returns an http.Header that can be modified by the caller to
  44076. // add HTTP headers to the request.
  44077. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  44078. if c.header_ == nil {
  44079. c.header_ = make(http.Header)
  44080. }
  44081. return c.header_
  44082. }
  44083. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44084. reqHeaders := make(http.Header)
  44085. for k, v := range c.header_ {
  44086. reqHeaders[k] = v
  44087. }
  44088. reqHeaders.Set("User-Agent", c.s.userAgent())
  44089. var body io.Reader = nil
  44090. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  44091. if err != nil {
  44092. return nil, err
  44093. }
  44094. reqHeaders.Set("Content-Type", "application/json")
  44095. c.urlParams_.Set("alt", alt)
  44096. c.urlParams_.Set("prettyPrint", "false")
  44097. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  44098. urls += "?" + c.urlParams_.Encode()
  44099. req, err := http.NewRequest("PUT", urls, body)
  44100. if err != nil {
  44101. return nil, err
  44102. }
  44103. req.Header = reqHeaders
  44104. googleapi.Expand(req.URL, map[string]string{
  44105. "profileId": strconv.FormatInt(c.profileId, 10),
  44106. })
  44107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44108. }
  44109. // Do executes the "dfareporting.targetingTemplates.update" call.
  44110. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  44111. // non-2xx status code is an error. Response headers are in either
  44112. // *TargetingTemplate.ServerResponse.Header or (if a response was
  44113. // returned at all) in error.(*googleapi.Error).Header. Use
  44114. // googleapi.IsNotModified to check whether the returned error was
  44115. // because http.StatusNotModified was returned.
  44116. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  44117. gensupport.SetOptions(c.urlParams_, opts...)
  44118. res, err := c.doRequest("json")
  44119. if res != nil && res.StatusCode == http.StatusNotModified {
  44120. if res.Body != nil {
  44121. res.Body.Close()
  44122. }
  44123. return nil, &googleapi.Error{
  44124. Code: res.StatusCode,
  44125. Header: res.Header,
  44126. }
  44127. }
  44128. if err != nil {
  44129. return nil, err
  44130. }
  44131. defer googleapi.CloseBody(res)
  44132. if err := googleapi.CheckResponse(res); err != nil {
  44133. return nil, err
  44134. }
  44135. ret := &TargetingTemplate{
  44136. ServerResponse: googleapi.ServerResponse{
  44137. Header: res.Header,
  44138. HTTPStatusCode: res.StatusCode,
  44139. },
  44140. }
  44141. target := &ret
  44142. if err := gensupport.DecodeResponse(target, res); err != nil {
  44143. return nil, err
  44144. }
  44145. return ret, nil
  44146. // {
  44147. // "description": "Updates an existing targeting template.",
  44148. // "httpMethod": "PUT",
  44149. // "id": "dfareporting.targetingTemplates.update",
  44150. // "parameterOrder": [
  44151. // "profileId"
  44152. // ],
  44153. // "parameters": {
  44154. // "profileId": {
  44155. // "description": "User profile ID associated with this request.",
  44156. // "format": "int64",
  44157. // "location": "path",
  44158. // "required": true,
  44159. // "type": "string"
  44160. // }
  44161. // },
  44162. // "path": "userprofiles/{profileId}/targetingTemplates",
  44163. // "request": {
  44164. // "$ref": "TargetingTemplate"
  44165. // },
  44166. // "response": {
  44167. // "$ref": "TargetingTemplate"
  44168. // },
  44169. // "scopes": [
  44170. // "https://www.googleapis.com/auth/dfatrafficking"
  44171. // ]
  44172. // }
  44173. }
  44174. // method id "dfareporting.userProfiles.get":
  44175. type UserProfilesGetCall struct {
  44176. s *Service
  44177. profileId int64
  44178. urlParams_ gensupport.URLParams
  44179. ifNoneMatch_ string
  44180. ctx_ context.Context
  44181. header_ http.Header
  44182. }
  44183. // Get: Gets one user profile by ID.
  44184. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  44185. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44186. c.profileId = profileId
  44187. return c
  44188. }
  44189. // Fields allows partial responses to be retrieved. See
  44190. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44191. // for more information.
  44192. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  44193. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44194. return c
  44195. }
  44196. // IfNoneMatch sets the optional parameter which makes the operation
  44197. // fail if the object's ETag matches the given value. This is useful for
  44198. // getting updates only after the object has changed since the last
  44199. // request. Use googleapi.IsNotModified to check whether the response
  44200. // error from Do is the result of In-None-Match.
  44201. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  44202. c.ifNoneMatch_ = entityTag
  44203. return c
  44204. }
  44205. // Context sets the context to be used in this call's Do method. Any
  44206. // pending HTTP request will be aborted if the provided context is
  44207. // canceled.
  44208. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  44209. c.ctx_ = ctx
  44210. return c
  44211. }
  44212. // Header returns an http.Header that can be modified by the caller to
  44213. // add HTTP headers to the request.
  44214. func (c *UserProfilesGetCall) Header() http.Header {
  44215. if c.header_ == nil {
  44216. c.header_ = make(http.Header)
  44217. }
  44218. return c.header_
  44219. }
  44220. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  44221. reqHeaders := make(http.Header)
  44222. for k, v := range c.header_ {
  44223. reqHeaders[k] = v
  44224. }
  44225. reqHeaders.Set("User-Agent", c.s.userAgent())
  44226. if c.ifNoneMatch_ != "" {
  44227. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44228. }
  44229. var body io.Reader = nil
  44230. c.urlParams_.Set("alt", alt)
  44231. c.urlParams_.Set("prettyPrint", "false")
  44232. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  44233. urls += "?" + c.urlParams_.Encode()
  44234. req, err := http.NewRequest("GET", urls, body)
  44235. if err != nil {
  44236. return nil, err
  44237. }
  44238. req.Header = reqHeaders
  44239. googleapi.Expand(req.URL, map[string]string{
  44240. "profileId": strconv.FormatInt(c.profileId, 10),
  44241. })
  44242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44243. }
  44244. // Do executes the "dfareporting.userProfiles.get" call.
  44245. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  44246. // status code is an error. Response headers are in either
  44247. // *UserProfile.ServerResponse.Header or (if a response was returned at
  44248. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44249. // to check whether the returned error was because
  44250. // http.StatusNotModified was returned.
  44251. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  44252. gensupport.SetOptions(c.urlParams_, opts...)
  44253. res, err := c.doRequest("json")
  44254. if res != nil && res.StatusCode == http.StatusNotModified {
  44255. if res.Body != nil {
  44256. res.Body.Close()
  44257. }
  44258. return nil, &googleapi.Error{
  44259. Code: res.StatusCode,
  44260. Header: res.Header,
  44261. }
  44262. }
  44263. if err != nil {
  44264. return nil, err
  44265. }
  44266. defer googleapi.CloseBody(res)
  44267. if err := googleapi.CheckResponse(res); err != nil {
  44268. return nil, err
  44269. }
  44270. ret := &UserProfile{
  44271. ServerResponse: googleapi.ServerResponse{
  44272. Header: res.Header,
  44273. HTTPStatusCode: res.StatusCode,
  44274. },
  44275. }
  44276. target := &ret
  44277. if err := gensupport.DecodeResponse(target, res); err != nil {
  44278. return nil, err
  44279. }
  44280. return ret, nil
  44281. // {
  44282. // "description": "Gets one user profile by ID.",
  44283. // "httpMethod": "GET",
  44284. // "id": "dfareporting.userProfiles.get",
  44285. // "parameterOrder": [
  44286. // "profileId"
  44287. // ],
  44288. // "parameters": {
  44289. // "profileId": {
  44290. // "description": "The user profile ID.",
  44291. // "format": "int64",
  44292. // "location": "path",
  44293. // "required": true,
  44294. // "type": "string"
  44295. // }
  44296. // },
  44297. // "path": "userprofiles/{profileId}",
  44298. // "response": {
  44299. // "$ref": "UserProfile"
  44300. // },
  44301. // "scopes": [
  44302. // "https://www.googleapis.com/auth/dfareporting",
  44303. // "https://www.googleapis.com/auth/dfatrafficking"
  44304. // ]
  44305. // }
  44306. }
  44307. // method id "dfareporting.userProfiles.list":
  44308. type UserProfilesListCall struct {
  44309. s *Service
  44310. urlParams_ gensupport.URLParams
  44311. ifNoneMatch_ string
  44312. ctx_ context.Context
  44313. header_ http.Header
  44314. }
  44315. // List: Retrieves list of user profiles for a user.
  44316. func (r *UserProfilesService) List() *UserProfilesListCall {
  44317. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44318. return c
  44319. }
  44320. // Fields allows partial responses to be retrieved. See
  44321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44322. // for more information.
  44323. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  44324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44325. return c
  44326. }
  44327. // IfNoneMatch sets the optional parameter which makes the operation
  44328. // fail if the object's ETag matches the given value. This is useful for
  44329. // getting updates only after the object has changed since the last
  44330. // request. Use googleapi.IsNotModified to check whether the response
  44331. // error from Do is the result of In-None-Match.
  44332. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  44333. c.ifNoneMatch_ = entityTag
  44334. return c
  44335. }
  44336. // Context sets the context to be used in this call's Do method. Any
  44337. // pending HTTP request will be aborted if the provided context is
  44338. // canceled.
  44339. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  44340. c.ctx_ = ctx
  44341. return c
  44342. }
  44343. // Header returns an http.Header that can be modified by the caller to
  44344. // add HTTP headers to the request.
  44345. func (c *UserProfilesListCall) Header() http.Header {
  44346. if c.header_ == nil {
  44347. c.header_ = make(http.Header)
  44348. }
  44349. return c.header_
  44350. }
  44351. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  44352. reqHeaders := make(http.Header)
  44353. for k, v := range c.header_ {
  44354. reqHeaders[k] = v
  44355. }
  44356. reqHeaders.Set("User-Agent", c.s.userAgent())
  44357. if c.ifNoneMatch_ != "" {
  44358. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44359. }
  44360. var body io.Reader = nil
  44361. c.urlParams_.Set("alt", alt)
  44362. c.urlParams_.Set("prettyPrint", "false")
  44363. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  44364. urls += "?" + c.urlParams_.Encode()
  44365. req, err := http.NewRequest("GET", urls, body)
  44366. if err != nil {
  44367. return nil, err
  44368. }
  44369. req.Header = reqHeaders
  44370. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44371. }
  44372. // Do executes the "dfareporting.userProfiles.list" call.
  44373. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  44374. // status code is an error. Response headers are in either
  44375. // *UserProfileList.ServerResponse.Header or (if a response was returned
  44376. // at all) in error.(*googleapi.Error).Header. Use
  44377. // googleapi.IsNotModified to check whether the returned error was
  44378. // because http.StatusNotModified was returned.
  44379. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  44380. gensupport.SetOptions(c.urlParams_, opts...)
  44381. res, err := c.doRequest("json")
  44382. if res != nil && res.StatusCode == http.StatusNotModified {
  44383. if res.Body != nil {
  44384. res.Body.Close()
  44385. }
  44386. return nil, &googleapi.Error{
  44387. Code: res.StatusCode,
  44388. Header: res.Header,
  44389. }
  44390. }
  44391. if err != nil {
  44392. return nil, err
  44393. }
  44394. defer googleapi.CloseBody(res)
  44395. if err := googleapi.CheckResponse(res); err != nil {
  44396. return nil, err
  44397. }
  44398. ret := &UserProfileList{
  44399. ServerResponse: googleapi.ServerResponse{
  44400. Header: res.Header,
  44401. HTTPStatusCode: res.StatusCode,
  44402. },
  44403. }
  44404. target := &ret
  44405. if err := gensupport.DecodeResponse(target, res); err != nil {
  44406. return nil, err
  44407. }
  44408. return ret, nil
  44409. // {
  44410. // "description": "Retrieves list of user profiles for a user.",
  44411. // "httpMethod": "GET",
  44412. // "id": "dfareporting.userProfiles.list",
  44413. // "path": "userprofiles",
  44414. // "response": {
  44415. // "$ref": "UserProfileList"
  44416. // },
  44417. // "scopes": [
  44418. // "https://www.googleapis.com/auth/dfareporting",
  44419. // "https://www.googleapis.com/auth/dfatrafficking"
  44420. // ]
  44421. // }
  44422. }
  44423. // method id "dfareporting.userRolePermissionGroups.get":
  44424. type UserRolePermissionGroupsGetCall struct {
  44425. s *Service
  44426. profileId int64
  44427. id int64
  44428. urlParams_ gensupport.URLParams
  44429. ifNoneMatch_ string
  44430. ctx_ context.Context
  44431. header_ http.Header
  44432. }
  44433. // Get: Gets one user role permission group by ID.
  44434. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  44435. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44436. c.profileId = profileId
  44437. c.id = id
  44438. return c
  44439. }
  44440. // Fields allows partial responses to be retrieved. See
  44441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44442. // for more information.
  44443. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  44444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44445. return c
  44446. }
  44447. // IfNoneMatch sets the optional parameter which makes the operation
  44448. // fail if the object's ETag matches the given value. This is useful for
  44449. // getting updates only after the object has changed since the last
  44450. // request. Use googleapi.IsNotModified to check whether the response
  44451. // error from Do is the result of In-None-Match.
  44452. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  44453. c.ifNoneMatch_ = entityTag
  44454. return c
  44455. }
  44456. // Context sets the context to be used in this call's Do method. Any
  44457. // pending HTTP request will be aborted if the provided context is
  44458. // canceled.
  44459. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  44460. c.ctx_ = ctx
  44461. return c
  44462. }
  44463. // Header returns an http.Header that can be modified by the caller to
  44464. // add HTTP headers to the request.
  44465. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  44466. if c.header_ == nil {
  44467. c.header_ = make(http.Header)
  44468. }
  44469. return c.header_
  44470. }
  44471. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  44472. reqHeaders := make(http.Header)
  44473. for k, v := range c.header_ {
  44474. reqHeaders[k] = v
  44475. }
  44476. reqHeaders.Set("User-Agent", c.s.userAgent())
  44477. if c.ifNoneMatch_ != "" {
  44478. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44479. }
  44480. var body io.Reader = nil
  44481. c.urlParams_.Set("alt", alt)
  44482. c.urlParams_.Set("prettyPrint", "false")
  44483. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  44484. urls += "?" + c.urlParams_.Encode()
  44485. req, err := http.NewRequest("GET", urls, body)
  44486. if err != nil {
  44487. return nil, err
  44488. }
  44489. req.Header = reqHeaders
  44490. googleapi.Expand(req.URL, map[string]string{
  44491. "profileId": strconv.FormatInt(c.profileId, 10),
  44492. "id": strconv.FormatInt(c.id, 10),
  44493. })
  44494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44495. }
  44496. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  44497. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  44498. // non-2xx status code is an error. Response headers are in either
  44499. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  44500. // returned at all) in error.(*googleapi.Error).Header. Use
  44501. // googleapi.IsNotModified to check whether the returned error was
  44502. // because http.StatusNotModified was returned.
  44503. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  44504. gensupport.SetOptions(c.urlParams_, opts...)
  44505. res, err := c.doRequest("json")
  44506. if res != nil && res.StatusCode == http.StatusNotModified {
  44507. if res.Body != nil {
  44508. res.Body.Close()
  44509. }
  44510. return nil, &googleapi.Error{
  44511. Code: res.StatusCode,
  44512. Header: res.Header,
  44513. }
  44514. }
  44515. if err != nil {
  44516. return nil, err
  44517. }
  44518. defer googleapi.CloseBody(res)
  44519. if err := googleapi.CheckResponse(res); err != nil {
  44520. return nil, err
  44521. }
  44522. ret := &UserRolePermissionGroup{
  44523. ServerResponse: googleapi.ServerResponse{
  44524. Header: res.Header,
  44525. HTTPStatusCode: res.StatusCode,
  44526. },
  44527. }
  44528. target := &ret
  44529. if err := gensupport.DecodeResponse(target, res); err != nil {
  44530. return nil, err
  44531. }
  44532. return ret, nil
  44533. // {
  44534. // "description": "Gets one user role permission group by ID.",
  44535. // "httpMethod": "GET",
  44536. // "id": "dfareporting.userRolePermissionGroups.get",
  44537. // "parameterOrder": [
  44538. // "profileId",
  44539. // "id"
  44540. // ],
  44541. // "parameters": {
  44542. // "id": {
  44543. // "description": "User role permission group ID.",
  44544. // "format": "int64",
  44545. // "location": "path",
  44546. // "required": true,
  44547. // "type": "string"
  44548. // },
  44549. // "profileId": {
  44550. // "description": "User profile ID associated with this request.",
  44551. // "format": "int64",
  44552. // "location": "path",
  44553. // "required": true,
  44554. // "type": "string"
  44555. // }
  44556. // },
  44557. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  44558. // "response": {
  44559. // "$ref": "UserRolePermissionGroup"
  44560. // },
  44561. // "scopes": [
  44562. // "https://www.googleapis.com/auth/dfatrafficking"
  44563. // ]
  44564. // }
  44565. }
  44566. // method id "dfareporting.userRolePermissionGroups.list":
  44567. type UserRolePermissionGroupsListCall struct {
  44568. s *Service
  44569. profileId int64
  44570. urlParams_ gensupport.URLParams
  44571. ifNoneMatch_ string
  44572. ctx_ context.Context
  44573. header_ http.Header
  44574. }
  44575. // List: Gets a list of all supported user role permission groups.
  44576. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  44577. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44578. c.profileId = profileId
  44579. return c
  44580. }
  44581. // Fields allows partial responses to be retrieved. See
  44582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44583. // for more information.
  44584. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  44585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44586. return c
  44587. }
  44588. // IfNoneMatch sets the optional parameter which makes the operation
  44589. // fail if the object's ETag matches the given value. This is useful for
  44590. // getting updates only after the object has changed since the last
  44591. // request. Use googleapi.IsNotModified to check whether the response
  44592. // error from Do is the result of In-None-Match.
  44593. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  44594. c.ifNoneMatch_ = entityTag
  44595. return c
  44596. }
  44597. // Context sets the context to be used in this call's Do method. Any
  44598. // pending HTTP request will be aborted if the provided context is
  44599. // canceled.
  44600. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  44601. c.ctx_ = ctx
  44602. return c
  44603. }
  44604. // Header returns an http.Header that can be modified by the caller to
  44605. // add HTTP headers to the request.
  44606. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  44607. if c.header_ == nil {
  44608. c.header_ = make(http.Header)
  44609. }
  44610. return c.header_
  44611. }
  44612. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  44613. reqHeaders := make(http.Header)
  44614. for k, v := range c.header_ {
  44615. reqHeaders[k] = v
  44616. }
  44617. reqHeaders.Set("User-Agent", c.s.userAgent())
  44618. if c.ifNoneMatch_ != "" {
  44619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44620. }
  44621. var body io.Reader = nil
  44622. c.urlParams_.Set("alt", alt)
  44623. c.urlParams_.Set("prettyPrint", "false")
  44624. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  44625. urls += "?" + c.urlParams_.Encode()
  44626. req, err := http.NewRequest("GET", urls, body)
  44627. if err != nil {
  44628. return nil, err
  44629. }
  44630. req.Header = reqHeaders
  44631. googleapi.Expand(req.URL, map[string]string{
  44632. "profileId": strconv.FormatInt(c.profileId, 10),
  44633. })
  44634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44635. }
  44636. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  44637. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  44638. // non-nil. Any non-2xx status code is an error. Response headers are in
  44639. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  44640. // (if a response was returned at all) in
  44641. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  44642. // whether the returned error was because http.StatusNotModified was
  44643. // returned.
  44644. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  44645. gensupport.SetOptions(c.urlParams_, opts...)
  44646. res, err := c.doRequest("json")
  44647. if res != nil && res.StatusCode == http.StatusNotModified {
  44648. if res.Body != nil {
  44649. res.Body.Close()
  44650. }
  44651. return nil, &googleapi.Error{
  44652. Code: res.StatusCode,
  44653. Header: res.Header,
  44654. }
  44655. }
  44656. if err != nil {
  44657. return nil, err
  44658. }
  44659. defer googleapi.CloseBody(res)
  44660. if err := googleapi.CheckResponse(res); err != nil {
  44661. return nil, err
  44662. }
  44663. ret := &UserRolePermissionGroupsListResponse{
  44664. ServerResponse: googleapi.ServerResponse{
  44665. Header: res.Header,
  44666. HTTPStatusCode: res.StatusCode,
  44667. },
  44668. }
  44669. target := &ret
  44670. if err := gensupport.DecodeResponse(target, res); err != nil {
  44671. return nil, err
  44672. }
  44673. return ret, nil
  44674. // {
  44675. // "description": "Gets a list of all supported user role permission groups.",
  44676. // "httpMethod": "GET",
  44677. // "id": "dfareporting.userRolePermissionGroups.list",
  44678. // "parameterOrder": [
  44679. // "profileId"
  44680. // ],
  44681. // "parameters": {
  44682. // "profileId": {
  44683. // "description": "User profile ID associated with this request.",
  44684. // "format": "int64",
  44685. // "location": "path",
  44686. // "required": true,
  44687. // "type": "string"
  44688. // }
  44689. // },
  44690. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  44691. // "response": {
  44692. // "$ref": "UserRolePermissionGroupsListResponse"
  44693. // },
  44694. // "scopes": [
  44695. // "https://www.googleapis.com/auth/dfatrafficking"
  44696. // ]
  44697. // }
  44698. }
  44699. // method id "dfareporting.userRolePermissions.get":
  44700. type UserRolePermissionsGetCall struct {
  44701. s *Service
  44702. profileId int64
  44703. id int64
  44704. urlParams_ gensupport.URLParams
  44705. ifNoneMatch_ string
  44706. ctx_ context.Context
  44707. header_ http.Header
  44708. }
  44709. // Get: Gets one user role permission by ID.
  44710. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  44711. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44712. c.profileId = profileId
  44713. c.id = id
  44714. return c
  44715. }
  44716. // Fields allows partial responses to be retrieved. See
  44717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44718. // for more information.
  44719. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  44720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44721. return c
  44722. }
  44723. // IfNoneMatch sets the optional parameter which makes the operation
  44724. // fail if the object's ETag matches the given value. This is useful for
  44725. // getting updates only after the object has changed since the last
  44726. // request. Use googleapi.IsNotModified to check whether the response
  44727. // error from Do is the result of In-None-Match.
  44728. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  44729. c.ifNoneMatch_ = entityTag
  44730. return c
  44731. }
  44732. // Context sets the context to be used in this call's Do method. Any
  44733. // pending HTTP request will be aborted if the provided context is
  44734. // canceled.
  44735. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  44736. c.ctx_ = ctx
  44737. return c
  44738. }
  44739. // Header returns an http.Header that can be modified by the caller to
  44740. // add HTTP headers to the request.
  44741. func (c *UserRolePermissionsGetCall) Header() http.Header {
  44742. if c.header_ == nil {
  44743. c.header_ = make(http.Header)
  44744. }
  44745. return c.header_
  44746. }
  44747. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  44748. reqHeaders := make(http.Header)
  44749. for k, v := range c.header_ {
  44750. reqHeaders[k] = v
  44751. }
  44752. reqHeaders.Set("User-Agent", c.s.userAgent())
  44753. if c.ifNoneMatch_ != "" {
  44754. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44755. }
  44756. var body io.Reader = nil
  44757. c.urlParams_.Set("alt", alt)
  44758. c.urlParams_.Set("prettyPrint", "false")
  44759. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  44760. urls += "?" + c.urlParams_.Encode()
  44761. req, err := http.NewRequest("GET", urls, body)
  44762. if err != nil {
  44763. return nil, err
  44764. }
  44765. req.Header = reqHeaders
  44766. googleapi.Expand(req.URL, map[string]string{
  44767. "profileId": strconv.FormatInt(c.profileId, 10),
  44768. "id": strconv.FormatInt(c.id, 10),
  44769. })
  44770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44771. }
  44772. // Do executes the "dfareporting.userRolePermissions.get" call.
  44773. // Exactly one of *UserRolePermission or error will be non-nil. Any
  44774. // non-2xx status code is an error. Response headers are in either
  44775. // *UserRolePermission.ServerResponse.Header or (if a response was
  44776. // returned at all) in error.(*googleapi.Error).Header. Use
  44777. // googleapi.IsNotModified to check whether the returned error was
  44778. // because http.StatusNotModified was returned.
  44779. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  44780. gensupport.SetOptions(c.urlParams_, opts...)
  44781. res, err := c.doRequest("json")
  44782. if res != nil && res.StatusCode == http.StatusNotModified {
  44783. if res.Body != nil {
  44784. res.Body.Close()
  44785. }
  44786. return nil, &googleapi.Error{
  44787. Code: res.StatusCode,
  44788. Header: res.Header,
  44789. }
  44790. }
  44791. if err != nil {
  44792. return nil, err
  44793. }
  44794. defer googleapi.CloseBody(res)
  44795. if err := googleapi.CheckResponse(res); err != nil {
  44796. return nil, err
  44797. }
  44798. ret := &UserRolePermission{
  44799. ServerResponse: googleapi.ServerResponse{
  44800. Header: res.Header,
  44801. HTTPStatusCode: res.StatusCode,
  44802. },
  44803. }
  44804. target := &ret
  44805. if err := gensupport.DecodeResponse(target, res); err != nil {
  44806. return nil, err
  44807. }
  44808. return ret, nil
  44809. // {
  44810. // "description": "Gets one user role permission by ID.",
  44811. // "httpMethod": "GET",
  44812. // "id": "dfareporting.userRolePermissions.get",
  44813. // "parameterOrder": [
  44814. // "profileId",
  44815. // "id"
  44816. // ],
  44817. // "parameters": {
  44818. // "id": {
  44819. // "description": "User role permission ID.",
  44820. // "format": "int64",
  44821. // "location": "path",
  44822. // "required": true,
  44823. // "type": "string"
  44824. // },
  44825. // "profileId": {
  44826. // "description": "User profile ID associated with this request.",
  44827. // "format": "int64",
  44828. // "location": "path",
  44829. // "required": true,
  44830. // "type": "string"
  44831. // }
  44832. // },
  44833. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  44834. // "response": {
  44835. // "$ref": "UserRolePermission"
  44836. // },
  44837. // "scopes": [
  44838. // "https://www.googleapis.com/auth/dfatrafficking"
  44839. // ]
  44840. // }
  44841. }
  44842. // method id "dfareporting.userRolePermissions.list":
  44843. type UserRolePermissionsListCall struct {
  44844. s *Service
  44845. profileId int64
  44846. urlParams_ gensupport.URLParams
  44847. ifNoneMatch_ string
  44848. ctx_ context.Context
  44849. header_ http.Header
  44850. }
  44851. // List: Gets a list of user role permissions, possibly filtered.
  44852. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  44853. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44854. c.profileId = profileId
  44855. return c
  44856. }
  44857. // Ids sets the optional parameter "ids": Select only user role
  44858. // permissions with these IDs.
  44859. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  44860. var ids_ []string
  44861. for _, v := range ids {
  44862. ids_ = append(ids_, fmt.Sprint(v))
  44863. }
  44864. c.urlParams_.SetMulti("ids", ids_)
  44865. return c
  44866. }
  44867. // Fields allows partial responses to be retrieved. See
  44868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44869. // for more information.
  44870. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  44871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44872. return c
  44873. }
  44874. // IfNoneMatch sets the optional parameter which makes the operation
  44875. // fail if the object's ETag matches the given value. This is useful for
  44876. // getting updates only after the object has changed since the last
  44877. // request. Use googleapi.IsNotModified to check whether the response
  44878. // error from Do is the result of In-None-Match.
  44879. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  44880. c.ifNoneMatch_ = entityTag
  44881. return c
  44882. }
  44883. // Context sets the context to be used in this call's Do method. Any
  44884. // pending HTTP request will be aborted if the provided context is
  44885. // canceled.
  44886. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  44887. c.ctx_ = ctx
  44888. return c
  44889. }
  44890. // Header returns an http.Header that can be modified by the caller to
  44891. // add HTTP headers to the request.
  44892. func (c *UserRolePermissionsListCall) Header() http.Header {
  44893. if c.header_ == nil {
  44894. c.header_ = make(http.Header)
  44895. }
  44896. return c.header_
  44897. }
  44898. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  44899. reqHeaders := make(http.Header)
  44900. for k, v := range c.header_ {
  44901. reqHeaders[k] = v
  44902. }
  44903. reqHeaders.Set("User-Agent", c.s.userAgent())
  44904. if c.ifNoneMatch_ != "" {
  44905. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44906. }
  44907. var body io.Reader = nil
  44908. c.urlParams_.Set("alt", alt)
  44909. c.urlParams_.Set("prettyPrint", "false")
  44910. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  44911. urls += "?" + c.urlParams_.Encode()
  44912. req, err := http.NewRequest("GET", urls, body)
  44913. if err != nil {
  44914. return nil, err
  44915. }
  44916. req.Header = reqHeaders
  44917. googleapi.Expand(req.URL, map[string]string{
  44918. "profileId": strconv.FormatInt(c.profileId, 10),
  44919. })
  44920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44921. }
  44922. // Do executes the "dfareporting.userRolePermissions.list" call.
  44923. // Exactly one of *UserRolePermissionsListResponse or error will be
  44924. // non-nil. Any non-2xx status code is an error. Response headers are in
  44925. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  44926. // a response was returned at all) in error.(*googleapi.Error).Header.
  44927. // Use googleapi.IsNotModified to check whether the returned error was
  44928. // because http.StatusNotModified was returned.
  44929. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  44930. gensupport.SetOptions(c.urlParams_, opts...)
  44931. res, err := c.doRequest("json")
  44932. if res != nil && res.StatusCode == http.StatusNotModified {
  44933. if res.Body != nil {
  44934. res.Body.Close()
  44935. }
  44936. return nil, &googleapi.Error{
  44937. Code: res.StatusCode,
  44938. Header: res.Header,
  44939. }
  44940. }
  44941. if err != nil {
  44942. return nil, err
  44943. }
  44944. defer googleapi.CloseBody(res)
  44945. if err := googleapi.CheckResponse(res); err != nil {
  44946. return nil, err
  44947. }
  44948. ret := &UserRolePermissionsListResponse{
  44949. ServerResponse: googleapi.ServerResponse{
  44950. Header: res.Header,
  44951. HTTPStatusCode: res.StatusCode,
  44952. },
  44953. }
  44954. target := &ret
  44955. if err := gensupport.DecodeResponse(target, res); err != nil {
  44956. return nil, err
  44957. }
  44958. return ret, nil
  44959. // {
  44960. // "description": "Gets a list of user role permissions, possibly filtered.",
  44961. // "httpMethod": "GET",
  44962. // "id": "dfareporting.userRolePermissions.list",
  44963. // "parameterOrder": [
  44964. // "profileId"
  44965. // ],
  44966. // "parameters": {
  44967. // "ids": {
  44968. // "description": "Select only user role permissions with these IDs.",
  44969. // "format": "int64",
  44970. // "location": "query",
  44971. // "repeated": true,
  44972. // "type": "string"
  44973. // },
  44974. // "profileId": {
  44975. // "description": "User profile ID associated with this request.",
  44976. // "format": "int64",
  44977. // "location": "path",
  44978. // "required": true,
  44979. // "type": "string"
  44980. // }
  44981. // },
  44982. // "path": "userprofiles/{profileId}/userRolePermissions",
  44983. // "response": {
  44984. // "$ref": "UserRolePermissionsListResponse"
  44985. // },
  44986. // "scopes": [
  44987. // "https://www.googleapis.com/auth/dfatrafficking"
  44988. // ]
  44989. // }
  44990. }
  44991. // method id "dfareporting.userRoles.delete":
  44992. type UserRolesDeleteCall struct {
  44993. s *Service
  44994. profileId int64
  44995. id int64
  44996. urlParams_ gensupport.URLParams
  44997. ctx_ context.Context
  44998. header_ http.Header
  44999. }
  45000. // Delete: Deletes an existing user role.
  45001. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  45002. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45003. c.profileId = profileId
  45004. c.id = id
  45005. return c
  45006. }
  45007. // Fields allows partial responses to be retrieved. See
  45008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45009. // for more information.
  45010. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  45011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45012. return c
  45013. }
  45014. // Context sets the context to be used in this call's Do method. Any
  45015. // pending HTTP request will be aborted if the provided context is
  45016. // canceled.
  45017. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  45018. c.ctx_ = ctx
  45019. return c
  45020. }
  45021. // Header returns an http.Header that can be modified by the caller to
  45022. // add HTTP headers to the request.
  45023. func (c *UserRolesDeleteCall) Header() http.Header {
  45024. if c.header_ == nil {
  45025. c.header_ = make(http.Header)
  45026. }
  45027. return c.header_
  45028. }
  45029. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  45030. reqHeaders := make(http.Header)
  45031. for k, v := range c.header_ {
  45032. reqHeaders[k] = v
  45033. }
  45034. reqHeaders.Set("User-Agent", c.s.userAgent())
  45035. var body io.Reader = nil
  45036. c.urlParams_.Set("alt", alt)
  45037. c.urlParams_.Set("prettyPrint", "false")
  45038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45039. urls += "?" + c.urlParams_.Encode()
  45040. req, err := http.NewRequest("DELETE", urls, body)
  45041. if err != nil {
  45042. return nil, err
  45043. }
  45044. req.Header = reqHeaders
  45045. googleapi.Expand(req.URL, map[string]string{
  45046. "profileId": strconv.FormatInt(c.profileId, 10),
  45047. "id": strconv.FormatInt(c.id, 10),
  45048. })
  45049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45050. }
  45051. // Do executes the "dfareporting.userRoles.delete" call.
  45052. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  45053. gensupport.SetOptions(c.urlParams_, opts...)
  45054. res, err := c.doRequest("json")
  45055. if err != nil {
  45056. return err
  45057. }
  45058. defer googleapi.CloseBody(res)
  45059. if err := googleapi.CheckResponse(res); err != nil {
  45060. return err
  45061. }
  45062. return nil
  45063. // {
  45064. // "description": "Deletes an existing user role.",
  45065. // "httpMethod": "DELETE",
  45066. // "id": "dfareporting.userRoles.delete",
  45067. // "parameterOrder": [
  45068. // "profileId",
  45069. // "id"
  45070. // ],
  45071. // "parameters": {
  45072. // "id": {
  45073. // "description": "User role ID.",
  45074. // "format": "int64",
  45075. // "location": "path",
  45076. // "required": true,
  45077. // "type": "string"
  45078. // },
  45079. // "profileId": {
  45080. // "description": "User profile ID associated with this request.",
  45081. // "format": "int64",
  45082. // "location": "path",
  45083. // "required": true,
  45084. // "type": "string"
  45085. // }
  45086. // },
  45087. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45088. // "scopes": [
  45089. // "https://www.googleapis.com/auth/dfatrafficking"
  45090. // ]
  45091. // }
  45092. }
  45093. // method id "dfareporting.userRoles.get":
  45094. type UserRolesGetCall struct {
  45095. s *Service
  45096. profileId int64
  45097. id int64
  45098. urlParams_ gensupport.URLParams
  45099. ifNoneMatch_ string
  45100. ctx_ context.Context
  45101. header_ http.Header
  45102. }
  45103. // Get: Gets one user role by ID.
  45104. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  45105. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45106. c.profileId = profileId
  45107. c.id = id
  45108. return c
  45109. }
  45110. // Fields allows partial responses to be retrieved. See
  45111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45112. // for more information.
  45113. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  45114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45115. return c
  45116. }
  45117. // IfNoneMatch sets the optional parameter which makes the operation
  45118. // fail if the object's ETag matches the given value. This is useful for
  45119. // getting updates only after the object has changed since the last
  45120. // request. Use googleapi.IsNotModified to check whether the response
  45121. // error from Do is the result of In-None-Match.
  45122. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  45123. c.ifNoneMatch_ = entityTag
  45124. return c
  45125. }
  45126. // Context sets the context to be used in this call's Do method. Any
  45127. // pending HTTP request will be aborted if the provided context is
  45128. // canceled.
  45129. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  45130. c.ctx_ = ctx
  45131. return c
  45132. }
  45133. // Header returns an http.Header that can be modified by the caller to
  45134. // add HTTP headers to the request.
  45135. func (c *UserRolesGetCall) Header() http.Header {
  45136. if c.header_ == nil {
  45137. c.header_ = make(http.Header)
  45138. }
  45139. return c.header_
  45140. }
  45141. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  45142. reqHeaders := make(http.Header)
  45143. for k, v := range c.header_ {
  45144. reqHeaders[k] = v
  45145. }
  45146. reqHeaders.Set("User-Agent", c.s.userAgent())
  45147. if c.ifNoneMatch_ != "" {
  45148. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45149. }
  45150. var body io.Reader = nil
  45151. c.urlParams_.Set("alt", alt)
  45152. c.urlParams_.Set("prettyPrint", "false")
  45153. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  45154. urls += "?" + c.urlParams_.Encode()
  45155. req, err := http.NewRequest("GET", urls, body)
  45156. if err != nil {
  45157. return nil, err
  45158. }
  45159. req.Header = reqHeaders
  45160. googleapi.Expand(req.URL, map[string]string{
  45161. "profileId": strconv.FormatInt(c.profileId, 10),
  45162. "id": strconv.FormatInt(c.id, 10),
  45163. })
  45164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45165. }
  45166. // Do executes the "dfareporting.userRoles.get" call.
  45167. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45168. // code is an error. Response headers are in either
  45169. // *UserRole.ServerResponse.Header or (if a response was returned at
  45170. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45171. // to check whether the returned error was because
  45172. // http.StatusNotModified was returned.
  45173. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45174. gensupport.SetOptions(c.urlParams_, opts...)
  45175. res, err := c.doRequest("json")
  45176. if res != nil && res.StatusCode == http.StatusNotModified {
  45177. if res.Body != nil {
  45178. res.Body.Close()
  45179. }
  45180. return nil, &googleapi.Error{
  45181. Code: res.StatusCode,
  45182. Header: res.Header,
  45183. }
  45184. }
  45185. if err != nil {
  45186. return nil, err
  45187. }
  45188. defer googleapi.CloseBody(res)
  45189. if err := googleapi.CheckResponse(res); err != nil {
  45190. return nil, err
  45191. }
  45192. ret := &UserRole{
  45193. ServerResponse: googleapi.ServerResponse{
  45194. Header: res.Header,
  45195. HTTPStatusCode: res.StatusCode,
  45196. },
  45197. }
  45198. target := &ret
  45199. if err := gensupport.DecodeResponse(target, res); err != nil {
  45200. return nil, err
  45201. }
  45202. return ret, nil
  45203. // {
  45204. // "description": "Gets one user role by ID.",
  45205. // "httpMethod": "GET",
  45206. // "id": "dfareporting.userRoles.get",
  45207. // "parameterOrder": [
  45208. // "profileId",
  45209. // "id"
  45210. // ],
  45211. // "parameters": {
  45212. // "id": {
  45213. // "description": "User role ID.",
  45214. // "format": "int64",
  45215. // "location": "path",
  45216. // "required": true,
  45217. // "type": "string"
  45218. // },
  45219. // "profileId": {
  45220. // "description": "User profile ID associated with this request.",
  45221. // "format": "int64",
  45222. // "location": "path",
  45223. // "required": true,
  45224. // "type": "string"
  45225. // }
  45226. // },
  45227. // "path": "userprofiles/{profileId}/userRoles/{id}",
  45228. // "response": {
  45229. // "$ref": "UserRole"
  45230. // },
  45231. // "scopes": [
  45232. // "https://www.googleapis.com/auth/dfatrafficking"
  45233. // ]
  45234. // }
  45235. }
  45236. // method id "dfareporting.userRoles.insert":
  45237. type UserRolesInsertCall struct {
  45238. s *Service
  45239. profileId int64
  45240. userrole *UserRole
  45241. urlParams_ gensupport.URLParams
  45242. ctx_ context.Context
  45243. header_ http.Header
  45244. }
  45245. // Insert: Inserts a new user role.
  45246. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  45247. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45248. c.profileId = profileId
  45249. c.userrole = userrole
  45250. return c
  45251. }
  45252. // Fields allows partial responses to be retrieved. See
  45253. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45254. // for more information.
  45255. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  45256. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45257. return c
  45258. }
  45259. // Context sets the context to be used in this call's Do method. Any
  45260. // pending HTTP request will be aborted if the provided context is
  45261. // canceled.
  45262. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  45263. c.ctx_ = ctx
  45264. return c
  45265. }
  45266. // Header returns an http.Header that can be modified by the caller to
  45267. // add HTTP headers to the request.
  45268. func (c *UserRolesInsertCall) Header() http.Header {
  45269. if c.header_ == nil {
  45270. c.header_ = make(http.Header)
  45271. }
  45272. return c.header_
  45273. }
  45274. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  45275. reqHeaders := make(http.Header)
  45276. for k, v := range c.header_ {
  45277. reqHeaders[k] = v
  45278. }
  45279. reqHeaders.Set("User-Agent", c.s.userAgent())
  45280. var body io.Reader = nil
  45281. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45282. if err != nil {
  45283. return nil, err
  45284. }
  45285. reqHeaders.Set("Content-Type", "application/json")
  45286. c.urlParams_.Set("alt", alt)
  45287. c.urlParams_.Set("prettyPrint", "false")
  45288. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45289. urls += "?" + c.urlParams_.Encode()
  45290. req, err := http.NewRequest("POST", urls, body)
  45291. if err != nil {
  45292. return nil, err
  45293. }
  45294. req.Header = reqHeaders
  45295. googleapi.Expand(req.URL, map[string]string{
  45296. "profileId": strconv.FormatInt(c.profileId, 10),
  45297. })
  45298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45299. }
  45300. // Do executes the "dfareporting.userRoles.insert" call.
  45301. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45302. // code is an error. Response headers are in either
  45303. // *UserRole.ServerResponse.Header or (if a response was returned at
  45304. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45305. // to check whether the returned error was because
  45306. // http.StatusNotModified was returned.
  45307. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45308. gensupport.SetOptions(c.urlParams_, opts...)
  45309. res, err := c.doRequest("json")
  45310. if res != nil && res.StatusCode == http.StatusNotModified {
  45311. if res.Body != nil {
  45312. res.Body.Close()
  45313. }
  45314. return nil, &googleapi.Error{
  45315. Code: res.StatusCode,
  45316. Header: res.Header,
  45317. }
  45318. }
  45319. if err != nil {
  45320. return nil, err
  45321. }
  45322. defer googleapi.CloseBody(res)
  45323. if err := googleapi.CheckResponse(res); err != nil {
  45324. return nil, err
  45325. }
  45326. ret := &UserRole{
  45327. ServerResponse: googleapi.ServerResponse{
  45328. Header: res.Header,
  45329. HTTPStatusCode: res.StatusCode,
  45330. },
  45331. }
  45332. target := &ret
  45333. if err := gensupport.DecodeResponse(target, res); err != nil {
  45334. return nil, err
  45335. }
  45336. return ret, nil
  45337. // {
  45338. // "description": "Inserts a new user role.",
  45339. // "httpMethod": "POST",
  45340. // "id": "dfareporting.userRoles.insert",
  45341. // "parameterOrder": [
  45342. // "profileId"
  45343. // ],
  45344. // "parameters": {
  45345. // "profileId": {
  45346. // "description": "User profile ID associated with this request.",
  45347. // "format": "int64",
  45348. // "location": "path",
  45349. // "required": true,
  45350. // "type": "string"
  45351. // }
  45352. // },
  45353. // "path": "userprofiles/{profileId}/userRoles",
  45354. // "request": {
  45355. // "$ref": "UserRole"
  45356. // },
  45357. // "response": {
  45358. // "$ref": "UserRole"
  45359. // },
  45360. // "scopes": [
  45361. // "https://www.googleapis.com/auth/dfatrafficking"
  45362. // ]
  45363. // }
  45364. }
  45365. // method id "dfareporting.userRoles.list":
  45366. type UserRolesListCall struct {
  45367. s *Service
  45368. profileId int64
  45369. urlParams_ gensupport.URLParams
  45370. ifNoneMatch_ string
  45371. ctx_ context.Context
  45372. header_ http.Header
  45373. }
  45374. // List: Retrieves a list of user roles, possibly filtered. This method
  45375. // supports paging.
  45376. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  45377. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45378. c.profileId = profileId
  45379. return c
  45380. }
  45381. // AccountUserRoleOnly sets the optional parameter
  45382. // "accountUserRoleOnly": Select only account level user roles not
  45383. // associated with any specific subaccount.
  45384. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  45385. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  45386. return c
  45387. }
  45388. // Ids sets the optional parameter "ids": Select only user roles with
  45389. // the specified IDs.
  45390. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  45391. var ids_ []string
  45392. for _, v := range ids {
  45393. ids_ = append(ids_, fmt.Sprint(v))
  45394. }
  45395. c.urlParams_.SetMulti("ids", ids_)
  45396. return c
  45397. }
  45398. // MaxResults sets the optional parameter "maxResults": Maximum number
  45399. // of results to return.
  45400. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  45401. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  45402. return c
  45403. }
  45404. // PageToken sets the optional parameter "pageToken": Value of the
  45405. // nextPageToken from the previous result page.
  45406. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  45407. c.urlParams_.Set("pageToken", pageToken)
  45408. return c
  45409. }
  45410. // SearchString sets the optional parameter "searchString": Allows
  45411. // searching for objects by name or ID. Wildcards (*) are allowed. For
  45412. // example, "userrole*2015" will return objects with names like
  45413. // "userrole June 2015", "userrole April 2015", or simply "userrole
  45414. // 2015". Most of the searches also add wildcards implicitly at the
  45415. // start and the end of the search string. For example, a search string
  45416. // of "userrole" will match objects with name "my userrole", "userrole
  45417. // 2015", or simply "userrole".
  45418. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  45419. c.urlParams_.Set("searchString", searchString)
  45420. return c
  45421. }
  45422. // SortField sets the optional parameter "sortField": Field by which to
  45423. // sort the list.
  45424. //
  45425. // Possible values:
  45426. // "ID" (default)
  45427. // "NAME"
  45428. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  45429. c.urlParams_.Set("sortField", sortField)
  45430. return c
  45431. }
  45432. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  45433. // results.
  45434. //
  45435. // Possible values:
  45436. // "ASCENDING" (default)
  45437. // "DESCENDING"
  45438. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  45439. c.urlParams_.Set("sortOrder", sortOrder)
  45440. return c
  45441. }
  45442. // SubaccountId sets the optional parameter "subaccountId": Select only
  45443. // user roles that belong to this subaccount.
  45444. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  45445. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  45446. return c
  45447. }
  45448. // Fields allows partial responses to be retrieved. See
  45449. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45450. // for more information.
  45451. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  45452. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45453. return c
  45454. }
  45455. // IfNoneMatch sets the optional parameter which makes the operation
  45456. // fail if the object's ETag matches the given value. This is useful for
  45457. // getting updates only after the object has changed since the last
  45458. // request. Use googleapi.IsNotModified to check whether the response
  45459. // error from Do is the result of In-None-Match.
  45460. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  45461. c.ifNoneMatch_ = entityTag
  45462. return c
  45463. }
  45464. // Context sets the context to be used in this call's Do method. Any
  45465. // pending HTTP request will be aborted if the provided context is
  45466. // canceled.
  45467. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  45468. c.ctx_ = ctx
  45469. return c
  45470. }
  45471. // Header returns an http.Header that can be modified by the caller to
  45472. // add HTTP headers to the request.
  45473. func (c *UserRolesListCall) Header() http.Header {
  45474. if c.header_ == nil {
  45475. c.header_ = make(http.Header)
  45476. }
  45477. return c.header_
  45478. }
  45479. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  45480. reqHeaders := make(http.Header)
  45481. for k, v := range c.header_ {
  45482. reqHeaders[k] = v
  45483. }
  45484. reqHeaders.Set("User-Agent", c.s.userAgent())
  45485. if c.ifNoneMatch_ != "" {
  45486. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45487. }
  45488. var body io.Reader = nil
  45489. c.urlParams_.Set("alt", alt)
  45490. c.urlParams_.Set("prettyPrint", "false")
  45491. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45492. urls += "?" + c.urlParams_.Encode()
  45493. req, err := http.NewRequest("GET", urls, body)
  45494. if err != nil {
  45495. return nil, err
  45496. }
  45497. req.Header = reqHeaders
  45498. googleapi.Expand(req.URL, map[string]string{
  45499. "profileId": strconv.FormatInt(c.profileId, 10),
  45500. })
  45501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45502. }
  45503. // Do executes the "dfareporting.userRoles.list" call.
  45504. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  45505. // non-2xx status code is an error. Response headers are in either
  45506. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  45507. // returned at all) in error.(*googleapi.Error).Header. Use
  45508. // googleapi.IsNotModified to check whether the returned error was
  45509. // because http.StatusNotModified was returned.
  45510. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  45511. gensupport.SetOptions(c.urlParams_, opts...)
  45512. res, err := c.doRequest("json")
  45513. if res != nil && res.StatusCode == http.StatusNotModified {
  45514. if res.Body != nil {
  45515. res.Body.Close()
  45516. }
  45517. return nil, &googleapi.Error{
  45518. Code: res.StatusCode,
  45519. Header: res.Header,
  45520. }
  45521. }
  45522. if err != nil {
  45523. return nil, err
  45524. }
  45525. defer googleapi.CloseBody(res)
  45526. if err := googleapi.CheckResponse(res); err != nil {
  45527. return nil, err
  45528. }
  45529. ret := &UserRolesListResponse{
  45530. ServerResponse: googleapi.ServerResponse{
  45531. Header: res.Header,
  45532. HTTPStatusCode: res.StatusCode,
  45533. },
  45534. }
  45535. target := &ret
  45536. if err := gensupport.DecodeResponse(target, res); err != nil {
  45537. return nil, err
  45538. }
  45539. return ret, nil
  45540. // {
  45541. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  45542. // "httpMethod": "GET",
  45543. // "id": "dfareporting.userRoles.list",
  45544. // "parameterOrder": [
  45545. // "profileId"
  45546. // ],
  45547. // "parameters": {
  45548. // "accountUserRoleOnly": {
  45549. // "description": "Select only account level user roles not associated with any specific subaccount.",
  45550. // "location": "query",
  45551. // "type": "boolean"
  45552. // },
  45553. // "ids": {
  45554. // "description": "Select only user roles with the specified IDs.",
  45555. // "format": "int64",
  45556. // "location": "query",
  45557. // "repeated": true,
  45558. // "type": "string"
  45559. // },
  45560. // "maxResults": {
  45561. // "default": "1000",
  45562. // "description": "Maximum number of results to return.",
  45563. // "format": "int32",
  45564. // "location": "query",
  45565. // "maximum": "1000",
  45566. // "minimum": "0",
  45567. // "type": "integer"
  45568. // },
  45569. // "pageToken": {
  45570. // "description": "Value of the nextPageToken from the previous result page.",
  45571. // "location": "query",
  45572. // "type": "string"
  45573. // },
  45574. // "profileId": {
  45575. // "description": "User profile ID associated with this request.",
  45576. // "format": "int64",
  45577. // "location": "path",
  45578. // "required": true,
  45579. // "type": "string"
  45580. // },
  45581. // "searchString": {
  45582. // "description": "Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, \"userrole*2015\" will return objects with names like \"userrole June 2015\", \"userrole April 2015\", or simply \"userrole 2015\". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of \"userrole\" will match objects with name \"my userrole\", \"userrole 2015\", or simply \"userrole\".",
  45583. // "location": "query",
  45584. // "type": "string"
  45585. // },
  45586. // "sortField": {
  45587. // "default": "ID",
  45588. // "description": "Field by which to sort the list.",
  45589. // "enum": [
  45590. // "ID",
  45591. // "NAME"
  45592. // ],
  45593. // "enumDescriptions": [
  45594. // "",
  45595. // ""
  45596. // ],
  45597. // "location": "query",
  45598. // "type": "string"
  45599. // },
  45600. // "sortOrder": {
  45601. // "default": "ASCENDING",
  45602. // "description": "Order of sorted results.",
  45603. // "enum": [
  45604. // "ASCENDING",
  45605. // "DESCENDING"
  45606. // ],
  45607. // "enumDescriptions": [
  45608. // "",
  45609. // ""
  45610. // ],
  45611. // "location": "query",
  45612. // "type": "string"
  45613. // },
  45614. // "subaccountId": {
  45615. // "description": "Select only user roles that belong to this subaccount.",
  45616. // "format": "int64",
  45617. // "location": "query",
  45618. // "type": "string"
  45619. // }
  45620. // },
  45621. // "path": "userprofiles/{profileId}/userRoles",
  45622. // "response": {
  45623. // "$ref": "UserRolesListResponse"
  45624. // },
  45625. // "scopes": [
  45626. // "https://www.googleapis.com/auth/dfatrafficking"
  45627. // ]
  45628. // }
  45629. }
  45630. // Pages invokes f for each page of results.
  45631. // A non-nil error returned from f will halt the iteration.
  45632. // The provided context supersedes any context provided to the Context method.
  45633. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  45634. c.ctx_ = ctx
  45635. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  45636. for {
  45637. x, err := c.Do()
  45638. if err != nil {
  45639. return err
  45640. }
  45641. if err := f(x); err != nil {
  45642. return err
  45643. }
  45644. if x.NextPageToken == "" {
  45645. return nil
  45646. }
  45647. c.PageToken(x.NextPageToken)
  45648. }
  45649. }
  45650. // method id "dfareporting.userRoles.patch":
  45651. type UserRolesPatchCall struct {
  45652. s *Service
  45653. profileId int64
  45654. userrole *UserRole
  45655. urlParams_ gensupport.URLParams
  45656. ctx_ context.Context
  45657. header_ http.Header
  45658. }
  45659. // Patch: Updates an existing user role. This method supports patch
  45660. // semantics.
  45661. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  45662. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45663. c.profileId = profileId
  45664. c.urlParams_.Set("id", fmt.Sprint(id))
  45665. c.userrole = userrole
  45666. return c
  45667. }
  45668. // Fields allows partial responses to be retrieved. See
  45669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45670. // for more information.
  45671. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  45672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45673. return c
  45674. }
  45675. // Context sets the context to be used in this call's Do method. Any
  45676. // pending HTTP request will be aborted if the provided context is
  45677. // canceled.
  45678. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  45679. c.ctx_ = ctx
  45680. return c
  45681. }
  45682. // Header returns an http.Header that can be modified by the caller to
  45683. // add HTTP headers to the request.
  45684. func (c *UserRolesPatchCall) Header() http.Header {
  45685. if c.header_ == nil {
  45686. c.header_ = make(http.Header)
  45687. }
  45688. return c.header_
  45689. }
  45690. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  45691. reqHeaders := make(http.Header)
  45692. for k, v := range c.header_ {
  45693. reqHeaders[k] = v
  45694. }
  45695. reqHeaders.Set("User-Agent", c.s.userAgent())
  45696. var body io.Reader = nil
  45697. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45698. if err != nil {
  45699. return nil, err
  45700. }
  45701. reqHeaders.Set("Content-Type", "application/json")
  45702. c.urlParams_.Set("alt", alt)
  45703. c.urlParams_.Set("prettyPrint", "false")
  45704. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45705. urls += "?" + c.urlParams_.Encode()
  45706. req, err := http.NewRequest("PATCH", urls, body)
  45707. if err != nil {
  45708. return nil, err
  45709. }
  45710. req.Header = reqHeaders
  45711. googleapi.Expand(req.URL, map[string]string{
  45712. "profileId": strconv.FormatInt(c.profileId, 10),
  45713. })
  45714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45715. }
  45716. // Do executes the "dfareporting.userRoles.patch" call.
  45717. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45718. // code is an error. Response headers are in either
  45719. // *UserRole.ServerResponse.Header or (if a response was returned at
  45720. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45721. // to check whether the returned error was because
  45722. // http.StatusNotModified was returned.
  45723. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45724. gensupport.SetOptions(c.urlParams_, opts...)
  45725. res, err := c.doRequest("json")
  45726. if res != nil && res.StatusCode == http.StatusNotModified {
  45727. if res.Body != nil {
  45728. res.Body.Close()
  45729. }
  45730. return nil, &googleapi.Error{
  45731. Code: res.StatusCode,
  45732. Header: res.Header,
  45733. }
  45734. }
  45735. if err != nil {
  45736. return nil, err
  45737. }
  45738. defer googleapi.CloseBody(res)
  45739. if err := googleapi.CheckResponse(res); err != nil {
  45740. return nil, err
  45741. }
  45742. ret := &UserRole{
  45743. ServerResponse: googleapi.ServerResponse{
  45744. Header: res.Header,
  45745. HTTPStatusCode: res.StatusCode,
  45746. },
  45747. }
  45748. target := &ret
  45749. if err := gensupport.DecodeResponse(target, res); err != nil {
  45750. return nil, err
  45751. }
  45752. return ret, nil
  45753. // {
  45754. // "description": "Updates an existing user role. This method supports patch semantics.",
  45755. // "httpMethod": "PATCH",
  45756. // "id": "dfareporting.userRoles.patch",
  45757. // "parameterOrder": [
  45758. // "profileId",
  45759. // "id"
  45760. // ],
  45761. // "parameters": {
  45762. // "id": {
  45763. // "description": "User role ID.",
  45764. // "format": "int64",
  45765. // "location": "query",
  45766. // "required": true,
  45767. // "type": "string"
  45768. // },
  45769. // "profileId": {
  45770. // "description": "User profile ID associated with this request.",
  45771. // "format": "int64",
  45772. // "location": "path",
  45773. // "required": true,
  45774. // "type": "string"
  45775. // }
  45776. // },
  45777. // "path": "userprofiles/{profileId}/userRoles",
  45778. // "request": {
  45779. // "$ref": "UserRole"
  45780. // },
  45781. // "response": {
  45782. // "$ref": "UserRole"
  45783. // },
  45784. // "scopes": [
  45785. // "https://www.googleapis.com/auth/dfatrafficking"
  45786. // ]
  45787. // }
  45788. }
  45789. // method id "dfareporting.userRoles.update":
  45790. type UserRolesUpdateCall struct {
  45791. s *Service
  45792. profileId int64
  45793. userrole *UserRole
  45794. urlParams_ gensupport.URLParams
  45795. ctx_ context.Context
  45796. header_ http.Header
  45797. }
  45798. // Update: Updates an existing user role.
  45799. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  45800. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45801. c.profileId = profileId
  45802. c.userrole = userrole
  45803. return c
  45804. }
  45805. // Fields allows partial responses to be retrieved. See
  45806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45807. // for more information.
  45808. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  45809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45810. return c
  45811. }
  45812. // Context sets the context to be used in this call's Do method. Any
  45813. // pending HTTP request will be aborted if the provided context is
  45814. // canceled.
  45815. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  45816. c.ctx_ = ctx
  45817. return c
  45818. }
  45819. // Header returns an http.Header that can be modified by the caller to
  45820. // add HTTP headers to the request.
  45821. func (c *UserRolesUpdateCall) Header() http.Header {
  45822. if c.header_ == nil {
  45823. c.header_ = make(http.Header)
  45824. }
  45825. return c.header_
  45826. }
  45827. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  45828. reqHeaders := make(http.Header)
  45829. for k, v := range c.header_ {
  45830. reqHeaders[k] = v
  45831. }
  45832. reqHeaders.Set("User-Agent", c.s.userAgent())
  45833. var body io.Reader = nil
  45834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45835. if err != nil {
  45836. return nil, err
  45837. }
  45838. reqHeaders.Set("Content-Type", "application/json")
  45839. c.urlParams_.Set("alt", alt)
  45840. c.urlParams_.Set("prettyPrint", "false")
  45841. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45842. urls += "?" + c.urlParams_.Encode()
  45843. req, err := http.NewRequest("PUT", urls, body)
  45844. if err != nil {
  45845. return nil, err
  45846. }
  45847. req.Header = reqHeaders
  45848. googleapi.Expand(req.URL, map[string]string{
  45849. "profileId": strconv.FormatInt(c.profileId, 10),
  45850. })
  45851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45852. }
  45853. // Do executes the "dfareporting.userRoles.update" call.
  45854. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45855. // code is an error. Response headers are in either
  45856. // *UserRole.ServerResponse.Header or (if a response was returned at
  45857. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45858. // to check whether the returned error was because
  45859. // http.StatusNotModified was returned.
  45860. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45861. gensupport.SetOptions(c.urlParams_, opts...)
  45862. res, err := c.doRequest("json")
  45863. if res != nil && res.StatusCode == http.StatusNotModified {
  45864. if res.Body != nil {
  45865. res.Body.Close()
  45866. }
  45867. return nil, &googleapi.Error{
  45868. Code: res.StatusCode,
  45869. Header: res.Header,
  45870. }
  45871. }
  45872. if err != nil {
  45873. return nil, err
  45874. }
  45875. defer googleapi.CloseBody(res)
  45876. if err := googleapi.CheckResponse(res); err != nil {
  45877. return nil, err
  45878. }
  45879. ret := &UserRole{
  45880. ServerResponse: googleapi.ServerResponse{
  45881. Header: res.Header,
  45882. HTTPStatusCode: res.StatusCode,
  45883. },
  45884. }
  45885. target := &ret
  45886. if err := gensupport.DecodeResponse(target, res); err != nil {
  45887. return nil, err
  45888. }
  45889. return ret, nil
  45890. // {
  45891. // "description": "Updates an existing user role.",
  45892. // "httpMethod": "PUT",
  45893. // "id": "dfareporting.userRoles.update",
  45894. // "parameterOrder": [
  45895. // "profileId"
  45896. // ],
  45897. // "parameters": {
  45898. // "profileId": {
  45899. // "description": "User profile ID associated with this request.",
  45900. // "format": "int64",
  45901. // "location": "path",
  45902. // "required": true,
  45903. // "type": "string"
  45904. // }
  45905. // },
  45906. // "path": "userprofiles/{profileId}/userRoles",
  45907. // "request": {
  45908. // "$ref": "UserRole"
  45909. // },
  45910. // "response": {
  45911. // "$ref": "UserRole"
  45912. // },
  45913. // "scopes": [
  45914. // "https://www.googleapis.com/auth/dfatrafficking"
  45915. // ]
  45916. // }
  45917. }
  45918. // method id "dfareporting.videoFormats.get":
  45919. type VideoFormatsGetCall struct {
  45920. s *Service
  45921. profileId int64
  45922. id int64
  45923. urlParams_ gensupport.URLParams
  45924. ifNoneMatch_ string
  45925. ctx_ context.Context
  45926. header_ http.Header
  45927. }
  45928. // Get: Gets one video format by ID.
  45929. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  45930. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45931. c.profileId = profileId
  45932. c.id = id
  45933. return c
  45934. }
  45935. // Fields allows partial responses to be retrieved. See
  45936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45937. // for more information.
  45938. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  45939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45940. return c
  45941. }
  45942. // IfNoneMatch sets the optional parameter which makes the operation
  45943. // fail if the object's ETag matches the given value. This is useful for
  45944. // getting updates only after the object has changed since the last
  45945. // request. Use googleapi.IsNotModified to check whether the response
  45946. // error from Do is the result of In-None-Match.
  45947. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  45948. c.ifNoneMatch_ = entityTag
  45949. return c
  45950. }
  45951. // Context sets the context to be used in this call's Do method. Any
  45952. // pending HTTP request will be aborted if the provided context is
  45953. // canceled.
  45954. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  45955. c.ctx_ = ctx
  45956. return c
  45957. }
  45958. // Header returns an http.Header that can be modified by the caller to
  45959. // add HTTP headers to the request.
  45960. func (c *VideoFormatsGetCall) Header() http.Header {
  45961. if c.header_ == nil {
  45962. c.header_ = make(http.Header)
  45963. }
  45964. return c.header_
  45965. }
  45966. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  45967. reqHeaders := make(http.Header)
  45968. for k, v := range c.header_ {
  45969. reqHeaders[k] = v
  45970. }
  45971. reqHeaders.Set("User-Agent", c.s.userAgent())
  45972. if c.ifNoneMatch_ != "" {
  45973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45974. }
  45975. var body io.Reader = nil
  45976. c.urlParams_.Set("alt", alt)
  45977. c.urlParams_.Set("prettyPrint", "false")
  45978. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  45979. urls += "?" + c.urlParams_.Encode()
  45980. req, err := http.NewRequest("GET", urls, body)
  45981. if err != nil {
  45982. return nil, err
  45983. }
  45984. req.Header = reqHeaders
  45985. googleapi.Expand(req.URL, map[string]string{
  45986. "profileId": strconv.FormatInt(c.profileId, 10),
  45987. "id": strconv.FormatInt(c.id, 10),
  45988. })
  45989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45990. }
  45991. // Do executes the "dfareporting.videoFormats.get" call.
  45992. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  45993. // status code is an error. Response headers are in either
  45994. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  45995. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45996. // to check whether the returned error was because
  45997. // http.StatusNotModified was returned.
  45998. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  45999. gensupport.SetOptions(c.urlParams_, opts...)
  46000. res, err := c.doRequest("json")
  46001. if res != nil && res.StatusCode == http.StatusNotModified {
  46002. if res.Body != nil {
  46003. res.Body.Close()
  46004. }
  46005. return nil, &googleapi.Error{
  46006. Code: res.StatusCode,
  46007. Header: res.Header,
  46008. }
  46009. }
  46010. if err != nil {
  46011. return nil, err
  46012. }
  46013. defer googleapi.CloseBody(res)
  46014. if err := googleapi.CheckResponse(res); err != nil {
  46015. return nil, err
  46016. }
  46017. ret := &VideoFormat{
  46018. ServerResponse: googleapi.ServerResponse{
  46019. Header: res.Header,
  46020. HTTPStatusCode: res.StatusCode,
  46021. },
  46022. }
  46023. target := &ret
  46024. if err := gensupport.DecodeResponse(target, res); err != nil {
  46025. return nil, err
  46026. }
  46027. return ret, nil
  46028. // {
  46029. // "description": "Gets one video format by ID.",
  46030. // "httpMethod": "GET",
  46031. // "id": "dfareporting.videoFormats.get",
  46032. // "parameterOrder": [
  46033. // "profileId",
  46034. // "id"
  46035. // ],
  46036. // "parameters": {
  46037. // "id": {
  46038. // "description": "Video format ID.",
  46039. // "format": "int32",
  46040. // "location": "path",
  46041. // "required": true,
  46042. // "type": "integer"
  46043. // },
  46044. // "profileId": {
  46045. // "description": "User profile ID associated with this request.",
  46046. // "format": "int64",
  46047. // "location": "path",
  46048. // "required": true,
  46049. // "type": "string"
  46050. // }
  46051. // },
  46052. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  46053. // "response": {
  46054. // "$ref": "VideoFormat"
  46055. // },
  46056. // "scopes": [
  46057. // "https://www.googleapis.com/auth/dfatrafficking"
  46058. // ]
  46059. // }
  46060. }
  46061. // method id "dfareporting.videoFormats.list":
  46062. type VideoFormatsListCall struct {
  46063. s *Service
  46064. profileId int64
  46065. urlParams_ gensupport.URLParams
  46066. ifNoneMatch_ string
  46067. ctx_ context.Context
  46068. header_ http.Header
  46069. }
  46070. // List: Lists available video formats.
  46071. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  46072. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  46073. c.profileId = profileId
  46074. return c
  46075. }
  46076. // Fields allows partial responses to be retrieved. See
  46077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  46078. // for more information.
  46079. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  46080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  46081. return c
  46082. }
  46083. // IfNoneMatch sets the optional parameter which makes the operation
  46084. // fail if the object's ETag matches the given value. This is useful for
  46085. // getting updates only after the object has changed since the last
  46086. // request. Use googleapi.IsNotModified to check whether the response
  46087. // error from Do is the result of In-None-Match.
  46088. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  46089. c.ifNoneMatch_ = entityTag
  46090. return c
  46091. }
  46092. // Context sets the context to be used in this call's Do method. Any
  46093. // pending HTTP request will be aborted if the provided context is
  46094. // canceled.
  46095. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  46096. c.ctx_ = ctx
  46097. return c
  46098. }
  46099. // Header returns an http.Header that can be modified by the caller to
  46100. // add HTTP headers to the request.
  46101. func (c *VideoFormatsListCall) Header() http.Header {
  46102. if c.header_ == nil {
  46103. c.header_ = make(http.Header)
  46104. }
  46105. return c.header_
  46106. }
  46107. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  46108. reqHeaders := make(http.Header)
  46109. for k, v := range c.header_ {
  46110. reqHeaders[k] = v
  46111. }
  46112. reqHeaders.Set("User-Agent", c.s.userAgent())
  46113. if c.ifNoneMatch_ != "" {
  46114. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  46115. }
  46116. var body io.Reader = nil
  46117. c.urlParams_.Set("alt", alt)
  46118. c.urlParams_.Set("prettyPrint", "false")
  46119. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  46120. urls += "?" + c.urlParams_.Encode()
  46121. req, err := http.NewRequest("GET", urls, body)
  46122. if err != nil {
  46123. return nil, err
  46124. }
  46125. req.Header = reqHeaders
  46126. googleapi.Expand(req.URL, map[string]string{
  46127. "profileId": strconv.FormatInt(c.profileId, 10),
  46128. })
  46129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  46130. }
  46131. // Do executes the "dfareporting.videoFormats.list" call.
  46132. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  46133. // Any non-2xx status code is an error. Response headers are in either
  46134. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  46135. // returned at all) in error.(*googleapi.Error).Header. Use
  46136. // googleapi.IsNotModified to check whether the returned error was
  46137. // because http.StatusNotModified was returned.
  46138. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  46139. gensupport.SetOptions(c.urlParams_, opts...)
  46140. res, err := c.doRequest("json")
  46141. if res != nil && res.StatusCode == http.StatusNotModified {
  46142. if res.Body != nil {
  46143. res.Body.Close()
  46144. }
  46145. return nil, &googleapi.Error{
  46146. Code: res.StatusCode,
  46147. Header: res.Header,
  46148. }
  46149. }
  46150. if err != nil {
  46151. return nil, err
  46152. }
  46153. defer googleapi.CloseBody(res)
  46154. if err := googleapi.CheckResponse(res); err != nil {
  46155. return nil, err
  46156. }
  46157. ret := &VideoFormatsListResponse{
  46158. ServerResponse: googleapi.ServerResponse{
  46159. Header: res.Header,
  46160. HTTPStatusCode: res.StatusCode,
  46161. },
  46162. }
  46163. target := &ret
  46164. if err := gensupport.DecodeResponse(target, res); err != nil {
  46165. return nil, err
  46166. }
  46167. return ret, nil
  46168. // {
  46169. // "description": "Lists available video formats.",
  46170. // "httpMethod": "GET",
  46171. // "id": "dfareporting.videoFormats.list",
  46172. // "parameterOrder": [
  46173. // "profileId"
  46174. // ],
  46175. // "parameters": {
  46176. // "profileId": {
  46177. // "description": "User profile ID associated with this request.",
  46178. // "format": "int64",
  46179. // "location": "path",
  46180. // "required": true,
  46181. // "type": "string"
  46182. // }
  46183. // },
  46184. // "path": "userprofiles/{profileId}/videoFormats",
  46185. // "response": {
  46186. // "$ref": "VideoFormatsListResponse"
  46187. // },
  46188. // "scopes": [
  46189. // "https://www.googleapis.com/auth/dfatrafficking"
  46190. // ]
  46191. // }
  46192. }